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.checkbox.js
CHANGED
package/source/smart.chip.js
CHANGED
package/source/smart.combobox.js
CHANGED
package/source/smart.complex.js
CHANGED
package/source/smart.core.js
CHANGED
package/source/smart.data.js
CHANGED
package/source/smart.date.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-date-input",class extends Smart.Input{static get properties(){return{autoClose:{value:!1,type:"boolean"},autoCloseDelay:{value:0,type:"number"},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"right",defaultReflectToAttribute:!0,type:"string"},dropDownHeight:{type:"any",value:"auto"},min:{type:"any",value:new Date(1900,0,1)},max:{type:"any",value:new Date(2100,0,1)},messages:{value:{en:{hours:"Hours",minutes:"Minutes",am:"am",pm:"pm"}},type:"object",extend:!0},placeholder:{value:"MM/dd/yyyy",type:"string"},formatString:{value:"",type:"string"},dateTimeFormat:{type:"any",value:{year:"numeric",month:"numeric",day:"numeric"}},value:{type:"any",value:""}}}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><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>'}static get listeners(){return{"input.change":"_changeHandler","input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}_calendarDropDownClickHandler(e){const t=this;t.autoClose&&e.target.closest(".smart-calendar-cell")&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay))}render(){super.render(),this.formatString&&this.formatString.length>1&&"MM/dd/yyyy"===this.placeholder&&(this.placeholder=this.formatString),this.value&&this.value instanceof Date&&this._setInputValue(this.value)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;t.contains(a)?requestAnimationFrame((()=>{})):t.$.scrollView.contains(a.shadowParent||a)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),t._isPointerDown=!1,t.close())}_changeHandler(e){const t=this;e.stopPropagation(),t._performSelect();const a=t._getInputValue();t._oldValue||(t._oldValue=null),t.$.fireEvent("change",{value:a,oldValue:t._oldValue}),t._updateTargetValue(),t._oldValue=a}_focusHandler(){const e=this;if(e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup){if(e.$.fireEvent("focus"),e.value){const t=e._getInputValue();e._setInputValue(t)}delete e._preventLookup}}_blurHandler(){const e=this;if(e.opened||e.removeAttribute("focus"),e._popup&&e._popup.isCompleted&&e.opened)e._setInputValue(e._popup.value);else{const t=e._getInputValue();e._setInputValue(t)}e.$.fireEvent("blur"),delete e._preventLookup}_getInputValue(){const e=this,t=e.$.input.value;let a=null;const o=t=>{let a=new Date(Date.parse(t));if("Invalid Date"===a.toString()&&(a=null),!a||e.locale&&"en"!==e.locale){let e=(new Smart.Utilities.DateTime).tryparseDate(t,null);if(e)return e}return a};return e.dateTimeFormat.day&&e.dateTimeFormat.month&&e.dateTimeFormat.year?a=o(t):e.dateTimeFormat.day&&e.dateTimeFormat.month&&!e.dateTimeFormat.year?(a=o(t),e._popup.value||(e._popup.value=new Date),e._popup.isCompleted?a.setFullYear(e._popup.value.getFullYear(),a.getMonth(),a.getDate()):a.setFullYear((new Date).getFullYear(),a.getMonth(),a.getDate())):!e.dateTimeFormat.day&&e.dateTimeFormat.month&&e.dateTimeFormat.year&&(e._popup.value||(e._popup.value=new Date),a=o(t),e._popup.isCompleted?a.setFullYear(a.getFullYear(),a.getMonth(),e._popup.value.getDate()):a.setFullYear(a.getFullYear(),a.getMonth(),(new Date).getDate())),""!==e.min&&a<e.min&&(a=e.min),""!==e.max&&a>e.max&&(a=e.max),a}getDate(){return this._getInputValue()}getValue(){return this._getInputValue()}setValue(e){this._setInputValue(e)}_setInputValue(e){const t=this;if(!e)return t.$.input.value="",t.removeAttribute("data-value"),void(t.value=null);""!==t.min&&e<t.min&&(e=t.min),""!==t.max&&e>t.max&&(e=t.max);const a=t.dateTimeFormat;a&&a.timeZone&&delete a.timeZone;let o=new Intl.DateTimeFormat(t.locale,a).format(e);if(t.hasAttribute("focus")&&(o=new Intl.DateTimeFormat(t.locale,{year:"numeric",day:"numeric",month:"numeric"}).format(e)),t.formatString&&t.formatString.length>1){let a=new Smart.Utilities.DateTime(e).toString(t.formatString);t.locale&&"en"!==t.locale&&(o.indexOf(".")>=0?a=a.replaceAll("/","."):o.indexOf("-")>=0&&(a=a.replaceAll("/","-"))),o=a}t.$.input.value=t.value=o,t.setAttribute("data-value",e)}_performSelect(){}getFormattedValue(e,t){const a=this;if(null===t)return parseFloat(e);e||(e=new Date),t||(t=a.dateTimeFormat).timeZone&&delete t.timeZone;const o=new Intl.DateTimeFormat(a.locale,t).format(e);return a.formatString&&a.formatString.length>1?new Smart.Utilities.DateTime(e).toString(a.formatString):o}_open(){const e=this,t=e.getBoundingClientRect(),a=window.scrollX,o=window.scrollY;let n=0,r=0;if(this.opened)return;if(e.timer&&clearTimeout(e.timer),document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.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();n=e.left,r=e.top}const l=document.body.getBoundingClientRect(),i=-3+t.left+a-n;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),i+e.$.scrollView.offsetWidth<l.right?e.$.scrollView.style.left=i+"px":e.$.scrollView.style.left=i+e.offsetWidth-e.$.scrollView.offsetWidth+"px",e.$.scrollView.style.top=t.bottom+o-r+1+"px",e.$.scrollView.classList.remove("open"),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},e._refreshPopup(),requestAnimationFrame((function(){e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open","")})),this.opened=!0}_refreshPopup(){const e=this,t=e._getInputValue();e._popup.isAttached&&e._popup.select(t)}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(document.body.removeChild(e.$.scrollView),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,!0)}_lookup(){}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){return this._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;e._process(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}_process(){this._performSelect(void 0,!0),this._open()}_matcher(){}_sorter(){}_highlighter(){}_render(){}ensureVisible(){}_next(){}_prev(){}_move(e){e.stopPropagation()}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey}_insertKey(e,t=1){const a=this,o=a.$.input.selectionStart,n=a.$.input.value,r=n.substring(0,o),l=n.substring(o+t);a.$.input.value=r+e.key+l,a.$.input.selectionStart=a.$.input.selectionEnd=o+1}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode);let a=!1;switch(e.keyCode>=48&&e.keyCode<=57&&(a=!0),e.keyCode>=96&&e.keyCode<=105&&(a=!0),e.key){case"/":case"-":case":":case"ArrowLeft":case"ArrowUp":case"ArrowDown":case"ArrowRight":case"Home":case"End":case"Delete":case"Backspace":case"Tab":a=!0}e.ctrlKey&&(a=!0),a||e.preventDefault(),"Tab"===e.key&&t.close(),e.shiftKey||e.altKey||e.ctrlKey}_getMask(){const e=this,t=e.getFormattedValue(new Date(2020,10,10),{year:"numeric",month:"numeric",day:"numeric"});let a="/";t.indexOf(".")>=0?a=".":t.indexOf("-")>=0&&(a="-");const o=t.split(a);e._mask=[];let n=0;for(let t=0;t<o.length-1;t++)n+=o[t].length,e._mask[n]=a,n++}_appendPreOrPostMatch(e,t){for(var a=0,o=!1,n=0,r=e.length;n<r;n++){var l=e.charAt(n);switch(l){case"'":o?t.push("'"):a++,o=!1;break;case"\\":o&&t.push("\\"),o=!o;break;default:t.push(l),o=!1}}return a}_keyUpHandler(e){const t=this;let a=t.$.input.value.trim();const o=new Date(a);if(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105){if(void 0!==t._mask[a.length]){let e=[...a],o=t._mask.flat().length,n=0;for(let o=0;o<e.length;o++)e[o]===t._mask[a.length]&&n++;n<o&&(a+=t._mask[a.length],t.$.input.value=a)}}else if(" "===e.key||"Enter"===e.key){const a=t._getInputValue();t._setInputValue(a),"Enter"===e.key&&t.opened&&t.close()}else if("/"===e.key||":"===e.key||"-"===e.key){const e=t.$.input.selectionStart,a=t._getInputValue();t._setInputValue(a),t.$.input.selectionStart=e,"/"===t.$.input.value[e]&&t.$.input.selectionStart++}if("Invalid Date"!==o.toString()?t.value=o:t.value=null,t._refreshPopup(),!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&(t.open(),setTimeout((()=>{t._popup.focus()}),50)),38===e.keyCode&&e.altKey&&(t.close(),t.focus());break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault()}}propertyChangedHandler(e,t,a){const o=this;switch(e){case"dateTimeFormat":case"formatString":o._setInputValue(o.value);break;case"value":"string"==typeof a?o.$.input.value=a:o._setInputValue(a);break;case"month":case"min":case"max":o.$.calendar[e]=a;break;case"theme":case"rightToLeft":case"animation":case"inverted":o.$.calendar&&(o.$.calendar[e]=a),o.$.scrollView&&(a?o.$.scrollView.setAttribute(Smart.Utilities.Core.toDash(e),"boolean"==typeof a?"":a):o.$.scrollView.removeAttribute(Smart.Utilities.Core.toDash(e)));break;case"locale":o._getMask(),o._performSelect(),o.$.calendar&&(o.$.calendar.locale=a);break;default:super.propertyChangedHandler(e,t,a)}}_createElement(){const e=this,t=document.createElement("div");if(t.classList.add("smart-input-drop-down-menu","smart-date-input-drop-down-menu"),t.setAttribute("animation",e.animation),t.setAttribute("role","presentation"),e.rightToLeft?t.setAttribute("right-to-left",""):t.removeAttribute("right-to-left"),e.inverted?t.setAttribute("inverted",""):t.removeAttribute("inverted"),t.onclick=function(t){t.stopPropagation(),t.preventDefault();const a=t.target;t.altKey?e.$.input.focus():e._popup.focus(),a.closest("smart-done-button")&&e.close()},!t.id){const e=t.tagName.toLowerCase();t.id=e.slice(0,1).toLowerCase()+e.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}e.$.scrollView=t,e.classList.add("smart-input");const a=document.createElement("smart-calendar");if(e._popup=a,e.$.calendar=a,a.locale=e.locale,a.$.listen("keyup",(t=>{if("Enter"===t.key){e._oldValue||(e._oldValue=null);const t=a.selectedDates[0];a.value=t,e._setInputValue(t),e.$.fireEvent("change",{value:t,oldValue:e._oldValue}),e.set("value",t),e._updateTargetValue(),e._oldValue=t,e.close(),e.focus()}"Escape"===t.key&&(e.close(),e.focus()),"Tab"===t.key&&(e.close(),e.focus())})),a.onclick=t=>{e._oldValue||(e._oldValue=null);const o=a.selectedDates[0];e._setInputValue(o),e._calendarDropDownClickHandler(t),e.$.fireEvent("change",{value:o,oldValue:e._oldValue}),e.set("value",o),e._updateTargetValue(),e._oldValue=o},t.appendChild(a),e.$.input.value=e.value,e.value&&(""+e.value).length>0){const t=e._getInputValue();e._oldValue=t,e._setInputValue(t)}e._getMask()}_refreshMenu(){}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","presentation"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.removeAttribute("aria-hidden"),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-haspopup","dialog"),e.$.scrollView.setAttribute("role","dialog")}_setActiveDescendant(){}_setInputPurpose(){}});
|
|
6
|
+
Smart("smart-date-input",class extends Smart.Input{static get properties(){return{autoClose:{value:!1,type:"boolean"},autoCloseDelay:{value:0,type:"number"},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"right",defaultReflectToAttribute:!0,type:"string"},dropDownHeight:{type:"any",value:"auto"},min:{type:"any",value:new Date(1900,0,1)},max:{type:"any",value:new Date(2100,0,1)},messages:{value:{en:{hours:"Hours",minutes:"Minutes",am:"am",pm:"pm"}},type:"object",extend:!0},placeholder:{value:"MM/dd/yyyy",type:"string"},formatString:{value:"",type:"string"},dateTimeFormat:{type:"any",value:{year:"numeric",month:"numeric",day:"numeric"}},value:{type:"any",value:""}}}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><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>'}static get listeners(){return{"input.change":"_changeHandler","input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}_calendarDropDownClickHandler(e){const t=this;t.autoClose&&e.target.closest(".smart-calendar-cell")&&"month"===t.$.calendar.displayMode&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay))}render(){super.render(),this.formatString&&this.formatString.length>1&&"MM/dd/yyyy"===this.placeholder&&(this.placeholder=this.formatString),this.value&&this.value instanceof Date&&this._setInputValue(this.value)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;t.contains(a)?requestAnimationFrame((()=>{})):t.$.scrollView.contains(a.shadowParent||a)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),t._isPointerDown=!1,t.close())}_changeHandler(e){const t=this;e.stopPropagation(),t._performSelect();const a=t._getInputValue();t._oldValue||(t._oldValue=null),t.$.fireEvent("change",{value:a,oldValue:t._oldValue}),t._updateTargetValue(),t._oldValue=a}_focusHandler(){const e=this;if(e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup){if(e.$.fireEvent("focus"),e.value){const t=e._getInputValue();e._setInputValue(t)}delete e._preventLookup}}_blurHandler(){const e=this;if(e.opened||e.removeAttribute("focus"),e._popup&&e._popup.isCompleted&&e.opened)e._setInputValue(e._popup.value);else{const t=e._getInputValue();e._setInputValue(t)}e.$.fireEvent("blur"),delete e._preventLookup}_getInputValue(){const e=this,t=e.$.input.value;let a=null;const o=t=>{let a=new Date(Date.parse(t));if("Invalid Date"===a.toString()&&(a=null),!a||e.locale&&"en"!==e.locale){let e=(new Smart.Utilities.DateTime).tryparseDate(t,null);if(e)return e}return a};return e.dateTimeFormat.day&&e.dateTimeFormat.month&&e.dateTimeFormat.year?a=o(t):e.dateTimeFormat.day&&e.dateTimeFormat.month&&!e.dateTimeFormat.year?(a=o(t),e._popup.value||(e._popup.value=new Date),e._popup.isCompleted?a.setFullYear(e._popup.value.getFullYear(),a.getMonth(),a.getDate()):a.setFullYear((new Date).getFullYear(),a.getMonth(),a.getDate())):!e.dateTimeFormat.day&&e.dateTimeFormat.month&&e.dateTimeFormat.year&&(e._popup.value||(e._popup.value=new Date),a=o(t),e._popup.isCompleted?a.setFullYear(a.getFullYear(),a.getMonth(),e._popup.value.getDate()):a.setFullYear(a.getFullYear(),a.getMonth(),(new Date).getDate())),""!==e.min&&a<e.min&&(a=e.min),""!==e.max&&a>e.max&&(a=e.max),a}getDate(){return this._getInputValue()}getValue(){return this._getInputValue()}setValue(e){this._setInputValue(e)}_setInputValue(e){const t=this;if(!e)return t.$.input.value="",t.removeAttribute("data-value"),void(t.value=null);""!==t.min&&e<t.min&&(e=t.min),""!==t.max&&e>t.max&&(e=t.max);const a=t.dateTimeFormat;a&&a.timeZone&&delete a.timeZone;let o=new Intl.DateTimeFormat(t.locale,a).format(e);if(t.hasAttribute("focus")&&(o=new Intl.DateTimeFormat(t.locale,{year:"numeric",day:"numeric",month:"numeric"}).format(e)),t.formatString&&t.formatString.length>1){let a=new Smart.Utilities.DateTime(e).toString(t.formatString);t.locale&&"en"!==t.locale&&(o.indexOf(".")>=0?a=a.replaceAll("/","."):o.indexOf("-")>=0&&(a=a.replaceAll("/","-"))),o=a}t.$.input.value=t.value=o,t.setAttribute("data-value",e)}_performSelect(){}getFormattedValue(e,t){const a=this;if(null===t)return parseFloat(e);e||(e=new Date),t||(t=a.dateTimeFormat).timeZone&&delete t.timeZone;const o=new Intl.DateTimeFormat(a.locale,t).format(e);return a.formatString&&a.formatString.length>1?new Smart.Utilities.DateTime(e).toString(a.formatString):o}_open(){const e=this,t=e.getBoundingClientRect(),a=window.scrollX,o=window.scrollY;let n=0,r=0;if(this.opened)return;if(e.timer&&clearTimeout(e.timer),document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.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();n=e.left,r=e.top}const l=document.body.getBoundingClientRect(),i=-3+t.left+a-n;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),i+e.$.scrollView.offsetWidth<l.right?e.$.scrollView.style.left=i+"px":e.$.scrollView.style.left=i+e.offsetWidth-e.$.scrollView.offsetWidth+"px",e.$.scrollView.style.top=t.bottom+o-r+1+"px",e.$.scrollView.classList.remove("open"),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},e._refreshPopup(),requestAnimationFrame((function(){e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open","")})),this.opened=!0}_refreshPopup(){const e=this,t=e._getInputValue();e._popup.isAttached&&e._popup.select(t)}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(document.body.removeChild(e.$.scrollView),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,!0)}_lookup(){}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){return this._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;e._process(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}_process(){this._performSelect(void 0,!0),this._open()}_matcher(){}_sorter(){}_highlighter(){}_render(){}ensureVisible(){}_next(){}_prev(){}_move(e){e.stopPropagation()}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey}_insertKey(e,t=1){const a=this,o=a.$.input.selectionStart,n=a.$.input.value,r=n.substring(0,o),l=n.substring(o+t);a.$.input.value=r+e.key+l,a.$.input.selectionStart=a.$.input.selectionEnd=o+1}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode);let a=!1;switch(e.keyCode>=48&&e.keyCode<=57&&(a=!0),e.keyCode>=96&&e.keyCode<=105&&(a=!0),e.key){case"/":case"-":case":":case"ArrowLeft":case"ArrowUp":case"ArrowDown":case"ArrowRight":case"Home":case"End":case"Delete":case"Backspace":case"Tab":a=!0}e.ctrlKey&&(a=!0),a||e.preventDefault(),"Tab"===e.key&&t.close(),e.shiftKey||e.altKey||e.ctrlKey}_getMask(){const e=this,t=e.getFormattedValue(new Date(2020,10,10),{year:"numeric",month:"numeric",day:"numeric"});let a="/";t.indexOf(".")>=0?a=".":t.indexOf("-")>=0&&(a="-");const o=t.split(a);e._mask=[];let n=0;for(let t=0;t<o.length-1;t++)n+=o[t].length,e._mask[n]=a,n++}_appendPreOrPostMatch(e,t){for(var a=0,o=!1,n=0,r=e.length;n<r;n++){var l=e.charAt(n);switch(l){case"'":o?t.push("'"):a++,o=!1;break;case"\\":o&&t.push("\\"),o=!o;break;default:t.push(l),o=!1}}return a}_keyUpHandler(e){const t=this;let a=t.$.input.value.trim();const o=new Date(a);if(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105){if(void 0!==t._mask[a.length]){let e=[...a],o=t._mask.flat().length,n=0;for(let o=0;o<e.length;o++)e[o]===t._mask[a.length]&&n++;n<o&&(a+=t._mask[a.length],t.$.input.value=a)}}else if(" "===e.key||"Enter"===e.key){const a=t._getInputValue();t._setInputValue(a),"Enter"===e.key&&t.opened&&t.close()}else if("/"===e.key||":"===e.key||"-"===e.key){const e=t.$.input.selectionStart,a=t._getInputValue();t._setInputValue(a),t.$.input.selectionStart=e,"/"===t.$.input.value[e]&&t.$.input.selectionStart++}if("Invalid Date"!==o.toString()?t.value=o:t.value=null,t._refreshPopup(),!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&(t.open(),setTimeout((()=>{t._popup.focus()}),50)),38===e.keyCode&&e.altKey&&(t.close(),t.focus());break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault()}}propertyChangedHandler(e,t,a){const o=this;switch(e){case"dateTimeFormat":case"formatString":o._setInputValue(o.value);break;case"value":"string"==typeof a?o.$.input.value=a:o._setInputValue(a);break;case"month":case"min":case"max":o.$.calendar[e]=a;break;case"theme":case"rightToLeft":case"animation":case"inverted":o.$.calendar&&(o.$.calendar[e]=a),o.$.scrollView&&(a?o.$.scrollView.setAttribute(Smart.Utilities.Core.toDash(e),"boolean"==typeof a?"":a):o.$.scrollView.removeAttribute(Smart.Utilities.Core.toDash(e)));break;case"locale":o._getMask(),o._performSelect(),o.$.calendar&&(o.$.calendar.locale=a);break;default:super.propertyChangedHandler(e,t,a)}}_createElement(){const e=this,t=document.createElement("div");if(t.classList.add("smart-input-drop-down-menu","smart-date-input-drop-down-menu"),t.setAttribute("animation",e.animation),t.setAttribute("role","presentation"),e.rightToLeft?t.setAttribute("right-to-left",""):t.removeAttribute("right-to-left"),e.inverted?t.setAttribute("inverted",""):t.removeAttribute("inverted"),t.onclick=function(t){t.stopPropagation(),t.preventDefault();const a=t.target;t.altKey?e.$.input.focus():e._popup.focus(),a.closest("smart-done-button")&&e.close()},!t.id){const e=t.tagName.toLowerCase();t.id=e.slice(0,1).toLowerCase()+e.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}e.$.scrollView=t,e.classList.add("smart-input");const a=document.createElement("smart-calendar");if(e._popup=a,e.$.calendar=a,e.$.calendar.locale=e.locale,e.$.calendar.min=e.min,e.$.calendar.max=e.max,e.$.calendar.value=e.value,a.$.listen("keyup",(t=>{if("Enter"===t.key){e._oldValue||(e._oldValue=null);const t=a.selectedDates[0];a.value=t,e._setInputValue(t),e.$.fireEvent("change",{value:t,oldValue:e._oldValue}),e.set("value",t),e._updateTargetValue(),e._oldValue=t,e.close(),e.focus()}"Escape"===t.key&&(e.close(),e.focus()),"Tab"===t.key&&(e.close(),e.focus())})),a.onclick=t=>{e._oldValue||(e._oldValue=null);const o=a.selectedDates[0];e._setInputValue(o),e._calendarDropDownClickHandler(t),e.$.fireEvent("change",{value:o,oldValue:e._oldValue}),e.set("value",o),e._updateTargetValue(),e._oldValue=o},t.appendChild(a),e.$.input.value=e.value,e.value&&(""+e.value).length>0){const t=e._getInputValue();e._oldValue=t,e._setInputValue(t)}e._getMask()}_refreshMenu(){}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","presentation"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.removeAttribute("aria-hidden"),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-haspopup","dialog"),e.$.scrollView.setAttribute("role","dialog")}_setActiveDescendant(){}_setInputPurpose(){}});
|
package/source/smart.draw.js
CHANGED
package/source/smart.editor.js
CHANGED
package/source/smart.element.js
CHANGED