@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.
Files changed (185) hide show
  1. package/dist/html-editor/InlineHtmlEditor.d.ts +1 -1
  2. package/dist/html-editor/InlineHtmlEditor.d.ts.map +1 -1
  3. package/dist/html-editor/InlineHtmlEditor.js +2 -2
  4. package/dist/html-editor/InlineHtmlEditor.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/dist-esm/ArrayLike.js +14 -12
  7. package/dist-esm/DataAttributes.js +18 -19
  8. package/dist-esm/Focusable.js +10 -11
  9. package/dist-esm/ModuleFiles.js +43 -42
  10. package/dist-esm/NumberFormats.js +60 -56
  11. package/dist-esm/PageNavigator.js +28 -30
  12. package/dist-esm/animations/Animations.js +36 -33
  13. package/dist-esm/basic/AtomChips.js +312 -305
  14. package/dist-esm/basic/AtomRepeater.js +1070 -1035
  15. package/dist-esm/basic/AtomSuggestions.js +97 -107
  16. package/dist-esm/basic/AttachedPopup.js +0 -1
  17. package/dist-esm/basic/Button.js +45 -19
  18. package/dist-esm/basic/ButtonBar.js +84 -64
  19. package/dist-esm/basic/Calendar.js +211 -203
  20. package/dist-esm/basic/CheckBoxList.js +90 -70
  21. package/dist-esm/basic/Checkbox.js +16 -8
  22. package/dist-esm/basic/Chip.js +36 -12
  23. package/dist-esm/basic/ComboBox.js +47 -51
  24. package/dist-esm/basic/DataGrid.js +258 -252
  25. package/dist-esm/basic/DateField.js +149 -127
  26. package/dist-esm/basic/DropDown.js +91 -103
  27. package/dist-esm/basic/DropDownInput.js +78 -106
  28. package/dist-esm/basic/Editable.js +82 -77
  29. package/dist-esm/basic/Expander.js +104 -86
  30. package/dist-esm/basic/FilesDragDrop.js +84 -80
  31. package/dist-esm/basic/Form.js +80 -52
  32. package/dist-esm/basic/FormField.js +164 -106
  33. package/dist-esm/basic/IElement.js +1 -2
  34. package/dist-esm/basic/InlinePopup.js +263 -234
  35. package/dist-esm/basic/InlinePopupButton.js +99 -88
  36. package/dist-esm/basic/InlinePopupControl.js +24 -23
  37. package/dist-esm/basic/ItemPath.js +59 -60
  38. package/dist-esm/basic/LimitedText.js +49 -38
  39. package/dist-esm/basic/ListRepeater.js +13 -14
  40. package/dist-esm/basic/MaskedInput.js +37 -29
  41. package/dist-esm/basic/MaskedInputDiv.js +55 -48
  42. package/dist-esm/basic/MergeNode.js +64 -35
  43. package/dist-esm/basic/PasswordBox.js +32 -17
  44. package/dist-esm/basic/PinchZoomView.js +221 -199
  45. package/dist-esm/basic/PopupButton.js +39 -16
  46. package/dist-esm/basic/PopupMenu.js +3 -4
  47. package/dist-esm/basic/RadioButtonList.js +35 -25
  48. package/dist-esm/basic/RefreshLock.js +41 -42
  49. package/dist-esm/basic/Resizable.js +43 -33
  50. package/dist-esm/basic/Select.js +72 -65
  51. package/dist-esm/basic/SortByButton.js +41 -31
  52. package/dist-esm/basic/Swipe.js +91 -84
  53. package/dist-esm/basic/Switch.js +22 -8
  54. package/dist-esm/basic/TableRepeater.js +29 -33
  55. package/dist-esm/basic/TimeEditor.js +97 -52
  56. package/dist-esm/basic/TitleEditor.js +115 -95
  57. package/dist-esm/basic/ToggleButtonBar.js +21 -22
  58. package/dist-esm/basic/Tooltip.js +49 -47
  59. package/dist-esm/basic/TypeWriter.js +45 -42
  60. package/dist-esm/basic/UploadEvent.js +211 -178
  61. package/dist-esm/basic/ZoomView.js +229 -198
  62. package/dist-esm/basic/combineClasses.js +2 -3
  63. package/dist-esm/basic/elements/AtomPopover.js +270 -253
  64. package/dist-esm/basic/elements/getContainingBlock.js +34 -35
  65. package/dist-esm/basic/elements/relativeRect.js +40 -21
  66. package/dist-esm/desktop-app/DesktopApp.js +65 -80
  67. package/dist-esm/desktop-app/MobileDesktopApp.js +20 -23
  68. package/dist-esm/html-editor/AtomHtmlEditor.js +243 -268
  69. package/dist-esm/html-editor/HtmlEditorCommands.js +6 -4
  70. package/dist-esm/html-editor/InlineHtmlEditor.d.ts +1 -1
  71. package/dist-esm/html-editor/InlineHtmlEditor.d.ts.map +1 -1
  72. package/dist-esm/html-editor/InlineHtmlEditor.js +175 -167
  73. package/dist-esm/html-editor/InlineHtmlEditor.js.map +1 -1
  74. package/dist-esm/html-editor/RangeEditor.js +49 -51
  75. package/dist-esm/html-editor/commands/AddImage.js +40 -35
  76. package/dist-esm/html-editor/commands/AddLink.js +56 -54
  77. package/dist-esm/html-editor/commands/Align.js +24 -7
  78. package/dist-esm/html-editor/commands/AttachFile.js +23 -13
  79. package/dist-esm/html-editor/commands/AttachImage.js +35 -25
  80. package/dist-esm/html-editor/commands/Bold.js +10 -11
  81. package/dist-esm/html-editor/commands/ChangeColor.js +31 -107
  82. package/dist-esm/html-editor/commands/ChangeFont.js +42 -42
  83. package/dist-esm/html-editor/commands/ChangeFontSize.js +15 -5
  84. package/dist-esm/html-editor/commands/Command.js +34 -16
  85. package/dist-esm/html-editor/commands/CommandButton.js +51 -32
  86. package/dist-esm/html-editor/commands/Headings.js +25 -9
  87. package/dist-esm/html-editor/commands/HorizontalRule.js +9 -10
  88. package/dist-esm/html-editor/commands/HtmlCommands.js +160 -65
  89. package/dist-esm/html-editor/commands/IndentLess.js +10 -11
  90. package/dist-esm/html-editor/commands/IndentMore.js +10 -11
  91. package/dist-esm/html-editor/commands/Italic.js +10 -11
  92. package/dist-esm/html-editor/commands/NumberedList.js +10 -11
  93. package/dist-esm/html-editor/commands/Quote.js +10 -11
  94. package/dist-esm/html-editor/commands/RemoveFormat.js +10 -11
  95. package/dist-esm/html-editor/commands/Separator.js +5 -4
  96. package/dist-esm/html-editor/commands/Source.js +29 -25
  97. package/dist-esm/html-editor/commands/StrikeThrough.js +10 -11
  98. package/dist-esm/html-editor/commands/Toolbar.js +6 -4
  99. package/dist-esm/html-editor/commands/Underline.js +10 -11
  100. package/dist-esm/html-editor/commands/Unlink.js +10 -9
  101. package/dist-esm/html-editor/commands/UnorderedList.js +10 -11
  102. package/dist-esm/mobile-app/BottomPopup.js +137 -148
  103. package/dist-esm/mobile-app/MasterDetailPage.js +153 -152
  104. package/dist-esm/mobile-app/MobileApp.js +577 -569
  105. package/dist-esm/player/AtomVideoPlayer.js +316 -270
  106. package/dist-esm/player/TrackProgress.js +11 -7
  107. package/dist-esm/player/input-range-style.js +97 -98
  108. package/dist-esm/tests/app-test/AppTestApp.js +12 -15
  109. package/dist-esm/tests/app-test/AppTestApp.pack.js +54 -0
  110. package/dist-esm/tests/app-test/commands/AppCommands.js +14 -11
  111. package/dist-esm/tests/app-test/drawer/AppDrawer.js +4 -6
  112. package/dist-esm/tests/app-test/model/model.js +1 -2
  113. package/dist-esm/tests/app-test/pages/detail/DetailPage.js +21 -15
  114. package/dist-esm/tests/app-test/pages/home/HomePage.js +7 -8
  115. package/dist-esm/tests/app-test/pages/list/ListPage.js +79 -62
  116. package/dist-esm/tests/basic/PopupTest.js +9 -7
  117. package/dist-esm/tests/basic/TimeEditorTest.js +5 -9
  118. package/dist-esm/tests/basic/TimeEditorTest.pack.js +39 -0
  119. package/dist-esm/tests/basic/TimerTest.js +27 -37
  120. package/dist-esm/tests/basic/TimerTest.pack.js +40 -0
  121. package/dist-esm/tests/basic/basic-form/BasicForm.js +47 -27
  122. package/dist-esm/tests/basic/basic-form/BasicForm.pack.js +44 -0
  123. package/dist-esm/tests/basic/calendar/BasicCalendarTest.js +5 -9
  124. package/dist-esm/tests/basic/calendar/BasicCalendarTest.pack.js +53 -0
  125. package/dist-esm/tests/basic/chips/ChipsTest.js +25 -15
  126. package/dist-esm/tests/basic/chips/ChipsTest.pack.js +56 -0
  127. package/dist-esm/tests/basic/data-grid/DataGridTest.js +55 -60
  128. package/dist-esm/tests/basic/data-grid/DataGridTest.pack.js +58 -0
  129. package/dist-esm/tests/basic/date/DateFieldTest.js +21 -96
  130. package/dist-esm/tests/basic/date/DateFieldTest.pack.js +57 -0
  131. package/dist-esm/tests/basic/drop-down/DropDownTest.js +25 -19
  132. package/dist-esm/tests/basic/drop-down/DropDownTest.pack.js +52 -0
  133. package/dist-esm/tests/basic/drop-down-input/DropDownTest.js +32 -32
  134. package/dist-esm/tests/basic/drop-down-input/DropDownTest.pack.js +54 -0
  135. package/dist-esm/tests/basic/expander/ExpanderMenuTest.js +20 -14
  136. package/dist-esm/tests/basic/expander/ExpanderMenuTest.pack.js +38 -0
  137. package/dist-esm/tests/basic/expander/ExpanderTest.js +11 -12
  138. package/dist-esm/tests/basic/expander/ExpanderTest.pack.js +38 -0
  139. package/dist-esm/tests/basic/form2/Form2Test.js +26 -24
  140. package/dist-esm/tests/basic/form2/Form2Test.pack.js +46 -0
  141. package/dist-esm/tests/basic/limited-text/LimitedTextTest.js +14 -11
  142. package/dist-esm/tests/basic/limited-text/LimitedTextTest.pack.js +38 -0
  143. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.js +14 -14
  144. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.pack.js +38 -0
  145. package/dist-esm/tests/basic/repeater/DragDropRepater.js +30 -12
  146. package/dist-esm/tests/basic/repeater/DragDropRepater.pack.js +51 -0
  147. package/dist-esm/tests/basic/repeater/RepeaterTest.js +45 -35
  148. package/dist-esm/tests/basic/repeater/RepeaterTest.pack.js +52 -0
  149. package/dist-esm/tests/basic/swipe/SwipeTest.js +13 -13
  150. package/dist-esm/tests/basic/swipe/SwipeTest.pack.js +52 -0
  151. package/dist-esm/tests/basic/switch-test/SwitchTest.js +8 -10
  152. package/dist-esm/tests/basic/switch-test/SwitchTest.pack.js +38 -0
  153. package/dist-esm/tests/basic/title-editor/TitleEditorTest.js +8 -9
  154. package/dist-esm/tests/basic/title-editor/TitleEditorTest.pack.js +38 -0
  155. package/dist-esm/tests/basic/tooltip/TooltipTest.js +30 -24
  156. package/dist-esm/tests/basic/tooltip/TooltipTest.pack.js +52 -0
  157. package/dist-esm/tests/basic/typewriter/TypeWriter.js +10 -9
  158. package/dist-esm/tests/basic/typewriter/TypeWriter.pack.js +39 -0
  159. package/dist-esm/tests/basic/video/AtomVideoTest.js +13 -10
  160. package/dist-esm/tests/basic/video/AtomVideoTest.pack.js +38 -0
  161. package/dist-esm/tests/basic/zoom/ZoomViewTest.js +13 -13
  162. package/dist-esm/tests/basic/zoom/ZoomViewTest.pack.js +38 -0
  163. package/dist-esm/tests/check-box-list/CheckBoxListSample.js +13 -12
  164. package/dist-esm/tests/check-box-list/CheckBoxListSample.pack.js +52 -0
  165. package/dist-esm/tests/data-grid/GridTestViewModel.js +203 -227
  166. package/dist-esm/tests/form/CustomHelp.js +6 -9
  167. package/dist-esm/tests/form/FormViewModel.js +21 -28
  168. package/dist-esm/tests/html-editor/HtmlEditorTest.js +7 -37
  169. package/dist-esm/tests/html-editor/HtmlEditorTest.pack.js +83 -0
  170. package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.js +9 -38
  171. package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.pack.js +85 -0
  172. package/dist-esm/tests/mask/MaskedInputTest.js +11 -12
  173. package/dist-esm/tests/mask/MaskedInputTest.pack.js +38 -0
  174. package/dist-esm/tests/mobile-app/DesktopAppTest.js +8 -9
  175. package/dist-esm/tests/mobile-app/DesktopAppTest.pack.js +60 -0
  176. package/dist-esm/tests/mobile-app/MobileAppTest.js +64 -53
  177. package/dist-esm/tests/mobile-app/MobileAppTest.pack.js +55 -0
  178. package/dist-esm/tests/pop-over/PopOverTest.js +37 -77
  179. package/dist-esm/tests/switch/SwitchTest.js +9 -8
  180. package/dist-esm/tests/toggle-view/ToggleViewTest.js +15 -22
  181. package/dist-esm/tests/toggle-view/ToggleViewTest.pack.js +45 -0
  182. package/dist-esm/toggle-view/AtomToggleView.js +77 -73
  183. package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
  184. package/package.json +3 -3
  185. 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({ icon, text, label, closeOnClick = true, popup, ...a }, ...nodes) {
5
- if (!a["anchor-right"]) {
6
- a["anchor-left"] ??= "parent-right";
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
- if (!a["anchor-bottom"]) {
9
- a["anchor-top"] ??= "parent-top";
10
- }
11
- a["data-atom-popup-button"] = "popup-button";
12
- if (!popup) {
13
- const copy = nodes;
14
- const div = XNode.create("div", null, ...copy);
15
- popup = () => div;
16
- nodes = [];
17
- }
18
- a["popupFactory"] = popup;
19
- if (closeOnClick) {
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", (e) => {
37
- let start = e.target;
38
- while (start) {
39
- if (start.hasAttribute("data-atom-popup-button")) {
40
- break;
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 (!start) {
45
- return;
46
- }
47
- const pf = start["popupFactory"];
48
- if (!pf) {
49
- return;
50
- }
51
- const control = AtomControl.from(start);
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
- if (!data) {
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
- AtomPopover.create(target, {
90
- nodeFactory: (data) => pf(data),
91
- dataFactory,
92
- closeOnClick,
93
- "anchor-bottom": target.getAttribute("anchor-bottom"),
94
- "anchor-top": target.getAttribute("anchor-top"),
95
- "anchor-left": target.getAttribute("anchor-left"),
96
- "anchor-right": target.getAttribute("anchor-right"),
97
- });
98
- });
99
- //# sourceMappingURL=InlinePopupButton.js.map
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
- 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 { atomControl } = start;
12
- if (atomControl) {
13
- atomControl.dispatchClickEvent(e, data);
14
- return;
15
- }
16
- start = start.parentElement;
17
- }
18
- super.dispatchClickEvent(e, data);
19
- }
20
- };
21
- options.popupStyle = ".no-style";
22
- return c.showControl(opener, options);
23
- }
24
- }
25
- //# sourceMappingURL=InlinePopupControl.js.map
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
- let item = start;
3
- for (const iterator of path.split(".")) {
4
- if (iterator === "$") {
5
- item = start;
6
- continue;
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
- return item;
8
+ item = item[iterator];
9
+ }
10
+ return item;
11
11
  };
