@web-atoms/web-controls 2.6.5 → 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.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/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.js +78 -106
- package/dist-esm/basic/Editable.js +82 -77
- package/dist-esm/basic/Expander.js +104 -86
- 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.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.js +270 -253
- package/dist-esm/basic/elements/getContainingBlock.js +34 -35
- package/dist-esm/basic/elements/relativeRect.js +40 -21
- 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/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/ChangeFont.js +42 -42
- 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.js +5 -4
- package/dist-esm/html-editor/commands/Source.js +29 -25
- 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.js +153 -152
- package/dist-esm/mobile-app/MobileApp.js +577 -569
- 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/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/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.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.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.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.pack.js +38 -0
- package/dist-esm/tests/basic/zoom/ZoomViewTest.js +13 -13
- 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/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
|
@@ -3,80 +3,40 @@ import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
|
3
3
|
import { MenuItem } from "../../basic/PopupButton.js";
|
|
4
4
|
import PopupMenu from "../../basic/PopupMenu.js";
|
|
5
5
|
export default class PopOverTest extends AtomControl {
|
|
6
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
XNode.create(MenuItem, { label: "As Attachment" })) }, "Forward"),
|
|
44
|
-
XNode.create("br", null),
|
|
45
|
-
XNode.create("br", null),
|
|
46
|
-
XNode.create("br", null),
|
|
47
|
-
XNode.create("br", null),
|
|
48
|
-
XNode.create("br", null),
|
|
49
|
-
XNode.create("br", null),
|
|
50
|
-
XNode.create("br", null),
|
|
51
|
-
XNode.create("br", null),
|
|
52
|
-
XNode.create("br", null),
|
|
53
|
-
XNode.create("br", null),
|
|
54
|
-
XNode.create("br", null),
|
|
55
|
-
XNode.create("br", null)),
|
|
56
|
-
XNode.create("br", null),
|
|
57
|
-
XNode.create("br", null),
|
|
58
|
-
XNode.create("br", null),
|
|
59
|
-
XNode.create("br", null),
|
|
60
|
-
XNode.create("br", null),
|
|
61
|
-
XNode.create("br", null),
|
|
62
|
-
XNode.create("br", null),
|
|
63
|
-
XNode.create("br", null),
|
|
64
|
-
XNode.create("br", null),
|
|
65
|
-
XNode.create("br", null),
|
|
66
|
-
XNode.create("br", null),
|
|
67
|
-
XNode.create("br", null),
|
|
68
|
-
XNode.create("br", null),
|
|
69
|
-
XNode.create("br", null),
|
|
70
|
-
XNode.create("br", null),
|
|
71
|
-
XNode.create("br", null),
|
|
72
|
-
XNode.create("br", null),
|
|
73
|
-
XNode.create("br", null),
|
|
74
|
-
XNode.create("br", null),
|
|
75
|
-
XNode.create("br", null),
|
|
76
|
-
XNode.create("br", null),
|
|
77
|
-
XNode.create("br", null),
|
|
78
|
-
XNode.create("br", null),
|
|
79
|
-
XNode.create("br", null));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=PopOverTest.js.map
|
|
6
|
+
constructor(app, e) {
|
|
7
|
+
super(app, e);
|
|
8
|
+
this.pushInit();
|
|
9
|
+
}
|
|
10
|
+
init() {
|
|
11
|
+
this.renderer = XNode.create("div", null, XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("div", {
|
|
12
|
+
style: "position: relative"
|
|
13
|
+
}, XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create(PopupMenu, {
|
|
14
|
+
"anchor-left": "parent-right",
|
|
15
|
+
popup: () => XNode.create("div", null, XNode.create(MenuItem, {
|
|
16
|
+
label: "As Inline"
|
|
17
|
+
}), XNode.create(MenuItem, {
|
|
18
|
+
label: "As Attachment"
|
|
19
|
+
}), XNode.create(MenuItem, {
|
|
20
|
+
label: "As Inline"
|
|
21
|
+
}), XNode.create(MenuItem, {
|
|
22
|
+
label: "As Attachment"
|
|
23
|
+
}), XNode.create(MenuItem, {
|
|
24
|
+
label: "As Inline"
|
|
25
|
+
}), XNode.create(MenuItem, {
|
|
26
|
+
label: "As Attachment"
|
|
27
|
+
}), XNode.create(MenuItem, {
|
|
28
|
+
label: "As Inline"
|
|
29
|
+
}), XNode.create(MenuItem, {
|
|
30
|
+
label: "As Attachment"
|
|
31
|
+
}), XNode.create(MenuItem, {
|
|
32
|
+
label: "As Inline"
|
|
33
|
+
}), XNode.create(MenuItem, {
|
|
34
|
+
label: "As Attachment"
|
|
35
|
+
}), XNode.create(MenuItem, {
|
|
36
|
+
label: "As Inline"
|
|
37
|
+
}), XNode.create(MenuItem, {
|
|
38
|
+
label: "As Attachment"
|
|
39
|
+
}))
|
|
40
|
+
}, "Forward"), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null)), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null), XNode.create("br", null));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -3,11 +3,12 @@ import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
|
3
3
|
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
4
4
|
import Switch from "../../basic/Switch.js";
|
|
5
5
|
export default class SwitchTest extends AtomControl {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
6
|
+
create() {
|
|
7
|
+
this.ready = false;
|
|
8
|
+
this.render(XNode.create("div", null, XNode.create(Switch, {
|
|
9
|
+
checked: Bind.twoWays(() => this.ready)
|
|
10
|
+
}), XNode.create("span", {
|
|
11
|
+
text: Bind.oneWay(() => this.ready ? "On" : "Off")
|
|
12
|
+
})));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -3,28 +3,21 @@ import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
|
3
3
|
import Pack from "@web-atoms/core/dist/Pack.js";
|
|
4
4
|
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
5
5
|
import AtomToggleView, { ToggleView } from "../../toggle-view/AtomToggleView.js";
|
|
6
|
-
import
|
|
6
|
+
ESMPack.installStyleSheet(import.meta.resolve("./ToggleView.local.css"));
|
|
7
7
|
const css = "toggle-view-test";
|
|
8
8
|
let ToggleViewTest = class ToggleViewTest extends AtomControl {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
XNode.create("div", null,
|
|
22
|
-
XNode.create("h3", null, "Third View"),
|
|
23
|
-
XNode.create("div", null, "Third View Content"))))));
|
|
24
|
-
}
|
|
9
|
+
create() {
|
|
10
|
+
this.render(XNode.create("div", {
|
|
11
|
+
class: css
|
|
12
|
+
}, XNode.create(AtomToggleView, null, XNode.create(ToggleView, {
|
|
13
|
+
icon: "fad fa-plus",
|
|
14
|
+
label: "First"
|
|
15
|
+
}, XNode.create("div", null, XNode.create("h3", null, "First View"), XNode.create("div", null, "First View Content"))), XNode.create(ToggleView, {
|
|
16
|
+
label: "Second"
|
|
17
|
+
}, XNode.create("div", null, XNode.create("h3", null, "Second View"), XNode.create("div", null, "Second View Content"))), XNode.create(ToggleView, {
|
|
18
|
+
label: "Third"
|
|
19
|
+
}, XNode.create("div", null, XNode.create("h3", null, "Third View"), XNode.create("div", null, "Third View Content"))))));
|
|
20
|
+
}
|
|
25
21
|
};
|
|
26
|
-
ToggleViewTest = __decorate([
|
|
27
|
-
|
|
28
|
-
], ToggleViewTest);
|
|
29
|
-
export default ToggleViewTest;
|
|
30
|
-
//# sourceMappingURL=ToggleViewTest.js.map
|
|
22
|
+
ToggleViewTest = __decorate([Pack], ToggleViewTest);
|
|
23
|
+
export default ToggleViewTest;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "@web-atoms/core/dist/core/XNode.js";
|
|
2
|
+
import "@web-atoms/core/dist/Pack.js";
|
|
3
|
+
import "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
4
|
+
import "@web-atoms/web-controls/dist-esm/toggle-view/AtomToggleView.js";
|
|
5
|
+
import "@web-atoms/core/dist/core/Bind.js";
|
|
6
|
+
import "@web-atoms/core/dist/core/BindableProperty.js";
|
|
7
|
+
import "@web-atoms/core/dist/view-model/Action.js";
|
|
8
|
+
import "@web-atoms/core/dist/core/AtomComponent.js";
|
|
9
|
+
import "@web-atoms/core/dist/core/Command.js";
|
|
10
|
+
import "@web-atoms/core/dist/core/FormattedString.js";
|
|
11
|
+
import "@web-atoms/core/dist/core/Hacks.js";
|
|
12
|
+
import "@web-atoms/core/dist/core/WebImage.js";
|
|
13
|
+
import "@web-atoms/core/dist/core/ExpressionParser.js";
|
|
14
|
+
import "@web-atoms/core/dist/core/types.js";
|
|
15
|
+
import "@web-atoms/core/dist/core/AtomBinder.js";
|
|
16
|
+
import "@web-atoms/core/dist/App.js";
|
|
17
|
+
import "@web-atoms/core/dist/core/EventScope.js";
|
|
18
|
+
import "@web-atoms/core/dist/core/StringHelper.js";
|
|
19
|
+
import "@web-atoms/core/dist/services/http/JsonError.js";
|
|
20
|
+
import "@web-atoms/core/dist/web/services/PopupService.js";
|
|
21
|
+
import "@web-atoms/core/dist/core/Route.js";
|
|
22
|
+
import "@web-atoms/core/dist/di/Inject.js";
|
|
23
|
+
import "@web-atoms/core/dist/core/AtomDisposableList.js";
|
|
24
|
+
import "@web-atoms/core/dist/core/AtomWatcher.js";
|
|
25
|
+
import "@web-atoms/core/dist/core/InheritedProperty.js";
|
|
26
|
+
import "@web-atoms/core/dist/core/PropertyMap.js";
|
|
27
|
+
import "@web-atoms/core/dist/web/core/AtomUI.js";
|
|
28
|
+
import "@web-atoms/core/dist/core/AtomMap.js";
|
|
29
|
+
import "@web-atoms/date-time/dist/DateTime.js";
|
|
30
|
+
import "@web-atoms/core/dist/core/AtomDispatcher.js";
|
|
31
|
+
import "@web-atoms/core/dist/di/RegisterSingleton.js";
|
|
32
|
+
import "@web-atoms/core/dist/di/ServiceProvider.js";
|
|
33
|
+
import "@web-atoms/core/dist/services/BusyIndicatorService.js";
|
|
34
|
+
import "@web-atoms/core/dist/core/AtomList.js";
|
|
35
|
+
import "@web-atoms/date-time/dist/TimeSpan.js";
|
|
36
|
+
import "@web-atoms/core/dist/web/services/LastTarget.js";
|
|
37
|
+
import "@web-atoms/core/dist/web/services/NotificationPopup.js";
|
|
38
|
+
import "@web-atoms/core/dist/web/services/PopupWindow.js";
|
|
39
|
+
import "@web-atoms/core/dist/di/TypeKey.js";
|
|
40
|
+
import "@web-atoms/core/dist/di/Register.js";
|
|
41
|
+
import "@web-atoms/core/dist/di/ServiceCollection.js";
|
|
42
|
+
import "@web-atoms/core/dist/core/TransientDisposable.js";
|
|
43
|
+
import "@web-atoms/core/dist/core/sleep.js";
|
|
44
|
+
import app from "@web-atoms/web-controls/dist-esm/tests/toggle-view/ToggleViewTest.js";
|
|
45
|
+
export default app;
|
|
@@ -2,80 +2,84 @@ 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 { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
5
|
-
import
|
|
5
|
+
ESMPack.installStyleSheet(import.meta.resolve("../basic/styles/toggle-view.global.css"));
|
|
6
6
|
import Action from "@web-atoms/core/dist/view-model/Action.js";
|
|
7
|
-
export function ToggleView({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export function ToggleView({
|
|
8
|
+
icon,
|
|
9
|
+
label
|
|
10
|
+
}, ...nodes) {
|
|
11
|
+
return XNode.create("div", null, XNode.create("div", null, XNode.create("i", {
|
|
12
|
+
class: icon
|
|
13
|
+
}), XNode.create("label", {
|
|
14
|
+
text: label
|
|
15
|
+
})), XNode.create("div", null, ...nodes));
|
|
13
16
|
}
|
|
14
|
-
export default function AtomToggleView({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
export default function AtomToggleView({
|
|
18
|
+
selectedIndex,
|
|
19
|
+
...a
|
|
20
|
+
}, ...nodes) {
|
|
21
|
+
const headers = [];
|
|
22
|
+
const views = [];
|
|
23
|
+
let n = 0;
|
|
24
|
+
for (const iterator of nodes) {
|
|
25
|
+
const i = n++;
|
|
26
|
+
const header = iterator.children[0];
|
|
27
|
+
const ha = header.attributes ??= {};
|
|
28
|
+
ha["data-element"] = "header";
|
|
29
|
+
ha["data-click-event"] = "header-click";
|
|
30
|
+
ha["data-header-index"] = i.toString();
|
|
31
|
+
const view = iterator.children[1];
|
|
32
|
+
const a = view.attributes ??= {};
|
|
33
|
+
a["data-element"] = "view";
|
|
34
|
+
a["data-left"] = i < selectedIndex;
|
|
35
|
+
a["data-right"] = i > selectedIndex;
|
|
36
|
+
a["data-selected"] = i === selectedIndex;
|
|
37
|
+
headers.push(header);
|
|
38
|
+
views.push(view);
|
|
39
|
+
}
|
|
40
|
+
class AtomToggleViewControl extends AtomControl {
|
|
41
|
+
onPropertyChanged(name) {
|
|
42
|
+
super.onPropertyChanged(name);
|
|
43
|
+
if (name === "selectedIndex") {
|
|
44
|
+
this.updateViews();
|
|
45
|
+
}
|
|
33
46
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (name === "selectedIndex") {
|
|
38
|
-
this.updateViews();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
preCreate() {
|
|
42
|
-
this.selectedIndex = 0;
|
|
43
|
-
this.runAfterInit(() => this.updateViews());
|
|
44
|
-
}
|
|
45
|
-
onHeaderClick({ headerIndex }) {
|
|
46
|
-
this.selectedIndex = parseInt(headerIndex, 0);
|
|
47
|
-
}
|
|
48
|
-
updateViews() {
|
|
49
|
-
const pe = this.element.parentElement;
|
|
50
|
-
if (!pe) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let ai = 0;
|
|
54
|
-
for (const child of Array.from(pe.querySelectorAll(`[data-element="view"]`))) {
|
|
55
|
-
const i = ai++;
|
|
56
|
-
child.setAttribute("data-left", (i < this.selectedIndex).toString());
|
|
57
|
-
child.setAttribute("data-right", (i > this.selectedIndex).toString());
|
|
58
|
-
child.setAttribute("data-selected", (i === this.selectedIndex).toString());
|
|
59
|
-
}
|
|
60
|
-
ai = 0;
|
|
61
|
-
for (const child of Array.from(pe.querySelectorAll(`[data-element="header"]`))) {
|
|
62
|
-
const i = ai++;
|
|
63
|
-
child.setAttribute("data-selected", (i === this.selectedIndex).toString());
|
|
64
|
-
}
|
|
65
|
-
}
|
|
47
|
+
preCreate() {
|
|
48
|
+
this.selectedIndex = 0;
|
|
49
|
+
this.runAfterInit(() => this.updateViews());
|
|
66
50
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
onHeaderClick({
|
|
52
|
+
headerIndex
|
|
53
|
+
}) {
|
|
54
|
+
this.selectedIndex = parseInt(headerIndex, 0);
|
|
55
|
+
}
|
|
56
|
+
updateViews() {
|
|
57
|
+
const pe = this.element.parentElement;
|
|
58
|
+
if (!pe) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let ai = 0;
|
|
62
|
+
for (const child of Array.from(pe.querySelectorAll(`[data-element="view"]`))) {
|
|
63
|
+
const i = ai++;
|
|
64
|
+
child.setAttribute("data-left", (i < this.selectedIndex).toString());
|
|
65
|
+
child.setAttribute("data-right", (i > this.selectedIndex).toString());
|
|
66
|
+
child.setAttribute("data-selected", (i === this.selectedIndex).toString());
|
|
67
|
+
}
|
|
68
|
+
ai = 0;
|
|
69
|
+
for (const child of Array.from(pe.querySelectorAll(`[data-element="header"]`))) {
|
|
70
|
+
const i = ai++;
|
|
71
|
+
child.setAttribute("data-selected", (i === this.selectedIndex).toString());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
__decorate([BindableProperty, __metadata("design:type", Number)], AtomToggleViewControl.prototype, "selectedIndex", void 0);
|
|
76
|
+
__decorate([Action({
|
|
77
|
+
onEvent: "header-click"
|
|
78
|
+
}), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], AtomToggleViewControl.prototype, "onHeaderClick", null);
|
|
79
|
+
return XNode.create("div", {
|
|
80
|
+
...a,
|
|
81
|
+
"data-wa-toggle-view": "wa-toggle-view"
|
|
82
|
+
}, XNode.create(AtomToggleViewControl, {
|
|
83
|
+
class: "toolbar"
|
|
84
|
+
}, ...headers), ...views);
|
|
85
|
+
}
|