smart-webcomponents-react 18.0.1 → 18.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/accordion.d.ts +2 -0
- package/accordion/accordion.esm.js +1 -1
- package/accordion/accordion.umd.js +2 -3
- package/accordion/accordionitem.d.ts +2 -0
- package/alertwindow/alertwindow.d.ts +2 -0
- package/alertwindow/alertwindow.esm.js +1 -1
- package/alertwindow/alertwindow.umd.js +2 -3
- package/array/array.d.ts +2 -0
- package/array/array.esm.js +1 -1
- package/array/array.umd.js +2 -3
- package/barcode/barcode.d.ts +2 -0
- package/barcode/barcode.esm.js +1 -1
- package/barcode/barcode.umd.js +2 -3
- package/breadcrumb/breadcrumb.d.ts +2 -0
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.umd.js +2 -3
- package/button/button.d.ts +2 -0
- package/button/button.esm.js +1 -1
- package/button/button.umd.js +2 -3
- package/button/buttongroup.d.ts +2 -0
- package/button/dropdownbutton.d.ts +2 -0
- package/button/multisplitbutton.d.ts +2 -0
- package/button/powerbutton.d.ts +2 -0
- package/button/radiobutton.d.ts +2 -0
- package/button/repeatbutton.d.ts +2 -0
- package/button/switchbutton.d.ts +2 -0
- package/button/togglebutton.d.ts +2 -0
- package/buttongroup/buttongroup.d.ts +2 -0
- package/buttongroup/buttongroup.esm.js +1 -1
- package/buttongroup/buttongroup.umd.js +2 -3
- package/calendar/calendar.d.ts +7 -0
- package/calendar/calendar.esm.js +13 -2
- package/calendar/calendar.umd.js +14 -4
- package/card/card.d.ts +2 -0
- package/card/card.esm.js +1 -1
- package/card/card.umd.js +2 -3
- package/card/cardview.d.ts +2 -0
- package/cardview/cardview.d.ts +2 -0
- package/cardview/cardview.esm.js +1 -1
- package/cardview/cardview.umd.js +2 -3
- package/carousel/carousel.d.ts +2 -0
- package/carousel/carousel.esm.js +1 -1
- package/carousel/carousel.umd.js +2 -3
- package/chart/chart.d.ts +2 -0
- package/chart/chart.esm.js +1 -1
- package/chart/chart.umd.js +2 -3
- package/chart/ganttchart.d.ts +2 -0
- package/chart/threedchart.d.ts +2 -0
- package/checkbox/checkbox.d.ts +2 -0
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.umd.js +2 -3
- package/checkinput/checkinput.d.ts +2 -0
- package/checkinput/checkinput.esm.js +1 -1
- package/checkinput/checkinput.umd.js +2 -3
- package/chip/chip.d.ts +2 -0
- package/chip/chip.esm.js +1 -1
- package/chip/chip.umd.js +2 -3
- package/colorinput/colorinput.d.ts +2 -0
- package/colorinput/colorinput.esm.js +1 -1
- package/colorinput/colorinput.umd.js +2 -3
- package/colorpanel/colorpanel.d.ts +2 -0
- package/colorpanel/colorpanel.esm.js +1 -1
- package/colorpanel/colorpanel.umd.js +2 -3
- package/colorpicker/colorpicker.d.ts +2 -0
- package/colorpicker/colorpicker.esm.js +1 -1
- package/colorpicker/colorpicker.umd.js +2 -3
- package/columnpanel/columnpanel.d.ts +2 -0
- package/columnpanel/columnpanel.esm.js +1 -1
- package/columnpanel/columnpanel.umd.js +2 -3
- package/combobox/combobox.d.ts +2 -0
- package/combobox/combobox.esm.js +1 -1
- package/combobox/combobox.umd.js +2 -3
- package/countryinput/countryinput.d.ts +2 -0
- package/countryinput/countryinput.esm.js +1 -1
- package/countryinput/countryinput.umd.js +2 -3
- package/customizationdialog/customizationdialog.d.ts +2 -0
- package/customizationdialog/customizationdialog.esm.js +1 -1
- package/customizationdialog/customizationdialog.umd.js +2 -3
- package/dateinput/dateinput.d.ts +2 -0
- package/dateinput/dateinput.esm.js +1 -1
- package/dateinput/dateinput.umd.js +2 -3
- package/daterangeinput/daterangeinput.d.ts +2 -0
- package/daterangeinput/daterangeinput.esm.js +1 -1
- package/daterangeinput/daterangeinput.umd.js +2 -3
- package/datetimepicker/datetimepicker.d.ts +2 -0
- package/datetimepicker/datetimepicker.esm.js +1 -1
- package/datetimepicker/datetimepicker.umd.js +2 -3
- package/dialogwindow/dialogwindow.d.ts +2 -0
- package/dialogwindow/dialogwindow.esm.js +1 -1
- package/dialogwindow/dialogwindow.umd.js +2 -3
- package/dockinglayout/dockinglayout.d.ts +2 -0
- package/dockinglayout/dockinglayout.esm.js +1 -1
- package/dockinglayout/dockinglayout.umd.js +2 -3
- package/dropdownbutton/dropdownbutton.d.ts +2 -0
- package/dropdownbutton/dropdownbutton.esm.js +1 -1
- package/dropdownbutton/dropdownbutton.umd.js +2 -3
- package/dropdownlist/dropdownlist.d.ts +2 -0
- package/dropdownlist/dropdownlist.esm.js +1 -1
- package/dropdownlist/dropdownlist.umd.js +2 -3
- package/editor/editor.d.ts +2 -0
- package/editor/editor.esm.js +1 -1
- package/editor/editor.umd.js +2 -3
- package/element/element.d.ts +2 -0
- package/element/element.esm.js +1 -1
- package/element/element.umd.js +2 -3
- package/fileupload/fileupload.d.ts +2 -0
- package/fileupload/fileupload.esm.js +1 -1
- package/fileupload/fileupload.umd.js +2 -3
- package/filterbuilder/filterbuilder.d.ts +2 -0
- package/filterbuilder/filterbuilder.esm.js +1 -1
- package/filterbuilder/filterbuilder.umd.js +2 -3
- package/filterpanel/filterpanel.d.ts +2 -0
- package/filterpanel/filterpanel.esm.js +1 -1
- package/filterpanel/filterpanel.umd.js +2 -3
- package/filterpanel/multicolumnfilterpanel.d.ts +2 -0
- package/form/form.d.ts +2 -0
- package/form/form.esm.js +1 -1
- package/form/form.umd.js +2 -3
- package/form/formcontrol.d.ts +2 -0
- package/form/formgroup.d.ts +2 -0
- package/ganttchart/ganttchart.d.ts +2 -0
- package/ganttchart/ganttchart.esm.js +1 -1
- package/ganttchart/ganttchart.umd.js +2 -3
- package/gauge/gauge.d.ts +2 -0
- package/gauge/gauge.esm.js +1 -1
- package/gauge/gauge.umd.js +2 -3
- package/grid/grid.d.ts +23 -12
- package/grid/grid.esm.js +25 -14
- package/grid/grid.umd.js +26 -16
- package/grouppanel/grouppanel.d.ts +2 -0
- package/grouppanel/grouppanel.esm.js +1 -1
- package/grouppanel/grouppanel.umd.js +2 -3
- package/index.d.ts +54 -3
- package/input/checkinput.d.ts +2 -0
- package/input/colorinput.d.ts +2 -0
- package/input/countryinput.d.ts +2 -0
- package/input/dateinput.d.ts +2 -0
- package/input/daterangeinput.d.ts +2 -0
- package/input/input.d.ts +2 -0
- package/input/input.esm.js +1 -1
- package/input/input.umd.js +2 -3
- package/input/multicomboinput.d.ts +2 -0
- package/input/multiinput.d.ts +2 -0
- package/input/numberinput.d.ts +2 -0
- package/input/passwordinput.d.ts +2 -0
- package/input/phoneinput.d.ts +2 -0
- package/input/timeinput.d.ts +2 -0
- package/kanban/kanban.d.ts +2 -0
- package/kanban/kanban.esm.js +1 -1
- package/kanban/kanban.umd.js +2 -3
- package/layout/dockinglayout.d.ts +2 -0
- package/layout/layout.d.ts +2 -0
- package/layout/layout.esm.js +1 -1
- package/layout/layout.umd.js +2 -3
- package/layout/layoutgroup.d.ts +2 -0
- package/layout/layoutitem.d.ts +2 -0
- package/layout/tablayoutgroup.d.ts +2 -0
- package/layout/tablayoutitem.d.ts +2 -0
- package/led/led.d.ts +2 -0
- package/led/led.esm.js +1 -1
- package/led/led.umd.js +2 -3
- package/listbox/listbox.d.ts +2 -0
- package/listbox/listbox.esm.js +1 -1
- package/listbox/listbox.umd.js +2 -3
- package/listmenu/listmenu.d.ts +2 -0
- package/listmenu/listmenu.esm.js +1 -1
- package/listmenu/listmenu.umd.js +2 -3
- package/map/map.d.ts +2 -0
- package/map/map.esm.js +1 -1
- package/map/map.umd.js +2 -3
- package/maskedtextbox/maskedtextbox.d.ts +2 -0
- package/maskedtextbox/maskedtextbox.esm.js +1 -1
- package/maskedtextbox/maskedtextbox.umd.js +2 -3
- package/menu/listmenu.d.ts +2 -0
- package/menu/menu.d.ts +2 -0
- package/menu/menu.esm.js +1 -1
- package/menu/menu.umd.js +2 -3
- package/menu/menuitem.d.ts +2 -0
- package/menu/menuitemsgroup.d.ts +2 -0
- package/multicolumnfilterpanel/multicolumnfilterpanel.d.ts +2 -0
- package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +1 -1
- package/multicolumnfilterpanel/multicolumnfilterpanel.umd.js +2 -3
- package/multicomboinput/multicomboinput.d.ts +2 -0
- package/multicomboinput/multicomboinput.esm.js +1 -1
- package/multicomboinput/multicomboinput.umd.js +2 -3
- package/multiinput/multiinput.d.ts +2 -0
- package/multiinput/multiinput.esm.js +1 -1
- package/multiinput/multiinput.umd.js +2 -3
- package/multilinetextbox/multilinetextbox.d.ts +2 -0
- package/multilinetextbox/multilinetextbox.esm.js +1 -1
- package/multilinetextbox/multilinetextbox.umd.js +2 -3
- package/multilinewindow/multilinewindow.d.ts +2 -0
- package/multilinewindow/multilinewindow.esm.js +1 -1
- package/multilinewindow/multilinewindow.umd.js +2 -3
- package/multisplitbutton/multisplitbutton.d.ts +2 -0
- package/multisplitbutton/multisplitbutton.esm.js +1 -1
- package/multisplitbutton/multisplitbutton.umd.js +2 -3
- package/numberinput/numberinput.d.ts +2 -0
- package/numberinput/numberinput.esm.js +1 -1
- package/numberinput/numberinput.umd.js +2 -3
- package/numerictextbox/numerictextbox.d.ts +2 -0
- package/numerictextbox/numerictextbox.esm.js +1 -1
- package/numerictextbox/numerictextbox.umd.js +2 -3
- package/package.json +1 -1
- package/pager/pager.d.ts +2 -0
- package/pager/pager.esm.js +1 -1
- package/pager/pager.umd.js +2 -3
- package/passwordinput/passwordinput.d.ts +2 -0
- package/passwordinput/passwordinput.esm.js +1 -1
- package/passwordinput/passwordinput.umd.js +2 -3
- package/passwordtextbox/passwordtextbox.d.ts +2 -0
- package/passwordtextbox/passwordtextbox.esm.js +1 -1
- package/passwordtextbox/passwordtextbox.umd.js +2 -3
- package/path/path.d.ts +2 -0
- package/path/path.esm.js +1 -1
- package/path/path.umd.js +2 -3
- package/phoneinput/phoneinput.d.ts +2 -0
- package/phoneinput/phoneinput.esm.js +1 -1
- package/phoneinput/phoneinput.umd.js +2 -3
- package/pivottable/pivottable.d.ts +2 -0
- package/pivottable/pivottable.esm.js +1 -1
- package/pivottable/pivottable.umd.js +2 -3
- package/progressbar/circularprogressbar.d.ts +2 -0
- package/progressbar/progressbar.d.ts +2 -0
- package/progressbar/progressbar.esm.js +1 -1
- package/progressbar/progressbar.umd.js +2 -3
- package/progresswindow/progresswindow.d.ts +2 -0
- package/progresswindow/progresswindow.esm.js +1 -1
- package/progresswindow/progresswindow.umd.js +2 -3
- package/promptwindow/promptwindow.d.ts +2 -0
- package/promptwindow/promptwindow.esm.js +1 -1
- package/promptwindow/promptwindow.umd.js +2 -3
- package/qrcode/qrcode.d.ts +2 -0
- package/qrcode/qrcode.esm.js +1 -1
- package/qrcode/qrcode.umd.js +2 -3
- package/querybuilder/querybuilder.d.ts +2 -0
- package/querybuilder/querybuilder.esm.js +1 -1
- package/querybuilder/querybuilder.umd.js +2 -3
- package/radiobutton/radiobutton.d.ts +2 -0
- package/radiobutton/radiobutton.esm.js +1 -1
- package/radiobutton/radiobutton.umd.js +2 -3
- package/rating/rating.d.ts +2 -0
- package/rating/rating.esm.js +1 -1
- package/rating/rating.umd.js +2 -3
- package/ribbon/ribbon.d.ts +2 -0
- package/ribbon/ribbon.esm.js +1 -1
- package/ribbon/ribbon.umd.js +2 -3
- package/ribbon/ribbongroup.d.ts +2 -0
- package/ribbon/ribbonitem.d.ts +2 -0
- package/ribbon/ribbontab.d.ts +2 -0
- package/scheduler/scheduler.d.ts +2 -0
- package/scheduler/scheduler.esm.js +1 -1
- package/scheduler/scheduler.umd.js +2 -3
- package/scrollbar/scrollbar.d.ts +2 -0
- package/scrollbar/scrollbar.esm.js +1 -1
- package/scrollbar/scrollbar.umd.js +2 -3
- package/slider/slider.d.ts +2 -0
- package/slider/slider.esm.js +1 -1
- package/slider/slider.umd.js +2 -3
- package/sortable/sortable.d.ts +2 -0
- package/sortable/sortable.esm.js +1 -1
- package/sortable/sortable.umd.js +2 -3
- package/sortpanel/sortpanel.d.ts +2 -0
- package/sortpanel/sortpanel.esm.js +1 -1
- package/sortpanel/sortpanel.umd.js +2 -3
- package/source/modules/smart.3dchart.js +3 -3
- package/source/modules/smart.accordion.js +3 -3
- package/source/modules/smart.array.js +3 -3
- package/source/modules/smart.barcode.js +3 -3
- package/source/modules/smart.breadcrumb.js +3 -3
- package/source/modules/smart.button.js +3 -3
- package/source/modules/smart.buttongroup.js +3 -3
- package/source/modules/smart.calendar.js +5 -5
- package/source/modules/smart.card.js +3 -3
- package/source/modules/smart.cardview.js +7 -7
- package/source/modules/smart.carousel.js +3 -3
- package/source/modules/smart.chart.js +4 -4
- package/source/modules/smart.checkbox.js +3 -3
- package/source/modules/smart.checkinput.js +4 -4
- package/source/modules/smart.chip.js +3 -3
- package/source/modules/smart.colorinput.js +4 -4
- package/source/modules/smart.colorpanel.js +3 -3
- package/source/modules/smart.colorpicker.js +3 -3
- package/source/modules/smart.combobox.js +3 -3
- package/source/modules/smart.common.js +5 -5
- package/source/modules/smart.countryinput.js +4 -4
- package/source/modules/smart.dateinput.js +5 -5
- package/source/modules/smart.daterangeinput.js +5 -5
- package/source/modules/smart.datetimepicker.js +5 -5
- package/source/modules/smart.dockinglayout.js +3 -3
- package/source/modules/smart.dropdownbutton.js +3 -3
- package/source/modules/smart.dropdownlist.js +3 -3
- package/source/modules/smart.editor.js +4 -4
- package/source/modules/smart.element.js +3 -3
- package/source/modules/smart.fileupload.js +3 -3
- package/source/modules/smart.form.js +5 -5
- package/source/modules/smart.formulaparser.js +3 -3
- package/source/modules/smart.ganttchart.js +8 -8
- package/source/modules/smart.gauge.js +3 -3
- package/source/modules/smart.grid.js +18 -18
- package/source/modules/smart.gridpanel.js +7 -7
- package/source/modules/smart.input.js +4 -4
- package/source/modules/smart.kanban.js +7 -7
- package/source/modules/smart.layout.js +3 -3
- package/source/modules/smart.led.js +3 -3
- package/source/modules/smart.listbox.js +3 -3
- package/source/modules/smart.listmenu.js +3 -3
- package/source/modules/smart.map.js +3 -3
- package/source/modules/smart.maskedtextbox.js +4 -4
- package/source/modules/smart.menu.js +3 -3
- package/source/modules/smart.multicomboinput.js +4 -4
- package/source/modules/smart.multiinput.js +4 -4
- package/source/modules/smart.multilinetextbox.js +3 -3
- package/source/modules/smart.multisplitbutton.js +3 -3
- package/source/modules/smart.numberinput.js +4 -4
- package/source/modules/smart.numerictextbox.js +3 -3
- package/source/modules/smart.pager.js +4 -4
- package/source/modules/smart.passwordinput.js +4 -4
- package/source/modules/smart.passwordtextbox.js +4 -4
- package/source/modules/smart.path.js +3 -3
- package/source/modules/smart.phoneinput.js +4 -4
- package/source/modules/smart.pivottable.js +8 -8
- package/source/modules/smart.progressbar.js +3 -3
- package/source/modules/smart.qrcode.js +3 -3
- package/source/modules/smart.querybuilder.js +5 -5
- package/source/modules/smart.radiobutton.js +3 -3
- package/source/modules/smart.rating.js +3 -3
- package/source/modules/smart.ribbon.js +4 -4
- package/source/modules/smart.router.js +4 -4
- package/source/modules/smart.scheduler.js +7 -7
- package/source/modules/smart.scrollbar.js +3 -3
- package/source/modules/smart.slider.js +3 -3
- package/source/modules/smart.sortable.js +3 -3
- package/source/modules/smart.splitter.js +3 -3
- package/source/modules/smart.switchbutton.js +3 -3
- package/source/modules/smart.table.js +6 -6
- package/source/modules/smart.tabs.js +3 -3
- package/source/modules/smart.tank.js +3 -3
- package/source/modules/smart.textarea.js +5 -5
- package/source/modules/smart.textbox.js +3 -3
- package/source/modules/smart.timeinput.js +4 -4
- package/source/modules/smart.timepicker.js +3 -3
- package/source/modules/smart.toast.js +3 -3
- package/source/modules/smart.tooltip.js +3 -3
- package/source/modules/smart.tree.js +4 -4
- package/source/modules/smart.validator.js +3 -3
- package/source/modules/smart.window.js +3 -3
- package/source/smart.3dchart.js +1 -1
- package/source/smart.accordion.js +1 -1
- package/source/smart.ajax.js +1 -1
- package/source/smart.array.js +1 -1
- package/source/smart.barcode.js +1 -1
- package/source/smart.bootstrap.js +1 -1
- package/source/smart.breadcrumb.js +1 -1
- package/source/smart.button.js +1 -1
- package/source/smart.buttongroup.js +1 -1
- package/source/smart.calendar.js +2 -2
- package/source/smart.card.js +1 -1
- package/source/smart.cardview.js +1 -1
- package/source/smart.carousel.js +1 -1
- package/source/smart.chart.annotations.js +1 -1
- package/source/smart.chart.api.js +1 -1
- package/source/smart.chart.core.js +1 -1
- package/source/smart.chart.js +1 -1
- package/source/smart.chart.rangeselector.js +1 -1
- package/source/smart.chart.waterfall.js +1 -1
- package/source/smart.checkbox.js +1 -1
- package/source/smart.checkinput.js +1 -1
- package/source/smart.chip.js +1 -1
- package/source/smart.colorinput.js +1 -1
- package/source/smart.colorpanel.js +1 -1
- package/source/smart.colorpicker.js +1 -1
- package/source/smart.combobox.js +1 -1
- package/source/smart.complex.js +1 -1
- package/source/smart.core.js +1 -1
- package/source/smart.countryinput.js +1 -1
- package/source/smart.data.js +2 -2
- package/source/smart.date.js +1 -1
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +1 -1
- package/source/smart.daterangeinput.js +1 -1
- package/source/smart.datetimepicker.js +1 -1
- package/source/smart.dockinglayout.js +1 -1
- package/source/smart.draw.js +1 -1
- package/source/smart.dropdownbutton.js +1 -1
- package/source/smart.dropdownlist.js +1 -1
- package/source/smart.editor.js +1 -1
- package/source/smart.element.js +1 -1
- package/source/smart.elements.js +17 -17
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +1 -1
- package/source/smart.filter.js +2 -2
- package/source/smart.filterbuilder.js +1 -1
- package/source/smart.filterpanel.js +2 -2
- package/source/smart.form.js +1 -1
- package/source/smart.format.js +1 -1
- package/source/smart.formulaparser.js +1 -1
- package/source/smart.ganttchart.js +2 -2
- package/source/smart.gauge.js +1 -1
- package/source/smart.grid.cell.js +2 -2
- package/source/smart.grid.chart.js +1 -1
- package/source/smart.grid.column.js +2 -2
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +2 -2
- package/source/smart.grid.edit.js +2 -2
- package/source/smart.grid.export.js +1 -1
- package/source/smart.grid.filter.js +1 -1
- package/source/smart.grid.group.js +1 -1
- package/source/smart.grid.js +1 -1
- package/source/smart.grid.menu.js +1 -1
- package/source/smart.grid.pager.js +1 -1
- package/source/smart.grid.reorder.js +1 -1
- package/source/smart.grid.resize.js +1 -1
- package/source/smart.grid.row.js +2 -2
- package/source/smart.grid.select.js +2 -2
- package/source/smart.grid.sort.js +1 -1
- package/source/smart.grid.toolbar.js +2 -2
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +1 -1
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +2 -2
- package/source/smart.kanban.js +1 -1
- package/source/smart.layout.js +1 -1
- package/source/smart.led.js +1 -1
- package/source/smart.listbox.js +1 -1
- package/source/smart.listmenu.js +1 -1
- package/source/smart.map.js +1 -1
- package/source/smart.maskedtextbox.js +1 -1
- package/source/smart.math.js +1 -1
- package/source/smart.menu.js +1 -1
- package/source/smart.multicomboinput.js +1 -1
- package/source/smart.multiinput.js +1 -1
- package/source/smart.multilinetextbox.js +1 -1
- package/source/smart.multisplitbutton.js +1 -1
- package/source/smart.numberformatpanel.js +1 -1
- package/source/smart.numberinput.js +1 -1
- package/source/smart.numeric.js +1 -1
- package/source/smart.numerictextbox.js +1 -1
- package/source/smart.pager.js +1 -1
- package/source/smart.passwordinput.js +1 -1
- package/source/smart.passwordtextbox.js +1 -1
- package/source/smart.path.js +1 -1
- package/source/smart.phoneinput.js +1 -1
- package/source/smart.pivottable.js +1 -1
- package/source/smart.powerbutton.js +1 -1
- package/source/smart.progressbar.js +1 -1
- package/source/smart.qrcode.js +1 -1
- package/source/smart.radiobutton.js +1 -1
- package/source/smart.rating.js +1 -1
- package/source/smart.ribbon.js +1 -1
- package/source/smart.router.js +1 -1
- package/source/smart.scheduler.js +1 -1
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.slider.js +1 -1
- package/source/smart.sortable.js +1 -1
- package/source/smart.sparkline.js +6 -0
- package/source/smart.splitter.js +1 -1
- package/source/smart.switchbutton.js +1 -1
- package/source/smart.table.js +1 -1
- package/source/smart.tabs.js +1 -1
- package/source/smart.tank.js +1 -1
- package/source/smart.textarea.js +2 -2
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.js +1 -1
- package/source/smart.timepicker.js +1 -1
- package/source/smart.toast.js +1 -1
- package/source/smart.tooltip.js +1 -1
- package/source/smart.tree.js +2 -2
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/source/styles/components/smart.grid.css +1 -1
- package/source/styles/components/smart.validator.css +1 -1
- package/source/styles/default/scss/smart.grid.scss +230 -168
- package/source/styles/default/scss/smart.validator.scss +1 -0
- package/source/styles/default/smart.grid.css +48 -9
- package/source/styles/default/smart.validator.css +123 -121
- package/source/styles/smart.default.css +2 -2
- package/source/typescript/smart.calendar.d.ts +5 -0
- package/source/typescript/smart.elements.d.ts +54 -3
- package/source/typescript/smart.grid.d.ts +33 -3
- package/source/typescript/smart.textarea.d.ts +5 -0
- package/source/typescript/smart.tree.d.ts +11 -0
- package/splitter/splitter.d.ts +2 -0
- package/splitter/splitter.esm.js +1 -1
- package/splitter/splitter.umd.js +2 -3
- package/splitter/splitterbar.d.ts +2 -0
- package/splitter/splitteritem.d.ts +2 -0
- package/switchbutton/switchbutton.d.ts +2 -0
- package/switchbutton/switchbutton.esm.js +1 -1
- package/switchbutton/switchbutton.umd.js +2 -3
- package/table/pivottable.d.ts +2 -0
- package/table/sortable.d.ts +2 -0
- package/table/table.d.ts +2 -0
- package/table/table.esm.js +1 -1
- package/table/table.umd.js +2 -3
- package/tabs/tabs.d.ts +2 -0
- package/tabs/tabs.esm.js +1 -1
- package/tabs/tabs.umd.js +2 -3
- package/tabs/tabswindow.d.ts +2 -0
- package/tabswindow/tabswindow.d.ts +2 -0
- package/tabswindow/tabswindow.esm.js +1 -1
- package/tabswindow/tabswindow.umd.js +2 -3
- package/tank/tank.d.ts +2 -0
- package/tank/tank.esm.js +1 -1
- package/tank/tank.umd.js +2 -3
- package/textarea/textarea.d.ts +7 -0
- package/textarea/textarea.esm.js +13 -2
- package/textarea/textarea.umd.js +14 -4
- package/textbox/maskedtextbox.d.ts +2 -0
- package/textbox/multilinetextbox.d.ts +2 -0
- package/textbox/numerictextbox.d.ts +2 -0
- package/textbox/passwordtextbox.d.ts +2 -0
- package/textbox/textbox.d.ts +2 -0
- package/textbox/textbox.esm.js +1 -1
- package/textbox/textbox.umd.js +2 -3
- package/threedchart/threedchart.d.ts +2 -0
- package/threedchart/threedchart.esm.js +1 -1
- package/threedchart/threedchart.umd.js +2 -3
- package/timeinput/timeinput.d.ts +2 -0
- package/timeinput/timeinput.esm.js +1 -1
- package/timeinput/timeinput.umd.js +2 -3
- package/timepicker/datetimepicker.d.ts +2 -0
- package/timepicker/timepicker.d.ts +2 -0
- package/timepicker/timepicker.esm.js +1 -1
- package/timepicker/timepicker.umd.js +2 -3
- package/toast/toast.d.ts +2 -0
- package/toast/toast.esm.js +1 -1
- package/toast/toast.umd.js +2 -3
- package/tooltip/tooltip.d.ts +2 -0
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.umd.js +2 -3
- package/tree/tree.d.ts +12 -0
- package/tree/tree.esm.js +9 -2
- package/tree/tree.umd.js +10 -4
- package/tree/treeitem.d.ts +2 -0
- package/tree/treeitemsgroup.d.ts +2 -0
- package/validator/validator.d.ts +2 -0
- package/validator/validator.esm.js +1 -1
- package/validator/validator.umd.js +2 -3
- package/waitwindow/waitwindow.d.ts +2 -0
- package/waitwindow/waitwindow.esm.js +1 -1
- package/waitwindow/waitwindow.umd.js +2 -3
- package/window/alertwindow.d.ts +2 -0
- package/window/dialogwindow.d.ts +2 -0
- package/window/multilinewindow.d.ts +2 -0
- package/window/progresswindow.d.ts +2 -0
- package/window/promptwindow.d.ts +2 -0
- package/window/tabswindow.d.ts +2 -0
- package/window/waitwindow.d.ts +2 -0
- package/window/window.d.ts +2 -0
- package/window/window.esm.js +1 -1
- package/window/window.umd.js +2 -3
package/source/smart.numeric.js
CHANGED
package/source/smart.pager.js
CHANGED
package/source/smart.path.js
CHANGED
package/source/smart.qrcode.js
CHANGED
package/source/smart.rating.js
CHANGED
package/source/smart.ribbon.js
CHANGED
package/source/smart.router.js
CHANGED
package/source/smart.slider.js
CHANGED
package/source/smart.sortable.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
/* Smart UI v18.0.11 (2024-02-10)
|
|
3
|
+
Copyright (c) 2011-2023 jQWidgets.
|
|
4
|
+
License: https://htmlelements.com/license/ */ //
|
|
5
|
+
|
|
6
|
+
Smart("smart-sparkline",class extends Smart.BaseElement{static get properties(){return{width:{value:100,type:"number"},height:{value:30,type:"number"},gap:{value:5,type:"number"},strokeWidth:{value:2,type:"number"},type:{value:"bar",type:"string"},colors:{value:["gray"],type:"array"},points:{value:[],type:"any"},labels:{value:[],type:"any"},format:{value:[],type:"any"}}}get enableShadowDOM(){return!1}template(){return'<div id="container" role="presentation">\n </div>'}render(){const t=this,e={svg:null,width:t.width,height:t.height,gap:t.gap,strokeWidth:t.strokeWidth,type:t.type,colors:t.colors,points:t.points,labels:t.labels,format:t.format};switch(e.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),e.svg.setAttribute("width",e.width),e.svg.setAttribute("height",e.height),function(e){Array.isArray(e.colors)||(e.colors=t.colors.split(",")),e.points&&(t.$.container.innerHTML="",e.points=e.points.split(",").map((t=>parseInt(t,10))))}(e),e.type){case"bar":t.bar(e);break;case"line":t.line(e);break;case"pie":t.pie(e);break;case"stacked":t.stacked(e)}super.render()}refresh(){this.render()}propertyChangedHandler(t,e,s){super.propertyChangedHandler(t,e,s),this.render()}bar(t){const e=t.gap/t.points.length+t.width/t.points.length-t.gap,s=Math.max(...t.points);t.points.forEach(((i,n)=>{const r=t.colors[n%t.colors.length],o=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=i/s*t.height;o.setAttribute("x",n*e+n*t.gap),o.setAttribute("y",t.height-a),o.setAttribute("width",e),o.setAttribute("height",a),o.setAttribute("fill",r);const h=document.createElementNS("http://www.w3.org/2000/svg","title");h.textContent=i,o.appendChild(h),t.svg.appendChild(o)})),this.$.container.appendChild(t.svg)}line(t){const e=t.width/(t.points.length-1),s=Math.max(...t.points),i=[];t.points.forEach(((n,r)=>{const o=n/s*t.height,a=r*e,h=t.height-o;i.push(`${a},${h}`)}));const n=document.createElementNS("http://www.w3.org/2000/svg","polyline");n.setAttribute("points",i.join(" ")),n.setAttribute("fill","none"),n.setAttribute("stroke-width",t.strokeWidth),n.setAttribute("stroke",t.colors[0]),t.svg.appendChild(n),this.$.container.appendChild(t.svg)}pie(t){const e=Math.min(t.width,t.height)/2,s=t.width/2,i=t.height/2,n=t.points.reduce(((t,e)=>t+e),0);let r=0;t.points.forEach(((o,a)=>{const h=t.colors[a%t.colors.length],p=o/n*2*Math.PI,l=r+p,c=s+e*Math.cos(r),d=i+e*Math.sin(r),g=s+e*Math.cos(l),u=i+e*Math.sin(l),w=document.createElementNS("http://www.w3.org/2000/svg","path"),b=p>Math.PI?1:0,m=`M ${s},${i} L ${c},${d} A ${e},${e} 0 ${b} 1 ${g},${u} Z`;w.setAttribute("d",m),w.setAttribute("fill",h);const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=`${(o/n*100).toFixed(2)}%`,w.appendChild(v),t.svg.appendChild(w),r=l})),this.$.container.appendChild(t.svg)}stacked(t){let e=t.points.reduce(((t,e)=>t+e),0),s=(t.points.length-1)*t.gap,i=t.width-s,n=0;t.points.forEach(((s,r)=>{const o=t.colors[r%t.colors.length],a=s/e*i,h=document.createElementNS("http://www.w3.org/2000/svg","rect");h.setAttribute("x",n),h.setAttribute("y",0),h.setAttribute("width",a),h.setAttribute("height",t.height),h.setAttribute("fill",o);const p=document.createElementNS("http://www.w3.org/2000/svg","title");p.textContent=s,h.appendChild(p),t.svg.appendChild(h),n+=a+t.gap})),this.$.container.appendChild(t.svg)}});
|
package/source/smart.splitter.js
CHANGED
package/source/smart.table.js
CHANGED
package/source/smart.tabs.js
CHANGED
package/source/smart.tank.js
CHANGED
package/source/smart.textarea.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI v18.0.
|
|
2
|
+
/* Smart UI v18.0.11 (2024-02-10)
|
|
3
3
|
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
|
-
(()=>{Smart("smart-text-area",class extends Smart.Input{static get properties(){return{users:{value:[],type:"array",reflectToAttribute:!1},resize:{value:"none",type:"string"},richText:{value:!1,type:"boolean"},enableHTMLEncode:{value:!0,type:"boolean"},minWidth:{value:0,type:"number"},minHeight:{value:0,type:"number"},toolbarOnFocus:{value:!1,type:"boolean"}}}template(){return'<div id="inputContainer" role="presentation"><textarea class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]"></textarea><div id="editor"></div><span class="smart-hidden smart-hint" inner-h-t-m-l="[[hint]]" id="span"></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>'}_blurHandler(){const e=this;e.richText?e.removeAttribute("focus"):super._blurHandler()}_focusHandler(){const e=this;e.richText&&(e.$.editor.component.focus(),setTimeout((()=>{const t=e.$.editor.value;e.$.editor.selectionStart=t.length}))),super._focusHandler()}setHTML(e){const t=this;if(t.richText)return t.$.editor.value=e;this.value=e.replaceAll("<","<").replaceAll(">",">")}getHTML(){const e=this;return e.richText?e.$.editor.component.getHTML():e.value}propertyChangedHandler(e,t,o){const n=this;"value"===e&&n.richText&&(n.$.editor.value=o),"users"===e?(delete n._initMenu,n._mentionMenu&&(n._mentionPlugin&&n._mentionPlugin.destroy(),n._mentionMenu.remove(),n._initUsersMention()),n._renderMentionTrigger()):"resize"===e&&(n.richText?n.$.editor.querySelector(".smart-editor-editable").style.resize=o:n.$.input.style.resize=o,n._mentionTrigger&&("none"!==n.resize?n._mentionTrigger.style.right="10px":n._mentionTrigger.style.right="5px"))}detached(){const e=this;delete e._initMenu,e._mentionMenu&&e._mentionMenu.remove()}findMatches(){const e=this.$.input.value.split("").concat([" "]),t=[];let o="";for(let n in e){let i=e[n],r=e[n-1]||" ",s=[" ","\\n"].indexOf(r)>-1||10===r.charCodeAt(0);("@"===i&&s||o.length)&&" "!==i&&(o+=i),o.length&&" "===i&&(t.push({word:o,index:Math.max(n-o.length,0)}),o="")}return t}getMentions(){const e=this,t=this.findMatches(),o=[];return t.forEach((t=>{e.users.forEach((e=>{const n=t.word.replace("@","");e.name===n&&o.push(e)}))})),o}_initUsersMention(){const e=this;if(e._initMenu)return;e._initMenu=!0;const t=document.createElement("div");t.id=e.id+"_mention_menu",t.classList.add("smart-text-area-mention-menu","smart-hidden"),e._mentionMenu=t,document.body.appendChild(t),e._mentionPlugin=new Smart.Mention(e.richText?e.$.editor:e.$.input,t,(t=>""===t?e.users:e.users.filter((e=>e.name.startsWith(t)))),((e,t)=>e?`${t}${e.name} `:""),((e,t,o)=>{const n=document.createElement("div");return n.setAttribute("role","option"),n.className="smart-text-area-mention-menu-item",o&&(n.classList.add("selected"),n.setAttribute("aria-selected","")),n.textContent=e.name,n.onpointerdown=e=>{e.preventDefault(),t()},n}))}_initRichText(e,t,o){const n=this,i=n,r={};if(!e)return;o||(o={bold:"Bold",italic:"Italic",underline:"Underline",striketrhough:"Strikethrough",unorderedlist:"Bulleted list",orderedlist:"Numbered list",checklist:"Checklist",paragraph:"Paragraph",format:"Format",h1:"Large Heading",h2:"Medium Heading",h3:"Small Heading",link:"Create link",code:"Code",openLink:"Ctrl + Click to open the link"});const s=`\n <div class="smart-container">\n <div class="smart-editor-toolbar"> \n <div style="height: auto;" class="smart-editor-toolbar-items-primary">\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.bold}" command="bold" item-name="bold"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.italic}" command="italic" item-name="italic"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.underline}" command="underline" item-name="underline"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.striketrhough}" command="strikethrough" item-name="strikethrough"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.unorderedlist}" command="insertUnorderedList" item-name="unorderedlist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.orderedlist}" command="insertOrderedList" item-name="orderedlist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.checklist}" command="insertUnorderedList" item-name="checklist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.link}" command="hyperlink" item-name="hyperlink"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center smart-arrow-down" item-type="button" item-name="tableheader" tooltip="${o.format}"></div>\n </div>\n </div>\n <div class="smart-editor-content-container">\n <div class="smart-editor-editable" contenteditable="true"></div>\n </div>\n </div>\n `,a=e;a.className="smart-editor smart-rich-textarea",a.style.borderLeftWidth=a.style.borderTopWidth=a.style.borderRightWidth=a.style.borderBottomWidth="0px",a.innerHTML=s;const l=a.querySelector(".smart-editor-editable");l.style.resize=n.resize,n.style.minHeight=n.minHeight+"px",l.style.minHeight=n.minHeight+"px",l.style.minWidth=n.minWidth+"px",e.style.minHeight=n.minHeight+"px",e.style.minWidth=n.minWidth+"px";const d=a.querySelectorAll(".smart-editor-toolbar-item");if(r.textarea=t,r.tools=[],r.toolbar=a.querySelector(".smart-editor-toolbar"),n.toolbarOnFocus){r.toolbar.id=n.id+"_toolbar";const e=document.createElement("div");e.classList.add("smart-editor"),e.classList.add("smart-editor-toolbar-float"),e.setAttribute("focus",""),e.appendChild(r.toolbar),a.querySelector(".smart-container").setAttribute("toolbar-on-focus",""),n.appendChild(e)}r.contentContainer=a.querySelector(".smart-editor-content-container");const c=document.createElement("div");c.className="smart-editor-tooltip",c.setAttribute("tooltip-position","bottom"),document.body.appendChild(c),r.tooltip=document.querySelector(".smart-editor-tooltip");new ResizeObserver((()=>{if("none"!==n.resize){if(n.style.width=parseInt(l.offsetWidth)+2+"px",n.toolbarOnFocus)return void(n.style.height=parseInt(l.offsetHeight)+2+"px");n.style.height=parseInt(l.offsetHeight)+r.toolbar.offsetHeight+2+"px"}})).observe(l),d.forEach((e=>{const t=e.getAttribute("item-name");r.tools[t]={element:e,type:"button"},e.onmouseenter=e=>{setTimeout((()=>{const t=e.target.getAttribute("tooltip"),o=e.target.getBoundingClientRect(),i=(r.toolbar.getBoundingClientRect(),e=>e?e.offsetTop+i(e.offsetParent):0),s=e=>e?e.offsetLeft+s(e.offsetParent):0,a=(l=e.target,{left:s(l),top:i(l)});var l;r.tooltip.style.top=5+a.top+o.height+"px",r.tooltip.setAttribute("hover-tooltip",t),r.tooltip.classList.add("open"),r.tooltip.style.left=a.left+o.width/2-r.tooltip.offsetWidth/2+"px",n._tooltipTimer&&clearTimeout(n._tooltipTimer),n._tooltipTimer=setTimeout((()=>{r.tooltip.classList.remove("open")}),1e3)}),150)},e.onmouseleave=()=>{r.tooltip.classList.remove("open")},e.onpointerdown=e=>{const t=e.target.getAttribute("item-name"),i=(e.target.getAttribute("item-value"),e.target.getAttribute("command")),s=e.target.getAttribute("command-value"),l=a.querySelector(".smart-editor-editable");if("tableheader"===t){e.preventDefault();const t=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="tableheader"]'):a.querySelector('[item-name="tableheader"]');if(t._popup)t._popup.remove(),delete t._popup;else{t._popup=document.createElement("div");const e=t._popup;document.body.appendChild(e),e.style.position="absolute",e.style.height="auto",e.style.width="70px",e.style.background="var(--smart-background)",e.style.borderStyle="solid",e.style.borderWidth="1px",e.style.borderColor="var(--smart-border)",e.style.boxShadow="var(--smart-elevation-8)",e.style.zIndex=99999;const n=t.getBoundingClientRect();e.style.top=n.bottom+"px",e.style.left=n.left-20+"px",e.innerHTML=`\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.paragraph}" command="insertParagraph" command-value="p" item-name="p">P</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h1}" command="formatBlock" command-value="H1" item-name="h1">H1</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h2}" command="formatBlock" command-value="H2" item-name="h2">H2</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h3}" command="formatBlock" command-value="H3" item-name="h3">H3</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.code}" command="formatBlock" command-value="pre" item-name="pre">Code</div> \n `,e.querySelectorAll(".smart-button").forEach((e=>{e.onpointerdown=e=>{t._popup.remove(),delete t._popup;const o=e.target.getAttribute("command"),n=e.target.getAttribute("command-value");a.querySelector(".smart-editor-editable").getRootNode().execCommand(o,!1,n),e.preventDefault()}}))}return}e.target.hasAttribute("checked")?e.target.removeAttribute("checked"):e.target.setAttribute("checked","");const d=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="tableheader"]'):a.querySelector('[item-name="tableheader"]');switch(d._popup&&(d._popup.remove(),delete d._popup),t){case"bold":case"italic":case"underline":case"strikethrough":case"unorderedlist":case"checklist":case"orderedlist":l.getRootNode().execCommand(i,!1,null);break;case"hyperlink":{const e=r._getSelectionRange();let t,n=e.startContainer;n&&"a"!==n.nodeName.toLowerCase()&&(n=n.parentElement);let i=!1;n&&"a"===n.nodeName.toLowerCase()?(t=n.textContent,i=!0):t=e.toString(),i?(n.remove(),l.getRootNode().execCommand("insertHTML",!1,t)):t&&(l.getRootNode().execCommand("insertHTML",!1,'<a title="'+o.openLink+'" href="https://'+t.trim()+'">'+t+"</a>"),setTimeout((()=>{let e=r._getSelectionRange().startContainer;e&&"a"!==e.nodeName.toLowerCase()&&(e=e.parentElement),e&&"a"===e.nodeName.toLowerCase()&&(e.onmouseenter=t=>{t.ctrlKey&&e.classList.add("ctrl")},e.onmousemove=t=>{t.ctrlKey&&e.classList.add("ctrl")},e.onmouseleave=()=>{e.classList.remove("ctrl")})}),50));break}case"h1":case"h2":case"h3":case"p":case"pre":case"formats":l.getRootNode().execCommand(i,!1,s)}if("checklist"===t){const e=window.getSelection();if(e.focusNode){const t=e.focusNode.parentElement.closest("ul");t&&t.setAttribute("checklist","")}}e.preventDefault()}}));const m=a.querySelector(".smart-editor-editable");r.content=m,r.content.innerHTML="<div>"+t.value+"​</div>";const u=(e,o)=>{const n=r;return void 0===e&&(e=t.value),e=!o&&n.enableHtmlEncode?e.replaceAll("<","<").replaceAll(">",">"):e.replaceAll("<","<").replaceAll(">",">")};e.component=r;const h=(e,t)=>{var o=t(e);for(e=e.firstChild;!1!==o&&e;e=e.nextSibling)o=h(e,t);return o};r.getCaretPosition=e=>{var t=window.getSelection(),o=[0,0];if(t.anchorNode===e)o=[t.anchorOffset,t.extentOffset];else{var n=[t.anchorNode,t.extentNode];if(!e.contains(t.anchorNode)||!e.contains(t.extentNode))return;var i,r=[0,0];h(e,(function(e){for(i=0;i<2;i++)if(e==n[i]&&(r[i]=!0,r[0==i?1:0]))return!1;if(e.textContent&&!e.firstChild)for(i=0;i<2;i++)r[i]||(o[i]+=e.textContent.length)})),o[0]+=t.anchorOffset,o[1]+=t.extentOffset}return o[0]<=o[1]?o:[o[1],o[0]]},r.setCaretPosition=e=>{if(e>=0){const t=window.getSelection(),o=(e,t,n)=>{if(n||((n=document.createRange()).selectNode(e),n.setStart(e,0)),0===t.count)n.setEnd(e,t.count);else if(e&&t.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<t.count?t.count-=e.textContent.length:(n.setEnd(e,t.count),t.count=0);else for(var i=0;i<e.childNodes.length&&(n=o(e.childNodes[i],t,n),0!==t.count);i++);return n},n=o(a.querySelector(".smart-editor-editable"),{count:e});n&&(n.collapse(!1),t.removeAllRanges(),t.addRange(n))}},r.execCommand=(e,t)=>{const o=m.getRootNode();o&&o.execCommand(e,!1,t)},Object.defineProperty(e,"selectionStart",{configurable:!1,enumerable:!0,get(){t.value=r.content.textContent;const e=r.getCaretPosition(r.content);return void 0!==e?e[1]:0},set(e){r.setCaretPosition(e)}}),Object.defineProperty(e,"value",{configurable:!1,enumerable:!0,get:()=>(t.value=r.content.textContent,r._getInputValue()),set(e){r.content.innerHTML="<div>"+e+"​</div>",t.value=e,i.set("value",t.value,!1)}});return r._getSelectionRange=()=>{const e=r;return e._selectionRange||e._setSelectionRange(),e._selectionRange},r._setSelectionRange=(e,t,o)=>{const n=r;let i=a.querySelector(".smart-editor-editable");const s=window.getSelection();let l;if(e){if(l=document.createRange(),"number"==typeof t&&"number"==typeof o)try{l.setStart(e,parseInt(t)),l.setEnd(e,parseInt(o))}catch(t){l.selectNodeContents(e)}else"img"===e.nodeName.toLowerCase()||e.classList.contains("smart-editor-video-container")?(l.setStartBefore(e),l.setEndAfter(e),l.selectNode(e)):l.selectNodeContents(e);s.removeAllRanges(),s.addRange(l)}else s.rangeCount&&(l=s.getRangeAt(0));try{l&&l.startContainer&&i.contains(l.startContainer)&&(r._selectionRange=l)}catch(e){}n._selectionRange||(l=document.createRange(),l.selectNodeContents(i),l.collapse(!0),r._selectionRange=l)},r._getNodeFromList=(e,t)=>{const o=r.content;if(e&&t)for(;e&&e!==o;){const o=e.nodeName.toLocaleLowerCase();if(t.indexOf(o)>-1)return o;e=e.parentElement}},r._setItemValue=(e,t)=>{const o=r;let n=t.value;e&&t&&("button"===t.type?n?(e.setAttribute("checked",""),e.setAttribute("aria-pressed",!0)):(e.removeAttribute("checked"),e.setAttribute("aria-pressed",!1)):(n||"color-input"!==t.type?["fontname","formats"].indexOf(t.name)>-1&&(n=o.localize(t.value)||t.label||t.value):n="transparent",n?(e.setAttribute("item-value",n),e.style.setProperty("--item-value",n)):(e.removeAttribute("item-value"),e.style.removeProperty("--item-value"))))},r._getInputValue=u,r._updateToolbarItems=e=>{const t=r,o=t._getSelectionRange();if(!o)return;const n=t.content;let i,s=o.startOffset>o.endOffset?o.endContainer:o.startContainer;if(s&&(s.closest||(s=s.parentElement),s&&s.closest)){e||(e=["alignment","bold","hyperlink","italic","strikethrough","underline","fontsize","fontname","formats","fontcolor","backgroundcolor","orderedlist","unorderedlist","checklist","subscript","superscript","h1","h2","h3","code","pre"]);for(let o=0,r=e.length;o<r;o+=1){const r=e[o],a=t.tools[r];if(a){let e;if("alignment"===r)e=s.style.textAlign;else if("bold"===r)e=!!t._getNodeFromList(s,["b","strong","h4","h5","h6"]);else if("hyperlink"===r)e=!!t._getNodeFromList(s,["a"]);else if("h1"===r)e=!!t._getNodeFromList(s,["h1"]);else if("h2"===r)e=!!t._getNodeFromList(s,["h2"]);else if("h3"===r)e=!!t._getNodeFromList(s,["h3"]);else if("pre"===r)e=!!t._getNodeFromList(s,["pre"]);else if("p"===r)e=!!t._getNodeFromList(s,["p"]);else if("italic"===r)e=!!t._getNodeFromList(s,["i"]);else if("underline"===r)e=!!t._getNodeFromList(s,["u"]);else if("strikethrough"===r)e=!!t._getNodeFromList(s,["strike"]);else if("fontsize"===r){const t=s.closest(".smart-editor-editable font");t&&(e=t.style.fontSize),e||(i||(i=window.getComputedStyle(s)),e=i.fontSize),e=parseInt(e),isNaN(e)&&(e="")}else if("fontname"===r){const t=s.closest(".smart-editor-editable font");t&&t.hasAttribute("face")?e=t.getAttribute("face"):(i||(i=window.getComputedStyle(s)),e=i.fontFamily.split(",")[0])}else if("formats"===r&&s!==n){const o=["h1","h2","h3","p","pre"];if(e="",o){const n=o;e=t._getNodeFromList(s,n)||""}}else if("fontcolor"===r){const t=s.closest(".smart-editor-editable font");t?e=t.color:(i||(i=window.getComputedStyle(s)),e=i.color)}else if("backgroundcolor"===r)e=t._getNodeBackgroundColor(s),e||(i||(i=window.getComputedStyle(s)),e=i.backgroundColor);else if("orderedlist"===r||"unorderedlist"===r){e=!!s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);const t=s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);t&&t.parentElement&&t.parentElement.hasAttribute("checklist")&&(e=!1)}else if("checklist"===r){const t=s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);t&&t.parentElement.hasAttribute("checklist")&&(e=!0)}else"subscript"===r?e=!!s.closest(".smart-editor-editable sub"):"superscript"===r&&(e=!!s.closest(".smart-editor-editable sup"));if(!e&&a.dataSource){const t=a.dataSource[0];t&&(e=t.value||t)}null!==e&&(a.value=e,t._setItemValue(t.toolbar.querySelector(`.smart-editor-toolbar-item[item-name=${r}]`),a))}}}},r._getTextFromCarret=()=>{const e=r._getSelectionRange(),t=e.startContainer,o=t.textContent;let n,i;if(!e.toString()&&o.length>0&&o.indexOf(" ")>-1){const t=o.slice(0,e.startOffset).lastIndexOf(" ")+1;let r=o.slice(e.endOffset).indexOf(" ");r<0&&(r=o.length-1),n=t>-1?t:e.startOffset,i=Math.max(e.endOffset,e.endOffset+r)}else n=0,i=t.length;return{selectionStartIndex:n,selectionEndIndex:i}},r.focus=()=>{m.focus()},r.blur=()=>{m.blur()},r.getHTML=()=>u(r.content.innerHTML),m.onpointerup=e=>{const t=r,o=e.target;if(t._setSelectionRange(),t._updateToolbarItems(),e.ctrlKey){let e=t._getSelectionRange().startContainer;e&&"a"!==e.nodeName.toLowerCase()&&(e=e.parentElement),e&&"a"===e.nodeName.toLowerCase()&&window.open(e.href,"_blank")}if(o&&"LI"===o.nodeName&&o.closest("UL[checklist]")){const e=t._getSelectionRange();e&&0===e.startOffset&&0===e.endOffset&&(o.hasAttribute("checked")?o.removeAttribute("checked"):o.setAttribute("checked",""))}},m.onpaste=()=>{const e=r;e._setSelectionRange(),e._updateToolbarItems(),t.value=e.content.textContent,i.set("value",t.value,!1)},m.oninput=()=>{const e=r;e._setSelectionRange(),e._updateToolbarItems(),t.value=e.content.textContent,i.set("value",t.value,!1)},m.onkeydown=e=>{const t=r;t._setSelectionRange(),t._updateToolbarItems();let o=r._getSelectionRange().startContainer;o&&"a"!==o.nodeName.toLowerCase()&&(o=o.parentElement),o&&"a"===o.nodeName.toLowerCase()&&e.ctrlKey&&o.classList.add("ctrl")},m.onkeyup=()=>{const e=r;e._setSelectionRange(),e._updateToolbarItems(),t.value=e.content.textContent,i.set("value",t.value,!1)},m.onfocus=()=>{a.setAttribute("focus",""),i.toolbarOnFocus&&r.toolbar.parentElement.classList.add("show")},m.onblur=()=>{const e=r;a.removeAttribute("focus"),t.value=e.content.textContent,i.set("value",t.value,!1),i.toolbarOnFocus&&r.toolbar.parentElement.classList.remove("show"),r.tooltip.classList.remove("open")},document.addEventListener("selectionchange",(e=>{const t=r;if(!e.target.getSelection)return;const o=e.target.getSelection().focusNode;t.contentContainer.contains(o)&&(t._setSelectionRange(),t._updateToolbarItems())})),r}render(){const e=this;if(super.render(),e.richText)e._initRichText(e.$.editor,e.$.input);else{new ResizeObserver((()=>{"none"!==e.resize&&(e.style.width=parseInt(e.$.input.offsetWidth)+2+"px",e.style.height=parseInt(e.$.input.offsetHeight)+2+"px")})).observe(e.$.input),e.$.input.style.resize=e.resize}e._initUsersMention(),e._renderMentionTrigger(),e.classList.add("smart-input")}_renderMentionTrigger(){const e=this;if(!this.richText&&e.users&&e.users.length){e.setAttribute("has-users","");const t=document.createElement("span");t.innerHTML="@",t.style.position="absolute",t.classList.add("smart-hidden"),t.classList.add("smart-mention-trigger"),t.style.bottom="3px","none"!==e.resize?t.style.right="10px":t.style.right="5px",t.style.cursor="pointer",t.onpointerdown=t=>{const o=this.$.input.selectionEnd,n=this.$.input.value.slice(0,o),i=this.$.input.value.substring(o);return e.richText?(e.$.editor.component.execCommand("insertHTML","@"),this.$.editor.dispatchEvent(new Event("input")),void t.preventDefault()):n.length>1&&n.substring(n.length-2).indexOf("@")>=0?(this.$.input.dispatchEvent(new Event("input")),void t.preventDefault()):(n.length>0?(this.$.input.value=n+" @"+i,this.$.input.selectionStart=this.$.input.selectionEnd=o+2):0===e.$.input.selectionStart&&(this.$.input.value=n+"@ "+i,this.$.input.selectionStart=this.$.input.selectionEnd=1),this.$.input.dispatchEvent(new Event("input")),void t.preventDefault())},e._mentionTrigger=t,e.addEventListener("focus",(()=>{t.classList.remove("smart-hidden"),e._mentionPlugin&&e._mentionPlugin.refreshMenu()})),e.addEventListener("blur",(()=>{t.classList.add("smart-hidden"),e._mentionPlugin&&e._mentionPlugin.refreshMenu()})),e.onmouseenter=()=>{t.classList.remove("smart-hidden")},e.onmouseleave=()=>{t.classList.add("smart-hidden")},e.$.inputContainer.appendChild(t)}}});const e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];function t(t,o){const n=document.createElement("div");document.body.appendChild(n);const i=n.style;let r=getComputedStyle(t);if(t.className.indexOf("smart-editor")>=0){const e=t.querySelector(".smart-editor-editable");r=getComputedStyle(e)}i.whiteSpace="pre-wrap",i.wordWrap="break-word",i.position="absolute",i.visibility="hidden",e.forEach((e=>{i[e]=r[e]})),i.overflow="hidden",n.textContent=t.value.substring(0,o);const s=document.createElement("span");s.textContent=t.value.substring(o)||".",n.appendChild(s);const a={top:s.offsetTop+parseInt(r.borderTopWidth),left:s.offsetLeft+parseInt(r.borderLeftWidth),height:s.offsetHeight};if(t.className.indexOf("smart-editor")>=0){const e=t.getBoundingClientRect(),o=window.getSelection().getRangeAt(0).getClientRects()[0];o&&e&&(a.left=o.left-e.left,a.top=o.top-e.top)}return n.remove(),a}Smart.Mention=class{constructor(e,t,o,n,i){this.ref=e,this.menuRef=t,this.resolveFn=o,this.replaceFn=n,this.menuItemFn=i,this.options=[],this.makeOptions=this.makeOptions.bind(this),this.closeMenu=this.closeMenu.bind(this),this.selectItem=this.selectItem.bind(this),this.onInput=this.onInput.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.renderMenu=this.renderMenu.bind(this),this.ref.addEventListener("input",this.onInput),this.ref.addEventListener("keydown",this.onKeyDown)}destroy(){this.ref.removeEventListener("input",this.onInput),this.ref.removeEventListener("keydown",this.onKeyDown)}async makeOptions(e){const t=await this.resolveFn(e);0!==t.lenght?(this.options=t,this.renderMenu()):this.closeMenu()}closeMenu(){setTimeout((()=>{this.options=[],this.left=void 0,this.top=void 0,this.triggerIdx=void 0,this.renderMenu()}),0)}selectItem(e){return()=>{const t=this.ref.value.substr(0,this.triggerIdx),o=this.options[e],n=this.replaceFn(o,this.ref.value[this.triggerIdx]),i=this.ref.value.substr(this.ref.selectionStart),r=`${t}${n}${i}`;-1!==this.ref.className.indexOf("smart-editor")?this.ref.component.execCommand("insertHTML",o.name):(this.ref.value=r,this.ref.ownerElement&&(this.ref.ownerElement.value=r));const s=this.ref.value.length-i.length;-1===this.ref.className.indexOf("smart-editor")?this.ref.setSelectionRange(s,s):this.ref.selectionStart=s,this.ref.dispatchEvent(new Event("input")),this.closeMenu(),this.ref.focus()}}onInput(e){const o=this.ref.selectionStart,n=this.ref.value.slice(0,o),i=n.split(/\s/),r=i[i.length-1],s=n.endsWith(r)?n.length-r.length:-1;if(!("@"===n[s]))return void this.closeMenu();const a=n.slice(s+1);this.makeOptions(a);const l=t(this.ref,o),{top:d,left:c}=this.ref.getBoundingClientRect();setTimeout((()=>{this.active=0,this.left=window.scrollX+l.left+c+this.ref.scrollLeft,this.top=window.scrollY+l.top+d+l.height-this.ref.scrollTop,this.triggerIdx=s,this.renderMenu()}),0)}refreshMenu(){void 0!==this.triggerIdx&&null!==this.triggerIdx&&(this.ref===document.activeElement?this.triggerIdx&&this.menuRef.classList.remove("smart-hidden"):this.menuRef.classList.add("smart-hidden"),setTimeout((()=>{const e=this.ref.selectionStart,o=t(this.ref,e),{top:n,left:i}=this.ref.getBoundingClientRect();this.left=window.scrollX+o.left+i+this.ref.scrollLeft,this.top=window.scrollY+o.top+n+o.height-this.ref.scrollTop,this.menuRef.style.left=this.left+"px",this.menuRef.style.top=this.top+"px"})))}onKeyDown(e){let t=!1;if(void 0!==this.triggerIdx)switch(e.key){case"ArrowDown":this.active=Math.min(this.active+1,this.options.length-1),this.renderMenu(),t=!0;break;case"ArrowUp":this.active=Math.max(this.active-1,0),this.renderMenu(),t=!0;break;case"Enter":case"Tab":this.selectItem(this.active)(),t=!0}t&&e.preventDefault()}renderMenu(){return void 0===this.top?(this.menuRef.hidden=!0,void this.menuRef.classList.add("smart-hidden")):this.options.length?(this.menuRef.style.left=this.left+"px",this.menuRef.style.top=this.top+"px",this.menuRef.innerHTML="",this.ref===document.activeElement&&this.menuRef.classList.remove("smart-hidden"),this.options.forEach(((e,t)=>{this.menuRef.appendChild(this.menuItemFn(e,this.selectItem(t),this.active===t))})),this.menuRef.hidden=!1,void this.menuRef.classList.remove("smart-hidden")):(this.menuRef.hidden=!0,void this.menuRef.classList.add("smart-hidden"))}}})();
|
|
6
|
+
(()=>{Smart("smart-text-area",class extends Smart.Input{static get properties(){return{users:{value:[],type:"array",reflectToAttribute:!1},resize:{value:"none",type:"string"},richText:{value:!1,type:"boolean"},enableHTMLEncode:{value:!0,type:"boolean"},minWidth:{value:0,type:"number"},minHeight:{value:0,type:"number"},toolbarOnFocus:{value:!1,type:"boolean"},uploadSettings:{value:{url:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1},existsUrl:{value:"",type:"string",reflectToAttribute:!1},name:{value:"userfile[]",type:"string",reflectToAttribute:!1},uploadMaxCount:{value:5,type:"number",reflectToAttribute:!1},uploadMaxSize:{value:2097152,type:"number",reflectToAttribute:!1},data:{value:null,type:"object",reflectToAttribute:!1},onUploadStarted:{value:null,type:"any",reflectToAttribute:!1},onUploadCompleted:{value:null,type:"any",reflectToAttribute:!1},onUploadRemove:{value:null,type:"any",reflectToAttribute:!1},onUploadError:{value:null,type:"any",reflectToAttribute:!1},onChange:{value:null,type:"any",reflectToAttribute:!1},onProgress:{value:null,type:"any",reflectToAttribute:!1},onAbort:{value:null,type:"any",reflectToAttribute:!1},onError:{value:null,type:"any",reflectToAttribute:!1},onSetHeaders:{value:null,type:"any",reflectToAttribute:!1}},reflectToAttribute:!1,type:"object"},toolbarItems:{value:["bold","italic","underline","strikethrough","alignment","orderedlist","unorderedlist","checklist","hyperlink","image","tableheader"],reflectToAttribute:!1,type:"array"}}}template(){return'<div id="inputContainer" role="presentation"><textarea class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]"></textarea><div id="editor"></div><span class="smart-hidden smart-hint" inner-h-t-m-l="[[hint]]" id="span"></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>'}_blurHandler(){const e=this;e.richText?e.removeAttribute("focus"):super._blurHandler()}_focusHandler(){const e=this;e.richText&&(e.$.editor.component.focus(),setTimeout((()=>{const t=e.$.editor.value;e.$.editor.selectionStart=t.length}))),super._focusHandler()}setHTML(e){const t=this;if(t.richText)return t.$.editor.value=e;this.value=e.replaceAll("<","<").replaceAll(">",">")}getHTML(){const e=this;return e.richText?e.$.editor.component.getHTML():e.value}propertyChangedHandler(e,t,o){const n=this;"value"===e&&n.richText&&(n.$.editor.value=o),"users"===e?(delete n._initMenu,n._mentionMenu&&(n._mentionPlugin&&n._mentionPlugin.destroy(),n._mentionMenu.remove(),n._initUsersMention()),n._renderMentionTrigger()):"resize"===e&&(n.richText?n.$.editor.querySelector(".smart-editor-editable").style.resize=o:n.$.input.style.resize=o,n._mentionTrigger&&("none"!==n.resize?n._mentionTrigger.style.right="10px":n._mentionTrigger.style.right="5px"))}detached(){const e=this;delete e._initMenu,e._mentionMenu&&e._mentionMenu.remove()}findMatches(){const e=this.$.input.value.split("").concat([" "]),t=[];let o="";for(let n in e){let i=e[n],r=e[n-1]||" ",s=[" ","\\n"].indexOf(r)>-1||10===r.charCodeAt(0);("@"===i&&s||o.length)&&" "!==i&&(o+=i),o.length&&" "===i&&(t.push({word:o,index:Math.max(n-o.length,0)}),o="")}return t}getMentions(){const e=this,t=this.findMatches(),o=[];return t.forEach((t=>{e.users.forEach((e=>{const n=t.word.replace("@","");e.name===n&&o.push(e)}))})),o}_initUsersMention(){const e=this;if(e._initMenu)return;e._initMenu=!0;const t=document.createElement("div");t.id=e.id+"_mention_menu",t.classList.add("smart-text-area-mention-menu","smart-hidden"),e._mentionMenu=t,document.body.appendChild(t),e._mentionPlugin=new Smart.Mention(e.richText?e.$.editor:e.$.input,t,(t=>""===t?e.users:e.users.filter((e=>e.name.startsWith(t)))),((e,t)=>e?`${t}${e.name} `:""),((e,t,o)=>{const n=document.createElement("div");return n.setAttribute("role","option"),n.className="smart-text-area-mention-menu-item",o&&(n.classList.add("selected"),n.setAttribute("aria-selected","")),n.textContent=e.name,n.onpointerdown=e=>{e.preventDefault(),t()},n}))}_initRichText(e,t,o){const n=this,i=n,r={};if(!e)return;o||(o={bold:"Bold",italic:"Italic",underline:"Underline",striketrhough:"Strikethrough",alignment:"Alignment",unorderedlist:"Bulleted list",orderedlist:"Numbered list",checklist:"Checklist",paragraph:"Paragraph",format:"Format",image:"Image",h1:"Large Heading",h2:"Medium Heading",h3:"Small Heading",link:"Create link",code:"Code",openLink:"Ctrl + Click to open the link"});const s=`\n <div class="smart-container">\n <div class="smart-editor-toolbar"> \n <div style="height: auto;" class="smart-editor-toolbar-items-primary">\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.bold}" command="bold" item-name="bold"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.italic}" command="italic" item-name="italic"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.underline}" command="underline" item-name="underline"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.striketrhough}" command="strikethrough" item-name="strikethrough"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center smart-arrow-down" item-type="button" item-value="left" item-name="alignment" command="justify" tooltip="${o.alignment}"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.unorderedlist}" command="insertUnorderedList" item-name="unorderedlist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.orderedlist}" command="insertOrderedList" item-name="orderedlist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.checklist}" command="insertUnorderedList" item-name="checklist"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.link}" command="hyperlink" item-name="hyperlink"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.image}" command="image" item-name="image"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center smart-arrow-down" item-type="button" item-name="tableheader" tooltip="${o.format}"></div>\n </div>\n </div>\n <div class="smart-editor-content-container">\n <div class="smart-editor-editable" contenteditable="true"></div>\n </div>\n </div>\n `,a=e;a.className="smart-editor smart-rich-textarea",a.style.borderLeftWidth=a.style.borderTopWidth=a.style.borderRightWidth=a.style.borderBottomWidth="0px",a.innerHTML=s;const l=a.querySelector(".smart-editor-editable");l.style.resize=n.resize,n.style.minHeight=n.minHeight+"px",l.style.minHeight=n.minHeight+"px",l.style.minWidth=n.minWidth+"px",e.style.minHeight=n.minHeight+"px",e.style.minWidth=n.minWidth+"px";const d=a.querySelectorAll(".smart-editor-toolbar-item");for(let e=0;e<d.length;e++){const t=d[e],o=t.getAttribute("item-name");-1===n.toolbarItems.indexOf(o)&&t.classList.add("smart-hidden")}if(r.textarea=t,r.tools=[],r.toolbar=a.querySelector(".smart-editor-toolbar"),n.toolbarOnFocus){r.toolbar.id=n.id+"_toolbar";const e=document.createElement("div");e.classList.add("smart-editor"),e.classList.add("smart-editor-toolbar-float"),e.setAttribute("focus",""),e.appendChild(r.toolbar),a.querySelector(".smart-container").setAttribute("toolbar-on-focus",""),n.appendChild(e)}r.contentContainer=a.querySelector(".smart-editor-content-container");const m=document.createElement("div");m.className="smart-editor-tooltip",m.setAttribute("tooltip-position","bottom"),document.body.appendChild(m),r.tooltip=document.querySelector(".smart-editor-tooltip");new ResizeObserver((()=>{if("none"!==n.resize){if(n.style.width=parseInt(l.offsetWidth)+2+"px",n.toolbarOnFocus)return void(n.style.height=parseInt(l.offsetHeight)+2+"px");n.style.height=parseInt(l.offsetHeight)+r.toolbar.offsetHeight+2+"px"}})).observe(l);const c=[],u=(e,t)=>{const o=this,n=new FormData,i=o.uploadSettings.url;let r=!1;const s=files[0],a=o.uploadSettings.data;a&&""!==a&&("string"==typeof a?n.append("postData",a):n.append("postData",JSON.stringify(a))),n.append("fileType",fileType);for(let e=0;e<files.length;e++)n.append(o.uploadSettings.name,files[e]),r=!0;let l=new XMLHttpRequest;l.open("POST",i),o.uploadSettings.onSetHeaders&&"function"==typeof o.uploadSettings.onSetHeaders&&o.uploadSettings.onSetHeaders(l,s),o.uploadSettings.onUploadStarted&&o.uploadSettings.onUploadStarted({files,status:l.status}),l.upload.onprogress=function(e){o.uploadSettings.onProgress&&o.uploadSettings.onProgress(e)},l.onabort=function(e){o.uploadSettings.onAbort&&o.uploadSettings.onAbort(e)},l.onerror=function(e){o.uploadSettings.onError&&o.uploadSettings.onError(e)},l.onload=function(){let e=!1;if(l.response&&("string"==typeof l.response?(e=l.response,e.indexOf("[{")>=0&&(e=JSON.parse(l.response))):e=JSON.parse(l.response)),l.status>=200&&l.status<=299){const n=(e,t)=>{if(e.response&&e.response.response&&"success"!==e.response.response)return null;let o=!1;l.fileURL&&(o=l.file_url);let n={};e&&e.file_url?o=e.file_url:e&&e[0]&&e[0].file_url&&(o=e[0].file_url);let i=!1;e&&e.file_url_small?i=e.file_url_small:e&&e[0]&&e[0].file_url_small&&(i=e[0].file_url_small);let r=!1;e&&e.file_url_medium?r=e.file_url_medium:e&&e[0]&&e[0].file_url_medium&&(r=e[0].file_url_medium);let s=!1;return e&&e.file_url_large?s=e.file_url_large:e&&e[0]&&e[0].file_url_large&&(s=e[0].file_url_large),o&&(n.value=o),i&&(n.small=i),r&&(n.medium=r),s&&(n.large=s),n.label=t,n};for(let t=0;t<files.length;t++){const i=files[t].name?[]:files[t].split("/"),r="url"===fileType?i[i.length-1]:files[t].name;o.uploadSettings.url;const s=n((e.files||e[0]&&e[0].files||[e[0]])[t],r);s&&c.push(s)}t(c,e)}else t(c,e)},l.onreadystatechange=function(){},r&&l.send(n)};d.forEach((t=>{const i=t.getAttribute("item-name");r.tools[i]={element:t,type:"button"},t.onmouseenter=e=>{setTimeout((()=>{const t=e.target.getAttribute("tooltip"),o=e.target.getBoundingClientRect(),i=(r.toolbar.getBoundingClientRect(),e=>e?e.offsetTop+i(e.offsetParent):0),s=e=>e?e.offsetLeft+s(e.offsetParent):0,a=(l=e.target,{left:s(l),top:i(l)});var l;r.tooltip.style.top=5+a.top+o.height+"px",r.tooltip.setAttribute("hover-tooltip",t),r.tooltip.classList.add("open"),r.tooltip.style.left=a.left+o.width/2-r.tooltip.offsetWidth/2+"px",n._tooltipTimer&&clearTimeout(n._tooltipTimer),n._tooltipTimer=setTimeout((()=>{r.tooltip.classList.remove("open")}),1e3)}),150)},t.onmouseleave=()=>{r.tooltip.classList.remove("open")},t.onpointerdown=t=>{const i=t.target.getAttribute("item-name"),s=(t.target.getAttribute("item-value"),t.target.getAttribute("command")),l=t.target.getAttribute("command-value"),d=a.querySelector(".smart-editor-editable"),m=e=>{if(!e||"tableheader"===e){const e=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="tableheader"]'):a.querySelector('[item-name="tableheader"]');e._popup&&(e._popup.remove(),delete e._popup)}if(!e||"alignment"===e){const e=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="alignment"]'):a.querySelector('[item-name="alignment"]');e._popup&&(e._popup.remove(),delete e._popup)}};if("tableheader"!==i)if("alignment"!==i){switch(m(),t.target.hasAttribute("checked")?t.target.removeAttribute("checked"):t.target.setAttribute("checked",""),i){case"bold":case"italic":case"underline":case"strikethrough":case"unorderedlist":case"checklist":case"orderedlist":d.getRootNode().execCommand(s,!1,null);break;case"image":{const t=document.createElement("input");t.type="file",t.accept="image/jpeg, image/png, image/gif",t.hidden=!0,document.body.appendChild(t);r._getSelectionRange();d.getRootNode().execCommand("insertHTML",!1,'<img style="max-width: 100%;" class="smart-hidden" id="targetImage"/>'),t.click(),t.onchange=()=>{const o=d.getRootNode().getElementById("targetImage"),i=t.files[0];o.id="",o.classList.add("smart-hidden");const r=new FileReader;r.addEventListener("load",(function(){o.src=r.result,o.classList.remove("smart-hidden")})),i&&r.readAsDataURL(i),n.uploadSettings.uploadUrl&&u(0,(t=>{t&&t.length&&(o.src=t[0].medium||t[0].value,o.classList.remove("smart-hidden"),e.imgArray||(e.imgArray=[]),e.imgArrayId||(e.imgArrayId=[]),e.imgArray.push(o.src),e.imgArrayId[o.src]=t[0])}))};break}case"hyperlink":{const e=r._getSelectionRange();let t,n=e.startContainer;n&&"a"!==n.nodeName.toLowerCase()&&(n=n.parentElement);let i=!1;n&&"a"===n.nodeName.toLowerCase()?(t=n.textContent,i=!0):t=e.toString(),i?(n.remove(),d.getRootNode().execCommand("insertHTML",!1,t)):t&&(d.getRootNode().execCommand("insertHTML",!1,'<a title="'+o.openLink+'" href="https://'+t.trim()+'">'+t+"</a>"),setTimeout((()=>{let e=r._getSelectionRange().startContainer;e&&"a"!==e.nodeName.toLowerCase()&&(e=e.parentElement),e&&"a"===e.nodeName.toLowerCase()&&(e.onmouseenter=t=>{t.ctrlKey&&e.classList.add("ctrl")},e.onmousemove=t=>{t.ctrlKey&&e.classList.add("ctrl")},e.onmouseleave=()=>{e.classList.remove("ctrl")})}),50));break}case"h1":case"h2":case"h3":case"p":case"pre":case"justify":case"formats":d.getRootNode().execCommand(s,!1,l)}if("checklist"===i){const e=window.getSelection();if(e.focusNode){const t=e.focusNode.parentElement.closest("ul");t&&t.setAttribute("checklist","")}}t.preventDefault()}else{t.preventDefault(),m("tableheader");const e=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="alignment"]'):a.querySelector('[item-name="alignment"]');if(e._popup)e._popup.remove(),delete e._popup;else{e._popup=document.createElement("div");const t=e._popup;document.body.appendChild(t),t.style.position="absolute",t.style.height="auto",t.style.width="30px",t.style.background="var(--smart-background)",t.style.borderStyle="solid",t.style.borderWidth="1px",t.style.borderColor="var(--smart-border)",t.style.boxShadow="var(--smart-elevation-8)",t.style.zIndex=99999;const n=e.getBoundingClientRect();t.style.top=n.bottom+"px",t.style.left=n.left+"px",t.innerHTML=`\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.alignLeft}" command="justify" command-value="Left" item-name="alignment" item-value="left"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.alignCenter}" command="justify" command-value="Center" item-name="alignment" item-value="center"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.alignRight}" command="justify" command-value="Right" item-name="alignment" item-value="right"></div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.alignJustify}" command="justify" command-value="Full" item-name="alignment" item-value="justify"></div>\n `,t.querySelectorAll(".smart-button").forEach((t=>{t.onpointerdown=t=>{e._popup.remove(),delete e._popup;const o=t.target.getAttribute("command"),n=t.target.getAttribute("command-value");a.querySelector(".smart-editor-editable").getRootNode().execCommand(o+n,!1,null),t.preventDefault()}}))}}else{t.preventDefault(),m("alignment");const e=n.toolbarOnFocus?document.querySelector("#"+n.id+'_toolbar [item-name="tableheader"]'):a.querySelector('[item-name="tableheader"]');if(e._popup)e._popup.remove(),delete e._popup;else{e._popup=document.createElement("div");const t=e._popup;document.body.appendChild(t),t.style.position="absolute",t.style.height="auto",t.style.width="70px",t.style.background="var(--smart-background)",t.style.borderStyle="solid",t.style.borderWidth="1px",t.style.borderColor="var(--smart-border)",t.style.boxShadow="var(--smart-elevation-8)",t.style.zIndex=99999;const n=e.getBoundingClientRect();t.style.top=n.bottom+"px",t.style.left=n.left-20+"px",t.innerHTML=`\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.paragraph}" command="insertParagraph" command-value="p" item-name="p">P</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h1}" command="formatBlock" command-value="H1" item-name="h1">H1</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h2}" command="formatBlock" command-value="H2" item-name="h2">H2</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.h3}" command="formatBlock" command-value="H3" item-name="h3">H3</div>\n <div class="smart-button smart-editor-toolbar-item smart-editor-toolbar-item-center" item-type="button" tooltip="${o.code}" command="formatBlock" command-value="pre" item-name="pre">Code</div> \n `,t.querySelectorAll(".smart-button").forEach((t=>{t.onpointerdown=t=>{e._popup.remove(),delete e._popup;const o=t.target.getAttribute("command"),n=t.target.getAttribute("command-value");a.querySelector(".smart-editor-editable").getRootNode().execCommand(o,!1,n),t.preventDefault()}}))}}}}));const p=a.querySelector(".smart-editor-editable");r.content=p,r.content.innerHTML="<div>"+t.value+"​</div>";const h=(e,o)=>{const n=r;return void 0===e&&(e=t.value),e=!o&&n.enableHtmlEncode?e.replaceAll("<","<").replaceAll(">",">"):e.replaceAll("<","<").replaceAll(">",">")};e.component=r;const g=(e,t)=>{var o=t(e);for(e=e.firstChild;!1!==o&&e;e=e.nextSibling)o=g(e,t);return o};r.getCaretPosition=e=>{var t=window.getSelection(),o=[0,0];if(t.anchorNode===e)o=[t.anchorOffset,t.extentOffset];else{var n=[t.anchorNode,t.extentNode];if(!e.contains(t.anchorNode)||!e.contains(t.extentNode))return;var i,r=[0,0];g(e,(function(e){for(i=0;i<2;i++)if(e==n[i]&&(r[i]=!0,r[0==i?1:0]))return!1;if(e.textContent&&!e.firstChild)for(i=0;i<2;i++)r[i]||(o[i]+=e.textContent.length)})),o[0]+=t.anchorOffset,o[1]+=t.extentOffset}return o[0]<=o[1]?o:[o[1],o[0]]},r.setCaretPosition=e=>{if(e>=0){const t=window.getSelection(),o=(e,t,n)=>{if(n||((n=document.createRange()).selectNode(e),n.setStart(e,0)),0===t.count)n.setEnd(e,t.count);else if(e&&t.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<t.count?t.count-=e.textContent.length:(n.setEnd(e,t.count),t.count=0);else for(var i=0;i<e.childNodes.length&&(n=o(e.childNodes[i],t,n),0!==t.count);i++);return n},n=o(a.querySelector(".smart-editor-editable"),{count:e});n&&(n.collapse(!1),t.removeAllRanges(),t.addRange(n))}},r.execCommand=(e,t)=>{const o=p.getRootNode();o&&o.execCommand(e,!1,t)},Object.defineProperty(e,"selectionStart",{configurable:!1,enumerable:!0,get(){t.value=r.content.textContent;const e=r.getCaretPosition(r.content);return void 0!==e?e[1]:0},set(e){r.setCaretPosition(e)}}),Object.defineProperty(e,"value",{configurable:!1,enumerable:!0,get:()=>(t.value=r.content.textContent,r._getInputValue()),set(e){r.content.innerHTML!==e&&(r.content.innerHTML="<div>"+e+"​</div>",t.value=e,i.set("value",t.value,!1),r.setCaretPosition(r.content.textContent.length-1))}});return r._getSelectionRange=()=>{const e=r;return e._selectionRange||e._setSelectionRange(),e._selectionRange},r._setSelectionRange=(e,t,o)=>{const n=r;let i=a.querySelector(".smart-editor-editable");const s=window.getSelection();let l;if(e){if(l=document.createRange(),"number"==typeof t&&"number"==typeof o)try{l.setStart(e,parseInt(t)),l.setEnd(e,parseInt(o))}catch(t){l.selectNodeContents(e)}else"img"===e.nodeName.toLowerCase()||e.classList.contains("smart-editor-video-container")?(l.setStartBefore(e),l.setEndAfter(e),l.selectNode(e)):l.selectNodeContents(e);s.removeAllRanges(),s.addRange(l)}else s.rangeCount&&(l=s.getRangeAt(0));try{l&&l.startContainer&&i.contains(l.startContainer)&&(r._selectionRange=l)}catch(e){}n._selectionRange||(l=document.createRange(),l.selectNodeContents(i),l.collapse(!0),r._selectionRange=l)},r._getNodeFromList=(e,t)=>{const o=r.content;if(e&&t)for(;e&&e!==o;){const o=e.nodeName.toLocaleLowerCase();if(t.indexOf(o)>-1)return o;e=e.parentElement}},r._setItemValue=(e,t)=>{const o=r;let n=t.value;e&&t&&("button"===t.type?n?(e.setAttribute("checked",""),e.setAttribute("aria-pressed",!0)):(e.removeAttribute("checked"),e.setAttribute("aria-pressed",!1)):(n||"color-input"!==t.type?["fontname","formats"].indexOf(t.name)>-1&&(n=o.localize(t.value)||t.label||t.value):n="transparent",n?(e.setAttribute("item-value",n),e.style.setProperty("--item-value",n)):(e.removeAttribute("item-value"),e.style.removeProperty("--item-value"))))},r._getInputValue=h,r._updateToolbarItems=e=>{const t=r,o=t._getSelectionRange();if(!o)return;const n=t.content;let i,s=o.startOffset>o.endOffset?o.endContainer:o.startContainer;if(s&&(s.closest||(s=s.parentElement),s&&s.closest)){e||(e=["alignment","bold","hyperlink","italic","strikethrough","underline","fontsize","fontname","formats","fontcolor","backgroundcolor","orderedlist","unorderedlist","image","checklist","subscript","superscript","h1","h2","h3","code","pre"]);for(let o=0,r=e.length;o<r;o+=1){const r=e[o],a=t.tools[r];if(a){let e;if("alignment"===r)e=s.style.textAlign;else if("bold"===r)e=!!t._getNodeFromList(s,["b","strong","h4","h5","h6"]);else if("hyperlink"===r)e=!!t._getNodeFromList(s,["a"]);else if("h1"===r)e=!!t._getNodeFromList(s,["h1"]);else if("h2"===r)e=!!t._getNodeFromList(s,["h2"]);else if("h3"===r)e=!!t._getNodeFromList(s,["h3"]);else if("pre"===r)e=!!t._getNodeFromList(s,["pre"]);else if("p"===r)e=!!t._getNodeFromList(s,["p"]);else if("italic"===r)e=!!t._getNodeFromList(s,["i"]);else if("underline"===r)e=!!t._getNodeFromList(s,["u"]);else if("strikethrough"===r)e=!!t._getNodeFromList(s,["strike"]);else if("fontsize"===r){const t=s.closest(".smart-editor-editable font");t&&(e=t.style.fontSize),e||(i||(i=window.getComputedStyle(s)),e=i.fontSize),e=parseInt(e),isNaN(e)&&(e="")}else if("fontname"===r){const t=s.closest(".smart-editor-editable font");t&&t.hasAttribute("face")?e=t.getAttribute("face"):(i||(i=window.getComputedStyle(s)),e=i.fontFamily.split(",")[0])}else if("formats"===r&&s!==n){const o=["h1","h2","h3","p","pre"];if(e="",o){const n=o;e=t._getNodeFromList(s,n)||""}}else if("fontcolor"===r){const t=s.closest(".smart-editor-editable font");t?e=t.color:(i||(i=window.getComputedStyle(s)),e=i.color)}else if("backgroundcolor"===r)e=t._getNodeBackgroundColor(s),e||(i||(i=window.getComputedStyle(s)),e=i.backgroundColor);else if("orderedlist"===r||"unorderedlist"===r){e=!!s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);const t=s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);t&&t.parentElement&&t.parentElement.hasAttribute("checklist")&&(e=!1)}else if("checklist"===r){const t=s.closest(`.smart-editor-editable ${"orderedlist"===r?"ol":"ul"} li`);t&&t.parentElement.hasAttribute("checklist")&&(e=!0)}else"subscript"===r?e=!!s.closest(".smart-editor-editable sub"):"superscript"===r&&(e=!!s.closest(".smart-editor-editable sup"));if(!e&&a.dataSource){const t=a.dataSource[0];t&&(e=t.value||t)}null!==e&&(a.value=e,t._setItemValue(t.toolbar.querySelector(`.smart-editor-toolbar-item[item-name=${r}]`),a))}}}},r._getTextFromCarret=()=>{const e=r._getSelectionRange(),t=e.startContainer,o=t.textContent;let n,i;if(!e.toString()&&o.length>0&&o.indexOf(" ")>-1){const t=o.slice(0,e.startOffset).lastIndexOf(" ")+1;let r=o.slice(e.endOffset).indexOf(" ");r<0&&(r=o.length-1),n=t>-1?t:e.startOffset,i=Math.max(e.endOffset,e.endOffset+r)}else n=0,i=t.length;return{selectionStartIndex:n,selectionEndIndex:i}},r.focus=()=>{p.focus()},r.blur=()=>{p.blur()},r.getHTML=()=>h(r.content.innerHTML),p.onpointerup=e=>{const t=r,o=e.target;if(t._setSelectionRange(),t._updateToolbarItems(),e.ctrlKey){let e=t._getSelectionRange().startContainer;e&&"a"!==e.nodeName.toLowerCase()&&(e=e.parentElement),e&&"a"===e.nodeName.toLowerCase()&&window.open(e.href,"_blank")}if(o&&"LI"===o.nodeName&&o.closest("UL[checklist]")){const e=t._getSelectionRange();e&&0===e.startOffset&&0===e.endOffset&&(o.hasAttribute("checked")?o.removeAttribute("checked"):o.setAttribute("checked",""))}},p.onpaste=()=>{const e=r;e._setSelectionRange(),e._updateToolbarItems(),t.value=e.content.textContent,i.set("value",t.value,!1)},p.oninput=e=>{const o=r;o._setSelectionRange(),o._updateToolbarItems();const n=t.value;t.value=o.content.textContent,i.set("value",t.value,!1),i.$.fireEvent("input",{value:t.value,oldValue:n,html:r.getHTML()}),e.stopPropagation()},p.onkeydown=e=>{const t=r;t._setSelectionRange(),t._updateToolbarItems();let o=r._getSelectionRange().startContainer;o&&"a"!==o.nodeName.toLowerCase()&&(o=o.parentElement),o&&"a"===o.nodeName.toLowerCase()&&e.ctrlKey&&o.classList.add("ctrl")},p.onkeyup=()=>{const e=r;e._setSelectionRange(),e._updateToolbarItems(),t.value=e.content.textContent,i.set("value",t.value,!1)},p.onfocus=()=>{a.setAttribute("focus",""),i.toolbarOnFocus&&r.toolbar.parentElement.classList.add("show")},p.onblur=()=>{const o=r;a.removeAttribute("focus");const n=t.value;t.value=o.content.textContent,i.set("value",t.value,!1),i.toolbarOnFocus&&r.toolbar.parentElement.classList.remove("show"),r.tooltip.classList.remove("open"),i.$.fireEvent("change",{value:t.value,oldValue:n,html:r.getHTML()}),o.content.querySelector("img")&&i.uploadSettings.uploadUrl&&i.uploadSettings.removeUrl&&o.content.querySelectorAll("img").forEach((t=>{if(e.imgArray&&-1===e.imgArray.indexOf(t.src)&&e.uploadSettings.removeUrl){let o=new FormData,n=new XMLHttpRequest;if(o.append(e.uploadSettings.name,t.src),e.imgArrayId[t.src]){const n=e.imgArrayId[t.src].small,i=e.imgArrayId[t.src].medium,r=e.imgArrayId[t.src].large,s=e.imgArrayId[t.src].value;n&&o.append(e.uploadSettings.name+"_small",n),i&&o.append(e.uploadSettings.name+"_medium",i),r&&o.append(e.uploadSettings.name+"_large",r),s&&o.append(e.uploadSettings.name+"_value",s)}n.open("POST",e.uploadSettings.removeUrl),n.send(o)}}))},document.addEventListener("selectionchange",(e=>{const t=r;if(!e.target.getSelection)return;const o=e.target.getSelection().focusNode;t.contentContainer.contains(o)&&(t._setSelectionRange(),t._updateToolbarItems())})),r}render(){const e=this;if(super.render(),e.richText)e._initRichText(e.$.editor,e.$.input);else{new ResizeObserver((()=>{"none"!==e.resize&&(e.style.width=parseInt(e.$.input.offsetWidth)+2+"px",e.style.height=parseInt(e.$.input.offsetHeight)+2+"px")})).observe(e.$.input),e.$.input.style.resize=e.resize}e._initUsersMention(),e._renderMentionTrigger(),e.classList.add("smart-input")}_renderMentionTrigger(){const e=this;if(!this.richText&&e.users&&e.users.length){e.setAttribute("has-users","");const t=document.createElement("span");t.innerHTML="@",t.style.position="absolute",t.classList.add("smart-hidden"),t.classList.add("smart-mention-trigger"),t.style.bottom="3px","none"!==e.resize?t.style.right="10px":t.style.right="5px",t.style.cursor="pointer",t.onpointerdown=t=>{const o=this.$.input.selectionEnd,n=this.$.input.value.slice(0,o),i=this.$.input.value.substring(o);return e.richText?(e.$.editor.component.execCommand("insertHTML","@"),this.$.editor.dispatchEvent(new Event("input")),void t.preventDefault()):n.length>1&&n.substring(n.length-2).indexOf("@")>=0?(this.$.input.dispatchEvent(new Event("input")),void t.preventDefault()):(n.length>0?(this.$.input.value=n+" @"+i,this.$.input.selectionStart=this.$.input.selectionEnd=o+2):0===e.$.input.selectionStart&&(this.$.input.value=n+"@ "+i,this.$.input.selectionStart=this.$.input.selectionEnd=1),this.$.input.dispatchEvent(new Event("input")),void t.preventDefault())},e._mentionTrigger=t,e.addEventListener("focus",(()=>{t.classList.remove("smart-hidden"),e._mentionPlugin&&e._mentionPlugin.refreshMenu()})),e.addEventListener("blur",(()=>{t.classList.add("smart-hidden"),e._mentionPlugin&&e._mentionPlugin.refreshMenu()})),e.onmouseenter=()=>{t.classList.remove("smart-hidden")},e.onmouseleave=()=>{t.classList.add("smart-hidden")},e.$.inputContainer.appendChild(t)}}});const e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];function t(t,o){const n=document.createElement("div");document.body.appendChild(n);const i=n.style;let r=getComputedStyle(t);if(t.className.indexOf("smart-editor")>=0){const e=t.querySelector(".smart-editor-editable");r=getComputedStyle(e)}i.whiteSpace="pre-wrap",i.wordWrap="break-word",i.position="absolute",i.visibility="hidden",e.forEach((e=>{i[e]=r[e]})),i.overflow="hidden",n.textContent=t.value.substring(0,o);const s=document.createElement("span");s.textContent=t.value.substring(o)||".",n.appendChild(s);const a={top:s.offsetTop+parseInt(r.borderTopWidth),left:s.offsetLeft+parseInt(r.borderLeftWidth),height:s.offsetHeight};if(t.className.indexOf("smart-editor")>=0){const e=t.getBoundingClientRect(),o=window.getSelection().getRangeAt(0).getClientRects()[0];o&&e&&(a.left=o.left-e.left,a.top=o.top-e.top)}return n.remove(),a}Smart.Mention=class{constructor(e,t,o,n,i){this.ref=e,this.menuRef=t,this.resolveFn=o,this.replaceFn=n,this.menuItemFn=i,this.options=[],this.makeOptions=this.makeOptions.bind(this),this.closeMenu=this.closeMenu.bind(this),this.selectItem=this.selectItem.bind(this),this.onInput=this.onInput.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.renderMenu=this.renderMenu.bind(this),this.ref.addEventListener("input",this.onInput),this.ref.addEventListener("keydown",this.onKeyDown)}destroy(){this.ref.removeEventListener("input",this.onInput),this.ref.removeEventListener("keydown",this.onKeyDown)}async makeOptions(e){const t=await this.resolveFn(e);0!==t.lenght?(this.options=t,this.renderMenu()):this.closeMenu()}closeMenu(){setTimeout((()=>{this.options=[],this.left=void 0,this.top=void 0,this.triggerIdx=void 0,this.renderMenu()}),0)}selectItem(e){return()=>{const t=this.ref.value.substr(0,this.triggerIdx),o=this.options[e],n=this.replaceFn(o,this.ref.value[this.triggerIdx]),i=this.ref.value.substr(this.ref.selectionStart),r=`${t}${n}${i}`;-1!==this.ref.className.indexOf("smart-editor")?this.ref.component.execCommand("insertHTML",o.name):(this.ref.value=r,this.ref.ownerElement&&(this.ref.ownerElement.value=r));const s=this.ref.value.length-i.length;-1===this.ref.className.indexOf("smart-editor")?this.ref.setSelectionRange(s,s):this.ref.selectionStart=s,this.ref.dispatchEvent(new Event("input")),this.closeMenu(),this.ref.focus()}}onInput(e){const o=this.ref.selectionStart,n=this.ref.value.slice(0,o),i=n.split(/\s/),r=i[i.length-1],s=n.endsWith(r)?n.length-r.length:-1;if(!("@"===n[s]))return void this.closeMenu();const a=n.slice(s+1);this.makeOptions(a);const l=t(this.ref,o),{top:d,left:m}=this.ref.getBoundingClientRect();setTimeout((()=>{this.active=0,this.left=window.scrollX+l.left+m+this.ref.scrollLeft,this.top=window.scrollY+l.top+d+l.height-this.ref.scrollTop,this.triggerIdx=s,this.renderMenu()}),0)}refreshMenu(){void 0!==this.triggerIdx&&null!==this.triggerIdx&&(this.ref===document.activeElement?this.triggerIdx&&this.menuRef.classList.remove("smart-hidden"):this.menuRef.classList.add("smart-hidden"),setTimeout((()=>{const e=this.ref.selectionStart,o=t(this.ref,e),{top:n,left:i}=this.ref.getBoundingClientRect();this.left=window.scrollX+o.left+i+this.ref.scrollLeft,this.top=window.scrollY+o.top+n+o.height-this.ref.scrollTop,this.menuRef.style.left=this.left+"px",this.menuRef.style.top=this.top+"px"})))}onKeyDown(e){let t=!1;if(void 0!==this.triggerIdx)switch(e.key){case"ArrowDown":this.active=Math.min(this.active+1,this.options.length-1),this.renderMenu(),t=!0;break;case"ArrowUp":this.active=Math.max(this.active-1,0),this.renderMenu(),t=!0;break;case"Enter":case"Tab":this.selectItem(this.active)(),t=!0}t&&e.preventDefault()}renderMenu(){return void 0===this.top?(this.menuRef.hidden=!0,void this.menuRef.classList.add("smart-hidden")):this.options.length?(this.menuRef.style.left=this.left+"px",this.menuRef.style.top=this.top+"px",this.menuRef.innerHTML="",this.ref===document.activeElement&&this.menuRef.classList.remove("smart-hidden"),this.options.forEach(((e,t)=>{this.menuRef.appendChild(this.menuItemFn(e,this.selectItem(t),this.active===t))})),this.menuRef.hidden=!1,void this.menuRef.classList.remove("smart-hidden")):(this.menuRef.hidden=!0,void this.menuRef.classList.add("smart-hidden"))}}})();
|
package/source/smart.textbox.js
CHANGED
package/source/smart.toast.js
CHANGED
package/source/smart.tooltip.js
CHANGED