@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
|
@@ -14,614 +14,622 @@ import { CancelToken } from "@web-atoms/core/dist/core/types.js";
|
|
|
14
14
|
import { AncestorEnumerator, ChildEnumerator } from "@web-atoms/core/dist/web/core/AtomUI.js";
|
|
15
15
|
import { displayRouteSymbol } from "@web-atoms/core/dist/core/Command.js";
|
|
16
16
|
import Route from "@web-atoms/core/dist/core/Route.js";
|
|
17
|
-
import
|
|
17
|
+
ESMPack.installStyleSheet(import.meta.resolve("./MobileApp.global.css"));
|
|
18
18
|
export function PullToRefresh() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
return XNode.create("div", null, XNode.create("i", {
|
|
20
|
+
class: "pull-icon fa-solid fa-down"
|
|
21
|
+
}), XNode.create("span", {
|
|
22
|
+
class: "down",
|
|
23
|
+
text: " Pull"
|
|
24
|
+
}), XNode.create("span", {
|
|
25
|
+
class: "up",
|
|
26
|
+
text: " Refresh"
|
|
27
|
+
}), XNode.create("i", {
|
|
28
|
+
class: "loading fa-duotone fa-spinner fa-spin"
|
|
29
|
+
}));
|
|
24
30
|
}
|
|
25
31
|
export class Drawer extends AtomControl {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
32
|
+
init() {}
|
|
33
|
+
preCreate() {
|
|
34
|
+
this.element.dataset.drawerPage = "drawer-page";
|
|
35
|
+
this.bindEvent(this.element, "click", e => {
|
|
36
|
+
const target = e.target;
|
|
37
|
+
if (e.defaultPrevented) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (/input/i.test(target.tagName) && !/button|submit/i.test(target.type)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.closeDrawer();
|
|
44
|
+
});
|
|
45
|
+
this.runAfterInit(() => this.app.runAsync(() => this.init?.()));
|
|
46
|
+
}
|
|
47
|
+
closeDrawer() {
|
|
48
|
+
const ce = new CustomEvent("closeDrawer", {
|
|
49
|
+
bubbles: true
|
|
50
|
+
});
|
|
51
|
+
this.element.dispatchEvent(ce);
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
delete Drawer.prototype.init;
|
|
47
55
|
let historyBackCalled = false;
|
|
48
56
|
export class BasePage extends AtomControl {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.keep = false;
|
|
60
|
+
this.disableAutoFocus = false;
|
|
61
|
+
}
|
|
62
|
+
get route() {
|
|
63
|
+
return this.routeUrl;
|
|
64
|
+
}
|
|
65
|
+
set route(url) {
|
|
66
|
+
if (!url) {
|
|
67
|
+
return;
|
|
53
68
|
}
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
if (history.state?.url === url) {
|
|
70
|
+
return;
|
|
56
71
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
if (history.state?.url === url) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
url = Route.encodeUrl(url);
|
|
65
|
-
if (this.routeUrl === url) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
this.routeUrl = url;
|
|
69
|
-
this.routeDisposable?.dispose();
|
|
70
|
-
let last = void 0;
|
|
71
|
-
setTimeout(() => last = url, 100);
|
|
72
|
-
const state = { url };
|
|
73
|
-
history.pushState(state, "", url);
|
|
74
|
-
const eventRegistration = (e) => {
|
|
75
|
-
if (historyBackCalled) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (e.state?.url === last) {
|
|
79
|
-
this.cancel();
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
window.addEventListener("popstate", eventRegistration);
|
|
83
|
-
const d = {
|
|
84
|
-
dispose() {
|
|
85
|
-
window.removeEventListener("popstate", eventRegistration);
|
|
86
|
-
if (history.state?.url === state.url) {
|
|
87
|
-
historyBackCalled = true;
|
|
88
|
-
history.back();
|
|
89
|
-
setTimeout(() => historyBackCalled = false, 500);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
this.routeDisposable = this.registerDisposable(d);
|
|
72
|
+
url = Route.encodeUrl(url);
|
|
73
|
+
if (this.routeUrl === url) {
|
|
74
|
+
return;
|
|
94
75
|
}
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
this.routeUrl = url;
|
|
77
|
+
this.routeDisposable?.dispose();
|
|
78
|
+
let last = void 0;
|
|
79
|
+
setTimeout(() => last = url, 100);
|
|
80
|
+
const state = {
|
|
81
|
+
url
|
|
82
|
+
};
|
|
83
|
+
history.pushState(state, "", url);
|
|
84
|
+
const eventRegistration = e => {
|
|
85
|
+
if (historyBackCalled) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (e.state?.url === last) {
|
|
89
|
+
this.cancel();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
window.addEventListener("popstate", eventRegistration);
|
|
93
|
+
const d = {
|
|
94
|
+
dispose() {
|
|
95
|
+
window.removeEventListener("popstate", eventRegistration);
|
|
96
|
+
if (history.state?.url === state.url) {
|
|
97
|
+
historyBackCalled = true;
|
|
98
|
+
history.back();
|
|
99
|
+
setTimeout(() => historyBackCalled = false, 500);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
this.routeDisposable = this.registerDisposable(d);
|
|
104
|
+
}
|
|
105
|
+
get hideToolbar() {
|
|
106
|
+
return /true/i.test(this.element?.getAttribute("data-hide-toolbar"));
|
|
107
|
+
}
|
|
108
|
+
set hideToolbar(v) {
|
|
109
|
+
if (v) {
|
|
110
|
+
this.element.setAttribute("data-hide-toolbar", "true");
|
|
111
|
+
} else {
|
|
112
|
+
this.element.removeAttribute("data-hide-toolbar");
|
|
97
113
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
}
|
|
115
|
+
get hideDrawer() {
|
|
116
|
+
return /true/i.test(this.element?.getAttribute("data-hide-drawer"));
|
|
117
|
+
}
|
|
118
|
+
set hideDrawer(v) {
|
|
119
|
+
if (v) {
|
|
120
|
+
this.element.setAttribute("data-hide-drawer", "true");
|
|
121
|
+
} else {
|
|
122
|
+
this.element.removeAttribute("data-hide-drawer");
|
|
105
123
|
}
|
|
106
|
-
|
|
107
|
-
|
|
124
|
+
}
|
|
125
|
+
async requestCancel() {
|
|
126
|
+
if (this.closeWarning) {
|
|
127
|
+
if (!(await PopupService.confirm({
|
|
128
|
+
message: this.closeWarning
|
|
129
|
+
}))) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
108
132
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
this.cancel();
|
|
134
|
+
}
|
|
135
|
+
onPropertyChanged(name) {
|
|
136
|
+
super.onPropertyChanged(name);
|
|
137
|
+
switch (name) {
|
|
138
|
+
case "footerRenderer":
|
|
139
|
+
this.recreate(name, "footer");
|
|
140
|
+
break;
|
|
141
|
+
case "iconRenderer":
|
|
142
|
+
this.recreate(name, "icon");
|
|
143
|
+
break;
|
|
144
|
+
case "titleRenderer":
|
|
145
|
+
this.recreate(name, "title");
|
|
146
|
+
break;
|
|
147
|
+
case "actionRenderer":
|
|
148
|
+
this.recreate(name, "action");
|
|
149
|
+
break;
|
|
150
|
+
case "headerRenderer":
|
|
151
|
+
this.recreate(name, "header");
|
|
152
|
+
break;
|
|
153
|
+
case "pullToRefreshRenderer":
|
|
154
|
+
this.pullToRefreshElement = this.recreate(name, "pull-to-refresh");
|
|
155
|
+
this.pullToRefreshElement?.remove();
|
|
156
|
+
this.enablePullToRefreshEvents();
|
|
157
|
+
break;
|
|
158
|
+
case "actionBarRenderer":
|
|
159
|
+
this.recreate(name, "action-bar");
|
|
160
|
+
break;
|
|
116
161
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
162
|
+
}
|
|
163
|
+
init() {}
|
|
164
|
+
rendererChanged() {
|
|
165
|
+
for (const content of ChildEnumerator.where(this.element, ({
|
|
166
|
+
dataset: {
|
|
167
|
+
pageElement
|
|
168
|
+
}
|
|
169
|
+
}) => !pageElement || pageElement === "content")) {
|
|
170
|
+
this.dispose(content);
|
|
171
|
+
content.remove();
|
|
126
172
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
case "footerRenderer":
|
|
131
|
-
this.recreate(name, "footer");
|
|
132
|
-
break;
|
|
133
|
-
case "iconRenderer":
|
|
134
|
-
this.recreate(name, "icon");
|
|
135
|
-
break;
|
|
136
|
-
case "titleRenderer":
|
|
137
|
-
this.recreate(name, "title");
|
|
138
|
-
break;
|
|
139
|
-
case "actionRenderer":
|
|
140
|
-
this.recreate(name, "action");
|
|
141
|
-
break;
|
|
142
|
-
case "headerRenderer":
|
|
143
|
-
this.recreate(name, "header");
|
|
144
|
-
break;
|
|
145
|
-
case "pullToRefreshRenderer":
|
|
146
|
-
this.pullToRefreshElement = this.recreate(name, "pull-to-refresh");
|
|
147
|
-
this.pullToRefreshElement?.remove();
|
|
148
|
-
this.enablePullToRefreshEvents();
|
|
149
|
-
break;
|
|
150
|
-
case "actionBarRenderer":
|
|
151
|
-
this.recreate(name, "action-bar");
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
173
|
+
const r = this.renderer;
|
|
174
|
+
if (!r) {
|
|
175
|
+
return;
|
|
154
176
|
}
|
|
155
|
-
|
|
177
|
+
delete this.render;
|
|
178
|
+
this.render(r);
|
|
179
|
+
}
|
|
180
|
+
recreate(renderer, name) {
|
|
181
|
+
const node = this[renderer]?.() ?? undefined;
|
|
182
|
+
for (const e of ChildEnumerator.enumerate(this.element)) {
|
|
183
|
+
if (e.dataset.pageElement === name) {
|
|
184
|
+
this.dispose(e);
|
|
185
|
+
e.remove();
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
156
188
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
189
|
+
if (node) {
|
|
190
|
+
const na = node.attributes ??= {};
|
|
191
|
+
na["data-page-element"] = name;
|
|
192
|
+
super.render(XNode.create("div", null, node));
|
|
193
|
+
return this.element.querySelector(`[data-page-element="${name}"]`);
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
preCreate() {
|
|
198
|
+
this.element.dataset.basePage = "base-page";
|
|
199
|
+
this.iconClass = "";
|
|
200
|
+
this.viewModelTitle = null;
|
|
201
|
+
const c = new CancelToken();
|
|
202
|
+
this.cancelToken = c;
|
|
203
|
+
this.registerDisposable({
|
|
204
|
+
dispose() {
|
|
205
|
+
c.cancel();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
this.runAfterInit(() => {
|
|
209
|
+
if (!this.element) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const anyAutofocus = this.element.querySelector(`*[autofocus]`);
|
|
213
|
+
if (!anyAutofocus) {
|
|
214
|
+
if (this.disableAutoFocus) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const windowContent = this.element.querySelector(`[data-page-element="content"]`);
|
|
218
|
+
if (windowContent) {
|
|
219
|
+
const firstInput = windowContent.querySelector("input,textarea");
|
|
220
|
+
if (firstInput) {
|
|
221
|
+
firstInput.focus();
|
|
164
222
|
return;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
anyAutofocus.focus();
|
|
228
|
+
});
|
|
229
|
+
setTimeout(p => {
|
|
230
|
+
p.dataset.pageState = "ready";
|
|
231
|
+
}, 1, this.element);
|
|
232
|
+
this.titleRenderer = () => XNode.create("span", {
|
|
233
|
+
"data-text-overflow": "ellipsis",
|
|
234
|
+
class: "title-text",
|
|
235
|
+
text: Bind.oneWay(() => this.viewModelTitle || this.title)
|
|
236
|
+
});
|
|
237
|
+
this.iconRenderer = () => XNode.create("i", {
|
|
238
|
+
"data-icon-button": "icon-button",
|
|
239
|
+
class: Bind.oneWay(() => this.iconClass),
|
|
240
|
+
eventClick: e1 => this.dispatchIconClickEvent(e1)
|
|
241
|
+
});
|
|
242
|
+
this.actionBarRenderer = () => XNode.create("div", null);
|
|
243
|
+
this.runAfterInit(() => {
|
|
244
|
+
this.pullToRefreshElement?.remove?.();
|
|
245
|
+
this.initialized = true;
|
|
246
|
+
this.enablePullToRefreshEvents();
|
|
247
|
+
try {
|
|
248
|
+
document.body.dispatchEvent(new CustomEvent("pageNavigated", {
|
|
249
|
+
detail: {
|
|
250
|
+
title: this.title,
|
|
251
|
+
route: this.route || Object.getPrototypeOf(this)?.constructor?.name
|
|
252
|
+
},
|
|
253
|
+
bubbles: true,
|
|
254
|
+
cancelable: true
|
|
255
|
+
}));
|
|
256
|
+
} catch {}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
render(node, e, creator) {
|
|
260
|
+
if (e || node?.attributes?.["data-page-element"]) {
|
|
261
|
+
super.render(node, e, creator);
|
|
262
|
+
return;
|
|
168
263
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
if (node) {
|
|
179
|
-
const na = node.attributes ??= {};
|
|
180
|
-
na["data-page-element"] = name;
|
|
181
|
-
super.render(XNode.create("div", null, node));
|
|
182
|
-
return this.element.querySelector(`[data-page-element="${name}"]`);
|
|
183
|
-
}
|
|
184
|
-
return null;
|
|
264
|
+
this.render = super.render;
|
|
265
|
+
const na = node.attributes ??= {};
|
|
266
|
+
let extracted = {};
|
|
267
|
+
if (!na["data-page-element"]) {
|
|
268
|
+
na["data-page-element"] = "content";
|
|
269
|
+
extracted = this.extractControlProperties(node);
|
|
185
270
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
dispose() {
|
|
194
|
-
c.cancel();
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
this.runAfterInit(() => {
|
|
198
|
-
if (!this.element) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const anyAutofocus = this.element.querySelector(`*[autofocus]`);
|
|
202
|
-
if (!anyAutofocus) {
|
|
203
|
-
if (this.disableAutoFocus) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const windowContent = this.element.querySelector(`[data-page-element="content"]`);
|
|
207
|
-
if (windowContent) {
|
|
208
|
-
const firstInput = windowContent.querySelector("input,textarea");
|
|
209
|
-
if (firstInput) {
|
|
210
|
-
firstInput.focus();
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
anyAutofocus.focus();
|
|
217
|
-
});
|
|
218
|
-
setTimeout((p) => {
|
|
219
|
-
p.dataset.pageState = "ready";
|
|
220
|
-
}, 1, this.element);
|
|
221
|
-
this.titleRenderer = () => XNode.create("span", { "data-text-overflow": "ellipsis", class: "title-text", text: Bind.oneWay(() => this.viewModelTitle || this.title) });
|
|
222
|
-
this.iconRenderer = () => XNode.create("i", { "data-icon-button": "icon-button", class: Bind.oneWay(() => this.iconClass), eventClick: (e1) => this.dispatchIconClickEvent(e1) });
|
|
223
|
-
this.actionBarRenderer = () => XNode.create("div", null);
|
|
224
|
-
this.runAfterInit(() => {
|
|
225
|
-
this.pullToRefreshElement?.remove?.();
|
|
226
|
-
this.initialized = true;
|
|
227
|
-
this.enablePullToRefreshEvents();
|
|
228
|
-
try {
|
|
229
|
-
document.body.dispatchEvent(new CustomEvent("pageNavigated", {
|
|
230
|
-
detail: {
|
|
231
|
-
title: this.title,
|
|
232
|
-
route: this.route || Object.getPrototypeOf(this)?.constructor?.name
|
|
233
|
-
},
|
|
234
|
-
bubbles: true,
|
|
235
|
-
cancelable: true
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
catch { }
|
|
239
|
-
});
|
|
271
|
+
super.render(XNode.create("div", {
|
|
272
|
+
viewModelTitle: Bind.oneWay(() => this.viewModel.title),
|
|
273
|
+
...extracted
|
|
274
|
+
}, node), e, creator);
|
|
275
|
+
this.contentElement = this.element.querySelector("[data-page-element='content']");
|
|
276
|
+
if (document.body.hasAttribute("ios-keyboard")) {
|
|
277
|
+
return;
|
|
240
278
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
super.render(XNode.create("div", { viewModelTitle: Bind.oneWay(() => this.viewModel.title), ...extracted }, node), e, creator);
|
|
254
|
-
this.contentElement = this.element.querySelector("[data-page-element='content']");
|
|
255
|
-
if (document.body.hasAttribute("ios-keyboard")) {
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
setTimeout(() => {
|
|
259
|
-
this.contentElement.scrollTop = 0;
|
|
260
|
-
this.contentElement.scrollLeft = 0;
|
|
261
|
-
}, 100);
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
this.contentElement.scrollTop = 0;
|
|
281
|
+
this.contentElement.scrollLeft = 0;
|
|
282
|
+
}, 100);
|
|
283
|
+
}
|
|
284
|
+
enablePullToRefreshEvents() {
|
|
285
|
+
const e = this.pullToRefreshElement;
|
|
286
|
+
if (!e) {
|
|
287
|
+
this.pullToRefreshDisposable?.dispose();
|
|
288
|
+
this.pullToRefreshDisposable = void 0;
|
|
289
|
+
return e;
|
|
262
290
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
d.dispose();
|
|
324
|
-
const done = () => {
|
|
325
|
-
delete this.pullToRefreshElement.dataset.mode;
|
|
326
|
-
this.contentElement.style.transform = ``;
|
|
327
|
-
this.pullToRefreshElement.style.transform = "";
|
|
328
|
-
this.pullToRefreshElement.remove();
|
|
329
|
-
elementAdded = false;
|
|
330
|
-
};
|
|
331
|
-
const diffX = ue.screenY - startY;
|
|
332
|
-
if (diffX <= 50) {
|
|
333
|
-
done();
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const ce = new CustomEvent("reloadPage", { detail: this, bubbles: true, cancelable: true });
|
|
337
|
-
this.contentElement.dispatchEvent(ce);
|
|
338
|
-
if (ce.defaultPrevented) {
|
|
339
|
-
done();
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
this.pullToRefreshElement.dataset.mode = "loading";
|
|
343
|
-
const promise = ce.promise;
|
|
344
|
-
if (!promise) {
|
|
345
|
-
done();
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
promise.then(done, done);
|
|
349
|
-
}, null, { passive: !isMouseEvent }));
|
|
291
|
+
if (this.pullToRefreshDisposable) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
let elementAdded = false;
|
|
295
|
+
const touchStart = te => {
|
|
296
|
+
if (!this.pullToRefreshElement) {
|
|
297
|
+
this.pullToRefreshDisposable?.dispose();
|
|
298
|
+
this.pullToRefreshDisposable = null;
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (this.contentElement.scrollTop > 0) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const isMouseEvent = te.type === "mousedown";
|
|
305
|
+
const moveEventName = isMouseEvent ? "mousemove" : "touchmove";
|
|
306
|
+
const endEventName = isMouseEvent ? "mouseup" : "touchend";
|
|
307
|
+
const startY = isMouseEvent ? te.screenY : te.touches[0].screenY;
|
|
308
|
+
this.pullToRefreshElement.dataset.mode = "down";
|
|
309
|
+
if (isMouseEvent) {
|
|
310
|
+
te.stopPropagation();
|
|
311
|
+
te.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
const d = new AtomDisposableList();
|
|
314
|
+
d.add(() => {
|
|
315
|
+
this.contentElement.style.removeProperty("touch-action");
|
|
316
|
+
});
|
|
317
|
+
d.add(this.bindEvent(this.contentElement, moveEventName, me => {
|
|
318
|
+
const screenY = isMouseEvent ? me.screenY : me.touches[0].screenY;
|
|
319
|
+
const diffX = Math.min(75, screenY - startY);
|
|
320
|
+
if (diffX > 5) {
|
|
321
|
+
if (!elementAdded) {
|
|
322
|
+
this.contentElement.style.touchAction = "none";
|
|
323
|
+
elementAdded = true;
|
|
324
|
+
this.element.appendChild(this.pullToRefreshElement);
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
this.contentElement.style.transform = `translateY(${diffX}px)`;
|
|
330
|
+
if (diffX > 50) {
|
|
331
|
+
this.pullToRefreshElement.dataset.mode = "up";
|
|
332
|
+
} else {
|
|
333
|
+
this.pullToRefreshElement.dataset.mode = "down";
|
|
334
|
+
}
|
|
335
|
+
}, null, {
|
|
336
|
+
passive: true
|
|
337
|
+
}));
|
|
338
|
+
d.add(this.bindEvent(this.contentElement, endEventName, ue => {
|
|
339
|
+
ue.stopPropagation();
|
|
340
|
+
if (isMouseEvent) {
|
|
341
|
+
ue.stopImmediatePropagation();
|
|
342
|
+
ue.preventDefault();
|
|
343
|
+
}
|
|
344
|
+
d.dispose();
|
|
345
|
+
const done = () => {
|
|
346
|
+
delete this.pullToRefreshElement.dataset.mode;
|
|
347
|
+
this.contentElement.style.transform = ``;
|
|
348
|
+
this.pullToRefreshElement.style.transform = "";
|
|
349
|
+
this.pullToRefreshElement.remove();
|
|
350
|
+
elementAdded = false;
|
|
350
351
|
};
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
const diffX = ue.screenY - startY;
|
|
353
|
+
if (diffX <= 50) {
|
|
354
|
+
done();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const ce = new CustomEvent("reloadPage", {
|
|
358
|
+
detail: this,
|
|
359
|
+
bubbles: true,
|
|
360
|
+
cancelable: true
|
|
361
|
+
});
|
|
362
|
+
this.contentElement.dispatchEvent(ce);
|
|
363
|
+
if (ce.defaultPrevented) {
|
|
364
|
+
done();
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
this.pullToRefreshElement.dataset.mode = "loading";
|
|
368
|
+
const promise = ce.promise;
|
|
369
|
+
if (!promise) {
|
|
370
|
+
done();
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
promise.then(done, done);
|
|
374
|
+
}, null, {
|
|
375
|
+
passive: !isMouseEvent
|
|
376
|
+
}));
|
|
377
|
+
};
|
|
378
|
+
const ed = new AtomDisposableList();
|
|
379
|
+
ed.add(this.bindEvent(this.contentElement, "mousedown", touchStart));
|
|
380
|
+
ed.add(this.bindEvent(this.contentElement, "touchstart", touchStart, null, {
|
|
381
|
+
passive: true
|
|
382
|
+
}));
|
|
383
|
+
this.pullToRefreshDisposable = ed;
|
|
384
|
+
}
|
|
385
|
+
dispatchIconClickEvent(e) {
|
|
386
|
+
const ce = new CustomEvent("iconClick", {
|
|
387
|
+
bubbles: true
|
|
388
|
+
});
|
|
389
|
+
e.target.dispatchEvent(ce);
|
|
390
|
+
}
|
|
391
|
+
hide() {
|
|
392
|
+
const {
|
|
393
|
+
element
|
|
394
|
+
} = this;
|
|
395
|
+
if (!element) {
|
|
396
|
+
return;
|
|
355
397
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
398
|
+
element.setAttribute("data-page-state", "hidden");
|
|
399
|
+
if (this.keep) {
|
|
400
|
+
setTimeout(() => element.setAttribute("data-page-removed", "true"), 400);
|
|
401
|
+
return;
|
|
359
402
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
this.scrollTop = this.contentElement?.scrollTop;
|
|
372
|
-
setTimeout(() => {
|
|
373
|
-
element?.remove();
|
|
374
|
-
}, 400);
|
|
375
|
-
}
|
|
376
|
-
show() {
|
|
377
|
-
if (this.keep) {
|
|
378
|
-
this.element.removeAttribute("data-page-removed");
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
this.element._logicalParent.appendChild(this.element);
|
|
382
|
-
}
|
|
383
|
-
setTimeout(() => {
|
|
384
|
-
if (this.scrollTop) {
|
|
385
|
-
this.contentElement.scrollTop = this.scrollTop;
|
|
386
|
-
}
|
|
387
|
-
this.element.setAttribute("data-page-state", "ready");
|
|
388
|
-
}, 1);
|
|
403
|
+
element._logicalParent = element.parentElement;
|
|
404
|
+
this.scrollTop = this.contentElement?.scrollTop;
|
|
405
|
+
setTimeout(() => {
|
|
406
|
+
element?.remove();
|
|
407
|
+
}, 400);
|
|
408
|
+
}
|
|
409
|
+
show() {
|
|
410
|
+
if (this.keep) {
|
|
411
|
+
this.element.removeAttribute("data-page-removed");
|
|
412
|
+
} else {
|
|
413
|
+
this.element._logicalParent.appendChild(this.element);
|
|
389
414
|
}
|
|
415
|
+
setTimeout(() => {
|
|
416
|
+
if (this.scrollTop) {
|
|
417
|
+
this.contentElement.scrollTop = this.scrollTop;
|
|
418
|
+
}
|
|
419
|
+
this.element.setAttribute("data-page-state", "ready");
|
|
420
|
+
}, 1);
|
|
421
|
+
}
|
|
390
422
|
}
|
|
391
|
-
__decorate([
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
], BasePage.prototype, "
|
|
395
|
-
__decorate([
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
], BasePage.prototype, "
|
|
399
|
-
__decorate([
|
|
400
|
-
BindableProperty,
|
|
401
|
-
__metadata("design:type", Function)
|
|
402
|
-
], BasePage.prototype, "titleRenderer", void 0);
|
|
403
|
-
__decorate([
|
|
404
|
-
BindableProperty,
|
|
405
|
-
__metadata("design:type", Function)
|
|
406
|
-
], BasePage.prototype, "iconRenderer", void 0);
|
|
407
|
-
__decorate([
|
|
408
|
-
BindableProperty,
|
|
409
|
-
__metadata("design:type", Function)
|
|
410
|
-
], BasePage.prototype, "actionRenderer", void 0);
|
|
411
|
-
__decorate([
|
|
412
|
-
BindableProperty,
|
|
413
|
-
__metadata("design:type", Function)
|
|
414
|
-
], BasePage.prototype, "footerRenderer", void 0);
|
|
415
|
-
__decorate([
|
|
416
|
-
BindableProperty,
|
|
417
|
-
__metadata("design:type", Function)
|
|
418
|
-
], BasePage.prototype, "actionBarRenderer", void 0);
|
|
419
|
-
__decorate([
|
|
420
|
-
BindableProperty,
|
|
421
|
-
__metadata("design:type", Function)
|
|
422
|
-
], BasePage.prototype, "headerRenderer", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
BindableProperty,
|
|
425
|
-
__metadata("design:type", Function)
|
|
426
|
-
], BasePage.prototype, "pullToRefreshRenderer", void 0);
|
|
423
|
+
__decorate([BindableProperty, __metadata("design:type", String)], BasePage.prototype, "closeWarning", void 0);
|
|
424
|
+
__decorate([BindableProperty, __metadata("design:type", String)], BasePage.prototype, "title", void 0);
|
|
425
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "titleRenderer", void 0);
|
|
426
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "iconRenderer", void 0);
|
|
427
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "actionRenderer", void 0);
|
|
428
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "footerRenderer", void 0);
|
|
429
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "actionBarRenderer", void 0);
|
|
430
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "headerRenderer", void 0);
|
|
431
|
+
__decorate([BindableProperty, __metadata("design:type", Function)], BasePage.prototype, "pullToRefreshRenderer", void 0);
|
|
427
432
|
delete BasePage.prototype.init;
|
|
428
|
-
export class ContentPage extends BasePage {
|
|
429
|
-
}
|
|
430
|
-
export class TabbedPage extends BasePage {
|
|
431
|
-
}
|
|
433
|
+
export class ContentPage extends BasePage {}
|
|
434
|
+
export class TabbedPage extends BasePage {}
|
|
432
435
|
export default class MobileApp extends AtomControl {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
436
|
+
static {
|
|
437
|
+
this.drawer = XNode.prepare("drawer", true, true);
|
|
438
|
+
}
|
|
439
|
+
static async pushPage(pageUri, parameters = {}, clearHistory = false) {
|
|
440
|
+
const mobileApp = this.current;
|
|
441
|
+
const page = await AtomLoader.loadClass(pageUri, parameters ?? {}, mobileApp.app);
|
|
442
|
+
const result = await mobileApp.loadPage(page, clearHistory);
|
|
443
|
+
return result;
|
|
444
|
+
}
|
|
445
|
+
popTo(w) {
|
|
446
|
+
this.app.runAsync(async () => {
|
|
447
|
+
while (this.selectedPage !== w) {
|
|
448
|
+
this.selectedPage.cancel();
|
|
449
|
+
await sleep(500);
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
async back() {
|
|
454
|
+
if (this.pages.length === 0) {
|
|
455
|
+
const drawer = this.drawer;
|
|
456
|
+
if (drawer && !this.hideDrawer) {
|
|
457
|
+
const drawerPage = new drawer(this.app);
|
|
458
|
+
const modalClose = ce => {
|
|
459
|
+
let start = ce.target;
|
|
460
|
+
const de = drawerPage.element;
|
|
461
|
+
while (start) {
|
|
462
|
+
if (start === de) {
|
|
463
|
+
return;
|
|
445
464
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}, 10);
|
|
482
|
-
this.hideDrawer = () => {
|
|
483
|
-
this.element.dataset.drawer = "";
|
|
484
|
-
setTimeout(() => {
|
|
485
|
-
const de = drawerPage.element;
|
|
486
|
-
drawerPage.dispose();
|
|
487
|
-
de.remove();
|
|
488
|
-
}, 400);
|
|
489
|
-
this.hideDrawer = undefined;
|
|
490
|
-
};
|
|
491
|
-
return false;
|
|
492
|
-
}
|
|
493
|
-
return true;
|
|
494
|
-
}
|
|
495
|
-
this.selectedPage.cancel("cancelled");
|
|
465
|
+
start = start.parentElement;
|
|
466
|
+
}
|
|
467
|
+
ce.preventDefault();
|
|
468
|
+
ce.stopImmediatePropagation?.();
|
|
469
|
+
ce.target.dispatchEvent(new CustomEvent("closeDrawer", {
|
|
470
|
+
bubbles: true
|
|
471
|
+
}));
|
|
472
|
+
};
|
|
473
|
+
const dispatchCloseDrawer = de => {
|
|
474
|
+
if (de.defaultPrevented) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const target = de.target;
|
|
478
|
+
if (AncestorEnumerator.find(target, x => x === drawerPage.element)) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
de.target.dispatchEvent(new CustomEvent("closeDrawer", {
|
|
482
|
+
bubbles: true
|
|
483
|
+
}));
|
|
484
|
+
};
|
|
485
|
+
this.element.appendChild(drawerPage.element);
|
|
486
|
+
setTimeout(() => {
|
|
487
|
+
this.element.dataset.drawer = "visible";
|
|
488
|
+
drawerPage.bindEvent(this.element, "click", dispatchCloseDrawer);
|
|
489
|
+
drawerPage.bindEvent(document.body, "click", modalClose, null, true);
|
|
490
|
+
}, 10);
|
|
491
|
+
this.hideDrawer = () => {
|
|
492
|
+
this.element.dataset.drawer = "";
|
|
493
|
+
setTimeout(() => {
|
|
494
|
+
const de = drawerPage.element;
|
|
495
|
+
drawerPage.dispose();
|
|
496
|
+
de.remove();
|
|
497
|
+
}, 400);
|
|
498
|
+
this.hideDrawer = undefined;
|
|
499
|
+
};
|
|
496
500
|
return false;
|
|
501
|
+
}
|
|
502
|
+
return true;
|
|
497
503
|
}
|
|
498
|
-
|
|
504
|
+
this.selectedPage.cancel("cancelled");
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
async init() {}
|
|
508
|
+
preCreate() {
|
|
509
|
+
MobileApp.current = this;
|
|
510
|
+
window.addEventListener("backButton", ce => {
|
|
511
|
+
const {
|
|
512
|
+
detail
|
|
513
|
+
} = ce;
|
|
514
|
+
ce.preventDefault();
|
|
515
|
+
this.app.runAsync(async () => {
|
|
516
|
+
if (await this.back()) {
|
|
517
|
+
detail();
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
this.drawer = null;
|
|
522
|
+
this.element.dataset.pageApp = "page-app";
|
|
523
|
+
const container = this.container = document.createElement("div");
|
|
524
|
+
container.dataset.container = "true";
|
|
525
|
+
this.element.appendChild(container);
|
|
526
|
+
this.pages = [];
|
|
527
|
+
this.selectedPage = null;
|
|
528
|
+
this.bindEvent(this.element, "iconClick", e => this.back());
|
|
529
|
+
this.bindEvent(this.element, "closeDrawer", e => {
|
|
530
|
+
this.hideDrawer?.();
|
|
531
|
+
});
|
|
532
|
+
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
533
|
+
}
|
|
534
|
+
async loadPageForReturn(url, clearHistory) {
|
|
535
|
+
this.defaultPage ??= url;
|
|
536
|
+
const page = await AtomLoader.loadControl(url, this.app);
|
|
537
|
+
if (url.query && url.query.title) {
|
|
538
|
+
page.title ||= url.query.title.toString();
|
|
499
539
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
});
|
|
510
|
-
});
|
|
511
|
-
this.drawer = null;
|
|
512
|
-
this.element.dataset.pageApp = "page-app";
|
|
513
|
-
const container = this.container = document.createElement("div");
|
|
514
|
-
container.dataset.container = "true";
|
|
515
|
-
this.element.appendChild(container);
|
|
516
|
-
this.pages = [];
|
|
517
|
-
this.selectedPage = null;
|
|
518
|
-
this.bindEvent(this.element, "iconClick", (e) => this.back());
|
|
519
|
-
this.bindEvent(this.element, "closeDrawer", (e) => {
|
|
520
|
-
this.hideDrawer?.();
|
|
521
|
-
});
|
|
522
|
-
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
540
|
+
const p = await this.loadPage(page, clearHistory);
|
|
541
|
+
try {
|
|
542
|
+
return await p;
|
|
543
|
+
} catch (ex) {
|
|
544
|
+
if ((ex.message ? ex.message : ex) === "cancelled") {
|
|
545
|
+
console.warn(ex);
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
throw ex;
|
|
523
549
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
534
|
-
catch (ex) {
|
|
535
|
-
if ((ex.message ? ex.message : ex) === "cancelled") {
|
|
536
|
-
console.warn(ex);
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
throw ex;
|
|
540
|
-
}
|
|
550
|
+
}
|
|
551
|
+
async loadPage(page, clearHistory) {
|
|
552
|
+
page.title ||= StringHelper.fromPascalToTitleCase(Object.getPrototypeOf(page).constructor.name);
|
|
553
|
+
const {
|
|
554
|
+
parameters
|
|
555
|
+
} = page;
|
|
556
|
+
const route = parameters?.[displayRouteSymbol];
|
|
557
|
+
if (route) {
|
|
558
|
+
page.route = route;
|
|
541
559
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
560
|
+
const selectedPage = this.selectedPage;
|
|
561
|
+
if (selectedPage) {
|
|
562
|
+
selectedPage.hide();
|
|
563
|
+
this.pages.add(selectedPage);
|
|
564
|
+
}
|
|
565
|
+
const hasPages = !clearHistory && this.pages.length;
|
|
566
|
+
if (clearHistory) {
|
|
567
|
+
for (const iterator of this.pages) {
|
|
568
|
+
const e = iterator.element;
|
|
569
|
+
iterator.dispose();
|
|
570
|
+
e.remove();
|
|
571
|
+
}
|
|
572
|
+
this.pages.length = 0;
|
|
573
|
+
this.selectedPage = null;
|
|
574
|
+
}
|
|
575
|
+
if (!hasPages) {
|
|
576
|
+
page.element.dataset.pageState = "ready";
|
|
577
|
+
page.iconClass = "fas fa-bars";
|
|
578
|
+
} else {
|
|
579
|
+
page.iconClass = "fas fa-arrow-left";
|
|
580
|
+
}
|
|
581
|
+
this.container.appendChild(page.element);
|
|
582
|
+
this.selectedPage = page;
|
|
583
|
+
const element = page.element;
|
|
584
|
+
return new Promise((resolve, reject) => {
|
|
585
|
+
const closeFactory = (callback, result) => r => {
|
|
555
586
|
if (clearHistory) {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
iterator.dispose();
|
|
559
|
-
e.remove();
|
|
560
|
-
}
|
|
561
|
-
this.pages.length = 0;
|
|
562
|
-
this.selectedPage = null;
|
|
587
|
+
this.app.runAsync(() => this.loadPageForReturn(this.defaultPage, true));
|
|
588
|
+
return;
|
|
563
589
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
element.removeAttribute("data-page-state");
|
|
581
|
-
const last = this.pages.pop();
|
|
582
|
-
last.show();
|
|
583
|
-
setTimeout(() => {
|
|
584
|
-
page.dispose();
|
|
585
|
-
element.remove();
|
|
586
|
-
callback(r ?? result);
|
|
587
|
-
this.selectedPage = last;
|
|
588
|
-
}, 300);
|
|
589
|
-
};
|
|
590
|
-
const cancel = closeFactory(reject, "cancelled");
|
|
591
|
-
const close = closeFactory(resolve);
|
|
592
|
-
page.cancel = cancel;
|
|
593
|
-
page.close = close;
|
|
594
|
-
});
|
|
595
|
-
}
|
|
590
|
+
element.removeAttribute("data-page-state");
|
|
591
|
+
const last = this.pages.pop();
|
|
592
|
+
last.show();
|
|
593
|
+
setTimeout(() => {
|
|
594
|
+
page.dispose();
|
|
595
|
+
element.remove();
|
|
596
|
+
callback(r ?? result);
|
|
597
|
+
this.selectedPage = last;
|
|
598
|
+
}, 300);
|
|
599
|
+
};
|
|
600
|
+
const cancel = closeFactory(reject, "cancelled");
|
|
601
|
+
const close = closeFactory(resolve);
|
|
602
|
+
page.cancel = cancel;
|
|
603
|
+
page.close = close;
|
|
604
|
+
});
|
|
605
|
+
}
|
|
596
606
|
}
|
|
597
|
-
export const isMobileView = /Android|iPhone/i.test(navigator.userAgent)
|
|
598
|
-
|| (window.visualViewport.width < 500)
|
|
599
|
-
|| window.forceMobileLayout;
|
|
607
|
+
export const isMobileView = /Android|iPhone/i.test(navigator.userAgent) || window.visualViewport.width < 500 || window.forceMobileLayout;
|
|
600
608
|
const isPopupPage = Symbol("isPopupPage");
|
|
601
609
|
class PopupWindowEx extends PopupWindow {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
610
|
+
static {
|
|
611
|
+
_a = isPopupPage;
|
|
612
|
+
}
|
|
613
|
+
static {
|
|
614
|
+
this[_a] = true;
|
|
615
|
+
}
|
|
607
616
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
};
|
|
619
|
-
options.modal ??= true;
|
|
620
|
-
if (options.modal) {
|
|
621
|
-
return page.showModal(options);
|
|
622
|
-
}
|
|
623
|
-
return page.showWindow(options);
|
|
624
|
-
}
|
|
625
|
-
return MobileApp.pushPage(page, parameters, clearHistory);
|
|
617
|
+
const root = isMobileView ? ContentPage : PopupWindowEx;
|
|
618
|
+
export class PopupWindowPage extends root {}
|
|
619
|
+
PageNavigator.pushPageForResult = (page, parameters, clearHistory) => {
|
|
620
|
+
if (!isMobileView && page[isPopupPage]) {
|
|
621
|
+
const popupPage = page;
|
|
622
|
+
const options = {
|
|
623
|
+
...(popupPage.dialogOptions ?? {}),
|
|
624
|
+
parameters: {
|
|
625
|
+
parameters
|
|
626
|
+
}
|
|
626
627
|
};
|
|
627
|
-
|
|
628
|
+
options.modal ??= true;
|
|
629
|
+
if (options.modal) {
|
|
630
|
+
return page.showModal(options);
|
|
631
|
+
}
|
|
632
|
+
return page.showWindow(options);
|
|
633
|
+
}
|
|
634
|
+
return MobileApp.pushPage(page, parameters, clearHistory);
|
|
635
|
+
};
|