@web-atoms/web-controls 2.6.5 → 2.6.7
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/html-editor/InlineHtmlEditor.d.ts +1 -1
- package/dist/html-editor/InlineHtmlEditor.d.ts.map +1 -1
- package/dist/html-editor/InlineHtmlEditor.js +2 -2
- package/dist/html-editor/InlineHtmlEditor.js.map +1 -1
- 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.d.ts +1 -1
- package/dist-esm/html-editor/InlineHtmlEditor.d.ts.map +1 -1
- package/dist-esm/html-editor/InlineHtmlEditor.js +175 -167
- package/dist-esm/html-editor/InlineHtmlEditor.js.map +1 -1
- 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
- package/src/html-editor/InlineHtmlEditor.tsx +1 -1
|
@@ -1,99 +1,110 @@
|
|
|
1
1
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
2
2
|
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
|
|
3
3
|
import AtomPopover from "./elements/AtomPopover.js";
|
|
4
|
-
export default function InlinePopupButton({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default function InlinePopupButton({
|
|
5
|
+
icon,
|
|
6
|
+
text,
|
|
7
|
+
label,
|
|
8
|
+
closeOnClick = true,
|
|
9
|
+
popup,
|
|
10
|
+
...a
|
|
11
|
+
}, ...nodes) {
|
|
12
|
+
if (!a["anchor-right"]) {
|
|
13
|
+
a["anchor-left"] ??= "parent-right";
|
|
14
|
+
}
|
|
15
|
+
if (!a["anchor-bottom"]) {
|
|
16
|
+
a["anchor-top"] ??= "parent-top";
|
|
17
|
+
}
|
|
18
|
+
a["data-atom-popup-button"] = "popup-button";
|
|
19
|
+
if (!popup) {
|
|
20
|
+
const copy = nodes;
|
|
21
|
+
const div = XNode.create("div", null, ...copy);
|
|
22
|
+
popup = () => div;
|
|
23
|
+
nodes = [];
|
|
24
|
+
}
|
|
25
|
+
a["popupFactory"] = popup;
|
|
26
|
+
if (closeOnClick) {
|
|
27
|
+
a["data-close-on-click"] = true;
|
|
28
|
+
}
|
|
29
|
+
if (!a["data-layout"]) {
|
|
30
|
+
if (icon && text) {
|
|
31
|
+
a["data-layout"] = "icon-button";
|
|
32
|
+
} else {
|
|
33
|
+
a["data-layout"] = "button";
|
|
7
34
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
a["data-close-on-click"] = true;
|
|
21
|
-
}
|
|
22
|
-
if (!a["data-layout"]) {
|
|
23
|
-
if (icon && text) {
|
|
24
|
-
a["data-layout"] = "icon-button";
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
a["data-layout"] = "button";
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return XNode.create("button", { "data-inline-popup-button": "inline-popup-button", "data-atom-popup-button": "1", ...a },
|
|
31
|
-
icon && XNode.create("i", { class: icon }),
|
|
32
|
-
text && XNode.create("span", { text: text }),
|
|
33
|
-
label && XNode.create("label", { text: text }),
|
|
34
|
-
...nodes);
|
|
35
|
+
}
|
|
36
|
+
return XNode.create("button", {
|
|
37
|
+
"data-inline-popup-button": "inline-popup-button",
|
|
38
|
+
"data-atom-popup-button": "1",
|
|
39
|
+
...a
|
|
40
|
+
}, icon && XNode.create("i", {
|
|
41
|
+
class: icon
|
|
42
|
+
}), text && XNode.create("span", {
|
|
43
|
+
text: text
|
|
44
|
+
}), label && XNode.create("label", {
|
|
45
|
+
text: text
|
|
46
|
+
}), ...nodes);
|
|
35
47
|
}
|
|
36
|
-
document.body.addEventListener("click",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
document.body.addEventListener("click", e => {
|
|
49
|
+
let start = e.target;
|
|
50
|
+
while (start) {
|
|
51
|
+
if (start.hasAttribute("data-atom-popup-button")) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
start = start.parentElement;
|
|
55
|
+
}
|
|
56
|
+
if (!start) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const pf = start["popupFactory"];
|
|
60
|
+
if (!pf) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const control = AtomControl.from(start);
|
|
64
|
+
const app = control.app;
|
|
65
|
+
const target = start;
|
|
66
|
+
const element = control.element;
|
|
67
|
+
const dataFactory = () => {
|
|
68
|
+
let itemIndex;
|
|
69
|
+
let data;
|
|
70
|
+
if (control.items && control.itemRenderer) {
|
|
71
|
+
while (start && start !== element) {
|
|
72
|
+
itemIndex ??= start.getAttribute("data-item-index");
|
|
73
|
+
if (itemIndex) {
|
|
74
|
+
data = control.items[~~itemIndex];
|
|
75
|
+
break;
|
|
41
76
|
}
|
|
42
77
|
start = start.parentElement;
|
|
78
|
+
}
|
|
43
79
|
}
|
|
44
|
-
if (!
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const app = control.app;
|
|
53
|
-
const target = start;
|
|
54
|
-
const element = control.element;
|
|
55
|
-
const dataFactory = () => {
|
|
56
|
-
let itemIndex;
|
|
57
|
-
let data;
|
|
58
|
-
if (control.items && control.itemRenderer) {
|
|
59
|
-
while (start && start !== element) {
|
|
60
|
-
itemIndex ??= start.getAttribute("data-item-index");
|
|
61
|
-
if (itemIndex) {
|
|
62
|
-
data = control.items[~~itemIndex];
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
start = start.parentElement;
|
|
80
|
+
if (!data) {
|
|
81
|
+
data = new Proxy(target, {
|
|
82
|
+
get(t, p, receiver) {
|
|
83
|
+
let s = target;
|
|
84
|
+
while (s) {
|
|
85
|
+
const v = s.dataset[p];
|
|
86
|
+
if (v !== void 0) {
|
|
87
|
+
return v;
|
|
66
88
|
}
|
|
89
|
+
s = s.parentElement;
|
|
90
|
+
}
|
|
67
91
|
}
|
|
68
|
-
|
|
69
|
-
data = new Proxy(target, {
|
|
70
|
-
get(t, p, receiver) {
|
|
71
|
-
let s = target;
|
|
72
|
-
while (s) {
|
|
73
|
-
const v = s.dataset[p];
|
|
74
|
-
if (v !== void 0) {
|
|
75
|
-
return v;
|
|
76
|
-
}
|
|
77
|
-
s = s.parentElement;
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
let closeOnClick = void 0;
|
|
85
|
-
const dataCloseOnClick = target.getAttribute("data-close-on-click");
|
|
86
|
-
if (dataCloseOnClick) {
|
|
87
|
-
closeOnClick = /^(true|yes|1)$/i.test(dataCloseOnClick);
|
|
92
|
+
});
|
|
88
93
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
return data;
|
|
95
|
+
};
|
|
96
|
+
let closeOnClick = void 0;
|
|
97
|
+
const dataCloseOnClick = target.getAttribute("data-close-on-click");
|
|
98
|
+
if (dataCloseOnClick) {
|
|
99
|
+
closeOnClick = /^(true|yes|1)$/i.test(dataCloseOnClick);
|
|
100
|
+
}
|
|
101
|
+
AtomPopover.create(target, {
|
|
102
|
+
nodeFactory: data => pf(data),
|
|
103
|
+
dataFactory,
|
|
104
|
+
closeOnClick,
|
|
105
|
+
"anchor-bottom": target.getAttribute("anchor-bottom"),
|
|
106
|
+
"anchor-top": target.getAttribute("anchor-top"),
|
|
107
|
+
"anchor-left": target.getAttribute("anchor-left"),
|
|
108
|
+
"anchor-right": target.getAttribute("anchor-right")
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { PopupControl } from "@web-atoms/core/dist/web/services/PopupService.js";
|
|
2
2
|
export default class InlinePopupControl extends PopupControl {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
static showPopup(opener, popup, options = {}) {
|
|
4
|
+
const c = class extends InlinePopupControl {
|
|
5
|
+
create() {
|
|
6
|
+
this.render(popup);
|
|
7
|
+
}
|
|
8
|
+
dispatchClickEvent(e, data) {
|
|
9
|
+
let start = this.element.parentElement;
|
|
10
|
+
while (start) {
|
|
11
|
+
const {
|
|
12
|
+
atomControl
|
|
13
|
+
} = start;
|
|
14
|
+
if (atomControl) {
|
|
15
|
+
atomControl.dispatchClickEvent(e, data);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
start = start.parentElement;
|
|
19
|
+
}
|
|
20
|
+
super.dispatchClickEvent(e, data);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
options.popupStyle = ".no-style";
|
|
24
|
+
return c.showControl(opener, options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,69 +1,68 @@
|
|
|
1
1
|
const get = (start, path) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
item = item[iterator];
|
|
2
|
+
let item = start;
|
|
3
|
+
for (const iterator of path.split(".")) {
|
|
4
|
+
if (iterator === "$") {
|
|
5
|
+
item = start;
|
|
6
|
+
continue;
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
item = item[iterator];
|
|
9
|
+
}
|
|
10
|
+
return item;
|
|
11
11
|
};
|
|
12
12
|
function* getFragments(path) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
yield [m[1].trim(), m[2].trim()];
|
|
13
|
+
const regex = /([^\=\:]+)\s*[\=\:]\s*((('[^\\']*(((\\')|(''))[^\\']*)*')|("[^\\"]*(((\\")|(""))[^\\"]*)*"))|([^\,\;]+))\s*[\,\;]?\s*/gmi;
|
|
14
|
+
let m;
|
|
15
|
+
while ((m = regex.exec(path)) !== null) {
|
|
16
|
+
if (m.index === regex.lastIndex) {
|
|
17
|
+
regex.lastIndex++;
|
|
20
18
|
}
|
|
19
|
+
yield [m[1].trim(), m[2].trim()];
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
22
|
export default class ItemPath {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
if (/^[\{\"]/.test(path)) {
|
|
28
|
-
const json = JSON.parse(path);
|
|
29
|
-
return json;
|
|
30
|
-
}
|
|
31
|
-
const target = {};
|
|
32
|
-
this.build(item, path, target);
|
|
33
|
-
return target;
|
|
23
|
+
static get(item, path) {
|
|
24
|
+
if (path.startsWith("$.")) {
|
|
25
|
+
return get(item, path);
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
value = get(item, value);
|
|
39
|
-
target[key] = value;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
if (value.startsWith('"')) {
|
|
43
|
-
value = JSON.parse(value);
|
|
44
|
-
target[key] = value;
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (value.startsWith("'")) {
|
|
48
|
-
value = value.substring(1, value.length - 1);
|
|
49
|
-
value = value.replace(/((\'\')|(\\\'))/, "'");
|
|
50
|
-
target[key] = value;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (value === "true") {
|
|
54
|
-
target[key] = true;
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (value === "false") {
|
|
58
|
-
target[key] = false;
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
if (value === "null") {
|
|
62
|
-
target[key] = null;
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
target[key] = Number(value);
|
|
66
|
-
}
|
|
27
|
+
if (/^[\{\"]/.test(path)) {
|
|
28
|
+
const json = JSON.parse(path);
|
|
29
|
+
return json;
|
|
67
30
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
31
|
+
const target = {};
|
|
32
|
+
this.build(item, path, target);
|
|
33
|
+
return target;
|
|
34
|
+
}
|
|
35
|
+
static build(item, path, target) {
|
|
36
|
+
for (let [key, value] of getFragments(path)) {
|
|
37
|
+
if (value.startsWith("$")) {
|
|
38
|
+
value = get(item, value);
|
|
39
|
+
target[key] = value;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (value.startsWith('"')) {
|
|
43
|
+
value = JSON.parse(value);
|
|
44
|
+
target[key] = value;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (value.startsWith("'")) {
|
|
48
|
+
value = value.substring(1, value.length - 1);
|
|
49
|
+
value = value.replace(/((\'\')|(\\\'))/, "'");
|
|
50
|
+
target[key] = value;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (value === "true") {
|
|
54
|
+
target[key] = true;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (value === "false") {
|
|
58
|
+
target[key] = false;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (value === "null") {
|
|
62
|
+
target[key] = null;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
target[key] = Number(value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,42 +1,53 @@
|
|
|
1
1
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
2
|
-
import
|
|
3
|
-
const toggleDetails =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
2
|
+
ESMPack.installStyleSheet(import.meta.resolve("../styles/limited-text.global.css"));
|
|
3
|
+
const toggleDetails = e => {
|
|
4
|
+
let start = e.target;
|
|
5
|
+
if (e.defaultPrevented) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
start = start.parentElement;
|
|
9
|
+
const container = start;
|
|
10
|
+
start = start?.parentElement;
|
|
11
|
+
if (!start || start.getAttribute("data-limited-text") !== "limited-text") {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
e.stopImmediatePropagation();
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
if (start.getAttribute("data-mode") === "collapsed") {
|
|
18
|
+
start.setAttribute("data-mode", "open");
|
|
19
|
+
start.style.maxHeight = "";
|
|
20
|
+
container.style.top = "";
|
|
21
|
+
} else {
|
|
22
|
+
const h = start.getAttribute("data-max-height");
|
|
23
|
+
start.style.maxHeight = h;
|
|
24
|
+
container.style.top = h;
|
|
25
|
+
start.setAttribute("data-mode", "collapsed");
|
|
26
|
+
}
|
|
28
27
|
};
|
|
29
28
|
let setEventHandler = () => {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
document.body.addEventListener("click", toggleDetails);
|
|
30
|
+
setEventHandler = null;
|
|
32
31
|
};
|
|
33
|
-
export default function LimitedText({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
export default function LimitedText({
|
|
33
|
+
text = "",
|
|
34
|
+
height = 100,
|
|
35
|
+
...a
|
|
36
|
+
}, ...nodes) {
|
|
37
|
+
setEventHandler?.();
|
|
38
|
+
const h = typeof height === "number" ? `${height}px` : height;
|
|
39
|
+
return XNode.create("div", {
|
|
40
|
+
"data-mode": "collapsed",
|
|
41
|
+
"data-max-height": h,
|
|
42
|
+
"style-max-height": h,
|
|
43
|
+
"data-limited-text": "limited-text",
|
|
44
|
+
...a
|
|
45
|
+
}, text && XNode.create("p", {
|
|
46
|
+
text: text
|
|
47
|
+
}), ...nodes, XNode.create("div", {
|
|
48
|
+
"style-top": h,
|
|
49
|
+
"data-element": "more"
|
|
50
|
+
}, XNode.create("button", {
|
|
51
|
+
class: "fa-solid fa-angles-up"
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import AtomRepeater from "./AtomRepeater.js";
|
|
2
|
-
import
|
|
2
|
+
ESMPack.installStyleSheet(import.meta.resolve("./styles/list-repeater.global.css"));
|
|
3
3
|
export default class ListRepeater extends AtomRepeater {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=ListRepeater.js.map
|
|
4
|
+
get autoSelectOnClick() {
|
|
5
|
+
return this.selectOnClick;
|
|
6
|
+
}
|
|
7
|
+
set autoSelectOnClick(value) {
|
|
8
|
+
this.selectOnClick = value;
|
|
9
|
+
}
|
|
10
|
+
preCreate() {
|
|
11
|
+
super.preCreate();
|
|
12
|
+
this.autoSelectOnClick = true;
|
|
13
|
+
this.element.setAttribute("data-list-repeater", "list-repeater");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
import XNode from "@web-atoms/core/dist/core/XNode.js";
|
|
2
|
-
import
|
|
3
|
-
const updateMask =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
result += element;
|
|
23
|
-
break;
|
|
2
|
+
ESMPack.installStyleSheet(import.meta.resolve("./styles/masked-input.global.css"));
|
|
3
|
+
const updateMask = e => {
|
|
4
|
+
const target = e.target;
|
|
5
|
+
const mask = target.dataset.mask;
|
|
6
|
+
if (!mask) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
let result = "";
|
|
10
|
+
const value = target.value;
|
|
11
|
+
for (let index = 0, elementIndex = 0; elementIndex < value.length; elementIndex++, index++) {
|
|
12
|
+
const element = value[elementIndex];
|
|
13
|
+
const maskElement = mask[index];
|
|
14
|
+
switch (maskElement) {
|
|
15
|
+
case "#":
|
|
16
|
+
result += /[0-9]/.test(element) ? element : "";
|
|
17
|
+
continue;
|
|
18
|
+
case ".":
|
|
19
|
+
if (element !== ".") {
|
|
20
|
+
result += ".";
|
|
24
21
|
}
|
|
22
|
+
result += element;
|
|
23
|
+
break;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
}
|
|
26
|
+
if (target.value !== result) {
|
|
27
|
+
target.value = result;
|
|
28
|
+
}
|
|
29
29
|
};
|
|
30
|
-
export default function MaskedInput({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
export default function MaskedInput({
|
|
31
|
+
mask,
|
|
32
|
+
...a
|
|
33
|
+
}) {
|
|
34
|
+
return XNode.create("input", {
|
|
35
|
+
"data-mask": mask,
|
|
36
|
+
"event-change": updateMask,
|
|
37
|
+
"event-keypress": updateMask,
|
|
38
|
+
"event-keyup": updateMask,
|
|
39
|
+
...a
|
|
40
|
+
});
|
|
41
|
+
}
|