@web-atoms/web-controls 2.6.4 → 2.6.6
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/dist/tsconfig.tsbuildinfo +1 -1
- package/dist-esm/ArrayLike.js +14 -12
- package/dist-esm/DataAttributes.js +18 -19
- package/dist-esm/Focusable.js +10 -11
- package/dist-esm/ModuleFiles.js +43 -42
- package/dist-esm/NumberFormats.js +60 -56
- package/dist-esm/PageNavigator.js +28 -30
- package/dist-esm/animations/Animations.global.css +2 -0
- package/dist-esm/animations/Animations.global.css.map +1 -0
- package/dist-esm/animations/Animations.js +36 -33
- package/dist-esm/basic/AtomChips.js +312 -305
- package/dist-esm/basic/AtomRepeater.js +1070 -1035
- package/dist-esm/basic/AtomSuggestions.js +97 -107
- package/dist-esm/basic/AttachedPopup.js +0 -1
- package/dist-esm/basic/Button.js +45 -19
- package/dist-esm/basic/Button.local.css +2 -0
- package/dist-esm/basic/Button.local.css.map +1 -0
- package/dist-esm/basic/ButtonBar.global.css +2 -0
- package/dist-esm/basic/ButtonBar.global.css.map +1 -0
- package/dist-esm/basic/ButtonBar.js +84 -64
- package/dist-esm/basic/Calendar.js +211 -203
- package/dist-esm/basic/CheckBoxList.js +90 -70
- package/dist-esm/basic/Checkbox.js +16 -8
- package/dist-esm/basic/Chip.js +36 -12
- package/dist-esm/basic/ComboBox.js +47 -51
- package/dist-esm/basic/DataGrid.js +258 -252
- package/dist-esm/basic/DateField.js +149 -127
- package/dist-esm/basic/DropDown.js +91 -103
- package/dist-esm/basic/DropDownInput.global.css +2 -0
- package/dist-esm/basic/DropDownInput.global.css.map +1 -0
- package/dist-esm/basic/DropDownInput.js +78 -106
- package/dist-esm/basic/Editable.js +82 -77
- package/dist-esm/basic/Expander.js +104 -86
- package/dist-esm/basic/FilesDragDrop.global.css +2 -0
- package/dist-esm/basic/FilesDragDrop.global.css.map +1 -0
- package/dist-esm/basic/FilesDragDrop.js +84 -80
- package/dist-esm/basic/Form.js +80 -52
- package/dist-esm/basic/FormField.js +164 -106
- package/dist-esm/basic/IElement.js +1 -2
- package/dist-esm/basic/InlinePopup.js +263 -234
- package/dist-esm/basic/InlinePopupButton.js +99 -88
- package/dist-esm/basic/InlinePopupControl.js +24 -23
- package/dist-esm/basic/ItemPath.js +59 -60
- package/dist-esm/basic/LimitedText.js +49 -38
- package/dist-esm/basic/ListRepeater.js +13 -14
- package/dist-esm/basic/MaskedInput.js +37 -29
- package/dist-esm/basic/MaskedInputDiv.js +55 -48
- package/dist-esm/basic/MergeNode.js +64 -35
- package/dist-esm/basic/PasswordBox.js +32 -17
- package/dist-esm/basic/PinchZoomView.js +221 -199
- package/dist-esm/basic/PopupButton.js +39 -16
- package/dist-esm/basic/PopupMenu.js +3 -4
- package/dist-esm/basic/RadioButtonList.js +35 -25
- package/dist-esm/basic/RefreshLock.js +41 -42
- package/dist-esm/basic/Resizable.js +43 -33
- package/dist-esm/basic/Select.js +72 -65
- package/dist-esm/basic/SortByButton.global.css +2 -0
- package/dist-esm/basic/SortByButton.global.css.map +1 -0
- package/dist-esm/basic/SortByButton.js +41 -31
- package/dist-esm/basic/Swipe.js +91 -84
- package/dist-esm/basic/Switch.js +22 -8
- package/dist-esm/basic/TableRepeater.js +29 -33
- package/dist-esm/basic/TimeEditor.js +97 -52
- package/dist-esm/basic/TitleEditor.js +115 -95
- package/dist-esm/basic/ToggleButtonBar.js +21 -22
- package/dist-esm/basic/Tooltip.js +49 -47
- package/dist-esm/basic/TypeWriter.js +45 -42
- package/dist-esm/basic/UploadEvent.js +211 -178
- package/dist-esm/basic/ZoomView.js +229 -198
- package/dist-esm/basic/combineClasses.js +2 -3
- package/dist-esm/basic/elements/AtomPopover.css +2 -0
- package/dist-esm/basic/elements/AtomPopover.css.map +1 -0
- package/dist-esm/basic/elements/AtomPopover.js +270 -253
- package/dist-esm/basic/elements/getContainingBlock.js +34 -35
- package/dist-esm/basic/elements/relativeRect.js +40 -21
- package/dist-esm/basic/styles/calendar.global.css +2 -0
- package/dist-esm/basic/styles/calendar.global.css.map +1 -0
- package/dist-esm/basic/styles/check-box-list.global.css +2 -0
- package/dist-esm/basic/styles/check-box-list.global.css.map +1 -0
- package/dist-esm/basic/styles/checkbox.global.css +2 -0
- package/dist-esm/basic/styles/checkbox.global.css.map +1 -0
- package/dist-esm/basic/styles/chip.global.css +2 -0
- package/dist-esm/basic/styles/chip.global.css.map +1 -0
- package/dist-esm/basic/styles/chips.global.css +2 -0
- package/dist-esm/basic/styles/chips.global.css.map +1 -0
- package/dist-esm/basic/styles/data-grid.global.css +2 -0
- package/dist-esm/basic/styles/data-grid.global.css.map +1 -0
- package/dist-esm/basic/styles/date-field.global.css +2 -0
- package/dist-esm/basic/styles/date-field.global.css.map +1 -0
- package/dist-esm/basic/styles/drop-down.global.css +2 -0
- package/dist-esm/basic/styles/drop-down.global.css.map +1 -0
- package/dist-esm/basic/styles/expander.global.css +2 -0
- package/dist-esm/basic/styles/expander.global.css.map +1 -0
- package/dist-esm/basic/styles/form-field.global.css +2 -0
- package/dist-esm/basic/styles/form-field.global.css.map +1 -0
- package/dist-esm/basic/styles/inline-popup.global.css +2 -0
- package/dist-esm/basic/styles/inline-popup.global.css.map +1 -0
- package/dist-esm/basic/styles/item-suggestion.global.css +2 -0
- package/dist-esm/basic/styles/item-suggestion.global.css.map +1 -0
- package/dist-esm/basic/styles/list-repeater.global.css +2 -0
- package/dist-esm/basic/styles/list-repeater.global.css.map +1 -0
- package/dist-esm/basic/styles/masked-input.global.css +2 -0
- package/dist-esm/basic/styles/masked-input.global.css.map +1 -0
- package/dist-esm/basic/styles/password-box.global.css +2 -0
- package/dist-esm/basic/styles/password-box.global.css.map +1 -0
- package/dist-esm/basic/styles/pinch-zoom-view.global.css +2 -0
- package/dist-esm/basic/styles/pinch-zoom-view.global.css.map +1 -0
- package/dist-esm/basic/styles/popup-button.global.css +2 -0
- package/dist-esm/basic/styles/popup-button.global.css.map +1 -0
- package/dist-esm/basic/styles/popup.global.css +2 -0
- package/dist-esm/basic/styles/popup.global.css.map +1 -0
- package/dist-esm/basic/styles/radio-button-list.global.css +2 -0
- package/dist-esm/basic/styles/radio-button-list.global.css.map +1 -0
- package/dist-esm/basic/styles/repeater.global.css +2 -0
- package/dist-esm/basic/styles/repeater.global.css.map +1 -0
- package/dist-esm/basic/styles/scale.svg +4 -0
- package/dist-esm/basic/styles/suggestion-popup.global.css +2 -0
- package/dist-esm/basic/styles/suggestion-popup.global.css.map +1 -0
- package/dist-esm/basic/styles/suggestion.global.css +2 -0
- package/dist-esm/basic/styles/suggestion.global.css.map +1 -0
- package/dist-esm/basic/styles/swipe.global.css +2 -0
- package/dist-esm/basic/styles/swipe.global.css.map +1 -0
- package/dist-esm/basic/styles/switch.global.css +2 -0
- package/dist-esm/basic/styles/switch.global.css.map +1 -0
- package/dist-esm/basic/styles/time-editor.global.css +2 -0
- package/dist-esm/basic/styles/time-editor.global.css.map +1 -0
- package/dist-esm/basic/styles/title-editor.global.css +2 -0
- package/dist-esm/basic/styles/title-editor.global.css.map +1 -0
- package/dist-esm/basic/styles/toggle-button-bar.global.css +2 -0
- package/dist-esm/basic/styles/toggle-button-bar.global.css.map +1 -0
- package/dist-esm/basic/styles/toggle-view.global.css +2 -0
- package/dist-esm/basic/styles/toggle-view.global.css.map +1 -0
- package/dist-esm/basic/styles/tooltip.global.css +2 -0
- package/dist-esm/basic/styles/tooltip.global.css.map +1 -0
- package/dist-esm/basic/styles/zoom-view.global.css +2 -0
- package/dist-esm/basic/styles/zoom-view.global.css.map +1 -0
- package/dist-esm/desktop-app/DesktopApp.js +65 -80
- package/dist-esm/desktop-app/MobileDesktopApp.js +20 -23
- package/dist-esm/html-editor/AtomHtmlEditor.js +243 -268
- package/dist-esm/html-editor/HtmlEditorCommands.js +6 -4
- package/dist-esm/html-editor/InlineHtmlEditor.js +174 -166
- package/dist-esm/html-editor/RangeEditor.js +49 -51
- package/dist-esm/html-editor/commands/AddImage.js +40 -35
- package/dist-esm/html-editor/commands/AddLink.js +56 -54
- package/dist-esm/html-editor/commands/AddLink.local.css +2 -0
- package/dist-esm/html-editor/commands/AddLink.local.css.map +1 -0
- package/dist-esm/html-editor/commands/Align.js +24 -7
- package/dist-esm/html-editor/commands/AttachFile.js +23 -13
- package/dist-esm/html-editor/commands/AttachImage.js +35 -25
- package/dist-esm/html-editor/commands/Bold.js +10 -11
- package/dist-esm/html-editor/commands/ChangeColor.js +31 -107
- package/dist-esm/html-editor/commands/ChangeColor.local.css +2 -0
- package/dist-esm/html-editor/commands/ChangeColor.local.css.map +1 -0
- package/dist-esm/html-editor/commands/ChangeFont.js +42 -42
- package/dist-esm/html-editor/commands/ChangeFont.local.css +2 -0
- package/dist-esm/html-editor/commands/ChangeFont.local.css.map +1 -0
- package/dist-esm/html-editor/commands/ChangeFontSize.js +15 -5
- package/dist-esm/html-editor/commands/Command.js +34 -16
- package/dist-esm/html-editor/commands/CommandButton.js +51 -32
- package/dist-esm/html-editor/commands/Headings.js +25 -9
- package/dist-esm/html-editor/commands/HorizontalRule.js +9 -10
- package/dist-esm/html-editor/commands/HtmlCommands.js +160 -65
- package/dist-esm/html-editor/commands/IndentLess.js +10 -11
- package/dist-esm/html-editor/commands/IndentMore.js +10 -11
- package/dist-esm/html-editor/commands/Italic.js +10 -11
- package/dist-esm/html-editor/commands/NumberedList.js +10 -11
- package/dist-esm/html-editor/commands/Quote.js +10 -11
- package/dist-esm/html-editor/commands/RemoveFormat.js +10 -11
- package/dist-esm/html-editor/commands/Separator.global.css +2 -0
- package/dist-esm/html-editor/commands/Separator.global.css.map +1 -0
- package/dist-esm/html-editor/commands/Separator.js +5 -4
- package/dist-esm/html-editor/commands/Source.js +29 -25
- package/dist-esm/html-editor/commands/Source.local.css +2 -0
- package/dist-esm/html-editor/commands/Source.local.css.map +1 -0
- package/dist-esm/html-editor/commands/StrikeThrough.js +10 -11
- package/dist-esm/html-editor/commands/Toolbar.js +6 -4
- package/dist-esm/html-editor/commands/Underline.js +10 -11
- package/dist-esm/html-editor/commands/Unlink.js +10 -9
- package/dist-esm/html-editor/commands/UnorderedList.js +10 -11
- package/dist-esm/mobile-app/BottomPopup.js +137 -148
- package/dist-esm/mobile-app/MasterDetailPage.global.css +2 -0
- package/dist-esm/mobile-app/MasterDetailPage.global.css.map +1 -0
- package/dist-esm/mobile-app/MasterDetailPage.js +153 -152
- package/dist-esm/mobile-app/MobileApp.global.css +2 -0
- package/dist-esm/mobile-app/MobileApp.global.css.map +1 -0
- package/dist-esm/mobile-app/MobileApp.js +577 -569
- package/dist-esm/mobile-app/bottom-popup.global.css +2 -0
- package/dist-esm/mobile-app/bottom-popup.global.css.map +1 -0
- package/dist-esm/player/AtomVideoPlayer.global.css +2 -0
- package/dist-esm/player/AtomVideoPlayer.global.css.map +1 -0
- package/dist-esm/player/AtomVideoPlayer.js +316 -270
- package/dist-esm/player/TrackProgress.js +11 -7
- package/dist-esm/player/input-range-style.js +97 -98
- package/dist-esm/styles/atom-html-editor.global.css +2 -0
- package/dist-esm/styles/atom-html-editor.global.css.map +1 -0
- package/dist-esm/styles/button-bar.global.css +2 -0
- package/dist-esm/styles/button-bar.global.css.map +1 -0
- package/dist-esm/styles/desktop-app.global.css +2 -0
- package/dist-esm/styles/desktop-app.global.css.map +1 -0
- package/dist-esm/styles/form.global.css +2 -0
- package/dist-esm/styles/form.global.css.map +1 -0
- package/dist-esm/styles/html-editor-toolbar.global.css +2 -0
- package/dist-esm/styles/html-editor-toolbar.global.css.map +1 -0
- package/dist-esm/styles/inline-html-editor.global.css +2 -0
- package/dist-esm/styles/inline-html-editor.global.css.map +1 -0
- package/dist-esm/styles/limited-text.global.css +2 -0
- package/dist-esm/styles/limited-text.global.css.map +1 -0
- package/dist-esm/styles/resizable.global.css +2 -0
- package/dist-esm/styles/resizable.global.css.map +1 -0
- package/dist-esm/styles/track-progress.global.css +2 -0
- package/dist-esm/styles/track-progress.global.css.map +1 -0
- package/dist-esm/styles/type-writer.global.css +2 -0
- package/dist-esm/styles/type-writer.global.css.map +1 -0
- package/dist-esm/tests/app-test/AppTestApp.js +12 -15
- package/dist-esm/tests/app-test/AppTestApp.pack.js +54 -0
- package/dist-esm/tests/app-test/commands/AppCommands.js +14 -11
- package/dist-esm/tests/app-test/drawer/AppDrawer.js +4 -6
- package/dist-esm/tests/app-test/model/model.js +1 -2
- package/dist-esm/tests/app-test/pages/detail/DetailPage.js +21 -15
- package/dist-esm/tests/app-test/pages/home/HomePage.js +7 -8
- package/dist-esm/tests/app-test/pages/list/ListPage.js +79 -62
- package/dist-esm/tests/app-test/pages/list/ListPage.local.css +2 -0
- package/dist-esm/tests/app-test/pages/list/ListPage.local.css.map +1 -0
- package/dist-esm/tests/basic/PopupTest.js +9 -7
- package/dist-esm/tests/basic/TimeEditorTest.js +5 -9
- package/dist-esm/tests/basic/TimeEditorTest.pack.js +39 -0
- package/dist-esm/tests/basic/TimerTest.js +27 -37
- package/dist-esm/tests/basic/TimerTest.pack.js +40 -0
- package/dist-esm/tests/basic/basic-form/BasicForm.js +47 -27
- package/dist-esm/tests/basic/basic-form/BasicForm.pack.js +44 -0
- package/dist-esm/tests/basic/calendar/BasicCalendarTest.js +5 -9
- package/dist-esm/tests/basic/calendar/BasicCalendarTest.pack.js +53 -0
- package/dist-esm/tests/basic/chips/ChipsTest.js +25 -15
- package/dist-esm/tests/basic/chips/ChipsTest.local.css +2 -0
- package/dist-esm/tests/basic/chips/ChipsTest.local.css.map +1 -0
- package/dist-esm/tests/basic/chips/ChipsTest.pack.js +56 -0
- package/dist-esm/tests/basic/data-grid/DataGridTest.js +55 -60
- package/dist-esm/tests/basic/data-grid/DataGridTest.pack.js +58 -0
- package/dist-esm/tests/basic/date/DateFieldTest.js +21 -96
- package/dist-esm/tests/basic/date/DateFieldTest.pack.js +57 -0
- package/dist-esm/tests/basic/drop-down/DropDownTest.js +25 -19
- package/dist-esm/tests/basic/drop-down/DropDownTest.pack.js +52 -0
- package/dist-esm/tests/basic/drop-down-input/DropDownTest.js +32 -32
- package/dist-esm/tests/basic/drop-down-input/DropDownTest.pack.js +54 -0
- package/dist-esm/tests/basic/expander/ExpanderMenuTest.js +20 -14
- package/dist-esm/tests/basic/expander/ExpanderMenuTest.pack.js +38 -0
- package/dist-esm/tests/basic/expander/ExpanderTest.js +11 -12
- package/dist-esm/tests/basic/expander/ExpanderTest.pack.js +38 -0
- package/dist-esm/tests/basic/form2/Form2Test.js +26 -24
- package/dist-esm/tests/basic/form2/Form2Test.pack.js +46 -0
- package/dist-esm/tests/basic/limited-text/LimitedTextTest.js +14 -11
- package/dist-esm/tests/basic/limited-text/LimitedTextTest.pack.js +38 -0
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.global.css +2 -0
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.global.css.map +1 -0
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.js +14 -14
- package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.pack.js +38 -0
- package/dist-esm/tests/basic/repeater/DragDropRepater.js +30 -12
- package/dist-esm/tests/basic/repeater/DragDropRepater.pack.js +51 -0
- package/dist-esm/tests/basic/repeater/RepeaterTest.js +45 -35
- package/dist-esm/tests/basic/repeater/RepeaterTest.pack.js +52 -0
- package/dist-esm/tests/basic/swipe/SwipeTest.js +13 -13
- package/dist-esm/tests/basic/swipe/SwipeTest.local.css +2 -0
- package/dist-esm/tests/basic/swipe/SwipeTest.local.css.map +1 -0
- package/dist-esm/tests/basic/swipe/SwipeTest.pack.js +52 -0
- package/dist-esm/tests/basic/switch-test/SwitchTest.js +8 -10
- package/dist-esm/tests/basic/switch-test/SwitchTest.pack.js +38 -0
- package/dist-esm/tests/basic/title-editor/TitleEditorTest.js +8 -9
- package/dist-esm/tests/basic/title-editor/TitleEditorTest.pack.js +38 -0
- package/dist-esm/tests/basic/tooltip/TooltipTest.js +30 -24
- package/dist-esm/tests/basic/tooltip/TooltipTest.pack.js +52 -0
- package/dist-esm/tests/basic/typewriter/TypeWriter.js +10 -9
- package/dist-esm/tests/basic/typewriter/TypeWriter.pack.js +39 -0
- package/dist-esm/tests/basic/video/AtomVideoTest.js +13 -10
- package/dist-esm/tests/basic/video/AtomVideoTest.local.css +2 -0
- package/dist-esm/tests/basic/video/AtomVideoTest.local.css.map +1 -0
- package/dist-esm/tests/basic/video/AtomVideoTest.pack.js +38 -0
- package/dist-esm/tests/basic/zoom/ZoomViewTest.js +13 -13
- package/dist-esm/tests/basic/zoom/ZoomViewTest.local.css +2 -0
- package/dist-esm/tests/basic/zoom/ZoomViewTest.local.css.map +1 -0
- package/dist-esm/tests/basic/zoom/ZoomViewTest.pack.js +38 -0
- package/dist-esm/tests/check-box-list/CheckBoxListSample.js +13 -12
- package/dist-esm/tests/check-box-list/CheckBoxListSample.pack.js +52 -0
- package/dist-esm/tests/data-grid/GridTestViewModel.js +203 -227
- package/dist-esm/tests/form/CustomHelp.js +6 -9
- package/dist-esm/tests/form/FormViewModel.js +21 -28
- package/dist-esm/tests/html-editor/HtmlEditorTest.js +7 -37
- package/dist-esm/tests/html-editor/HtmlEditorTest.pack.js +83 -0
- package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.js +9 -38
- package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.pack.js +85 -0
- package/dist-esm/tests/mask/MaskedInputTest.js +11 -12
- package/dist-esm/tests/mask/MaskedInputTest.pack.js +38 -0
- package/dist-esm/tests/mobile-app/DesktopAppTest.js +8 -9
- package/dist-esm/tests/mobile-app/DesktopAppTest.pack.js +60 -0
- package/dist-esm/tests/mobile-app/MobileAppTest.js +64 -53
- package/dist-esm/tests/mobile-app/MobileAppTest.pack.js +55 -0
- package/dist-esm/tests/pop-over/PopOverTest.js +37 -77
- package/dist-esm/tests/switch/SwitchTest.js +9 -8
- package/dist-esm/tests/toggle-view/ToggleView.local.css +2 -0
- package/dist-esm/tests/toggle-view/ToggleView.local.css.map +1 -0
- package/dist-esm/tests/toggle-view/ToggleViewTest.js +15 -22
- package/dist-esm/tests/toggle-view/ToggleViewTest.pack.js +45 -0
- package/dist-esm/toggle-view/AtomToggleView.js +77 -73
- package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -4,116 +4,88 @@ import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
|
4
4
|
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
5
5
|
import { askSuggestionPopup, MatchAnyCaseInsensitive } from "./AtomRepeater.js";
|
|
6
6
|
import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty.js";
|
|
7
|
-
import
|
|
7
|
+
ESMPack.installStyleSheet(import.meta.resolve("./DropDownInput.global.css"));
|
|
8
8
|
export default class DropDownInput extends AtomControl {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
break;
|
|
9
|
+
constructor(app, e = document.createElement("drop-down-input")) {
|
|
10
|
+
super(app, e);
|
|
11
|
+
}
|
|
12
|
+
onPropertyChanged(name) {
|
|
13
|
+
super.onPropertyChanged(name);
|
|
14
|
+
switch (name) {
|
|
15
|
+
case "search":
|
|
16
|
+
if (this.search) {
|
|
17
|
+
this.openPopup().catch(console.error);
|
|
20
18
|
}
|
|
19
|
+
break;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
}
|
|
22
|
+
preCreate() {
|
|
23
|
+
this.items = null;
|
|
24
|
+
this.value = null;
|
|
25
|
+
this.selectedItem = null;
|
|
26
|
+
this.labelPath = x => x?.label ?? x;
|
|
27
|
+
this.valuePath = x => x?.value ?? x;
|
|
28
|
+
this.itemRenderer = x => XNode.create("div", {
|
|
29
|
+
text: this.labelPath?.(x) ?? x
|
|
30
|
+
});
|
|
31
|
+
this.search = "";
|
|
32
|
+
this.label = "";
|
|
33
|
+
this.isPopupOpen = false;
|
|
34
|
+
this.disableSearch = true;
|
|
35
|
+
this.render(XNode.create("div", {
|
|
36
|
+
"event-click": () => this.input.focus()
|
|
37
|
+
}, XNode.create("input", {
|
|
38
|
+
autofocus: Bind.oneTime(() => this.autofocus),
|
|
39
|
+
"event-focus": () => this.onFocus(),
|
|
40
|
+
value: Bind.twoWaysImmediate(() => this.search)
|
|
41
|
+
}), XNode.create("label", {
|
|
42
|
+
text: Bind.oneWay(x => this.labelPath(this.items?.find(i => this.valuePath(i) === this.value)))
|
|
43
|
+
}), XNode.create("i", null)));
|
|
44
|
+
this.input = this.element.querySelector("input");
|
|
45
|
+
this.labelElement = this.element.querySelector("label");
|
|
46
|
+
}
|
|
47
|
+
onFocus() {
|
|
48
|
+
const value = this.value;
|
|
49
|
+
if (value) {
|
|
50
|
+
const item = this.items.find(i => this.valuePath?.(i) == value);
|
|
51
|
+
this.input.placeholder = item ? this.labelPath(item) : this.label;
|
|
39
52
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.input.value = "";
|
|
47
|
-
this.app.runAsync(() => this.openPopup());
|
|
53
|
+
this.input.value = "";
|
|
54
|
+
this.app.runAsync(() => this.openPopup());
|
|
55
|
+
}
|
|
56
|
+
async openPopup() {
|
|
57
|
+
if (this.isPopupOpen) {
|
|
58
|
+
return;
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.input.placeholder = this.label;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
finally {
|
|
71
|
-
this.isPopupOpen = false;
|
|
72
|
-
}
|
|
60
|
+
this.isPopupOpen = true;
|
|
61
|
+
try {
|
|
62
|
+
let selectedItem = this.items.find(i => this.value === (this.valuePath?.(i) ?? i));
|
|
63
|
+
this.anchorItem = selectedItem;
|
|
64
|
+
this.selectedItem = selectedItem;
|
|
65
|
+
const newItem = await askSuggestionPopup(this, this.items, this.itemRenderer, this.match ?? MatchAnyCaseInsensitive(this.labelPath), selectedItem);
|
|
66
|
+
if (newItem !== selectedItem) {
|
|
67
|
+
this.selectedItem = selectedItem;
|
|
68
|
+
this.value = this.valuePath?.(newItem) ?? newItem;
|
|
69
|
+
this.element.dispatchEvent(new CustomEvent("selectionChanged", {
|
|
70
|
+
bubbles: true,
|
|
71
|
+
detail: newItem,
|
|
72
|
+
cancelable: true
|
|
73
|
+
}));
|
|
74
|
+
this.input.placeholder = this.label;
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
this.isPopupOpen = false;
|
|
73
78
|
}
|
|
79
|
+
}
|
|
74
80
|
}
|
|
75
|
-
__decorate([
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
], DropDownInput.prototype, "
|
|
79
|
-
__decorate([
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
], DropDownInput.prototype, "
|
|
83
|
-
__decorate([
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
], DropDownInput.prototype, "prompt", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
BindableProperty,
|
|
89
|
-
__metadata("design:type", String)
|
|
90
|
-
], DropDownInput.prototype, "suggestionPrompt", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
BindableProperty,
|
|
93
|
-
__metadata("design:type", Boolean)
|
|
94
|
-
], DropDownInput.prototype, "autofocus", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
BindableProperty,
|
|
97
|
-
__metadata("design:type", Function)
|
|
98
|
-
], DropDownInput.prototype, "itemRenderer", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
BindableProperty,
|
|
101
|
-
__metadata("design:type", Function)
|
|
102
|
-
], DropDownInput.prototype, "labelPath", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
BindableProperty,
|
|
105
|
-
__metadata("design:type", Function)
|
|
106
|
-
], DropDownInput.prototype, "valuePath", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
BindableProperty,
|
|
109
|
-
__metadata("design:type", Function)
|
|
110
|
-
], DropDownInput.prototype, "match", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
BindableProperty,
|
|
113
|
-
__metadata("design:type", Function)
|
|
114
|
-
], DropDownInput.prototype, "suggestionRenderer", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
BindableProperty,
|
|
117
|
-
__metadata("design:type", Object)
|
|
118
|
-
], DropDownInput.prototype, "selectedItem", void 0);
|
|
119
|
-
//# sourceMappingURL=DropDownInput.js.map
|
|
81
|
+
__decorate([BindableProperty, __metadata("design:type", Boolean)], DropDownInput.prototype, "popupSuggestions", void 0);
|
|
82
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDownInput.prototype, "search", void 0);
|
|
83
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDownInput.prototype, "prompt", void 0);
|
|
84
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDownInput.prototype, "suggestionPrompt", void 0);
|
|
85
|
+
__decorate([BindableProperty, __metadata("design:type", Boolean)], DropDownInput.prototype, "autofocus", void 0);
|
|
86
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDownInput.prototype, "itemRenderer", void 0);
|
|
87
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDownInput.prototype, "labelPath", void 0);
|
|
88
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDownInput.prototype, "valuePath", void 0);
|
|
89
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDownInput.prototype, "match", void 0);
|
|
90
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDownInput.prototype, "suggestionRenderer", void 0);
|
|
91
|
+
__decorate([BindableProperty, __metadata("design:type", Object)], DropDownInput.prototype, "selectedItem", void 0);
|
|
@@ -1,91 +1,96 @@
|
|
|
1
1
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
2
2
|
import { getParentRepeaterItem } from "./AtomRepeater.js";
|
|
3
3
|
export function getPropertyInfo(propertyPath) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (item) {
|
|
10
|
-
item[propertyPath] = value;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
if (!Array.isArray(propertyPath)) {
|
|
16
|
-
return propertyPath;
|
|
17
|
-
}
|
|
18
|
-
const last = propertyPath.pop();
|
|
19
|
-
let getterIntermediate;
|
|
20
|
-
if (propertyPath.length > 0) {
|
|
21
|
-
getterIntermediate = (item) => {
|
|
22
|
-
if (!item) {
|
|
23
|
-
return item;
|
|
24
|
-
}
|
|
25
|
-
for (const iterator of propertyPath) {
|
|
26
|
-
item = item[iterator];
|
|
27
|
-
if (!item) {
|
|
28
|
-
return item;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return item;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const setter = (item, value) => {
|
|
4
|
+
if (typeof propertyPath === "string") {
|
|
5
|
+
return {
|
|
6
|
+
key: propertyPath,
|
|
7
|
+
getter: item => item?.[propertyPath],
|
|
8
|
+
setter: (item, value) => {
|
|
35
9
|
if (item) {
|
|
36
|
-
|
|
37
|
-
item = getterIntermediate(item);
|
|
38
|
-
}
|
|
39
|
-
if (item) {
|
|
40
|
-
item[last] = value;
|
|
41
|
-
}
|
|
10
|
+
item[propertyPath] = value;
|
|
42
11
|
}
|
|
12
|
+
}
|
|
43
13
|
};
|
|
44
|
-
|
|
14
|
+
}
|
|
15
|
+
if (!Array.isArray(propertyPath)) {
|
|
16
|
+
return propertyPath;
|
|
17
|
+
}
|
|
18
|
+
const last = propertyPath.pop();
|
|
19
|
+
let getterIntermediate;
|
|
20
|
+
if (propertyPath.length > 0) {
|
|
21
|
+
getterIntermediate = item => {
|
|
22
|
+
if (!item) {
|
|
23
|
+
return item;
|
|
24
|
+
}
|
|
25
|
+
for (const iterator of propertyPath) {
|
|
26
|
+
item = item[iterator];
|
|
45
27
|
if (!item) {
|
|
46
|
-
|
|
28
|
+
return item;
|
|
47
29
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
return item?.[last];
|
|
52
|
-
};
|
|
53
|
-
return {
|
|
54
|
-
key: propertyPath.join(","),
|
|
55
|
-
getter,
|
|
56
|
-
setter
|
|
30
|
+
}
|
|
31
|
+
return item;
|
|
57
32
|
};
|
|
33
|
+
}
|
|
34
|
+
const setter = (item, value) => {
|
|
35
|
+
if (item) {
|
|
36
|
+
if (getterIntermediate) {
|
|
37
|
+
item = getterIntermediate(item);
|
|
38
|
+
}
|
|
39
|
+
if (item) {
|
|
40
|
+
item[last] = value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const getter = item => {
|
|
45
|
+
if (!item) {
|
|
46
|
+
return item;
|
|
47
|
+
}
|
|
48
|
+
if (getterIntermediate) {
|
|
49
|
+
item = getterIntermediate(item);
|
|
50
|
+
}
|
|
51
|
+
return item?.[last];
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
key: propertyPath.join(","),
|
|
55
|
+
getter,
|
|
56
|
+
setter
|
|
57
|
+
};
|
|
58
58
|
}
|
|
59
59
|
const handlers = {};
|
|
60
60
|
function registerEvent(property, changeEvents, editorValuePath) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export function EditableInput({ propertyPath, ...a }) {
|
|
85
|
-
if (typeof propertyPath === "string" || Array.isArray(propertyPath)) {
|
|
86
|
-
propertyPath = getPropertyInfo(propertyPath);
|
|
61
|
+
property.key ??= property.setter + ":" + property.getter;
|
|
62
|
+
const name = `${property.key}:${changeEvents.join(",")}`;
|
|
63
|
+
if (!handlers[name]) {
|
|
64
|
+
handlers[name] = changeEvents;
|
|
65
|
+
for (const iterator of changeEvents) {
|
|
66
|
+
document.body.addEventListener(iterator, e => {
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
const ri = getParentRepeaterItem(e.target);
|
|
69
|
+
if (!ri) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const [_, repeater, item] = ri;
|
|
73
|
+
const oldValue = property.getter(item);
|
|
74
|
+
const value = editorValuePath(e.target);
|
|
75
|
+
if (oldValue != value) {
|
|
76
|
+
property.setter(item, value);
|
|
77
|
+
repeater.refreshItem(item);
|
|
78
|
+
}
|
|
79
|
+
}, 1);
|
|
80
|
+
}, true);
|
|
87
81
|
}
|
|
88
|
-
|
|
89
|
-
return XNode.create("input", { type: "text", ...a });
|
|
82
|
+
}
|
|
90
83
|
}
|
|
91
|
-
|
|
84
|
+
export function EditableInput({
|
|
85
|
+
propertyPath,
|
|
86
|
+
...a
|
|
87
|
+
}) {
|
|
88
|
+
if (typeof propertyPath === "string" || Array.isArray(propertyPath)) {
|
|
89
|
+
propertyPath = getPropertyInfo(propertyPath);
|
|
90
|
+
}
|
|
91
|
+
registerEvent(propertyPath, ["change", "blur"], item => item.value);
|
|
92
|
+
return XNode.create("input", {
|
|
93
|
+
type: "text",
|
|
94
|
+
...a
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -1,91 +1,109 @@
|
|
|
1
1
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
2
|
-
import
|
|
3
|
-
document.body.addEventListener("click",
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
ESMPack.installStyleSheet(import.meta.resolve("./styles/expander.global.css"));
|
|
3
|
+
document.body.addEventListener("click", e => {
|
|
4
|
+
if (e.defaultPrevented) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
let start = e.target;
|
|
8
|
+
while (start) {
|
|
9
|
+
if (/icon|caret|header/.test(start.getAttribute("data-element"))) {
|
|
10
|
+
break;
|
|
6
11
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, {
|
|
34
|
-
|
|
35
|
-
if (ce.defaultPrevented) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const target = ce.target;
|
|
39
|
-
target.dataset.isExpanded = "true";
|
|
12
|
+
start = start.parentElement;
|
|
13
|
+
}
|
|
14
|
+
start = start?.parentElement;
|
|
15
|
+
if (!start) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const isExpander = start?.getAttribute("data-is-expander");
|
|
19
|
+
if (!/^(menu|expander)$/i.test(isExpander)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const ds = start.dataset;
|
|
23
|
+
if (/menu/i.test(isExpander)) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.stopImmediatePropagation();
|
|
26
|
+
}
|
|
27
|
+
if (ds.isExpanded === "false") {
|
|
28
|
+
start.dispatchEvent(new CustomEvent("expanded", {
|
|
29
|
+
bubbles: true,
|
|
30
|
+
cancelable: true
|
|
31
|
+
}));
|
|
32
|
+
} else {
|
|
33
|
+
start.dispatchEvent(new CustomEvent("collapsed", {
|
|
34
|
+
bubbles: true,
|
|
35
|
+
cancelable: true
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
capture: true
|
|
40
40
|
});
|
|
41
|
-
document.body.addEventListener("
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
document.body.addEventListener("expanded", ce => {
|
|
42
|
+
if (ce.defaultPrevented) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const target = ce.target;
|
|
46
|
+
target.dataset.isExpanded = "true";
|
|
47
47
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
const iconElement = !icon
|
|
81
|
-
? []
|
|
82
|
-
: (Array.isArray(icon)
|
|
83
|
-
? icon
|
|
84
|
-
: [icon]).map((i) => XNode.create("i", { "data-element": "icon", class: i }));
|
|
85
|
-
return XNode.create("div", { "data-is-expander": "menu", "data-is-expanded": isExpanded, ...a },
|
|
86
|
-
...iconElement,
|
|
87
|
-
header,
|
|
88
|
-
XNode.create("i", { "data-element": "caret", class: "fas fa-angle-down" }),
|
|
89
|
-
...details);
|
|
48
|
+
document.body.addEventListener("collapsed", ce => {
|
|
49
|
+
if (ce.defaultPrevented) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const target = ce.target;
|
|
53
|
+
target.dataset.isExpanded = "false";
|
|
54
|
+
});
|
|
55
|
+
export default function Expander({
|
|
56
|
+
icon,
|
|
57
|
+
isExpanded,
|
|
58
|
+
...a
|
|
59
|
+
}, header, detail) {
|
|
60
|
+
if (!detail) {
|
|
61
|
+
throw new Error("Expander must contain two children, one header and one detail");
|
|
62
|
+
}
|
|
63
|
+
const ha = header.attributes ??= {};
|
|
64
|
+
const da = detail.attributes ??= {};
|
|
65
|
+
ha["data-element"] = "header";
|
|
66
|
+
da["data-element"] = "detail";
|
|
67
|
+
const iconElement = !icon ? [] : (Array.isArray(icon) ? icon : [icon]).map(i => XNode.create("i", {
|
|
68
|
+
"data-element": "icon",
|
|
69
|
+
class: i
|
|
70
|
+
}));
|
|
71
|
+
return XNode.create("div", {
|
|
72
|
+
"data-is-expander": "expander",
|
|
73
|
+
"data-is-expanded": isExpanded,
|
|
74
|
+
...a
|
|
75
|
+
}, ...iconElement, header, XNode.create("i", {
|
|
76
|
+
"data-element": "caret",
|
|
77
|
+
class: "fas fa-angle-down"
|
|
78
|
+
}), detail);
|
|
90
79
|
}
|
|
91
|
-
|
|
80
|
+
export function ExpanderMenu({
|
|
81
|
+
icon,
|
|
82
|
+
isExpanded,
|
|
83
|
+
...a
|
|
84
|
+
}, header, ...details) {
|
|
85
|
+
if (details.length === 0) {
|
|
86
|
+
throw new Error("Expander must contain two children, one header and one detail");
|
|
87
|
+
}
|
|
88
|
+
const ha = header.attributes ??= {};
|
|
89
|
+
ha["data-element"] = "header";
|
|
90
|
+
let i = 2;
|
|
91
|
+
details = details.filter(x => x !== false);
|
|
92
|
+
for (const iterator of details) {
|
|
93
|
+
const ia = iterator.attributes ??= {};
|
|
94
|
+
ia["data-element"] = "detail";
|
|
95
|
+
ia["style-grid-row-start"] = (i++).toString();
|
|
96
|
+
}
|
|
97
|
+
const iconElement = !icon ? [] : (Array.isArray(icon) ? icon : [icon]).map(i => XNode.create("i", {
|
|
98
|
+
"data-element": "icon",
|
|
99
|
+
class: i
|
|
100
|
+
}));
|
|
101
|
+
return XNode.create("div", {
|
|
102
|
+
"data-is-expander": "menu",
|
|
103
|
+
"data-is-expanded": isExpanded,
|
|
104
|
+
...a
|
|
105
|
+
}, ...iconElement, header, XNode.create("i", {
|
|
106
|
+
"data-element": "caret",
|
|
107
|
+
class: "fas fa-angle-down"
|
|
108
|
+
}), ...details);
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/basic/FilesDragDrop.global.css"],"names":[],"mappings":"AACI,wCACI,uBACJ","file":"FilesDragDrop.global.css"}
|