smart-webcomponents-react 19.1.30 → 19.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.esm.js +2 -1
- package/alertwindow/alertwindow.esm.js +2 -1
- package/array/array.esm.js +2 -1
- package/barcode/barcode.esm.js +2 -1
- package/breadcrumb/breadcrumb.esm.js +2 -1
- package/button/button.esm.js +2 -1
- package/buttongroup/buttongroup.esm.js +2 -1
- package/calendar/calendar.esm.js +2 -1
- package/card/card.esm.js +2 -1
- package/cardview/cardview.esm.js +2 -1
- package/carousel/carousel.esm.js +2 -1
- package/chart/chart.esm.js +2 -1
- package/checkbox/checkbox.esm.js +2 -1
- package/checkinput/checkinput.esm.js +2 -1
- package/chip/chip.esm.js +2 -1
- package/colorinput/colorinput.esm.js +2 -1
- package/colorpanel/colorpanel.esm.js +2 -1
- package/colorpicker/colorpicker.esm.js +2 -1
- package/columnpanel/columnpanel.esm.js +2 -1
- package/combobox/combobox.esm.js +2 -1
- package/countryinput/countryinput.esm.js +2 -1
- package/customizationdialog/customizationdialog.esm.js +2 -1
- package/dateinput/dateinput.esm.js +2 -1
- package/daterangeinput/daterangeinput.esm.js +2 -1
- package/datetimepicker/datetimepicker.esm.js +2 -1
- package/dialogwindow/dialogwindow.esm.js +2 -1
- package/dockinglayout/dockinglayout.esm.js +2 -1
- package/dropdownbutton/dropdownbutton.esm.js +2 -1
- package/dropdownlist/dropdownlist.esm.js +2 -1
- package/editor/editor.esm.js +2 -1
- package/element/element.esm.js +2 -1
- package/fileupload/fileupload.esm.js +2 -1
- package/filterbuilder/filterbuilder.esm.js +2 -1
- package/filterpanel/filterpanel.esm.js +2 -1
- package/form/form.esm.js +2 -1
- package/ganttchart/ganttchart.esm.js +2 -1
- package/gauge/gauge.esm.js +2 -1
- package/grid/grid.esm.js +2 -1
- package/grouppanel/grouppanel.esm.js +2 -1
- package/input/input.esm.js +2 -1
- package/kanban/kanban.esm.js +2 -1
- package/layout/layout.esm.js +2 -1
- package/led/led.esm.js +2 -1
- package/listbox/listbox.esm.js +2 -1
- package/listmenu/listmenu.esm.js +2 -1
- package/map/map.esm.js +2 -1
- package/maskedtextbox/maskedtextbox.esm.js +2 -1
- package/menu/menu.esm.js +2 -1
- package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +2 -1
- package/multicomboinput/multicomboinput.esm.js +2 -1
- package/multiinput/multiinput.esm.js +2 -1
- package/multilinetextbox/multilinetextbox.esm.js +2 -1
- package/multilinewindow/multilinewindow.esm.js +2 -1
- package/multisplitbutton/multisplitbutton.esm.js +2 -1
- package/numberinput/numberinput.esm.js +2 -1
- package/numerictextbox/numerictextbox.esm.js +2 -1
- package/package.json +1 -1
- package/pager/pager.esm.js +2 -1
- package/passwordinput/passwordinput.esm.js +2 -1
- package/passwordtextbox/passwordtextbox.esm.js +2 -1
- package/path/path.esm.js +2 -1
- package/phoneinput/phoneinput.esm.js +2 -1
- package/pivottable/pivottable.esm.js +2 -1
- package/progressbar/progressbar.esm.js +2 -1
- package/progresswindow/progresswindow.esm.js +2 -1
- package/promptwindow/promptwindow.esm.js +2 -1
- package/qrcode/qrcode.esm.js +2 -1
- package/querybuilder/querybuilder.esm.js +2 -1
- package/radiobutton/radiobutton.esm.js +2 -1
- package/rating/rating.esm.js +2 -1
- package/ribbon/ribbon.esm.js +2 -1
- package/scheduler/scheduler.esm.js +2 -1
- package/scrollbar/scrollbar.esm.js +2 -1
- package/slider/slider.esm.js +2 -1
- package/sortable/sortable.esm.js +2 -1
- package/sortpanel/sortpanel.esm.js +2 -1
- package/source/modules/smart.3dchart.js +2 -2
- package/source/modules/smart.accordion.js +2 -2
- package/source/modules/smart.array.js +2 -2
- package/source/modules/smart.barcode.js +2 -2
- package/source/modules/smart.breadcrumb.js +2 -2
- package/source/modules/smart.button.js +2 -2
- package/source/modules/smart.buttongroup.js +2 -2
- package/source/modules/smart.calendar.js +2 -2
- package/source/modules/smart.card.js +2 -2
- package/source/modules/smart.cardview.js +2 -2
- package/source/modules/smart.carousel.js +2 -2
- package/source/modules/smart.chart.js +2 -2
- package/source/modules/smart.checkbox.js +2 -2
- package/source/modules/smart.checkinput.js +2 -2
- package/source/modules/smart.chip.js +2 -2
- package/source/modules/smart.colorinput.js +2 -2
- package/source/modules/smart.colorpanel.js +2 -2
- package/source/modules/smart.colorpicker.js +2 -2
- package/source/modules/smart.combobox.js +2 -2
- package/source/modules/smart.common.js +2 -2
- package/source/modules/smart.countryinput.js +2 -2
- package/source/modules/smart.dateinput.js +2 -2
- package/source/modules/smart.daterangeinput.js +2 -2
- package/source/modules/smart.datetimepicker.js +2 -2
- package/source/modules/smart.dockinglayout.js +2 -2
- package/source/modules/smart.dropdownbutton.js +2 -2
- package/source/modules/smart.dropdownlist.js +2 -2
- package/source/modules/smart.editor.js +2 -2
- package/source/modules/smart.element.js +2 -2
- package/source/modules/smart.fileupload.js +2 -2
- package/source/modules/smart.form.js +2 -2
- package/source/modules/smart.formulaparser.js +2 -2
- package/source/modules/smart.ganttchart.js +2 -2
- package/source/modules/smart.gauge.js +2 -2
- package/source/modules/smart.grid.js +7 -7
- package/source/modules/smart.gridpanel.js +2 -2
- package/source/modules/smart.input.js +2 -2
- package/source/modules/smart.kanban.js +2 -2
- package/source/modules/smart.layout.js +2 -2
- package/source/modules/smart.led.js +2 -2
- package/source/modules/smart.listbox.js +2 -2
- package/source/modules/smart.listmenu.js +2 -2
- package/source/modules/smart.map.js +2 -2
- package/source/modules/smart.maskedtextbox.js +2 -2
- package/source/modules/smart.menu.js +2 -2
- package/source/modules/smart.multicomboinput.js +2 -2
- package/source/modules/smart.multiinput.js +2 -2
- package/source/modules/smart.multilinetextbox.js +2 -2
- package/source/modules/smart.multisplitbutton.js +2 -2
- package/source/modules/smart.numberinput.js +2 -2
- package/source/modules/smart.numerictextbox.js +2 -2
- package/source/modules/smart.pager.js +2 -2
- package/source/modules/smart.passwordinput.js +2 -2
- package/source/modules/smart.passwordtextbox.js +2 -2
- package/source/modules/smart.path.js +2 -2
- package/source/modules/smart.phoneinput.js +2 -2
- package/source/modules/smart.pivottable.js +2 -2
- package/source/modules/smart.progressbar.js +2 -2
- package/source/modules/smart.qrcode.js +2 -2
- package/source/modules/smart.querybuilder.js +2 -2
- package/source/modules/smart.radiobutton.js +2 -2
- package/source/modules/smart.rating.js +2 -2
- package/source/modules/smart.ribbon.js +2 -2
- package/source/modules/smart.router.js +2 -2
- package/source/modules/smart.scheduler.js +2 -2
- package/source/modules/smart.scrollbar.js +2 -2
- package/source/modules/smart.slider.js +2 -2
- package/source/modules/smart.sortable.js +2 -2
- package/source/modules/smart.splitter.js +2 -2
- package/source/modules/smart.switchbutton.js +2 -2
- package/source/modules/smart.table.js +2 -2
- package/source/modules/smart.tabs.js +2 -2
- package/source/modules/smart.tank.js +2 -2
- package/source/modules/smart.textarea.js +2 -2
- package/source/modules/smart.textbox.js +2 -2
- package/source/modules/smart.timeinput.js +2 -2
- package/source/modules/smart.timeline.js +2 -2
- package/source/modules/smart.timepicker.js +2 -2
- package/source/modules/smart.toast.js +2 -2
- package/source/modules/smart.tooltip.js +2 -2
- package/source/modules/smart.tree.js +2 -2
- package/source/modules/smart.validator.js +2 -2
- package/source/modules/smart.window.js +2 -2
- package/source/smart.3dchart.js +1 -1
- package/source/smart.accordion.js +1 -1
- package/source/smart.ajax.js +1 -1
- package/source/smart.array.js +1 -1
- package/source/smart.barcode.js +1 -1
- package/source/smart.bootstrap.js +1 -1
- package/source/smart.breadcrumb.js +1 -1
- package/source/smart.button.js +1 -1
- package/source/smart.buttongroup.js +1 -1
- package/source/smart.calendar.js +1 -1
- package/source/smart.card.js +1 -1
- package/source/smart.cardview.js +1 -1
- package/source/smart.carousel.js +1 -1
- package/source/smart.chart.annotations.js +1 -1
- package/source/smart.chart.api.js +1 -1
- package/source/smart.chart.core.js +1 -1
- package/source/smart.chart.js +1 -1
- package/source/smart.chart.rangeselector.js +1 -1
- package/source/smart.chart.waterfall.js +1 -1
- package/source/smart.checkbox.js +1 -1
- package/source/smart.checkinput.js +1 -1
- package/source/smart.chip.js +1 -1
- package/source/smart.colorinput.js +1 -1
- package/source/smart.colorpanel.js +1 -1
- package/source/smart.colorpicker.js +1 -1
- package/source/smart.combobox.js +1 -1
- package/source/smart.complex.js +1 -1
- package/source/smart.core.js +1 -1
- package/source/smart.countryinput.js +1 -1
- package/source/smart.data.js +1 -1
- package/source/smart.date.js +1 -1
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +1 -1
- package/source/smart.daterangeinput.js +1 -1
- package/source/smart.datetimepicker.js +1 -1
- package/source/smart.dockinglayout.js +1 -1
- package/source/smart.draw.js +1 -1
- package/source/smart.dropdownbutton.js +1 -1
- package/source/smart.dropdownlist.js +1 -1
- package/source/smart.editor.js +1 -1
- package/source/smart.element.js +1 -1
- package/source/smart.elements.js +5 -5
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +1 -1
- package/source/smart.filter.js +1 -1
- package/source/smart.filterbuilder.js +1 -1
- package/source/smart.filterpanel.js +1 -1
- package/source/smart.form.js +1 -1
- package/source/smart.format.js +1 -1
- package/source/smart.formulaparser.js +1 -1
- package/source/smart.ganttchart.js +1 -1
- package/source/smart.gauge.js +1 -1
- package/source/smart.grid.cell.js +2 -2
- package/source/smart.grid.chart.js +1 -1
- package/source/smart.grid.column.js +1 -1
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +2 -2
- package/source/smart.grid.edit.js +1 -1
- package/source/smart.grid.export.js +1 -1
- package/source/smart.grid.filter.js +1 -1
- package/source/smart.grid.group.js +1 -1
- package/source/smart.grid.js +1 -1
- package/source/smart.grid.menu.js +1 -1
- package/source/smart.grid.pager.js +1 -1
- package/source/smart.grid.reorder.js +1 -1
- package/source/smart.grid.resize.js +1 -1
- package/source/smart.grid.row.js +1 -1
- package/source/smart.grid.select.js +1 -1
- package/source/smart.grid.sort.js +1 -1
- package/source/smart.grid.toolbar.js +2 -2
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +2 -2
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +1 -1
- package/source/smart.kanban.js +1 -1
- package/source/smart.layout.js +1 -1
- package/source/smart.led.js +1 -1
- package/source/smart.listbox.js +1 -1
- package/source/smart.listmenu.js +1 -1
- package/source/smart.map.js +1 -1
- package/source/smart.maskedtextbox.js +1 -1
- package/source/smart.math.js +1 -1
- package/source/smart.menu.js +1 -1
- package/source/smart.multicomboinput.js +1 -1
- package/source/smart.multiinput.js +1 -1
- package/source/smart.multilinetextbox.js +1 -1
- package/source/smart.multisplitbutton.js +1 -1
- package/source/smart.numberformatpanel.js +1 -1
- package/source/smart.numberinput.js +1 -1
- package/source/smart.numeric.js +1 -1
- package/source/smart.numerictextbox.js +1 -1
- package/source/smart.pager.js +1 -1
- package/source/smart.passwordinput.js +1 -1
- package/source/smart.passwordtextbox.js +1 -1
- package/source/smart.path.js +1 -1
- package/source/smart.phoneinput.js +1 -1
- package/source/smart.pivottable.js +1 -1
- package/source/smart.powerbutton.js +1 -1
- package/source/smart.progressbar.js +1 -1
- package/source/smart.qrcode.js +1 -1
- package/source/smart.radiobutton.js +1 -1
- package/source/smart.rating.js +1 -1
- package/source/smart.ribbon.js +1 -1
- package/source/smart.router.js +1 -1
- package/source/smart.scheduler.js +1 -1
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.slider.js +1 -1
- package/source/smart.sortable.js +1 -1
- package/source/smart.sparkline.js +1 -1
- package/source/smart.splitter.js +1 -1
- package/source/smart.switchbutton.js +1 -1
- package/source/smart.table.js +1 -1
- package/source/smart.tabs.js +1 -1
- package/source/smart.tank.js +1 -1
- package/source/smart.textarea.js +1 -1
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.js +1 -1
- package/source/smart.timeline.js +1 -1
- package/source/smart.timepicker.js +1 -1
- package/source/smart.toast.js +1 -1
- package/source/smart.tooltip.js +1 -1
- package/source/smart.tree.js +1 -1
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/splitter/splitter.esm.js +2 -1
- package/switchbutton/switchbutton.esm.js +2 -1
- package/table/table.esm.js +2 -1
- package/tabs/tabs.esm.js +2 -1
- package/tabswindow/tabswindow.esm.js +2 -1
- package/tank/tank.esm.js +2 -1
- package/textarea/textarea.esm.js +2 -1
- package/textbox/textbox.esm.js +2 -1
- package/threedchart/threedchart.esm.js +2 -1
- package/timeinput/timeinput.esm.js +2 -1
- package/timepicker/timepicker.esm.js +2 -1
- package/toast/toast.esm.js +2 -1
- package/tooltip/tooltip.esm.js +2 -1
- package/tree/tree.esm.js +2 -1
- package/validator/validator.esm.js +2 -1
- package/waitwindow/waitwindow.esm.js +2 -1
- package/window/window.esm.js +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI v19.1.
|
|
2
|
+
/* Smart UI v19.1.33 (2024-06-15)
|
|
3
3
|
Copyright (c) 2011-2024 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
|
-
Smart.Utilities.Assign("Grid.View",class{createBasicKanban(){this._initKanbanView("basic")}createBlankKanban(){this._initKanbanView("blank")}_getStatusColumn(e){const t=this;let a=!e||e&&"blank"===e?t.localize("dialogNewColumn"):t.localize("status");return t.columnByDataField.taskStatus&&(a=t.columnByDataField.taskStatus.label),new Smart.Grid.Column({label:a,description:t.localize("dialogAddColumnStatusDescription"),dataField:"taskStatus",showDescriptionButton:!0,dataType:"string",defaultValue:"",editor:{template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""},{color:"#33B679",label:t.localize("toDo"),value:"To Do"},{color:"#039BE5",label:t.localize("inProgress"),value:"In Progress"},{color:"#8E24AA",label:t.localize("done"),value:"Done"}]},template:"tags",cellsAlign:"left",align:"left",grid:t,visible:!0,_visible:!0,_view:!0})}_initKanbanView(e,t){const a=this;a._kanbanInitialized=!0;let i=null;for(let e=0;e<a.columns.length;e++){const t=a.columns[e];t._dataField&&!a.columnByDataField[t._dataField]&&(a.columnByDataField[t._dataField]=t),a._stackedBy||(t.statusColumn||"taskStatus"===t._dataField)&&(i=t),a._stackedBy&&a._stackedBy===t.dataField&&(i=t,a.columnByDataField.taskStatus=t,i.statusColumn=!0)}(()=>{if(!a.columnByDataField.taskText)for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if("string"===t.dataType&&t.editor&&"input"===t.editor.template){a.columnByDataField.taskText=t,t._dataField="taskText";break}}if(!a.columnByDataField.taskDescription)for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if("string"===t.dataType&&t.editor&&"textarea"===t.editor.template){a.columnByDataField.taskDescription=t,t._dataField="taskDescription";break}}})();const l=a._getStatusColumn(e);a._onColumnUpdated=(e,t)=>{if(!e._view)return;delete e._view,delete e._state,delete a._onColumnUpdated,e.allowSort=e.allowEdit=e.allowFilter=!0;const i=Math.floor(9e4*Math.random()+1e4);if(delete a.columnByDataField.taskStatus,"blank"===t.kanban?(e.displayField=e.dataField="dataField"+i,e.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""}]},a.columnByDataField.taskStatus=e):"basic"===t.kanban?(e.displayField=e.dataField="dataField"+i,a.columnByDataField.taskStatus=e):(e=a.columnByDataField[t.kanban],a.columnByDataField.taskStatus=e),e.statusColumn=!0,a._stackedBy===e.dataField&&a._kanban)a._showKanbanView();else{if(a._stackedBy=e.dataField,""===e.editor.dataSource[0])e.editor.dataSource[0]={label:"",value:""};else{let t=!1;for(let a=0;a<e.editor.dataSource.length;a++)if(""===e.editor.dataSource[a].value){t=!0;break}if(!t){const t=[...e.editor.dataSource];e.editor.dataSource=[{color:"#DD5347",label:a.localize("uncategorized"),value:""}],e.editor.dataSource=e.editor.dataSource.concat(t)}}a.beginUpdate(),a._createKanban(e),a._refreshHeaderBar(),a.endUpdate(!1),a.autoSaveState(),a._showKanbanView(),a.$.headerBar&&a.$.headerBar._refresh()}};const s=()=>{let e=!0;a.beginUpdate(),a._kanban?a.columnByDataField[l.dataField]||(a.columns.push(l),a._updateKanbanView(l)):(a._createKanban(i),e=!1),a._resetCachedLayout(),a._refreshHeaderBar(),a.endUpdate(),a.$.headerBar&&a.$.headerBar._refresh(),e&&a._showKanbanView()};if(a.stateSettings.loading&&i&&"dynamic"===e)return void s();const o=a.getCurrentState();if(i&&"dynamic"!==e){if(l.statusColumn=!0,a._stackedBy===l.dataField&&a._kanban)return;return a._stackedBy=i.dataField,delete l._view,void s()}return i&&"dynamic"===e&&a.stateSettings.storage&&o&&o.kanban&&o.kanban.stackedBy===i.dataField&&!a._kanban?(delete l._view,void s()):e&&"blank"===e?(delete l._view,l.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[]},l.allowSort=l.allowEdit=l.allowFilter=!0,l.label="New Column",a.beginUpdate(),a._createKanban(l),a._resetCachedLayout(),a._refreshHeaderBar(),void a.endUpdate()):e&&"basic"===e?(delete l._view,a.beginUpdate(),a._createKanban(l),a._resetCachedLayout(),a._refreshHeaderBar(),void a.endUpdate()):void a._openAddStackColumnDialog(l,!0,(e=>{if(!e&&"grid"===t){delete a._kanbanInitialized;let e=a.getCurrentState();if(e&&(e.view="grid"),a.view="grid",a._hideKanbanView(),Object.keys(a.stateSettings.storage).length>1)return delete a.stateSettings.storage[e.name],a.loadState(Object.keys(a.stateSettings.storage)[0]),void(a.$.headerBar&&a.$.headerBar._updateViews());a._refresh(),a.autoSaveState()}}))}_showKanbanView(e){const t=this;if(t.classList.contains("smart-kanban-view"))return t._updateKanbanView(),void t._kanban.refresh();t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t._kanban.parentNode?t._kanban.style.display="":t.$.viewContent.appendChild(t._kanban),t.classList.add("smart-kanban-view"),!1!==e&&t._updateKanbanView(),requestAnimationFrame((()=>{t._kanban.refresh();const a=t.getCurrentState();a&&a.kanban&&t._kanban.isInitialized&&(e=t._kanban.loadState(a.kanban))})),t._onFilter=t._onSort=()=>{if("kanban"===t.view){if(t._isUpdating)return;t._updateKanbanView(),t._kanban.refresh()}}}_hideKanbanView(){const e=this;e.classList.contains("smart-kanban-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e.$.footerPager.classList.remove("smart-hidden"),e._kanban._closeAllLists(),e._kanban.style.display="none",e.classList.remove("smart-kanban-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_showSchedulerView(e){const t=this;t.classList.contains("smart-scheduler-view")?t._updateSchedulerView():(t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t._scheduler.parentNode?t._scheduler.style.display="":t.$.viewContent.appendChild(t._scheduler),t.classList.add("smart-scheduler-view"),!1!==e&&t._updateSchedulerView(),requestAnimationFrame((()=>{t._scheduler.refresh();const a=t.getCurrentState();a&&a.scheduler&&t._scheduler.isInitialized&&(e=t._scheduler.loadState(a.scheduler))})),t._onFilter=t._onSort=()=>{if("scheduler"===t.view){if(t._isUpdating)return;t._updateSchedulerView()}})}_hideSchedulerView(){const e=this;e.classList.contains("smart-scheduler-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e.$.footerPager.classList.remove("smart-hidden"),e._scheduler.style.display="none",e.classList.remove("smart-scheduler-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_getPriorityDataSource(){const e=this;return[{color:"#F4511E",label:"",value:""},{color:"#33B679",label:e.localize("priority_low"),value:"Low"},{color:"#039BE5",label:e.localize("priority_average"),value:"Average"},{color:"#DD5347",label:e.localize("priority_high"),value:"High"},{color:"#AF0020",label:e.localize("priority_critical"),value:"Critical"}]}_updateKanbanTaskFields(){const e=this;for(let t=0;t<e.columns.length;t++){const a=e.columns[t];if(a.dataField.startsWith("taskStartDate")){const t=e._getKanbanTaskField("startDate");a.editor=t.editor}else if(a.dataField.startsWith("taskDueDate")){const t=e._getKanbanTaskField("dueDate");a.editor=t.editor}else if("checklist"===a.template){const t=e._getKanbanTaskField("checklist");a.editor=t.editor}}}_getKanbanTaskField(e){const t=this;switch(e){case"startDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeStartDate"),dataField:"taskStartDate",cellsFormat:"d",showDescriptionButton:!0,dataType:"date",allowDelete:!0,editor:{template:"dateInput",autoOpen:!0,onValidate(e,a){if("taskStartDate"===this.dataField){if(e>a.taskDueDate&&a.taskDueDate&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a.taskDueDate.toLocaleDateString()})}else if(this.boundDateField){const i=this.boundDateField;if(e>a[i]&&a[i]&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a[i].toLocaleDateString()})}return!0}},template:"startDate",visible:!0,_visible:!0,grid:t});case"dueDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDueDate"),dataField:"taskDueDate",cellsFormat:"d",showDescriptionButton:!0,allowDelete:!0,dataType:"date",editor:{template:"dateInput",autoOpen:!0,onValidate(e,a){if(e<a.taskStartDate&&a.taskStartDate&&e)return t.localize("invalidMinValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a.taskStartDate.toLocaleDateString()});if(this.boundDateField){const i=this.boundDateField;if(e<a[i]&&a[i]&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a[i].toLocaleDateString()})}return!0}},template:"dueDate",visible:!0,_visible:!0,grid:t});case"progress":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeProgress"),dataField:"taskProgress",showDescriptionButton:!0,allowDelete:!0,visible:!0,_visible:!0,disabledDialogOptions:["numberFormat","minValue","maxValue"],dataType:"number",cellsFormat:"p0",template:"progress",editor:{disabledDialogOptions:!0,template:"numberInput",min:0,max:1},grid:t});case"checklist":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeChecklist"),dataField:"taskChecklist",allowGroup:!1,showDescriptionButton:!0,allowSort:!1,allowDelete:!0,allowFilter:!1,visible:!0,_visible:!0,disabledDialogOptions:["allowFilter","allowSort","allowColorItems","options"],template:"checklist",editor:{template:"<smart-multi-combo-input></smart-multi-combo-input>",settings:{inputTagsMode:"one",readonly:!0,allowItemsAdd:!0,allowItemsRemove:!0},onRender:function(e,a,i,l){const s="string"==typeof l[a]&&l[a]?JSON.parse(l[a]):l[a],o=[],n=i.firstElementChild;if(n.isInitialized&&t._kanban&&t._kanban.messages[t.locale]&&(n.messages[t.locale].tagLabel=t._kanban.messages[t.locale].taskCompleted,n.messages[t.locale].tagLabelOne=t._kanban.messages[t.locale].taskCompleted),s){const e=s.map((e=>{const t={label:e.text,value:e.text};return e.completed&&o.push(t),t}));n.dataSource=e}else n.dataSource=[];n.selectedItems=o,!t.editing.editRow&&n.open&&n.open()},setValue:function(){},getValue:function(){const e=this.firstElementChild;return e.dataSource.map((t=>{const a=e.selectedItems.find((e=>t.value===e.value));return{text:t.label,completed:void 0!==a}}))}},dataType:"any",grid:t});case"priority":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypePriority"),dataField:"taskPriority",showDescriptionButton:!0,dataType:"string",visible:!0,_visible:!0,allowDelete:!0,disabledDialogOptions:[],editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:t._getPriorityDataSource()},template:"tags",grid:t});case"tags":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeTags"),dataField:"taskTags",allowDelete:!0,allowGroup:!1,visible:!0,_visible:!0,allowTypeChange:!1,editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!1,dataSource:[]},showDescriptionButton:!0,dataType:"string",template:"tags",grid:t});case"name":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeName"),allowDelete:!0,allowGroup:!1,dataField:"taskText",showDescriptionButton:!0,dataType:"string",_visible:!0,visible:!0,grid:t});case"description":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDescription"),dataField:"taskDescription",allowGroup:!1,allowDelete:!0,showDescriptionButton:!0,editor:{template:"textarea"},dataType:"string",_visible:!0,visible:!0,grid:t});case"assigned":{let e=[{label:"",value:"",color:"#DD5347"}];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeAssigned"),allowDelete:!0,dataField:"taskUserId",showDescriptionButton:!0,disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,collaborator:!0,disabledDialogOptions:!0,colorItems:!0,dropDownButtonPosition:"right",autoOpen:!0,pills:!0,singleSelect:!0,dataSource:e},dataType:"string",visible:!0,_visible:!0,template:"tags",grid:t})}case"color":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeColor"),allowDelete:!0,dataField:"taskColor",showDescriptionButton:!0,dataType:"string",disabledDialogOptions:["minLength","maxLength"],editor:{template:"colorInput"},template:"color",width:80,visible:!0,_visible:!0,grid:t});case"status":return t._getStatusColumn("basic")}}_getKanbanTaskFields(e){const t=this,a=[],i=t._getKanbanTaskField("startDate"),l=t._getKanbanTaskField("dueDate"),s=t._getKanbanTaskField("priority"),o=t._getKanbanTaskField("tags"),n=t._getKanbanTaskField("progress"),d=t._getKanbanTaskField("description"),r=t._getKanbanTaskField("name"),c=t._getKanbanTaskField("color"),u=t._getKanbanTaskField("checklist");let m=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.editor&&a.editor.collaborator){m=!1;break}}if(a.push(r),a.push(d),a.push(e),a.push(i),a.push(l),a.push(n),a.push(s),a.push(o),a.push(u),a.push(c),m){let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});const l=t._getKanbanTaskField("assigned");a.push(l),t._kanbanViewColumns=[i,l,n,s,o,u,c]}else t._kanbanViewColumns=[i,n,s,o,u,c];return a}getKanbanState(){const e=this;if(e._kanban){const t=e._kanban.getState(["order","sorting","filtering","columnOrder","collapsed"]);return e._stackedBy&&(t.stackedBy=e._stackedBy),t}return{}}getSchedulerProperties(){const e=this;if(e._schedulerProperties)return e._schedulerProperties;e._schedulerProperties={};const t={currentTimeIndicator:!0,views:["day","week","month","agenda"],view:"month"};return!1===e.editing.enabled&&(t.disableDrag=!0,t.disableDrop=!0,t.disableResize=!0,t.allowColumnRemove=!1,t.allowColumnEdit=!1,t.addNewButton=!1,t.addNewColumn=!1,t.columnActions=!1,t.editable=!1),e._schedulerProperties=Object.assign({},t),e._schedulerProperties}getKanbanProperties(){const e=this;if(e._kanbanProperties)return e._kanbanProperties;e._kanbanProperties={};const t={taskColorEntireSurface:!1,collapsible:!0,addNewButton:e.editing.addNewRow.visible,addNewButtonDisplayMode:"both",addNewColumn:e.editing.addNewColumn.visible,allowCustomTags:!1,allowColumnRemove:!0,editable:!0,editMode:"singleClick",columnActions:!0,columnEditMode:"headerAndMenu",allowColumnEdit:!0,allowColumnReorder:!0,taskActions:!0,taskDue:!0,taskTags:!1,tags:[],taskColor:!0,autoColumnHeight:!0,columnWidth:270,taskComments:!0,taskProgress:!0,columnSummary:!0,columnColors:!0,taskPriority:!0,disableAddNewDialog:!0,taskUserIcon:!0,taskSubTasks:"none",taskCustomFieldsHide:!1,columnColorEntireSurface:!0,columnFooter:!0,userList:!0,allowDropPlaceholder:!0};return!1===e.editing.enabled&&(t.allowDrag=!1,t.allowDrop=!1,t.allowColumnReorder=!1,t.allowColumnRemove=!1,t.allowColumnEdit=!1,t.addNewButton=!1,t.addNewColumn=!1,t.columnActions=!1,t.editable=!1),e._kanbanProperties=Object.assign({},t),e._kanbanProperties}setKanbanProperties(e){const t=this,a=t.getKanbanProperties();for(let t in e)void 0!==e[t]&&void 0!==a[t]&&(a[t]=e[t]);t.columnByDataField.taskTags&&(t.columnByDataField.taskTags.editor.dataSource=a.tags),t._kanbanProperties=a,t.classList.contains("smart-kanban-view")&&(t._updateKanbanView(),t._kanban.refresh())}_updateKanbanView(e){const t=this;if(!t._kanban)return;if(!t.isInitialized)return;if(!e&&!(e=t.columnByDataField.taskStatus))return;const a=t._kanban,i=a.context;a.context=a;const l=e.editor.dataSource&&e.editor.dataSource.length>0?e.editor.dataSource:[{label:e.label,value:e.value,color:"#DD5347"}];a.users=t.users,a.currentUser=t.currentUser;const s=t.getKanbanProperties();for(let e in s)a[e]=s[e];let o=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];let i=a.dataField;if(a._dataField&&(i=a._dataField),i.startsWith("task")){let e=i.replace("task","");e=e.substring(0,1).toLowerCase()+e.substring(1),-1===o.indexOf(e)&&o.push(e)}}a.$&&a.$.scrollViewer&&(a.$.scrollViewer.scrollLeft=0),a.dialogEditors=o;let n=[];for(let e=0;e<l.length;e++){const a=l[e];let i=a.label;""===a.label&&(i=a.labelAlt?a.labelAlt:t.localize("uncategorized")),n.push({label:i,value:a.value,status:a.value,dataField:a.value,color:a.color})}a.columns=n;let d=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.dataField.startsWith("task"))continue;if(t._stackedBy===a.dataField)continue;if(a._dataField&&("taskStatus"!==a._dataField||a._dataField===t._stackedBy))continue;if(!1===a.allowEdit)continue;if("any"===a.dataType)continue;d.push({label:a.label||"",dataField:a.dataField,dataType:a.dataType,visible:a.visible,editor:a.editor.template});const i=d[d.length-1];a.editor.dataSource&&(i.dataSource=[...a.editor.dataSource]),a.editor.colorItems&&(i.colorItems=a.editor.colorItems),a.editor.colorItems&&(i.pills=a.editor.pills),a.editor.colorItems&&(i.singleSelect=a.editor.singleSelect),a.editor.dropDownButtonPosition&&(i.dropDownButtonPosition=a.editor.dropDownButtonPosition),["min","max","minLength","maxLength","minDate","maxDate"].forEach((e=>{void 0!==a.editor[e]&&(i[e]=a.editor[e])}))}a.taskCustomFields=d;const r=[];for(let e=0;e<t.dataSource.length;e++){const a=t.dataSource[e],i=a.$.id;if(!1===a.$.filtered)continue;const l=t._getTaskDataByRow(i,a);r.push(l)}a.dataSource=r,t.columnByDataField.taskPriority&&(a.priority=t.columnByDataField.taskPriority.editor.dataSource),t.columnByDataField.taskTags&&(a.tags=t.columnByDataField.taskTags.editor.dataSource),a.context=i}_updateSchedulerView(e){const t=this;if(!t._scheduler)return;if(!t.isInitialized)return;t._refreshHeaderBar();const a=t._scheduler,i=a.context;a.context=a,a.users=t.users,a.currentUser=t.currentUser;const l=t.getSchedulerProperties();for(let e in l)a[e]=l[e];a.context=i}_getTaskDataByRow(e,t){const a=this,i={},l=a._kanban,s=a.rowById[e];s&&(s.history?i.history=JSON.parse(JSON.stringify(s.history)):i.history=[],s.comments?i.comments=JSON.parse(JSON.stringify(s.comments)):i.comments=[]),a.columnByDataField.taskStatus||void 0===t.taskStatus&&(t.taskStatus="");for(let e in t){if(e.startsWith("$"))continue;if("parent"===e)continue;if("children"===e)continue;let l=t[e];const s=a.columnByDataField[e];if(s&&s._dataField&&(e=s._dataField),"taskStatus"===e&&s&&a._stackedBy!==s.dataField&&(e=s.dataField),a._stackedBy===e&&(e="taskStatus"),e.startsWith("task")){let t=e.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"progress"===t&&(l=100*parseFloat(l)),"checklist"===t)if(l&&l.length){if("string"==typeof l)try{l=JSON.parse(l)}catch(e){console.log(e),l=[]}}else l=[];i[t]=l}else i[e]=l}return i.id=t.$.id,void 0===i.status?i.status="":l.columns.find((e=>e.value===i.status))||(i.status=""),i}_getTaskData(e){const t=this,a={},i=t._kanban;if(e.checklist&&e.checklist.length>0&&!t.columnByDataField.taskChecklist){const e=t._getKanbanTaskField("checklist");e.visible=e._visible=!1,t.columns.push(e)}if(e.priority&&i.taskPriority&&!t.columnByDataField.taskPriority){const e=t._getKanbanTaskField("priority");e.visible=e._visible=!1,t.columns.push(e)}if(null!==e.userId&&i.taskUserIcon&&!t.columnByDataField.taskUserId){const e=t._getKanbanTaskField("assigned");t.columns.push(e)}for(let l=0;l<t.columns.length;l++){const s=t.columns[l];let o=s.dataField,n=s.dataField;if(s._dataField&&(o=s._dataField),"taskStatus"===o&&t._stackedBy!==s.dataField&&(o=s.dataField),t._stackedBy===s.dataField&&(o="taskStatus"),o.startsWith("task")){let t=o.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"checklist"===t){e.checklist?a[n]=e.checklist:a[n]="";continue}if("history"===t&&(a[n]=e.history),void 0===e[t])continue;if("priority"===t){const i=e[t];a[n]=i}else a[n]="progress"===t?parseFloat(e[t])/100:e[t]}else i.taskCustomFields&&i.taskCustomFields.length&&i.taskCustomFields.find((e=>e.dataField===n))&&(a[n]=e[n])}return a}_createScheduler(){const e=this;e._openDateDialog((t=>{if(t){const t=e._dialogDate.querySelector("smart-input").selectedValues[0];"+"===t?alert("Yes"):e._dateStackedBy=t;const a=document.createElement("smart-scheduler"),i=e.getSchedulerProperties();for(let e in i)a[e]=i[e];e._scheduler=a,e.onViewInit&&e.onViewInit(a),a.style.width="100%",a.style.height="100%",a.style.borderTopColor="transparent",a.style.borderLeftColor="transparent",a.style.borderRightColor="transparent",a.style.borderBottomColor="transparent",a.style.background="inherit","scheduler"===e.view&&(e.$.viewContent.classList.remove("smart-hidden"),e.$.content.classList.add("smart-hidden"),e.$.footerPager.classList.add("smart-hidden")),e.$.viewContent.appendChild(a),"scheduler"===e.view&&e.classList.add("smart-scheduler-view"),e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show");const l=e.getCurrentState();l&&l.scheduler&&a.isInitialized&&a.loadState(l.scheduler),e._showSchedulerView()}else{delete e._schedulerInitialized;let t=e.getCurrentState();if(t&&(t.view="grid"),e.view="grid",e._hideSchedulerView(),Object.keys(e.stateSettings.storage).length>1)return delete e.stateSettings.storage[t.name],e.loadState(Object.keys(e.stateSettings.storage)[0]),void(e.$.headerBar&&e.$.headerBar._updateViews());e._refresh(),e.autoSaveState()}}))}_createKanban(e){const t=this;if(t._kanban)return void(t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e)));t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e));const a=document.createElement("smart-kanban");t._kanban=a,t.onViewInit&&t.onViewInit(a),t._updateKanbanView(e),a.style.width="100%",a.style.height="100%",a.style.borderTopColor="transparent",a.style.borderLeftColor="transparent",a.style.borderRightColor="transparent",a.style.borderBottomColor="transparent",a.style.background="inherit","kanban"===t.view&&(t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden")),t.$.viewContent.appendChild(a),"kanban"===t.view&&t.classList.add("smart-kanban-view"),t.editing.addNewColumn._addButton&&t.editing.addNewColumn._addButton.classList.remove("show");const i=t.getCurrentState();i&&i.kanban&&a.isInitialized&&a.loadState(i.kanban);const l=()=>{const e=this,t=e.columnByDataField.taskStatus,a=e._kanban,i=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e],l={label:t.dataField?t.label:"",labelAlt:t.label,value:t.dataField,color:t.color};i.push(l)}if(t.editor.isDirty=!0,t.editor.dataSource=i,t._state&&(t._state.editor=t.editor),delete t.editor._items,e.onColumnUpdated){const a=e.viewColumns.indexOf(t);e.onColumnUpdated(a,t)}};a.addEventListener("columnCollapse",(()=>{t.autoSaveState()})),a.addEventListener("columnExpand",(()=>{t.autoSaveState()})),a.addEventListener("columnReorder",(()=>{t.autoSaveState()})),a.addEventListener("taskReorder",(()=>{t.autoSaveState()})),a.addEventListener("columnUpdate",(()=>{l()})),a.addEventListener("columnAdd",(()=>{l()})),a.addEventListener("columnRemove",(()=>{l()})),a.addEventListener("taskAdd",(e=>{const i=e.detail.value,l=t._getTaskData(i);t._onRowInserted=e=>{const t=a.querySelector('[data-id="'+i.id+'"]');t&&t.setAttribute("data-id",e.id),i.id=e.id},t.addRow(l,!0,(e=>{const t=a.querySelector('[data-id="'+i.id+'"]');t&&t.setAttribute("data-id",e.id),i.id=e.id})),t._refreshHeaderBar(),delete t._onRowInserted})),a.addEventListener("taskRemove",(e=>{t.removeRow(e.detail.id),t._refreshHeaderBar()})),a.addEventListener("taskDoubleClick",(e=>{const i=e.detail.value;t._isUpdating=0,t.showDetail(i.id),t._isUpdating=1,t._endKanbanEdit?(t.removeEventListener("endEdit",t._endKanbanEdit,null),t.removeEventListener("cancelEdit",t._endKanbanEdit,null)):t._endKanbanEdit=e=>{if("kanban"===t.view){const i=e.detail.id,l=t.rowById[i];if(l){const e=t._getTaskDataByRow(i,l.data);a.updateTask(i,e)}}},t.addEventListener("endEdit",t._endKanbanEdit),t.addEventListener("cancelEdit",t._endKanbanEdit),e.preventDefault()})),t._onRowRemoved=(e,t)=>{for(let t=0;t<e.length;t++)a.removeTask(e[t])},a._beginEdit=a.beginEdit=e=>{const i=e.data;t._isUpdating=0,t.showDetail(i.id),t._isUpdating=1,t.onEndEdit=e=>{if("grid"===t.view)return;const i=e.detail.id,l=t.rowById[i];if(l){const e=t._getTaskDataByRow(i,l.data);a.updateTask(i,e)}}},t._onSaveRowData=e=>{if("grid"===t.view)return;const i=e.id,l=t._getTaskDataByRow(i,e.data);a.updateTask(i,l)},a.addEventListener("taskUpdate",(e=>{if("grid"===t.view)return;const i=e.detail.value,l=e.detail.oldValue,s=t._getTaskData(i),o=t._getTaskData(l);if(JSON.stringify(s)!==JSON.stringify(o)){const a=t.rowById[e.detail.id];a&&(i.history&&(a.history=JSON.parse(JSON.stringify(i.history))),i.comments&&(a.comments=JSON.parse(JSON.stringify(i.comments)))),t.updateRow(e.detail.id,s)}for(let e=0;e<a.taskCustomFields.length;e++){const i=a.taskCustomFields[e],l=t.columnByDataField[i.dataField];l&&(l.visible=i.visible)}const n=t.rowById[e.detail.id];n&&(n.history=i.history,i.comments&&(n.comments&&JSON.stringify(n.comments)===JSON.stringify(i.comments)||(n.comments=JSON.parse(JSON.stringify(i.comments)),t.onComment&&t.onComment(e.detail.id,n.comments))))}))}});
|
|
6
|
+
Smart.Utilities.Assign("Grid.View",class{createBasicKanban(){this._initKanbanView("basic")}createBlankKanban(){this._initKanbanView("blank")}_getStatusColumn(e){const t=this;let a=!e||e&&"blank"===e?t.localize("dialogNewColumn"):t.localize("status");return t.columnByDataField.taskStatus&&(a=t.columnByDataField.taskStatus.label),new Smart.Grid.Column({label:a,description:t.localize("dialogAddColumnStatusDescription"),dataField:"taskStatus",showDescriptionButton:!0,dataType:"string",defaultValue:"",editor:{template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""},{color:"#33B679",label:t.localize("toDo"),value:"To Do"},{color:"#039BE5",label:t.localize("inProgress"),value:"In Progress"},{color:"#8E24AA",label:t.localize("done"),value:"Done"}]},template:"tags",cellsAlign:"left",align:"left",grid:t,visible:!0,_visible:!0,_view:!0})}_initKanbanView(e,t){const a=this;a._kanbanInitialized=!0;let i=null;for(let e=0;e<a.columns.length;e++){const t=a.columns[e];t._dataField&&!a.columnByDataField[t._dataField]&&(a.columnByDataField[t._dataField]=t),a._stackedBy||(t.statusColumn||"taskStatus"===t._dataField)&&(i=t),a._stackedBy&&a._stackedBy===t.dataField&&(i=t,a.columnByDataField.taskStatus=t,i.statusColumn=!0)}(()=>{if(!a.columnByDataField.taskText)for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if("string"===t.dataType&&t.editor&&"input"===t.editor.template){a.columnByDataField.taskText=t,t._dataField="taskText";break}}if(!a.columnByDataField.taskDescription)for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if("string"===t.dataType&&t.editor&&"textarea"===t.editor.template){a.columnByDataField.taskDescription=t,t._dataField="taskDescription";break}}})();const l=a._getStatusColumn(e);a._onColumnUpdated=(e,t)=>{if(!e._view)return;delete e._view,delete e._state,delete a._onColumnUpdated,e.allowSort=e.allowEdit=e.allowFilter=!0;const i=Math.floor(9e4*Math.random()+1e4);if(delete a.columnByDataField.taskStatus,"blank"===t.kanban?(e.displayField=e.dataField="dataField"+i,e.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""}]},a.columnByDataField.taskStatus=e):"basic"===t.kanban?(e.displayField=e.dataField="dataField"+i,a.columnByDataField.taskStatus=e):(e=a.columnByDataField[t.kanban],a.columnByDataField.taskStatus=e),e.statusColumn=!0,a._stackedBy===e.dataField&&a._kanban)a._showKanbanView();else{if(a._stackedBy=e.dataField,""===e.editor.dataSource[0])e.editor.dataSource[0]={label:"",value:""};else{let t=!1;for(let a=0;a<e.editor.dataSource.length;a++)if(""===e.editor.dataSource[a].value){t=!0;break}if(!t){const t=[...e.editor.dataSource];e.editor.dataSource=[{color:"#DD5347",label:a.localize("uncategorized"),value:""}],e.editor.dataSource=e.editor.dataSource.concat(t)}}a.beginUpdate(),a._createKanban(e),a._refreshHeaderBar(),a.endUpdate(!1),a.autoSaveState(),a._showKanbanView(),a.$.headerBar&&a.$.headerBar._refresh()}};const s=()=>{let e=!0;a.beginUpdate(),a._kanban?a.columnByDataField[l.dataField]||(a.columns.push(l),a._updateKanbanView(l)):(a._createKanban(i),e=!1),a._resetCachedLayout(),a._refreshHeaderBar(),a.endUpdate(),a.$.headerBar&&a.$.headerBar._refresh(),e&&a._showKanbanView()};if(a.stateSettings.loading&&i&&"dynamic"===e)return void s();const o=a.getCurrentState();if(i&&"dynamic"!==e){if(l.statusColumn=!0,a._stackedBy===l.dataField&&a._kanban)return;return a._stackedBy=i.dataField,delete l._view,void s()}return i&&"dynamic"===e&&a.stateSettings.storage&&o&&o.kanban&&o.kanban.stackedBy===i.dataField&&!a._kanban?(delete l._view,void s()):e&&"blank"===e?(delete l._view,l.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[]},l.allowSort=l.allowEdit=l.allowFilter=!0,l.label="New Column",a.beginUpdate(),a._createKanban(l),a._resetCachedLayout(),a._refreshHeaderBar(),void a.endUpdate()):e&&"basic"===e?(delete l._view,a.beginUpdate(),a._createKanban(l),a._resetCachedLayout(),a._refreshHeaderBar(),void a.endUpdate()):void a._openAddStackColumnDialog(l,!0,(e=>{if(!e&&"grid"===t){delete a._kanbanInitialized;let e=a.getCurrentState();if(e&&(e.view="grid"),a.view="grid",a._hideKanbanView(),Object.keys(a.stateSettings.storage).length>1)return delete a.stateSettings.storage[e.name],a.loadState(Object.keys(a.stateSettings.storage)[0]),void(a.$.headerBar&&a.$.headerBar._updateViews());a._refresh(),a.autoSaveState()}}))}_showKanbanView(e){const t=this;if(t.classList.contains("smart-kanban-view"))return t._updateKanbanView(),void t._kanban.refresh();t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t._kanban.parentNode?t._kanban.style.display="":t.$.viewContent.appendChild(t._kanban),t.classList.add("smart-kanban-view"),!1!==e&&t._updateKanbanView(),requestAnimationFrame((()=>{t._kanban.refresh();const a=t.getCurrentState();a&&a.kanban&&t._kanban.isInitialized&&(e=t._kanban.loadState(a.kanban))})),t._onFilter=t._onSort=()=>{if("kanban"===t.view){if(t._isUpdating)return;t._updateKanbanView(),t._kanban.refresh()}}}_hideKanbanView(){const e=this;e.classList.contains("smart-kanban-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e.$.footerPager.classList.remove("smart-hidden"),e._kanban._closeAllLists(),e._kanban.style.display="none",e.classList.remove("smart-kanban-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_showSchedulerView(e){const t=this;t.classList.contains("smart-scheduler-view")?t._updateSchedulerView():(t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t._scheduler.parentNode?t._scheduler.style.display="":t.$.viewContent.appendChild(t._scheduler),t.classList.add("smart-scheduler-view"),!1!==e&&t._updateSchedulerView(),requestAnimationFrame((()=>{t._scheduler.refresh();const a=t.getCurrentState();a&&a.scheduler&&t._scheduler.isInitialized&&(e=t._scheduler.loadState(a.scheduler))})),t._onFilter=t._onSort=()=>{if("scheduler"===t.view){if(t._isUpdating)return;t._updateSchedulerView()}})}_hideSchedulerView(){const e=this;e.classList.contains("smart-scheduler-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e.$.footerPager.classList.remove("smart-hidden"),e._scheduler.style.display="none",e.classList.remove("smart-scheduler-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_getPriorityDataSource(){const e=this;return[{color:"#F4511E",label:"",value:""},{color:"#33B679",label:e.localize("priority_low"),value:"Low"},{color:"#039BE5",label:e.localize("priority_average"),value:"Average"},{color:"#DD5347",label:e.localize("priority_high"),value:"High"},{color:"#AF0020",label:e.localize("priority_critical"),value:"Critical"}]}_updateKanbanTaskFields(){const e=this;for(let t=0;t<e.columns.length;t++){const a=e.columns[t];if(a.dataField.startsWith("taskStartDate")){const t=e._getKanbanTaskField("startDate");a.editor=t.editor}else if(a.dataField.startsWith("taskDueDate")){const t=e._getKanbanTaskField("dueDate");a.editor=t.editor}else if("checklist"===a.template){const t=e._getKanbanTaskField("checklist");a.editor=t.editor}}}_getKanbanTaskField(e){const t=this;switch(e){case"startDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeStartDate"),dataField:"taskStartDate",cellsFormat:"d",showDescriptionButton:!0,dataType:"date",allowDelete:!0,editor:{template:"dateInput",autoOpen:!0,onValidate(e,a){if("taskStartDate"===this.dataField){if(e>a.taskDueDate&&a.taskDueDate&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a.taskDueDate.toLocaleDateString()})}else if(this.boundDateField){const i=this.boundDateField;if(e>a[i]&&a[i]&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a[i].toLocaleDateString()})}return!0}},template:"startDate",visible:!0,_visible:!0,grid:t});case"dueDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDueDate"),dataField:"taskDueDate",cellsFormat:"d",showDescriptionButton:!0,allowDelete:!0,dataType:"date",editor:{template:"dateInput",autoOpen:!0,onValidate(e,a){if(e<a.taskStartDate&&a.taskStartDate&&e)return t.localize("invalidMinValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a.taskStartDate.toLocaleDateString()});if(this.boundDateField){const i=this.boundDateField;if(e<a[i]&&a[i]&&e)return t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a[i].toLocaleDateString()})}return!0}},template:"dueDate",visible:!0,_visible:!0,grid:t});case"progress":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeProgress"),dataField:"taskProgress",showDescriptionButton:!0,allowDelete:!0,visible:!0,_visible:!0,disabledDialogOptions:["numberFormat","minValue","maxValue"],dataType:"number",cellsFormat:"p0",template:"progress",editor:{disabledDialogOptions:!0,template:"numberInput",min:0,max:1},grid:t});case"checklist":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeChecklist"),dataField:"taskChecklist",allowGroup:!1,showDescriptionButton:!0,allowSort:!1,allowDelete:!0,allowFilter:!1,visible:!0,_visible:!0,disabledDialogOptions:["allowFilter","allowSort","allowColorItems","options"],template:"checklist",editor:{template:"<smart-multi-combo-input></smart-multi-combo-input>",settings:{inputTagsMode:"one",readonly:!0,allowItemsAdd:!0,allowItemsRemove:!0},onRender:function(e,a,i,l){const s="string"==typeof l[a]&&l[a]?JSON.parse(l[a]):l[a],o=[],n=i.firstElementChild;if(n.isInitialized&&t._kanban&&t._kanban.messages[t.locale]&&(n.messages[t.locale].tagLabel=t._kanban.messages[t.locale].taskCompleted,n.messages[t.locale].tagLabelOne=t._kanban.messages[t.locale].taskCompleted),s){const e=s.map((e=>{const t={label:e.text,value:e.text};return e.completed&&o.push(t),t}));n.dataSource=e}else n.dataSource=[];n.selectedItems=o,!t.editing.editRow&&n.open&&n.open()},setValue:function(){},getValue:function(){const e=this.firstElementChild;return e.dataSource.map((t=>{const a=e.selectedItems.find((e=>t.value===e.value));return{text:t.label,completed:void 0!==a}}))}},dataType:"any",grid:t});case"priority":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypePriority"),dataField:"taskPriority",showDescriptionButton:!0,dataType:"string",visible:!0,_visible:!0,allowDelete:!0,disabledDialogOptions:[],editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:t._getPriorityDataSource()},template:"tags",grid:t});case"tags":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeTags"),dataField:"taskTags",allowDelete:!0,allowGroup:!1,visible:!0,_visible:!0,allowTypeChange:!1,editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!1,dataSource:[]},showDescriptionButton:!0,dataType:"string",template:"tags",grid:t});case"name":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeName"),allowDelete:!0,allowGroup:!1,dataField:"taskText",showDescriptionButton:!0,dataType:"string",_visible:!0,visible:!0,grid:t});case"description":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDescription"),dataField:"taskDescription",allowGroup:!1,allowDelete:!0,showDescriptionButton:!0,editor:{template:"textarea"},dataType:"string",_visible:!0,visible:!0,grid:t});case"assigned":{let e=[{label:"",value:"",color:"#DD5347"}];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeAssigned"),allowDelete:!0,dataField:"taskUserId",showDescriptionButton:!0,disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,collaborator:!0,disabledDialogOptions:!0,colorItems:!0,dropDownButtonPosition:"right",autoOpen:!0,pills:!0,singleSelect:!0,dataSource:e},dataType:"string",visible:!0,_visible:!0,template:"tags",grid:t})}case"color":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeColor"),allowDelete:!0,dataField:"taskColor",showDescriptionButton:!0,dataType:"string",disabledDialogOptions:["minLength","maxLength"],editor:{template:"colorInput"},template:"color",width:80,visible:!0,_visible:!0,grid:t});case"status":return t._getStatusColumn("basic")}}_getKanbanTaskFields(e){const t=this,a=[],i=t._getKanbanTaskField("startDate"),l=t._getKanbanTaskField("dueDate"),s=t._getKanbanTaskField("priority"),o=t._getKanbanTaskField("tags"),n=t._getKanbanTaskField("progress"),d=t._getKanbanTaskField("description"),r=t._getKanbanTaskField("name"),u=t._getKanbanTaskField("color"),c=t._getKanbanTaskField("checklist");let m=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.editor&&a.editor.collaborator){m=!1;break}}if(a.push(r),a.push(d),a.push(e),a.push(i),a.push(l),a.push(n),a.push(s),a.push(o),a.push(c),a.push(u),m){let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});const l=t._getKanbanTaskField("assigned");a.push(l),t._kanbanViewColumns=[i,l,n,s,o,c,u]}else t._kanbanViewColumns=[i,n,s,o,c,u];return a}getKanbanState(){const e=this;if(e._kanban){const t=e._kanban.getState(["order","sorting","filtering","columnOrder","collapsed"]);return e._stackedBy&&(t.stackedBy=e._stackedBy),t}return{}}getSchedulerProperties(){const e=this;if(e._schedulerProperties)return e._schedulerProperties;e._schedulerProperties={};const t={currentTimeIndicator:!0,views:["day","week","month","agenda"],view:"month"};return!1===e.editing.enabled&&(t.disableDrag=!0,t.disableDrop=!0,t.disableResize=!0,t.allowColumnRemove=!1,t.allowColumnEdit=!1,t.addNewButton=!1,t.addNewColumn=!1,t.columnActions=!1,t.editable=!1),e._schedulerProperties=Object.assign({},t),e._schedulerProperties}getKanbanProperties(){const e=this;if(e._kanbanProperties)return e._kanbanProperties;e._kanbanProperties={};const t={taskColorEntireSurface:!1,collapsible:!0,addNewButton:e.editing.addNewRow.visible,addNewButtonDisplayMode:"both",addNewColumn:e.editing.addNewColumn.visible,allowCustomTags:!1,allowColumnRemove:!0,editable:!0,editMode:"singleClick",columnActions:!0,columnEditMode:"headerAndMenu",allowColumnEdit:!0,allowColumnReorder:!0,taskActions:!0,taskDue:!0,taskTags:!1,tags:[],taskColor:!0,autoColumnHeight:!0,columnWidth:270,taskComments:!0,taskProgress:!0,columnSummary:!0,columnColors:!0,taskPriority:!0,disableAddNewDialog:!0,taskUserIcon:!0,taskSubTasks:"none",taskCustomFieldsHide:!1,columnColorEntireSurface:!0,columnFooter:!0,userList:!0,allowDropPlaceholder:!0};return!1===e.editing.enabled&&(t.allowDrag=!1,t.allowDrop=!1,t.allowColumnReorder=!1,t.allowColumnRemove=!1,t.allowColumnEdit=!1,t.addNewButton=!1,t.addNewColumn=!1,t.columnActions=!1,t.editable=!1),e._kanbanProperties=Object.assign({},t),e._kanbanProperties}setKanbanProperties(e){const t=this,a=t.getKanbanProperties();for(let t in e)void 0!==e[t]&&void 0!==a[t]&&(a[t]=e[t]);t.columnByDataField.taskTags&&(t.columnByDataField.taskTags.editor.dataSource=a.tags),t._kanbanProperties=a,t.classList.contains("smart-kanban-view")&&(t._updateKanbanView(),t._kanban.refresh())}_updateKanbanView(e){const t=this;if(!t._kanban)return;if(!t.isInitialized)return;if(!e&&!(e=t.columnByDataField.taskStatus))return;const a=t._kanban,i=a.context;a.context=a;const l=e.editor.dataSource&&e.editor.dataSource.length>0?e.editor.dataSource:[{label:e.label,value:e.value,color:"#DD5347"}];a.users=t.users,a.currentUser=t.currentUser;const s=t.getKanbanProperties();for(let e in s)a[e]=s[e];let o=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];let i=a.dataField;if(a._dataField&&(i=a._dataField),i.startsWith("task")){let e=i.replace("task","");e=e.substring(0,1).toLowerCase()+e.substring(1),-1===o.indexOf(e)&&o.push(e)}}a.$&&a.$.scrollViewer&&(a.$.scrollViewer.scrollLeft=0),a.dialogEditors=o;let n=[];for(let e=0;e<l.length;e++){const a=l[e];let i=a.label;""===a.label&&(i=a.labelAlt?a.labelAlt:t.localize("uncategorized")),n.push({label:i,value:a.value,status:a.value,dataField:a.value,color:a.color})}a.columns=n;let d=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.dataField.startsWith("task"))continue;if(t._stackedBy===a.dataField)continue;if(a._dataField&&("taskStatus"!==a._dataField||a._dataField===t._stackedBy))continue;if(!1===a.allowEdit)continue;if("any"===a.dataType)continue;d.push({label:a.label||"",dataField:a.dataField,dataType:a.dataType,visible:a.visible,editor:a.editor.template});const i=d[d.length-1];a.editor.dataSource&&(i.dataSource=[...a.editor.dataSource]),a.editor.colorItems&&(i.colorItems=a.editor.colorItems),a.editor.colorItems&&(i.pills=a.editor.pills),a.editor.colorItems&&(i.singleSelect=a.editor.singleSelect),a.editor.dropDownButtonPosition&&(i.dropDownButtonPosition=a.editor.dropDownButtonPosition),["min","max","minLength","maxLength","minDate","maxDate"].forEach((e=>{void 0!==a.editor[e]&&(i[e]=a.editor[e])}))}a.taskCustomFields=d;const r=[];for(let e=0;e<t.dataSource.length;e++){const a=t.dataSource[e],i=a.$.id;if(!1===a.$.filtered)continue;const l=t._getTaskDataByRow(i,a);r.push(l)}a.dataSource=r,t.columnByDataField.taskPriority&&(a.priority=t.columnByDataField.taskPriority.editor.dataSource),t.columnByDataField.taskTags&&(a.tags=t.columnByDataField.taskTags.editor.dataSource),a.context=i}_updateSchedulerView(e){const t=this;if(!t._scheduler)return;if(!t.isInitialized)return;t._refreshHeaderBar();const a=t._scheduler,i=a.context;a.context=a,a.users=t.users,a.currentUser=t.currentUser;const l=t.getSchedulerProperties();for(let e in l)a[e]=l[e];a.context=i}_getTaskDataByRow(e,t){const a=this,i={},l=a._kanban,s=a.rowById[e];s&&(s.history?i.history=JSON.parse(JSON.stringify(s.history)):i.history=[],s.comments?i.comments=JSON.parse(JSON.stringify(s.comments)):i.comments=[]),a.columnByDataField.taskStatus||void 0===t.taskStatus&&(t.taskStatus="");for(let e in t){if(e.startsWith("$"))continue;if("parent"===e)continue;if("children"===e)continue;let l=t[e];const s=a.columnByDataField[e];if(s&&s._dataField&&(e=s._dataField),"taskStatus"===e&&s&&a._stackedBy!==s.dataField&&(e=s.dataField),a._stackedBy===e&&(e="taskStatus"),e.startsWith("task")){let t=e.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"progress"===t&&(l=100*parseFloat(l)),"checklist"===t)if(l&&l.length){if("string"==typeof l)try{l=JSON.parse(l)}catch(e){console.log(e),l=[]}}else l=[];i[t]=l}else i[e]=l}return i.id=t.$.id,void 0===i.status?i.status="":l.columns.find((e=>e.value===i.status))||(i.status=""),i}_getTaskData(e){const t=this,a={},i=t._kanban;if(e.checklist&&e.checklist.length>0&&!t.columnByDataField.taskChecklist){const e=t._getKanbanTaskField("checklist");e.visible=e._visible=!1,t.columns.push(e)}if(e.priority&&i.taskPriority&&!t.columnByDataField.taskPriority){const e=t._getKanbanTaskField("priority");e.visible=e._visible=!1,t.columns.push(e)}if(null!==e.userId&&i.taskUserIcon&&!t.columnByDataField.taskUserId){const e=t._getKanbanTaskField("assigned");t.columns.push(e)}for(let l=0;l<t.columns.length;l++){const s=t.columns[l];let o=s.dataField,n=s.dataField;if(s._dataField&&(o=s._dataField),"taskStatus"===o&&t._stackedBy!==s.dataField&&(o=s.dataField),t._stackedBy===s.dataField&&(o="taskStatus"),o.startsWith("task")){let t=o.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"checklist"===t){e.checklist?a[n]=e.checklist:a[n]="";continue}if("history"===t&&(a[n]=e.history),void 0===e[t])continue;if("priority"===t){const i=e[t];a[n]=i}else a[n]="progress"===t?parseFloat(e[t])/100:e[t]}else i.taskCustomFields&&i.taskCustomFields.length&&i.taskCustomFields.find((e=>e.dataField===n))&&(a[n]=e[n])}return a}_createScheduler(e){const t=this;t._openDateDialog((a=>{if(a){const a=t._dialogDate.querySelector("smart-input").selectedValues[0];if("+"===a){const e=t._getKanbanTaskField("startDate");e.dataField=e.displayField="dataField"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);let a=1;for(let i=0;i<t.columns.length;i++)t.columns[i].label===e.label&&a++;1!==a&&(e.label+=" "+a),t.columns.push(e),t._dateStackedBy=e.dataField}else if("++"===a){const e=t._getKanbanTaskField("startDate");e.dataField=e.displayField="dataField"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);const a=t._getKanbanTaskField("dueDate");a.dataField=a.displayField="dataField"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),e.editor.boundDateField=a.dataField,a.editor.boundDateField=e.dataField;let i=1,l=1;for(let s=0;s<t.columns.length;s++)t.columns[s].label===e.label&&i++,t.columns[s].label===a.label&&l++;1!==i&&(e.label+=" "+i),1!==l&&(a.label+=" "+l),t.columns.push(e),t.columns.push(a),t._dateStackedBy=[e.dataField,a.dataField]}else t._dateStackedBy=a;if("update"===e)return void t._updateSchedulerView();const i=document.createElement("smart-scheduler"),l=t.getSchedulerProperties();for(let e in l)i[e]=l[e];t._scheduler=i,t.onViewInit&&t.onViewInit(i),i.style.width="100%",i.style.height="100%",i.style.borderTopColor="transparent",i.style.borderLeftColor="transparent",i.style.borderRightColor="transparent",i.style.borderBottomColor="transparent",i.style.background="inherit","scheduler"===t.view&&(t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden")),t.$.viewContent.appendChild(i),"scheduler"===t.view&&t.classList.add("smart-scheduler-view"),t.editing.addNewColumn._addButton&&t.editing.addNewColumn._addButton.classList.remove("show");const s=t.getCurrentState();s&&s.scheduler&&i.isInitialized&&i.loadState(s.scheduler),t._showSchedulerView()}else{if("update"===e)return;delete t._schedulerInitialized;let a=t.getCurrentState();if(a&&(a.view="grid"),t.view="grid",t._hideSchedulerView(),Object.keys(t.stateSettings.storage).length>1)return delete t.stateSettings.storage[a.name],t.loadState(Object.keys(t.stateSettings.storage)[0]),void(t.$.headerBar&&t.$.headerBar._updateViews());t._refresh(),t.autoSaveState()}}))}_createKanban(e){const t=this;if(t._kanban)return void(t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e)));t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e));const a=document.createElement("smart-kanban");t._kanban=a,t.onViewInit&&t.onViewInit(a),t._updateKanbanView(e),a.style.width="100%",a.style.height="100%",a.style.borderTopColor="transparent",a.style.borderLeftColor="transparent",a.style.borderRightColor="transparent",a.style.borderBottomColor="transparent",a.style.background="inherit","kanban"===t.view&&(t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden")),t.$.viewContent.appendChild(a),"kanban"===t.view&&t.classList.add("smart-kanban-view"),t.editing.addNewColumn._addButton&&t.editing.addNewColumn._addButton.classList.remove("show");const i=t.getCurrentState();i&&i.kanban&&a.isInitialized&&a.loadState(i.kanban);const l=()=>{const e=this,t=e.columnByDataField.taskStatus,a=e._kanban,i=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e],l={label:t.dataField?t.label:"",labelAlt:t.label,value:t.dataField,color:t.color};i.push(l)}if(t.editor.isDirty=!0,t.editor.dataSource=i,t._state&&(t._state.editor=t.editor),delete t.editor._items,e.onColumnUpdated){const a=e.viewColumns.indexOf(t);e.onColumnUpdated(a,t)}};a.addEventListener("columnCollapse",(()=>{t.autoSaveState()})),a.addEventListener("columnExpand",(()=>{t.autoSaveState()})),a.addEventListener("columnReorder",(()=>{t.autoSaveState()})),a.addEventListener("taskReorder",(()=>{t.autoSaveState()})),a.addEventListener("columnUpdate",(()=>{l()})),a.addEventListener("columnAdd",(()=>{l()})),a.addEventListener("columnRemove",(()=>{l()})),a.addEventListener("taskAdd",(e=>{const i=e.detail.value,l=t._getTaskData(i);t._onRowInserted=e=>{const t=a.querySelector('[data-id="'+i.id+'"]');t&&t.setAttribute("data-id",e.id),i.id=e.id},t.addRow(l,!0,(e=>{const t=a.querySelector('[data-id="'+i.id+'"]');t&&t.setAttribute("data-id",e.id),i.id=e.id})),t._refreshHeaderBar(),delete t._onRowInserted})),a.addEventListener("taskRemove",(e=>{t.removeRow(e.detail.id),t._refreshHeaderBar()})),a.addEventListener("taskDoubleClick",(e=>{const i=e.detail.value;t._isUpdating=0,t.showDetail(i.id),t._isUpdating=1,t._endKanbanEdit?(t.removeEventListener("endEdit",t._endKanbanEdit,null),t.removeEventListener("cancelEdit",t._endKanbanEdit,null)):t._endKanbanEdit=e=>{if("kanban"===t.view){const i=e.detail.id,l=t.rowById[i];if(l){const e=t._getTaskDataByRow(i,l.data);a.updateTask(i,e)}}},t.addEventListener("endEdit",t._endKanbanEdit),t.addEventListener("cancelEdit",t._endKanbanEdit),e.preventDefault()})),t._onRowRemoved=(e,t)=>{for(let t=0;t<e.length;t++)a.removeTask(e[t])},a._beginEdit=a.beginEdit=e=>{const i=e.data;t._isUpdating=0,t.showDetail(i.id),t._isUpdating=1,t.onEndEdit=e=>{if("grid"===t.view)return;const i=e.detail.id,l=t.rowById[i];if(l){const e=t._getTaskDataByRow(i,l.data);a.updateTask(i,e)}}},t._onSaveRowData=e=>{if("grid"===t.view)return;const i=e.id,l=t._getTaskDataByRow(i,e.data);a.updateTask(i,l)},a.addEventListener("taskUpdate",(e=>{if("grid"===t.view)return;const i=e.detail.value,l=e.detail.oldValue,s=t._getTaskData(i),o=t._getTaskData(l);if(JSON.stringify(s)!==JSON.stringify(o)){const a=t.rowById[e.detail.id];a&&(i.history&&(a.history=JSON.parse(JSON.stringify(i.history))),i.comments&&(a.comments=JSON.parse(JSON.stringify(i.comments)))),t.updateRow(e.detail.id,s)}for(let e=0;e<a.taskCustomFields.length;e++){const i=a.taskCustomFields[e],l=t.columnByDataField[i.dataField];l&&(l.visible=i.visible)}const n=t.rowById[e.detail.id];n&&(n.history=i.history,i.comments&&(n.comments&&JSON.stringify(n.comments)===JSON.stringify(i.comments)||(n.comments=JSON.parse(JSON.stringify(i.comments)),t.onComment&&t.onComment(e.detail.id,n.comments))))}))}});
|
package/source/smart.input.js
CHANGED
package/source/smart.kanban.js
CHANGED
package/source/smart.layout.js
CHANGED
package/source/smart.led.js
CHANGED
package/source/smart.listbox.js
CHANGED
package/source/smart.listmenu.js
CHANGED
package/source/smart.map.js
CHANGED
package/source/smart.math.js
CHANGED
package/source/smart.menu.js
CHANGED
package/source/smart.numeric.js
CHANGED
package/source/smart.pager.js
CHANGED
package/source/smart.path.js
CHANGED
package/source/smart.qrcode.js
CHANGED
package/source/smart.rating.js
CHANGED
package/source/smart.ribbon.js
CHANGED
package/source/smart.router.js
CHANGED
package/source/smart.slider.js
CHANGED
package/source/smart.sortable.js
CHANGED
package/source/smart.splitter.js
CHANGED
package/source/smart.table.js
CHANGED
package/source/smart.tabs.js
CHANGED
package/source/smart.tank.js
CHANGED
package/source/smart.textarea.js
CHANGED
package/source/smart.textbox.js
CHANGED
package/source/smart.timeline.js
CHANGED
package/source/smart.toast.js
CHANGED
package/source/smart.tooltip.js
CHANGED
package/source/smart.tree.js
CHANGED
package/source/smart.window.js
CHANGED
package/splitter/splitter.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
|
+
import '../source/modules/smart.splitter'
|
|
4
5
|
|
|
5
6
|
if(typeof window !== 'undefined') {
|
|
6
7
|
if (!window['Smart']) {
|
|
@@ -9,7 +10,7 @@ if(typeof window !== 'undefined') {
|
|
|
9
10
|
else {
|
|
10
11
|
window['Smart'].RenderMode = 'manual';
|
|
11
12
|
}
|
|
12
|
-
require('../source/modules/smart.splitter');
|
|
13
|
+
//require('../source/modules/smart.splitter');
|
|
13
14
|
}
|
|
14
15
|
import React from 'react';
|
|
15
16
|
|