smart-webcomponents-react 18.0.2 → 18.0.11
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.d.ts +2 -0
- package/accordion/accordion.esm.js +1 -1
- package/accordion/accordion.umd.js +2 -3
- package/accordion/accordionitem.d.ts +2 -0
- package/alertwindow/alertwindow.d.ts +2 -0
- package/alertwindow/alertwindow.esm.js +1 -1
- package/alertwindow/alertwindow.umd.js +2 -3
- package/array/array.d.ts +2 -0
- package/array/array.esm.js +1 -1
- package/array/array.umd.js +2 -3
- package/barcode/barcode.d.ts +2 -0
- package/barcode/barcode.esm.js +1 -1
- package/barcode/barcode.umd.js +2 -3
- package/breadcrumb/breadcrumb.d.ts +2 -0
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.umd.js +2 -3
- package/button/button.d.ts +2 -0
- package/button/button.esm.js +1 -1
- package/button/button.umd.js +2 -3
- package/button/buttongroup.d.ts +2 -0
- package/button/dropdownbutton.d.ts +2 -0
- package/button/multisplitbutton.d.ts +2 -0
- package/button/powerbutton.d.ts +2 -0
- package/button/radiobutton.d.ts +2 -0
- package/button/repeatbutton.d.ts +2 -0
- package/button/switchbutton.d.ts +2 -0
- package/button/togglebutton.d.ts +2 -0
- package/buttongroup/buttongroup.d.ts +2 -0
- package/buttongroup/buttongroup.esm.js +1 -1
- package/buttongroup/buttongroup.umd.js +2 -3
- package/calendar/calendar.d.ts +7 -0
- package/calendar/calendar.esm.js +13 -2
- package/calendar/calendar.umd.js +14 -4
- package/card/card.d.ts +2 -0
- package/card/card.esm.js +1 -1
- package/card/card.umd.js +2 -3
- package/card/cardview.d.ts +2 -0
- package/cardview/cardview.d.ts +2 -0
- package/cardview/cardview.esm.js +1 -1
- package/cardview/cardview.umd.js +2 -3
- package/carousel/carousel.d.ts +2 -0
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.umd.js +2 -3
- package/chart/chart.d.ts +2 -0
- package/chart/chart.esm.js +1 -1
- package/chart/chart.umd.js +2 -3
- package/chart/ganttchart.d.ts +2 -0
- package/chart/threedchart.d.ts +2 -0
- package/checkbox/checkbox.d.ts +2 -0
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.umd.js +2 -3
- package/checkinput/checkinput.d.ts +2 -0
- package/checkinput/checkinput.esm.js +1 -1
- package/checkinput/checkinput.umd.js +2 -3
- package/chip/chip.d.ts +2 -0
- package/chip/chip.esm.js +1 -1
- package/chip/chip.umd.js +2 -3
- package/colorinput/colorinput.d.ts +2 -0
- package/colorinput/colorinput.esm.js +1 -1
- package/colorinput/colorinput.umd.js +2 -3
- package/colorpanel/colorpanel.d.ts +2 -0
- package/colorpanel/colorpanel.esm.js +1 -1
- package/colorpanel/colorpanel.umd.js +2 -3
- package/colorpicker/colorpicker.d.ts +2 -0
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.umd.js +2 -3
- package/columnpanel/columnpanel.d.ts +2 -0
- package/columnpanel/columnpanel.esm.js +1 -1
- package/columnpanel/columnpanel.umd.js +2 -3
- package/combobox/combobox.d.ts +2 -0
- package/combobox/combobox.esm.js +1 -1
- package/combobox/combobox.umd.js +2 -3
- package/countryinput/countryinput.d.ts +2 -0
- package/countryinput/countryinput.esm.js +1 -1
- package/countryinput/countryinput.umd.js +2 -3
- package/customizationdialog/customizationdialog.d.ts +2 -0
- package/customizationdialog/customizationdialog.esm.js +1 -1
- package/customizationdialog/customizationdialog.umd.js +2 -3
- package/dateinput/dateinput.d.ts +2 -0
- package/dateinput/dateinput.esm.js +1 -1
- package/dateinput/dateinput.umd.js +2 -3
- package/daterangeinput/daterangeinput.d.ts +2 -0
- package/daterangeinput/daterangeinput.esm.js +1 -1
- package/daterangeinput/daterangeinput.umd.js +2 -3
- package/datetimepicker/datetimepicker.d.ts +2 -0
- package/datetimepicker/datetimepicker.esm.js +1 -1
- package/datetimepicker/datetimepicker.umd.js +2 -3
- package/dialogwindow/dialogwindow.d.ts +2 -0
- package/dialogwindow/dialogwindow.esm.js +1 -1
- package/dialogwindow/dialogwindow.umd.js +2 -3
- package/dockinglayout/dockinglayout.d.ts +2 -0
- package/dockinglayout/dockinglayout.esm.js +1 -1
- package/dockinglayout/dockinglayout.umd.js +2 -3
- package/dropdownbutton/dropdownbutton.d.ts +2 -0
- package/dropdownbutton/dropdownbutton.esm.js +1 -1
- package/dropdownbutton/dropdownbutton.umd.js +2 -3
- package/dropdownlist/dropdownlist.d.ts +2 -0
- package/dropdownlist/dropdownlist.esm.js +1 -1
- package/dropdownlist/dropdownlist.umd.js +2 -3
- package/editor/editor.d.ts +2 -0
- package/editor/editor.esm.js +1 -1
- package/editor/editor.umd.js +2 -3
- package/element/element.d.ts +2 -0
- package/element/element.esm.js +1 -1
- package/element/element.umd.js +2 -3
- package/fileupload/fileupload.d.ts +2 -0
- package/fileupload/fileupload.esm.js +1 -1
- package/fileupload/fileupload.umd.js +2 -3
- package/filterbuilder/filterbuilder.d.ts +2 -0
- package/filterbuilder/filterbuilder.esm.js +1 -1
- package/filterbuilder/filterbuilder.umd.js +2 -3
- package/filterpanel/filterpanel.d.ts +2 -0
- package/filterpanel/filterpanel.esm.js +1 -1
- package/filterpanel/filterpanel.umd.js +2 -3
- package/filterpanel/multicolumnfilterpanel.d.ts +2 -0
- package/form/form.d.ts +2 -0
- package/form/form.esm.js +1 -1
- package/form/form.umd.js +2 -3
- package/form/formcontrol.d.ts +2 -0
- package/form/formgroup.d.ts +2 -0
- package/ganttchart/ganttchart.d.ts +2 -0
- package/ganttchart/ganttchart.esm.js +1 -1
- package/ganttchart/ganttchart.umd.js +2 -3
- package/gauge/gauge.d.ts +2 -0
- package/gauge/gauge.esm.js +1 -1
- package/gauge/gauge.umd.js +2 -3
- package/grid/grid.d.ts +23 -12
- package/grid/grid.esm.js +25 -14
- package/grid/grid.umd.js +26 -16
- package/grouppanel/grouppanel.d.ts +2 -0
- package/grouppanel/grouppanel.esm.js +1 -1
- package/grouppanel/grouppanel.umd.js +2 -3
- package/index.d.ts +54 -3
- package/input/checkinput.d.ts +2 -0
- package/input/colorinput.d.ts +2 -0
- package/input/countryinput.d.ts +2 -0
- package/input/dateinput.d.ts +2 -0
- package/input/daterangeinput.d.ts +2 -0
- package/input/input.d.ts +2 -0
- package/input/input.esm.js +1 -1
- package/input/input.umd.js +2 -3
- package/input/multicomboinput.d.ts +2 -0
- package/input/multiinput.d.ts +2 -0
- package/input/numberinput.d.ts +2 -0
- package/input/passwordinput.d.ts +2 -0
- package/input/phoneinput.d.ts +2 -0
- package/input/timeinput.d.ts +2 -0
- package/kanban/kanban.d.ts +2 -0
- package/kanban/kanban.esm.js +1 -1
- package/kanban/kanban.umd.js +2 -3
- package/layout/dockinglayout.d.ts +2 -0
- package/layout/layout.d.ts +2 -0
- package/layout/layout.esm.js +1 -1
- package/layout/layout.umd.js +2 -3
- package/layout/layoutgroup.d.ts +2 -0
- package/layout/layoutitem.d.ts +2 -0
- package/layout/tablayoutgroup.d.ts +2 -0
- package/layout/tablayoutitem.d.ts +2 -0
- package/led/led.d.ts +2 -0
- package/led/led.esm.js +1 -1
- package/led/led.umd.js +2 -3
- package/listbox/listbox.d.ts +2 -0
- package/listbox/listbox.esm.js +1 -1
- package/listbox/listbox.umd.js +2 -3
- package/listmenu/listmenu.d.ts +2 -0
- package/listmenu/listmenu.esm.js +1 -1
- package/listmenu/listmenu.umd.js +2 -3
- package/map/map.d.ts +2 -0
- package/map/map.esm.js +1 -1
- package/map/map.umd.js +2 -3
- package/maskedtextbox/maskedtextbox.d.ts +2 -0
- package/maskedtextbox/maskedtextbox.esm.js +1 -1
- package/maskedtextbox/maskedtextbox.umd.js +2 -3
- package/menu/listmenu.d.ts +2 -0
- package/menu/menu.d.ts +2 -0
- package/menu/menu.esm.js +1 -1
- package/menu/menu.umd.js +2 -3
- package/menu/menuitem.d.ts +2 -0
- package/menu/menuitemsgroup.d.ts +2 -0
- package/multicolumnfilterpanel/multicolumnfilterpanel.d.ts +2 -0
- package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +1 -1
- package/multicolumnfilterpanel/multicolumnfilterpanel.umd.js +2 -3
- package/multicomboinput/multicomboinput.d.ts +2 -0
- package/multicomboinput/multicomboinput.esm.js +1 -1
- package/multicomboinput/multicomboinput.umd.js +2 -3
- package/multiinput/multiinput.d.ts +2 -0
- package/multiinput/multiinput.esm.js +1 -1
- package/multiinput/multiinput.umd.js +2 -3
- package/multilinetextbox/multilinetextbox.d.ts +2 -0
- package/multilinetextbox/multilinetextbox.esm.js +1 -1
- package/multilinetextbox/multilinetextbox.umd.js +2 -3
- package/multilinewindow/multilinewindow.d.ts +2 -0
- package/multilinewindow/multilinewindow.esm.js +1 -1
- package/multilinewindow/multilinewindow.umd.js +2 -3
- package/multisplitbutton/multisplitbutton.d.ts +2 -0
- package/multisplitbutton/multisplitbutton.esm.js +1 -1
- package/multisplitbutton/multisplitbutton.umd.js +2 -3
- package/numberinput/numberinput.d.ts +2 -0
- package/numberinput/numberinput.esm.js +1 -1
- package/numberinput/numberinput.umd.js +2 -3
- package/numerictextbox/numerictextbox.d.ts +2 -0
- package/numerictextbox/numerictextbox.esm.js +1 -1
- package/numerictextbox/numerictextbox.umd.js +2 -3
- package/package.json +1 -1
- package/pager/pager.d.ts +2 -0
- package/pager/pager.esm.js +1 -1
- package/pager/pager.umd.js +2 -3
- package/passwordinput/passwordinput.d.ts +2 -0
- package/passwordinput/passwordinput.esm.js +1 -1
- package/passwordinput/passwordinput.umd.js +2 -3
- package/passwordtextbox/passwordtextbox.d.ts +2 -0
- package/passwordtextbox/passwordtextbox.esm.js +1 -1
- package/passwordtextbox/passwordtextbox.umd.js +2 -3
- package/path/path.d.ts +2 -0
- package/path/path.esm.js +1 -1
- package/path/path.umd.js +2 -3
- package/phoneinput/phoneinput.d.ts +2 -0
- package/phoneinput/phoneinput.esm.js +1 -1
- package/phoneinput/phoneinput.umd.js +2 -3
- package/pivottable/pivottable.d.ts +2 -0
- package/pivottable/pivottable.esm.js +1 -1
- package/pivottable/pivottable.umd.js +2 -3
- package/progressbar/circularprogressbar.d.ts +2 -0
- package/progressbar/progressbar.d.ts +2 -0
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.umd.js +2 -3
- package/progresswindow/progresswindow.d.ts +2 -0
- package/progresswindow/progresswindow.esm.js +1 -1
- package/progresswindow/progresswindow.umd.js +2 -3
- package/promptwindow/promptwindow.d.ts +2 -0
- package/promptwindow/promptwindow.esm.js +1 -1
- package/promptwindow/promptwindow.umd.js +2 -3
- package/qrcode/qrcode.d.ts +2 -0
- package/qrcode/qrcode.esm.js +1 -1
- package/qrcode/qrcode.umd.js +2 -3
- package/querybuilder/querybuilder.d.ts +2 -0
- package/querybuilder/querybuilder.esm.js +1 -1
- package/querybuilder/querybuilder.umd.js +2 -3
- package/radiobutton/radiobutton.d.ts +2 -0
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.umd.js +2 -3
- package/rating/rating.d.ts +2 -0
- package/rating/rating.esm.js +1 -1
- package/rating/rating.umd.js +2 -3
- package/ribbon/ribbon.d.ts +2 -0
- package/ribbon/ribbon.esm.js +1 -1
- package/ribbon/ribbon.umd.js +2 -3
- package/ribbon/ribbongroup.d.ts +2 -0
- package/ribbon/ribbonitem.d.ts +2 -0
- package/ribbon/ribbontab.d.ts +2 -0
- package/scheduler/scheduler.d.ts +2 -0
- package/scheduler/scheduler.esm.js +1 -1
- package/scheduler/scheduler.umd.js +2 -3
- package/scrollbar/scrollbar.d.ts +2 -0
- package/scrollbar/scrollbar.esm.js +1 -1
- package/scrollbar/scrollbar.umd.js +2 -3
- package/slider/slider.d.ts +2 -0
- package/slider/slider.esm.js +1 -1
- package/slider/slider.umd.js +2 -3
- package/sortable/sortable.d.ts +2 -0
- package/sortable/sortable.esm.js +1 -1
- package/sortable/sortable.umd.js +2 -3
- package/sortpanel/sortpanel.d.ts +2 -0
- package/sortpanel/sortpanel.esm.js +1 -1
- package/sortpanel/sortpanel.umd.js +2 -3
- package/source/modules/smart.3dchart.js +1 -1
- package/source/modules/smart.accordion.js +1 -1
- package/source/modules/smart.array.js +1 -1
- package/source/modules/smart.barcode.js +1 -1
- package/source/modules/smart.breadcrumb.js +1 -1
- package/source/modules/smart.button.js +1 -1
- package/source/modules/smart.buttongroup.js +1 -1
- package/source/modules/smart.calendar.js +3 -3
- package/source/modules/smart.card.js +1 -1
- package/source/modules/smart.cardview.js +5 -5
- package/source/modules/smart.carousel.js +1 -1
- package/source/modules/smart.chart.js +2 -2
- package/source/modules/smart.checkbox.js +1 -1
- package/source/modules/smart.checkinput.js +2 -2
- package/source/modules/smart.chip.js +1 -1
- package/source/modules/smart.colorinput.js +2 -2
- package/source/modules/smart.colorpanel.js +1 -1
- package/source/modules/smart.colorpicker.js +1 -1
- package/source/modules/smart.combobox.js +1 -1
- package/source/modules/smart.common.js +3 -3
- package/source/modules/smart.countryinput.js +2 -2
- package/source/modules/smart.dateinput.js +3 -3
- package/source/modules/smart.daterangeinput.js +3 -3
- package/source/modules/smart.datetimepicker.js +3 -3
- package/source/modules/smart.dockinglayout.js +1 -1
- package/source/modules/smart.dropdownbutton.js +1 -1
- package/source/modules/smart.dropdownlist.js +1 -1
- package/source/modules/smart.editor.js +2 -2
- package/source/modules/smart.element.js +1 -1
- package/source/modules/smart.fileupload.js +1 -1
- package/source/modules/smart.form.js +3 -3
- package/source/modules/smart.formulaparser.js +1 -1
- package/source/modules/smart.ganttchart.js +6 -6
- package/source/modules/smart.gauge.js +1 -1
- package/source/modules/smart.grid.js +15 -15
- package/source/modules/smart.gridpanel.js +5 -5
- package/source/modules/smart.input.js +2 -2
- package/source/modules/smart.kanban.js +5 -5
- package/source/modules/smart.layout.js +1 -1
- package/source/modules/smart.led.js +1 -1
- package/source/modules/smart.listbox.js +1 -1
- package/source/modules/smart.listmenu.js +1 -1
- package/source/modules/smart.map.js +1 -1
- package/source/modules/smart.maskedtextbox.js +2 -2
- package/source/modules/smart.menu.js +1 -1
- package/source/modules/smart.multicomboinput.js +2 -2
- package/source/modules/smart.multiinput.js +2 -2
- package/source/modules/smart.multilinetextbox.js +1 -1
- package/source/modules/smart.multisplitbutton.js +1 -1
- package/source/modules/smart.numberinput.js +2 -2
- package/source/modules/smart.numerictextbox.js +1 -1
- 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 +1 -1
- package/source/modules/smart.phoneinput.js +2 -2
- package/source/modules/smart.pivottable.js +6 -6
- package/source/modules/smart.progressbar.js +1 -1
- package/source/modules/smart.qrcode.js +1 -1
- package/source/modules/smart.querybuilder.js +3 -3
- package/source/modules/smart.radiobutton.js +1 -1
- package/source/modules/smart.rating.js +1 -1
- package/source/modules/smart.ribbon.js +2 -2
- package/source/modules/smart.router.js +2 -2
- package/source/modules/smart.scheduler.js +5 -5
- package/source/modules/smart.scrollbar.js +1 -1
- package/source/modules/smart.slider.js +1 -1
- package/source/modules/smart.sortable.js +1 -1
- package/source/modules/smart.splitter.js +1 -1
- package/source/modules/smart.switchbutton.js +1 -1
- package/source/modules/smart.table.js +4 -4
- package/source/modules/smart.tabs.js +1 -1
- package/source/modules/smart.tank.js +1 -1
- package/source/modules/smart.textarea.js +3 -3
- package/source/modules/smart.textbox.js +1 -1
- package/source/modules/smart.timeinput.js +2 -2
- package/source/modules/smart.timepicker.js +1 -1
- package/source/modules/smart.toast.js +1 -1
- package/source/modules/smart.tooltip.js +1 -1
- package/source/modules/smart.tree.js +2 -2
- package/source/modules/smart.validator.js +1 -1
- package/source/modules/smart.window.js +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +16 -16
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +1 -1
- package/source/smart.filter.js +2 -2
- package/source/smart.filterbuilder.js +1 -1
- package/source/smart.filterpanel.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +2 -2
- package/source/smart.grid.edit.js +2 -2
- 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 +2 -2
- package/source/smart.grid.select.js +2 -2
- package/source/smart.grid.sort.js +1 -1
- package/source/smart.grid.toolbar.js +1 -1
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +1 -1
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +2 -2
- 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 +6 -0
- 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 +2 -2
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.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 +2 -2
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/source/styles/components/smart.grid.css +1 -1
- package/source/styles/components/smart.validator.css +1 -1
- package/source/styles/default/scss/smart.grid.scss +230 -168
- package/source/styles/default/scss/smart.validator.scss +1 -0
- package/source/styles/default/smart.grid.css +48 -9
- package/source/styles/default/smart.validator.css +123 -121
- package/source/styles/smart.default.css +2 -2
- package/source/typescript/smart.calendar.d.ts +5 -0
- package/source/typescript/smart.elements.d.ts +54 -3
- package/source/typescript/smart.grid.d.ts +33 -3
- package/source/typescript/smart.textarea.d.ts +5 -0
- package/source/typescript/smart.tree.d.ts +11 -0
- package/splitter/splitter.d.ts +2 -0
- package/splitter/splitter.esm.js +1 -1
- package/splitter/splitter.umd.js +2 -3
- package/splitter/splitterbar.d.ts +2 -0
- package/splitter/splitteritem.d.ts +2 -0
- package/switchbutton/switchbutton.d.ts +2 -0
- package/switchbutton/switchbutton.esm.js +1 -1
- package/switchbutton/switchbutton.umd.js +2 -3
- package/table/pivottable.d.ts +2 -0
- package/table/sortable.d.ts +2 -0
- package/table/table.d.ts +2 -0
- package/table/table.esm.js +1 -1
- package/table/table.umd.js +2 -3
- package/tabs/tabs.d.ts +2 -0
- package/tabs/tabs.esm.js +1 -1
- package/tabs/tabs.umd.js +2 -3
- package/tabs/tabswindow.d.ts +2 -0
- package/tabswindow/tabswindow.d.ts +2 -0
- package/tabswindow/tabswindow.esm.js +1 -1
- package/tabswindow/tabswindow.umd.js +2 -3
- package/tank/tank.d.ts +2 -0
- package/tank/tank.esm.js +1 -1
- package/tank/tank.umd.js +2 -3
- package/textarea/textarea.d.ts +7 -0
- package/textarea/textarea.esm.js +13 -2
- package/textarea/textarea.umd.js +14 -4
- package/textbox/maskedtextbox.d.ts +2 -0
- package/textbox/multilinetextbox.d.ts +2 -0
- package/textbox/numerictextbox.d.ts +2 -0
- package/textbox/passwordtextbox.d.ts +2 -0
- package/textbox/textbox.d.ts +2 -0
- package/textbox/textbox.esm.js +1 -1
- package/textbox/textbox.umd.js +2 -3
- package/threedchart/threedchart.d.ts +2 -0
- package/threedchart/threedchart.esm.js +1 -1
- package/threedchart/threedchart.umd.js +2 -3
- package/timeinput/timeinput.d.ts +2 -0
- package/timeinput/timeinput.esm.js +1 -1
- package/timeinput/timeinput.umd.js +2 -3
- package/timepicker/datetimepicker.d.ts +2 -0
- package/timepicker/timepicker.d.ts +2 -0
- package/timepicker/timepicker.esm.js +1 -1
- package/timepicker/timepicker.umd.js +2 -3
- package/toast/toast.d.ts +2 -0
- package/toast/toast.esm.js +1 -1
- package/toast/toast.umd.js +2 -3
- package/tooltip/tooltip.d.ts +2 -0
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.umd.js +2 -3
- package/tree/tree.d.ts +12 -0
- package/tree/tree.esm.js +9 -2
- package/tree/tree.umd.js +10 -4
- package/tree/treeitem.d.ts +2 -0
- package/tree/treeitemsgroup.d.ts +2 -0
- package/validator/validator.d.ts +2 -0
- package/validator/validator.esm.js +1 -1
- package/validator/validator.umd.js +2 -3
- package/waitwindow/waitwindow.d.ts +2 -0
- package/waitwindow/waitwindow.esm.js +1 -1
- package/waitwindow/waitwindow.umd.js +2 -3
- package/window/alertwindow.d.ts +2 -0
- package/window/dialogwindow.d.ts +2 -0
- package/window/multilinewindow.d.ts +2 -0
- package/window/progresswindow.d.ts +2 -0
- package/window/promptwindow.d.ts +2 -0
- package/window/tabswindow.d.ts +2 -0
- package/window/waitwindow.d.ts +2 -0
- package/window/window.d.ts +2 -0
- package/window/window.esm.js +1 -1
- package/window/window.umd.js +2 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI v18.0.
|
|
2
|
+
/* Smart UI v18.0.11 (2024-02-10)
|
|
3
3
|
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
|
-
Smart.Utilities.Assign("Grid.Cell",class{constructor(e,t){const l=this;if(l.row=e,l.column=t,l.grid=e.grid,l.rowSpan=1,l.colSpan=1,l.value=void 0,l.fontSize=null,l.fontWeight=null,l.fontFamily=null,l.fontStyle=null,l.color=null,l.background=null,l.textDecoration=null,l.tooltip=null,l.align=null,l.verticalAlign=null,l.readonly=!1,l.oldValue=void 0,l._updating=!1,l.styleChanged=!0,l.editor=null,l.template=null,l.isEditing=!1,l.canNotify=!0,l.selected=!1,l.focused=!1,l.error=!1,l.format=null,l.formula=null,e._style){const t=e._style;l.color=t.color,l.background=t.background,l.fontFamily=t.fontFamily,l.fontSize=t.fontSize,l.fontStyle=t.fontStyle,l.textDecoration=t.textDecoration,l.fontWeight=t.fontWeight}if(l.grid&&l.grid.formulas){let a=e.data[t.dataField];t.formula&&(l.formula=l._parseFormula(t.formula)),a&&(""+a).startsWith("=")&&(l.formula=l._parseFormula(""+a))}return new Proxy(l,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){if("value"===t){const e=l.column.displayField?l.row.data[l.column.displayField]:l.row.data[l.column.dataField];if(l.grid&&l.grid.formulas&&l.formula){const e=l.grid._formulaParser;if(e)return e.parse(l.formula.slice(1))}return e}if("editor"===t||"template"===t)return e[t]||l.column[t];if("focused"===t){if(l.grid.selection.allowCellSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===l.row.id&&l.grid._selection.focusedCell.dataField===l.column.dataField)return!(l.grid&&l.grid.dataSource.virtualDataSource&&!l.grid.dataSource.id)||l.grid._selection.focusedCell.id===l.row.index;if(l.grid.selection.allowRowSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===l.row.id&&l.grid._selection.focusedCell.dataField===l.column.dataField)return!(l.grid&&l.grid.dataSource.virtualDataSource&&!l.grid.dataSource.id)||l.grid._selection.focusedCell.id===l.row.index;const e=l.parent();return!!(e&&l.grid.selection.allowCellSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===e.row.id&&l.grid._selection.focusedCell.dataField===e.column.dataField)}if("selected"===t)return!0===l.row.getProperty("selected")||!0===l.column.getProperty("selected")||!!l.grid._selection.cells["row"+l.row.id]&&l.grid._selection.cells["row"+l.row.id][l.column.dataField];if("modifiedValue"===t){l.grid._cellsUpdatedValues||(l.grid._cellsUpdatedValues=[]);const t=l.grid._cellsUpdatedValues[l.row.id+"_"+l.column.dataField];return void 0!==t?t:e.value}return e[t]},set:function(e,a,i){const r=this.get(e,a);return r===i||(e[a]=i,!("element"!==a&&"isEditing"!==a&&"oldValue"!==a&&"_updating"!==a&&"notifyFn"!==a&&!a.startsWith("_")&&"canNotify"!==a)||("error"===a||("focused"===a&&(l.grid._selection.focusedCell={id:l.row.id,dataField:l.column.dataField,value:l.value,index:l.row.index}),"colSpan"!==a&&"rowSpan"!==a||i>=0&&-1===l.grid._cellsMerge.indexOf(l)&&l.grid._cellsMerge.push(l),"row"===a||"column"===a||"grid"===a||"styleChanged"===a||"formula"===a?("formula"===a&&(l.formula=l._parseFormula(l.formula)),!0):("background"!==a&&"fontSize"!==a&&"fontWeight"!==a&&"fontFamily"!==a&&"textDecoration"!==a&&"color"!==a&&"fontStyle"!==a||(l.grid._cellStyles["row"+l.row.id]=!0,l.grid._cellStyles.length++,l._styleChanged=!0),"value"===a&&(void 0===l.oldValue&&(l.oldValue=r),(()=>{l.grid.dataSource.boundSource.canNotify=!1,null===i&&(l.column.allowNull||(i="number"===l.column.dataType||"int"===l.column.dataType||"float"===l.column.dataType||"integer"===l.column.dataType?0:"date"===l.column.dataType?new Date:"boolean"!==l.column.dataType&&"bool"!==t.dataType&&"")),void 0===i&&(i=null),null!==i&&i.label&&i.value?(l.row.data[l.column.displayField]=i.label,l.row.data[l.column.dataField]=i.value):(l.column.valueField&&(l.row.data[l.column.valueField]=i),l.row.data[l.column.dataField]=i);const e=l.grid.dataSource.dataItemById[l.row.id];if(e){const t=e.$.index;l.grid.dataSource&&i!==l.grid.dataSource.boundSource[t][l.column.dataField]&&(l.grid._sortedColumns&&l.grid._sortedColumns.length>0?e[l.column.dataField]=i:l.grid.dataSource.boundSource[t][l.column.dataField]=i)}l.grid.dataSource.boundSource.canNotify=!0})()),"selected"===a&&(l.grid._selection.cells["row"+l.row.id]&&(delete l.grid._selection.cells["row"+l.row.id][l.column.dataField],1===Object.getOwnPropertyNames(l.grid._selection.cells["row"+l.row.id]).length&&delete l.grid._selection.cells["row"+l.row.id]),l.grid._selection.cells["column"+l.column.dataField]&&(delete l.grid._selection.cells["column"+l.column.dataField][l.row.id],1===Object.getOwnPropertyNames(l.grid._selection.cells["column"+l.column.dataField]).length&&delete l.grid._selection.cells["column"+l.column.dataField]),i&&(l.grid._selection.cells["row"+l.row.id]||(l.grid._selection.cells["row"+l.row.id]=[]),l.grid._selection.cells["column"+l.column.dataField]||(l.grid._selection.cells["column"+l.column.dataField]=[]),l.grid._selection.cells["row"+l.row.id][l.column.dataField]=!0,l.grid._selection.cells["column"+l.column.dataField][l.row.id]=!0)),!(!l._updating&&l.canNotify&&(l.grid._recycle(),l.row.canNotify&&(l.propertyChanged&&l.propertyChanged(name.substring(1),r),0)))))))}})}_parseFormula(e){let t=0;const l=this.row;if(!e)return e;for("string"!=typeof e&&(e=""+e),!1===e.startsWith("=")&&(e="="+e);e.indexOf("COL")>=0;){const a=e.indexOf("COL"),i=a+e.substring(a).indexOf(")"),r=e.substring(a,i+2),s=e.substring(i+2,i+3);let n="";if(n=isNaN(parseInt(s))?r.replace("COL(","").replace(")",1+l.index):r.replace("COL(","").replace(")",""),e=e.replace(r,n),t++,t>10)break}return e}setStyle(e){this.setProperties(e)}_setStyle(e){const t=this;if(t._styleChanged){if(!t.grid._cellStyles.length)return;let l="";const a={background:"background",color:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",textDecoration:"text-decoration"},i=e=>{const i=t[e];if(""===i||null===i)return;const r=a[e];l+=`${r}: ${i};`},r=["background","color","fontSize","fontFamily","fontWeight","fontStyle","textDecoration"];for(let e=0;e<r.length;e++)i(r[e]);e.getAttribute("style")!==l&&(""===l?e.removeAttribute("style"):e.setAttribute("style",l)),""!==e.style.paddingBottom&&(e.style.paddingBottom=""),t._styleChanged=!1}t.grid&&!t.grid.appearance.showSelectionOnTop||t.selected&&(t.background||t.color)&&(e.style.background="",e.style.color="")}getFormattedValue(e,t){const l=this;if(null==e||""===e)return e;if(!t)return""+e;if(l.column._cellsCachedValues||(l.column._cellsCachedValues=[]),l.column._cellsCachedValues[""+e+t+l.column.grid.locale])return l.column._cellsCachedValues[""+e+t+l.column.grid.locale];if("date"===l.column.dataType||"datetime"===l.column.dataType||"time"===l.column.dataType){if("dateRangeInput"===l.column.editor.template){if(Array.isArray(e)){const a=l.formatDate(e[0],t)+" - "+l.formatDate(e[1],t);return l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}{const a=l.formatDate(e,t);return l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}}let a=l.formatDate(e,t);return"1/1/0001 12:00 AM"===a&&(a=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}if("int"===l.column.dataType||"int64"===l.column.dataType||"float"===l.column.dataType||"number"===l.column.dataType){let a=l.formatNumber(e,t);return"NaN"===a&&(a=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}if("any"===l.column.dataType||"string"===l.column.dataType&&t&&t.length){let a=!1;if(t.indexOf("d")>=0&&t.indexOf("M")>=0&&(a=!0),(t.indexOf("d")>=0||t.indexOf("M")>=0||t.indexOf("y")>=0||t.indexOf("h")>=0||t.indexOf("H")>=0||t.indexOf("m")>=0)&&(a=!0),a){let a=l.formatDate(e,t);return"1/1/0001 12:00 AM"===a&&(a=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}{"string"==typeof e&&(e=parseFloat(e));let a=l.formatNumber(e,t);return"NaN"===a&&(a=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=a,a}}return e}formatDate(e,t){if(!Smart.Utilities.DateTime)return e;const l=this,a=l.grid;if(l.column.formatSettings.Intl&&l.column.formatSettings.Intl.DateTimeFormat)return new Intl.DateTimeFormat(this.grid.locale,l.column.formatSettings.Intl.DateTimeFormat).format(e);!t&&l.column.formatSettings.dateFormat&&(t=l.column.formatSettings.dateFormat);try{const l=new Smart.Utilities.DateTime(e);l.calendar.locale=a.locale,a.messages[a.locale]&&a.messages[a.locale].calendar&&(a.messages[a.locale].calendar.months&&(l.calendar.months=a.messages[a.locale].calendar.months),a.messages[a.locale].calendar.days&&(l.calendar.days=a.messages[a.locale].calendar.days),void 0!==a.messages[a.locale].calendar.firstDay&&(l.calendar.firstDay=a.messages[a.locale].calendar.firstDay),void 0!==a.messages[a.locale].calendar.eras&&(l.calendar.eras=a.messages[a.locale].calendar.eras),void 0!==a.messages[a.locale].calendar.AM&&(l.calendar.AM=a.messages[a.locale].calendar.AM),void 0!==a.messages[a.locale].calendar.PM&&(l.calendar.PM=a.messages[a.locale].calendar.PM),void 0!==a.messages[a.locale].calendar["/"]&&(l.calendar["/"]=a.messages[a.locale].calendar["/"]),void 0!==a.messages[a.locale].calendar[":"]&&(l.calendar[":"]=a.messages[a.locale].calendar[":"]),l.calendar.today=a.messages[a.locale].today);let i=l.toString(t);return i!==a.messages[a.locale].today||a.showTodayDateAsString||(l.showTodayDateAsString=!1,i=l.toString(t),delete l.showTodayDateAsString),i}catch(t){return e}}formatNumber(e,t){if(!Smart.Utilities.NumberRenderer)return e;const l=this,a=l.grid;if(l.column.formatSettings.Intl&&l.column.formatSettings.Intl.NumberFormat){if(l.column.formatSettings.Intl.NumberFormat.currency&&Smart.Utilities.CurrencyFormatter){const t=void 0!==l.column.formatSettings.Intl.NumberFormat.maximumFractionDigits?l.column.formatSettings.Intl.NumberFormat.maximumFractionDigits:2,a=(new Smart.Utilities.CurrencyFormatter).format(e,{decimalPlaces:t,currency:l.column.formatSettings.Intl.NumberFormat.currency});return"accounting"===l.column.formatSettings.Intl.NumberFormat.currency.currencySign&&e<0?"("+a.replace("-","")+")":a}if(l.column.formatSettings.Intl.NumberFormat.locale)return new Intl.NumberFormat(l.column.formatSettings.Intl.NumberFormat.locale,l.column.formatSettings.Intl.NumberFormat).format(e);{const t=new Intl.NumberFormat(this.grid.locale,l.column.formatSettings.Intl.NumberFormat).format(e);return"squaremeter"===l.column.formatSettings.Intl.NumberFormat.type?t+" m²":"cubicmeter"===l.column.formatSettings.Intl.NumberFormat.type?t+" m³":t}}const i=new Smart.Utilities.NumberRenderer;if(i.localizationObject){const e=l.column.formatSettings,t=a.messages[a.locale]?a.messages[a.locale].calendar:{};e.decimalPlaces&&(i.localizationObject.decimalPlaces=e.decimalPlaces),(e.decimalSeparator||t.decimalSeparator)&&(i.localizationObject.decimalSeparator=e.decimalSeparator||t.decimalSeparator,i.localizationObject.decimalseparator=i.localizationObject.decimalSeparator),(e.thousandsSeparator||t.thousandsSeparator)&&(i.localizationObject.thousandsSeparator=e.thousandsSeparator||t.thousandsSeparator,i.localizationObject.thousandsseparator=i.localizationObject.thousandsSeparator),i.localizationObject.currencysymbol=t.currencySymbol,i.localizationObject.currencysymbolposition=t.currencySymbolPosition,e.prefix&&(i.localizationObject.currencysymbol=e.prefix),e.sufix&&(i.localizationObject.currencysymbol=e.sufix,i.localizationObject.currencysymbolposition="after")}const r=i.formatNumber(e,t);return void 0===r?e:e<0&&l.column.formatSettings.negativeWithBrackets?"("+r+")":r}refresh(){const e=this;if(e.element){const t=e.element.firstChild;e._setStyle(t)}}autoWrap(){const e=this;e.element&&e.element._autoWrap()}setProperties(e){const t=this;t._updating=!0;for(let l in e)t[l]=e[l];t._updating=!1,t.grid._recycle()}createElement(){const e=document.createElement("smart-grid-cell");return e.setAttribute("role","gridcell"),this.element=e,e._initialize(this),e}render(){this.element&&this.element._render()}parent(e){const t=this,l=t.row,a=t.column.dataField,i=t.grid;if(!i._cellsMerge.length)return null;if(t.__parentCells&&void 0!==t.__parentCells["row"+l.id+"_column_"+a])return t.__parentCells["row"+l.id+"_column_"+a];let r=i.getVisibleRows();i.paging.enabled&&"page"===i.selection.selectAllMode&&(r=r.slice(i.paging.pageIndex*i.paging.pageSize,(i.paging.pageIndex+1)*i.paging.pageSize)),t.__parentCells||(t.__parentCells=[]);for(let s=0;s<i._cellsMerge.length;s++){const n=i._cellsMerge[s];let o=[],d=[];if(o.push(n.row),n.rowspan>1){const e=r.indexOf(n.row);if(e>=0)for(let t=e;t<e+n.rowSpan;t++)r[t]&&-1===o.indexOf(r[t])&&o.push(r[t])}if(d.push(n.column.dataField),n.colspan>1){const e=i.columns.indexOf(i.columnByDataField[n.column.dataField]);for(let t=e;t<e+n.colSpan;t++)i.columns[t]&&-1===d.indexOf(i.columns[t].dataField)&&d.push(i.columns[t].dataField)}if(o.indexOf(l)>=0&&d.indexOf(a)>=0){if(e){const e={cell:n.row.getCell(n.column.dataField),rows:o,columns:d,row:n.row,column:n.column,endRow:o[o.length-1],endColumn:i.columnByDataField[d[d.length-1]]};return t.__parentCells["row"+l.id+"_column_"+a]=e,e}const r=n.row.getCell(n.column.dataField);return t.__parentCells["row"+l.id+"_column_"+a]=r,r}}return t.__parentCells["row"+l.id+"_column_"+a]=null,null}}),Smart("smart-grid-cell",class extends Smart.BaseElement{static get properties(){return{}}get hasStyleObserver(){return!1}get enableShadowDOM(){return!1}addThemeClass(){}addDefaultClass(){}get isUtilityElement(){return!0}_refresh(){const e=this;e.innerHTML="",e._initialize(e.cell)}_createToggleButton(e,t){const l=this,a=document.createElement("div"),i=document.createElement("button"),r=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),o=document.createElement("span"),d=t.grid;t.row.expanded?i.setAttribute("toggled",""):i.removeAttribute("toggled",""),i.tabIndex=-1,l.toggleButton=i,l.checkbox=n,e.appendChild(a),e.appendChild(s),s.setAttribute("content",""),a.setAttribute("indent",""),r.setAttribute("label",""),i.setAttribute("toggle-button",""),n.setAttribute("checkbox",""),n.setAttribute("role","checkbox"),l.setAttribute("has-toggle-button",""),s.appendChild(i),s.appendChild(n),o.classList.add("smart-input"),n.appendChild(o),d.checkBoxes.visible?o.classList.remove("smart-hidden"):o.classList.add("smart-hidden"),s.appendChild(r),l.content=r}_initialize(e){const t=this,l=document.createElement("div"),a=e.column,i=e.grid;t._properties=[],t.cell=e,t.appendChild(l);let r=!1;if(a&&a._treeColumn&&i.dataSource.boundHierarchy&&(r=!0,e.row.filterRow&&(r=!1),!i.grouping.enabled&&i.dataSource.groupBy&&i.dataSource.groupBy.length>0&&(r=!1),i.grouping.enabled&&i.dataSource.groupBy&&0===i.dataSource.groupBy.length&&(r=!1)),r)return t._createToggleButton(l,e),void(t.isRendered=!0);{const e=document.createElement("div");l.appendChild(e)}t.content=l,t.isRendered=!0}_renderCommands(){const e=this,t=e.cell.grid;if(t.__cellsCommandTemplate)return e.firstChild.innerHTML=t.__cellsCommandTemplate,void t._updateCommandColumnCommandsVisibility(e.firstChild,e.cell.row);const l=t._getCommandColumnCommandsTemplate();e.firstChild.innerHTML=l,t._updateCommandColumnCommandsVisibility(e.firstChild,e.cell.row),t.__cellsCommandTemplate=l}_renderGroupCell(){const e=this,t=e.cell.grid,l=e.cell.column,a=e.cell.row;[...e.attributes].forEach((t=>e.removeAttribute(t.name))),e.setAttribute("group","");const i=l===t._firstRenderedColumn;e.style.width!==l.computedWidth+"px"&&(e.style.width=l.computedWidth+"px"),i||(t.rightToLeft?e.style.right!==l.left+"px"&&(e.style.right=l.left+"px"):e.style.left!==l.left+"px"&&(e.style.left=l.left+"px")),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),l===t._firstRenderedColumn||a.summaryRow||e.classList.add("smart-hidden"),l.autoGenerated&&(e.style.width="0px");let r=a.label;const s=function(e,t,l){if(!t)return[];for(let a=0;a<t.length;a++){const i=t[a];i.$&&!1===i.$.filtered||(void 0!==i[e]&&l.push(i),i.summaryRow||(i.children||i.data&&i.data.children)&&s(e,i.children,l))}return l};if(void 0!==a.label){let n="",o=[];if(t.grouping.summaryRow.visible){let r=[];const d={},c=i?l.summary.length>0?l.summary:["count"]:l.summary;c.length&&(r=s(l.dataField,a.summaryRow?a.parent.data.children:a.data.children,[])),d[l.dataField]=c;const m=c.length>0?t.dataSource.summarize([d],r):null;if(m)for(let r=0;r<c.length;r++){const s=c[r];r>0&&(n+=", ");let u=m[l.dataField][s];const p=l.cellsFormat;if(p&&(u=e.cell.getFormattedValue(u,p)),i){const i=t.columnByDataField[a.groupDataField];if(i){d[i.dataField]=c,m[i.dataField]=m[l.dataField],u=m[i.dataField][s];const t=i.cellsFormat;t&&(u=e.cell.getFormattedValue(u,t))}}n+=t.localize(s,{value:u}),o.push(m[l.dataField][s])}}if(t.dataSource.virtualDataSourceOnExpand&&(n=""),i){const l=t.columnByDataField[a.groupDataField],i=l?l.label:"";if("advanced"===t.grouping.renderMode){if(a.summaryRow)r="<div header group-advanced><span group></span><span value></span>",n&&(r+="<div summary>",r+=n,r+="</div>");else{let e=a.label?a.label:t.localize("blankSummary");a.label||"taskStatus"!==a.groupDataField||(e="");let s="";if(l&&l.editor&&l.editor.dataSource){const t=l.editor.dataSource.find((t=>t.value===e||t.label===e));t&&t.color?(s=`--smart-primary: ${t.color}`,t.label&&(e=t.label)):t&&t.label&&(e=t.label)}if(a.label||"taskStatus"!==a.groupDataField||(e=t.localize("uncategorized")),"object"==typeof e&&l.cellsFormat){const t=a.getCell(l.dataField);e=t.getFormattedValue(e,l.cellsFormat)}else if("object"==typeof e&&e&&e instanceof Date){const t=a.getCell(l.dataField);e=t.getFormattedValue(e,"d")}r=`<div style="${s}" header group-advanced><span group>${t.editing.addNewRow.visible?'<span add-row class="smart-grid-icon smart-icon-plus-circled show"></span>':""}${i}: </span><span value>${e}</span>`,n&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=""+n,r+="</span>")}r+="</div>",e.classList.add("smart-grid-column-border-collapse")}else if("compact"===t.grouping.renderMode){if(a.summaryRow)r="<div header><span group></span><span value></span>",n&&(r+="<div summary>",r+=n,r+="</div>");else{let e=a.label;l.displayField!==l.dataField&&a.data.data&&(e=a.data.data[l.displayField]),"object"==typeof e&&l.cellsFormat&&(e=a.getCell(l.dataField).getFormattedValue(e,l.cellsFormat)),r="<div header><span group>"+i+": </span><span value>"+e+"</span>",n&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>")}r+="</div>",e.classList.add("smart-grid-column-border-collapse")}else"basic"===t.grouping.renderMode?(r=a.label,l.displayField!==l.dataField&&a.data.data&&(r=a.data.data[l.displayField]),"object"==typeof r&&l.cellsFormat&&(r=a.getCell(l.dataField).getFormattedValue(r,l.cellsFormat)),a.summaryRow?n&&(r+="<div summary>",r+=n,r+="</div>"):n&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>"),e.classList.add("smart-grid-column-border-collapse")):"multipleColumns"===t.grouping.renderMode&&(r=a.label,"object"==typeof r&&l.cellsFormat&&(r=a.getCell(l.dataField).getFormattedValue(r,l.cellsFormat)),a.summaryRow?n&&(r+="<div summary>",r+=n,r+="</div>"):n&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>"),e.classList.add("smart-grid-column-border-collapse"));e.setAttribute("has-toggle-button","")}else e.removeAttribute("has-toggle-button",""),r=n}let n=e.firstChild;if(t.dataSource.boundHierarchy&&i){n.children.length<=1&&(e.innerHTML="<div></div>",n=e.firstChild,e._createToggleButton(n,e.cell),n=e.firstChild);const s=n.children[0],o=n.children[1].children[0],d=n.children[1].children[1].firstChild,c=n.children[1].children[2];s.setAttribute("indent",""),a.checked?d.setAttribute("checked",""):!1===a.checked?d.removeAttribute("checked"):null===a.checked&&d.setAttribute("checked","indeterminate"),a.leaf?o.classList.add("smart-visibility-hidden"):(o.classList.remove("smart-visibility-hidden"),a.expanded?o.setAttribute("toggled",""):o.removeAttribute("toggled",""));let m="";if(!l._treeColumn||a.summaryRow||a.filterRow?e.toggleButton.classList.add("smart-hidden"):e.toggleButton.classList.remove("smart-hidden"),l._treeColumn)if(t.grouping.enabled){let e=a.level-1;if(1+e===0)m+="",s.classList.add("smart-hidden");else{if("multipleColumns"===t.grouping.renderMode){let l=0;for(let a=0;a<t.columns.length;a++)a<1+e&&(l+=t.columns[a].computedWidth);m+='<div style="width: '+l+'px;"></div>'}else m+='<div style="width: '+(1+e)*t.grouping.groupIndent+'px;"></div>';s.classList.remove("smart-hidden")}}else for(let e=0;e<a.level;e++)m+="<div class='smart-indent'></div>";if(void 0===a.label||a.summaryRow||a.filterRow?o.classList.add("smart-hidden"):(o.classList.remove("smart-hidden"),o.style.marginLeft=""),s.innerHTML=m,c.innerHTML=r,i&&t.grouping.formatFunction){const i={row:a,column:l,groupDataField:a.groupDataField,cell:e.cell,value:r,template:null};t.grouping.formatFunction(i),i.value!==r?c.innerHTML=i.value:i.template&&(c.innerHTML=i.template)}t.appearance.showTooltips?c.setAttribute("title",a.label?a.label:t._unescapeString(r)):c.hasAttribute("title")&&c.removeAttribute("title")}else void 0!==a.label&&t.grouping.enabled&&!i&&(n.innerHTML=r);let o="smart-label";e.style.zIndex="";const d=t.editing.addNewColumn.visible?t._addNewColumn.width-1:0;if(i){const l=t.columnByDataField[a.groupDataField];l.cellsAlign&&(o+=" align-"+l.cellsAlign),l.cellsVerticalAlign&&(o+=" align-"+l.cellsVerticalAlign),e.setAttribute("header",""),a.summaryRow||(e.style.width="calc(100% - "+d+"px)"),void 0!==a.label&&(e.style.zIndex=11)}else l===t._firstRenderedColumn&&(e.style.zIndex=4),e.setAttribute("header",""),a.summaryRow||(e.style.width="calc(100% - "+d+"px)");if(a.summaryRow&&(e.setAttribute("header",""),e.classList.add("smart-grid-column-border-collapse"),l.cellsAlign&&(o+=" align-"+l.cellsAlign),l.cellsVerticalAlign&&(o+=" align-"+l.cellsVerticalAlign)),n.className!==o&&(n.className=o),l.formatFunction){const t={row:a,column:l,cell:e.cell,value:null,template:null,group:{value:r,template:null}};l.formatFunction(t),t.group.value!==r&&(l._treeColumn?n.children[1].children[2].innerHTML=t.group.value:n.innerHTML=t.group.value),null!==t.group.template&&(n.innerHTML=t.group.template)}}_renderFilterCell(e){const t=this,l=t.cell.grid,a=t.cell.column;let i;const r=(e,t)=>{l._handleFilterMenuClick(e,t)};l._filterInfo||(l._filterInfo={},l._filterInfo.stringConditions=[{icon:"smart-icon-contains",command:r,value:"CONTAINS",label:l.localize("CONTAINS")},{icon:"smart-icon-does-not-contain",command:r,value:"DOES_NOT_CONTAIN",label:l.localize("DOES_NOT_CONTAIN")},{icon:"smart-icon-starts-with",command:r,value:"STARTS_WITH",label:l.localize("STARTS_WITH")},{icon:"smart-icon-ends-with",command:r,value:"ENDS_WITH",label:l.localize("ENDS_WITH")},{icon:"smart-icon-equals",command:r,value:"EQUAL",label:l.localize("EQUAL")},{icon:"smart-icon-delete",command:r,value:"CLEAR_FILTER",label:l.localize("CLEAR_FILTER")}],l._filterInfo.numberAndDateConditions=[{icon:"smart-icon-equals",command:r,value:"EQUAL",label:l.localize("EQUAL")},{icon:"smart-icon-not-equal",command:r,value:"NOT_EQUAL",label:l.localize("NOT_EQUAL")},{icon:"smart-icon-less-than",command:r,value:"LESS_THAN",label:l.localize("LESS_THAN")},{icon:"smart-icon-less-than-equal",command:r,value:"LESS_THAN_OR_EQUAL",label:l.localize("LESS_THAN_OR_EQUAL")},{icon:"smart-icon-greater-than",command:r,value:"GREATER_THAN",label:l.localize("GREATER_THAN")},{icon:"smart-icon-greater-than-equal",command:r,value:"GREATER_THAN_OR_EQUAL",label:l.localize("GREATER_THAN_OR_EQUAL")},{icon:"smart-icon-between",command:r,value:"RANGE",label:l.localize("RANGE")},{icon:"smart-icon-delete",command:r,value:"CLEAR_FILTER",label:l.localize("CLEAR_FILTER")}]),i="string"===a.dataType?l._filterInfo.stringConditions:l._filterInfo.numberAndDateConditions;let s="smart-icon-search";if(a._filterInfo||(a._filterInfo={condition:""}),a.filterEditor&&a.filterEditor.condition&&(a._filterInfo.condition=a.filterEditor.condition),a.filterEditor&&a.filterEditor.value&&(a._filterInfo.value=a.filterEditor.value),a._filterInfo.dataSource=i,null===a._filterInfo.condition||void 0===a._filterInfo.condition)a._filterInfo.condition="",s="smart-icon-search";else switch(a._filterInfo.condition.toLowerCase()){case"equal":s="smart-icon-equals";break;case"starts_with":s="smart-icon-starts-with";break;case"ends_with":s="smart-icon-ends-with";break;case"not_equal":s="smart-icon-not-equal";break;case"less_than":s="smart-icon-less-than";break;case"less_than_or_equal":s="smart-icon-less-than-or-equal";break;case"greater_than":s="smart-icon-greater-than";break;case"greater_than_or_equal":s="smart-icon-greater-than-or-equal";break;case"contains":s="smart-icon-contains";break;case"does_not_contain":s="smart-icon-does-not-contain";break;case"range":s="smart-icon-between";break;default:s="smart-icon-search"}let n=`<div class="smart-filter-input-type"><i class="smart-grid-icon ${s} show"></i></div> `;if("string"===a.dataType)n+=`<input class="smart-filter-input-value" data-type="${a.dataType}" /> `,e.innerHTML=n;else if("date"===a.dataType){const i=new Smart.Utilities.DateTime;n+=`<input placeholder = "${i.expandFormat(i.calendar,a.cellsFormat||"d")}" class="smart-filter-input-value" data-type="${a.dataType}"/><div class="smart-filter-input-type"><i class="smart-grid-icon smart-icon-calendar show"></i></div>`,e.innerHTML=n,e.lastElementChild.onpointerdown=function(){l._handleFilterCalendarCellClick(t.cell)}}else if("number"===a.dataType)n+='<div class="smart-grid-cell-editor smart-filter-input-value smart-grid-number-input-cell-editor"><input class="smart-input" type="number"><div tabindex="-1" class="nav"><div tabindex="-1" class="up"></div><div tabindex="-1" class="down"></div></div></div>',e.innerHTML=n,l._handleFilterNumberCellEditor(this.cell,e);else if("boolean"===a.dataType||"bool"===a.dataType){const i=document.createElement("div");i.classList.add("smart-input"),i.classList.add("smart-grid-check-box-cell-editor"),i.classList.add("smart-filter-input-value"),e.tabIndex=0,e.style.outline="none",t.setAttribute("template","checkBox"),i.setAttribute("checked","indeterminate"),a._filterInfo&&a._filterInfo.value?i.setAttribute("checked",""):a._filterInfo&&!1===a._filterInfo.value&&i.removeAttribute("checked"),n=i.outerHTML,e.innerHTML=n,e.classList.add("align-center"),e.classList.add("smart-label"),e.onfocus=()=>{e.setAttribute("focus","")},e.onblur=()=>{e.removeAttribute("focus","")},e.onclick=e=>{e.target.classList.contains("smart-input")&&l._handleFilterCellCheckBoxClick(this.cell)}}const o=e.querySelector("input");if(o&&(e.firstElementChild.onpointerdown=function(){l._handleFilterCellIconClick(this.cell)}.bind(this),o.onfocus=function(){l._handleFilterCellFocus(this.cell)}.bind(this),o.onblur=function(){l._handleFilterCellBlur(this.cell)}.bind(this),o.onkeyup=function(e){l._handleFilterCellKeyUp(this.cell,e)}.bind(this),o.onkeydown=function(e){l._handleFilterCellKeyDown(this.cell,e)}.bind(this)),e.classList.add("smart-filter-input-container"),a._filterInfo.input=o,a._filterInfo.cell=t.cell,a._filterInfo.editor=e,a._filterInfo.value&&o&&(o.value=a._filterInfo.value,"date"===a.dataType&&(o.value=t.cell.getFormattedValue(a._filterInfo.value,a.cellsFormat))),a.allowFilter||(o.disabled=!0),a.filterEditor)if(a.filterEditor.template){const t=a.filterEditor.template,l=document.createElement("div");a.filterTemplate instanceof HTMLTemplateElement?l.appendChild(t.content.cloneNode(!0)):t instanceof HTMLElement?l.appendChild(t):l.innerHTML=t,e.innerHTML="",e.appendChild(l),l.style.height="100%",l.style.width="100%";const i=e.querySelector("input");i&&(i.onfocus=()=>{e.setAttribute("focus","")},i.onblur=()=>{e.removeAttribute("focus","")}),a.filterEditor.onInit&&a.filterEditor.onInit(a,l)}else void 0!==a.filterEditor.min&&(o.min=a.filterEditor.min),void 0!==a.filterEditor.max&&(o.max=a.filterEditor.max),void 0!==a.filterEditor.minLength&&(o.minLength=a.filterEditor.minLength),void 0!==a.filterEditor.maxLength&&(o.maxLength=a.filterEditor.maxLength),void 0!==a.filterEditor.placeholder&&(o.placeholder=a.filterEditor.placeholder),void 0!==a.filterEditor.value&&(o.value=a.filterEditor.value),void 0!==a.filterEditor.step&&(o.step=a.filterEditor.step),void 0!==a.filterEditor.disabled&&(o.disabled=a.filterEditor.disabled),void 0!==a.filterEditor.condition&&(a._filterInfo.condition=a.filterEditor.condition),a.filterEditor.onInit&&a.filterEditor.onInit(a,e)}_setTemplate(e,t,l){const a=this,i=a.cell.grid,r=a.cell.column;let s=null;switch((!i.editing.enabled||!r.allowEdit||a.cell.readonly||"none"===i.editing.action||i.editing.enabled&&i.editing.commandColumn.visible&&i.editing.editRow!==a.cell.row)&&a.setAttribute("readonly",""),t){case"checkBox":case"radioButton":case"switchButton":if(l.firstElementChild&&l.firstElementChild.classList.contains("smart-input"))return s=l.firstElementChild,e?s.setAttribute("checked",""):null===e?s.setAttribute("checked","indeterminate"):s.removeAttribute("checked"),void a.setAttribute("template",a.cell.template);s=document.createElement("span"),s.className="smart-input",e?s.setAttribute("checked",""):null===e?s.setAttribute("checked","indeterminate"):s.removeAttribute("checked"),a.setAttribute("template",a.cell.template),l.innerHTML="",l.appendChild(s),a.cell._setStyle(l);break;case"checklist":if(e&&e.indexOf("[")>=0&&(e=JSON.parse(e)),l.firstElementChild&&l.firstElementChild.hasAttribute("value")){const t=l.firstElementChild.getAttribute("value");if(e&&t===e.length)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template)}if(e&&Array.isArray(e)&&e.length>0){const t=e.filter((e=>e.completed)).length,l=["#D50000","#F4511E","#F6BF26","#33B679"],a=t+"/"+e.length;let i=l[0];t===e.length?i=l[3]:t>0&&t<e.length&&(i=l[2]),e=`<div style="display: grid; grid-template-columns: 25px auto"><div style="margin-left: 4px; align-self: center; border-radius: 50%; display: flex; align-content: center; background: ${i}; width:16px; height: 16px;"><span title="${a}" style="align-content: center; font-size: 13px; color: white;" class="smart-grid-icon show smart-icon-check"></span></div>${a}</span></div>`}else e="";s=document.createElement("span"),s.innerHTML=e,a.setAttribute("template",a.cell.template),s.setAttribute("value",e.length);break;case"createdBy":case"updatedBy":{const e=a.cell.row;let n=null,o=null;if(n="createdBy"===t?e.createdBy:e.updatedBy,l.firstElementChild&&l.firstElementChild.hasAttribute("user-id")){if(n===parseInt(l.firstElementChild.getAttribute("user-id")))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);if(null!=n&&-1!==n){o=i.users.find((e=>e.id===n));const e=o;if(e){const t=l.firstElementChild.firstElementChild&&l.firstElementChild.firstElementChild.firstElementChild?l.firstElementChild.firstElementChild.firstElementChild.firstElementChild:null;if(t){l.firstElementChild.setAttribute("user-id",n);const a="string"==typeof e?e:e.name,i="string"==typeof e?null:e.color;if(("string"==typeof e?null:e.image)&&(t.firstElementChild.style.backgroundImage=`url('${e.image}')`),i){const e=new Smart.Color(i).getInvertedColor();t.setAttribute("data-item",a),t.setAttribute("title",a),t.setAttribute("backgroundColor",i),t.setAttribute("color",e),t.lastElementChild.textContent=a}else t.setAttribute("data-item",a),t.setAttribute("title",a),t.setAttribute("backgroundColor",""),t.setAttribute("color","");return}}}}const d=document.createElement("div");d.classList.add("smart-multi-combo-input"),d.setAttribute("data-field",r.dataField),d.setAttribute("row-id",a.cell.row.id),d.style.width="100%",d.style.paddingRight="6px";let c='<div class="smart-flex smart-flex-auto smart-tokens-layout">';if(null!=n&&-1!==n){o=i.users.find((e=>e.id===n));const e=o;if(e){const t="string"==typeof e?e:e.name,l="string"==typeof e?null:e.color,a="string"==typeof e?null:e.image,i=document.createElement("span");a&&(i.style.backgroundImage=`url('${e.image}')`,i.className="smart-drop-down-list-selection-image"),c+=l?'<span title="'+t+'" data-item="'+t+'" style="background: '+l+"; color: "+new Smart.Color(l).getInvertedColor()+'; overflow: visible;" class="smart-truncate smart-token">'+i.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+t+"</span></span>":'<span title="'+t+'" data-item="'+t+'" class="smart-truncate smart-token">'+i.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+t+"</span></span>"}else c=""}d.innerHTML=c+"</div>";const m=document.createElement("div");m.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),d.classList.add("smart-flex-auto"),m.appendChild(d),s=m,s.setAttribute("user-id",n),a.setAttribute("template",a.cell.template);break}case"collaborator":case"tags":{let n=[];"number"==typeof e&&(e=""+e);let o=!1===i.editing.enabled?"smart-visibility-hidden":"",d=r.editor.dataSource&&r.editor.dataSource.length;if(r.editor.collaborator&&(d=i.users&&i.users.length),d||(o="smart-visibility-hidden"),r.relationId&&r.relationField&&e){let t=!1;for(let l=0;l<r.editor.dataSource.length;l++){const a=r.editor.dataSource[l];if(("string"==typeof a?a:a.label)===e){t=!0;break}}t||(e=null)}if(""===e||null===e||"uncategorized"===e){let e=`\n <div class="smart-multi-combo-input-container tokens smart-flex smart-flex-auto" data-field="${r.dataField}" row-id="${a.cell.row.id}"> \n <div class="smart-multi-combo-input" data-field="${r.dataField}" row-id="${a.cell.row.id}" class="tokens smart-flex smart-flex-auto">\n <div class=" smart-flex-auto smart-flex"></div>\n </div>\n <span class="smart-arrow-down arrowbtn ${o}"></span>\n </div>\n `;l.innerHTML!==e&&(l.firstElementChild&&l.firstElementChild.firstElementChild&&l.firstElementChild.firstElementChild.firstElementChild&&""===l.firstElementChild.firstElementChild.firstElementChild.textContent?(l.firstElementChild.setAttribute("row-id",a.cell.row.id),l.firstElementChild.firstElementChild.setAttribute("row-id",a.cell.row.id)):l.innerHTML=e);const t=l.querySelector(".smart-arrow-down");return t&&(t.onpointerdown=e=>{if(i.editing.enabled){const t=e.target.previousElementSibling,l=t.getAttribute("data-field"),a=t.closest("smart-grid-row").getAttribute("data-id");i.beginEdit(a,l)}e.stopPropagation(),e.preventDefault()}),void a.setAttribute("template",a.cell.template)}if(null!==e&&(n=Array.isArray(e)?n.map((e=>e.trim())):e.indexOf("{")>=0||"[]"===e?JSON.parse(e):e.split(",").map((e=>e.trim()))),l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&r.editor._items&&l.firstElementChild.getAttribute("value")===e){if(a.cell._setStyle(l),a.setAttribute("template",a.cell.template),l.firstElementChild&&l.firstElementChild.firstElementChild&&l.firstElementChild.firstElementChild.firstElementChild)if(l.firstElementChild.firstElementChild.firstElementChild.classList.remove("smart-flex-wrap"),a.cell.row.height>45){l.firstElementChild.firstElementChild.firstElementChild.classList.add("smart-flex-wrap");const e=l.firstElementChild.firstElementChild.firstElementChild;if(e.children&&e.children.length>1)for(let t=0;t<e.children.length;t++)e.children[t].style.maxWidth&&(e.children[t].style.maxWidth="")}else if(i.layout.rowHeight<=45&&a.cell.row.height<=45){const e=l.firstElementChild.firstElementChild.firstElementChild;if(e.children&&e.children.length>1){const t=parseInt(r.computedWidth/e.children.length)-5;let l=0;for(let t=0;t<e.children.length;t++)l+=e.children[t].textContent.length,e.children[t].style.maxWidth="";if(14*l*.52+20*e.children.length>r.computedWidth)for(let l=0;l<e.children.length;l++)e.children[l].style.maxWidth=t+"px"}}return}const c=document.createElement("div");c.classList.add("smart-multi-combo-input"),c.setAttribute("data-field",r.dataField),c.setAttribute("row-id",a.cell.row.id);let m='<div class="smart-tokens-layout smart-flex smart-flex-auto">';n.length>2&&a.cell.row.height>45&&(m='<div style="max-width: '+(r.computedWidth-10)+'px" class="smart-flex smart-flex-wrap">');let u=0;if(e)for(let e=0;e<n.length;e++){const l=n[e];let a=null;if("collaborator"===t||r.editor&&r.editor.collaborator)a=i.users.find((e=>{if("string"==typeof l||"number"==typeof l){if(e.value===l||parseInt(e.value)===parseInt(l))return e;if(e.id===l||parseInt(e.id)===parseInt(l))return e}else if("object"==typeof l&&e.value===l.value)return e})),a&&(a.label=a.name);else if(r.editor.dataSource)if("string"==typeof l&&r.editor._items&&r.editor._items[l])a=r.editor._items[l];else for(let e=0;e<r.editor.dataSource.length;e++){const t=r.editor.dataSource[e];if(void 0!==t.value&&void 0!==l&&void 0!==l.value&&t.value===l.value){a=t,r.editor._items||(r.editor._items=[]),r.editor._items[l]=t;break}if(void 0===t.value&&t===l||void 0!==t.value&&""+t.value===l){a=t,r.editor._items||(r.editor._items=[]),r.editor._items[l]=t;break}}else a=l;if(!a)continue;const s="string"==typeof a?a:a.label,o="string"==typeof a?null:a.color,d="string"==typeof a?null:a.image;if(""===s)continue;const c=document.createElement("span");d&&(c.style.backgroundImage=`url('${a.image}')`,c.className="smart-drop-down-list-selection-image");const p="smart-truncate";if(o&&r.editor.colorItems?m+='<span title="'+s+'" data-item="'+s+'" style="background: '+o+"; color: "+new Smart.Color(o).getInvertedColor()+'; overflow: visible;" class="'+p+' smart-token">'+c.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>":m+='<span title="'+s+'" data-item="'+s+'" class="'+p+' smart-token">'+c.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>",u+=s.length,r.editor.dataSource){if(r.editor.singleSelect){m+="</span>";break}m+='<span class=\'smart-hidden smart-drop-down-list-unselect-button\' role="button" aria-label="Unselect"></span></span>'}else m+="</span>"}c.innerHTML=m+"</div>";const p=14*u*.52,g=c.firstElementChild;if(i.layout.rowHeight<=45&&a.cell.row.height<=45&&c&&g.children.length>1&&p+20*g.children.length>r.computedWidth){const e=parseInt(r.computedWidth/g.children.length)-5;for(let t=0;t<g.children.length;t++)g.children[t].style.maxWidth=e+"px"}if(c.style.width="100%",a.onmouseenter=()=>{c.style.width="calc(100% - 25px)"},a.onmouseleave=()=>{c.style.width="100%"},c.style.paddingRight="6px",c.onpointerdown=e=>{if(!i._mobile)if(e.target&&"#text"!==e.target.nodeName&&e.target.classList.contains("smart-drop-down-list-unselect-button")){let t=e.target.parentNode.getAttribute("data-item");if(r.editor.dataSource&&"string"==typeof t&&r.editor.dataSource)for(let e=0;e<r.editor.dataSource.length;e++)r.editor.dataSource[e].label===t&&(t=r.editor.dataSource[e],t.value&&(t=t.value));if(n[0]&&n[0].label){const l=n.map((e=>e.value)).indexOf(t);if(l>=0){n.splice(l,1);const t=a.cell.value,s=n.join(", ");i.setCellValue(a.cell.row.id,r.dataField,JSON.stringify(n)),i.onCellUpdate&&i.onCellUpdate([a.cell],[t],[s],(function(){}),a),e.preventDefault(),e.stopPropagation()}}else if(n.indexOf(t)>=0){n.splice(n.indexOf(t),1);const l=a.cell.value,s=n.join(", ");i.setCellValue(a.cell.row.id,r.dataField,s),i.onCellUpdate&&i.onCellUpdate([a.cell],[l],[s],(function(){}),a),e.preventDefault(),e.stopPropagation()}}else if(e.target.classList.contains("smart-drop-down-list-selection-label")){if(i.editing.enabled){const t=e.target.parentElement.parentElement,l=t.getAttribute("data-field"),a=t.getAttribute("row-id");i.beginEdit(a,l)}e.stopPropagation(),e.preventDefault()}},!r.cellsWrap&&r.allowEdit&&i.editing.enabled&&"card"!==i.view){const e=document.createElement("span");e.classList.add("smart-arrow-down","arrowbtn");let t=r.editor.dataSource&&r.editor.dataSource.length;r.editor.collaborator&&(t=i.users&&i.users.length),t||e.classList.add("smart-visibility-hidden");const l=document.createElement("div");l.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),c.classList.add("smart-flex-auto"),c.classList.remove("smart-flex-wrap"),n.length>2&&i.layout.rowHeight>45&&(c.classList.add("smart-flex-wrap"),c.style.maxWidth=r.computedWidth-10+"px"),i.rightToLeft&&(c.style.direction="rtl"),l.appendChild(c),"input"!==r.editor.template&&l.appendChild(e),s=l,e.onpointerdown=e=>{if(!i._mobile){if(i.editing.enabled){const t=e.target.previousElementSibling,l=t.getAttribute("data-field"),a=t.closest("smart-grid-row").getAttribute("data-id");i.beginEdit(a,l)}e.stopPropagation(),e.preventDefault()}}}else if(r.cellsWrap||r.allowEdit){const e=document.createElement("div");e.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),c.classList.add("smart-flex-auto"),c.classList.remove("smart-flex-wrap"),n.length>2&&i.layout.rowHeight>45&&(c.classList.add("smart-flex-wrap"),c.style.maxWidth=r.computedWidth-10+"px"),i.rightToLeft&&(c.style.direction="rtl"),e.appendChild(c),s=e}else c.classList.add("smart-flex-auto"),s=c;a.setAttribute("template",a.cell.template),s.setAttribute("value",e);break}case"dropDownList":case"dropdownlist":case"list":{const t=document.createElement("div");if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&l.firstElementChild.getAttribute("value")===e)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);if(t.innerHTML='<span class="smart-truncate">'+e+"</span>",r.allowEdit&&i.editing.enabled){const e=document.createElement("span");e.classList.add("smart-arrow-down","arrowbtn");const l=document.createElement("div");l.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),t.classList.add("smart-flex-auto","smart-multi-combo-input"),l.appendChild(t),l.appendChild(e),l.classList.add(a.cell.template.toLowerCase()),s=l,e.onpointerdown=e=>{if(!i._mobile){if(i.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=e.target.closest("smart-grid-row"),r=t.getAttribute("data-field"),s=l.getAttribute("data-id");if(i.beginEdit(s,r),a.cell.column.editor&&a.cell.column.editor.instance){const e=a.cell.column.editor,t=e.instance.element;!e.autoOpen&&t.open?t.open():!e.autoOpen&&t.firstElementChild&&t.firstElementChild.open&&setTimeout((()=>{t.firstElementChild.open()}),250)}}e.stopPropagation(),e.preventDefault()}}}else s=t;a.setAttribute("template",a.cell.template.toLowerCase()),s.setAttribute("value",e);break}case"password":l.innerHTML=e?'<span class="smart-truncate">'+e.replace(/./g,"*")+"</span>":"",a.setAttribute("template",a.cell.template);break;case"richText":if(l.innerHTML=e?'<div class="textwrap" style="height: 100%; padding-left: 5px;">'+i._unescapeString(e)+"</div>":"",i.layout.autoWrap&&a.cell.row.height>40&&1===a.cell.colSpan&&"string"===r.dataType&&(null==e&&(e=""),14*e.length*.52>r.computedWidth)){const e=parseInt(a.cell.row.height/20);l.firstElementChild.style["-webkit-line-clamp"]=e}a.setAttribute("template",a.cell.template);break;case"color":l.innerHTML=`<span style="left: calc(50% - 12px); top: calc(50% - 12px); position: absolute; border-radius: 50%; width: 24px; height: 24px; display: block; background:${e};"></span>`,a.setAttribute("template",a.cell.template);break;case"autoNumber":s=document.createElement("span"),s.innerHTML=1+a.cell.row.visibleIndex,a.setAttribute("template",a.cell.template);break;case"createdDate":case"createdTime":{const e=a.cell.getFormattedValue(a.cell.row.createdDate,"d"),t=a.cell.getFormattedValue(a.cell.row.createdDate,"t");if(l.firstElementChild&&l.firstElementChild.hasAttribute("created-date")){const a=e+" "+t;a!==l.firstElementChild.textContent&&(l.firstElementChild.textContent=a)}else l.innerHTML='<span created-date class="align-left smart-truncate">'+e+" "+t+"</span>";a.cell._setStyle(l),a.setAttribute("template",a.cell.template);break}case"updatedDate":case"updatedTime":if(a.cell.row.updatedDate){const e=a.cell.getFormattedValue(a.cell.row.updatedDate,"d"),t=a.cell.getFormattedValue(a.cell.row.updatedDate,"t");if(l.firstElementChild&&l.firstElementChild.hasAttribute("updated-date")){const a=e+" "+t;a!==l.firstElementChild.textContent&&(l.firstElementChild.textContent=a)}else l.innerHTML='<span updated-date class="align-left smart-truncate">'+a.cell.getFormattedValue(a.cell.row.updatedDate,"d")+" "+a.cell.getFormattedValue(a.cell.row.updatedDate,"t")+"</span>"}else l.innerHTML="";a.cell._setStyle(l),a.setAttribute("template",a.cell.template);break;case"progress":{const t=e?parseInt(100*e)+"%":"0%";if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===l.firstElementChild.getAttribute("value"))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);const i="white",r=["#D50000","#F4511E","#F6BF26","#33B679"];let s=r[0];s=e<.25?r[0]:e<.5?r[1]:e<.75?r[2]:r[3],l.innerHTML='<div value="'+t+'" style="padding-left: 5px; padding-right: 5px; display: grid; grid-template-columns: 1fr auto"><div style="height: 100%; display: flex; align-items: center; width: '+t+';"><div title="'+t+'" style="width: 100%; height: 4px; background: '+s+"; color: "+i+';" class="smart-truncate smart-token"></div></div><span>'+t+"</span></div>",a.setAttribute("template",a.cell.template);break}case"rating":{const t=a.cell.column.editor.max?a.cell.column.editor.max:5,r=e?parseInt(e):0;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")){if(r===parseInt(l.firstElementChild.getAttribute("value")))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);l.firstElementChild.setAttribute("value",r);for(let e=0;e<t;e++){const t=l.firstElementChild.children[e];let a="";r>0&&r>e&&(a="value"),a?t.classList.add("value"):t.classList.remove("value")}return void a.setAttribute("template",a.cell.template)}const s=e=>{let l="";for(let a=0;a<t;a++){let t="";e>0&&e>a&&(t="value"),l+=`<div rating-value title="${a+1}" value="${a+1}" class="smart-grid-icon show smart-icon-star ${t}"></div>`}return l};l.innerHTML=`<div value="${r}" class="rating">${s(r)}</div>`;const n=e=>{if(!i._mobile&&e.hasAttribute("rating-value")){const t=e.getAttribute("value"),l=e.closest("smart-grid-cell"),r=e.closest("smart-grid-row");if(l&&r){const e=l.querySelector(".rating"),n=r.getAttribute("data-id"),o=l.getAttribute("data-field"),d=i.rowById[n],c=i.getCellValue(n,o),m=l.cell;let u=null;i.storeHistory&&(u=i._stringifyRow(d)),c===t?(r.row.data[o]=0,e.innerHTML=s(0),e.setAttribute("value",0)):(r.row.data[o]=parseInt(t),e.innerHTML=s(parseInt(t)),e.setAttribute("value",t));const p=r.row.data[o];i._setCellUndoRedo(m,c,p),i.onCellUpdate&&i.onCellUpdate([m],[c],[p],(function(e){i.onCellUpdated&&i.onCellUpdated([m.row.index],[m.row],[m.column],[m.row.data],[c],[p],a),i._onCellUpdated&&i._onCellUpdated(m.row.index,m.row,m.column,m.row.data,c,p)}),a);const g=e=>{if(e!==c&&(d.updatedDate=new Date,d.updatedBy=a.currentUser,i.storeHistory)){const t=i._stringifyRow(d);t[m.column.dataField]=e,i._updateRowHistory(d,u,t)}};if(i.onCellUpdate&&i.onRowHistory){const e=i.onRowHistory;i.onRowHistory=null,g(p),setTimeout((()=>{i.onRowHistory=e}),100)}else g(p);const f=l.querySelector(".rating"),h=parseInt(t)-1;f.children[h].classList.add("down"),setTimeout((()=>{f.children[h].classList.remove("down")}),1e3)}}},o=(e,t=!0)=>{if(e&&[...e.querySelectorAll(".smart-icon-star")].forEach((e=>{e.classList.remove("hover")})),e.hasAttribute("value")){const l=[...e.parentElement.children],a=l.indexOf(e);l.forEach(((e,l)=>{e.classList.remove("hover"),l<=a&&t&&e.classList.add("hover")}))}};i.handleRatingClick||(i._handleRatingMove=o,i._handleRatingClick=n),l.firstElementChild.onpointerdown=e=>{n(e.target)},l.firstElementChild.onpointermove=e=>{o(e.target)},l.firstElementChild.onpointerleave=e=>{o(e.target)},a.setAttribute("template",a.cell.template);break}case"duration":{const t=e;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===l.firstElementChild.getAttribute("value"))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);if(e){const t=864e5;let r="MMM dd",s="MMM dd";if("string"==typeof e[0]&&(Array.isArray(e)?(e[0]=new Date(e[0]),e[1]=new Date(e[1])):((e=e.split(","))[0]=new Date(e[0]),e[1]=new Date(e[1]))),Array.isArray(e)){e[0]&&"string"==typeof e[0]&&(e[0]=new Date(e[0])),e[1]&&"string"==typeof e[1]&&(e[1]=new Date(e[1])),e[1]&&e[1].getMonth()===e[0].getMonth()&&(s="dd"),e[0].getFullYear()!==(new Date).getFullYear()&&(r+=", yyyy","dd"===s?(r="MMM dd",s+=", yyyy"):s=r);let n=!1;0===e[0].getHours()&&0===e[0].getHours()||(r+=" hh:mm","dd"===s?s=r:s+=" hh:mm",n=!0);let o=null;o=Math.round(e[1].getTime()-e[0].getTime())/t;const d=o?parseInt(Math.abs(o).toFixed(0)):0;if(d>0){const t=a.cell.getFormattedValue(e[0],r)+" - "+a.cell.getFormattedValue(e[1],s);let n="";n=i.localize("days",{value:d}),l.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${t}</span><span style="font-size: 11px;" class="smart-quiet">${n}</span></div>`}else{let t="";if(n){const i=e[1]-e[0],s=Math.floor(i%864e5/36e5);let n=Math.round(i%864e5%36e5/6e4);n<10&&(n+="0"+n),t=s+":"+n;const o=a.cell.getFormattedValue(e[0],r)+" - "+a.cell.getFormattedValue(e[1],"hh:mm");l.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${o}</span><span style="font-size: 11px;" class="smart-quiet">${t}</span></div>`}else{const i=a.cell.getFormattedValue(e[0],r);l.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${i}</span><span style="font-size: 11px;" class="smart-quiet">${t}</span></div>`}}}}else l.innerHTML="";a.setAttribute("template",a.cell.template),l.firstElementChild&&l.firstElementChild.setAttribute("value",t);break}case"startDate":{const t=e;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===l.firstElementChild.getAttribute("value"))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);let s=e;if(r.cellsFormat?s=a.cell.getFormattedValue(e,r.cellsFormat):r.formatSettings&&r.formatSettings.Intl&&(s=a.cell.getFormattedValue(e,r.formatSettings.Intl)),e){const t=864e5,n="string"==typeof e?new Date(e):e;let o=i.columnByDataField.taskDueDate;r.editor.boundDataField&&(o=i.columnByDataField[r.editor.boundDataField]);const d=o?a.cell.row.data[o.dataField]:"";let c=null;d&&(c=Math.round(n.getTime()-d.getTime())/t);const m=c?parseInt(Math.abs(c).toFixed(0)):0;if(m>0){let e="";e=i.localize("days",{value:m}),l.innerHTML=`<div style="display: grid; grid-template-columns: 25px auto 25px"><span style="color: var(--smart-primary);" title="${e}" class="smart-icon-clock smart-grid-icon show"></span><span>${s}</span><span style="font-size: 11px;" class="smart-quiet">${e}</span></div>`}else l.innerHTML='<div style="padding-left: 6px;">'+s+"</div>"}else l.innerHTML="";a.setAttribute("template",a.cell.template),a.setAttribute("value",t);break}case"dueDate":{const t=e;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===l.firstElementChild.getAttribute("value"))return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);const s=["#D50000","#F4511E","#F6BF26","#33B679"],n=new Date;n.setHours(0,0,0);let o=e;r.cellsFormat?o=a.cell.getFormattedValue(e,r.cellsFormat):r.formatSettings&&r.formatSettings.Intl&&(o=a.cell.getFormattedValue(e,r.formatSettings.Intl));const d=(e,t)=>{const l=e<=8?e/8:1;return`<div title="${t}" class="smart-element smart-circular-progress-bar" style="background: inherit; padding-left:4px; position: relative; top: calc(50% - 12px); padding-top:4px; width: 20px; height: 20px;">\n <div class="smart-container">\n <svg style="background: var(--smart-background);"width="100%" height="100%" viewPort="0 0 100 100" viewBox="0 0 100 100" role="presentation" aria-hidden="true">\n <circle id="value" class="smart-value-path" r="50" cx="50" cy="50" transform="rotate(270 50 50)"></circle>\n <circle id="value" style="stroke-dashoffset: ${100*Math.PI-(1-l)*Math.PI*100}; stroke-width: 100%;" class="smart-value" r="50" cx="50" cy="50" transform="rotate(270 50 50)"></circle>\n </svg>\n </div>\n </div>\n `};if(e){const c=864e5,m="string"==typeof e?new Date(e):e,u=Math.round(m.getTime()-n.getTime())/c,p=parseInt(Math.abs(u).toFixed(0));let g=i.columnByDataField.taskStatus;r.editor.boundDataField&&(g=i.columnByDataField[r.editor.boundDataField]);const f=g?a.cell.row.data[g.dataField]:"";if("done"===f||"complete"===f||"completed"===f||"finished"===f){let e=i.localize("done");l.innerHTML=`<div style="display: grid; grid-template-columns: 25px auto"><div style="margin-left: 4px; align-self: center; border-radius: 50%; display: flex; align-content: center; background: ${s[3]}; width:16px; height: 16px;"><span title="${e}" style="align-content: center; font-size: 13px; color: white;" class="smart-grid-icon show smart-icon-check"></span></div>${o}</span></div>`}else{let e="";e=0===p?i.localize("today"):1===p?t<n?i.localize("yesterday"):i.localize("tomorrow"):t<n?i.localize("daysOverdue",{value:p}):i.localize("daysLeft",{value:p}),l.innerHTML=t>=n?`<div style="display: grid; grid-template-columns: 25px auto">${d(p,e)}<span>${o}</span></div>`:`<div style="display: grid; grid-template-columns: 25px auto"><span title="${e}" style="font-size: 16px; color: ${s[0]}" class="smart-grid-icon show smart-icon-attention-circled"></span>${o}</span></div>`}}else l.innerHTML="";a.setAttribute("template",a.cell.template),a.setAttribute("value",t);break}case"attachments":{if(""===e||"[]"===e){const e=`<div class="container"><div class="attachments"><div title="${i.localize("addFiles")}" class="smart-grid-icon show smart-icon-plus"></div></div></div>`;return l.innerHTML!==e&&(l.innerHTML=e,l.onpointerdown=e=>{if(e.target.classList.contains("smart-icon-plus")){if(i._mobile)return;if(i.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=t.getAttribute("data-field"),a=t.closest("smart-grid-row").getAttribute("data-id");i.beginEdit(a,l),t.querySelector(".smart-icon-plus").onpointerdown()}e.stopPropagation(),e.preventDefault()}}),a.cell._setStyle(l),void a.setAttribute("template",a.cell.template)}if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")){const t=l.firstElementChild.getAttribute("value");if(e&&e.indexOf(t)>=0)return a.cell._setStyle(l),a.setAttribute("template",a.cell.template),void(l.firstElementChild.evaluateScroll&&l.firstElementChild.evaluateScroll());if(t&&e&&Array.isArray(e)&&e[0]&&e[0].value&&t.length===e[0].value.length)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template)}const t=document.createElement("div"),r=document.createElement("div");t.classList.add("file-container"),r.classList.add("attachments");let n=e;if(i._findIsFile(n)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}if("string"==typeof n&&(n.indexOf("[{")>=0||n.indexOf("}]")>=0)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}Array.isArray(n)&&n.forEach((e=>{const l=document.createElement("div");l.title=e.label,l.classList.add("item"),l.innerHTML="<div></div>",l.firstElementChild.classList.add("smart-grid-icon","show","attachment"),e.label.indexOf("png")>=0||e.label.indexOf("jpg")>=0||e.label.indexOf("jpeg")>=0||e.label.indexOf("gif")>=0?l.firstElementChild.classList.add("smart-icon-image"):e.label.indexOf(".pdf")>=0?l.firstElementChild.classList.add("smart-icon-pdf"):e.label.indexOf(".tsv")>=0||e.label.indexOf(".txt")>=0||e.label.indexOf(".csv")>=0?l.firstElementChild.classList.add("smart-icon-text"):e.label.indexOf(".xls")>=0||e.label.indexOf(".xlsx")>=0?l.firstElementChild.classList.add("smart-icon-excel"):e.label.indexOf(".ppt")>=0?l.firstElementChild.classList.add("smart-icon-powerpoint"):e.label.indexOf(".zip")>=0||e.label.indexOf(".rar")>=0||e.label.indexOf(".7z")>=0?l.firstElementChild.classList.add("smart-icon-archive"):e.label.indexOf(".doc")>=0||e.label.indexOf(".docx")>=0?l.firstElementChild.classList.add("smart-icon-word"):l.firstElementChild.classList.add("smart-icon-file"),t.appendChild(l)}));const o=document.createElement("div");o.classList.add("smart-arrow-left","arrowbtn","smart-hidden");const d=document.createElement("div");d.classList.add("smart-arrow-right","arrowbtn");const c=document.createElement("div");if(c.classList.add("smart-icon-plus","smart-grid-icon","show"),c.title=i.localize("addFiles"),"card"!==i.view&&r.appendChild(c),r.onpointerdown=e=>{if(e.target.classList.contains("attachment")){const t=JSON.parse(a.cell.value),l=[...r.children[1].children].indexOf(e.target.parentNode);if(t[l]){const e=document.createElement("a");if(t[l].value.indexOf(window.location.host)>=0)fetch(t[l].value).then((e=>e.blob())).then((a=>{const i=URL.createObjectURL(a);e.download=t[l].label,e.href=i,e.click()}));else{if(t[l].value.indexOf("base64")>=0){const a=i._getFileFromBase64(t[l].value);e.href=URL.createObjectURL(a)}else e.href=t[l].value;e.target="_blank",e.click()}}e.stopPropagation(),e.preventDefault()}else if("DIV"===e.target.nodeName&&e.target.classList.contains("arrowbtn")){let l=parseInt(t.style.marginLeft);isNaN(l)&&(l=0);const i=o===e.target,r=t.scrollWidth-a.offsetWidth+30;t.style.marginLeft=i?Math.min(0,l+25)+"px":Math.max(-r,l-25)+"px",l=parseInt(t.style.marginLeft),0===l?o.classList.add("smart-hidden"):o.classList.remove("smart-hidden"),e.stopPropagation(),e.preventDefault()}},t.children.length){if(r.appendChild(t),"card"!==i.view){const e=25*n.length;e-a.offsetWidth+30>30&&(r.appendChild(o),r.appendChild(d)),r.evaluateScroll=()=>{const l=e-a.offsetWidth+30;t.style.marginLeft="0px",o.classList.add("smart-hidden"),l<0?d.classList.add("smart-hidden"):d.classList.remove("smart-hidden"),l>30&&(r.appendChild(o),r.appendChild(d))}}s=r}else s=document.createElement("div");a.setAttribute("template",a.cell.template),e&&e[0]&&e[0].value?s.setAttribute("value",e[0].value):n&&n[0]&&n[0].label?s.setAttribute("value",n[0].label):s.setAttribute("value",e);break}case"images":{if(""===e||"[]"===e){const e=`<div class="file-container"><div class="images"><div title="${i.localize("addImages")}" class="smart-grid-icon show smart-icon-plus"></div></div></div>`;return e!==l.innerHTML&&(l.innerHTML=e,l.onpointerdown=e=>{if(e.target.classList.contains("smart-icon-plus")){if(i._mobile)return;if(i.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=t.getAttribute("data-field"),a=t.closest("smart-grid-row").getAttribute("data-id");i.beginEdit(a,l),t.querySelector(".smart-icon-plus").onpointerdown()}e.stopPropagation(),e.preventDefault()}}),a.cell._setStyle(l),void a.setAttribute("template",a.cell.template)}if(!i._recycleFiles&&l.firstElementChild&&l.firstElementChild.hasAttribute("value")){const t=l.firstElementChild.getAttribute("value");if(e&&e.indexOf(t)>=0)return a.cell._setStyle(l),a.setAttribute("template",a.cell.template),void(l.firstElementChild.evaluateScroll&&l.firstElementChild.evaluateScroll());if(t&&e&&Array.isArray(e)&&e[0]&&e[0].value&&t.length===e[0].value.length)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template)}const t=document.createElement("div"),r=document.createElement("div");t.classList.add("file-container"),r.classList.add("images");let n=e;if(i._findIsFile(n)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}if("string"==typeof n&&(n.indexOf("[{")>=0||n.indexOf("}]")>=0)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}Array.isArray(n)&&n.forEach((e=>{const l=document.createElement("img");l.style.display="none";let a="";a=e.small?e.small:e.medium?e.medium:e.large?e.large:e.value,l.onload=()=>{l.style.display=""},a.indexOf("base64")>=0?l.src=a:(i._imagesCache||(i._imagesCache=[]),i.uploadSettings.url?i._imagesCache[a]?i._findUserFile(e)&&(l.src=a):(i._imagesCache[a]=!0,l.style.display="none",i._findUserFile(e)?(l.src=a,l.style.display=""):a&&a.startsWith("https://")&&(l.src=a)):l.src=a,l.onerror=()=>{l.style.display="none"}),l.title=e.label,l.setAttribute("data-url",e.large||e.value),t.appendChild(l)}));const o=document.createElement("div");o.classList.add("smart-arrow-left","arrowbtn","smart-hidden");const d=document.createElement("div");d.classList.add("smart-arrow-right","arrowbtn");const c=document.createElement("div");c.classList.add("smart-icon-plus","smart-grid-icon","show"),c.title=i.localize("addImages");const m=document.createElement("div");if(m.classList.add("smart-navigation"),"card"!==i.view&&r.appendChild(c),r.onpointerdown=e=>{if("IMG"===e.target.nodeName)[...t.children].forEach((e=>e.classList.remove("smart-hidden"))),i._openImagePreviewDialog(e.target),e.stopPropagation(),e.preventDefault();else if("DIV"===e.target.nodeName&&e.target.classList.contains("smart-navigation-item")){[...m.children].forEach((e=>e.classList.remove("active"))),e.target.classList.add("active"),[...t.children].forEach((e=>e.classList.add("smart-hidden")));const l=[...m.children].indexOf(e.target);t.children[l].classList.remove("smart-hidden"),e.stopPropagation(),e.preventDefault()}else if("DIV"===e.target.nodeName&&e.target.classList.contains("arrowbtn")){let l=parseInt(t.style.marginLeft);isNaN(l)&&(l=0);const i=o===e.target,r=t.scrollWidth-a.offsetWidth+30;t.style.marginLeft=i?Math.min(0,l+25)+"px":Math.max(-r,l-25)+"px",l=parseInt(t.style.marginLeft),0===l?o.classList.add("smart-hidden"):o.classList.remove("smart-hidden"),e.stopPropagation(),e.preventDefault()}},t.children.length){if(r.appendChild(t),"card"===i.view&&r.appendChild(m),"card"!==i.view){const e=25*n.length;e-a.offsetWidth+30>30&&(r.appendChild(o),r.appendChild(d)),r.evaluateScroll=()=>{const l=e-a.offsetWidth+30;t.style.marginLeft="0px",o.classList.add("smart-hidden"),l<0?d.classList.add("smart-hidden"):d.classList.remove("smart-hidden"),l>30&&(r.appendChild(o),r.appendChild(d))}}else for(let e=0;e<t.children.length;e++){const t=document.createElement("div");t.classList.add("smart-navigation-item"),0===e&&t.classList.add("active"),m.appendChild(t)}s=r}else s=document.createElement("div");a.setAttribute("template",a.cell.template),e&&e[0]&&e[0].value?s.setAttribute("value",e[0].value):n&&n[0]&&n[0].label?s.setAttribute("value",n[0].label):s.setAttribute("value",e);break}case"email":if(Smart.Validator){const t=l.firstElementChild?l.firstElementChild.getAttribute("value"):null;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===e)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);s=document.createElement("span"),null===e||""===e?s.innerHTML="":Smart.Validator.email(e)?s.innerHTML=e:(s.className="url",s.innerHTML='<a href="mailto:'+e+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+e+"</a>",s.firstElementChild&&(s.firstElementChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault(),s.firstElementChild.click()}))}a.setAttribute("template",a.cell.template),s.setAttribute("value",e);break;case"url":if(Smart.Validator){const t=l.firstElementChild?l.firstElementChild.getAttribute("value"):null;if(l.firstElementChild&&l.firstElementChild.hasAttribute("value")&&t===e)return a.cell._setStyle(l),void a.setAttribute("template",a.cell.template);const i=t=>{null===e||""===e?t.classList.add("smart-hidden"):Smart.Validator.url(e)?(t.firstElementChild&&"A"===t.firstElementChild.nodeName?(t.firstElementChild.setAttribute("href",e),t.firstElementChild.textContent=e):t.innerHTML='<a href="https://'+e+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+e+"</a>",t.classList.remove("smart-hidden")):(t.firstElementChild&&"A"===t.firstElementChild.nodeName?(t.firstElementChild.setAttribute("href",e),t.firstElementChild.textContent=e):t.innerHTML='<a href="'+e+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+e+"</a>",t.classList.remove("smart-hidden"))};l.firstElementChild&&l.firstElementChild.classList.contains("url")?(s=l.firstElementChild,i(s)):(s=document.createElement("span"),s.className="url",i(s)),s.firstElementChild&&(s.firstElementChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault(),s.firstElementChild.click()})}a.setAttribute("template",a.cell.template),s.setAttribute("value",e);break;default:{let t=null;a.setAttribute("template","");const s=a.cell.row,n=l;let o=a.cell.getFormattedValue(e,r.cellsFormat);if(n.style.lineHeight="","function"==typeof a.cell.template){const t={row:s,column:r,cell:a.cell,oldValue:a.cell.oldValue,value:e,template:null};let l=n.querySelector(".smart-grid-cell-template");const d=s.id;i.isHScrolling&&(i._cachedTemplates||(i._cachedTemplates=[]),l&&0===l.innerHTML.length&&(l=null),!l&&i._cachedTemplates&&i._cachedTemplates[r.dataField+"_"+d]&&(0===i._cachedTemplates[r.dataField+"_"+d].innerHTML.length?delete i._cachedTemplates[r.dataField+"_"+d]:t.template=i._cachedTemplates[r.dataField+"_"+d])),l&&l.getAttribute("column")===r.dataField?t.template=l.firstElementChild:l=null,a.formattedValue!==o&&(l=null),a.cell.canNotify=!1,s.canNotify=!1;const c=Object.assign({},{background:a.cell.background,color:a.cell.color,fontSize:a.cell.fontSize,fontFamily:a.cell.fontFamily,fontWeight:a.cell.fontWeight,textDecoration:a.cell.textDecoration,fontStyle:a.cell.fontStyle});if(a.cell.template(t),!l&&t.template)if(t.template instanceof HTMLElement){const e=document.createElement("div");e.classList.add("smart-grid-cell-template"),e.setAttribute("column",r.dataField),n.innerHTML="",n.appendChild(e),e.appendChild(t.template)}else n.innerHTML='<div column="'+r.dataField+'" class="smart-grid-cell-template">'+t.template+"</div>";else l||null!==t.template||(n.innerHTML=e);if(i.isHScrolling&&!i._cachedTemplates[r.dataField+"_"+d]&&n.firstElementChild.firstElementChild){const e=n.firstElementChild.firstElementChild;e&&(i._cachedTemplates[r.dataField+"_"+d]=e)}n.style.background===c.background&&n.style.color===c.color&&n.style.fontSize===c.fontSize&&n.style.fontWeight===c.fontWeight&&n.style.fontStyle===c.fontStyle||(a.cell._styleChanged=!0,a.cell._setStyle(n)),a.cell.background!==c.background||a.cell.color!==c.color||a.cell.fontSize!==c.fontSize||a.cell.fontWeight!==c.fontWeight||a.cell.fontStyle!==c.fontStyle?(a.cell._styleChanged=!0,a.cell._setStyle(n)):a.cell._styleChanged&&a.cell._setStyle(n),void 0===a.cell.oldValue&&(a.cell.oldValue=e),a.formattedValue=o,a.cell.canNotify=!0,s.canNotify=!0}else if(Array.isArray(a.cell.template)){const e=document.createElement("div");if(n.firstElementChild&&n.firstElementChild.classList.contains("smart-grid-cell-template"))for(let e=0;e<a.cell.template.length;e++){const t=n.firstElementChild.children[e].firstElementChild,l=a.cell.template[e];if(l.length>1&&t){let e=s.data[l[1]];l[2]&&(e=l[2].length>2?l[2].replaceAll("{{value}}",e):a.cell.getFormattedValue(e,l[2])),t.src&&t.src!==e?(a._imageUpdateTimer&&clearTimeout(a._imageUpdateTimer),a._imageUpdateTimer=setTimeout((()=>{t.src=e}),50)):t.textContent!==e&&(t.textContent=e)}}else{e.classList.add("smart-grid-cell-template"),e.setAttribute("column",r.dataField),n.innerHTML="",n.appendChild(e);let t="";for(let e=0;e<a.cell.template.length;e++){const l=a.cell.template[e];if(l.length>1){let e=s.data[l[1]];l[2]&&(e=l[2].length>2?l[2].replaceAll("{{value}}",e):a.cell.getFormattedValue(e,l[2])),t+='<span class="smart-template-part">'+l[0].replaceAll("{{value}}",e)+"</span>"}}e.innerHTML=t}}else{if(""!==n.textContent&&(n.textContent=""),a.cell.template instanceof HTMLTemplateElement)t=a.cell.template;else if(a.cell.template instanceof HTMLElement){const t=a.cell.template.innerHTML.replace(/{{value}}/gi,e).replace(/{{id}}/gi,s.id);n.innerHTML!==t&&(n.innerHTML=t)}if(a.cell.template.startsWith&&a.cell.template.startsWith("#")&&(t=document.querySelector(a.cell.template)),t){let l=t.content.cloneNode(!0).firstElementChild;const d=e;if(e=(e=(e=e.toString()).replace(/'/gi,"\\'")).replace(/"/gi,'\\"'),l.querySelector("[smart-if]")){const t=l.querySelector("[smart-else]"),a=l.querySelectorAll("[smart-if]");let i=!1;for(let t=0;t<a.length;t++){const s=a[t],n=s.getAttribute("smart-if"),o=n.split(" "),c=o[1].trim();let m=o[2].trim();n.indexOf("'")>=0&&(m=n.substring(n.indexOf("'")+1),m=m.replaceAll("'",""));let u=e;switch("Today"===m&&(m=new Date),"date"===r.dataType&&(e=new Date(d).getTime(),m=new Date(m).getTime()),c){case">":e>parseFloat(m)&&(l=s,i=!0);break;case">=":e>=parseFloat(m)&&(l=s,i=!0);break;case"=":case"==":case"===":e===m&&(l=s,i=!0);break;case"<":e<parseFloat(m)&&(l=s,i=!0);break;case"<=":e<=parseFloat(m)&&(l=s,i=!0)}if(e=u,i)break}!i&&t&&(l=t)}let c=l.outerHTML.replace(/{{value}}/gi,e).replace(/{{id}}/gi,s.id);for(c.indexOf("{{value=")>=0&&(e?(c=c.substring(0,c.indexOf("{{value="))+e+c.substring(c.indexOf("}")),c=c.replace(/}/gi,""),c=c.replace(/{/gi,"")):(c=c.replace(/{{value=/gi,""),c=c.replace(/}}/gi,"")));c.indexOf("{{value::")>=0;){const t=c.indexOf("{{value::"),l=c.substring(t+9,c.indexOf("}}")),i=a.cell.getFormattedValue(e,l);c=c.replace(`{{value::${l}}}`,i)}if(r._treeColumn){const e=n.firstChild;if(e&&e.classList&&a.toggleButton&&r._treeColumn&&n.children[1]){const e=n.children[0],t=n.children[1].children[0],l=n.children[1].children[1].firstChild,a=n.children[1].children[2];let r="";if(i.grouping.enabled){let e=s.level-1;"multipleColumns"!==i.grouping.renderMode&&(r+='<div style="width: '+(1+e)*i.grouping.groupIndent+'px;"></div>')}else for(let e=0;e<s.level;e++)r+="<div class='smart-indent'></div>";s.checked?l.setAttribute("checked",""):!1===s.checked?l.removeAttribute("checked"):null===s.checked&&l.setAttribute("checked","indeterminate"),s.leaf?s.allowCheck?l.classList.remove("smart-visibility-hidden"):l.classList.add("smart-visibility-hidden"):s.allowCheck?l.classList.remove("smart-hidden"):l.classList.add("smart-hidden"),s.allowCheck?i.checkBoxes.visible?l.classList.remove("smart-hidden"):l.classList.add("smart-hidden"):i.checkBoxes.visible||l.classList.add("smart-hidden"),e.innerHTML=r,t.classList.add("smart-visibility-hidden"),s.leaf?t.classList.add("smart-visibility-hidden"):(t.classList.remove("smart-visibility-hidden"),s.expanded?t.setAttribute("toggled",""):t.removeAttribute("toggled","")),s.data.isEmpty&&t.classList.add("smart-visibility-hidden"),a.innerHTML=c,i.appearance.showTooltips?a.setAttribute("title",i._unescapeString(o)):a.hasAttribute("title")&&a.removeAttribute("title")}}else n.innerHTML!==c&&(n.innerHTML=c)}else if("string"==typeof a.cell.template){""===e&&(e=" ");let t=a.cell.template.replace(/{{value}}/gi,e).replace(/{{id}}/gi,s.id);if(t.indexOf("{{"))for(let e=0;e<i.dataSource.dataFields.length;e++){const l=i.dataSource.dataFields[e].name;if(t.indexOf("{{"+l+"}}")>=0&&(t=t.replace("{{"+l+"}}",s.data[l]),-1===t.indexOf("{{")))break}n.innerHTML!==t&&(n.innerHTML=t)}}if("auto"===a.cell.row.height||i.layout.allowCellsWrap||"auto"===i.layout.rowHeight){const e=n.querySelector(".smart-grid-cell-template");if(e){s._templatesHeight||(s._templatesHeight=[]);const t=(e,t)=>{if(e){const l=i.rowById[e.getAttribute("data-id")];l._templatesHeight[r.dataField]=t,l._isDirty=!0;const a=l.canNotify;l.canNotify=!1,l.autoSize(),l.canNotify=a,delete l._isDirty}};if(e.firstElementChild){if(!e.firstElementChild.resizeObserver){const l=new ResizeObserver((function(){const e=this.target.closest("smart-grid-row");this.target.offsetHeight&&(t(e,this.target.offsetHeight),i.$.scrollView.scrollTop=0)}));e.firstElementChild.resizeObserver=l,l.target=e.firstElementChild,l.observe(e.firstElementChild)}e.firstElementChild.onblur=e.firstElementChild.onchange=function(){const e=this.closest("smart-grid-row");t(e,this.offsetHeight)}}else{const l=this.closest("smart-grid-row");t(l,e.offsetHeight)}}}}}if(s)return l.innerHTML="",l.appendChild(s),a.cell._setStyle(l),s}async _render(){const e=this,t=e.cell.grid,l=e.cell.column,a=e.cell.row,i=a.data,r=a._isMeasureRow?null:e.cell.format||l.cellsFormat,s=t.grouping.enabled&&t.dataSource.groupBy.length>0;if(!(!1!==t._recycleValues||s||l.formatFunction||l._treeColumn||a.summaryRow||"grid"!==t.view)){if(e.cell.selected?(e.setAttribute("selected",""),e.setAttribute("aria-selected",!0)):(e.removeAttribute("selected"),e.removeAttribute("aria-selected")),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),e.cell.focused?(t.selection.allowCellSelection&&e.setAttribute("focus",""),a.element.setAttribute("focus",""),a.element.toggleDetailButton&&(a.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),a.element.star&&a.element.star.classList.add("smart-hidden")),e.cell.id||(e.id="gridcell_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),t.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focus"),a.element&&a.element.star&&t._selection.focusedCell&&t._selection.focusedCell.id!==a.id&&a.element.star.classList.remove("smart-hidden")),e.cell.background||e.cell.color){e.cell._styleChanged=!0;const t=e.firstChild;e.cell._setStyle(t)}return}if(t.grouping.enabled&&t.dataSource.groupBy.length>0&&"card"!==t.view){if(void 0!==a.label){let t=l.displayField?i[l.displayField]:i[l.dataField];return void 0===t&&i.data&&(t=l.displayField?i.data[l.displayField]:i.data[l.dataField]),e._renderGroupCell(t),void(a.summaryRow&&(e.cell.canNotify=!1,a.canNotify=!1,e.cell._styleChanged=!0,e.cell.background=null,e.cell.color=null,e.cell.fontFamily=null,e.cell.fontSize=null,e.cell.element&&e.cell.element.firstElementChild&&e.cell._setStyle(e.cell.element.firstElementChild),e.cell.canNotify=!0,a.canNotify=!0))}e.style.zIndex=""}else if(t.appearance.showTreeRowHeader&&t.rowHierarchy&&!1===a.leaf&&!l.autoGenerated){let t=i[a.groupDataField];return a.label=t,void e._renderGroupCell(t)}if(t.appearance.showTreeRowHeader&&e.removeAttribute("header"),t.grouping.enabled&&t.dataSource.groupBy.length>0&&e.toggleButton&&(e.toggleButton.classList.remove("smart-hidden"),e.toggleButton.classList.remove("smart-visibility-hidden"),e.toggleButton.style.marginLeft="",l._treeColumn&&t.grouping.enabled&&t.grouping.toggleButtonIndent>0&&(e.toggleButton.style.marginLeft=a.level*(t.grouping.toggleButtonIndent-t.grouping.groupIndent)+"px")),t.grouping.enabled&&t.dataSource.groupBy.length>0&&(e.removeAttribute("header"),e.removeAttribute("group")),!l.visible)return void(e.style.width="0px");t.appearance.showSortColumnBackground&&t.sorting.maintainSort&&!a.summaryRow?l.sorted?e.setAttribute("sort",""):e.removeAttribute("sort"):l.sorted&&e.hasAttribute("sort")&&e.removeAttribute("sort"),t.appearance.showFilterColumnBackground?l.filtered?e.setAttribute("filter",""):e.removeAttribute("filter"):l.filtered&&e.hasAttribute("filter")&&e.removeAttribute("filter"),t.dataSource.boundHierarchy&&e.hasAttribute("has-toggle-button")&&!l._treeColumn&&e.removeAttribute("has-toggle-button");let n=l.displayField?i[l.displayField]:i[l.dataField];if(null!==n||l.allowNull||("int"!==l.dataType&&"number"!==l.dataType||(n=0),"string"===l.dataType&&(n=""),"boolean"!==l.dataType&&"bool"!==l.dataType||(n=!1),"date"===l.dataType&&(n=new Date)),t.formulas&&e.cell.formula&&"string"==typeof e.cell.formula&&/=.+/.test(e.cell.formula)){const l=t._formulaParser;if(l){const t=l.parse(e.cell.formula.slice(1));n=isNaN(t)?"#VALUE!"===t?"":"#ERROR!"===t?"#ERROR!":t:t}}t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&t.dataSource.groupBy.length>0&&t.dataSource.groupBy.indexOf(l.dataField)>=0&&(n="",e.setAttribute("header","")),e.removeAttribute("highlight"),t.highlighted!==a.id||l.autoGenerated||e.setAttribute("highlight",""),t.editing.addNewRow.visible&&e.classList.remove("smart-add-new-row"),t.editing.enabled&&(e.cell.readonly||!l.allowEdit?e.classList.add("smart-readonly"):e.classList.remove("smart-readonly"));const o=t=>t?t.startsWith("off_")?(e.classList.remove(t.substring(4)),!1):(e.classList.add(t),e.hasAttribute("customCSS")&&(t=t+" "+e.getAttribute("customCSS")),e.setAttribute("customCSS",t),!0):(e.setAttribute("highlight",""),!0);if((t.highlightedRows||t.highlightedCells)&&e.hasAttribute("customCSS")){const t=e.getAttribute("customCSS");e.removeAttribute("customCSS");const l=t.split(" ");for(let t=0;t<l.length;t++)e.classList.remove(l[t])}if(l.highlight&&!a.summaryRow&&(o(l._highlightCSS||""),e.setAttribute("highlight-data-field",l.dataField)),t.highlightedCells&&t.highlightedCells[a.id]&&!a.summaryRow&&void 0!==t.highlightedCells[a.id][l.dataField]&&o(t.highlightedCells[a.id][l.dataField]),t.highlightedRows&&!a.summaryRow&&void 0!==t.highlightedRows[a.id]&&o(t.highlightedRows[a.id]),t.editing.batch){if(t._cellsUpdatedValues){e.removeAttribute("update");const i=t._cellsUpdatedValues[a.id+"_"+l.dataField];void 0!==i&&(e.setAttribute("update",""),n=i)}t._rowsDeleted&&(t._rowsDeleted.indexOf(a.id)>=0?e.setAttribute("delete",""):e.removeAttribute("delete")),t._rowsAdded&&(t._rowsAdded.indexOf(a.id)>=0?e.setAttribute("add",""):e.removeAttribute("add"))}!t.onCellValue||l.rowHeaderColumn||l.selectionColumn||(e.cell._updating=!0,t.onCellValue(e.cell,t),e.cell._updating=!1,n=e.cell.value),void 0===n&&(n="");let d=n;r?d=e.cell.getFormattedValue(n,r):l.formatSettings&&l.formatSettings.Intl&&(d=e.cell.getFormattedValue(n,l.formatSettings.Intl));const c=e.firstChild;if(e.content=c,l._isDirty&&(c.innerHTML=""),c.hasAttribute("data-field")&&c.getAttribute("data-field")!==l.dataField&&(c.innerHTML="",a.filterRow&&(l._filterEditorInitialized=!1)),c.setAttribute("data-field",l.dataField),t.onCellRender||l.onCellRender)if(l._cellsCachedValues||(l._cellsCachedValues=[]),l._cellsCachedValues[a.index]){const t=l._cellsCachedValues[a.index];c.firstChild&&c.removeChild(c.firstChild),e.cell.template instanceof HTMLTemplateElement||"string"==typeof e.cell.template?c.appendChild(t):c.innerHTML=t.innerHTML}else{if(e.cell._updating=!0,t.onCellRender?t.onCellRender(e.cell,a.visibleIndex,l.dataField,a.data,e):l.onCellRender(e.cell,a.visibleIndex,l.dataField,a.data,e),e.cell._updating=!1,e.cell.template!==l.template){const t=document.createElement("div");return c.firstChild&&c.removeChild(c.firstChild),e.cell.template instanceof HTMLTemplateElement?(t.appendChild(e.cell.template.content.cloneNode(!0)),l._cellsCachedValues[a.index]=t):t.appendChild(e.cell.template),void c.appendChild(t)}e.cell.value!==n&&(d=e.cell.value)}if(l.autoGenerated||e.setAttribute("data-field",l.dataField),e.cell.focused?(t.selection.allowCellSelection&&e.setAttribute("focus",""),a.element.setAttribute("focus",""),a.element.toggleDetailButton&&(a.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),a.element.star&&a.element.star.classList.add("smart-hidden")),e.cell.id||(e.id="gridcell_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),t.setAttribute("aria-activedescendant",e.id)):e.removeAttribute("focus"),e.cell.selected?(e.setAttribute("selected",""),e.setAttribute("aria-selected",!0)):(e.removeAttribute("selected"),e.removeAttribute("aria-selected")),t.dragDrop&&t.dragDrop.row===a?e.classList.add("dragged"):e.classList.remove("dragged"),e._classNames)for(let t=0;t<e._classNames.length;t++)e.classList.remove(e._classNames[t]);if(a._classNames||e._rowClassNames){if(e._rowClassNames)for(let t=0;t<e._rowClassNames.length;t++)e.classList.remove(e._rowClassNames[t]);for(let t=0;t<a._classNames.length;t++)e.classList.add(a._classNames[t]);e._rowClassNames=a._classNames}if(t.onCellClass){const i=t.onCellClass(a.visibleIndex,l.dataField,n,a.data,a,t);if(e.___classNames)for(let t=0;t<e.___classNames.length;t++)e.classList.remove(e.___classNames[t]);if(i){const t=i.trim().split(" ");for(let l=0;l<t.length;l++)e.classList.add(t[l]);e.___classNames=t}}if(l.cellsClassName)if("string"==typeof l.cellsClassName){const t=l.cellsClassName.trim().split(" ");for(let l=0;l<t.length;l++)e.classList.add(t[l]);e._classNames=t}else{const t=l.cellsClassName(a.visibleIndex,l.dataField,n,a.data,a);if(e._classNames)for(let t=0;t<e._classNames.length;t++)e.classList.remove(e._classNames[t]);if(t){const l=t.trim().split(" ");for(let t=0;t<l.length;t++)e.classList.add(l[t]);e._classNames=l}}if(l.cellsCSSRules){if(e.__classNames)for(let t=0;t<e.__classNames.length;t++)e.classList.remove(e.__classNames[t]);const i=Object.keys(l.cellsCSSRules);let r=[];for(let s=0;s<i.length;s++){let o=i[s];const d={index:a.visibleIndex,value:n,dataField:l.dataField,row:a,api:t};l.cellsCSSRules[o](d)&&(e.classList.add(o),r.push(o))}e.__classNames=r}t.rowDetail.enabled&&a.showDetail&&!1===t.rowDetail.dialog.enabled&&(e.style.height=a.cellHeight+"px",e.style.lineHeight=a.cellHeight+"px"),a.expanded&&a.expandHeight>0&&(e.style.height=a.cellHeight+"px",e.style.lineHeight=a.cellHeight+"px");const m=e._getCellAlignment(a,l),u=""!==e.cell.template&&t.isInitialized&&!a._isMeasureRow;let p="";if(m.align&&(p+=m.align+" "),m.verticalAlign&&(p+=m.verticalAlign+" "),l.cellsWrap)p+="wrap ";else if(t.layout.autoWrap&&a.height>40&&1===e.cell.colSpan&&"string"===l.dataType&&14*(d||"").length*.52>l.computedWidth){p+="textwrap ";const e=parseInt(a.height/20);c.style["-webkit-line-clamp"]=e}if(p+="smart-label",e.style.width!==l.computedWidth+"px"){const a=t._isLastVisibleColumn(l);l.autoGenerated||a?e.style.width=l.computedWidth+"px":e.style.width=l.computedWidth-t._columnGap+"px"}l===t._firstVisibleColumn?e.classList.add("smart-grid-column-border-collapse"):e.classList.remove("smart-grid-column-border-collapse"),t.appearance.showColumnGroupCellLines||l.parent&&!l.element.hasAttribute("column-group-first-child")&&e.classList.add("smart-grid-column-border-collapse"),t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&t.dataSource.groupBy.length>0&&t.dataSource.groupBy.indexOf(l.dataField)>=0&&e.classList.add("smart-grid-column-border-collapse"),t._columnGap>0&&t.appearance.showColumnLines&&e.classList.add("smart-grid-column-border"),t._rowGap>0&&e.classList.add("smart-grid-row-border"),t.appearance.showColumnLines?e.classList.remove("smart-grid-vertical-border-collapse"):e.classList.add("smart-grid-vertical-border-collapse"),t.appearance.showRowLines?e.classList.remove("smart-grid-horizontal-border-collapse"):e.classList.add("smart-grid-horizontal-border-collapse");let g=l.left;if(t.rightToLeft?e.style.right!==g+"px"&&(e.style.right=g+"px"):e.style.left!==g+"px"&&(e.style.left=g+"px"),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),e.hasAttribute("template")&&e.removeAttribute("template"),e.hasAttribute("freeze")&&e.removeAttribute("freeze"),e.hasAttribute("detail")&&e.removeAttribute("detail"),e.hasAttribute("error")&&e.removeAttribute("error"),e.cell.error&&e.setAttribute("error",e.cell.error),a.filterRow?e.classList.add("smart-grid-filter-row-cell"):a.summaryRow?e.classList.add("smart-grid-summary-row-cell"):(l.freeze||a.freeze)&&(l.selectionColumn&&(e.setAttribute("checkbox",""),p+=" smart-input",l.grid.selection.checkBoxes.enabled&&l.grid.selection.checkBoxes.autoShow?e.setAttribute("auto-show",""):e.removeAttribute("auto-show")),(l.rowHeaderColumn||l.selectionColumn)&&(e.setAttribute("header",""),e.setAttribute("role","rowheader")),l.rowDetailColumn&&(e.setAttribute("header",""),e.setAttribute("detail",""),e.setAttribute("has-toggle-button",""),e.classList.add("smart-grid-column-border-collapse")),l.commandColumn&&e.setAttribute("command",""),t.appearance.showFrozenColumnBackground&&l.freeze&&e.setAttribute("freeze",""),t.appearance.showFrozenRowBackground&&a.freeze&&e.setAttribute("freeze","")),l.cellsRotationAngle){if(!e._rotateCellContent(c,l,n))return}else if(a.filterRow){if(!l.toggleColumn&&!l.rowHeaderColumn)return t.grouping.enabled&&t.dataSource&&t.dataSource.groupBy.length>0&&(l._filterEditorInitialized=!1),l._filterEditorInitialized||l.autoGenerated?void("boolean"===l.dataType||"bool"===l.dataType?e.setAttribute("template","checkBox"):e.removeAttribute("template")):(l._filterEditorInitialized=!0,void e._renderFilterCell(c));c.innerHTML=""}else if(a.summaryRow){if(l.toggleColumn||l.rowHeaderColumn)c.innerHTML="";else if(l.autoGenerated&&(c.innerHTML=""),t.dataSource.boundHierarchy&&e.hasAttribute("has-toggle-button")&&e.removeAttribute("has-toggle-button"),!l.autoGenerated){if(l.summary.length>0&&t._summaryItems){const a=t._summaryItems[l.dataField],i=[];for(let r in a){if("status"===r)continue;const s=l.cellsFormat;let n=a[r];s&&s.indexOf("p")>=0&&"count"===r?n=a[r]:s&&"date"!==l.dataType&&(n=e.cell.getFormattedValue(n,s)),i.push(t.localize(r,{value:n}))}let r=[],s="";if(a&&a.status&&l.editor){s+='<div style="margin-right: 5px; display: flex; border-radius: 8px; align-items: center;">';const e=l.editor.dataSource,i=a.status,n=t.rows.length,o=l.computedWidth;let d=0;if(e)for(let l=0;l<e.length;l++){const a=e[l];if(i[a.value]){const e=a.label?a.label:t.localize("blankSummary"),l=i[a.value].length,c=new Number(l/n*100).toFixed(2),m=e+" "+l+"/"+n+" "+c+"%",u=o*c/100/2;r.push(m);const p=["#D50000","#F6BF26","#33B679","#039BE5","#3F51B5","#8E24AA"];d>p.length-1&&(d=0),s+='<span class="summary-value-part" title="'+m+'" style="width: '+u+"px; font-size: 11px; padding: 5px; background:"+(a.color||p[d++])+'; color: white;"></span>'}}s+="</div>"}const n=i.join(", "),o=t.summaryRow.editing?'<span class="smart-arrow-down"></span>':"";let d=`<div title = "${n}" class="smart-truncate summary-value" > <span class="label">${n}</span>${o}</div> `;if(r.length&&(d=`<div title = "${n}" class="smart-truncate summary-value" > <span style="align-items: center; display: flex;" class="label">${s}${n}</span>${o}</div> `),t.columns[0].dataField===l.dataField&&i.length<3){const e=t._recyclingRows.length;d=`<div title = "${n}" class="smart-truncate summary-value" > <span style = "justify-content: flex-start" class="smart-truncate summary-value" > ${1===e?t.localize("oneRow"):t.localize("rows",{value:e})}</span> <span class="label">${n}</span>${o}</div> `}c.innerHTML!==d&&(c.innerHTML=d)}else if(t.summaryRow.editing&&l.allowSummary)if(t.columns[0].dataField===l.dataField){const e=t._recyclingRows.length,l=`<div class="smart-truncate summary-value"><span style="justify-content: flex-start" class="smart-truncate summary-value">${1===e?t.localize("oneRow"):t.localize("rows",{value:e})}</span><span class="smart-summary-placeholder label">${t.localize("summary")}</span><span class="smart-arrow-down"></span></div>`;c.innerHTML!==l&&(c.innerHTML=l)}else{const e=`<div class="smart-truncate summary-value"><span class="smart-summary-placeholder label">${t.localize("summary")}</span><span class="smart-arrow-down"></span></div>`;c.innerHTML!==e&&(c.innerHTML=e)}t.summaryRow.editing&&l.allowSummary&&(t._selection&&t._selection.focusedCell&&t._selection.focusedCell.dataField===l.dataField?c.firstElementChild.setAttribute("has-summary",""):c.firstElementChild.removeAttribute("has-summary"),c.onpointerdown=e=>{e.preventDefault(),e.stopPropagation(),c._clickTarget=e.target},c.onpointerup=l=>{!0!==t._mobile&&c._clickTarget!==l.target||(l.preventDefault(),l.stopPropagation(),t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.dataField===e.cell.column.dataField?t._summaryRowDialog.confirm():t._openSummaryRowDialog(e.cell,(()=>{})))})}}else if(t.rowDetail.enabled&&l.rowDetailColumn){let l="",i=t.appearance.showRowStatus?"smart-visibility-hidden":"";if(l=a.showDetail?'<button tabindex="-1" class="'+i+' smart-animate" toggled toggle-button></button>':'<button tabindex="-1" class="'+i+' smart-animate" toggle-button></button>',t.appearance.showRowStatus){l=a._style&&a._style.status?`<span class="row-status custom" style = "color: ${a._style.status};" ></span> `+l:'<span class="row-status"></span>'+l,c.innerHTML===l||a.element.star?(a.element.star.classList.remove("smart-hidden"),a.element.star.classList.remove("custom"),a._style&&a._style.status?(a.element.star.style.color=a._style.status,a.element.star.classList.add("custom")):a.element.star.style.color=""):c.innerHTML=l;const i=()=>{if(a.comments&&a.comments.length>0){const e=a.comments.length;a.element.star.classList.add("comments"),a.element.star.setAttribute("title",t.localize(a.starred?"starred":"notStarred",{elementType:"Grid"})+", "+e+" "+t.localize("comments"))}else a.comments&&0===a.comments.length&&a.element.star.classList.remove("comments")};a.element.star=e.querySelector("span"),a.element.star||(c.innerHTML=l,a.element.star=e.querySelector("span")),a.element.star.onpointerdown=e=>{a.canNotify=!1,a.starred=!a.starred,a.canNotify=!0,a.data.$&&(a.data.$.starred=a.starred),a.starred?a.element.star.classList.add("starred"):a.element.star.classList.remove("starred"),a.element.star.setAttribute("title",t.localize(a.starred?"starred":"notStarred",{elementType:"Grid"})),i(),e.stopPropagation(),e.preventDefault(),t.$.fireEvent("rowStarred",{id:a.id,originalEvent:e,row:a,value:a.starred})},a.element.star.setAttribute("title",t.localize(a.starred?"starred":"notStarred",{elementType:"Grid"})),a.starred?a.element.star.classList.add("starred"):a.element.star.classList.remove("starred"),i()}else c.innerHTML!==l&&(c.innerHTML=l);if(a.element.toggleDetailButton=e.querySelector("button"),a.element.toggleDetailButton.setAttribute("title",t.localize(a.showDetail?"collapseRow":"expandRow",{elementType:"Grid"})),(t.rowDetail.template||t.onRowDetailInit)&&a.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),a.comments&&a.comments.length>0){const e=a.comments.length;a.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),t.appearance.showRowStatus?a.element.toggleDetailButton.querySelector(".comments-length")?a.element.toggleDetailButton.querySelector(".comments-length").innerHTML=e:a.element.toggleDetailButton.innerHTML+=`<div class="comments-length'>${e}</div>`:a.element.toggleDetailButton.innerHTML=`<div class="comments-length'>${e}</div>`,a.starred&&a.element.toggleDetailButton.classList.add("starred"),a.element.toggleDetailButton.classList.add("row-comments"),a.element.toggleDetailButton.setAttribute("title",t.localize(a.showDetail?"collapseRow":"expandRowComments",{value:e,elementType:"Grid"}))}else a.comments&&0===a.comments.length&&a.element.toggleDetailButton.classList.remove("row-comments");t.rowDetail.dialog.enabled&&a.element.toggleDetailButton.classList.add("row-detail")}else if(l.commandColumn)e._renderCommands();else if(t.appearance.showRowHeaderNumber&&l.rowHeaderColumn)if(a.addNewRow)c.textContent="";else{const l=l=>{if(e.cell.value)return e.cell.value;if("number"===t.appearance.autoGenerateRowLabelMode)return l.visibleIndex+1;{const e=l.visibleIndex%26,t=Math.floor(l.visibleIndex/26),a="A".charCodeAt(0),i=String.fromCharCode(a+e);let r="";for(let e=0;e<t;e++)r+="A";return r+i}};t._rowsAdded&&t._rowsAdded.indexOf(a.id)>=0?c.textContent="":c.textContent=l(a)}else if(u)if(e.removeAttribute("readonly"),t.appearance.displayLoadingIndicator&&!l.autoGenerated)c.innerHTML='<div class="smart-grid-cell-loading"></div>';else if(a._isMeasureRow)c.innerHTML=n;else switch(c.removeAttribute("title"),e.cell.template){case"checkBox":case"switchButton":case"radioButton":e._setTemplate(n,e.cell.template,c);break;case"tags":case"checklist":case"collaborator":case"updatedBy":case"createdBy":case"multiComboInput":e._setTemplate(n,e.cell.template,c);break;case"attachment":e._setTemplate(n,"attachments",c);break;case"image":e._setTemplate(n,"images",c);break;case"email":e._setTemplate(n,"email",c);break;case"url":e._setTemplate(n,"url",c);break;case"richText":e._setTemplate(n,"richText",c);break;default:e._setTemplate(n,e.cell.template,c)}else{const i=c.firstChild;if(i&&i.classList&&e.toggleButton&&l._treeColumn&&c.children[1]){const e=c.children[0],i=c.children[1].children[0],r=c.children[1].children[1].firstChild,s=c.children[1].children[2];let n="";if(l._treeColumn){if(t.grouping.enabled){let e=a.level-1;t.appearance.showRowHeaderNumber&&e--,t.rowDetail.enabled&&e--,e<-1?n="":"multipleColumns"!==t.grouping.renderMode&&(n+='<div style="width: '+(1+e)*t.grouping.groupIndent+'px;"></div>')}else for(let e=0;e<a.level;e++)n+="<div class='smart-indent'></div>";if(a.checked?r.setAttribute("checked",""):!1===a.checked?r.removeAttribute("checked"):null===a.checked&&r.setAttribute("checked","indeterminate"),a.leaf?a.allowCheck?r.classList.remove("smart-visibility-hidden"):r.classList.add("smart-visibility-hidden"):a.allowCheck?r.classList.remove("smart-hidden"):r.classList.add("smart-hidden"),!l.autoGenerated){const e=a["column_"+l.dataField];e&&e._setStyle(c)}}a.allowCheck?t.checkBoxes.visible?r.classList.remove("smart-hidden"):r.classList.add("smart-hidden"):t.checkBoxes.visible||r.classList.add("smart-hidden"),"card"===t.view&&(r.classList.add("smart-hidden"),i.classList.add("smart-hidden")),e.innerHTML=n,i.classList.add("smart-visibility-hidden"),a.leaf?i.classList.add("smart-visibility-hidden"):(i.classList.remove("smart-visibility-hidden"),a.expanded?i.setAttribute("toggled",""):i.removeAttribute("toggled","")),t.grouping.enabled&&i.classList.add("smart-hidden"),a.data.isEmpty&&i.classList.add("smart-visibility-hidden"),s.innerHTML=d,t.appearance.showTooltips?s.setAttribute("title",t._unescapeString(d)):s.hasAttribute("title")&&s.removeAttribute("title")}else{const i=a["column_"+l.dataField];if(e.getAttribute("rowspan")&&(e.removeAttribute("rowspan"),e.removeAttribute("aria-rowspan"),e.style.height=""),e.getAttribute("colspan")&&(e.removeAttribute("colspan"),e.removeAttribute("aria-colspan")),i){if(i.colSpan>1){const a=t.columns.indexOf(l);let r=0;for(let e=a;e<a+i.colSpan;e++){const l=t.columns[e];l&&l.visible&&(r+=l.computedWidth)}e.style.width=r+"px",e.setAttribute("colspan",""),e.setAttribute("aria-colspan",i.colSpan),i._styleChanged=!0}let r=i.rowSpan;if(i.rowSpan>1){const l=t.rows.indexOf(a);let r=0;a.element.setAttribute("rowspan","");for(let e=l;e<=l+i.rowSpan-1;e++){const l=t.rows[e];l&&l.visible&&l.filtered&&(r+=l.cellHeight)}e.style.height=r+"px",e.setAttribute("rowspan",""),e.setAttribute("aria-rowspan",i.rowSpan),i._styleChanged=!0}else if(l.rowSpan&&!a._isMeasureRow){const s="number"==typeof l.rowSpan?l.rowSpan:l.rowSpan(n,a.visibleIndex,a.data),o=a.visibleIndex;let d=!1;for(let e=0;e<t._cellRowSpan.length;e++){const l=t._cellRowSpan[e];if(o>l[0]&&o<l[1]){d=!0;break}}if(a._rowSpan=s,s&&!d){let n=0;t._cellRowSpan.push([o,o+s,l.dataField]),t._cellRowSpan.maxSpan||(t._cellRowSpan.maxSpan=1),t._cellRowSpan.maxSpan=Math.max(s,t._cellRowSpan.maxSpan),a.element.setAttribute("rowspan","");for(let e=o;e<=o+s-1;e++){const l=t.rows[e];l&&l.visible&&l.filtered&&(n+=l.cellHeight)}e.style.height=n+"px",e.setAttribute("rowspan",""),e.setAttribute("aria-rowspan",s),i._styleChanged=!0,r=s}}1===i.colSpan&&e.hasAttribute("colspan")&&(e.style.width="",e.removeAttribute("colspan"),e.removeAttribute("aria-colspan"),i._styleChanged=!0),e.hasAttribute("rowspan")&&1===r&&(e.style.height="",e.removeAttribute("rowspan"),e.removeAttribute("aria-rowspan"),i._styleChanged=!0),c.textContent===d||l.formatFunction||("string"==typeof d&&d.indexOf("&")>=0?"card"===t.view?c.innerHTML=d:t.isScrolling?requestAnimationFrame((()=>{c.innerHTML=d})):c.innerHTML=d:c.textContent=d),i.column.autoGenerated||i._setStyle(c),t.appearance.showTooltips?c.setAttribute("title",i.tooltip||t._unescapeString(d)):c.hasAttribute("title")&&c.removeAttribute("title"),t.appearance.showTooltipsOverflow&&(!t.appearance.showTooltips&&c.hasAttribute("title")&&c.removeAttribute("title"),d&&d.length)&&(14*(d||"").length*.52>l.computedWidth?c.setAttribute("title",i.tooltip||t._unescapeString(d)):!t.appearance.showTooltips&&c.hasAttribute("title")&&c.removeAttribute("title"))}else c.textContent=d}}if(c.className!==p&&(c.className=p),!t.appearance.displayLoadingIndicator||l.autoGenerated||t.dataSource.boundHierarchy?t.appearance.displayLoadingIndicator&&l.selectionColumn?e.removeAttribute("selected"):!l.autoGenerated&&c.firstChild&&c.firstChild.classList&&c.firstChild.classList.contains("smart-grid-cell-loading")&&(c.firstChild.classList.remove("smart-grid-cell-loading"),e.removeAttribute("selected")):(a.element.removeAttribute("focus"),e.removeAttribute("selected"),c.innerHTML='<div class="smart-grid-cell-loading"></div>'),l.formatFunction&&!a.data.isEmpty&&t.isInitialized&&!a.summaryRow){const t={row:a,column:l,cell:e.cell,oldValue:e.cell.oldValue,value:n,formattedValue:d,template:null};e.cell.canNotify=!1,a.canNotify=!1;const i=Object.assign({},{background:e.cell.background,color:e.cell.color,fontSize:e.cell.fontSize,fontFamily:e.cell.fontFamily,textDecoration:e.cell.textDecoration,fontWeight:e.cell.fontWeight,fontStyle:e.cell.fontStyle});await l.formatFunction(t),c.style.background===i.background&&c.style.color===i.color&&c.style.fontSize===i.fontSize&&c.style.fontFamily===i.fontFamily&&c.style.textDecoration===i.textDecoration&&c.style.fontWeight===i.fontWeight&&c.style.fontStyle===i.fontStyle||(e.cell._styleChanged=!0,e.cell._setStyle(c)),e.cell.background===i.background&&e.cell.color===i.color&&e.cell.fontSize===i.fontSize&&e.cell.fontWeight===i.fontWeight&&e.cell.textDecoration===i.textDecoration&&e.cell.fontFamily===i.fontFamily&&e.cell.fontStyle===i.fontStyle||(e.cell._styleChanged=!0,e.cell._setStyle(c));let r=!0;if(t.value!==n&&(e.toggleButton?c.children[1].children[2].innerHTML=t.value:c.innerHTML=t.value,r=!1),null!==t.template){if(e.toggleButton){if(c.children[1]){const e=c.children[1].children[2];e.innerHTML!==t.template&&(e.innerHTML=t.template)}}else if(c.innerHTML!==t.template){const e=document.createElement("div");e.innerHTML=t.template,e.innerHTML!==c.innerHTML&&(c.innerHTML=t.template)}r=!1}r&&(l.cellsFormat?c.textContent=d:c.textContent=n),e.cell.canNotify=!0,a.canNotify=!0}if(!a.data.isEmpty&&t.isInitialized&&e._applyConditionalFormattingToCell(e.cell,t,c),t.grouping.enabled&&t.dataSource&&t.dataSource.groupBy.length>0&&l===t._firstVisibleColumn&&t.rowDetail.enabled&&t.rowDetail.visible&&c.querySelector("[toggle-button]")){const e=c.querySelector("[toggle-button]");e.classList.remove("smart-visibility-hidden"),e.classList.add("row-detail"),a.element.toggleDetailButton=e,a.element.toggleDetailButton.setAttribute("title",t.localize(a.showDetail?"collapseRow":"expandRow",{elementType:"Grid"})),e.onpointerdown=function(e){a.showDetail=!a.showDetail,e.stopPropagation(),e.preventDefault()}}}_autoWrap(){const e=this,t=e.firstChild,l=e.cell.grid;l.layout.allowCellsWrapShortcut&&e.hasAttribute("focus")&&e.hasAttribute("selected")&&(t.offsetWidth<t.scrollWidth?e._popupCellContent(t.innerHTML,e.cell):l._cellContentPopup&&l._cellContentPopup.remove())}_popupCellContent(e,t){const l=this,a=t.grid;let i=a._cellContentPopup;if(!a._cellContentPopup){i=document.createElement("div");const t=document.createElement("span"),l=document.createElement("div"),r=document.createElement("div");i.style.minHeight="0px",i.style.minWidth="0px",i.setAttribute("theme",a.theme),i.classList.add("smart-grid-cell-content-popup"),r.appendChild(l),r.classList.add("smart-grid-text-area-container"),l.innerHTML=e,l.classList.add("smart-grid-cell-content-popup-content"),t.classList.add("smart-hidden"),t.classList.add("close-button"),t.classList.add("smart-grid-icon"),t.classList.add("smart-icon-cancel-circled"),t.onclick=function(){a._cellContentPopup.parentNode.removeChild(a._cellContentPopup)},i.classList.add("smart-grid-text-area-dialog"),i.appendChild(r),i.appendChild(t),a._cellContentPopup=i}i.querySelector(".smart-grid-cell-content-popup-content").innerHTML=e;const r=a.offset(a.$.scrollView);i.style.top=a._offsetTop(l)-r.top+"px",i.style.left=a._offsetLeft(l)-r.left+"px",i.style.width=l.offsetWidth-4+"px",a.$.scrollView.appendChild(i)}_applyConditionalFormattingToCell(e,t,l){const a=this,i=e.column.dataField,r=e.row,s=e.row.index,n=r._style;if(t._conditionalFormatting&&t._conditionalFormatting[i]){const e=t._conditionalFormatting[i][s];a.cell.canNotify=!1,r.canNotify=!1,e?(a.cell._styleChanged=!0,a.cell.background=e.background,a.cell.color=e.color,a.cell.fontFamily=e.fontFamily,a.cell.fontSize=e.fontSize,a.cell._setStyle(l)):a.cell._styleChanged||(n&&n._changed?(a.cell._styleChanged=!0,a.cell.background=n.background,a.cell.color=n.color,a.cell.fontFamily=n.fontFamily,a.cell.fontSize=n.fontSize,a.cell._setStyle(l)):(a.cell._styleChanged=!0,a.cell.background=null,a.cell.color=null,a.cell.fontFamily=null,a.cell.fontSize=null,a.cell._setStyle(l))),a.cell.canNotify=!0,r.canNotify=!0}else t._conditionalFormattingChanged&&!a.cell._styleChanged&&(a.cell.canNotify=!1,r.canNotify=!1,n&&n._changed?(a.cell._styleChanged=!0,a.cell.background=n.background,a.cell.color=n.color,a.cell.fontFamily=n.fontFamily,a.cell.fontSize=n.fontSize,a.cell._setStyle(l)):(a.cell._styleChanged=!0,a.cell.background=null,a.cell.color=null,a.cell.fontFamily=null,a.cell.fontSize=null,a.cell._setStyle(l)),a.cell.canNotify=!0,r.canNotify=!0)}_rotateCellContent(e,t,l){const a=document.createElement("span");return e.innerHTML="",a.innerHTML=l,e.appendChild(a),a.className="rotate",a.style.transform="rotate("+t.cellsRotationAngle+"deg)",this.grid._recycleRotate(e,a,t.cellsAlign,t.cellsVerticalAlign,l)}_getCellAlignment(e,t){const l=e["column_"+t.dataField],a=l&&l.verticalAlign||t.cellsVerticalAlign;let i=l&&l.align||t.cellsAlign;const r={align:"",verticalAlign:""};if(!l)return{align:"align-left",verticalAlign:"align-middle"};switch(l.grid.rightToLeft&&("left"===i?i="right":"right"===i&&(i="left")),i){case"left":r.align="align-left";break;case"center":case"middle":r.align="align-center";break;case"right":r.align="align-right"}switch(a){case"top":r.verticalAlign="align-top";break;case"center":case"middle":r.verticalAlign="align-middle";break;case"bottom":r.verticalAlign="align-bottom"}return r}template(){return""}_detach(){this.element=null,this.cell=null}onDetached(){this._detach()}});
|
|
6
|
+
(()=>{Smart.Utilities.Assign("Grid.Cell",class{constructor(e,t){const l=this;if(l.row=e,l.column=t,l.grid=e.grid,l.rowSpan=1,l.colSpan=1,l.value=void 0,l.fontSize=null,l.fontWeight=null,l.fontFamily=null,l.fontStyle=null,l.color=null,l.background=null,l.textDecoration=null,l.tooltip=null,l.align=null,l.verticalAlign=null,l.readonly=!1,l.oldValue=void 0,l._updating=!1,l.styleChanged=!0,l.editor=null,l.template=null,l.isEditing=!1,l.canNotify=!0,l.selected=!1,l.focused=!1,l.error=!1,l.format=null,l.formula=null,e._style){const t=e._style;l.color=t.color,l.background=t.background,l.fontFamily=t.fontFamily,l.fontSize=t.fontSize,l.fontStyle=t.fontStyle,l.textDecoration=t.textDecoration,l.fontWeight=t.fontWeight}if(l.grid&&l.grid.formulas){let i=e.data[t.dataField];t.formula&&(l.formula=l._parseFormula(t.formula)),i&&(""+i).startsWith("=")&&(l.formula=l._parseFormula(""+i))}return new Proxy(l,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){if("value"===t){const e=l.column.displayField?l.row.data[l.column.displayField]:l.row.data[l.column.dataField];if(l.grid&&l.grid.formulas&&l.formula){const e=l.grid._formulaParser;if(e){return e.parse(l.formula.slice(1))}}return e}if("editor"===t||"template"===t)return e[t]||l.column[t];if("focused"===t){if(l.grid.selection.allowCellSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===l.row.id&&l.grid._selection.focusedCell.dataField===l.column.dataField)return!(l.grid&&l.grid.dataSource.virtualDataSource&&!l.grid.dataSource.id)||l.grid._selection.focusedCell.id===l.row.index;if(l.grid.selection.allowRowSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===l.row.id&&l.grid._selection.focusedCell.dataField===l.column.dataField)return!(l.grid&&l.grid.dataSource.virtualDataSource&&!l.grid.dataSource.id)||l.grid._selection.focusedCell.id===l.row.index;const e=l.parent();return!!(e&&l.grid.selection.allowCellSelection&&l.grid._selection.focusedCell&&l.grid._selection.focusedCell.id===e.row.id&&l.grid._selection.focusedCell.dataField===e.column.dataField)}if("selected"===t)return!0===l.row.getProperty("selected")||(!0===l.column.getProperty("selected")||!!l.grid._selection.cells["row"+l.row.id]&&l.grid._selection.cells["row"+l.row.id][l.column.dataField]);if("modifiedValue"===t){l.grid._cellsUpdatedValues||(l.grid._cellsUpdatedValues=[]);const t=l.grid._cellsUpdatedValues[l.row.id+"_"+l.column.dataField];return void 0!==t?t:e.value}return e[t]},set:function(e,i,a){const r=this.get(e,i);if(r===a)return!0;if(e[i]=a,"element"===i||"isEditing"===i||"oldValue"===i||"_updating"===i||"notifyFn"===i||i.startsWith("_")||"canNotify"===i)return!0;if("error"===i)return!0;if("focused"===i&&(l.grid._selection.focusedCell={id:l.row.id,dataField:l.column.dataField,value:l.value,index:l.row.index}),"colSpan"!==i&&"rowSpan"!==i||a>=0&&-1===l.grid._cellsMerge.indexOf(l)&&l.grid._cellsMerge.push(l),"row"===i||"column"===i||"grid"===i||"styleChanged"===i||"formula"===i)return"formula"===i&&(l.formula=l._parseFormula(l.formula)),!0;if("background"!==i&&"fontSize"!==i&&"fontWeight"!==i&&"fontFamily"!==i&&"textDecoration"!==i&&"color"!==i&&"fontStyle"!==i||(l.grid._cellStyles["row"+l.row.id]=!0,l.grid._cellStyles.length++,l._styleChanged=!0),"value"===i){void 0===l.oldValue&&(l.oldValue=r);(()=>{l.grid.dataSource.boundSource.canNotify=!1,null===a&&(l.column.allowNull||(a="number"===l.column.dataType||"int"===l.column.dataType||"float"===l.column.dataType||"integer"===l.column.dataType?0:"date"===l.column.dataType?new Date:"boolean"!==l.column.dataType&&"bool"!==t.dataType&&"")),void 0===a&&(a=null),null!==a&&a.label&&a.value?(l.row.data[l.column.displayField]=a.label,l.row.data[l.column.dataField]=a.value):(l.column.valueField&&(l.row.data[l.column.valueField]=a),l.row.data[l.column.dataField]=a);const e=l.grid.dataSource.dataItemById[l.row.id];if(e){const t=e.$.index;l.grid.dataSource&&a!==l.grid.dataSource.boundSource[t][l.column.dataField]&&(l.grid._sortedColumns&&l.grid._sortedColumns.length>0?e[l.column.dataField]=a:l.grid.dataSource.boundSource[t][l.column.dataField]=a)}l.grid.dataSource.boundSource.canNotify=!0})()}return"selected"===i&&(l.grid._selection.cells["row"+l.row.id]&&(delete l.grid._selection.cells["row"+l.row.id][l.column.dataField],1===Object.getOwnPropertyNames(l.grid._selection.cells["row"+l.row.id]).length&&delete l.grid._selection.cells["row"+l.row.id]),l.grid._selection.cells["column"+l.column.dataField]&&(delete l.grid._selection.cells["column"+l.column.dataField][l.row.id],1===Object.getOwnPropertyNames(l.grid._selection.cells["column"+l.column.dataField]).length&&delete l.grid._selection.cells["column"+l.column.dataField]),a&&(l.grid._selection.cells["row"+l.row.id]||(l.grid._selection.cells["row"+l.row.id]=[]),l.grid._selection.cells["column"+l.column.dataField]||(l.grid._selection.cells["column"+l.column.dataField]=[]),l.grid._selection.cells["row"+l.row.id][l.column.dataField]=!0,l.grid._selection.cells["column"+l.column.dataField][l.row.id]=!0)),!(!l._updating&&l.canNotify)||(l.grid._recycle(),!l.row.canNotify||(l.propertyChanged&&l.propertyChanged(name.substring(1),r),!0))}})}_parseFormula(e){let t=0;const l=this.row;if(!e)return e;for("string"!=typeof e&&(e=""+e),!1===e.startsWith("=")&&(e="="+e);e.indexOf("COL")>=0;){const i=e.indexOf("COL"),a=i+e.substring(i).indexOf(")"),r=e.substring(i,a+2),n=e.substring(a+2,a+3);let s="";if(s=isNaN(parseInt(n))?r.replace("COL(","").replace(")",1+l.index):r.replace("COL(","").replace(")",""),e=e.replace(r,s),t++,t>10)break}return e}setStyle(e){this.setProperties(e)}_setStyle(e){const t=this;if(t._styleChanged){if(!t.grid._cellStyles.length)return;let l="";const i={background:"background",color:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",textDecoration:"text-decoration"},a=e=>{const a=t[e];if(""===a||null===a)return;const r=i[e];l+=`${r}: ${a};`},r=["background","color","fontSize","fontFamily","fontWeight","fontStyle","textDecoration"];for(let e=0;e<r.length;e++)a(r[e]);e.getAttribute("style")!==l&&(""===l?e.removeAttribute("style"):e.setAttribute("style",l)),""!==e.style.paddingBottom&&(e.style.paddingBottom=""),t._styleChanged=!1}t.grid&&!t.grid.appearance.showSelectionOnTop||t.selected&&(t.background||t.color)&&(e.style.background="",e.style.color="")}getFormattedValue(e,t){const l=this;if(null==e||""===e)return e;if(!t)return""+e;if(l.column._cellsCachedValues||(l.column._cellsCachedValues=[]),l.column._cellsCachedValues[""+e+t+l.column.grid.locale])return l.column._cellsCachedValues[""+e+t+l.column.grid.locale];if("date"===l.column.dataType||"datetime"===l.column.dataType||"time"===l.column.dataType){if("dateRangeInput"===l.column.editor.template){if(Array.isArray(e)){const i=l.formatDate(e[0],t)+" - "+l.formatDate(e[1],t);return l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}{const i=l.formatDate(e,t);return l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}}let i=l.formatDate(e,t);return"1/1/0001 12:00 AM"===i&&(i=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}if("int"===l.column.dataType||"int64"===l.column.dataType||"float"===l.column.dataType||"number"===l.column.dataType){let i=l.formatNumber(e,t);return"NaN"===i&&(i=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}if("any"===l.column.dataType||"string"===l.column.dataType&&t&&t.length){let i=!1;if(t.indexOf("d")>=0&&t.indexOf("M")>=0&&(i=!0),(t.indexOf("d")>=0||t.indexOf("M")>=0||t.indexOf("y")>=0||t.indexOf("h")>=0||t.indexOf("H")>=0||t.indexOf("m")>=0)&&(i=!0),i){let i=l.formatDate(e,t);return"1/1/0001 12:00 AM"===i&&(i=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}{"string"==typeof e&&(e=parseFloat(e));let i=l.formatNumber(e,t);return"NaN"===i&&(i=""),l.column._cellsCachedValues[""+e+t+l.column.grid.locale]=i,i}}return e}formatDate(e,t){if(!Smart.Utilities.DateTime)return e;const l=this,i=l.grid;if(l.column.formatSettings.Intl&&l.column.formatSettings.Intl.DateTimeFormat){return new Intl.DateTimeFormat(this.grid.locale,l.column.formatSettings.Intl.DateTimeFormat).format(e)}!t&&l.column.formatSettings.dateFormat&&(t=l.column.formatSettings.dateFormat);try{const l=new Smart.Utilities.DateTime(e);l.calendar.locale=i.locale,i.messages[i.locale]&&i.messages[i.locale].calendar&&(i.messages[i.locale].calendar.months&&(l.calendar.months=i.messages[i.locale].calendar.months),i.messages[i.locale].calendar.days&&(l.calendar.days=i.messages[i.locale].calendar.days),void 0!==i.messages[i.locale].calendar.firstDay&&(l.calendar.firstDay=i.messages[i.locale].calendar.firstDay),void 0!==i.messages[i.locale].calendar.eras&&(l.calendar.eras=i.messages[i.locale].calendar.eras),void 0!==i.messages[i.locale].calendar.AM&&(l.calendar.AM=i.messages[i.locale].calendar.AM),void 0!==i.messages[i.locale].calendar.PM&&(l.calendar.PM=i.messages[i.locale].calendar.PM),void 0!==i.messages[i.locale].calendar["/"]&&(l.calendar["/"]=i.messages[i.locale].calendar["/"]),void 0!==i.messages[i.locale].calendar[":"]&&(l.calendar[":"]=i.messages[i.locale].calendar[":"]),l.calendar.today=i.messages[i.locale].today);let a=l.toString(t);return a!==i.messages[i.locale].today||i.showTodayDateAsString||(l.showTodayDateAsString=!1,a=l.toString(t),delete l.showTodayDateAsString),a}catch(t){return e}}formatNumber(e,t){if(!Smart.Utilities.NumberRenderer)return e;const l=this,i=l.grid;if(l.column.formatSettings.Intl&&l.column.formatSettings.Intl.NumberFormat){if(l.column.formatSettings.Intl.NumberFormat.currency&&Smart.Utilities.CurrencyFormatter){const t=void 0!==l.column.formatSettings.Intl.NumberFormat.maximumFractionDigits?l.column.formatSettings.Intl.NumberFormat.maximumFractionDigits:2,i=(new Smart.Utilities.CurrencyFormatter).format(e,{decimalPlaces:t,currency:l.column.formatSettings.Intl.NumberFormat.currency});return"accounting"===l.column.formatSettings.Intl.NumberFormat.currency.currencySign&&e<0?"("+i.replace("-","")+")":i}if(l.column.formatSettings.Intl.NumberFormat.locale){return new Intl.NumberFormat(l.column.formatSettings.Intl.NumberFormat.locale,l.column.formatSettings.Intl.NumberFormat).format(e)}{const t=new Intl.NumberFormat(this.grid.locale,l.column.formatSettings.Intl.NumberFormat).format(e);return"squaremeter"===l.column.formatSettings.Intl.NumberFormat.type?t+" m²":"cubicmeter"===l.column.formatSettings.Intl.NumberFormat.type?t+" m³":t}}const a=new Smart.Utilities.NumberRenderer;if(a.localizationObject){const e=l.column.formatSettings,t=i.messages[i.locale]?i.messages[i.locale].calendar:{};e.decimalPlaces&&(a.localizationObject.decimalPlaces=e.decimalPlaces),(e.decimalSeparator||t.decimalSeparator)&&(a.localizationObject.decimalSeparator=e.decimalSeparator||t.decimalSeparator,a.localizationObject.decimalseparator=a.localizationObject.decimalSeparator),(e.thousandsSeparator||t.thousandsSeparator)&&(a.localizationObject.thousandsSeparator=e.thousandsSeparator||t.thousandsSeparator,a.localizationObject.thousandsseparator=a.localizationObject.thousandsSeparator),a.localizationObject.currencysymbol=t.currencySymbol,a.localizationObject.currencysymbolposition=t.currencySymbolPosition,e.prefix&&(a.localizationObject.currencysymbol=e.prefix),e.sufix&&(a.localizationObject.currencysymbol=e.sufix,a.localizationObject.currencysymbolposition="after")}const r=a.formatNumber(e,t);return void 0===r?e:e<0&&l.column.formatSettings.negativeWithBrackets?"("+r+")":r}refresh(){const e=this;if(e.element){const t=e.element.firstChild;e._setStyle(t)}}autoWrap(){const e=this;e.element&&e.element._autoWrap()}setProperties(e){const t=this;t._updating=!0;for(let l in e)t[l]=e[l];t._updating=!1,t.grid._recycle()}createElement(){const e=document.createElement("smart-grid-cell");return e.setAttribute("role","gridcell"),this.element=e,e._initialize(this),e}render(){this.element&&this.element._render()}parent(e){const t=this,l=t.row,i=t.column.dataField,a=t.grid;if(!a._cellsMerge.length)return null;if(t.__parentCells&&void 0!==t.__parentCells["row"+l.id+"_column_"+i])return t.__parentCells["row"+l.id+"_column_"+i];let r=a.getVisibleRows();a.paging.enabled&&"page"===a.selection.selectAllMode&&(r=r.slice(a.paging.pageIndex*a.paging.pageSize,(a.paging.pageIndex+1)*a.paging.pageSize)),t.__parentCells||(t.__parentCells=[]);for(let n=0;n<a._cellsMerge.length;n++){const s=a._cellsMerge[n];let o=[],d=[];if(o.push(s.row),s.rowspan>1){const e=r.indexOf(s.row);if(e>=0)for(let t=e;t<e+s.rowSpan;t++)r[t]&&-1===o.indexOf(r[t])&&o.push(r[t])}if(d.push(s.column.dataField),s.colspan>1){const e=a.columns.indexOf(a.columnByDataField[s.column.dataField]);for(let t=e;t<e+s.colSpan;t++)a.columns[t]&&-1===d.indexOf(a.columns[t].dataField)&&d.push(a.columns[t].dataField)}if(o.indexOf(l)>=0&&d.indexOf(i)>=0){if(e){const e={cell:s.row.getCell(s.column.dataField),rows:o,columns:d,row:s.row,column:s.column,endRow:o[o.length-1],endColumn:a.columnByDataField[d[d.length-1]]};return t.__parentCells["row"+l.id+"_column_"+i]=e,e}const r=s.row.getCell(s.column.dataField);return t.__parentCells["row"+l.id+"_column_"+i]=r,r}}return t.__parentCells["row"+l.id+"_column_"+i]=null,null}}),Smart("smart-grid-cell",class extends Smart.BaseElement{static get properties(){return{}}get hasStyleObserver(){return!1}get enableShadowDOM(){return!1}addThemeClass(){}addDefaultClass(){}get isUtilityElement(){return!0}_refresh(){const e=this;e.innerHTML="",e._initialize(e.cell)}_createToggleButton(e,t){const l=this,i=document.createElement("div"),a=document.createElement("button"),r=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div"),o=document.createElement("span"),d=t.grid;t.row.expanded?a.setAttribute("toggled",""):a.removeAttribute("toggled",""),a.tabIndex=-1,l.toggleButton=a,l.checkbox=s,e.appendChild(i),e.appendChild(n),n.setAttribute("content",""),i.setAttribute("indent",""),r.setAttribute("label",""),a.setAttribute("toggle-button",""),s.setAttribute("checkbox",""),s.setAttribute("role","checkbox"),l.setAttribute("has-toggle-button",""),n.appendChild(a),n.appendChild(s),o.classList.add("smart-input"),s.appendChild(o),d.checkBoxes.visible?o.classList.remove("smart-hidden"):o.classList.add("smart-hidden"),n.appendChild(r),l.content=r}_initialize(e){const t=this,l=document.createElement("div"),i=e.column,a=e.grid;t._properties=[],t.cell=e,t.appendChild(l);let r=!1;if(i&&i._treeColumn&&a.dataSource.boundHierarchy&&(r=!0,e.row.filterRow&&(r=!1),!a.grouping.enabled&&a.dataSource.groupBy&&a.dataSource.groupBy.length>0&&(r=!1),a.grouping.enabled&&a.dataSource.groupBy&&0===a.dataSource.groupBy.length&&(r=!1)),r)return t._createToggleButton(l,e),void(t.isRendered=!0);{const e=document.createElement("div");l.appendChild(e)}t.content=l,t.isRendered=!0}_renderCommands(){const e=this,t=e.cell.grid;if(t.__cellsCommandTemplate)return e.firstChild.innerHTML=t.__cellsCommandTemplate,void t._updateCommandColumnCommandsVisibility(e.firstChild,e.cell.row);const l=t._getCommandColumnCommandsTemplate();e.firstChild.innerHTML=l,t._updateCommandColumnCommandsVisibility(e.firstChild,e.cell.row),t.__cellsCommandTemplate=l}_renderGroupCell(){const e=this,t=e.cell.grid,l=e.cell.column,i=e.cell.row;[...e.attributes].forEach((t=>e.removeAttribute(t.name))),e.setAttribute("group","");const a=l===t._firstRenderedColumn;e.style.width!==l.computedWidth+"px"&&(e.style.width=l.computedWidth+"px"),a||(t.rightToLeft?e.style.right!==l.left+"px"&&(e.style.right=l.left+"px"):e.style.left!==l.left+"px"&&(e.style.left=l.left+"px")),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),l===t._firstRenderedColumn||i.summaryRow||e.classList.add("smart-hidden"),l.autoGenerated&&(e.style.width="0px");let r=i.label;const n=function(e,t,l){if(!t)return[];for(let i=0;i<t.length;i++){const a=t[i];a.$&&!1===a.$.filtered||(void 0!==a[e]&&l.push(a),a.summaryRow||(a.children||a.data&&a.data.children)&&n(e,a.children,l))}return l};if(void 0!==i.label){let s="",o=[];if(t.grouping.summaryRow.visible){let r=[];const d={},c=a?l.summary.length>0?l.summary:["count"]:l.summary;c.length&&(r=n(l.dataField,i.summaryRow?i.parent.data.children:i.data.children,[])),d[l.dataField]=c;const m=c.length>0?t.dataSource.summarize([d],r):null;if(m)for(let r=0;r<c.length;r++){const n=c[r];r>0&&(s+=", ");let u=m[l.dataField][n];const p=l.cellsFormat;if(p&&(u=e.cell.getFormattedValue(u,p)),a){const a=t.columnByDataField[i.groupDataField];if(a){d[a.dataField]=c,m[a.dataField]=m[l.dataField],u=m[a.dataField][n];const t=a.cellsFormat;t&&(u=e.cell.getFormattedValue(u,t))}}s+=t.localize(n,{value:u}),o.push(m[l.dataField][n])}}if(t.dataSource.virtualDataSourceOnExpand&&(s=""),a){const l=t.columnByDataField[i.groupDataField],a=l?l.label:"";if("advanced"===t.grouping.renderMode){if(i.summaryRow)r="<div header group-advanced><span group></span><span value></span>",s&&(r+="<div summary>",r+=s,r+="</div>");else{let e=i.label?i.label:t.localize("blankSummary");i.label||"taskStatus"!==i.groupDataField||(e="");let n="";if(l&&l.editor&&l.editor.dataSource){const t=l.editor.dataSource.find((t=>t.value===e||t.label===e));t&&t.color?(n=`--smart-primary: ${t.color}`,t.label&&(e=t.label)):t&&t.label&&(e=t.label)}if(i.label||"taskStatus"!==i.groupDataField||(e=t.localize("uncategorized")),"object"==typeof e&&l.cellsFormat){const t=i.getCell(l.dataField);e=t.getFormattedValue(e,l.cellsFormat)}else if("object"==typeof e&&e&&e instanceof Date){const t=i.getCell(l.dataField);e=t.getFormattedValue(e,"d")}r=`<div style="${n}" header group-advanced><span group>${t.editing.addNewRow.visible?'<span add-row class="smart-grid-icon smart-icon-plus-circled show"></span>':""}${a}: </span><span value>${e}</span>`,s&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=""+s,r+="</span>")}r+="</div>",e.classList.add("smart-grid-column-border-collapse")}else if("compact"===t.grouping.renderMode){if(i.summaryRow)r="<div header><span group></span><span value></span>",s&&(r+="<div summary>",r+=s,r+="</div>");else{let e=i.label;if(l.displayField!==l.dataField&&i.data.data&&(e=i.data.data[l.displayField]),"object"==typeof e&&l.cellsFormat){e=i.getCell(l.dataField).getFormattedValue(e,l.cellsFormat)}r="<div header><span group>"+a+": </span><span value>"+e+"</span>",s&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>")}r+="</div>",e.classList.add("smart-grid-column-border-collapse")}else if("basic"===t.grouping.renderMode){if(r=i.label,l.displayField!==l.dataField&&i.data.data&&(r=i.data.data[l.displayField]),"object"==typeof r&&l.cellsFormat){r=i.getCell(l.dataField).getFormattedValue(r,l.cellsFormat)}i.summaryRow?s&&(r+="<div summary>",r+=s,r+="</div>"):s&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>"),e.classList.add("smart-grid-column-border-collapse")}else if("multipleColumns"===t.grouping.renderMode){if(r=i.label,"object"==typeof r&&l.cellsFormat){r=i.getCell(l.dataField).getFormattedValue(r,l.cellsFormat)}i.summaryRow?s&&(r+="<div summary>",r+=s,r+="</div>"):s&&t.grouping.summaryRow.inline&&(r+="<span summary>",r+=" ("+o+")",r+="</span>"),e.classList.add("smart-grid-column-border-collapse")}e.setAttribute("has-toggle-button","")}else e.removeAttribute("has-toggle-button",""),r=s}let s=e.firstChild;if(t.dataSource.boundHierarchy&&a){s.children.length<=1&&(e.innerHTML="<div></div>",s=e.firstChild,e._createToggleButton(s,e.cell),s=e.firstChild);const n=s.children[0],o=s.children[1].children[0],d=s.children[1].children[1].firstChild,c=s.children[1].children[2];n.setAttribute("indent",""),i.checked?d.setAttribute("checked",""):!1===i.checked?d.removeAttribute("checked"):null===i.checked&&d.setAttribute("checked","indeterminate"),i.leaf?o.classList.add("smart-visibility-hidden"):(o.classList.remove("smart-visibility-hidden"),i.expanded?o.setAttribute("toggled",""):o.removeAttribute("toggled",""));let m="";if(!l._treeColumn||i.summaryRow||i.filterRow?e.toggleButton.classList.add("smart-hidden"):e.toggleButton.classList.remove("smart-hidden"),l._treeColumn)if(t.grouping.enabled){let e=i.level-1;if(1+e===0)m+="",n.classList.add("smart-hidden");else{if("multipleColumns"===t.grouping.renderMode){let l=0;for(let i=0;i<t.columns.length;i++)i<1+e&&(l+=t.columns[i].computedWidth);m+='<div style="width: '+l+'px;"></div>'}else m+='<div style="width: '+(1+e)*t.grouping.groupIndent+'px;"></div>';n.classList.remove("smart-hidden")}}else for(let e=0;e<i.level;e++)m+="<div class='smart-indent'></div>";if(void 0===i.label||i.summaryRow||i.filterRow?o.classList.add("smart-hidden"):(o.classList.remove("smart-hidden"),o.style.marginLeft=""),n.innerHTML=m,c.innerHTML=r,a&&t.grouping.formatFunction){const a={row:i,column:l,groupDataField:i.groupDataField,cell:e.cell,value:r,template:null};t.grouping.formatFunction(a),a.value!==r?c.innerHTML=a.value:a.template&&(c.innerHTML=a.template)}t.appearance.showTooltips?c.setAttribute("title",i.label?i.label:t._unescapeString(r)):c.hasAttribute("title")&&c.removeAttribute("title")}else void 0!==i.label&&t.grouping.enabled&&!a&&(s.innerHTML=r);let o="smart-label";e.style.zIndex="";const d=t.editing.addNewColumn.visible?t._addNewColumn.width-1:0;if(a){const l=t.columnByDataField[i.groupDataField];l.cellsAlign&&(o+=" align-"+l.cellsAlign),l.cellsVerticalAlign&&(o+=" align-"+l.cellsVerticalAlign),e.setAttribute("header",""),i.summaryRow||(e.style.width="calc(100% - "+d+"px)"),void 0!==i.label&&(e.style.zIndex=11)}else l===t._firstRenderedColumn&&(e.style.zIndex=4),e.setAttribute("header",""),i.summaryRow||(e.style.width="calc(100% - "+d+"px)");if(i.summaryRow&&(e.setAttribute("header",""),e.classList.add("smart-grid-column-border-collapse"),l.cellsAlign&&(o+=" align-"+l.cellsAlign),l.cellsVerticalAlign&&(o+=" align-"+l.cellsVerticalAlign)),s.className!==o&&(s.className=o),l.formatFunction){const t={row:i,column:l,cell:e.cell,value:null,template:null,group:{value:r,template:null}};if(l.formatFunction(t),t.group.value!==r)if(l._treeColumn){s.children[1].children[2].innerHTML=t.group.value}else s.innerHTML=t.group.value;null!==t.group.template&&(s.innerHTML=t.group.template)}}_renderFilterCell(e){const t=this,l=t.cell.grid,i=t.cell.column;let a;const r=(e,t)=>{l._handleFilterMenuClick(e,t)};l._filterInfo||(l._filterInfo={},l._filterInfo.stringConditions=[{icon:"smart-icon-contains",command:r,value:"CONTAINS",label:l.localize("CONTAINS")},{icon:"smart-icon-does-not-contain",command:r,value:"DOES_NOT_CONTAIN",label:l.localize("DOES_NOT_CONTAIN")},{icon:"smart-icon-starts-with",command:r,value:"STARTS_WITH",label:l.localize("STARTS_WITH")},{icon:"smart-icon-ends-with",command:r,value:"ENDS_WITH",label:l.localize("ENDS_WITH")},{icon:"smart-icon-equals",command:r,value:"EQUAL",label:l.localize("EQUAL")},{icon:"smart-icon-delete",command:r,value:"CLEAR_FILTER",label:l.localize("CLEAR_FILTER")}],l._filterInfo.numberAndDateConditions=[{icon:"smart-icon-equals",command:r,value:"EQUAL",label:l.localize("EQUAL")},{icon:"smart-icon-not-equal",command:r,value:"NOT_EQUAL",label:l.localize("NOT_EQUAL")},{icon:"smart-icon-less-than",command:r,value:"LESS_THAN",label:l.localize("LESS_THAN")},{icon:"smart-icon-less-than-equal",command:r,value:"LESS_THAN_OR_EQUAL",label:l.localize("LESS_THAN_OR_EQUAL")},{icon:"smart-icon-greater-than",command:r,value:"GREATER_THAN",label:l.localize("GREATER_THAN")},{icon:"smart-icon-greater-than-equal",command:r,value:"GREATER_THAN_OR_EQUAL",label:l.localize("GREATER_THAN_OR_EQUAL")},{icon:"smart-icon-between",command:r,value:"RANGE",label:l.localize("RANGE")},{icon:"smart-icon-delete",command:r,value:"CLEAR_FILTER",label:l.localize("CLEAR_FILTER")}]),a="string"===i.dataType?l._filterInfo.stringConditions:l._filterInfo.numberAndDateConditions;let n="smart-icon-search";if(i._filterInfo||(i._filterInfo={condition:""}),i.filterEditor&&i.filterEditor.condition&&(i._filterInfo.condition=i.filterEditor.condition),i.filterEditor&&i.filterEditor.value&&(i._filterInfo.value=i.filterEditor.value),i._filterInfo.dataSource=a,null===i._filterInfo.condition||void 0===i._filterInfo.condition)i._filterInfo.condition="",n="smart-icon-search";else switch(i._filterInfo.condition.toLowerCase()){case"equal":n="smart-icon-equals";break;case"starts_with":n="smart-icon-starts-with";break;case"ends_with":n="smart-icon-ends-with";break;case"not_equal":n="smart-icon-not-equal";break;case"less_than":n="smart-icon-less-than";break;case"less_than_or_equal":n="smart-icon-less-than-or-equal";break;case"greater_than":n="smart-icon-greater-than";break;case"greater_than_or_equal":n="smart-icon-greater-than-or-equal";break;case"contains":n="smart-icon-contains";break;case"does_not_contain":n="smart-icon-does-not-contain";break;case"range":n="smart-icon-between";break;default:n="smart-icon-search"}let s=`<div class="smart-filter-input-type"><i class="smart-grid-icon ${n} show"></i></div> `;if("string"===i.dataType)s+=`<input class="smart-filter-input-value" data-type="${i.dataType}" /> `,e.innerHTML=s;else if("date"===i.dataType){const a=new Smart.Utilities.DateTime;s+=`<input placeholder = "${a.expandFormat(a.calendar,i.cellsFormat||"d")}" class="smart-filter-input-value" data-type="${i.dataType}"/><div class="smart-filter-input-type"><i class="smart-grid-icon smart-icon-calendar show"></i></div>`,e.innerHTML=s,e.lastElementChild.onpointerdown=function(){l._handleFilterCalendarCellClick(t.cell)}}else if("number"===i.dataType)s+='<div class="smart-grid-cell-editor smart-filter-input-value smart-grid-number-input-cell-editor"><input class="smart-input" type="number"><div tabindex="-1" class="nav"><div tabindex="-1" class="up"></div><div tabindex="-1" class="down"></div></div></div>',e.innerHTML=s,l._handleFilterNumberCellEditor(this.cell,e);else if("boolean"===i.dataType||"bool"===i.dataType){const a=document.createElement("div");a.classList.add("smart-input"),a.classList.add("smart-grid-check-box-cell-editor"),a.classList.add("smart-filter-input-value"),e.tabIndex=0,e.style.outline="none",t.setAttribute("template","checkBox"),a.setAttribute("checked","indeterminate"),i._filterInfo&&i._filterInfo.value?a.setAttribute("checked",""):i._filterInfo&&!1===i._filterInfo.value&&a.removeAttribute("checked"),s=a.outerHTML,e.innerHTML=s,e.classList.add("align-center"),e.classList.add("smart-label"),e.onfocus=()=>{e.setAttribute("focus","")},e.onblur=()=>{e.removeAttribute("focus","")},e.onclick=e=>{e.target.classList.contains("smart-input")&&l._handleFilterCellCheckBoxClick(this.cell)}}const o=e.querySelector("input");if(o&&(e.firstElementChild.onpointerdown=function(){l._handleFilterCellIconClick(this.cell)}.bind(this),o.onpaste=function(e){setTimeout((()=>{l._handleFilterCellKeyUp(this.cell,e)}))}.bind(this),o.onfocus=function(){l._handleFilterCellFocus(this.cell)}.bind(this),o.onblur=function(){l._handleFilterCellBlur(this.cell)}.bind(this),o.onkeyup=function(e){l._handleFilterCellKeyUp(this.cell,e)}.bind(this),o.onkeydown=function(e){l._handleFilterCellKeyDown(this.cell,e)}.bind(this)),e.classList.add("smart-filter-input-container"),i._filterInfo.input=o,i._filterInfo.cell=t.cell,i._filterInfo.editor=e,i._filterInfo.value&&o&&(o.value=i._filterInfo.value,"date"===i.dataType&&(o.value=t.cell.getFormattedValue(i._filterInfo.value,i.cellsFormat))),i.allowFilter||(o.disabled=!0),i.filterEditor)if(i.filterEditor.template){const t=i.filterEditor.template,l=document.createElement("div");i.filterTemplate instanceof HTMLTemplateElement?l.appendChild(t.content.cloneNode(!0)):t instanceof HTMLElement?l.appendChild(t):l.innerHTML=t,e.innerHTML="",e.appendChild(l),l.style.height="100%",l.style.width="100%";const a=e.querySelector("input");a&&(a.onfocus=()=>{e.setAttribute("focus","")},a.onblur=()=>{e.removeAttribute("focus","")}),i.filterEditor.onInit&&i.filterEditor.onInit(i,l)}else void 0!==i.filterEditor.min&&(o.min=i.filterEditor.min),void 0!==i.filterEditor.max&&(o.max=i.filterEditor.max),void 0!==i.filterEditor.minLength&&(o.minLength=i.filterEditor.minLength),void 0!==i.filterEditor.maxLength&&(o.maxLength=i.filterEditor.maxLength),void 0!==i.filterEditor.placeholder&&(o.placeholder=i.filterEditor.placeholder),void 0!==i.filterEditor.value&&(o.value=i.filterEditor.value),void 0!==i.filterEditor.step&&(o.step=i.filterEditor.step),void 0!==i.filterEditor.disabled&&(o.disabled=i.filterEditor.disabled),void 0!==i.filterEditor.condition&&(i._filterInfo.condition=i.filterEditor.condition),i.filterEditor.onInit&&i.filterEditor.onInit(i,e)}_setTemplate(t,l,i){const a=this,r=a.cell.grid,n=a.cell.column;let s=null;switch((!r.editing.enabled||!n.allowEdit||a.cell.readonly||"none"===r.editing.action||r.editing.enabled&&r.editing.commandColumn.visible&&r.editing.editRow!==a.cell.row)&&a.setAttribute("readonly",""),l){case"checkBox":case"radioButton":case"switchButton":if(i.firstElementChild&&i.firstElementChild.classList.contains("smart-input"))return s=i.firstElementChild,t?s.setAttribute("checked",""):null===t?s.setAttribute("checked","indeterminate"):s.removeAttribute("checked"),void a.setAttribute("template",a.cell.template);s=document.createElement("span"),s.className="smart-input",t?s.setAttribute("checked",""):null===t?s.setAttribute("checked","indeterminate"):s.removeAttribute("checked"),a.setAttribute("template",a.cell.template),i.innerHTML="",i.appendChild(s),a.cell._setStyle(i);break;case"checklist":if(t&&t.indexOf("[")>=0&&(t=JSON.parse(t)),i.firstElementChild&&i.firstElementChild.hasAttribute("value")){const e=i.firstElementChild.getAttribute("value");if(t&&e===t.length)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}if(t&&Array.isArray(t)&&t.length>0){const e=t.filter((e=>e.completed)).length,l=["#D50000","#F4511E","#F6BF26","#33B679"],i=e+"/"+t.length;let a=l[0];e===t.length?a=l[3]:e>0&&e<t.length&&(a=l[2]),t=`<div style="display: grid; grid-template-columns: 25px auto"><div style="margin-left: 4px; align-self: center; border-radius: 50%; display: flex; align-content: center; background: ${a}; width:16px; height: 16px;"><span title="${i}" style="align-content: center; font-size: 13px; color: white;" class="smart-grid-icon show smart-icon-check"></span></div>${i}</span></div>`}else t="";s=document.createElement("span"),s.innerHTML=t,a.setAttribute("template",a.cell.template),s.setAttribute("value",t.length);break;case"createdBy":case"updatedBy":{const e=a.cell.row;let t=null,o=null;if(t="createdBy"===l?e.createdBy:e.updatedBy,i.firstElementChild&&i.firstElementChild.hasAttribute("user-id")){if(t===parseInt(i.firstElementChild.getAttribute("user-id")))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template);if(null!=t&&-1!==t){o=r.users.find((e=>e.id===t));const e=o;if(e){const l=i.firstElementChild.firstElementChild&&i.firstElementChild.firstElementChild.firstElementChild?i.firstElementChild.firstElementChild.firstElementChild.firstElementChild:null;if(l){i.firstElementChild.setAttribute("user-id",t);const a="string"==typeof e?e:e.name,r="string"==typeof e?null:e.color;if(("string"==typeof e?null:e.image)&&(l.firstElementChild.style.backgroundImage=`url('${e.image}')`),r){const e=new Smart.Color(r).getInvertedColor();l.setAttribute("data-item",a),l.setAttribute("title",a),l.setAttribute("backgroundColor",r),l.setAttribute("color",e),l.lastElementChild.textContent=a}else l.setAttribute("data-item",a),l.setAttribute("title",a),l.setAttribute("backgroundColor",""),l.setAttribute("color","");return}}}}const d=document.createElement("div");d.classList.add("smart-multi-combo-input"),d.setAttribute("data-field",n.dataField),d.setAttribute("row-id",a.cell.row.id),d.style.width="100%",d.style.paddingRight="6px";let c='<div class="smart-flex smart-flex-auto smart-tokens-layout">';if(null!=t&&-1!==t){o=r.users.find((e=>e.id===t));const e=o;if(e){const t="string"==typeof e?e:e.name,l="string"==typeof e?null:e.color,i="string"==typeof e?null:e.image,a=document.createElement("span");if(i&&(a.style.backgroundImage=`url('${e.image}')`,a.className="smart-drop-down-list-selection-image"),l){c+='<span title="'+t+'" data-item="'+t+'" style="background: '+l+"; color: "+new Smart.Color(l).getInvertedColor()+'; overflow: visible;" class="smart-truncate smart-token">'+a.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+t+"</span></span>"}else c+='<span title="'+t+'" data-item="'+t+'" class="smart-truncate smart-token">'+a.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+t+"</span></span>"}else c=""}d.innerHTML=c+"</div>";const m=document.createElement("div");m.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),d.classList.add("smart-flex-auto"),m.appendChild(d),s=m,s.setAttribute("user-id",t),a.setAttribute("template",a.cell.template);break}case"collaborator":case"tags":{let e=[];"number"==typeof t&&(t=""+t);let o=!1===r.editing.enabled?"smart-visibility-hidden":"",d=n.editor.dataSource&&n.editor.dataSource.length;if(n.editor.collaborator&&(d=r.users&&r.users.length),d||(o="smart-visibility-hidden"),n.relationId&&n.relationField&&t){let e=!1;for(let l=0;l<n.editor.dataSource.length;l++){const i=n.editor.dataSource[l];if(("string"==typeof i?i:i.label)===t){e=!0;break}}e||(t=null)}if(""===t||null===t||"uncategorized"===t){let e=`\n <div class="smart-multi-combo-input-container tokens smart-flex smart-flex-auto" data-field="${n.dataField}" row-id="${a.cell.row.id}"> \n <div class="smart-multi-combo-input" data-field="${n.dataField}" row-id="${a.cell.row.id}" class="tokens smart-flex smart-flex-auto">\n <div class=" smart-flex-auto smart-flex"></div>\n </div>\n <span class="smart-arrow-down arrowbtn ${o}"></span>\n </div>\n `;i.innerHTML!==e&&(i.firstElementChild&&i.firstElementChild.firstElementChild&&i.firstElementChild.firstElementChild.firstElementChild&&""===i.firstElementChild.firstElementChild.firstElementChild.textContent?(i.firstElementChild.setAttribute("row-id",a.cell.row.id),i.firstElementChild.firstElementChild.setAttribute("row-id",a.cell.row.id)):i.innerHTML=e);const t=i.querySelector(".smart-arrow-down");return t&&(t.onpointerdown=e=>{if(r.editing.enabled){const t=e.target.previousElementSibling,l=t.getAttribute("data-field"),i=t.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l)}e.stopPropagation(),e.preventDefault()}),void a.setAttribute("template",a.cell.template)}if(null!==t&&(e=Array.isArray(t)?e.map((e=>e.trim())):t.indexOf("{")>=0||"[]"===t?JSON.parse(t):t.split(",").map((e=>e.trim()))),i.firstElementChild&&i.firstElementChild.hasAttribute("value")&&n.editor._items){if(i.firstElementChild.getAttribute("value")===t){if(a.cell._setStyle(i),a.setAttribute("template",a.cell.template),i.firstElementChild&&i.firstElementChild.firstElementChild&&i.firstElementChild.firstElementChild.firstElementChild)if(i.firstElementChild.firstElementChild.firstElementChild.classList.remove("smart-flex-wrap"),a.cell.row.height>45){i.firstElementChild.firstElementChild.firstElementChild.classList.add("smart-flex-wrap");const e=i.firstElementChild.firstElementChild.firstElementChild;if(e.children&&e.children.length>1)for(let t=0;t<e.children.length;t++)e.children[t].style.maxWidth&&(e.children[t].style.maxWidth="")}else if(r.layout.rowHeight<=45&&a.cell.row.height<=45){const e=i.firstElementChild.firstElementChild.firstElementChild;if(e.children&&e.children.length>1){const t=parseInt(n.computedWidth/e.children.length)-5;let l=0;for(let t=0;t<e.children.length;t++)l+=e.children[t].textContent.length,e.children[t].style.maxWidth="";if(14*l*.52+20*e.children.length>n.computedWidth)for(let l=0;l<e.children.length;l++)e.children[l].style.maxWidth=t+"px"}}return}}const c=document.createElement("div");c.classList.add("smart-multi-combo-input"),c.setAttribute("data-field",n.dataField),c.setAttribute("row-id",a.cell.row.id);let m='<div class="smart-tokens-layout smart-flex smart-flex-auto">';if(e.length>2&&a.cell.row.height>45){m='<div style="max-width: '+(n.computedWidth-10+"px")+'" class="smart-flex smart-flex-wrap">'}let u=0;if(t)for(let t=0;t<e.length;t++){const i=e[t];let a=null;if("collaborator"===l||n.editor&&n.editor.collaborator)a=r.users.find((e=>{if("string"==typeof i||"number"==typeof i){if(e.value===i||parseInt(e.value)===parseInt(i))return e;if(e.id===i||parseInt(e.id)===parseInt(i))return e}else if("object"==typeof i&&e.value===i.value)return e})),a&&(a.label=a.name);else if(n.editor.dataSource)if("string"==typeof i&&n.editor._items&&n.editor._items[i])a=n.editor._items[i];else for(let e=0;e<n.editor.dataSource.length;e++){const t=n.editor.dataSource[e];if(void 0!==t.value&&void 0!==i&&void 0!==i.value&&t.value===i.value){a=t,n.editor._items||(n.editor._items=[]),n.editor._items[i]=t;break}if(void 0===t.value&&t===i||void 0!==t.value&&""+t.value===i){a=t,n.editor._items||(n.editor._items=[]),n.editor._items[i]=t;break}}else a=i;if(!a)continue;const s="string"==typeof a?a:a.label,o="string"==typeof a?null:a.color,d="string"==typeof a?null:a.image;if(""===s)continue;const c=document.createElement("span");d&&(c.style.backgroundImage=`url('${a.image}')`,c.className="smart-drop-down-list-selection-image");const p="smart-truncate";if(o&&n.editor.colorItems){m+='<span title="'+s+'" data-item="'+s+'" style="background: '+o+"; color: "+new Smart.Color(o).getInvertedColor()+'; overflow: visible;" class="'+p+' smart-token">'+c.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>"}else m+='<span title="'+s+'" data-item="'+s+'" class="'+p+' smart-token">'+c.outerHTML+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>";if(u+=s.length,n.editor.dataSource){if(n.editor.singleSelect){m+="</span>";break}m+='<span class=\'smart-hidden smart-drop-down-list-unselect-button\' role="button" aria-label="Unselect"></span></span>'}else m+="</span>"}c.innerHTML=m+"</div>";const p=14*u*.52,g=c.firstElementChild;if(r.layout.rowHeight<=45&&a.cell.row.height<=45&&c&&g.children.length>1&&p+20*g.children.length>n.computedWidth){const e=parseInt(n.computedWidth/g.children.length)-5;for(let t=0;t<g.children.length;t++)g.children[t].style.maxWidth=e+"px"}if(c.style.width="100%",a.onmouseenter=()=>{c.style.width="calc(100% - 25px)"},a.onmouseleave=()=>{c.style.width="100%"},c.style.paddingRight="6px",c.onpointerdown=t=>{if(!r._mobile)if(t.target&&"#text"!==t.target.nodeName&&t.target.classList.contains("smart-drop-down-list-unselect-button")){let l=t.target.parentNode.getAttribute("data-item");if(n.editor.dataSource&&"string"==typeof l&&n.editor.dataSource)for(let e=0;e<n.editor.dataSource.length;e++)n.editor.dataSource[e].label===l&&(l=n.editor.dataSource[e],l.value&&(l=l.value));if(e[0]&&e[0].label){const i=e.map((e=>e.value)).indexOf(l);if(i>=0){e.splice(i,1);const l=a.cell.value,s=e.join(", ");r.setCellValue(a.cell.row.id,n.dataField,JSON.stringify(e)),r.onCellUpdate&&r.onCellUpdate([a.cell],[l],[s],(function(){}),a),t.preventDefault(),t.stopPropagation()}}else if(e.indexOf(l)>=0){e.splice(e.indexOf(l),1);const i=a.cell.value,s=e.join(", ");r.setCellValue(a.cell.row.id,n.dataField,s),r.onCellUpdate&&r.onCellUpdate([a.cell],[i],[s],(function(){}),a),t.preventDefault(),t.stopPropagation()}}else if(t.target.classList.contains("smart-drop-down-list-selection-label")){if(r.editing.enabled){const e=t.target.parentElement.parentElement,l=e.getAttribute("data-field"),i=e.getAttribute("row-id");r.beginEdit(i,l)}t.stopPropagation(),t.preventDefault()}},!n.cellsWrap&&n.allowEdit&&r.editing.enabled&&"card"!==r.view){const t=document.createElement("span");t.classList.add("smart-arrow-down","arrowbtn");let l=n.editor.dataSource&&n.editor.dataSource.length;n.editor.collaborator&&(l=r.users&&r.users.length),l||t.classList.add("smart-visibility-hidden");const i=document.createElement("div");i.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),c.classList.add("smart-flex-auto"),c.classList.remove("smart-flex-wrap"),e.length>2&&r.layout.rowHeight>45&&(c.classList.add("smart-flex-wrap"),c.style.maxWidth=n.computedWidth-10+"px"),r.rightToLeft&&(c.style.direction="rtl"),i.appendChild(c),"input"!==n.editor.template&&i.appendChild(t),s=i,t.onpointerdown=e=>{if(!r._mobile){if(r.editing.enabled){const t=e.target.previousElementSibling,l=t.getAttribute("data-field"),i=t.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l)}e.stopPropagation(),e.preventDefault()}}}else if(n.cellsWrap||n.allowEdit){const t=document.createElement("div");t.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),c.classList.add("smart-flex-auto"),c.classList.remove("smart-flex-wrap"),e.length>2&&r.layout.rowHeight>45&&(c.classList.add("smart-flex-wrap"),c.style.maxWidth=n.computedWidth-10+"px"),r.rightToLeft&&(c.style.direction="rtl"),t.appendChild(c),s=t}else c.classList.add("smart-flex-auto"),s=c;a.setAttribute("template",a.cell.template),s.setAttribute("value",t);break}case"dropDownList":case"dropdownlist":case"list":{const e=document.createElement("div");if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(i.firstElementChild.getAttribute("value")===t)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}if("card"===r.view?e.textContent=t:e.innerHTML='<span class="smart-truncate">'+t+"</span>",n.allowEdit&&r.editing.enabled&&"card"!==r.view){const t=document.createElement("span");t.classList.add("smart-arrow-down","arrowbtn");const l=document.createElement("div");l.classList.add("smart-multi-combo-input-container","tokens","smart-flex","smart-flex-auto"),e.classList.add("smart-flex-auto","smart-multi-combo-input"),l.appendChild(e),l.appendChild(t),l.classList.add(a.cell.template.toLowerCase()),s=l,t.onpointerdown=e=>{if(!r._mobile){if(r.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=e.target.closest("smart-grid-row"),i=t.getAttribute("data-field"),n=l.getAttribute("data-id");if(r.beginEdit(n,i),a.cell.column.editor&&a.cell.column.editor.instance){const e=a.cell.column.editor,t=e.instance.element;!e.autoOpen&&t.open?t.open():!e.autoOpen&&t.firstElementChild&&t.firstElementChild.open&&setTimeout((()=>{t.firstElementChild.open()}),250)}}e.stopPropagation(),e.preventDefault()}}}else s=e;a.setAttribute("template",a.cell.template.toLowerCase()),s.setAttribute("value",t);break}case"password":i.innerHTML=t?'<span class="smart-truncate">'+t.replace(/./g,"*")+"</span>":"",a.setAttribute("template",a.cell.template);break;case"richText":if(i.innerHTML=t?'<div class="textwrap" style="height: 100%; padding-left: 5px;">'+r._unescapeString(t)+"</div>":"",r.layout.autoWrap&&a.cell.row.height>40&&1===a.cell.colSpan&&"string"===n.dataType){null==t&&(t="");if(14*t.length*.52>n.computedWidth){const e=parseInt(a.cell.row.height/20);i.firstElementChild.style["-webkit-line-clamp"]=e}}a.setAttribute("template",a.cell.template);break;case"color":i.innerHTML=`<span style="left: calc(50% - 12px); top: calc(50% - 12px); position: absolute; border-radius: 50%; width: 24px; height: 24px; display: block; background:${t};"></span>`,a.setAttribute("template",a.cell.template);break;case"autoNumber":s=document.createElement("span"),s.innerHTML=1+a.cell.row.visibleIndex,a.setAttribute("template",a.cell.template);break;case"createdDate":case"createdTime":{const e=a.cell.getFormattedValue(a.cell.row.createdDate,"d"),t=a.cell.getFormattedValue(a.cell.row.createdDate,"t");if(i.firstElementChild&&i.firstElementChild.hasAttribute("created-date")){const l=e+" "+t;l!==i.firstElementChild.textContent&&(i.firstElementChild.textContent=l)}else i.innerHTML='<span created-date class="align-left smart-truncate">'+e+" "+t+"</span>";a.cell._setStyle(i),a.setAttribute("template",a.cell.template);break}case"updatedDate":case"updatedTime":if(a.cell.row.updatedDate){const e=a.cell.getFormattedValue(a.cell.row.updatedDate,"d"),t=a.cell.getFormattedValue(a.cell.row.updatedDate,"t");if(i.firstElementChild&&i.firstElementChild.hasAttribute("updated-date")){const l=e+" "+t;l!==i.firstElementChild.textContent&&(i.firstElementChild.textContent=l)}else i.innerHTML='<span updated-date class="align-left smart-truncate">'+a.cell.getFormattedValue(a.cell.row.updatedDate,"d")+" "+a.cell.getFormattedValue(a.cell.row.updatedDate,"t")+"</span>"}else i.innerHTML="";a.cell._setStyle(i),a.setAttribute("template",a.cell.template);break;case"progress":{const e=t?parseInt(100*t)+"%":"0%";if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(e===i.firstElementChild.getAttribute("value"))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}const l="white",r=["#D50000","#F4511E","#F6BF26","#33B679"];let n=r[0];n=t<.25?r[0]:t<.5?r[1]:t<.75?r[2]:r[3],i.innerHTML='<div value="'+e+'" style="padding-left: 5px; padding-right: 5px; display: grid; grid-template-columns: 1fr auto"><div style="height: 100%; display: flex; align-items: center; width: '+e+';"><div title="'+e+'" style="width: 100%; height: 4px; background: '+n+"; color: "+l+';" class="smart-truncate smart-token"></div></div><span>'+e+"</span></div>",a.setAttribute("template",a.cell.template);break}case"rating":{const e=a.cell.column.editor.max?a.cell.column.editor.max:5,l=t?parseInt(t):0;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(l===parseInt(i.firstElementChild.getAttribute("value")))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template);i.firstElementChild.setAttribute("value",l);for(let t=0;t<e;t++){const e=i.firstElementChild.children[t];let a="";l>0&&l>t&&(a="value"),a?e.classList.add("value"):e.classList.remove("value")}return void a.setAttribute("template",a.cell.template)}const n=t=>{let l="";for(let i=0;i<e;i++){let e="";t>0&&t>i&&(e="value"),l+=`<div rating-value title="${i+1}" value="${i+1}" class="smart-grid-icon show smart-icon-star ${e}"></div>`}return l};i.innerHTML=`<div value="${l}" class="rating">${n(l)}</div>`;const s=e=>{if(!r._mobile&&e.hasAttribute("rating-value")){const t=e.getAttribute("value"),l=e.closest("smart-grid-cell"),i=e.closest("smart-grid-row");if(l&&i){const e=l.querySelector(".rating"),s=i.getAttribute("data-id"),o=l.getAttribute("data-field"),d=r.rowById[s],c=r.getCellValue(s,o),m=l.cell;let u=null;r.storeHistory&&(u=r._stringifyRow(d)),c===t?(i.row.data[o]=0,e.innerHTML=n(0),e.setAttribute("value",0)):(i.row.data[o]=parseInt(t),e.innerHTML=n(parseInt(t)),e.setAttribute("value",t));const p=i.row.data[o];r._setCellUndoRedo(m,c,p),r.onCellUpdate&&r.onCellUpdate([m],[c],[p],(function(e){r.onCellUpdated&&r.onCellUpdated([m.row.index],[m.row],[m.column],[m.row.data],[c],[p],a),r._onCellUpdated&&r._onCellUpdated(m.row.index,m.row,m.column,m.row.data,c,p)}),a);const g=e=>{if(e!==c&&(d.updatedDate=new Date,d.updatedBy=a.currentUser,r.storeHistory)){const t=r._stringifyRow(d);t[m.column.dataField]=e,r._updateRowHistory(d,u,t)}};if(r.onCellUpdate&&r.onRowHistory){const e=r.onRowHistory;r.onRowHistory=null,g(p),setTimeout((()=>{r.onRowHistory=e}),100)}else g(p);const h=l.querySelector(".rating"),f=parseInt(t)-1;h.children[f].classList.add("down"),setTimeout((()=>{h.children[f].classList.remove("down")}),1e3)}}},o=(e,t=!0)=>{if(e&&[...e.querySelectorAll(".smart-icon-star")].forEach((e=>{e.classList.remove("hover")})),e.hasAttribute("value")){const l=[...e.parentElement.children],i=l.indexOf(e);l.forEach(((e,l)=>{e.classList.remove("hover"),l<=i&&t&&e.classList.add("hover")}))}};r.handleRatingClick||(r._handleRatingMove=o,r._handleRatingClick=s),i.firstElementChild.onpointerdown=e=>{s(e.target)},i.firstElementChild.onpointermove=e=>{o(e.target)},i.firstElementChild.onpointerleave=e=>{o(e.target)},a.setAttribute("template",a.cell.template);break}case"duration":{const e=t;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(e===i.firstElementChild.getAttribute("value"))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}if(t){const e=864e5;let l="MMM dd",n="MMM dd";if("string"==typeof t[0]&&(Array.isArray(t)?(t[0]=new Date(t[0]),t[1]=new Date(t[1])):((t=t.split(","))[0]=new Date(t[0]),t[1]=new Date(t[1]))),Array.isArray(t)){t[0]&&"string"==typeof t[0]&&(t[0]=new Date(t[0])),t[1]&&"string"==typeof t[1]&&(t[1]=new Date(t[1])),t[1]&&t[1].getMonth()===t[0].getMonth()&&(n="dd"),t[0].getFullYear()!==(new Date).getFullYear()&&(l+=", yyyy","dd"===n?(l="MMM dd",n+=", yyyy"):n=l);let s=!1;0===t[0].getHours()&&0===t[0].getHours()||(l+=" hh:mm","dd"===n?n=l:n+=" hh:mm",s=!0);let o=null;o=Math.round(t[1].getTime()-t[0].getTime())/e;const d=o?parseInt(Math.abs(o).toFixed(0)):0;if(d>0){const e=a.cell.getFormattedValue(t[0],l)+" - "+a.cell.getFormattedValue(t[1],n);let s="";s=r.localize("days",{value:d}),i.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${e}</span><span style="font-size: 11px;" class="smart-quiet">${s}</span></div>`}else{let e="";if(s){const r=t[1]-t[0],n=Math.floor(r%864e5/36e5);let s=Math.round(r%864e5%36e5/6e4);s<10&&(s+="0"+s),e=n+":"+s;const o=a.cell.getFormattedValue(t[0],l)+" - "+a.cell.getFormattedValue(t[1],"hh:mm");i.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${o}</span><span style="font-size: 11px;" class="smart-quiet">${e}</span></div>`}else{const r=a.cell.getFormattedValue(t[0],l);i.innerHTML=`<div style="display: grid; grid-template-columns: 5px auto 25px"><span></span><span>${r}</span><span style="font-size: 11px;" class="smart-quiet">${e}</span></div>`}}}}else i.innerHTML="";a.setAttribute("template",a.cell.template),i.firstElementChild&&i.firstElementChild.setAttribute("value",e);break}case"startDate":{const e=t;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(e===i.firstElementChild.getAttribute("value"))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}let l=t;if(n.cellsFormat?l=a.cell.getFormattedValue(t,n.cellsFormat):n.formatSettings&&n.formatSettings.Intl&&(l=a.cell.getFormattedValue(t,n.formatSettings.Intl)),t){const e=864e5,s="string"==typeof t?new Date(t):t;let o=r.columnByDataField.taskDueDate;n.editor.boundDataField&&(o=r.columnByDataField[n.editor.boundDataField]);const d=o?a.cell.row.data[o.dataField]:"";let c=null;d&&(c=Math.round(s.getTime()-d.getTime())/e);const m=c?parseInt(Math.abs(c).toFixed(0)):0;if(m>0){let e="";e=r.localize("days",{value:m}),i.innerHTML=`<div style="display: grid; grid-template-columns: 25px auto 25px"><span style="color: var(--smart-primary);" title="${e}" class="smart-icon-clock smart-grid-icon show"></span><span>${l}</span><span style="font-size: 11px;" class="smart-quiet">${e}</span></div>`}else i.innerHTML='<div style="padding-left: 6px;">'+l+"</div>"}else i.innerHTML="";a.setAttribute("template",a.cell.template),a.setAttribute("value",e);break}case"dueDate":{const e=t;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){if(e===i.firstElementChild.getAttribute("value"))return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}const l=["#D50000","#F4511E","#F6BF26","#33B679"],s=new Date;s.setHours(0,0,0);let o=t;n.cellsFormat?o=a.cell.getFormattedValue(t,n.cellsFormat):n.formatSettings&&n.formatSettings.Intl&&(o=a.cell.getFormattedValue(t,n.formatSettings.Intl));const d=(e,t)=>{const l=e<=8?e/8:1;return`<div title="${t}" class="smart-element smart-circular-progress-bar" style="background: inherit; padding-left:4px; position: relative; top: calc(50% - 12px); padding-top:4px; width: 20px; height: 20px;">\n <div class="smart-container">\n <svg style="background: var(--smart-background);"width="100%" height="100%" viewPort="0 0 100 100" viewBox="0 0 100 100" role="presentation" aria-hidden="true">\n <circle id="value" class="smart-value-path" r="50" cx="50" cy="50" transform="rotate(270 50 50)"></circle>\n <circle id="value" style="stroke-dashoffset: ${100*Math.PI-(1-l)*Math.PI*100}; stroke-width: 100%;" class="smart-value" r="50" cx="50" cy="50" transform="rotate(270 50 50)"></circle>\n </svg>\n </div>\n </div>\n `};if(t){const c=864e5,m="string"==typeof t?new Date(t):t,u=Math.round(m.getTime()-s.getTime())/c,p=parseInt(Math.abs(u).toFixed(0));let g=r.columnByDataField.taskStatus;n.editor.boundDataField&&(g=r.columnByDataField[n.editor.boundDataField]);const h=g?a.cell.row.data[g.dataField]:"";if("done"===h||"complete"===h||"completed"===h||"finished"===h){let e=r.localize("done");i.innerHTML=`<div style="display: grid; grid-template-columns: 25px auto"><div style="margin-left: 4px; align-self: center; border-radius: 50%; display: flex; align-content: center; background: ${l[3]}; width:16px; height: 16px;"><span title="${e}" style="align-content: center; font-size: 13px; color: white;" class="smart-grid-icon show smart-icon-check"></span></div>${o}</span></div>`}else{let t="";t=0===p?r.localize("today"):1===p?e<s?r.localize("yesterday"):r.localize("tomorrow"):e<s?r.localize("daysOverdue",{value:p}):r.localize("daysLeft",{value:p}),i.innerHTML=e>=s?`<div style="display: grid; grid-template-columns: 25px auto">${d(p,t)}<span>${o}</span></div>`:`<div style="display: grid; grid-template-columns: 25px auto"><span title="${t}" style="font-size: 16px; color: ${l[0]}" class="smart-grid-icon show smart-icon-attention-circled"></span>${o}</span></div>`}}else i.innerHTML="";a.setAttribute("template",a.cell.template),a.setAttribute("value",e);break}case"attachments":{if(""===t||"[]"===t){const e=`<div class="container"><div class="attachments"><div title="${r.localize("addFiles")}" class="smart-grid-icon show smart-icon-plus"></div></div></div>`;return i.innerHTML!==e&&(i.innerHTML=e,i.onpointerdown=e=>{if(e.target.classList.contains("smart-icon-plus")){if(r._mobile)return;if(r.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=t.getAttribute("data-field"),i=t.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l),t.querySelector(".smart-icon-plus").onpointerdown()}e.stopPropagation(),e.preventDefault()}}),a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){const e=i.firstElementChild.getAttribute("value");if(t&&t.indexOf(e)>=0)return a.cell._setStyle(i),a.setAttribute("template",a.cell.template),void(i.firstElementChild.evaluateScroll&&i.firstElementChild.evaluateScroll());if(e&&t&&Array.isArray(t)&&t[0]&&t[0].value&&e.length===t[0].value.length)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}const e=document.createElement("div"),l=document.createElement("div");e.classList.add("file-container"),l.classList.add("attachments");let n=t;if(r._findIsFile(n)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}if("string"==typeof n&&(n.indexOf("[{")>=0||n.indexOf("}]")>=0)){let e="";if(n)try{e=JSON.parse(n)}catch(e){console.log(e)}n=e}Array.isArray(n)&&n.forEach((t=>{const l=document.createElement("div");l.title=t.label,l.classList.add("item"),l.innerHTML="<div></div>",l.firstElementChild.classList.add("smart-grid-icon","show","attachment"),t.label.indexOf("png")>=0||t.label.indexOf("jpg")>=0||t.label.indexOf("jpeg")>=0||t.label.indexOf("gif")>=0?l.firstElementChild.classList.add("smart-icon-image"):t.label.indexOf(".pdf")>=0?l.firstElementChild.classList.add("smart-icon-pdf"):t.label.indexOf(".tsv")>=0||t.label.indexOf(".txt")>=0||t.label.indexOf(".csv")>=0?l.firstElementChild.classList.add("smart-icon-text"):t.label.indexOf(".xls")>=0||t.label.indexOf(".xlsx")>=0?l.firstElementChild.classList.add("smart-icon-excel"):t.label.indexOf(".ppt")>=0?l.firstElementChild.classList.add("smart-icon-powerpoint"):t.label.indexOf(".zip")>=0||t.label.indexOf(".rar")>=0||t.label.indexOf(".7z")>=0?l.firstElementChild.classList.add("smart-icon-archive"):t.label.indexOf(".doc")>=0||t.label.indexOf(".docx")>=0?l.firstElementChild.classList.add("smart-icon-word"):l.firstElementChild.classList.add("smart-icon-file"),e.appendChild(l)}));const o=document.createElement("div");o.classList.add("smart-arrow-left","arrowbtn","smart-hidden");const d=document.createElement("div");d.classList.add("smart-arrow-right","arrowbtn");const c=document.createElement("div");if(c.classList.add("smart-icon-plus","smart-grid-icon","show"),c.title=r.localize("addFiles"),"card"!==r.view&&l.appendChild(c),l.onpointerdown=t=>{if(t.target.classList.contains("attachment")){const e=JSON.parse(a.cell.value),i=[...l.children[1].children].indexOf(t.target.parentNode);if(e[i]){const t=document.createElement("a");if(e[i].value.indexOf(window.location.host)>=0)fetch(e[i].value).then((e=>e.blob())).then((l=>{const a=URL.createObjectURL(l);t.download=e[i].label,t.href=a,t.click()}));else{if(e[i].value.indexOf("base64")>=0){const l=r._getFileFromBase64(e[i].value);t.href=URL.createObjectURL(l)}else t.href=e[i].value;t.target="_blank",t.click()}}t.stopPropagation(),t.preventDefault()}else if("DIV"===t.target.nodeName&&t.target.classList.contains("arrowbtn")){let l=parseInt(e.style.marginLeft);isNaN(l)&&(l=0);const i=o===t.target,r=e.scrollWidth-a.offsetWidth+30;e.style.marginLeft=i?Math.min(0,l+25)+"px":Math.max(-r,l-25)+"px",l=parseInt(e.style.marginLeft),0===l?o.classList.add("smart-hidden"):o.classList.remove("smart-hidden"),t.stopPropagation(),t.preventDefault()}else if(t.target.classList.contains("smart-icon-plus")){if(r._mobile)return;if(r.editing.enabled){const e=t.target.closest("smart-grid-cell"),l=e.getAttribute("data-field"),i=e.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l),e.querySelector(".smart-icon-plus").onpointerdown()}t.stopPropagation(),t.preventDefault()}},e.children.length){if(l.appendChild(e),"card"!==r.view){const t=25*n.length;t-a.offsetWidth+30>30&&(l.appendChild(o),l.appendChild(d)),l.evaluateScroll=()=>{const i=t-a.offsetWidth+30;e.style.marginLeft="0px",o.classList.add("smart-hidden"),i<0?d.classList.add("smart-hidden"):d.classList.remove("smart-hidden"),i>30&&(l.appendChild(o),l.appendChild(d))}}s=l}else s=document.createElement("div");a.setAttribute("template",a.cell.template),t&&t[0]&&t[0].value?s.setAttribute("value",t[0].value):n&&n[0]&&n[0].label?s.setAttribute("value",n[0].label):s.setAttribute("value",t);break}case"images":{if(""===t||"[]"===t){const e=`<div class="file-container"><div class="images"><div title="${r.localize("addImages")}" class="smart-grid-icon show smart-icon-plus"></div></div></div>`;return e!==i.innerHTML&&(i.innerHTML=e,i.onpointerdown=e=>{if(e.target.classList.contains("smart-icon-plus")){if(r._mobile)return;if(r.editing.enabled){const t=e.target.closest("smart-grid-cell"),l=t.getAttribute("data-field"),i=t.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l),t.querySelector(".smart-icon-plus").onpointerdown()}e.stopPropagation(),e.preventDefault()}}),a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}if(!r._recycleFiles&&i.firstElementChild&&i.firstElementChild.hasAttribute("value")){const e=i.firstElementChild.getAttribute("value");if(t&&t.indexOf(e)>=0)return a.cell._setStyle(i),a.setAttribute("template",a.cell.template),void(i.firstElementChild.evaluateScroll&&i.firstElementChild.evaluateScroll());if(e&&t&&Array.isArray(t)&&t[0]&&t[0].value&&e.length===t[0].value.length)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}const e=document.createElement("div"),l=document.createElement("div");e.classList.add("file-container"),l.classList.add("images");let o=t;if(r._findIsFile(o)){let e="";if(o)try{e=JSON.parse(o)}catch(e){console.log(e)}o=e}if("string"==typeof o&&(o.indexOf("[{")>=0||o.indexOf("}]")>=0)){let e="";if(o)try{e=JSON.parse(o)}catch(e){console.log(e)}o=e}else"string"==typeof o&&o.indexOf("./")>=0&&(o=o.split(","),o=o.map((e=>({label:e,value:e}))));Array.isArray(o)&&o.forEach((t=>{const l=document.createElement("img");l.style.display="none";let i="";i=t.small?t.small:t.medium?t.medium:t.large?t.large:t.value,l.onload=()=>{l.style.display=""},i.indexOf("base64")>=0?l.src=i:(r._imagesCache||(r._imagesCache=[]),r.uploadSettings.url?r._imagesCache[i]?r._findUserFile(t)&&(l.src=i):(r._imagesCache[i]=!0,l.style.display="none",r._findUserFile(t)?(l.src=i,l.style.display=""):i&&i.startsWith("https://")&&(l.src=i)):l.src=i,l.onerror=()=>{l.style.display="none"}),l.title=t.label,l.setAttribute("data-url",t.large||t.value),e.appendChild(l)}));const d=document.createElement("div");d.classList.add("smart-arrow-left","arrowbtn","smart-hidden");const c=document.createElement("div");c.classList.add("smart-arrow-right","arrowbtn");const m=document.createElement("div");m.classList.add("smart-icon-plus","smart-grid-icon","show"),m.title=r.localize("addImages");const u=document.createElement("div");if(u.classList.add("smart-navigation"),"card"!==r.view&&r.editing.enabled&&n.allowEdit&&l.appendChild(m),l.onpointerdown=t=>{if("IMG"===t.target.nodeName)"card"!==r.view&&[...e.children].forEach((e=>e.classList.remove("smart-hidden"))),r._openImagePreviewDialog(t.target),t.stopPropagation(),t.preventDefault();else if("DIV"===t.target.nodeName&&t.target.classList.contains("smart-navigation-item")){[...u.children].forEach((e=>e.classList.remove("active"))),t.target.classList.add("active"),[...e.children].forEach((e=>e.classList.add("smart-hidden")));const l=[...u.children].indexOf(t.target);e.children[l].classList.remove("smart-hidden"),t.stopPropagation(),t.preventDefault()}else if("DIV"===t.target.nodeName&&t.target.classList.contains("arrowbtn")){let l=parseInt(e.style.marginLeft);isNaN(l)&&(l=0);const i=d===t.target,r=e.scrollWidth-a.offsetWidth+30;e.style.marginLeft=i?Math.min(0,l+25)+"px":Math.max(-r,l-25)+"px",l=parseInt(e.style.marginLeft),0===l?d.classList.add("smart-hidden"):d.classList.remove("smart-hidden"),t.stopPropagation(),t.preventDefault()}else if(t.target.classList.contains("smart-icon-plus")){if(r._mobile)return;if(r.editing.enabled){const e=t.target.closest("smart-grid-cell"),l=e.getAttribute("data-field"),i=e.closest("smart-grid-row").getAttribute("data-id");r.beginEdit(i,l),e.querySelector(".smart-icon-plus").onpointerdown()}t.stopPropagation(),t.preventDefault()}},e.children.length){if(l.appendChild(e),"card"===r.view&&l.appendChild(u),"card"!==r.view){const t=25*o.length;t-a.offsetWidth+30>30&&(l.appendChild(d),l.appendChild(c)),l.evaluateScroll=()=>{const i=t-a.offsetWidth+30;e.style.marginLeft="0px",d.classList.add("smart-hidden"),i<0?c.classList.add("smart-hidden"):c.classList.remove("smart-hidden"),i>30&&(l.appendChild(d),l.appendChild(c))}}else{for(let t=0;t<e.children.length;t++){const l=document.createElement("div");l.classList.add("smart-navigation-item"),0===t?l.classList.add("active"):e.children[t].classList.add("smart-hidden"),u.appendChild(l)}1===e.children.length&&u.classList.add("smart-visibility-hidden")}s=l}else s=document.createElement("div");a.setAttribute("template",a.cell.template),t&&t[0]&&t[0].value?s.setAttribute("value",t[0].value):o&&o[0]&&o[0].label?s.setAttribute("value",o[0].label):s.setAttribute("value",t);break}case"email":if(Smart.Validator){const e=i.firstElementChild?i.firstElementChild.getAttribute("value"):null;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")&&e===t)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template);s=document.createElement("span"),null===t||""===t?s.innerHTML="":Smart.Validator.email(t)?s.innerHTML=t:(s.className="url",s.innerHTML='<a href="mailto:'+t+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+t+"</a>",s.firstElementChild&&(s.firstElementChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault(),s.firstElementChild.click()}))}a.setAttribute("template",a.cell.template),s.setAttribute("value",t);break;case"url":if(Smart.Validator){const e=i.firstElementChild?i.firstElementChild.getAttribute("value"):null;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")&&e===t)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template);const l=e=>{null===t||""===t?e.classList.add("smart-hidden"):Smart.Validator.url(t)?(e.firstElementChild&&"A"===e.firstElementChild.nodeName?(e.firstElementChild.setAttribute("href",t),e.firstElementChild.textContent=t):e.innerHTML='<a href="https://'+t+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+t+"</a>",e.classList.remove("smart-hidden")):(e.firstElementChild&&"A"===e.firstElementChild.nodeName?(e.firstElementChild.setAttribute("href",t),e.firstElementChild.textContent=t):e.innerHTML='<a href="'+t+'" target="_blank" contenteditable="false" rel="noreferrer noopener">'+t+"</a>",e.classList.remove("smart-hidden"))};i.firstElementChild&&i.firstElementChild.classList.contains("url")?(s=i.firstElementChild,l(s)):(s=document.createElement("span"),s.className="url",l(s)),s.firstElementChild&&(s.firstElementChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault(),s.firstElementChild.click()})}a.setAttribute("template",a.cell.template),s.setAttribute("value",t);break;case"sparklines":{const l=t,s=""+n.computedWidth;if(i.firstElementChild&&i.firstElementChild.hasAttribute("value")){const e=i.firstElementChild.getAttribute("value"),t=i.firstElementChild.getAttribute("width");if(l===e&&t===s)return a.cell._setStyle(i),void a.setAttribute("template",a.cell.template)}const o=new e,d=a.cell.row.cellHeight||r.layout.rowMinHeight,c=n.templateSettings;if(d>=7){a._sparklinesRender&&cancelAnimationFrame(a._sparklinesRender);const e=o.render({width:s-10,height:Math.max(0,d-7),points:t,colors:c.colors,type:c.type,gap:c.gap,max:c.max,min:c.min,strokeWidth:c.strokeWidth,colorFunction:c.colorFunction,tooltipFormatFunction:c.tooltipFormatFunction});i.innerHTML=`<div width="${s}" value="${l}" style="padding-top: 5px; padding-left: 5px; padding-right: 5px;">${e}</div>`;const n=(e,t,l)=>{if(!1===c.tooltip)return;const i=e.pageX,a=e.pageY-10;if(!r._sparklineTooltip){const e=document.createElement("smart-button");e.classList.add("secondary"),e.style.boxShadow="var(--smart-elevation-4)",e.style.opacity=.9,e.style.transition="all cubic-bezier(0.6, 0.2, 0, 0.8) 0.2s",document.body.appendChild(e),e.style.position="absolute",e.style.zIndex=999,r._sparklineTooltip=e}const n=r._sparklineTooltip;n.innerHTML===t&&n.element===l||(n.style.top=a+25+"px",n.style.left=i-15+"px"),n.innerHTML=t,n.style.display=""};i.onmousemove=e=>{if("column"!==c.type&&"bar"!==c.type||i.querySelectorAll("rect").forEach((t=>{var l=t.getBoundingClientRect();t.removeAttribute("highlight"),l.left<=e.clientX&&e.clientX<=l.right&&l.top<=e.clientY&&e.clientY<=l.bottom&&(t.setAttribute("highlight",""),n(e,t.getAttribute("data-title"),t))})),"pie"===c.type){let t=!1;i.querySelectorAll("path").forEach((l=>{var i=l.getBoundingClientRect();l.removeAttribute("highlight"),t||i.left<=e.clientX&&e.clientX<=i.right&&i.top<=e.clientY&&e.clientY<=i.bottom&&(l.setAttribute("highlight",""),t=!0,n(e,l.getAttribute("data-title"),l))}))}"line"===c.type&&i.querySelectorAll("line").forEach((t=>{var l=t.getBoundingClientRect();t.removeAttribute("highlight"),l.left<=e.clientX&&e.clientX<=l.right&&(t.previousElementSibling&&(t.previousElementSibling.style.display="none"),t.nextElementSibling&&(t.nextElementSibling.style.display="none"),t.setAttribute("highlight",""),l.left+l.width/2>=e.clientX?t.previousElementSibling&&(t.previousElementSibling.style.display="",n(e,t.previousElementSibling.getAttribute("data-title"),t.previousElementSibling)):t.nextElementSibling&&(t.nextElementSibling.style.display="",n(e,t.nextElementSibling.getAttribute("data-title"),t.nextElementSibling)))}))},i.onmouseleave=()=>{r._sparklineTooltip&&(r._sparklineTooltip.style.display="none"),i.querySelectorAll("rect").forEach((e=>{e.removeAttribute("highlight")})),i.querySelectorAll("path").forEach((e=>{e.removeAttribute("highlight")})),i.querySelectorAll("line").forEach((e=>{e.removeAttribute("highlight")})),i.querySelectorAll("circle").forEach((e=>{e.style.display="none"}))}}a.setAttribute("template",a.cell.template);break}default:{let e=null;a.setAttribute("template","");const l=a.cell.row,s=i;let o=a.cell.getFormattedValue(t,n.cellsFormat);if(s.style.lineHeight="","function"==typeof a.cell.template){const e={row:l,column:n,cell:a.cell,oldValue:a.cell.oldValue,value:t,template:null};let i=s.querySelector(".smart-grid-cell-template");const d=l.id;r.isHScrolling&&(r._cachedTemplates||(r._cachedTemplates=[]),i&&0===i.innerHTML.length&&(i=null),!i&&r._cachedTemplates&&r._cachedTemplates[n.dataField+"_"+d]&&(0===r._cachedTemplates[n.dataField+"_"+d].innerHTML.length?delete r._cachedTemplates[n.dataField+"_"+d]:e.template=r._cachedTemplates[n.dataField+"_"+d])),i&&i.getAttribute("column")===n.dataField?e.template=i.firstElementChild:i=null,a.formattedValue!==o&&(i=null),a.cell.canNotify=!1,l.canNotify=!1;const c=Object.assign({},{background:a.cell.background,color:a.cell.color,fontSize:a.cell.fontSize,fontFamily:a.cell.fontFamily,fontWeight:a.cell.fontWeight,textDecoration:a.cell.textDecoration,fontStyle:a.cell.fontStyle});if(a.cell.template(e),!i&&e.template)if(e.template instanceof HTMLElement){const t=document.createElement("div");t.classList.add("smart-grid-cell-template"),t.setAttribute("column",n.dataField),s.innerHTML="",s.appendChild(t),t.appendChild(e.template)}else s.innerHTML='<div column="'+n.dataField+'" class="smart-grid-cell-template">'+e.template+"</div>";else i||null!==e.template||(s.innerHTML=t);if(r.isHScrolling&&!r._cachedTemplates[n.dataField+"_"+d]&&s.firstElementChild.firstElementChild){const e=s.firstElementChild.firstElementChild;e&&(r._cachedTemplates[n.dataField+"_"+d]=e)}s.style.background===c.background&&s.style.color===c.color&&s.style.fontSize===c.fontSize&&s.style.fontWeight===c.fontWeight&&s.style.fontStyle===c.fontStyle||(a.cell._styleChanged=!0,a.cell._setStyle(s)),a.cell.background!==c.background||a.cell.color!==c.color||a.cell.fontSize!==c.fontSize||a.cell.fontWeight!==c.fontWeight||a.cell.fontStyle!==c.fontStyle?(a.cell._styleChanged=!0,a.cell._setStyle(s)):a.cell._styleChanged&&a.cell._setStyle(s),void 0===a.cell.oldValue&&(a.cell.oldValue=t),a.formattedValue=o,a.cell.canNotify=!0,l.canNotify=!0}else if(Array.isArray(a.cell.template)){const e=document.createElement("div");if(s.firstElementChild&&s.firstElementChild.classList.contains("smart-grid-cell-template"))for(let e=0;e<a.cell.template.length;e++){const t=s.firstElementChild.children[e].firstElementChild,i=a.cell.template[e];if(i.length>1&&t){let e=l.data[i[1]];i[2]&&(e=i[2].length>2?i[2].replaceAll("{{value}}",e):a.cell.getFormattedValue(e,i[2])),t.src&&t.src!==e?(a._imageUpdateTimer&&clearTimeout(a._imageUpdateTimer),a._imageUpdateTimer=setTimeout((()=>{t.src=e}),50)):t.textContent!==e&&(t.textContent=e)}}else{e.classList.add("smart-grid-cell-template"),e.setAttribute("column",n.dataField),s.innerHTML="",s.appendChild(e);let t="";for(let e=0;e<a.cell.template.length;e++){const i=a.cell.template[e];if(i.length>1){let e=l.data[i[1]];i[2]&&(e=i[2].length>2?i[2].replaceAll("{{value}}",e):a.cell.getFormattedValue(e,i[2])),t+='<span class="smart-template-part">'+i[0].replaceAll("{{value}}",e)+"</span>"}}e.innerHTML=t}}else{if(""!==s.textContent&&(s.textContent=""),a.cell.template instanceof HTMLTemplateElement)e=a.cell.template;else if(a.cell.template instanceof HTMLElement){const e=a.cell.template.innerHTML.replace(/{{value}}/gi,t).replace(/{{id}}/gi,l.id);s.innerHTML!==e&&(s.innerHTML=e)}if(a.cell.template.startsWith&&a.cell.template.startsWith("#")&&(e=document.querySelector(a.cell.template)),e){let i=e.content.cloneNode(!0).firstElementChild;const d=t;if(t=(t=(t=t.toString()).replace(/'/gi,"\\'")).replace(/"/gi,'\\"'),i.querySelector("[smart-if]")){const e=i.querySelector("[smart-else]"),l=i.querySelectorAll("[smart-if]");let a=!1;for(let e=0;e<l.length;e++){const r=l[e],s=r.getAttribute("smart-if"),o=s.split(" "),c=o[1].trim();let m=o[2].trim();s.indexOf("'")>=0&&(m=s.substring(s.indexOf("'")+1),m=m.replaceAll("'",""));let u=t;switch("Today"===m&&(m=new Date),"date"===n.dataType&&(t=new Date(d).getTime(),m=new Date(m).getTime()),c){case">":t>parseFloat(m)&&(i=r,a=!0);break;case">=":t>=parseFloat(m)&&(i=r,a=!0);break;case"=":case"==":case"===":t===m&&(i=r,a=!0);break;case"<":t<parseFloat(m)&&(i=r,a=!0);break;case"<=":t<=parseFloat(m)&&(i=r,a=!0)}if(t=u,a)break}!a&&e&&(i=e)}let c=i.outerHTML.replace(/{{value}}/gi,t).replace(/{{id}}/gi,l.id);for(c.indexOf("{{value=")>=0&&(t?(c=c.substring(0,c.indexOf("{{value="))+t+c.substring(c.indexOf("}")),c=c.replace(/}/gi,""),c=c.replace(/{/gi,"")):(c=c.replace(/{{value=/gi,""),c=c.replace(/}}/gi,"")));c.indexOf("{{value::")>=0;){const e=c.indexOf("{{value::"),l=c.substring(e+9,c.indexOf("}}")),i=a.cell.getFormattedValue(t,l);c=c.replace(`{{value::${l}}}`,i)}if(n._treeColumn){const e=s.firstChild;if(e&&e.classList&&a.toggleButton&&n._treeColumn&&s.children[1]){const e=s.children[0],t=s.children[1].children[0],i=s.children[1].children[1].firstChild,a=s.children[1].children[2];let n="";if(r.grouping.enabled){let e=l.level-1;"multipleColumns"!==r.grouping.renderMode&&(n+='<div style="width: '+(1+e)*r.grouping.groupIndent+'px;"></div>')}else for(let e=0;e<l.level;e++)n+="<div class='smart-indent'></div>";l.checked?i.setAttribute("checked",""):!1===l.checked?i.removeAttribute("checked"):null===l.checked&&i.setAttribute("checked","indeterminate"),l.leaf?l.allowCheck?i.classList.remove("smart-visibility-hidden"):i.classList.add("smart-visibility-hidden"):l.allowCheck?i.classList.remove("smart-hidden"):i.classList.add("smart-hidden"),l.allowCheck?r.checkBoxes.visible?i.classList.remove("smart-hidden"):i.classList.add("smart-hidden"):r.checkBoxes.visible||i.classList.add("smart-hidden"),e.innerHTML=n,t.classList.add("smart-visibility-hidden"),l.leaf?t.classList.add("smart-visibility-hidden"):(t.classList.remove("smart-visibility-hidden"),l.expanded?t.setAttribute("toggled",""):t.removeAttribute("toggled","")),l.data.isEmpty&&t.classList.add("smart-visibility-hidden"),a.innerHTML=c,r.appearance.showTooltips?a.setAttribute("title",r._unescapeString(o)):a.hasAttribute("title")&&a.removeAttribute("title")}}else s.innerHTML!==c&&(s.innerHTML=c)}else if("string"==typeof a.cell.template){""===t&&(t=" ");let e=a.cell.template.replace(/{{value}}/gi,t).replace(/{{id}}/gi,l.id);if(e.indexOf("{{"))for(let t=0;t<r.dataSource.dataFields.length;t++){const i=r.dataSource.dataFields[t].name;if(e.indexOf("{{"+i+"}}")>=0&&(e=e.replace("{{"+i+"}}",l.data[i]),-1===e.indexOf("{{")))break}s.innerHTML!==e&&(s.innerHTML=e)}}if("auto"===a.cell.row.height||r.layout.allowCellsWrap||"auto"===r.layout.rowHeight){const e=s.querySelector(".smart-grid-cell-template");if(e){l._templatesHeight||(l._templatesHeight=[]);const t=(e,t)=>{if(e){const l=r.rowById[e.getAttribute("data-id")];l._templatesHeight[n.dataField]=t,l._isDirty=!0;const i=l.canNotify;l.canNotify=!1,l.autoSize(),l.canNotify=i,delete l._isDirty}};if(e.firstElementChild){if(!e.firstElementChild.resizeObserver){const l=new ResizeObserver((function(){const e=this.target.closest("smart-grid-row");this.target.offsetHeight&&(t(e,this.target.offsetHeight),r.$.scrollView.scrollTop=0)}));e.firstElementChild.resizeObserver=l,l.target=e.firstElementChild,l.observe(e.firstElementChild)}e.firstElementChild.onblur=e.firstElementChild.onchange=function(){const e=this.closest("smart-grid-row");t(e,this.offsetHeight)}}else{const l=this.closest("smart-grid-row");t(l,e.offsetHeight)}}}}}if(s)return i.innerHTML="",i.appendChild(s),a.cell._setStyle(i),s}async _render(){const e=this,t=e.cell.grid,l=e.cell.column,i=e.cell.row,a=i.data,r=i._isMeasureRow?null:e.cell.format||l.cellsFormat,n=t.grouping.enabled&&t.dataSource.groupBy.length>0;if(!(!1!==t._recycleValues||n||l.formatFunction||l._treeColumn||i.summaryRow||"grid"!==t.view)){if(e.cell.selected?(e.setAttribute("selected",""),e.setAttribute("aria-selected",!0)):(e.removeAttribute("selected"),e.removeAttribute("aria-selected")),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),e.cell.focused?(t.selection.allowCellSelection&&e.setAttribute("focus",""),i.element.setAttribute("focus",""),i.element.toggleDetailButton&&(i.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),i.element.star&&i.element.star.classList.add("smart-hidden")),e.cell.id||(e.id="gridcell_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),t.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focus"),i.element&&i.element.star&&t._selection.focusedCell&&t._selection.focusedCell.id!==i.id&&i.element.star.classList.remove("smart-hidden")),e.cell.background||e.cell.color){e.cell._styleChanged=!0;const t=e.firstChild;e.cell._setStyle(t)}return}if(t.grouping.enabled&&t.dataSource.groupBy.length>0&&"card"!==t.view){if(void 0!==i.label){let t=l.displayField?a[l.displayField]:a[l.dataField];return void 0===t&&a.data&&(t=l.displayField?a.data[l.displayField]:a.data[l.dataField]),e._renderGroupCell(t),void(i.summaryRow&&(e.cell.canNotify=!1,i.canNotify=!1,e.cell._styleChanged=!0,e.cell.background=null,e.cell.color=null,e.cell.fontFamily=null,e.cell.fontSize=null,e.cell.element&&e.cell.element.firstElementChild&&e.cell._setStyle(e.cell.element.firstElementChild),e.cell.canNotify=!0,i.canNotify=!0))}e.style.zIndex=""}else if(t.appearance.showTreeRowHeader&&t.rowHierarchy&&!1===i.leaf&&!l.autoGenerated){let t=a[i.groupDataField];return i.label=t,void e._renderGroupCell(t)}if(t.appearance.showTreeRowHeader&&e.removeAttribute("header"),t.grouping.enabled&&t.dataSource.groupBy.length>0&&e.toggleButton&&(e.toggleButton.classList.remove("smart-hidden"),e.toggleButton.classList.remove("smart-visibility-hidden"),e.toggleButton.style.marginLeft="",l._treeColumn&&t.grouping.enabled&&t.grouping.toggleButtonIndent>0&&(e.toggleButton.style.marginLeft=i.level*(t.grouping.toggleButtonIndent-t.grouping.groupIndent)+"px")),t.grouping.enabled&&t.dataSource.groupBy.length>0&&(e.removeAttribute("header"),e.removeAttribute("group")),!l.visible)return void(e.style.width="0px");t.appearance.showSortColumnBackground&&t.sorting.maintainSort&&!i.summaryRow?l.sorted?e.setAttribute("sort",""):e.removeAttribute("sort"):l.sorted&&e.hasAttribute("sort")&&e.removeAttribute("sort"),t.appearance.showFilterColumnBackground?l.filtered?e.setAttribute("filter",""):e.removeAttribute("filter"):l.filtered&&e.hasAttribute("filter")&&e.removeAttribute("filter"),t.dataSource.boundHierarchy&&e.hasAttribute("has-toggle-button")&&!l._treeColumn&&e.removeAttribute("has-toggle-button");let s=l.displayField?a[l.displayField]:a[l.dataField];if(null!==s||l.allowNull||("int"!==l.dataType&&"number"!==l.dataType||(s=0),"string"===l.dataType&&(s=""),"boolean"!==l.dataType&&"bool"!==l.dataType||(s=!1),"date"===l.dataType&&(s=new Date)),t.formulas&&e.cell.formula&&"string"==typeof e.cell.formula&&/=.+/.test(e.cell.formula)){const l=t._formulaParser;if(l){const t=l.parse(e.cell.formula.slice(1));s=isNaN(t)?"#VALUE!"===t?"":"#ERROR!"===t?"#ERROR!":t:t}}t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&t.dataSource.groupBy.length>0&&t.dataSource.groupBy.indexOf(l.dataField)>=0&&(s="",e.setAttribute("header","")),e.removeAttribute("highlight"),t.highlighted!==i.id||l.autoGenerated||e.setAttribute("highlight",""),t.editing.addNewRow.visible&&e.classList.remove("smart-add-new-row"),t.editing.enabled&&(e.cell.readonly||!l.allowEdit?e.classList.add("smart-readonly"):e.classList.remove("smart-readonly"));const o=t=>{if(t){if(t.startsWith("off_"))return e.classList.remove(t.substring(4)),!1;if(e.classList.add(t),e.hasAttribute("customCSS")){t=t+" "+e.getAttribute("customCSS")}return e.setAttribute("customCSS",t),!0}return e.setAttribute("highlight",""),!0};if((t.highlightedRows||t.highlightedCells)&&e.hasAttribute("customCSS")){const t=e.getAttribute("customCSS");e.removeAttribute("customCSS");const l=t.split(" ");for(let t=0;t<l.length;t++)e.classList.remove(l[t])}if(l.highlight&&!i.summaryRow&&(o(l._highlightCSS||""),e.setAttribute("highlight-data-field",l.dataField)),t.highlightedCells&&t.highlightedCells[i.id]&&!i.summaryRow&&void 0!==t.highlightedCells[i.id][l.dataField]){o(t.highlightedCells[i.id][l.dataField])}if(t.highlightedRows&&!i.summaryRow&&void 0!==t.highlightedRows[i.id]){o(t.highlightedRows[i.id])}if(t.editing.batch){if(t._cellsUpdatedValues){e.removeAttribute("update");const a=t._cellsUpdatedValues[i.id+"_"+l.dataField];void 0!==a&&(e.setAttribute("update",""),s=a)}t._rowsDeleted&&(t._rowsDeleted.indexOf(i.id)>=0?e.setAttribute("delete",""):e.removeAttribute("delete")),t._rowsAdded&&(t._rowsAdded.indexOf(i.id)>=0?e.setAttribute("add",""):e.removeAttribute("add"))}!t.onCellValue||l.rowHeaderColumn||l.selectionColumn||(e.cell._updating=!0,t.onCellValue(e.cell,t),e.cell._updating=!1,s=e.cell.value),void 0===s&&(s="");let d=s;r?d=e.cell.getFormattedValue(s,r):l.formatSettings&&l.formatSettings.Intl?d=e.cell.getFormattedValue(s,l.formatSettings.Intl):l.formatSettings&&l.formatSettings.formatString&&(d=e.cell.getFormattedValue(s,l.formatSettings.formatString));const c=e.firstChild;if(e.content=c,l._isDirty&&(c.innerHTML=""),c.hasAttribute("data-field")&&c.getAttribute("data-field")!==l.dataField&&(c.innerHTML="",i.filterRow&&(l._filterEditorInitialized=!1)),c.setAttribute("data-field",l.dataField),t.onCellRender||l.onCellRender)if(l._cellsCachedValues||(l._cellsCachedValues=[]),l._cellsCachedValues[i.index]){const t=l._cellsCachedValues[i.index];c.firstChild&&c.removeChild(c.firstChild),e.cell.template instanceof HTMLTemplateElement||"string"==typeof e.cell.template?c.appendChild(t):c.innerHTML=t.innerHTML}else{if(e.cell._updating=!0,t.onCellRender?t.onCellRender(e.cell,i.visibleIndex,l.dataField,i.data,e):l.onCellRender(e.cell,i.visibleIndex,l.dataField,i.data,e),e.cell._updating=!1,e.cell.template!==l.template){const t=document.createElement("div");return c.firstChild&&c.removeChild(c.firstChild),e.cell.template instanceof HTMLTemplateElement?(t.appendChild(e.cell.template.content.cloneNode(!0)),l._cellsCachedValues[i.index]=t):t.appendChild(e.cell.template),void c.appendChild(t)}e.cell.value!==s&&(d=e.cell.value)}if(l.autoGenerated||e.setAttribute("data-field",l.dataField),e.cell.focused?(t.selection.allowCellSelection&&e.setAttribute("focus",""),i.element.setAttribute("focus",""),i.element.toggleDetailButton&&(i.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),i.element.star&&i.element.star.classList.add("smart-hidden")),e.cell.id||(e.id="gridcell_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),t.setAttribute("aria-activedescendant",e.id)):e.removeAttribute("focus"),e.cell.selected?(e.setAttribute("selected",""),e.setAttribute("aria-selected",!0)):(e.removeAttribute("selected"),e.removeAttribute("aria-selected")),t.dragDrop&&t.dragDrop.row===i?e.classList.add("dragged"):e.classList.remove("dragged"),e._classNames)for(let t=0;t<e._classNames.length;t++)e.classList.remove(e._classNames[t]);if(i._classNames||e._rowClassNames){if(e._rowClassNames)for(let t=0;t<e._rowClassNames.length;t++)e.classList.remove(e._rowClassNames[t]);for(let t=0;t<i._classNames.length;t++)e.classList.add(i._classNames[t]);e._rowClassNames=i._classNames}if(t.onCellClass){const a=t.onCellClass(i.visibleIndex,l.dataField,s,i.data,i,t);if(e.___classNames)for(let t=0;t<e.___classNames.length;t++)e.classList.remove(e.___classNames[t]);if(a){const t=a.trim().split(" ");for(let l=0;l<t.length;l++)e.classList.add(t[l]);e.___classNames=t}}if(l.cellsClassName)if("string"==typeof l.cellsClassName){const t=l.cellsClassName.trim().split(" ");for(let l=0;l<t.length;l++)e.classList.add(t[l]);e._classNames=t}else{const t=l.cellsClassName(i.visibleIndex,l.dataField,s,i.data,i);if(e._classNames)for(let t=0;t<e._classNames.length;t++)e.classList.remove(e._classNames[t]);if(t){const l=t.trim().split(" ");for(let t=0;t<l.length;t++)e.classList.add(l[t]);e._classNames=l}}if(l.cellsCSSRules){if(e.__classNames)for(let t=0;t<e.__classNames.length;t++)e.classList.remove(e.__classNames[t]);const a=Object.keys(l.cellsCSSRules);let r=[];for(let n=0;n<a.length;n++){let o=a[n];const d={index:i.visibleIndex,value:s,dataField:l.dataField,row:i,api:t};l.cellsCSSRules[o](d)&&(e.classList.add(o),r.push(o))}e.__classNames=r}t.rowDetail.enabled&&i.showDetail&&!1===t.rowDetail.dialog.enabled&&(e.style.height=i.cellHeight+"px",e.style.lineHeight=i.cellHeight+"px"),i.expanded&&i.expandHeight>0&&(e.style.height=i.cellHeight+"px",e.style.lineHeight=i.cellHeight+"px");const m=e._getCellAlignment(i,l),u=""!==e.cell.template&&t.isInitialized&&!i._isMeasureRow;let p="";if(m.align&&(p+=m.align+" "),m.verticalAlign&&(p+=m.verticalAlign+" "),l.cellsWrap)p+="wrap ";else if(t.layout.autoWrap&&i.height>40&&1===e.cell.colSpan&&"string"===l.dataType){if(14*(d||"").length*.52>l.computedWidth){p+="textwrap ";const e=parseInt(i.height/20);c.style["-webkit-line-clamp"]=e}}if(p+="smart-label",e.style.width!==l.computedWidth+"px"){const i=t._isLastVisibleColumn(l);l.autoGenerated||i?e.style.width=l.computedWidth+"px":e.style.width=l.computedWidth-t._columnGap+"px"}l===t._firstVisibleColumn?e.classList.add("smart-grid-column-border-collapse"):e.classList.remove("smart-grid-column-border-collapse"),t.appearance.showColumnGroupCellLines||l.parent&&!l.element.hasAttribute("column-group-first-child")&&e.classList.add("smart-grid-column-border-collapse"),t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&t.dataSource.groupBy.length>0&&t.dataSource.groupBy.indexOf(l.dataField)>=0&&e.classList.add("smart-grid-column-border-collapse"),t._columnGap>0&&t.appearance.showColumnLines&&e.classList.add("smart-grid-column-border"),t._rowGap>0&&e.classList.add("smart-grid-row-border"),t.appearance.showColumnLines?e.classList.remove("smart-grid-vertical-border-collapse"):e.classList.add("smart-grid-vertical-border-collapse"),t.appearance.showRowLines?e.classList.remove("smart-grid-horizontal-border-collapse"):e.classList.add("smart-grid-horizontal-border-collapse");let g=l.left;if(t.rightToLeft?e.style.right!==g+"px"&&(e.style.right=g+"px"):e.style.left!==g+"px"&&(e.style.left=g+"px"),e.classList.contains("smart-hidden")&&e.classList.remove("smart-hidden"),e.hasAttribute("template")&&e.removeAttribute("template"),e.hasAttribute("freeze")&&e.removeAttribute("freeze"),e.hasAttribute("detail")&&e.removeAttribute("detail"),e.hasAttribute("error")&&e.removeAttribute("error"),e.cell.error&&e.setAttribute("error",e.cell.error),i.filterRow?e.classList.add("smart-grid-filter-row-cell"):i.summaryRow?e.classList.add("smart-grid-summary-row-cell"):(l.freeze||i.freeze)&&(l.selectionColumn&&(e.setAttribute("checkbox",""),p+=" smart-input",l.grid.selection.checkBoxes.enabled&&l.grid.selection.checkBoxes.autoShow?e.setAttribute("auto-show",""):e.removeAttribute("auto-show")),(l.rowHeaderColumn||l.selectionColumn)&&(e.setAttribute("header",""),e.setAttribute("role","rowheader")),l.rowDetailColumn&&(e.setAttribute("header",""),e.setAttribute("detail",""),e.setAttribute("has-toggle-button",""),e.classList.add("smart-grid-column-border-collapse")),l.commandColumn&&e.setAttribute("command",""),t.appearance.showFrozenColumnBackground&&l.freeze&&e.setAttribute("freeze",""),t.appearance.showFrozenRowBackground&&i.freeze&&e.setAttribute("freeze","")),l.cellsRotationAngle){if(!e._rotateCellContent(c,l,s))return}else if(i.filterRow){if(!l.toggleColumn&&!l.rowHeaderColumn)return t.grouping.enabled&&t.dataSource&&t.dataSource.groupBy.length>0&&(l._filterEditorInitialized=!1),l._filterEditorInitialized||l.autoGenerated?void("boolean"===l.dataType||"bool"===l.dataType?e.setAttribute("template","checkBox"):e.removeAttribute("template")):(l._filterEditorInitialized=!0,void e._renderFilterCell(c));c.innerHTML=""}else if(i.summaryRow){if(l.toggleColumn||l.rowHeaderColumn)c.innerHTML="";else if(l.autoGenerated&&(c.innerHTML=""),t.dataSource.boundHierarchy&&e.hasAttribute("has-toggle-button")&&e.removeAttribute("has-toggle-button"),!l.autoGenerated){if(l.summary.length>0&&t._summaryItems){const i=t._summaryItems[l.dataField],a=[];for(let r in i){if("status"===r)continue;const n=l.cellsFormat;let s=i[r];n&&n.indexOf("p")>=0&&"count"===r?s=i[r]:n&&"date"!==l.dataType&&(s=e.cell.getFormattedValue(s,n)),a.push(t.localize(r,{value:s}))}let r=[],n="";if(i&&i.status&&l.editor){n+='<div style="margin-right: 5px; display: flex; border-radius: 8px; align-items: center;">';const e=l.editor.dataSource,a=i.status,s=t.rows.length,o=l.computedWidth;let d=0;if(e)for(let l=0;l<e.length;l++){const i=e[l];if(a[i.value]){const e=i.label?i.label:t.localize("blankSummary"),l=a[i.value].length,c=new Number(l/s*100).toFixed(2),m=e+" "+l+"/"+s+" "+c+"%",u=o*c/100/2;r.push(m);const p=["#D50000","#F6BF26","#33B679","#039BE5","#3F51B5","#8E24AA"];d>p.length-1&&(d=0);n+='<span class="summary-value-part" title="'+m+'" style="width: '+u+"px; font-size: 11px; padding: 5px; background:"+(i.color||p[d++])+'; color: white;"></span>'}}n+="</div>"}const s=a.join(", "),o=t.summaryRow.editing?'<span class="smart-arrow-down"></span>':"";let d=`<div title = "${s}" class="smart-truncate summary-value" > <span class="label">${s}</span>${o}</div> `;r.length&&(d=`<div title = "${s}" class="smart-truncate summary-value" > <span style="align-items: center; display: flex;" class="label">${n}${s}</span>${o}</div> `);if(t.columns[0].dataField===l.dataField&&a.length<3){const e=t._recyclingRows.length;d=`<div title = "${s}" class="smart-truncate summary-value" > ${`<span style = "justify-content: flex-start" class="smart-truncate summary-value" > ${1===e?t.localize("oneRow"):t.localize("rows",{value:e})}</span> `} <span class="label">${s}</span>${o}</div> `}c.innerHTML!==d&&(c.innerHTML=d)}else if(t.summaryRow.editing&&l.allowSummary){if(t.columns[0].dataField===l.dataField){const e=t._recyclingRows.length,l=`<div class="smart-truncate summary-value"><span style="justify-content: flex-start" class="smart-truncate summary-value">${1===e?t.localize("oneRow"):t.localize("rows",{value:e})}</span><span class="smart-summary-placeholder label">${t.localize("summary")}</span><span class="smart-arrow-down"></span></div>`;c.innerHTML!==l&&(c.innerHTML=l)}else{const e=`<div class="smart-truncate summary-value"><span class="smart-summary-placeholder label">${t.localize("summary")}</span><span class="smart-arrow-down"></span></div>`;c.innerHTML!==e&&(c.innerHTML=e)}}t.summaryRow.editing&&l.allowSummary&&(t._selection&&t._selection.focusedCell&&t._selection.focusedCell.dataField===l.dataField?c.firstElementChild.setAttribute("has-summary",""):c.firstElementChild.removeAttribute("has-summary"),c.onpointerdown=e=>{e.preventDefault(),e.stopPropagation(),c._clickTarget=e.target},c.onpointerup=l=>{!0!==t._mobile&&c._clickTarget!==l.target||(l.preventDefault(),l.stopPropagation(),t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.dataField===e.cell.column.dataField?t._summaryRowDialog.confirm():t._openSummaryRowDialog(e.cell,(()=>{})))})}}else if(t.rowDetail.enabled&&l.rowDetailColumn){let l="",a=t.appearance.showRowStatus?"smart-visibility-hidden":"";if(l=i.showDetail?'<button tabindex="-1" class="'+a+' smart-animate" toggled toggle-button></button>':'<button tabindex="-1" class="'+a+' smart-animate" toggle-button></button>',t.appearance.showRowStatus){l=i._style&&i._style.status?`<span class="row-status custom" style = "color: ${i._style.status};" ></span> `+l:'<span class="row-status"></span>'+l,c.innerHTML===l||i.element.star?(i.element.star.classList.remove("smart-hidden"),i.element.star.classList.remove("custom"),i._style&&i._style.status?(i.element.star.style.color=i._style.status,i.element.star.classList.add("custom")):i.element.star.style.color=""):c.innerHTML=l;const a=()=>{if(i.comments&&i.comments.length>0){const e=i.comments.length;i.element.star.classList.add("comments"),i.element.star.setAttribute("title",t.localize(i.starred?"starred":"notStarred",{elementType:"Grid"})+", "+e+" "+t.localize("comments"))}else i.comments&&0===i.comments.length&&i.element.star.classList.remove("comments")};i.element.star=e.querySelector("span"),i.element.star||(c.innerHTML=l,i.element.star=e.querySelector("span")),i.element.star.onpointerdown=e=>{i.canNotify=!1,i.starred=!i.starred,i.canNotify=!0,i.data.$&&(i.data.$.starred=i.starred),i.starred?i.element.star.classList.add("starred"):i.element.star.classList.remove("starred"),i.element.star.setAttribute("title",t.localize(i.starred?"starred":"notStarred",{elementType:"Grid"})),a(),e.stopPropagation(),e.preventDefault(),t.$.fireEvent("rowStarred",{id:i.id,originalEvent:e,row:i,value:i.starred})},i.element.star.setAttribute("title",t.localize(i.starred?"starred":"notStarred",{elementType:"Grid"})),i.starred?i.element.star.classList.add("starred"):i.element.star.classList.remove("starred"),a()}else c.innerHTML!==l&&(c.innerHTML=l);if(i.element.toggleDetailButton=e.querySelector("button"),i.element.toggleDetailButton.setAttribute("title",t.localize(i.showDetail?"collapseRow":"expandRow",{elementType:"Grid"})),(t.rowDetail.template||t.onRowDetailInit)&&i.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),i.comments&&i.comments.length>0){const e=i.comments.length;i.element.toggleDetailButton.classList.remove("smart-visibility-hidden"),t.appearance.showRowStatus?i.element.toggleDetailButton.querySelector(".comments-length")?i.element.toggleDetailButton.querySelector(".comments-length").innerHTML=e:i.element.toggleDetailButton.innerHTML+=`<div class="comments-length'>${e}</div>`:i.element.toggleDetailButton.innerHTML=`<div class="comments-length'>${e}</div>`,i.starred&&i.element.toggleDetailButton.classList.add("starred"),i.element.toggleDetailButton.classList.add("row-comments"),i.element.toggleDetailButton.setAttribute("title",t.localize(i.showDetail?"collapseRow":"expandRowComments",{value:e,elementType:"Grid"}))}else i.comments&&0===i.comments.length&&i.element.toggleDetailButton.classList.remove("row-comments");t.rowDetail.dialog.enabled&&i.element.toggleDetailButton.classList.add("row-detail")}else if(l.commandColumn)e._renderCommands();else if(t.appearance.showRowHeaderNumber&&l.rowHeaderColumn)if(i.addNewRow)c.textContent="";else{const l=l=>{if(e.cell.value)return e.cell.value;if("number"===t.appearance.autoGenerateRowLabelMode)return l.visibleIndex+1;{const e=l.visibleIndex%26,t=Math.floor(l.visibleIndex/26),i="A".charCodeAt(0),a=String.fromCharCode(i+e);let r="";for(let e=0;e<t;e++)r+="A";return r+a}};t._rowsAdded&&t._rowsAdded.indexOf(i.id)>=0?c.textContent="":c.textContent=l(i)}else if(u)if(e.removeAttribute("readonly"),t.appearance.displayLoadingIndicator&&!l.autoGenerated)c.innerHTML='<div class="smart-grid-cell-loading"></div>';else if(i._isMeasureRow)c.innerHTML=s;else switch(c.removeAttribute("title"),e.cell.template){case"checkBox":case"switchButton":case"radioButton":e._setTemplate(s,e.cell.template,c);break;case"tags":case"checklist":case"collaborator":case"updatedBy":case"createdBy":case"multiComboInput":e._setTemplate(s,e.cell.template,c);break;case"attachment":e._setTemplate(s,"attachments",c);break;case"image":e._setTemplate(s,"images",c);break;case"email":e._setTemplate(s,"email",c);break;case"url":e._setTemplate(s,"url",c);break;case"richText":e._setTemplate(s,"richText",c);break;default:e._setTemplate(s,e.cell.template,c)}else{const a=c.firstChild;if(a&&a.classList&&e.toggleButton&&l._treeColumn&&c.children[1]){const e=c.children[0],a=c.children[1].children[0],r=c.children[1].children[1].firstChild,n=c.children[1].children[2];let s="";if(l._treeColumn){if(t.grouping.enabled){let e=i.level-1;t.appearance.showRowHeaderNumber&&e--,t.rowDetail.enabled&&e--,e<-1?s="":"multipleColumns"!==t.grouping.renderMode&&(s+='<div style="width: '+(1+e)*t.grouping.groupIndent+'px;"></div>')}else for(let e=0;e<i.level;e++)s+="<div class='smart-indent'></div>";if(i.checked?r.setAttribute("checked",""):!1===i.checked?r.removeAttribute("checked"):null===i.checked&&r.setAttribute("checked","indeterminate"),i.leaf?i.allowCheck?r.classList.remove("smart-visibility-hidden"):r.classList.add("smart-visibility-hidden"):i.allowCheck?r.classList.remove("smart-hidden"):r.classList.add("smart-hidden"),!l.autoGenerated){const e=i["column_"+l.dataField];e&&e._setStyle(c)}}i.allowCheck?t.checkBoxes.visible?r.classList.remove("smart-hidden"):r.classList.add("smart-hidden"):t.checkBoxes.visible||r.classList.add("smart-hidden"),"card"===t.view&&(r.classList.add("smart-hidden"),a.classList.add("smart-hidden")),e.innerHTML=s,a.classList.add("smart-visibility-hidden"),i.leaf?a.classList.add("smart-visibility-hidden"):(a.classList.remove("smart-visibility-hidden"),i.expanded?a.setAttribute("toggled",""):a.removeAttribute("toggled","")),t.grouping.enabled&&a.classList.add("smart-hidden"),i.data.isEmpty&&a.classList.add("smart-visibility-hidden"),n.innerHTML=d,t.appearance.showTooltips?n.setAttribute("title",t._unescapeString(d)):n.hasAttribute("title")&&n.removeAttribute("title")}else{const a=i["column_"+l.dataField];if(e.getAttribute("rowspan")&&(e.removeAttribute("rowspan"),e.removeAttribute("aria-rowspan"),e.style.height=""),e.getAttribute("colspan")&&(e.removeAttribute("colspan"),e.removeAttribute("aria-colspan")),a){if(a.colSpan>1){const i=t.columns.indexOf(l);let r=0;for(let e=i;e<i+a.colSpan;e++){const l=t.columns[e];l&&l.visible&&(r+=l.computedWidth)}e.style.width=r+"px",e.setAttribute("colspan",""),e.setAttribute("aria-colspan",a.colSpan),a._styleChanged=!0}let r=a.rowSpan;if(a.rowSpan>1){const l=t.rows.indexOf(i);let r=0;i.element.setAttribute("rowspan","");for(let e=l;e<=l+a.rowSpan-1;e++){const l=t.rows[e];l&&l.visible&&l.filtered&&(r+=l.cellHeight)}e.style.height=r+"px",e.setAttribute("rowspan",""),e.setAttribute("aria-rowspan",a.rowSpan),a._styleChanged=!0}else if(l.rowSpan&&!i._isMeasureRow){const n="number"==typeof l.rowSpan?l.rowSpan:l.rowSpan(s,i.visibleIndex,i.data),o=i.visibleIndex;let d=!1;for(let e=0;e<t._cellRowSpan.length;e++){const l=t._cellRowSpan[e];if(o>l[0]&&o<l[1]){d=!0;break}}if(i._rowSpan=n,n&&!d){let s=0;t._cellRowSpan.push([o,o+n,l.dataField]),t._cellRowSpan.maxSpan||(t._cellRowSpan.maxSpan=1),t._cellRowSpan.maxSpan=Math.max(n,t._cellRowSpan.maxSpan),i.element.setAttribute("rowspan","");for(let e=o;e<=o+n-1;e++){const l=t.rows[e];l&&l.visible&&l.filtered&&(s+=l.cellHeight)}e.style.height=s+"px",e.setAttribute("rowspan",""),e.setAttribute("aria-rowspan",n),a._styleChanged=!0,r=n}}if(1===a.colSpan&&e.hasAttribute("colspan")&&(e.style.width="",e.removeAttribute("colspan"),e.removeAttribute("aria-colspan"),a._styleChanged=!0),e.hasAttribute("rowspan")&&1===r&&(e.style.height="",e.removeAttribute("rowspan"),e.removeAttribute("aria-rowspan"),a._styleChanged=!0),c.textContent===d||l.formatFunction||("string"==typeof d&&d.indexOf("&")>=0?"card"===t.view?c.innerHTML=d:t.isScrolling?requestAnimationFrame((()=>{c.innerHTML=d})):c.innerHTML=d:c.textContent=d),a.column.autoGenerated||a._setStyle(c),t.appearance.showTooltips?c.setAttribute("title",a.tooltip||t._unescapeString(d)):c.hasAttribute("title")&&c.removeAttribute("title"),t.appearance.showTooltipsOverflow&&(!t.appearance.showTooltips&&c.hasAttribute("title")&&c.removeAttribute("title"),d&&d.length)){14*(d||"").length*.52>l.computedWidth?c.setAttribute("title",a.tooltip||t._unescapeString(d)):!t.appearance.showTooltips&&c.hasAttribute("title")&&c.removeAttribute("title")}}else c.textContent=d}}if(c.className!==p&&(c.className=p),!t.appearance.displayLoadingIndicator||l.autoGenerated||t.dataSource.boundHierarchy?t.appearance.displayLoadingIndicator&&l.selectionColumn?e.removeAttribute("selected"):!l.autoGenerated&&c.firstChild&&c.firstChild.classList&&c.firstChild.classList.contains("smart-grid-cell-loading")&&(c.firstChild.classList.remove("smart-grid-cell-loading"),e.removeAttribute("selected")):(i.element.removeAttribute("focus"),e.removeAttribute("selected"),c.innerHTML='<div class="smart-grid-cell-loading"></div>'),l.formatFunction&&!i.data.isEmpty&&t.isInitialized&&!i.summaryRow){const t={row:i,column:l,cell:e.cell,oldValue:e.cell.oldValue,value:s,formattedValue:d,template:null};e.cell.canNotify=!1,i.canNotify=!1;const a=Object.assign({},{background:e.cell.background,color:e.cell.color,fontSize:e.cell.fontSize,fontFamily:e.cell.fontFamily,textDecoration:e.cell.textDecoration,fontWeight:e.cell.fontWeight,fontStyle:e.cell.fontStyle});await l.formatFunction(t),c.style.background===a.background&&c.style.color===a.color&&c.style.fontSize===a.fontSize&&c.style.fontFamily===a.fontFamily&&c.style.textDecoration===a.textDecoration&&c.style.fontWeight===a.fontWeight&&c.style.fontStyle===a.fontStyle||(e.cell._styleChanged=!0,e.cell._setStyle(c)),e.cell.background===a.background&&e.cell.color===a.color&&e.cell.fontSize===a.fontSize&&e.cell.fontWeight===a.fontWeight&&e.cell.textDecoration===a.textDecoration&&e.cell.fontFamily===a.fontFamily&&e.cell.fontStyle===a.fontStyle||(e.cell._styleChanged=!0,e.cell._setStyle(c));let r=!0;if(t.value!==s){if(e.toggleButton){c.children[1].children[2].innerHTML=t.value}else c.innerHTML=t.value;r=!1}if(null!==t.template){if(e.toggleButton){if(c.children[1]){const e=c.children[1].children[2];e.innerHTML!==t.template&&(e.innerHTML=t.template)}}else if(c.innerHTML!==t.template){const e=document.createElement("div");e.innerHTML=t.template,e.innerHTML!==c.innerHTML&&(c.innerHTML=t.template)}r=!1}r&&(l.cellsFormat?c.textContent=d:c.textContent=s),e.cell.canNotify=!0,i.canNotify=!0}if(!i.data.isEmpty&&t.isInitialized&&e._applyConditionalFormattingToCell(e.cell,t,c),t.grouping.enabled&&t.dataSource&&t.dataSource.groupBy.length>0&&l===t._firstVisibleColumn&&t.rowDetail.enabled&&t.rowDetail.visible&&c.querySelector("[toggle-button]")){const e=c.querySelector("[toggle-button]");e.classList.remove("smart-visibility-hidden"),e.classList.add("row-detail"),i.element.toggleDetailButton=e,i.element.toggleDetailButton.setAttribute("title",t.localize(i.showDetail?"collapseRow":"expandRow",{elementType:"Grid"})),e.onpointerdown=function(e){i.showDetail=!i.showDetail,e.stopPropagation(),e.preventDefault()}}}_autoWrap(){const e=this,t=e.firstChild,l=e.cell.grid;l.layout.allowCellsWrapShortcut&&e.hasAttribute("focus")&&e.hasAttribute("selected")&&(t.offsetWidth<t.scrollWidth?e._popupCellContent(t.innerHTML,e.cell):l._cellContentPopup&&l._cellContentPopup.remove())}_popupCellContent(e,t){const l=this,i=t.grid;let a=i._cellContentPopup;if(!i._cellContentPopup){a=document.createElement("div");const t=document.createElement("span"),l=document.createElement("div"),r=document.createElement("div");a.style.minHeight="0px",a.style.minWidth="0px",a.setAttribute("theme",i.theme),a.classList.add("smart-grid-cell-content-popup"),r.appendChild(l),r.classList.add("smart-grid-text-area-container"),l.innerHTML=e,l.classList.add("smart-grid-cell-content-popup-content"),t.classList.add("smart-hidden"),t.classList.add("close-button"),t.classList.add("smart-grid-icon"),t.classList.add("smart-icon-cancel-circled"),t.onclick=function(){i._cellContentPopup.parentNode.removeChild(i._cellContentPopup)},a.classList.add("smart-grid-text-area-dialog"),a.appendChild(r),a.appendChild(t),i._cellContentPopup=a}a.querySelector(".smart-grid-cell-content-popup-content").innerHTML=e;const r=i.offset(i.$.scrollView);a.style.top=i._offsetTop(l)-r.top+"px",a.style.left=i._offsetLeft(l)-r.left+"px",a.style.width=l.offsetWidth-4+"px",i.$.scrollView.appendChild(a)}_applyConditionalFormattingToCell(e,t,l){const i=this,a=e.column.dataField,r=e.row,n=e.row.index,s=r._style;if(t._conditionalFormatting&&t._conditionalFormatting[a]){const e=t._conditionalFormatting[a][n];i.cell.canNotify=!1,r.canNotify=!1,e?(i.cell._styleChanged=!0,i.cell.background=e.background,i.cell.color=e.color,i.cell.fontFamily=e.fontFamily,i.cell.fontSize=e.fontSize,i.cell._setStyle(l)):i.cell._styleChanged||(s&&s._changed?(i.cell._styleChanged=!0,i.cell.background=s.background,i.cell.color=s.color,i.cell.fontFamily=s.fontFamily,i.cell.fontSize=s.fontSize,i.cell._setStyle(l)):(i.cell._styleChanged=!0,i.cell.background=null,i.cell.color=null,i.cell.fontFamily=null,i.cell.fontSize=null,i.cell._setStyle(l))),i.cell.canNotify=!0,r.canNotify=!0}else t._conditionalFormattingChanged&&!i.cell._styleChanged&&(i.cell.canNotify=!1,r.canNotify=!1,s&&s._changed?(i.cell._styleChanged=!0,i.cell.background=s.background,i.cell.color=s.color,i.cell.fontFamily=s.fontFamily,i.cell.fontSize=s.fontSize,i.cell._setStyle(l)):(i.cell._styleChanged=!0,i.cell.background=null,i.cell.color=null,i.cell.fontFamily=null,i.cell.fontSize=null,i.cell._setStyle(l)),i.cell.canNotify=!0,r.canNotify=!0)}_rotateCellContent(e,t,l){const i=document.createElement("span");return e.innerHTML="",i.innerHTML=l,e.appendChild(i),i.className="rotate",i.style.transform="rotate("+t.cellsRotationAngle+"deg)",this.grid._recycleRotate(e,i,t.cellsAlign,t.cellsVerticalAlign,l)}_getCellAlignment(e,t){const l=e["column_"+t.dataField],i=l&&l.verticalAlign||t.cellsVerticalAlign;let a=l&&l.align||t.cellsAlign;const r={align:"",verticalAlign:""};if(!l)return{align:"align-left",verticalAlign:"align-middle"};switch(l.grid.rightToLeft&&("left"===a?a="right":"right"===a&&(a="left")),a){case"left":r.align="align-left";break;case"center":case"middle":r.align="align-center";break;case"right":r.align="align-right"}switch(i){case"top":r.verticalAlign="align-top";break;case"center":case"middle":r.verticalAlign="align-middle";break;case"bottom":r.verticalAlign="align-bottom"}return r}template(){return""}_detach(){this.element=null,this.cell=null}onDetached(){this._detach()}});class e{render(e){const t=this,l={svg:null,width:e.width||100,height:e.height||30,gap:e.gap||5,strokeWidth:e.strokeWidth||2,type:e.type||"column",colors:e.colors||["var(--smart-primary)"],points:e.points,labels:e.labels,colorFunction:e.colorFunction,tooltipFormatFunction:e.tooltipFormatFunction,min:e.min,max:e.max};switch(l.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),l.svg.setAttribute("width",l.width),l.svg.setAttribute("height",l.height),function(e){Array.isArray(e.colors)||(e.colors=t.colors.split(",")),e.points&&(e.points=e.points.split(",").map((e=>parseInt(e,10))))}(l),l.type){case"column":return t.column(l);case"bar":return t.bar(l);case"line":return t.line(l);case"pie":return t.pie(l);case"stacked":return t.stacked(l)}}column(e){const t=e.gap/e.points.length+e.width/e.points.length-e.gap,l=e.max||Math.max(...e.points),i=e.min||Math.min(...e.points),a=e.height/(Math.abs(i)+Math.abs(l)),r=Math.abs(i)*a;return e.points.forEach(((n,s)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","rect"),d=Math.abs(n)*a;o.setAttribute("x",s*t+s*e.gap),o.setAttribute("point",n);let c=n>=0?"var(--smart-primary)":"var(--smart-error)";if(l>0&&i<0?n>=0?o.setAttribute("y",e.height-r-1-d):o.setAttribute("y",e.height-r-1):l>=0&&i>=0?o.setAttribute("y",e.height-d):i<=0&&l<=0&&o.setAttribute("y",d),o.setAttribute("width",t),o.setAttribute("height",d),e.colorFunction){const t=e.colorFunction(n);t&&(c=t)}o.setAttribute("fill",c);const m=e.tooltipFormatFunction?e.tooltipFormatFunction(n):n;o.setAttribute("data-title",m),e.svg.appendChild(o)})),e.svg.outerHTML}bar(e){const t=e.height-5,l=Math.max(5,e.gap/e.points.length+t/e.points.length-e.gap),i=e.max||Math.max(...e.points),a=e.min||Math.min(...e.points);let r=e.width/(Math.abs(a)+Math.abs(i));const n=Math.abs(a)*r;return e.points.forEach(((t,s)=>{const o=document.createElementNS("http://www.w3.org/2000/svg","rect"),d=Math.abs(t)*r;o.setAttribute("y",s*l+s*e.gap),o.setAttribute("point",t);let c=t>=0?"var(--smart-primary)":"var(--smart-error)";if(i>0&&a<0?t>=0?o.setAttribute("x",n):o.setAttribute("x",n-d):(i>=0&&a>=0||a<=0&&i<=0)&&o.setAttribute("x",0),o.setAttribute("width",d),o.setAttribute("height",l),e.colorFunction){const l=e.colorFunction(t);l&&(c=l)}o.setAttribute("fill",c);const m=e.tooltipFormatFunction?e.tooltipFormatFunction(t):t;o.setAttribute("data-title",m),e.svg.appendChild(o)})),e.svg.outerHTML}line(e){const t=e.width/(e.points.length-1),l=e.max||Math.max(...e.points),i=e.min||Math.min(...e.points),a=e.height/(Math.abs(i)+Math.abs(l)),r=Math.abs(i)*a;let n="var(--smart-primary)",s=[],o=[];e.svg.setAttribute("overflow","visible");for(let l=0;l<e.points.length;l++){const i=e.points[l],n=l*t,d=e.height-r-i*a;o.push({x:n,y:d,point:i}),2===o.length&&(s.push(o),o=[]),s.length>0&&0===o.length&&o.push(s[s.length-1][1])}for(let t=0;t<s.length;t++){const l=s[t];if(e.colorFunction){const t=e.colorFunction(l[0].point);t&&(n=t)}if(0===t){const t=document.createElementNS("http://www.w3.org/2000/svg","circle");e.svg.appendChild(t),t.setAttribute("cx",l[0].x),t.setAttribute("cy",l[0].y),t.setAttribute("r",3),t.setAttribute("fill",n);const i=e.tooltipFormatFunction?e.tooltipFormatFunction(l[0].point):l[0].point;t.setAttribute("data-title",i),t.style.display="none"}const i=document.createElementNS("http://www.w3.org/2000/svg","line");e.svg.appendChild(i),i.setAttribute("x1",l[0].x),i.setAttribute("y1",l[0].y),i.setAttribute("x2",l[1].x),i.setAttribute("y2",l[1].y);const a=document.createElementNS("http://www.w3.org/2000/svg","circle");e.svg.appendChild(a),a.setAttribute("cx",l[1].x),a.setAttribute("cy",l[1].y),a.setAttribute("r",3),a.setAttribute("fill",n);const r=e.tooltipFormatFunction?e.tooltipFormatFunction(l[1].point):l[1].point;a.setAttribute("data-title",r),a.style.display="none",i.setAttribute("fill","none"),i.setAttribute("stroke-width",e.strokeWidth),i.setAttribute("stroke",n)}return e.svg.outerHTML}pie(e){const t=Math.min(e.width,e.height)/2,l=e.width/2,i=e.height/2,a=e.points.reduce(((e,t)=>e+Math.abs(t)),0);let r=0;return e.points.forEach((n=>{let s=e.color;if(e.colorFunction){const t=e.colorFunction(n);t&&(s=t)}const o=Math.abs(n)/a*2*Math.PI,d=r+o,c=l+t*Math.cos(r),m=i+t*Math.sin(r),u=l+t*Math.cos(d),p=i+t*Math.sin(d),g=document.createElementNS("http://www.w3.org/2000/svg","path"),h=o>Math.PI?1:0,f=`M ${l},${i} L ${c},${m} A ${t},${t} 0 ${h} 1 ${u},${p} Z`;g.setAttribute("d",f),g.setAttribute("fill",s);const b=e.tooltipFormatFunction?e.tooltipFormatFunction(n):`${(n/a*100).toFixed(2)}%`;g.setAttribute("data-title",b),e.svg.appendChild(g),r=d})),e.svg.outerHTML}stacked(e){let t=e.points.reduce(((e,t)=>e+t),0),l=(e.points.length-1)*e.gap,i=e.width-l,a=0;return e.points.forEach(((l,r)=>{const n=e.colors[r%e.colors.length],s=l/t*i,o=document.createElementNS("http://www.w3.org/2000/svg","rect");o.setAttribute("x",a),o.setAttribute("y",0),o.setAttribute("width",s),o.setAttribute("height",e.height),o.setAttribute("fill",n);const d=document.createElementNS("http://www.w3.org/2000/svg","title");d.textContent=l,o.appendChild(d),e.svg.appendChild(o),a+=s+e.gap})),e.svg.outerHTML}}})();
|