smart-webcomponents-react 14.2.39 → 14.2.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.esm.js +2 -2
- package/accordion/accordion.umd.js +2 -2
- package/alertwindow/alertwindow.esm.js +1 -1
- package/alertwindow/alertwindow.umd.js +1 -1
- package/array/array.esm.js +1 -1
- package/array/array.umd.js +1 -1
- package/barcode/barcode.esm.js +1 -1
- package/barcode/barcode.umd.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.umd.js +1 -1
- package/button/button.esm.js +4 -4
- package/button/button.umd.js +4 -4
- package/buttongroup/buttongroup.esm.js +1 -1
- package/buttongroup/buttongroup.umd.js +1 -1
- package/calendar/calendar.esm.js +1 -1
- package/calendar/calendar.umd.js +1 -1
- package/card/card.esm.js +1 -1
- package/card/card.umd.js +1 -1
- package/cardview/cardview.esm.js +1 -1
- package/cardview/cardview.umd.js +1 -1
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.umd.js +1 -1
- package/chart/chart.esm.js +1 -1
- package/chart/chart.umd.js +1 -1
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.umd.js +1 -1
- package/checkinput/checkinput.esm.js +1 -1
- package/checkinput/checkinput.umd.js +1 -1
- package/chip/chip.esm.js +1 -1
- package/chip/chip.umd.js +1 -1
- package/colorinput/colorinput.esm.js +1 -1
- package/colorinput/colorinput.umd.js +1 -1
- package/colorpanel/colorpanel.esm.js +1 -1
- package/colorpanel/colorpanel.umd.js +1 -1
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.umd.js +1 -1
- package/columnpanel/columnpanel.esm.js +1 -1
- package/columnpanel/columnpanel.umd.js +1 -1
- package/combobox/combobox.esm.js +3 -3
- package/combobox/combobox.umd.js +3 -3
- package/countryinput/countryinput.esm.js +1 -1
- package/countryinput/countryinput.umd.js +1 -1
- package/customizationdialog/customizationdialog.esm.js +1 -1
- package/customizationdialog/customizationdialog.umd.js +1 -1
- package/dateinput/dateinput.esm.js +1 -1
- package/dateinput/dateinput.umd.js +1 -1
- package/daterangeinput/daterangeinput.esm.js +1 -1
- package/daterangeinput/daterangeinput.umd.js +1 -1
- package/datetimepicker/datetimepicker.esm.js +1 -1
- package/datetimepicker/datetimepicker.umd.js +1 -1
- package/dialogwindow/dialogwindow.esm.js +1 -1
- package/dialogwindow/dialogwindow.umd.js +1 -1
- package/dockinglayout/dockinglayout.esm.js +1 -1
- package/dockinglayout/dockinglayout.umd.js +1 -1
- package/dropdownbutton/dropdownbutton.esm.js +1 -1
- package/dropdownbutton/dropdownbutton.umd.js +1 -1
- package/dropdownlist/dropdownlist.esm.js +3 -3
- package/dropdownlist/dropdownlist.umd.js +3 -3
- package/editor/editor.esm.js +1 -1
- package/editor/editor.umd.js +1 -1
- package/element/element.esm.js +1 -1
- package/element/element.umd.js +1 -1
- package/fileupload/fileupload.esm.js +1 -1
- package/fileupload/fileupload.umd.js +1 -1
- package/filterbuilder/filterbuilder.esm.js +1 -1
- package/filterbuilder/filterbuilder.umd.js +1 -1
- package/filterpanel/filterpanel.esm.js +1 -1
- package/filterpanel/filterpanel.umd.js +1 -1
- package/form/form.esm.js +3 -3
- package/form/form.umd.js +3 -3
- package/ganttchart/ganttchart.esm.js +1 -1
- package/ganttchart/ganttchart.umd.js +1 -1
- package/gauge/gauge.esm.js +1 -1
- package/gauge/gauge.umd.js +1 -1
- package/grid/grid.esm.js +1 -1
- package/grid/grid.umd.js +1 -1
- package/grouppanel/grouppanel.esm.js +1 -1
- package/grouppanel/grouppanel.umd.js +1 -1
- package/index.d.ts +12 -0
- package/input/input.esm.js +1 -1
- package/input/input.umd.js +1 -1
- package/kanban/kanban.esm.js +1 -1
- package/kanban/kanban.umd.js +1 -1
- package/layout/layout.esm.js +5 -5
- package/layout/layout.umd.js +5 -5
- package/led/led.esm.js +1 -1
- package/led/led.umd.js +1 -1
- package/listbox/listbox.esm.js +3 -3
- package/listbox/listbox.umd.js +3 -3
- package/listmenu/listmenu.esm.js +3 -3
- package/listmenu/listmenu.umd.js +3 -3
- package/map/map.esm.js +1 -1
- package/map/map.umd.js +1 -1
- package/maskedtextbox/maskedtextbox.esm.js +1 -1
- package/maskedtextbox/maskedtextbox.umd.js +1 -1
- package/menu/menu.esm.js +3 -3
- package/menu/menu.umd.js +3 -3
- package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +1 -1
- package/multicolumnfilterpanel/multicolumnfilterpanel.umd.js +1 -1
- package/multicomboinput/multicomboinput.esm.js +1 -1
- package/multicomboinput/multicomboinput.umd.js +1 -1
- package/multiinput/multiinput.esm.js +1 -1
- package/multiinput/multiinput.umd.js +1 -1
- package/multilinetextbox/multilinetextbox.esm.js +3 -3
- package/multilinetextbox/multilinetextbox.umd.js +3 -3
- package/multilinewindow/multilinewindow.esm.js +1 -1
- package/multilinewindow/multilinewindow.umd.js +1 -1
- package/multisplitbutton/multisplitbutton.esm.js +3 -3
- package/multisplitbutton/multisplitbutton.umd.js +3 -3
- package/numberinput/numberinput.esm.js +1 -1
- package/numberinput/numberinput.umd.js +1 -1
- package/numerictextbox/numerictextbox.esm.js +1 -1
- package/numerictextbox/numerictextbox.umd.js +1 -1
- package/package.json +1 -1
- package/pager/pager.esm.js +1 -1
- package/pager/pager.umd.js +1 -1
- package/passwordinput/passwordinput.esm.js +1 -1
- package/passwordinput/passwordinput.umd.js +1 -1
- package/passwordtextbox/passwordtextbox.esm.js +1 -1
- package/passwordtextbox/passwordtextbox.umd.js +1 -1
- package/path/path.esm.js +1 -1
- package/path/path.umd.js +1 -1
- package/phoneinput/phoneinput.esm.js +1 -1
- package/phoneinput/phoneinput.umd.js +1 -1
- package/pivottable/pivottable.esm.js +1 -1
- package/pivottable/pivottable.umd.js +1 -1
- package/progressbar/progressbar.esm.js +2 -2
- package/progressbar/progressbar.umd.js +2 -2
- package/progresswindow/progresswindow.esm.js +1 -1
- package/progresswindow/progresswindow.umd.js +1 -1
- package/promptwindow/promptwindow.esm.js +1 -1
- package/promptwindow/promptwindow.umd.js +1 -1
- package/qrcode/qrcode.esm.js +1 -1
- package/qrcode/qrcode.umd.js +1 -1
- package/querybuilder/querybuilder.d.ts +7 -0
- package/querybuilder/querybuilder.esm.js +2 -2
- package/querybuilder/querybuilder.umd.js +2 -2
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.umd.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.umd.js +1 -1
- package/scheduler/scheduler.esm.js +1 -1
- package/scheduler/scheduler.umd.js +1 -1
- package/scrollbar/scrollbar.esm.js +1 -1
- package/scrollbar/scrollbar.umd.js +1 -1
- package/slider/slider.esm.js +1 -1
- package/slider/slider.umd.js +1 -1
- package/sortable/sortable.esm.js +1 -1
- package/sortable/sortable.umd.js +1 -1
- package/sortpanel/sortpanel.esm.js +1 -1
- package/sortpanel/sortpanel.umd.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 +2 -2
- package/source/modules/smart.card.js +1 -1
- package/source/modules/smart.cardview.js +2 -2
- package/source/modules/smart.carousel.js +1 -1
- package/source/modules/smart.chart.js +1 -1
- package/source/modules/smart.checkbox.js +1 -1
- package/source/modules/smart.checkinput.js +1 -1
- package/source/modules/smart.chip.js +1 -1
- package/source/modules/smart.colorinput.js +1 -1
- 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 +21 -21
- package/source/modules/smart.countryinput.js +1 -1
- package/source/modules/smart.dateinput.js +3 -3
- package/source/modules/smart.daterangeinput.js +3 -3
- package/source/modules/smart.datetimepicker.js +2 -2
- 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 +1 -1
- package/source/modules/smart.element.js +1 -1
- package/source/modules/smart.fileupload.js +1 -1
- package/source/modules/smart.form.js +1 -1
- package/source/modules/smart.formulaparser.js +1 -1
- package/source/modules/smart.ganttchart.js +3 -3
- package/source/modules/smart.gauge.js +1 -1
- package/source/modules/smart.grid.js +14 -14
- package/source/modules/smart.gridpanel.js +3 -3
- package/source/modules/smart.input.js +1 -1
- package/source/modules/smart.kanban.js +4 -4
- 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 +1 -1
- package/source/modules/smart.menu.js +1 -1
- package/source/modules/smart.multicomboinput.js +2 -2
- package/source/modules/smart.multiinput.js +1 -1
- package/source/modules/smart.multilinetextbox.js +1 -1
- package/source/modules/smart.multisplitbutton.js +1 -1
- package/source/modules/smart.numberinput.js +1 -1
- package/source/modules/smart.numerictextbox.js +1 -1
- package/source/modules/smart.pager.js +1 -1
- package/source/modules/smart.passwordinput.js +1 -1
- package/source/modules/smart.passwordtextbox.js +1 -1
- package/source/modules/smart.path.js +1 -1
- package/source/modules/smart.phoneinput.js +1 -1
- package/source/modules/smart.pivottable.js +3 -3
- 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.router.js +1 -1
- package/source/modules/smart.scheduler.js +3 -3
- 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 +2 -2
- package/source/modules/smart.tabs.js +1 -1
- package/source/modules/smart.tank.js +1 -1
- package/source/modules/smart.textarea.js +1 -1
- package/source/modules/smart.textbox.js +1 -1
- package/source/modules/smart.timeinput.js +1 -1
- 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 +1 -1
- package/source/modules/smart.validator.js +1 -1
- package/source/modules/smart.window.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 +1 -1
- package/source/smart.date.js +1 -1
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +2 -2
- 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 +1 -1
- package/source/smart.filterbuilder.js +2 -2
- 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 +1 -1
- package/source/smart.gauge.js +1 -1
- package/source/smart.grid.cell.js +2 -2
- package/source/smart.grid.chart.js +1 -1
- package/source/smart.grid.column.js +1 -1
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +2 -2
- package/source/smart.grid.edit.js +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 +2 -2
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +2 -2
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +1 -1
- package/source/smart.kanban.js +2 -2
- 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 +2 -2
- 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.router.js +1 -1
- package/source/smart.scheduler.js +2 -2
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.slider.js +1 -1
- package/source/smart.sortable.js +1 -1
- package/source/smart.splitter.js +1 -1
- package/source/smart.switchbutton.js +1 -1
- package/source/smart.table.js +2 -2
- package/source/smart.tabs.js +1 -1
- package/source/smart.tank.js +1 -1
- package/source/smart.textarea.js +1 -1
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.js +1 -1
- package/source/smart.timepicker.js +1 -1
- package/source/smart.toast.js +1 -1
- package/source/smart.tooltip.js +1 -1
- package/source/smart.tree.js +1 -1
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/source/styles/components/smart.base.css +1 -1
- package/source/styles/components/smart.grid.css +1 -1
- package/source/styles/default/scss/smart.grid.scss +47 -0
- package/source/styles/default/smart.grid.css +34 -0
- package/source/styles/default/smart.variables.css +8 -0
- package/source/styles/font/smart-icons.eot +0 -0
- package/source/styles/font/smart-icons.svg +296 -286
- package/source/styles/font/smart-icons.ttf +0 -0
- package/source/styles/font/smart-icons.woff +0 -0
- package/source/styles/font/smart-icons.woff2 +0 -0
- package/source/styles/smart.default.css +2 -2
- package/source/typescript/smart.elements.d.ts +12 -0
- package/source/typescript/smart.grid.d.ts +5 -0
- package/source/typescript/smart.querybuilder.d.ts +7 -0
- package/splitter/splitter.esm.js +3 -3
- package/splitter/splitter.umd.js +3 -3
- package/switchbutton/switchbutton.esm.js +1 -1
- package/switchbutton/switchbutton.umd.js +1 -1
- package/table/table.esm.js +1 -1
- package/table/table.umd.js +1 -1
- package/tabs/tabs.esm.js +3 -3
- package/tabs/tabs.umd.js +3 -3
- package/tabswindow/tabswindow.esm.js +1 -1
- package/tabswindow/tabswindow.umd.js +1 -1
- package/tank/tank.esm.js +1 -1
- package/tank/tank.umd.js +1 -1
- package/textarea/textarea.esm.js +1 -1
- package/textarea/textarea.umd.js +1 -1
- package/textbox/textbox.esm.js +3 -3
- package/textbox/textbox.umd.js +3 -3
- package/timeinput/timeinput.esm.js +1 -1
- package/timeinput/timeinput.umd.js +1 -1
- package/timepicker/timepicker.esm.js +1 -1
- package/timepicker/timepicker.umd.js +1 -1
- package/toast/toast.esm.js +1 -1
- package/toast/toast.umd.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.umd.js +1 -1
- package/tree/tree.esm.js +3 -3
- package/tree/tree.umd.js +3 -3
- package/validator/validator.esm.js +1 -1
- package/validator/validator.umd.js +1 -1
- package/waitwindow/waitwindow.esm.js +1 -1
- package/waitwindow/waitwindow.umd.js +1 -1
- package/window/window.esm.js +1 -1
- package/window/window.umd.js +1 -1
package/source/smart.layout.js
CHANGED
package/source/smart.led.js
CHANGED
package/source/smart.listbox.js
CHANGED
package/source/smart.listmenu.js
CHANGED
package/source/smart.map.js
CHANGED
package/source/smart.math.js
CHANGED
package/source/smart.menu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI v14.2.
|
|
2
|
+
/* Smart UI v14.2.83 (2022-09-09)
|
|
3
3
|
Copyright (c) 2011-2021 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
|
-
Smart("smart-multi-combo-input",class extends Smart.CheckInput{static get properties(){return{allowItemsAdd:{value:!1,type:"boolean"},allowItemsRemove:{value:!1,type:"boolean"},autoAddNewTags:{value:!0,type:"boolean"},colorItems:{value:!0,type:"boolean"},inputTagsMode:{allowedValues:["one","many"],value:"many",type:"string"},hideInputTagsCloseButton:{value:!1,type:"boolean"},messages:{value:{en:{newItem:"New item",tagLabelOne:"{{value}} item selected",tagLabel:"{{value}} items selected",selectAll:"Select All",unselectAll:"Unselect All"}},type:"object",extend:!0},pills:{value:!1,type:"boolean"},singleSelect:{value:!1,type:"boolean"},selectAll:{value:!1,type:"boolean"}}}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><div class="smart-action-button" role="presentation" id="actionButton"> <input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /></div><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}_downHandler(e){const t=this,l=e.originalEvent.target;t.readonly&&l&&l.classList&&!l.classList.contains("smart-drop-down-list-unselect-button")?t._dropDownButtonDownHandler(e):t._tokenCloseButtonClick!==l.closest(".smart-drop-down-list-unselect-button")&&(t._tokenCloseButtonClick=l.closest(".smart-drop-down-list-unselect-button"),t.readonly&&t._dropDownButtonDownHandler(e))}focus(){const e=this;e.readonly?HTMLElement.prototype.focus.apply(e,[]):e.$.input.focus()}_setFocusable(){const e=this;if(e.readonly){if(e.disabled||e.unfocusable)return void e.removeAttribute("tabindex");e.tabIndex=e.tabIndex>0?e.tabIndex:0,e.$.listen("keydown",e._keyDownHandler),e.$.listen("keyup",e._keyUpHandler)}}_documentUpHandler(e){const t=this,l=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(t._tokenCloseButtonClick&&t._tokenCloseButtonClick===l.closest(".smart-drop-down-list-unselect-button")){const e=l.closest(".smart-token"),[a,s]=[e.getAttribute("data-label"),e.getAttribute("value")],n=t._selectedItems.findIndex((e=>a===e.label&&s===e.value)),[o,i]=[t.value,t.$.input.dataValue];let r,d;return n>-1&&t._selectedItems.splice(n,1),t.set("value",d=t._selectedItems.map((e=>e.label)).join(t.separator)),t.$.input.dataValue=r=t._selectedItems.map((e=>e.value)).join(t.separator),t._updateValue(),t.$.actionButton.contains(e)&&t.$.actionButton.removeChild(e),t.close(),void(d===o&&r===i||(t.$.fireEvent("change",{value:r,label:d,oldValue:i,oldLabel:o}),t._updateTargetValue()))}if(!t.contains(l))if(t.$.dropDownContainer.contains(l.shadowParent||l)){if(t._isPointerDown){if(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),l.hasAttribute("add-new"))return;t.focus()}}else t.opened&&(t._preventLookup=!0),t._isPointerDown||t.close(),t._isPointerDown=!1}get selectedItems(){return this._selectedItems?this._selectedItems:[]}set selectedItems(e){this._selectedItems=e,this._updateValue()}_performSelect(e,t){const l=this;if(!e)return void l.close();const a=e.target?e.target.closest("li"):e;if(!a)return;l._selectedItems||(l._selectedItems=[]),a.classList.toggle("selected"),l.singleSelect&&(l._selectedItems=[],a.classList.add("selected"));const s=a.classList.contains("selected"),n={label:a.getAttribute("data-label"),value:a.getAttribute("value"),color:a.getAttribute("color"),image:a.getAttribute("image")},o=l.$.menu.children;for(let e=0;e<o.length;e++)l.singleSelect&&o[e]!==a&&o[e].classList.remove("selected"),o[e].classList.remove("active"),o[e].setAttribute("aria-selected",!1);if(s){if(l.dataSource&&l.dataSource[0]&&"string"==typeof l.dataSource[0])l._selectedItems.push(n);else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));l.dataSource&&e>=0?l._selectedItems.push(l.dataSource[e]):l._selectedItems.push(n)}if(e.noActiveState||(l._setActiveDescendant(a),a.classList.add("active")),l.dataSource)if(l.dataSource[0]&&"string"==typeof l.dataSource[0]){const e=l.dataSource.findIndex((e=>e===n.label));l.set("selectedIndex",e)}else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));l.set("selectedIndex",e)}}else{if(l.dataSource&&l.dataSource[0]&&"string"==typeof l.dataSource[0]){const e=l.dataSource.findIndex((e=>e===n.label));if(e>-1){const e=l._selectedItems.findIndex((e=>e===n.label));l._selectedItems.splice(e,1),l.set("selectedIndex",-1)}else l.set("selectedIndex",e)}else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));if(l.dataSource)if(e>-1){const e=l._selectedItems.findIndex((e=>e.label===n.label&&""+e.value===n.value));l._selectedItems.splice(e,1),l.set("selectedIndex",-1)}else l.set("selectedIndex",e)}a.classList.remove("active")}a.setAttribute("aria-selected",s),l._updateValue(t),l.singleSelect&&l.close()}_updateValue(e){const t=this;if(!t.isInitialized)return;let l=t._selectedItems,a=t.value,s=t.$.input.dataValue,[n,o]=[[],[]];l||(l=[]);for(let e=0;e<l.length;e++){const t=l[e];t?"string"==typeof t?(n.push(t),o.push(t)):(n.push(t.label),o.push(t.value)):(n.push(""),o.push(""))}if(t._createTags(),l&&l.length>0&&"string"==typeof l[0]?t.set("selectedValues",l):t.set("selectedValues",l.map((e=>e.value))),n=n.join(t.separator),t.set("value",n),t.$.input.dataValue=o=o.join(t.separator),t.$.input.value="",t.setAttribute("value",t.value),e||n===a&&o===s||(t.$.fireEvent("change",{value:o,label:n,oldValue:s,oldLabel:a}),t._updateTargetValue()),t.selectAll&&t._setSelectAllItemState(),!t.opened)return;const i=t.getBoundingClientRect(),r=window.scrollX,d=window.scrollY;t.$.dropDownContainer.style.left=-3+i.left+r+"px",t.$.dropDownContainer.style.top=i.bottom+d+1+"px"}_setSelection(){const e=this;super._setSelection(),e.singleSelect&&(e._selectedItems.length>0&&(e._selectedItems=[e._selectedItems[e._selectedItems.length-1]]),e.selectedValues.length>0&&(e.selectedValues=[e.selectedValues[e.selectedValues.length-1]])),this._createTags()}_createTags(){const e=this,t=e._selectedItems||[];let l,a=document.createDocumentFragment();for(;"SPAN"===e.$.actionButton.firstElementChild.nodeName;)e.$.actionButton.removeChild(e.$.actionButton.firstElementChild);if(0===t.length&&"one"===e.inputTagsMode&&e.readonly){const s="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"";l=document.createElement("span"),l.classList.add("smart-token"),l.innerHTML="<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>",a.appendChild(l)}for(let s=0;s<t.length;s++){const n=t[s];if("one"===e.inputTagsMode&&!l||"many"===e.inputTagsMode){let s="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"string"==typeof n?n:n.label;"many"===e.inputTagsMode&&void 0===s&&(s=""),l=document.createElement("span"),l.classList.add("smart-token");let o=null,i="";if(n.image&&"many"===e.inputTagsMode&&(o=document.createElement("span"),o.style.backgroundImage=`url('${n.image}')`,o.className="smart-drop-down-list-selection-image",i=o.outerHTML),l.innerHTML=i+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>",e.singleSelect||"one"===e.inputTagsMode||(l.innerHTML+='<span class=\'smart-drop-down-list-unselect-button\' role="button" aria-label="Unselect"></span>'),"many"===e.inputTagsMode){n.label?(l.setAttribute("data-label",n.label),l.setAttribute("value",n.value)):(l.setAttribute("data-label",""),l.setAttribute("value","")),l.setAttribute("separator",e.separator);const t=n.color;if(t&&e.colorItems){l.setAttribute("color",t),l.style.setProperty("--smart-primary",t);const e=new Smart.Color(t).getInvertedColor();l.style.setProperty("--smart-primary-color",e)}}if(""===s&&e.singleSelect)continue;a.appendChild(l)}}e.$.actionButton.insertBefore(a,e.$.input);const s=e.getBoundingClientRect(),n=window.scrollX,o=window.scrollY;e.$.scrollView.style.left=-3+s.left+n+"px",e.$.scrollView.style.top=s.bottom+o+1+"px"}_render(e){const t=this,l=(e,l)=>{let a=e,s=e,n=e,o=null;"object"==typeof e&&(a=e.label,s=void 0!==e.value?e.value:a,o=void 0!==e.color?e.color:"",n=void 0!==e.id?e.id:l);const i=document.createElement("li"),r=document.createElement("a");if(r.href="#",i.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),i.setAttribute("data-label",a),i.setAttribute("value",s),i.setAttribute("role","option"),i.setAttribute("aria-selected",!1),i.setAttribute("aria-label",a),void 0!==n&&(i.id=n),o&&t.colorItems){i.setAttribute("color",o),i.style.setProperty("--smart-primary",o);const e=new Smart.Color(o).getInvertedColor();i.style.setProperty("--smart-primary-color",e)}if(r.innerHTML=t.highlighter?t.highlighter(a):t._highlighter(a),r.setAttribute("aria-hidden",!0),e.icon&&(r.classList.add("icon"),r.classList.add(e.icon)),e.image){const t=document.createElement("span");t.style.backgroundImage=`url('${e.image}')`,t.className="smart-drop-down-list-selection-image",i.setAttribute("image",e.image),r.innerHTML=t.outerHTML+r.innerHTML}if(i.appendChild(r),t.allowItemsRemove){const l=document.createElement("span");l.classList.add("close-button"),r.appendChild(l),l.onpointerdown=l=>{l.preventDefault(),l.stopPropagation();const n=t.dataSource.findIndex((t=>t.value===e.value));if(n>=0){if(t.dataSource.splice(n,1),i.remove(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),"one"===t.inputTagsMode){const e=t._selectedItems.findIndex((e=>e.label===a&&e.value===s));e>=0&&t._selectedItems.splice(e,1),t._createTags()}t.$.fireEvent("remove",{index:n,label:e.label,value:e.value})}}}return(t.singleSelect&&""===e||t.singleSelect&&e&&""===e.label)&&(i.innerHTML=""),i},a=e.map((function(e,t){return l(e,t)}));t.$.menu.innerHTML="",t._selectedItems||(t._selectedItems=[]);let s=t._selectedItems.map((e=>"string"==typeof e?e:e.value));s.length||(s=(t.$.input.dataValue||t.$.input.value).split(t.separator).map((e=>e.trim())));let n=Array.from(t.$.actionButton.getElementsByClassName("smart-token")).map((e=>e.textContent.trim()));if(t.allowItemsAdd){const e=document.createElement("div"),a=document.createElement("smart-button"),s=document.createElement("input");e.classList.add("add-new-item"),a.setAttribute("add-new",""),s.setAttribute("add-new",""),s.placeholder=t.localize("newItem"),s.classList.add("smart-input"),a.onclick=()=>{if(!s.value)return;const e={label:s.value,value:s.value.trim().replace(/ /gi,"")};t.dataSource||(t.dataSource=[]),t.dataSource.push(e);const a=l(e,t.dataSource.length-1);t.$.menu.appendChild(a),t.$.scrollView.refresh&&t.$.scrollView.refresh(),s.value="","one"===t.inputTagsMode&&t._createTags(),t.$.fireEvent("add",{label:e.label,value:e.value,index:t.dataSource.length-1})},s.onkeydown=e=>{"Enter"===e.key&&a.click()},e.appendChild(s),e.appendChild(a),t.$.menu.appendChild(e)}for(let e=0;e<a.length;e++){const l=a[e],o=l.getAttribute("value"),i=l.getAttribute("data-label"),r=s.findIndex((e=>""+e==""+o));r>-1&&("one"===t.inputTagsMode||n[r]===i)&&(l.classList.add("selected"),l.setAttribute("aria-selected",!0),t._setActiveDescendant(l),t._selectedItems.findIndex((e=>"string"==typeof e?e===i:e.label===i&&e.value===o))<0&&t._selectedItems.findIndex((e=>"string"==typeof e?e===o:""+e.value==""+o))<0&&t._selectedItems.push({label:l.getAttribute("data-label"),value:l.getAttribute("value")})),t._setSelectAllItemState(),t.$.menu.appendChild(l)}}_next(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const a=e.$.menu.children;for(let e=0;e<a.length;e++)a[e].classList.remove("active","focused");e._setActiveDescendant();let s=l.nextElementSibling;s||(s=e.$.menu.firstElementChild),s.classList.add("active","focused"),e._setActiveDescendant(s),e.ensureVisible()}_prev(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const a=e.$.menu.children;for(let e=0;e<a.length;e++)a[e].classList.remove("active","focused");e._setActiveDescendant();let s=l.previousElementSibling;s||(s=e.$.menu.lastElementChild),s.classList.add("active","focused"),e._setActiveDescendant(s),e.ensureVisible()}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),e.shiftKey||e.altKey||e.ctrlKey?delete t._inputValue:(t._move(e),t._inputValue=t.$.input.value)}_keyUpHandler(e){const t=this;let l=t.$.input.value;if(t._selectedItems&&(l=t._selectedItems.map((e=>e.label)),t.$.input.value&&l.push(t.$.input.value),l=l.join(t.separator)),t.set("value",l),!e.shiftKey&&"F2"!==e.key){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 8:{if(t.readonly)break;if(t.opened&&t.close(),t._inputValue&&t._inputValue.length)break;if(!t._selectedItems){t.readonly||(t.$.input.dataValue=t.$.input.value);break}const e=t._selectedItems[t._selectedItems.length-1];if(!e)break;t.$.menu.querySelector(`li[data-label="${e.label}"][value="${e.value}"]`)&&(t._selectedItems.pop(),t._updateValue());break}case 9:case 13:if(!t.opened)return void(t.autoAddNewTags&&13===e.keyCode&&"many"===t.inputTagsMode&&t._autoCreateTags());t._performSelect(t.$.menu.querySelector(".active")),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault())}delete t._inputValue}}_blurHandler(){super._blurHandler(),this._autoCreateTags()}_autoCreateTags(){const e=this;if(!e.autoAddNewTags||"many"===!e.inputTagsMode)return;e.dataSource||(e.dataSource=[]);const t=e.$.input.value.trim();if(!e.dataSource.find((e=>"string"==typeof e?e===t:e.label===t))){e._tempItems||(e._tempItems=[]);let l=t.trim();if(t.indexOf(",")>=0){l=t.split(",");for(let t=0;t<l.length;t++){const a=l[t].trim();""!==a&&(e._tempItems.push(a),e._creteaTagsFromValue(a))}}else""!==l&&(e._tempItems.push(l),e._creteaTagsFromValue(l));e.query="",e._updateValue(!0)}}propertyChangedHandler(e,t,l){const a=this;if("disabled"===e&&a._setFocusable(),"value"===e){a.displayMember!==a.valueMember&&"string"!=typeof l?(a.value=l[a.displayMember],a.$.input.dataValue=l[a.valueMember]):a.$.input.dataValue="";const e=a.$.menu.children;for(let t=0;t<e.length;t++)e[t].classList.remove("selected"),e[t].setAttribute("aria-selected",!1);a._setActiveDescendant(a.$.menu.querySelector("active")),a._creteaTagsFromValue(l)}else if("separator"===e){const e=a.$.actionButton.children;for(let t=0;t<e.length;t++){const a=e[t];a.classList.contains("smart-token")&&a.setAttribute("separator",l)}}else if("inputTagsMode"===e)a._createTags();else if("theme"===e||"rightToLeft"===e)a.$.scrollView[e]=l,l?a.$.dropDownContainer.setAttribute(Smart.Utilities.Core.toDash(e),""):a.$.dropDownContainer.removeAttribute(Smart.Utilities.Core.toDash(e));else if("inverted"===e)l?a.$.dropDownContainer.setAttribute("inverted",""):a.$.dropDownContainer.removeAttribute("inverted");else if("selectAll"===e)a._handleSelectAllItem();else if("selectedIndex"===e){if(super.propertyChangedHandler(e,t,l),a._selectedItems=[],a.dataSource){const e=a.dataSource[l];e&&a._selectedItems.push(e),a._updateValue(!0)}}else if("selectedValues"===e){if(super.propertyChangedHandler(e,t,l),a.dataSource){a._selectedItems=[];const e=a.dataSource.filter((e=>{if("string"==typeof e){if(a.selectedValues.indexOf(e)>=0)return!0}else if(a.selectedValues.indexOf(e.value)>=0)return!0}));a._selectedItems=e,a._updateValue(!0)}}else super.propertyChangedHandler(e,t,l)}_createElement(){const e=this,t=document.createElement("ul"),l=document.createElement("smart-scroll-viewer"),a=document.createElement("div");if(l.rightToLeft=e.rightToLeft,l.theme=e.theme,l.horizontalScrollBarVisibility="hidden",l.classList.add("smart-multi-combo-input-scroll-viewer"),e.rightToLeft&&a.setAttribute("right-to-left",""),e.dataSource&&"string"==typeof e.dataSource&&(e.dataSource=e.$.deserialize(e.dataSource,"array")),a.setAttribute("theme",e.theme),a.classList.add("smart-multi-combo-input-drop-down-menu","smart-input-drop-down-menu","smart-check-input-drop-down-menu"),e.pills&&a.setAttribute("pills",""),e.singleSelect&&a.setAttribute("single-select",""),e.inverted?a.setAttribute("inverted",""):a.removeAttribute("inverted"),e.classList.add("smart-input"),a.appendChild(l),t.setAttribute("aria-multiselectable",!0),e.$.scrollView=l,e.$.menu=t,e.$.dropDownContainer=a,e.$.menu.onclick=function(t){t.stopPropagation(),t.preventDefault(),t.target&&t.target.hasAttribute("add-new")||(e._performSelect(t),e.focus())},e.classList.add("smart-input"),e.$.input.value="",e.selectedValues&&e.selectedValues.length>0){const t=e.dataSource.filter((t=>{if("string"==typeof t){if(e.selectedValues.indexOf(t)>=0)return!0}else if(e.selectedValues.indexOf(t.value)>=0)return!0}));e.selectedItems=t}else{const t=e.value;t&&e._creteaTagsFromValue(t)}e._handleSelectAllItem(),e._setFocusable()}_creteaTagsFromValue(e=""){const t=this;if(e){const e=t.value.split(",");for(t.$.input.value="",t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);for(let l=0,a=e.length;l<a;l+=1){const a=e[l].trim();if(a)if(t.dataSource){const e=t.dataSource.find((e=>{if("string"==typeof e){if(e===a)return e}else if(""+e.value===a)return e}));e&&e.label?e.color?t._selectedItems.push({color:e.color,label:e.label,value:e.value}):t._selectedItems.push({label:e.label,value:e.value}):t._selectedItems.push({label:a,value:a})}else t._selectedItems.push({label:a,value:a})}t._createTags()}else t.$.input.value="",t._selectedItems=[],t._createTags()}_handleSelectAllItem(){const e=this;if(e.selectAll){if(!e.$.selectAll){const t=document.createElement("ul"),l=document.createElement("li"),a=document.createElement("a");a.href="#",a.innerHTML=e.localize("selectAll"),a.setAttribute("aria-hidden",!0),l.id=e.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),l.setAttribute("role","option"),l.setAttribute("value",e.localize("selectAll")),l.setAttribute("aria-label",e.localize("selectAll")),l.classList.add("smart-select-all"),l.appendChild(a),l.onclick=function(t){t.stopPropagation(),t.preventDefault(),Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")))?e._selectAll():e._clearSelection(),e._setSelectAllItemState(),l.classList.contains("selected")&&l.classList.add("active"),e.focus()},t.appendChild(l),e.$.selectAll=t}e._setSelectAllItemState(),e.$.dropDownContainer.insertBefore(e.$.selectAll,e.$.scrollView)}else e.$.selectAll&&e.$.selectAll.remove()}_setSelectAllItemState(){const e=this;if(!e.$.selectAll)return;const t=e.$.selectAll.firstElementChild,l=t.firstElementChild,a=!Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")));t.removeAttribute("indeterminate"),t.classList.remove("selected","active"),l.innerHTML=e.localize("selectAll"),e._selectedItems&&e._selectedItems.length>0&&(a?(t.classList.add("selected"),l.innerHTML=e.localize("unselectAll")):t.setAttribute("indeterminate",""))}_selectAll(){const e=this,t=e._selectedItems.length,l=e.$.input.dataValue,a=e.value;e._clearSelection(!0);const s=e.$.menu.children;for(let t=0;t<s.length;t++)s[t].classList.contains("selected")||e._performSelect({target:s[t],noActiveState:!0},!0);t!==e._selectedItems.length&&(e.$.fireEvent("change",{value:e.$.input.dataValue,label:e.value,oldValue:l,oldLabel:a}),e._updateTargetValue())}_clearSelection(e){const t=this;if(!t._selectedItems.length)return;const l=t.$.input.dataValue,a=t.value;for(t.$.input.dataValue="",t.value=t.$.input.value,t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);const s=t.$.menu.children;for(let e=0;e<s.length;e++)s[e].classList.remove("selected"),s[e].classList.remove("active"),s[e].setAttribute("aria-selected",!1);t._setActiveDescendant(t.$.menu.querySelector("active")),e||(t.$.fireEvent("change",{value:"",label:"",oldValue:l,oldLabel:a}),t._updateTargetValue());const n=t.getBoundingClientRect(),o=window.scrollX,i=window.scrollY;t.$.dropDownContainer.style.left=-3+n.left+o+"px",t.$.dropDownContainer.style.top=n.bottom+i+1+"px"}_open(){const e=this,t=e.getBoundingClientRect(),l=window.scrollX,a=window.scrollY;let s=0,n=0;if(!this.opened){if(e.timer&&clearTimeout(e.timer),e.$.scrollView.classList.remove("smart-input-drop-down-menu"),e.$.dropDownContainer.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),document.body.appendChild(e.$.dropDownContainer),e.setAttribute("aria-owns",e.$.dropDownContainer.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.dropDownContainer.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();s=e.left,n=e.top}e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.dropDownContainer.style.left=-3+t.left+l-s+"px",e.$.dropDownContainer.style.top=t.bottom+a-n+1+"px",e.$.dropDownContainer.classList.remove("open"),e.$.dropDownContainer.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.dropDownContainer.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const l=parseFloat(t)/100;e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*l+"px")}else if("auto"!==t&&t)e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const l=e.$.menu.querySelectorAll("li");for(let t=0;t<l.length;t++)e._maxDropDownWidth=Math.max((l[t].firstElementChild||l[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>e.$.scrollView._scrollView.vScrollBar.refresh()))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),this.opened=!0,e.setAttribute("aria-expanded",!0)}}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.dropDownContainer.parentNode&&!e.opened&&(document.body.removeChild(e.$.dropDownContainer),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.dropDownContainer.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,e.setAttribute("aria-expanded",!1),e.focus(),e.$.fireEvent("close"),!0)}});
|
|
6
|
+
Smart("smart-multi-combo-input",class extends Smart.CheckInput{static get properties(){return{allowItemsAdd:{value:!1,type:"boolean"},allowItemsRemove:{value:!1,type:"boolean"},autoAddNewTags:{value:!0,type:"boolean"},colorItems:{value:!0,type:"boolean"},inputTagsMode:{allowedValues:["one","many"],value:"many",type:"string"},hideInputTagsCloseButton:{value:!1,type:"boolean"},messages:{value:{en:{newItem:"New item",tagLabelOne:"{{value}} item selected",tagLabel:"{{value}} items selected",selectAll:"Select All",unselectAll:"Unselect All"}},type:"object",extend:!0},pills:{value:!1,type:"boolean"},singleSelect:{value:!1,type:"boolean"},selectAll:{value:!1,type:"boolean"}}}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><div class="smart-action-button" role="presentation" id="actionButton"> <input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /></div><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}_downHandler(e){const t=this,l=e.originalEvent.target;t.readonly&&l&&l.classList&&!l.classList.contains("smart-drop-down-list-unselect-button")?t._dropDownButtonDownHandler(e):t._tokenCloseButtonClick!==l.closest(".smart-drop-down-list-unselect-button")&&(t._tokenCloseButtonClick=l.closest(".smart-drop-down-list-unselect-button"),t.readonly&&t._dropDownButtonDownHandler(e))}focus(){const e=this;e.readonly?HTMLElement.prototype.focus.apply(e,[]):e.$.input.focus()}_setFocusable(){const e=this;if(e.readonly){if(e.disabled||e.unfocusable)return void e.removeAttribute("tabindex");e.tabIndex=e.tabIndex>0?e.tabIndex:0,e.$.listen("keydown",e._keyDownHandler),e.$.listen("keyup",e._keyUpHandler)}}_documentUpHandler(e){const t=this,l=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(l!==t&&l!==t.$.dropDownButton&&l!==t.$.input&&l!==t.$.arrow){if(t._tokenCloseButtonClick&&t._tokenCloseButtonClick===l.closest(".smart-drop-down-list-unselect-button")){const e=l.closest(".smart-token"),[a,s]=[e.getAttribute("data-label"),e.getAttribute("value")],n=t._selectedItems.findIndex((e=>a===e.label&&s===e.value)),[o,i]=[t.value,t.$.input.dataValue];let r,d;return n>-1&&t._selectedItems.splice(n,1),t.set("value",d=t._selectedItems.map((e=>e.label)).join(t.separator)),t.$.input.dataValue=r=t._selectedItems.map((e=>e.value)).join(t.separator),t._updateValue(),t.$.actionButton.contains(e)&&t.$.actionButton.removeChild(e),t.close(),void(d===o&&r===i||(t.$.fireEvent("change",{value:r,label:d,oldValue:i,oldLabel:o}),t._updateTargetValue()))}if(!t.contains(l))if(t.$.dropDownContainer.contains(l.shadowParent||l)){if(t._isPointerDown){if(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),l.hasAttribute("add-new"))return;t.focus()}}else t.opened&&(t._preventLookup=!0),t._isPointerDown||t.close(),t._isPointerDown=!1}else t._isPointerDown=!1}get selectedItems(){return this._selectedItems?this._selectedItems:[]}set selectedItems(e){this._selectedItems=e,this._updateValue()}_performSelect(e,t){const l=this;if(!e)return void l.close();const a=e.target?e.target.closest("li"):e;if(!a)return;l._selectedItems||(l._selectedItems=[]),a.classList.toggle("selected"),l.singleSelect&&(l._selectedItems=[],a.classList.add("selected"));const s=a.classList.contains("selected"),n={label:a.getAttribute("data-label"),value:a.getAttribute("value"),color:a.getAttribute("color"),image:a.getAttribute("image")},o=l.$.menu.children;for(let e=0;e<o.length;e++)l.singleSelect&&o[e]!==a&&o[e].classList.remove("selected"),o[e].classList.remove("active"),o[e].setAttribute("aria-selected",!1);if(s){if(l.dataSource&&l.dataSource[0]&&"string"==typeof l.dataSource[0])l._selectedItems.push(n);else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));l.dataSource&&e>=0?l._selectedItems.push(l.dataSource[e]):l._selectedItems.push(n)}if(e.noActiveState||(l._setActiveDescendant(a),a.classList.add("active")),l.dataSource)if(l.dataSource[0]&&"string"==typeof l.dataSource[0]){const e=l.dataSource.findIndex((e=>e===n.label));l.set("selectedIndex",e)}else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));l.set("selectedIndex",e)}}else{if(l.dataSource&&l.dataSource[0]&&"string"==typeof l.dataSource[0]){const e=l.dataSource.findIndex((e=>e===n.label));if(e>-1){const e=l._selectedItems.findIndex((e=>e===n.label));l._selectedItems.splice(e,1),l.set("selectedIndex",-1)}else l.set("selectedIndex",e)}else{const e=l.dataSource.findIndex((e=>e.label===n.label&&""+e.value===n.value));if(l.dataSource)if(e>-1){const e=l._selectedItems.findIndex((e=>e.label===n.label&&""+e.value===n.value));l._selectedItems.splice(e,1),l.set("selectedIndex",-1)}else l.set("selectedIndex",e)}a.classList.remove("active")}a.setAttribute("aria-selected",s),l._updateValue(t),l.singleSelect&&l.close()}_updateValue(e){const t=this;if(!t.isInitialized)return;let l=t._selectedItems,a=t.value,s=t.$.input.dataValue,[n,o]=[[],[]];l||(l=[]);for(let e=0;e<l.length;e++){const t=l[e];t?"string"==typeof t?(n.push(t),o.push(t)):(n.push(t.label),o.push(t.value)):(n.push(""),o.push(""))}if(t._createTags(),l&&l.length>0&&"string"==typeof l[0]?t.set("selectedValues",l):t.set("selectedValues",l.map((e=>e.value))),n=n.join(t.separator),t.set("value",n),t.$.input.dataValue=o=o.join(t.separator),t.$.input.value="",t.setAttribute("value",t.value),e||n===a&&o===s||(t.$.fireEvent("change",{value:o,label:n,oldValue:s,oldLabel:a}),t._updateTargetValue()),t.selectAll&&t._setSelectAllItemState(),!t.opened)return;const i=t.getBoundingClientRect(),r=window.scrollX,d=window.scrollY;t.$.dropDownContainer.style.left=-3+i.left+r+"px",t.$.dropDownContainer.style.top=i.bottom+d+1+"px"}_setSelection(){const e=this;super._setSelection(),e.singleSelect&&(e._selectedItems.length>0&&(e._selectedItems=[e._selectedItems[e._selectedItems.length-1]]),e.selectedValues.length>0&&(e.selectedValues=[e.selectedValues[e.selectedValues.length-1]])),this._createTags()}_createTags(){const e=this,t=e._selectedItems||[];let l,a=document.createDocumentFragment();for(;"SPAN"===e.$.actionButton.firstElementChild.nodeName;)e.$.actionButton.removeChild(e.$.actionButton.firstElementChild);if(0===t.length&&"one"===e.inputTagsMode&&e.readonly){const s="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"";l=document.createElement("span"),l.classList.add("smart-token"),l.innerHTML="<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>",a.appendChild(l)}for(let s=0;s<t.length;s++){const n=t[s];if("one"===e.inputTagsMode&&!l||"many"===e.inputTagsMode){let s="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"string"==typeof n?n:n.label;"many"===e.inputTagsMode&&void 0===s&&(s=""),l=document.createElement("span"),l.classList.add("smart-token");let o=null,i="";if(n.image&&"many"===e.inputTagsMode&&(o=document.createElement("span"),o.style.backgroundImage=`url('${n.image}')`,o.className="smart-drop-down-list-selection-image",i=o.outerHTML),l.innerHTML=i+"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+s+"</span>",e.singleSelect||"one"===e.inputTagsMode||(l.innerHTML+='<span class=\'smart-drop-down-list-unselect-button\' role="button" aria-label="Unselect"></span>'),"many"===e.inputTagsMode){n.label?(l.setAttribute("data-label",n.label),l.setAttribute("value",n.value)):(l.setAttribute("data-label",""),l.setAttribute("value","")),l.setAttribute("separator",e.separator);const t=n.color;if(t&&e.colorItems){l.setAttribute("color",t),l.style.setProperty("--smart-primary",t);const e=new Smart.Color(t).getInvertedColor();l.style.setProperty("--smart-primary-color",e)}}if(""===s&&e.singleSelect)continue;a.appendChild(l)}}e.$.actionButton.insertBefore(a,e.$.input);const s=e.getBoundingClientRect(),n=window.scrollX,o=window.scrollY;e.$.scrollView.style.left=-3+s.left+n+"px",e.$.scrollView.style.top=s.bottom+o+1+"px"}_render(e){const t=this,l=(e,l)=>{let a=e,s=e,n=e,o=null;"object"==typeof e&&(a=e.label,s=void 0!==e.value?e.value:a,o=void 0!==e.color?e.color:"",n=void 0!==e.id?e.id:l);const i=document.createElement("li"),r=document.createElement("a");if(r.href="#",i.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),i.setAttribute("data-label",a),i.setAttribute("value",s),i.setAttribute("role","option"),i.setAttribute("aria-selected",!1),i.setAttribute("aria-label",a),void 0!==n&&(i.id=n),o&&t.colorItems){i.setAttribute("color",o),i.style.setProperty("--smart-primary",o);const e=new Smart.Color(o).getInvertedColor();i.style.setProperty("--smart-primary-color",e)}if(r.innerHTML=t.highlighter?t.highlighter(a):t._highlighter(a),r.setAttribute("aria-hidden",!0),e.icon&&(r.classList.add("icon"),r.classList.add(e.icon)),e.image){const t=document.createElement("span");t.style.backgroundImage=`url('${e.image}')`,t.className="smart-drop-down-list-selection-image",i.setAttribute("image",e.image),r.innerHTML=t.outerHTML+r.innerHTML}if(i.appendChild(r),t.allowItemsRemove){const l=document.createElement("span");l.classList.add("close-button"),r.appendChild(l),l.onpointerdown=l=>{l.preventDefault(),l.stopPropagation();const n=t.dataSource.findIndex((t=>t.value===e.value));if(n>=0){if(t.dataSource.splice(n,1),i.remove(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),"one"===t.inputTagsMode){const e=t._selectedItems.findIndex((e=>e.label===a&&e.value===s));e>=0&&t._selectedItems.splice(e,1),t._createTags()}t.$.fireEvent("remove",{index:n,label:e.label,value:e.value})}}}return(t.singleSelect&&""===e||t.singleSelect&&e&&""===e.label)&&(i.innerHTML=""),i},a=e.map((function(e,t){return l(e,t)}));t.$.menu.innerHTML="",t._selectedItems||(t._selectedItems=[]);let s=t._selectedItems.map((e=>"string"==typeof e?e:e.value));s.length||(s=(t.$.input.dataValue||t.$.input.value).split(t.separator).map((e=>e.trim())));let n=Array.from(t.$.actionButton.getElementsByClassName("smart-token")).map((e=>e.textContent.trim()));if(t.allowItemsAdd){const e=document.createElement("div"),a=document.createElement("smart-button"),s=document.createElement("input");e.classList.add("add-new-item"),a.setAttribute("add-new",""),s.setAttribute("add-new",""),s.placeholder=t.localize("newItem"),s.classList.add("smart-input"),a.onclick=()=>{if(!s.value)return;const e={label:s.value,value:s.value.trim().replace(/ /gi,"")};t.dataSource||(t.dataSource=[]),t.dataSource.push(e);const a=l(e,t.dataSource.length-1);t.$.menu.appendChild(a),t.$.scrollView.refresh&&t.$.scrollView.refresh(),s.value="","one"===t.inputTagsMode&&t._createTags(),t.$.fireEvent("add",{label:e.label,value:e.value,index:t.dataSource.length-1})},s.onkeydown=e=>{"Enter"===e.key&&a.click()},e.appendChild(s),e.appendChild(a),t.$.menu.appendChild(e)}for(let e=0;e<a.length;e++){const l=a[e],o=l.getAttribute("value"),i=l.getAttribute("data-label"),r=s.findIndex((e=>""+e==""+o));r>-1&&("one"===t.inputTagsMode||n[r]===i)&&(l.classList.add("selected"),l.setAttribute("aria-selected",!0),t._setActiveDescendant(l),t._selectedItems.findIndex((e=>"string"==typeof e?e===i:e.label===i&&e.value===o))<0&&t._selectedItems.findIndex((e=>"string"==typeof e?e===o:""+e.value==""+o))<0&&t._selectedItems.push({label:l.getAttribute("data-label"),value:l.getAttribute("value")})),t._setSelectAllItemState(),t.$.menu.appendChild(l)}}_next(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const a=e.$.menu.children;for(let e=0;e<a.length;e++)a[e].classList.remove("active","focused");e._setActiveDescendant();let s=l.nextElementSibling;s||(s=e.$.menu.firstElementChild),s.classList.add("active","focused"),e._setActiveDescendant(s),e.ensureVisible()}_prev(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const a=e.$.menu.children;for(let e=0;e<a.length;e++)a[e].classList.remove("active","focused");e._setActiveDescendant();let s=l.previousElementSibling;s||(s=e.$.menu.lastElementChild),s.classList.add("active","focused"),e._setActiveDescendant(s),e.ensureVisible()}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),e.shiftKey||e.altKey||e.ctrlKey?delete t._inputValue:(t._move(e),t._inputValue=t.$.input.value)}_keyUpHandler(e){const t=this;let l=t.$.input.value;if(t._selectedItems&&(l=t._selectedItems.map((e=>e.label)),t.$.input.value&&l.push(t.$.input.value),l=l.join(t.separator)),t.set("value",l),!e.shiftKey&&"F2"!==e.key){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 8:{if(t.readonly)break;if(t.opened&&t.close(),t._inputValue&&t._inputValue.length)break;if(!t._selectedItems){t.readonly||(t.$.input.dataValue=t.$.input.value);break}const e=t._selectedItems[t._selectedItems.length-1];if(!e)break;t.$.menu.querySelector(`li[data-label="${e.label}"][value="${e.value}"]`)&&(t._selectedItems.pop(),t._updateValue());break}case 9:case 13:if(!t.opened)return void(t.autoAddNewTags&&13===e.keyCode&&"many"===t.inputTagsMode&&t._autoCreateTags());t._performSelect(t.$.menu.querySelector(".active")),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault())}delete t._inputValue}}_blurHandler(){super._blurHandler(),this._autoCreateTags()}_autoCreateTags(){const e=this;if(!e.autoAddNewTags||"many"===!e.inputTagsMode)return;e.dataSource||(e.dataSource=[]);const t=e.$.input.value.trim();if(!e.dataSource.find((e=>"string"==typeof e?e===t:e.label===t))){e._tempItems||(e._tempItems=[]);let l=t.trim();if(t.indexOf(",")>=0){l=t.split(",");for(let t=0;t<l.length;t++){const a=l[t].trim();""!==a&&(e._tempItems.push(a),e._creteaTagsFromValue(a))}}else""!==l&&(e._tempItems.push(l),e._creteaTagsFromValue(l));e.query="",e._updateValue(!0)}}propertyChangedHandler(e,t,l){const a=this;if("disabled"===e&&a._setFocusable(),"value"===e){a.displayMember!==a.valueMember&&"string"!=typeof l?(a.value=l[a.displayMember],a.$.input.dataValue=l[a.valueMember]):a.$.input.dataValue="";const e=a.$.menu.children;for(let t=0;t<e.length;t++)e[t].classList.remove("selected"),e[t].setAttribute("aria-selected",!1);a._setActiveDescendant(a.$.menu.querySelector("active")),a._creteaTagsFromValue(l)}else if("separator"===e){const e=a.$.actionButton.children;for(let t=0;t<e.length;t++){const a=e[t];a.classList.contains("smart-token")&&a.setAttribute("separator",l)}}else if("inputTagsMode"===e)a._createTags();else if("theme"===e||"rightToLeft"===e)a.$.scrollView[e]=l,l?a.$.dropDownContainer.setAttribute(Smart.Utilities.Core.toDash(e),""):a.$.dropDownContainer.removeAttribute(Smart.Utilities.Core.toDash(e));else if("inverted"===e)l?a.$.dropDownContainer.setAttribute("inverted",""):a.$.dropDownContainer.removeAttribute("inverted");else if("selectAll"===e)a._handleSelectAllItem();else if("selectedIndex"===e){if(super.propertyChangedHandler(e,t,l),a._selectedItems=[],a.dataSource){const e=a.dataSource[l];e&&a._selectedItems.push(e),a._updateValue(!0)}}else if("selectedValues"===e){if(super.propertyChangedHandler(e,t,l),a.dataSource){a._selectedItems=[];const e=a.dataSource.filter((e=>{if("string"==typeof e){if(a.selectedValues.indexOf(e)>=0)return!0}else if(a.selectedValues.indexOf(e.value)>=0)return!0}));a._selectedItems=e,a._updateValue(!0)}}else super.propertyChangedHandler(e,t,l)}_createElement(){const e=this,t=document.createElement("ul"),l=document.createElement("smart-scroll-viewer"),a=document.createElement("div");if(l.rightToLeft=e.rightToLeft,l.theme=e.theme,l.horizontalScrollBarVisibility="hidden",l.classList.add("smart-multi-combo-input-scroll-viewer"),e.rightToLeft&&a.setAttribute("right-to-left",""),e.dataSource&&"string"==typeof e.dataSource&&(e.dataSource=e.$.deserialize(e.dataSource,"array")),a.setAttribute("theme",e.theme),a.classList.add("smart-multi-combo-input-drop-down-menu","smart-input-drop-down-menu","smart-check-input-drop-down-menu"),e.pills&&a.setAttribute("pills",""),e.singleSelect&&a.setAttribute("single-select",""),e.inverted?a.setAttribute("inverted",""):a.removeAttribute("inverted"),e.classList.add("smart-input"),a.appendChild(l),t.setAttribute("aria-multiselectable",!0),e.$.scrollView=l,e.$.menu=t,e.$.dropDownContainer=a,e.$.menu.onclick=function(t){t.stopPropagation(),t.preventDefault(),t.target&&t.target.hasAttribute("add-new")||(e._performSelect(t),e.focus())},e.classList.add("smart-input"),e.$.input.value="",e.selectedValues&&e.selectedValues.length>0){const t=e.dataSource.filter((t=>{if("string"==typeof t){if(e.selectedValues.indexOf(t)>=0)return!0}else if(e.selectedValues.indexOf(t.value)>=0)return!0}));e.selectedItems=t}else{const t=e.value;t&&e._creteaTagsFromValue(t)}e._handleSelectAllItem(),e._setFocusable()}_creteaTagsFromValue(e=""){const t=this;if(e){const e=t.value.split(",");for(t.$.input.value="",t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);for(let l=0,a=e.length;l<a;l+=1){const a=e[l].trim();if(a)if(t.dataSource){const e=t.dataSource.find((e=>{if("string"==typeof e){if(e===a)return e}else if(""+e.value===a)return e}));e&&e.label?e.color?t._selectedItems.push({color:e.color,label:e.label,value:e.value}):t._selectedItems.push({label:e.label,value:e.value}):t._selectedItems.push({label:a,value:a})}else t._selectedItems.push({label:a,value:a})}t._createTags()}else t.$.input.value="",t._selectedItems=[],t._createTags()}_handleSelectAllItem(){const e=this;if(e.selectAll){if(!e.$.selectAll){const t=document.createElement("ul"),l=document.createElement("li"),a=document.createElement("a");a.href="#",a.innerHTML=e.localize("selectAll"),a.setAttribute("aria-hidden",!0),l.id=e.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),l.setAttribute("role","option"),l.setAttribute("value",e.localize("selectAll")),l.setAttribute("aria-label",e.localize("selectAll")),l.classList.add("smart-select-all"),l.appendChild(a),l.onclick=function(t){t.stopPropagation(),t.preventDefault(),Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")))?e._selectAll():e._clearSelection(),e._setSelectAllItemState(),l.classList.contains("selected")&&l.classList.add("active"),e.focus()},t.appendChild(l),e.$.selectAll=t}e._setSelectAllItemState(),e.$.dropDownContainer.insertBefore(e.$.selectAll,e.$.scrollView)}else e.$.selectAll&&e.$.selectAll.remove()}_setSelectAllItemState(){const e=this;if(!e.$.selectAll)return;const t=e.$.selectAll.firstElementChild,l=t.firstElementChild,a=!Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")));t.removeAttribute("indeterminate"),t.classList.remove("selected","active"),l.innerHTML=e.localize("selectAll"),e._selectedItems&&e._selectedItems.length>0&&(a?(t.classList.add("selected"),l.innerHTML=e.localize("unselectAll")):t.setAttribute("indeterminate",""))}_selectAll(){const e=this,t=e._selectedItems.length,l=e.$.input.dataValue,a=e.value;e._clearSelection(!0);const s=e.$.menu.children;for(let t=0;t<s.length;t++)s[t].classList.contains("selected")||e._performSelect({target:s[t],noActiveState:!0},!0);t!==e._selectedItems.length&&(e.$.fireEvent("change",{value:e.$.input.dataValue,label:e.value,oldValue:l,oldLabel:a}),e._updateTargetValue())}_clearSelection(e){const t=this;if(!t._selectedItems.length)return;const l=t.$.input.dataValue,a=t.value;for(t.$.input.dataValue="",t.value=t.$.input.value,t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);const s=t.$.menu.children;for(let e=0;e<s.length;e++)s[e].classList.remove("selected"),s[e].classList.remove("active"),s[e].setAttribute("aria-selected",!1);t._setActiveDescendant(t.$.menu.querySelector("active")),e||(t.$.fireEvent("change",{value:"",label:"",oldValue:l,oldLabel:a}),t._updateTargetValue());const n=t.getBoundingClientRect(),o=window.scrollX,i=window.scrollY;t.$.dropDownContainer.style.left=-3+n.left+o+"px",t.$.dropDownContainer.style.top=n.bottom+i+1+"px"}_open(){const e=this,t=e.getBoundingClientRect(),l=window.scrollX,a=window.scrollY;let s=0,n=0;if(!this.opened){if(e.timer&&clearTimeout(e.timer),e.$.scrollView.classList.remove("smart-input-drop-down-menu"),e.$.dropDownContainer.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),document.body.appendChild(e.$.dropDownContainer),e.setAttribute("aria-owns",e.$.dropDownContainer.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.dropDownContainer.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();s=e.left,n=e.top}e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.dropDownContainer.style.left=-3+t.left+l-s+"px",e.$.dropDownContainer.style.top=t.bottom+a-n+1+"px",e.$.dropDownContainer.classList.remove("open"),e.$.dropDownContainer.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.dropDownContainer.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const l=parseFloat(t)/100;e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*l+"px")}else if("auto"!==t&&t)e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const l=e.$.menu.querySelectorAll("li");for(let t=0;t<l.length;t++)e._maxDropDownWidth=Math.max((l[t].firstElementChild||l[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>e.$.scrollView._scrollView.vScrollBar.refresh()))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),this.opened=!0,e.setAttribute("aria-expanded",!0)}}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.dropDownContainer.parentNode&&!e.opened&&(document.body.removeChild(e.$.dropDownContainer),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.dropDownContainer.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,e.setAttribute("aria-expanded",!1),e.focus(),e.$.fireEvent("close"),!0)}});
|
package/source/smart.numeric.js
CHANGED
package/source/smart.pager.js
CHANGED
package/source/smart.path.js
CHANGED
package/source/smart.qrcode.js
CHANGED
package/source/smart.rating.js
CHANGED
package/source/smart.router.js
CHANGED