/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@mescius/wijmo.vue2.grid@5.20261.50/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
﻿/*!
    *
    * Wijmo Library 5.20261.50
    * https://developer.mescius.com/wijmo
    *
    * Copyright(c) MESCIUS inc. All rights reserved.
    *
    * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
    * us.sales@mescius.com
    * https://developer.mescius.com/wijmo/licensing
    *
    */

"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__rest=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&(r[o[i]]=e[o[i]])}return r},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_vue2_base_1=require("@mescius/wijmo.vue2.base"),wjcCore=__importStar(require("@mescius/wijmo")),wjcGrid=__importStar(require("@mescius/wijmo.grid")),wjcInteropGrid=__importStar(require("@mescius/wijmo.interop.grid"));exports.CellTemplateType=wjcInteropGrid.GridCellTemplateType;var WjFlexGridBehavior=function(e){__extends(WjFlexGridBehavior,e);function WjFlexGridBehavior(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridBehavior.prototype._createControl=function(){var t=e.prototype._createControl.call(this);new DirectiveCellFactory(t);return t};WjFlexGridBehavior.tag="wj-flex-grid";WjFlexGridBehavior.props=["isDisabled","tabOrder","newRowAtTop","allowAddNew","allowDelete","allowDragging","allowMerging","allowResizing","allowSorting","allowPinning","autoScroll","autoRowHeights","autoSizeMode","autoGenerateColumns","autoSearch","caseSensitiveSearch","quickAutoSize","bigCheckboxes","childItemsPath","groupHeaderFormat","headersVisibility","showSelectedHeaders","showMarquee","showPlaceholders","itemFormatter","isReadOnly","imeEnabled","mergeManager","selectionMode","showGroups","showSort","showDropDown","showAlternatingRows","showErrors","alternatingRowStep","itemValidator","validateEdits","treeIndent","itemsSource","autoClipboard","expandSelectionOnCopyPaste","frozenRows","frozenColumns","cloneFrozenCells","deferResizing","sortRowIndex","editColumnIndex","stickyHeaders","preserveSelectedState","preserveOutlineState","preserveWhiteSpace","keyActionTab","keyActionEnter","rowHeaderPath","virtualizationThreshold","anchorCursor","lazyRender","refreshOnEdit","copyHeaders","columnGroups","commitEmptyEdits","headersFocusability","ariaLabel","skipMerged","pasteEmptyCells","groupSummaryPosition","frozenCells","sortOrder","noDataOverlayContent"];WjFlexGridBehavior.events=["initialized","gotFocus","lostFocus","refreshing","refreshed","invalidInput","beginningEdit","cellEditEnded","cellEditEnding","prepareCellForEdit","formatItem","resizingColumn","resizedColumn","autoSizingColumn","autoSizedColumn","draggingColumn","draggingColumnOver","draggedColumn","sortingColumn","sortedColumn","pinningColumn","pinnedColumn","resizingRow","resizedRow","autoSizingRow","autoSizedRow","draggingRow","draggingRowOver","draggedRow","deletingRow","deletedRow","loadingRows","loadedRows","rowEditStarting","rowEditStarted","rowEditEnding","rowEditEnded","rowAdded","groupCollapsedChanging","groupCollapsedChanged","columnGroupCollapsedChanging","columnGroupCollapsedChanged","itemsSourceChanging","itemsSourceChanged","selectionChanging","selectionChanged","scrollPositionChanged","updatingView","updatedView","updatingLayout","updatedLayout","pasting","pasted","pastingCell","pastedCell","copying","copied","gettingCellClipString"];WjFlexGridBehavior.classCtor=function(){return wjcGrid.FlexGrid};return WjFlexGridBehavior}(wijmo_vue2_base_1.WjComponentBehavior);exports.WjFlexGrid=WjFlexGridBehavior.register();function registerV3WjFlexGrid(e){e.component(WjFlexGridBehavior.tag,exports.WjFlexGrid)}var WjFlexGridColumnBehavior=function(e){__extends(WjFlexGridColumnBehavior,e);function WjFlexGridColumnBehavior(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridColumnBehavior.prototype._initParent=function(){var t=this.parent.control;if(t.autoGenerateColumns){t.autoGenerateColumns=!1;t.columns.clear()}e.prototype._initParent.call(this)};WjFlexGridColumnBehavior.tag="wj-flex-grid-column";WjFlexGridColumnBehavior.parentProp="columns";WjFlexGridColumnBehavior.props=["wjProperty","name","dataMap","dataType","binding","sortMemberPath","format","cellTemplate","header","width","maxLength","minWidth","maxWidth","align","allowDragging","allowSorting","allowResizing","allowMerging","aggregate","isReadOnly","cssClass","cssClassAll","isContentHtml","isSelected","visible","wordWrap","multiLine","mask","inputType","isRequired","showDropDown","dataMapEditor","dropDownCssClass","quickAutoSize","editor","placeholder","sortOrder"];WjFlexGridColumnBehavior.events=["initialized"];WjFlexGridColumnBehavior.changeEvents={"grid.selectionChanged":["isSelected"]};WjFlexGridColumnBehavior.classCtor=function(){return wjcGrid.Column};return WjFlexGridColumnBehavior}(wijmo_vue2_base_1.WjComponentBehavior);exports.WjFlexGridColumn=WjFlexGridColumnBehavior.register();function registerV3WjFlexGridColumn(e){e.component(WjFlexGridColumnBehavior.tag,exports.WjFlexGridColumn)}var WjFlexGridColumnGroupBehavior=function(e){__extends(WjFlexGridColumnGroupBehavior,e);function WjFlexGridColumnGroupBehavior(){return null!==e&&e.apply(this,arguments)||this}WjFlexGridColumnGroupBehavior.tag="wj-flex-grid-column-group";WjFlexGridColumnGroupBehavior.parentProp="columnGroups";WjFlexGridColumnGroupBehavior.props=["wjProperty","name","dataMap","dataType","binding","sortMemberPath","format","cellTemplate","header","width","maxLength","minWidth","maxWidth","align","allowDragging","allowSorting","allowResizing","allowMerging","aggregate","isReadOnly","cssClass","cssClassAll","isContentHtml","isSelected","visible","wordWrap","multiLine","mask","inputType","isRequired","showDropDown","dataMapEditor","dropDownCssClass","quickAutoSize","editor","placeholder","collapseTo","isCollapsed","height","sortOrder"];WjFlexGridColumnGroupBehavior.events=["initialized"];WjFlexGridColumnGroupBehavior.changeEvents={"grid.selectionChanged":["isSelected"]};WjFlexGridColumnGroupBehavior.classCtor=function(){return wjcGrid.ColumnGroup};return WjFlexGridColumnGroupBehavior}(wijmo_vue2_base_1.WjComponentBehavior);exports.WjFlexGridColumnGroup=WjFlexGridColumnGroupBehavior.register();function registerV3WjFlexGridColumnGroup(e){e.component(WjFlexGridColumnGroupBehavior.tag,exports.WjFlexGridColumnGroup)}var DirectiveCellFactory=function(e){__extends(DirectiveCellFactory,e);function DirectiveCellFactory(){return null!==e&&e.apply(this,arguments)||this}DirectiveCellFactory.prototype.shouldInstantiate=function(e){var t=e.templateCache;return null==t||t.column!==e.column||!t.cellCmp||t.templateContextProperty!==e.templateContextProperty||e.cell.firstChild!=t.rootElement};DirectiveCellFactory.prototype.renderTemplate=function(e,t){var r=e.row,o={},i=e.templateContext;e.cellBindingsData=this.setBindingsData(o,r,e.column,r.dataItem,e.cellValue,i.valuePaths);e.cellBindingsData.localVars.valueFormatted=e.cellValueFormatted;if(t){var l=e.cell,n=i._instantiateTemplate(l,o.cell);e.templateCache={column:e.column,rootElement:n.$el,templateContextProperty:e.templateContextProperty,cellCmp:n};var a=e.templateCache;l[e.templateContextProperty]=a}else{var s=e.templateCache.cellCmp;s.context=o.cell;s.$forceUpdate()}};DirectiveCellFactory.prototype.disposeTemplate=function(t,r,o){var i=r&&r.cellCmp;if(i){i.$destroy();r.cellCmp=null;e.prototype.disposeTemplate.call(this,t,r,o)}};DirectiveCellFactory.prototype.clearCell=function(e){e.textContent=""};DirectiveCellFactory.prototype.applyImmediately=function(e){if(!wijmo_vue2_base_1.VueApi.isV3Plus){var t=e.templateCache.cellCmp._watcher;t&&"function"==typeof t.run&&t.run()}};DirectiveCellFactory.prototype.flushPendingEvents=function(e){};DirectiveCellFactory.prototype.getEditorFocusFlag=function(){return!0};DirectiveCellFactory.prototype.setEditorFocusFlag=function(e){};return DirectiveCellFactory}(wjcInteropGrid.DirectiveCellFactoryBase);exports.DirectiveCellFactory=DirectiveCellFactory;exports.WjFlexGridCellTemplateDefinition={props:{cellOverflow:{default:void 0},cellType:{default:void 0},autoSizeRows:{default:!0},forceFullEdit:{default:!0}},render:function(e){return wijmo_vue2_base_1.VueApi.isV3Plus?wijmo_vue2_base_1.VueApi.h("div"):e("div")},mounted:function(){var e=this,t=this.$parent;if(t){var r=t[wijmo_vue2_base_1.WjComponentBehavior._behProp];r._mountedCB((function(){e.ownerControl=r.control;var o=e.ownerControl;if(o instanceof wjcGrid.FlexGrid)e.grid=o;else if(o instanceof wjcGrid.Column){e.column=o;var i=t,l=void 0;do{var n=(i=i.$parent)&&i[wijmo_vue2_base_1.WjComponentBehavior._behProp];l=n&&n.control}while(!(l instanceof wjcGrid.FlexGrid));e.grid=l}e._attachToControl()}))}},methods:{_attachToControl:function(){this.cellTypeEnum=wjcCore.asEnum(this.cellType,exports.CellTemplateType);var e=this.cellTypeEnum,t=this.ownerControl;t[DirectiveCellFactory.getTemplContextProp(e)]=this;t instanceof wjcGrid.Column&&(e===exports.CellTemplateType.Cell||e===exports.CellTemplateType.ColumnHeader||e===exports.CellTemplateType.ColumnFooter)&&t._setFlag(wjcGrid.RowColFlags.HasTemplate,!0);this.grid.invalidate()},_detachFromControl:function(){if(null!=this.cellTypeEnum){this.ownerControl[DirectiveCellFactory.getTemplContextProp(this.cellTypeEnum)]=null;this.grid.invalidate()}},_instantiateTemplate:function(e,t){var r=wijmo_vue2_base_1.VueApi.isV3Plus?new V3CellTemplateCmp({parent:this}):new CellTemplateCmp({parent:this});r.context=t;r.slotFn=wijmo_vue2_base_1.VueApi.isV3Plus?this.$slots.default:this.$scopedSlots.default;r.$mount();e&&e.appendChild(r.$el);return r}}};exports.WjFlexGridCellTemplateDefinition[wijmo_vue2_base_1.VueApi.isV3Plus?"unmounted":"destroyed"]=function(){this._detachFromControl()};var WjFlexGridCellTemplateTag="wj-flex-grid-cell-template";exports.WjFlexGridCellTemplate=wijmo_vue2_base_1.VueApi.isV3Plus?exports.WjFlexGridCellTemplateDefinition:wijmo_vue2_base_1.VueApi.component(WjFlexGridCellTemplateTag,exports.WjFlexGridCellTemplateDefinition);function registerV3WjFlexGridCellTemplate(e){e.component(WjFlexGridCellTemplateTag,exports.WjFlexGridCellTemplate)}var CellTemplateCmp=wijmo_vue2_base_1.VueApi.extend({render:function(e){var t=this.slotFn;return e("div",t&&[t(this.context)])}}),V3CellTemplateCmp=function(){function V3CellTemplateCmp(e){this.props=e;this._host=document.createElement("div")}V3CellTemplateCmp.prototype.$mount=function(){var e=this,t=wijmo_vue2_base_1.VueApi.h,r=this.props,o=r.parent,i=__rest(r,["parent"]);wijmo_vue2_base_1.VueApi.render(t({parent:o,render:function(){return t("div",i,e.slotFn&&e.slotFn(e.context))}}),this.$el)};Object.defineProperty(V3CellTemplateCmp.prototype,"$el",{get:function(){return this._host},enumerable:!0,configurable:!0});V3CellTemplateCmp.prototype.$destroy=function(){wijmo_vue2_base_1.VueApi.render(null,this.$el);this._host=null};V3CellTemplateCmp.prototype.$forceUpdate=function(){this._host&&this.$mount()};return V3CellTemplateCmp}();function registerGrid(e){if(wijmo_vue2_base_1.VueApi.isV3Plus){registerV3WjFlexGrid(e);registerV3WjFlexGridColumn(e);registerV3WjFlexGridColumnGroup(e);registerV3WjFlexGridCellTemplate(e)}}exports.registerGrid=registerGrid;