@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
|
@@ -7,140 +7,162 @@ import DateTime from "@web-atoms/date-time/dist/DateTime.js";
|
|
|
7
7
|
import Calendar from "./Calendar.js";
|
|
8
8
|
import TimeEditor from "./TimeEditor.js";
|
|
9
9
|
import TimeSpan from "@web-atoms/date-time/dist/TimeSpan.js";
|
|
10
|
-
import
|
|
10
|
+
ESMPack.installStyleSheet(import.meta.resolve("./styles/date-field.global.css"));
|
|
11
11
|
import AtomPopover from "./elements/AtomPopover.js";
|
|
12
12
|
function hours() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
return [{
|
|
14
|
+
label: "01",
|
|
15
|
+
value: 1
|
|
16
|
+
}, {
|
|
17
|
+
label: "02",
|
|
18
|
+
value: 2
|
|
19
|
+
}, {
|
|
20
|
+
label: "03",
|
|
21
|
+
value: 3
|
|
22
|
+
}, {
|
|
23
|
+
label: "04",
|
|
24
|
+
value: 4
|
|
25
|
+
}, {
|
|
26
|
+
label: "05",
|
|
27
|
+
value: 5
|
|
28
|
+
}, {
|
|
29
|
+
label: "06",
|
|
30
|
+
value: 6
|
|
31
|
+
}, {
|
|
32
|
+
label: "07",
|
|
33
|
+
value: 7
|
|
34
|
+
}, {
|
|
35
|
+
label: "08",
|
|
36
|
+
value: 8
|
|
37
|
+
}, {
|
|
38
|
+
label: "09",
|
|
39
|
+
value: 9
|
|
40
|
+
}, {
|
|
41
|
+
label: "10",
|
|
42
|
+
value: 10
|
|
43
|
+
}, {
|
|
44
|
+
label: "11",
|
|
45
|
+
value: 11
|
|
46
|
+
}, {
|
|
47
|
+
label: "12",
|
|
48
|
+
value: 12
|
|
49
|
+
}];
|
|
27
50
|
}
|
|
28
51
|
function minutes() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
const items = [];
|
|
53
|
+
for (let index = 0; index < 10; index++) {
|
|
54
|
+
items.push({
|
|
55
|
+
label: "0" + index,
|
|
56
|
+
value: index
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
for (let index = 10; index < 60; index++) {
|
|
60
|
+
items.push({
|
|
61
|
+
label: index.toString(),
|
|
62
|
+
value: index
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return items;
|
|
37
66
|
}
|
|
38
67
|
export default class DateField extends AtomControl {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
this.owner.enableTime && XNode.create(TimeEditor, { time: Bind.twoWays(() => this.time) }),
|
|
80
|
-
XNode.create("button", { class: "clear", text: "Clear", "event-click": (e) => {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
e.stopImmediatePropagation();
|
|
83
|
-
e.stopPropagation();
|
|
84
|
-
this.save();
|
|
85
|
-
} }),
|
|
86
|
-
XNode.create("button", { class: "today", text: "Today", "event-click": (e) => {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
e.stopImmediatePropagation();
|
|
89
|
-
e.stopPropagation();
|
|
90
|
-
this.save(DateTime.today.asJSDate);
|
|
91
|
-
} }));
|
|
92
|
-
}
|
|
93
|
-
save(d) {
|
|
94
|
-
if (!d) {
|
|
95
|
-
this.owner.value = d;
|
|
96
|
-
this.close(d);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
let date = DateTime.from((d));
|
|
100
|
-
if (this.owner.enableTime) {
|
|
101
|
-
date = date.add(this.time);
|
|
102
|
-
}
|
|
103
|
-
this.owner.value = date.asJSDate;
|
|
104
|
-
this.close(date);
|
|
68
|
+
constructor(app, e = document.createElement("button")) {
|
|
69
|
+
super(app, e);
|
|
70
|
+
}
|
|
71
|
+
preCreate() {
|
|
72
|
+
this.prompt = "Select";
|
|
73
|
+
this.enableTime = false;
|
|
74
|
+
this.value = null;
|
|
75
|
+
this.format = (d, showTime) => showTime ? d?.toLocaleString(navigator.language, {
|
|
76
|
+
month: "short",
|
|
77
|
+
year: "numeric",
|
|
78
|
+
day: "numeric",
|
|
79
|
+
weekday: "short",
|
|
80
|
+
hour12: true,
|
|
81
|
+
hour: "numeric",
|
|
82
|
+
minute: "2-digit"
|
|
83
|
+
}) : d?.toLocaleDateString(navigator.language, {
|
|
84
|
+
month: "short",
|
|
85
|
+
year: "numeric",
|
|
86
|
+
day: "numeric",
|
|
87
|
+
weekday: "short"
|
|
88
|
+
});
|
|
89
|
+
const owner = this;
|
|
90
|
+
class CalendarPopup extends AtomPopover {
|
|
91
|
+
init() {
|
|
92
|
+
this.owner = owner;
|
|
93
|
+
this.type = "AM";
|
|
94
|
+
const now = DateTime.from(owner.value ?? DateTime.today.addHours(owner.hour || 0).addMinutes(owner.minute || 0));
|
|
95
|
+
this.time = new TimeSpan(0, now.hour, now.minute);
|
|
96
|
+
const yearStart = typeof this.owner.yearStart === "number" ? this.owner.yearStart : -10;
|
|
97
|
+
const yearEnd = typeof this.owner.yearEnd === "number" ? this.owner.yearEnd : 10;
|
|
98
|
+
const year = typeof this.owner.year === "number" ? this.owner.year : now.year;
|
|
99
|
+
this.renderer = XNode.create("div", {
|
|
100
|
+
class: "calendar-popup"
|
|
101
|
+
}, XNode.create(Calendar, {
|
|
102
|
+
yearStart: yearStart,
|
|
103
|
+
yearEnd: yearEnd,
|
|
104
|
+
year: year,
|
|
105
|
+
"event-item-select": Bind.event((s, e) => {
|
|
106
|
+
if (e.detail.disabled) {
|
|
107
|
+
return;
|
|
105
108
|
}
|
|
109
|
+
this.save(e.detail.value);
|
|
110
|
+
}),
|
|
111
|
+
enableFunc: Bind.oneTime(() => this.owner.enableFunc),
|
|
112
|
+
value: Bind.oneWay(() => this.owner.value)
|
|
113
|
+
}), this.owner.enableTime && XNode.create(TimeEditor, {
|
|
114
|
+
time: Bind.twoWays(() => this.time)
|
|
115
|
+
}), XNode.create("button", {
|
|
116
|
+
class: "clear",
|
|
117
|
+
text: "Clear",
|
|
118
|
+
"event-click": e => {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
e.stopImmediatePropagation();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
this.save();
|
|
123
|
+
}
|
|
124
|
+
}), XNode.create("button", {
|
|
125
|
+
class: "today",
|
|
126
|
+
text: "Today",
|
|
127
|
+
"event-click": e => {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
e.stopImmediatePropagation();
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
this.save(DateTime.today.asJSDate);
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
save(d) {
|
|
136
|
+
if (!d) {
|
|
137
|
+
this.owner.value = d;
|
|
138
|
+
this.close(d);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
let date = DateTime.from(d);
|
|
142
|
+
if (this.owner.enableTime) {
|
|
143
|
+
date = date.add(this.time);
|
|
106
144
|
}
|
|
107
|
-
this.
|
|
145
|
+
this.owner.value = date.asJSDate;
|
|
146
|
+
this.close(date);
|
|
147
|
+
}
|
|
108
148
|
}
|
|
149
|
+
this.render(XNode.create("div", {
|
|
150
|
+
"data-layout": "flex",
|
|
151
|
+
"data-date-field": "date-field",
|
|
152
|
+
text: Bind.oneWay(() => this.format?.(this.value, this.enableTime) || this.prompt),
|
|
153
|
+
"event-click": () => CalendarPopup.show(this, {
|
|
154
|
+
"anchor-left": "parent-left",
|
|
155
|
+
closeOnClick: false
|
|
156
|
+
})
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
109
159
|
}
|
|
110
|
-
__decorate([
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
], DateField.prototype, "
|
|
114
|
-
__decorate([
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
], DateField.prototype, "
|
|
118
|
-
__decorate([
|
|
119
|
-
BindableProperty,
|
|
120
|
-
__metadata("design:type", Function)
|
|
121
|
-
], DateField.prototype, "format", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
BindableProperty,
|
|
124
|
-
__metadata("design:type", Object)
|
|
125
|
-
], DateField.prototype, "yearStart", void 0);
|
|
126
|
-
__decorate([
|
|
127
|
-
BindableProperty,
|
|
128
|
-
__metadata("design:type", Object)
|
|
129
|
-
], DateField.prototype, "yearEnd", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
BindableProperty,
|
|
132
|
-
__metadata("design:type", Number)
|
|
133
|
-
], DateField.prototype, "year", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
BindableProperty,
|
|
136
|
-
__metadata("design:type", Number)
|
|
137
|
-
], DateField.prototype, "hour", void 0);
|
|
138
|
-
__decorate([
|
|
139
|
-
BindableProperty,
|
|
140
|
-
__metadata("design:type", Number)
|
|
141
|
-
], DateField.prototype, "minute", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
BindableProperty,
|
|
144
|
-
__metadata("design:type", String)
|
|
145
|
-
], DateField.prototype, "prompt", void 0);
|
|
146
|
-
//# sourceMappingURL=DateField.js.map
|
|
160
|
+
__decorate([BindableProperty, __metadata("design:type", Date)], DateField.prototype, "value", void 0);
|
|
161
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DateField.prototype, "enableFunc", void 0);
|
|
162
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DateField.prototype, "format", void 0);
|
|
163
|
+
__decorate([BindableProperty, __metadata("design:type", Object)], DateField.prototype, "yearStart", void 0);
|
|
164
|
+
__decorate([BindableProperty, __metadata("design:type", Object)], DateField.prototype, "yearEnd", void 0);
|
|
165
|
+
__decorate([BindableProperty, __metadata("design:type", Number)], DateField.prototype, "year", void 0);
|
|
166
|
+
__decorate([BindableProperty, __metadata("design:type", Number)], DateField.prototype, "hour", void 0);
|
|
167
|
+
__decorate([BindableProperty, __metadata("design:type", Number)], DateField.prototype, "minute", void 0);
|
|
168
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DateField.prototype, "prompt", void 0);
|
|
@@ -2,114 +2,102 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty.js";
|
|
3
3
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
4
4
|
import AtomRepeater, { askSuggestion, askSuggestionPopup, disposeChildren, MatchAnyCaseInsensitive } from "./AtomRepeater.js";
|
|
5
|
-
import
|
|
5
|
+
ESMPack.installStyleSheet(import.meta.resolve("./styles/drop-down.global.css"));
|
|
6
6
|
export default class DropDown extends AtomRepeater {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.isPopupOpen = false;
|
|
10
|
+
}
|
|
11
|
+
updateItems(container) {}
|
|
12
|
+
onPropertyChanged(name) {
|
|
13
|
+
super.onPropertyChanged(name);
|
|
14
|
+
switch (name) {
|
|
15
|
+
case "labelPath":
|
|
16
|
+
this.itemRenderer = item => XNode.create("div", {
|
|
17
|
+
text: this.labelPath(item)
|
|
18
|
+
});
|
|
19
|
+
break;
|
|
20
|
+
case "prompt":
|
|
21
|
+
this.updateClasses();
|
|
22
|
+
break;
|
|
10
23
|
}
|
|
11
|
-
|
|
24
|
+
}
|
|
25
|
+
preCreate() {
|
|
26
|
+
super.preCreate();
|
|
27
|
+
this.disableSearch = false;
|
|
28
|
+
this.prompt = "Select";
|
|
29
|
+
this.popupSuggestions = true;
|
|
30
|
+
this.bindEvent(this.element, "click", e => this.openPopup(e));
|
|
31
|
+
this.valuePath = item => item?.value ?? item;
|
|
32
|
+
this.labelPath = item => item?.label ?? item;
|
|
33
|
+
this.itemRenderer = item => XNode.create("div", {
|
|
34
|
+
text: this.labelPath(item)
|
|
35
|
+
});
|
|
36
|
+
this.element.dataset.dropDown = "drop-down";
|
|
37
|
+
this.render(XNode.create("div", null, XNode.create("div", {
|
|
38
|
+
"data-white-space": "nowrap",
|
|
39
|
+
text: this.prompt
|
|
40
|
+
}), XNode.create("i", {
|
|
41
|
+
class: "fad fa-caret-circle-down"
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
async openPopup(e) {
|
|
45
|
+
if (this.isPopupOpen) {
|
|
46
|
+
return;
|
|
12
47
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
48
|
+
this.isPopupOpen = true;
|
|
49
|
+
try {
|
|
50
|
+
if (!this.popupSuggestions) {
|
|
51
|
+
const selected = await askSuggestion(this.items, this.suggestionRenderer ?? this.itemRenderer, this.match ?? MatchAnyCaseInsensitive(this.labelPath), {
|
|
52
|
+
title: this.suggestionPrompt ?? this.prompt
|
|
53
|
+
});
|
|
54
|
+
this.selectedItem = selected;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const selectedItem = await askSuggestionPopup(this, this.items, this.suggestionRenderer ?? this.itemRenderer, this.match ?? MatchAnyCaseInsensitive(this.labelPath), this.selectedItem);
|
|
58
|
+
if (this.selectedItem !== selectedItem) {
|
|
59
|
+
this.selectedItem = selectedItem;
|
|
60
|
+
this.element.dispatchEvent(new CustomEvent("selectionChanged", {
|
|
61
|
+
bubbles: true,
|
|
62
|
+
detail: selectedItem,
|
|
63
|
+
cancelable: true
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
} finally {
|
|
67
|
+
this.isPopupOpen = false;
|
|
23
68
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.valuePath = (item) => item?.value ?? item;
|
|
31
|
-
this.labelPath = (item) => item?.label ?? item;
|
|
32
|
-
this.itemRenderer = (item) => XNode.create("div", { text: this.labelPath(item) });
|
|
33
|
-
this.element.dataset.dropDown = "drop-down";
|
|
34
|
-
this.render(XNode.create("div", null,
|
|
35
|
-
XNode.create("div", { "data-white-space": "nowrap", text: this.prompt }),
|
|
36
|
-
XNode.create("i", { class: "fad fa-caret-circle-down" })));
|
|
69
|
+
}
|
|
70
|
+
updateClasses() {
|
|
71
|
+
disposeChildren(this, this.element);
|
|
72
|
+
const ir = this.itemRenderer;
|
|
73
|
+
if (!ir) {
|
|
74
|
+
return;
|
|
37
75
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.selectedItem = selected;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const selectedItem = await askSuggestionPopup(this, this.items, this.suggestionRenderer ?? this.itemRenderer, this.match ?? MatchAnyCaseInsensitive(this.labelPath), this.selectedItem);
|
|
50
|
-
if (this.selectedItem !== selectedItem) {
|
|
51
|
-
this.selectedItem = selectedItem;
|
|
52
|
-
this.element.dispatchEvent(new CustomEvent("selectionChanged", {
|
|
53
|
-
bubbles: true,
|
|
54
|
-
detail: selectedItem,
|
|
55
|
-
cancelable: true
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
this.isPopupOpen = false;
|
|
61
|
-
}
|
|
76
|
+
if (!this.selectedItem) {
|
|
77
|
+
this.render(XNode.create("div", null, XNode.create("div", {
|
|
78
|
+
"data-white-space": "nowrap",
|
|
79
|
+
text: this.prompt
|
|
80
|
+
}), XNode.create("i", {
|
|
81
|
+
class: "fad fa-caret-circle-down"
|
|
82
|
+
})));
|
|
83
|
+
return;
|
|
62
84
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!this.selectedItem) {
|
|
70
|
-
this.render(XNode.create("div", null,
|
|
71
|
-
XNode.create("div", { "data-white-space": "nowrap", text: this.prompt }),
|
|
72
|
-
XNode.create("i", { class: "fad fa-caret-circle-down" })));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const selectedItem = this.selectedItem;
|
|
76
|
-
const index = this.items.indexOf(selectedItem);
|
|
77
|
-
const node = ir(selectedItem, index, this);
|
|
78
|
-
const na = node.attributes ??= {};
|
|
79
|
-
if (!na["data-white-space"]) {
|
|
80
|
-
na["data-white-space"] = "nowrap";
|
|
81
|
-
}
|
|
82
|
-
this.render(XNode.create("div", null,
|
|
83
|
-
node,
|
|
84
|
-
XNode.create("i", { class: "fad fa-caret-circle-down" })));
|
|
85
|
+
const selectedItem = this.selectedItem;
|
|
86
|
+
const index = this.items.indexOf(selectedItem);
|
|
87
|
+
const node = ir(selectedItem, index, this);
|
|
88
|
+
const na = node.attributes ??= {};
|
|
89
|
+
if (!na["data-white-space"]) {
|
|
90
|
+
na["data-white-space"] = "nowrap";
|
|
85
91
|
}
|
|
92
|
+
this.render(XNode.create("div", null, node, XNode.create("i", {
|
|
93
|
+
class: "fad fa-caret-circle-down"
|
|
94
|
+
})));
|
|
95
|
+
}
|
|
86
96
|
}
|
|
87
|
-
__decorate([
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
], DropDown.prototype, "
|
|
91
|
-
__decorate([
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
], DropDown.prototype, "search", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
BindableProperty,
|
|
97
|
-
__metadata("design:type", String)
|
|
98
|
-
], DropDown.prototype, "prompt", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
BindableProperty,
|
|
101
|
-
__metadata("design:type", String)
|
|
102
|
-
], DropDown.prototype, "suggestionPrompt", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
BindableProperty,
|
|
105
|
-
__metadata("design:type", Function)
|
|
106
|
-
], DropDown.prototype, "labelPath", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
BindableProperty,
|
|
109
|
-
__metadata("design:type", Function)
|
|
110
|
-
], DropDown.prototype, "match", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
BindableProperty,
|
|
113
|
-
__metadata("design:type", Function)
|
|
114
|
-
], DropDown.prototype, "suggestionRenderer", void 0);
|
|
115
|
-
//# sourceMappingURL=DropDown.js.map
|
|
97
|
+
__decorate([BindableProperty, __metadata("design:type", Boolean)], DropDown.prototype, "popupSuggestions", void 0);
|
|
98
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDown.prototype, "search", void 0);
|
|
99
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDown.prototype, "prompt", void 0);
|
|
100
|
+
__decorate([BindableProperty, __metadata("design:type", String)], DropDown.prototype, "suggestionPrompt", void 0);
|
|
101
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDown.prototype, "labelPath", void 0);
|
|
102
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDown.prototype, "match", void 0);
|
|
103
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], DropDown.prototype, "suggestionRenderer", void 0);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
drop-down-input{border-bottom:1px solid #d3d3d3;display:inline-grid;grid-template-columns:1fr auto;padding-left:5px;padding-right:5px}drop-down-input>*{grid-column:1;grid-row:1}drop-down-input>label{pointer-events:none}drop-down-input>input{border:none;opacity:0;outline:none}drop-down-input>input:focus{opacity:1}drop-down-input:has(input:focus)>label{opacity:0}drop-down-input:has(input:focus){border-bottom-color:var(--focus-border-color,#000)}drop-down-input>i{background-image:url(../../images/svgs/caret-down.svg);background-position:100%;background-repeat:no-repeat;background-size:16px 16px;display:inline-block;grid-column:2;height:16px;width:16px}
|
|
2
|
+
/*# sourceMappingURL=DropDownInput.global.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/basic/DropDownInput.global.css","<no source>"],"names":[],"mappings":"AAAA,gBAGI,+BAAkC,CAFlC,mBAAoB,CACpB,8BAA+B,CAE/B,gBAAiB,CACjB,iBAiCJ,CAhCI,kBAEI,aAAc,CADd,UAEJ,CACA,sBACI,mBACJ,CACA,sBAGI,WAAY,CAFZ,SAAU,CACV,YAEJ,CACA,4BACI,SACJ,CAEI,uCACI,SACJ,CCxBR,iCDyBQ,mDCzBR,AD4BI,kBAEI,sDAAuD,CAEvD,wBAAiC,CACjC,2BAA4B,CAF5B,yBAA0B,CAK1B,oBAAqB,CAPrB,aAAc,CAMd,WAAY,CADZ,UAGJ","file":"DropDownInput.global.css"}
|