12
12
  function* getFragments(path) {
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++;
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
- static get(item, path) {
24
- if (path.startsWith("$.")) {
25
- return get(item, path);
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
- 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
- }
27
+ if (/^[\{\"]/.test(path)) {
28
+ const json = JSON.parse(path);
29
+ return json;
67
30
  }
68
- }
69
- //# sourceMappingURL=ItemPath.js.map
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 "../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
- }
22
- else {
23
- const h = start.getAttribute("data-max-height");
24
- start.style.maxHeight = h;
25
- container.style.top = h;
26
- start.setAttribute("data-mode", "collapsed");
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
- document.body.addEventListener("click", toggleDetails);
31
- setEventHandler = null;
29
+ document.body.addEventListener("click", toggleDetails);
30
+ setEventHandler = null;
32
31
  };
33
- export default function LimitedText({ text = "", height = 100, ...a }, ...nodes) {
34
- setEventHandler?.();
35
- const h = typeof height === "number" ? `${height}px` : height;
36
- return XNode.create("div", { "data-mode": "collapsed", "data-max-height": h, "style-max-height": h, "data-limited-text": "limited-text", ...a },
37
- text && XNode.create("p", { text: text }),
38
- ...nodes,
39
- XNode.create("div", { "style-top": h, "data-element": "more" },
40
- XNode.create("button", { class: "fa-solid fa-angles-up" })));
41
- }
42
- //# sourceMappingURL=LimitedText.js.map
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 "./styles/list-repeater.global.css";
2
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/list-repeater.global.css"));
3
3
  export default class ListRepeater extends AtomRepeater {
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
- }
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 "./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 += ".";
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
- if (target.value !== result) {
27
- target.value = result;
28
- }
25
+ }
26
+ if (target.value !== result) {
27
+ target.value = result;
28
+ }
29
29
  };
30
- export default function MaskedInput({ mask, ...a }) {
31
- return XNode.create("input", { "data-mask": mask, "event-change": updateMask, "event-keypress": updateMask, "event-keyup": updateMask, ...a });
32
- }
33
- //# sourceMappingURL=MaskedInput.js.map
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
+ }