@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.
Files changed (304) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/dist-esm/ArrayLike.js +14 -12
  3. package/dist-esm/DataAttributes.js +18 -19
  4. package/dist-esm/Focusable.js +10 -11
  5. package/dist-esm/ModuleFiles.js +43 -42
  6. package/dist-esm/NumberFormats.js +60 -56
  7. package/dist-esm/PageNavigator.js +28 -30
  8. package/dist-esm/animations/Animations.global.css +2 -0
  9. package/dist-esm/animations/Animations.global.css.map +1 -0
  10. package/dist-esm/animations/Animations.js +36 -33
  11. package/dist-esm/basic/AtomChips.js +312 -305
  12. package/dist-esm/basic/AtomRepeater.js +1070 -1035
  13. package/dist-esm/basic/AtomSuggestions.js +97 -107
  14. package/dist-esm/basic/AttachedPopup.js +0 -1
  15. package/dist-esm/basic/Button.js +45 -19
  16. package/dist-esm/basic/Button.local.css +2 -0
  17. package/dist-esm/basic/Button.local.css.map +1 -0
  18. package/dist-esm/basic/ButtonBar.global.css +2 -0
  19. package/dist-esm/basic/ButtonBar.global.css.map +1 -0
  20. package/dist-esm/basic/ButtonBar.js +84 -64
  21. package/dist-esm/basic/Calendar.js +211 -203
  22. package/dist-esm/basic/CheckBoxList.js +90 -70
  23. package/dist-esm/basic/Checkbox.js +16 -8
  24. package/dist-esm/basic/Chip.js +36 -12
  25. package/dist-esm/basic/ComboBox.js +47 -51
  26. package/dist-esm/basic/DataGrid.js +258 -252
  27. package/dist-esm/basic/DateField.js +149 -127
  28. package/dist-esm/basic/DropDown.js +91 -103
  29. package/dist-esm/basic/DropDownInput.global.css +2 -0
  30. package/dist-esm/basic/DropDownInput.global.css.map +1 -0
  31. package/dist-esm/basic/DropDownInput.js +78 -106
  32. package/dist-esm/basic/Editable.js +82 -77
  33. package/dist-esm/basic/Expander.js +104 -86
  34. package/dist-esm/basic/FilesDragDrop.global.css +2 -0
  35. package/dist-esm/basic/FilesDragDrop.global.css.map +1 -0
  36. package/dist-esm/basic/FilesDragDrop.js +84 -80
  37. package/dist-esm/basic/Form.js +80 -52
  38. package/dist-esm/basic/FormField.js +164 -106
  39. package/dist-esm/basic/IElement.js +1 -2
  40. package/dist-esm/basic/InlinePopup.js +263 -234
  41. package/dist-esm/basic/InlinePopupButton.js +99 -88
  42. package/dist-esm/basic/InlinePopupControl.js +24 -23
  43. package/dist-esm/basic/ItemPath.js +59 -60
  44. package/dist-esm/basic/LimitedText.js +49 -38
  45. package/dist-esm/basic/ListRepeater.js +13 -14
  46. package/dist-esm/basic/MaskedInput.js +37 -29
  47. package/dist-esm/basic/MaskedInputDiv.js +55 -48
  48. package/dist-esm/basic/MergeNode.js +64 -35
  49. package/dist-esm/basic/PasswordBox.js +32 -17
  50. package/dist-esm/basic/PinchZoomView.js +221 -199
  51. package/dist-esm/basic/PopupButton.js +39 -16
  52. package/dist-esm/basic/PopupMenu.js +3 -4
  53. package/dist-esm/basic/RadioButtonList.js +35 -25
  54. package/dist-esm/basic/RefreshLock.js +41 -42
  55. package/dist-esm/basic/Resizable.js +43 -33
  56. package/dist-esm/basic/Select.js +72 -65
  57. package/dist-esm/basic/SortByButton.global.css +2 -0
  58. package/dist-esm/basic/SortByButton.global.css.map +1 -0
  59. package/dist-esm/basic/SortByButton.js +41 -31
  60. package/dist-esm/basic/Swipe.js +91 -84
  61. package/dist-esm/basic/Switch.js +22 -8
  62. package/dist-esm/basic/TableRepeater.js +29 -33
  63. package/dist-esm/basic/TimeEditor.js +97 -52
  64. package/dist-esm/basic/TitleEditor.js +115 -95
  65. package/dist-esm/basic/ToggleButtonBar.js +21 -22
  66. package/dist-esm/basic/Tooltip.js +49 -47
  67. package/dist-esm/basic/TypeWriter.js +45 -42
  68. package/dist-esm/basic/UploadEvent.js +211 -178
  69. package/dist-esm/basic/ZoomView.js +229 -198
  70. package/dist-esm/basic/combineClasses.js +2 -3
  71. package/dist-esm/basic/elements/AtomPopover.css +2 -0
  72. package/dist-esm/basic/elements/AtomPopover.css.map +1 -0
  73. package/dist-esm/basic/elements/AtomPopover.js +270 -253
  74. package/dist-esm/basic/elements/getContainingBlock.js +34 -35
  75. package/dist-esm/basic/elements/relativeRect.js +40 -21
  76. package/dist-esm/basic/styles/calendar.global.css +2 -0
  77. package/dist-esm/basic/styles/calendar.global.css.map +1 -0
  78. package/dist-esm/basic/styles/check-box-list.global.css +2 -0
  79. package/dist-esm/basic/styles/check-box-list.global.css.map +1 -0
  80. package/dist-esm/basic/styles/checkbox.global.css +2 -0
  81. package/dist-esm/basic/styles/checkbox.global.css.map +1 -0
  82. package/dist-esm/basic/styles/chip.global.css +2 -0
  83. package/dist-esm/basic/styles/chip.global.css.map +1 -0
  84. package/dist-esm/basic/styles/chips.global.css +2 -0
  85. package/dist-esm/basic/styles/chips.global.css.map +1 -0
  86. package/dist-esm/basic/styles/data-grid.global.css +2 -0
  87. package/dist-esm/basic/styles/data-grid.global.css.map +1 -0
  88. package/dist-esm/basic/styles/date-field.global.css +2 -0
  89. package/dist-esm/basic/styles/date-field.global.css.map +1 -0
  90. package/dist-esm/basic/styles/drop-down.global.css +2 -0
  91. package/dist-esm/basic/styles/drop-down.global.css.map +1 -0
  92. package/dist-esm/basic/styles/expander.global.css +2 -0
  93. package/dist-esm/basic/styles/expander.global.css.map +1 -0
  94. package/dist-esm/basic/styles/form-field.global.css +2 -0
  95. package/dist-esm/basic/styles/form-field.global.css.map +1 -0
  96. package/dist-esm/basic/styles/inline-popup.global.css +2 -0
  97. package/dist-esm/basic/styles/inline-popup.global.css.map +1 -0
  98. package/dist-esm/basic/styles/item-suggestion.global.css +2 -0
  99. package/dist-esm/basic/styles/item-suggestion.global.css.map +1 -0
  100. package/dist-esm/basic/styles/list-repeater.global.css +2 -0
  101. package/dist-esm/basic/styles/list-repeater.global.css.map +1 -0
  102. package/dist-esm/basic/styles/masked-input.global.css +2 -0
  103. package/dist-esm/basic/styles/masked-input.global.css.map +1 -0
  104. package/dist-esm/basic/styles/password-box.global.css +2 -0
  105. package/dist-esm/basic/styles/password-box.global.css.map +1 -0
  106. package/dist-esm/basic/styles/pinch-zoom-view.global.css +2 -0
  107. package/dist-esm/basic/styles/pinch-zoom-view.global.css.map +1 -0
  108. package/dist-esm/basic/styles/popup-button.global.css +2 -0
  109. package/dist-esm/basic/styles/popup-button.global.css.map +1 -0
  110. package/dist-esm/basic/styles/popup.global.css +2 -0
  111. package/dist-esm/basic/styles/popup.global.css.map +1 -0
  112. package/dist-esm/basic/styles/radio-button-list.global.css +2 -0
  113. package/dist-esm/basic/styles/radio-button-list.global.css.map +1 -0
  114. package/dist-esm/basic/styles/repeater.global.css +2 -0
  115. package/dist-esm/basic/styles/repeater.global.css.map +1 -0
  116. package/dist-esm/basic/styles/scale.svg +4 -0
  117. package/dist-esm/basic/styles/suggestion-popup.global.css +2 -0
  118. package/dist-esm/basic/styles/suggestion-popup.global.css.map +1 -0
  119. package/dist-esm/basic/styles/suggestion.global.css +2 -0
  120. package/dist-esm/basic/styles/suggestion.global.css.map +1 -0
  121. package/dist-esm/basic/styles/swipe.global.css +2 -0
  122. package/dist-esm/basic/styles/swipe.global.css.map +1 -0
  123. package/dist-esm/basic/styles/switch.global.css +2 -0
  124. package/dist-esm/basic/styles/switch.global.css.map +1 -0
  125. package/dist-esm/basic/styles/time-editor.global.css +2 -0
  126. package/dist-esm/basic/styles/time-editor.global.css.map +1 -0
  127. package/dist-esm/basic/styles/title-editor.global.css +2 -0
  128. package/dist-esm/basic/styles/title-editor.global.css.map +1 -0
  129. package/dist-esm/basic/styles/toggle-button-bar.global.css +2 -0
  130. package/dist-esm/basic/styles/toggle-button-bar.global.css.map +1 -0
  131. package/dist-esm/basic/styles/toggle-view.global.css +2 -0
  132. package/dist-esm/basic/styles/toggle-view.global.css.map +1 -0
  133. package/dist-esm/basic/styles/tooltip.global.css +2 -0
  134. package/dist-esm/basic/styles/tooltip.global.css.map +1 -0
  135. package/dist-esm/basic/styles/zoom-view.global.css +2 -0
  136. package/dist-esm/basic/styles/zoom-view.global.css.map +1 -0
  137. package/dist-esm/desktop-app/DesktopApp.js +65 -80
  138. package/dist-esm/desktop-app/MobileDesktopApp.js +20 -23
  139. package/dist-esm/html-editor/AtomHtmlEditor.js +243 -268
  140. package/dist-esm/html-editor/HtmlEditorCommands.js +6 -4
  141. package/dist-esm/html-editor/InlineHtmlEditor.js +174 -166
  142. package/dist-esm/html-editor/RangeEditor.js +49 -51
  143. package/dist-esm/html-editor/commands/AddImage.js +40 -35
  144. package/dist-esm/html-editor/commands/AddLink.js +56 -54
  145. package/dist-esm/html-editor/commands/AddLink.local.css +2 -0
  146. package/dist-esm/html-editor/commands/AddLink.local.css.map +1 -0
  147. package/dist-esm/html-editor/commands/Align.js +24 -7
  148. package/dist-esm/html-editor/commands/AttachFile.js +23 -13
  149. package/dist-esm/html-editor/commands/AttachImage.js +35 -25
  150. package/dist-esm/html-editor/commands/Bold.js +10 -11
  151. package/dist-esm/html-editor/commands/ChangeColor.js +31 -107
  152. package/dist-esm/html-editor/commands/ChangeColor.local.css +2 -0
  153. package/dist-esm/html-editor/commands/ChangeColor.local.css.map +1 -0
  154. package/dist-esm/html-editor/commands/ChangeFont.js +42 -42
  155. package/dist-esm/html-editor/commands/ChangeFont.local.css +2 -0
  156. package/dist-esm/html-editor/commands/ChangeFont.local.css.map +1 -0
  157. package/dist-esm/html-editor/commands/ChangeFontSize.js +15 -5
  158. package/dist-esm/html-editor/commands/Command.js +34 -16
  159. package/dist-esm/html-editor/commands/CommandButton.js +51 -32
  160. package/dist-esm/html-editor/commands/Headings.js +25 -9
  161. package/dist-esm/html-editor/commands/HorizontalRule.js +9 -10
  162. package/dist-esm/html-editor/commands/HtmlCommands.js +160 -65
  163. package/dist-esm/html-editor/commands/IndentLess.js +10 -11
  164. package/dist-esm/html-editor/commands/IndentMore.js +10 -11
  165. package/dist-esm/html-editor/commands/Italic.js +10 -11
  166. package/dist-esm/html-editor/commands/NumberedList.js +10 -11
  167. package/dist-esm/html-editor/commands/Quote.js +10 -11
  168. package/dist-esm/html-editor/commands/RemoveFormat.js +10 -11
  169. package/dist-esm/html-editor/commands/Separator.global.css +2 -0
  170. package/dist-esm/html-editor/commands/Separator.global.css.map +1 -0
  171. package/dist-esm/html-editor/commands/Separator.js +5 -4
  172. package/dist-esm/html-editor/commands/Source.js +29 -25
  173. package/dist-esm/html-editor/commands/Source.local.css +2 -0
  174. package/dist-esm/html-editor/commands/Source.local.css.map +1 -0
  175. package/dist-esm/html-editor/commands/StrikeThrough.js +10 -11
  176. package/dist-esm/html-editor/commands/Toolbar.js +6 -4
  177. package/dist-esm/html-editor/commands/Underline.js +10 -11
  178. package/dist-esm/html-editor/commands/Unlink.js +10 -9
  179. package/dist-esm/html-editor/commands/UnorderedList.js +10 -11
  180. package/dist-esm/mobile-app/BottomPopup.js +137 -148
  181. package/dist-esm/mobile-app/MasterDetailPage.global.css +2 -0
  182. package/dist-esm/mobile-app/MasterDetailPage.global.css.map +1 -0
  183. package/dist-esm/mobile-app/MasterDetailPage.js +153 -152
  184. package/dist-esm/mobile-app/MobileApp.global.css +2 -0
  185. package/dist-esm/mobile-app/MobileApp.global.css.map +1 -0
  186. package/dist-esm/mobile-app/MobileApp.js +577 -569
  187. package/dist-esm/mobile-app/bottom-popup.global.css +2 -0
  188. package/dist-esm/mobile-app/bottom-popup.global.css.map +1 -0
  189. package/dist-esm/player/AtomVideoPlayer.global.css +2 -0
  190. package/dist-esm/player/AtomVideoPlayer.global.css.map +1 -0
  191. package/dist-esm/player/AtomVideoPlayer.js +316 -270
  192. package/dist-esm/player/TrackProgress.js +11 -7
  193. package/dist-esm/player/input-range-style.js +97 -98
  194. package/dist-esm/styles/atom-html-editor.global.css +2 -0
  195. package/dist-esm/styles/atom-html-editor.global.css.map +1 -0
  196. package/dist-esm/styles/button-bar.global.css +2 -0
  197. package/dist-esm/styles/button-bar.global.css.map +1 -0
  198. package/dist-esm/styles/desktop-app.global.css +2 -0
  199. package/dist-esm/styles/desktop-app.global.css.map +1 -0
  200. package/dist-esm/styles/form.global.css +2 -0
  201. package/dist-esm/styles/form.global.css.map +1 -0
  202. package/dist-esm/styles/html-editor-toolbar.global.css +2 -0
  203. package/dist-esm/styles/html-editor-toolbar.global.css.map +1 -0
  204. package/dist-esm/styles/inline-html-editor.global.css +2 -0
  205. package/dist-esm/styles/inline-html-editor.global.css.map +1 -0
  206. package/dist-esm/styles/limited-text.global.css +2 -0
  207. package/dist-esm/styles/limited-text.global.css.map +1 -0
  208. package/dist-esm/styles/resizable.global.css +2 -0
  209. package/dist-esm/styles/resizable.global.css.map +1 -0
  210. package/dist-esm/styles/track-progress.global.css +2 -0
  211. package/dist-esm/styles/track-progress.global.css.map +1 -0
  212. package/dist-esm/styles/type-writer.global.css +2 -0
  213. package/dist-esm/styles/type-writer.global.css.map +1 -0
  214. package/dist-esm/tests/app-test/AppTestApp.js +12 -15
  215. package/dist-esm/tests/app-test/AppTestApp.pack.js +54 -0
  216. package/dist-esm/tests/app-test/commands/AppCommands.js +14 -11
  217. package/dist-esm/tests/app-test/drawer/AppDrawer.js +4 -6
  218. package/dist-esm/tests/app-test/model/model.js +1 -2
  219. package/dist-esm/tests/app-test/pages/detail/DetailPage.js +21 -15
  220. package/dist-esm/tests/app-test/pages/home/HomePage.js +7 -8
  221. package/dist-esm/tests/app-test/pages/list/ListPage.js +79 -62
  222. package/dist-esm/tests/app-test/pages/list/ListPage.local.css +2 -0
  223. package/dist-esm/tests/app-test/pages/list/ListPage.local.css.map +1 -0
  224. package/dist-esm/tests/basic/PopupTest.js +9 -7
  225. package/dist-esm/tests/basic/TimeEditorTest.js +5 -9
  226. package/dist-esm/tests/basic/TimeEditorTest.pack.js +39 -0
  227. package/dist-esm/tests/basic/TimerTest.js +27 -37
  228. package/dist-esm/tests/basic/TimerTest.pack.js +40 -0
  229. package/dist-esm/tests/basic/basic-form/BasicForm.js +47 -27
  230. package/dist-esm/tests/basic/basic-form/BasicForm.pack.js +44 -0
  231. package/dist-esm/tests/basic/calendar/BasicCalendarTest.js +5 -9
  232. package/dist-esm/tests/basic/calendar/BasicCalendarTest.pack.js +53 -0
  233. package/dist-esm/tests/basic/chips/ChipsTest.js +25 -15
  234. package/dist-esm/tests/basic/chips/ChipsTest.local.css +2 -0
  235. package/dist-esm/tests/basic/chips/ChipsTest.local.css.map +1 -0
  236. package/dist-esm/tests/basic/chips/ChipsTest.pack.js +56 -0
  237. package/dist-esm/tests/basic/data-grid/DataGridTest.js +55 -60
  238. package/dist-esm/tests/basic/data-grid/DataGridTest.pack.js +58 -0
  239. package/dist-esm/tests/basic/date/DateFieldTest.js +21 -96
  240. package/dist-esm/tests/basic/date/DateFieldTest.pack.js +57 -0
  241. package/dist-esm/tests/basic/drop-down/DropDownTest.js +25 -19
  242. package/dist-esm/tests/basic/drop-down/DropDownTest.pack.js +52 -0
  243. package/dist-esm/tests/basic/drop-down-input/DropDownTest.js +32 -32
  244. package/dist-esm/tests/basic/drop-down-input/DropDownTest.pack.js +54 -0
  245. package/dist-esm/tests/basic/expander/ExpanderMenuTest.js +20 -14
  246. package/dist-esm/tests/basic/expander/ExpanderMenuTest.pack.js +38 -0
  247. package/dist-esm/tests/basic/expander/ExpanderTest.js +11 -12
  248. package/dist-esm/tests/basic/expander/ExpanderTest.pack.js +38 -0
  249. package/dist-esm/tests/basic/form2/Form2Test.js +26 -24
  250. package/dist-esm/tests/basic/form2/Form2Test.pack.js +46 -0
  251. package/dist-esm/tests/basic/limited-text/LimitedTextTest.js +14 -11
  252. package/dist-esm/tests/basic/limited-text/LimitedTextTest.pack.js +38 -0
  253. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.global.css +2 -0
  254. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.global.css.map +1 -0
  255. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.js +14 -14
  256. package/dist-esm/tests/basic/pinch-zoom/PinchZoomViewTest.pack.js +38 -0
  257. package/dist-esm/tests/basic/repeater/DragDropRepater.js +30 -12
  258. package/dist-esm/tests/basic/repeater/DragDropRepater.pack.js +51 -0
  259. package/dist-esm/tests/basic/repeater/RepeaterTest.js +45 -35
  260. package/dist-esm/tests/basic/repeater/RepeaterTest.pack.js +52 -0
  261. package/dist-esm/tests/basic/swipe/SwipeTest.js +13 -13
  262. package/dist-esm/tests/basic/swipe/SwipeTest.local.css +2 -0
  263. package/dist-esm/tests/basic/swipe/SwipeTest.local.css.map +1 -0
  264. package/dist-esm/tests/basic/swipe/SwipeTest.pack.js +52 -0
  265. package/dist-esm/tests/basic/switch-test/SwitchTest.js +8 -10
  266. package/dist-esm/tests/basic/switch-test/SwitchTest.pack.js +38 -0
  267. package/dist-esm/tests/basic/title-editor/TitleEditorTest.js +8 -9
  268. package/dist-esm/tests/basic/title-editor/TitleEditorTest.pack.js +38 -0
  269. package/dist-esm/tests/basic/tooltip/TooltipTest.js +30 -24
  270. package/dist-esm/tests/basic/tooltip/TooltipTest.pack.js +52 -0
  271. package/dist-esm/tests/basic/typewriter/TypeWriter.js +10 -9
  272. package/dist-esm/tests/basic/typewriter/TypeWriter.pack.js +39 -0
  273. package/dist-esm/tests/basic/video/AtomVideoTest.js +13 -10
  274. package/dist-esm/tests/basic/video/AtomVideoTest.local.css +2 -0
  275. package/dist-esm/tests/basic/video/AtomVideoTest.local.css.map +1 -0
  276. package/dist-esm/tests/basic/video/AtomVideoTest.pack.js +38 -0
  277. package/dist-esm/tests/basic/zoom/ZoomViewTest.js +13 -13
  278. package/dist-esm/tests/basic/zoom/ZoomViewTest.local.css +2 -0
  279. package/dist-esm/tests/basic/zoom/ZoomViewTest.local.css.map +1 -0
  280. package/dist-esm/tests/basic/zoom/ZoomViewTest.pack.js +38 -0
  281. package/dist-esm/tests/check-box-list/CheckBoxListSample.js +13 -12
  282. package/dist-esm/tests/check-box-list/CheckBoxListSample.pack.js +52 -0
  283. package/dist-esm/tests/data-grid/GridTestViewModel.js +203 -227
  284. package/dist-esm/tests/form/CustomHelp.js +6 -9
  285. package/dist-esm/tests/form/FormViewModel.js +21 -28
  286. package/dist-esm/tests/html-editor/HtmlEditorTest.js +7 -37
  287. package/dist-esm/tests/html-editor/HtmlEditorTest.pack.js +83 -0
  288. package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.js +9 -38
  289. package/dist-esm/tests/html-editor/InlineHtmlEdiorTest.pack.js +85 -0
  290. package/dist-esm/tests/mask/MaskedInputTest.js +11 -12
  291. package/dist-esm/tests/mask/MaskedInputTest.pack.js +38 -0
  292. package/dist-esm/tests/mobile-app/DesktopAppTest.js +8 -9
  293. package/dist-esm/tests/mobile-app/DesktopAppTest.pack.js +60 -0
  294. package/dist-esm/tests/mobile-app/MobileAppTest.js +64 -53
  295. package/dist-esm/tests/mobile-app/MobileAppTest.pack.js +55 -0
  296. package/dist-esm/tests/pop-over/PopOverTest.js +37 -77
  297. package/dist-esm/tests/switch/SwitchTest.js +9 -8
  298. package/dist-esm/tests/toggle-view/ToggleView.local.css +2 -0
  299. package/dist-esm/tests/toggle-view/ToggleView.local.css.map +1 -0
  300. package/dist-esm/tests/toggle-view/ToggleViewTest.js +15 -22
  301. package/dist-esm/tests/toggle-view/ToggleViewTest.pack.js +45 -0
  302. package/dist-esm/toggle-view/AtomToggleView.js +77 -73
  303. package/dist-esm/tsconfig.esm.tsbuildinfo +1 -1
  304. package/package.json +3 -3
@@ -2,89 +2,93 @@ const supportsFileSystemAccessAPI = "getAsFileSystemHandle" in DataTransferItem.
2
2
  const supportsWebkitGetAsEntry = "webkitGetAsEntry" in DataTransferItem.prototype;
3
3
  import { StringHelper } from "@web-atoms/core/dist/core/StringHelper.js";
4
4
  import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
5
- import "./FilesDragDrop.global.css";
6
- const dragEnter = (e) => {
7
- if (!e.dataTransfer) {
8
- return;
9
- }
10
- e.currentTarget.setAttribute("data-drop-enabled", "1");
5
+ ESMPack.installStyleSheet(import.meta.resolve("./FilesDragDrop.global.css"));
6
+ const dragEnter = e => {
7
+ if (!e.dataTransfer) {
8
+ return;
9
+ }
10
+ e.currentTarget.setAttribute("data-drop-enabled", "1");
11
11
  };
12
- const dragOver = (e) => {
13
- if (!e.dataTransfer) {
14
- return;
15
- }
16
- e.preventDefault();
12
+ const dragOver = e => {
13
+ if (!e.dataTransfer) {
14
+ return;
15
+ }
16
+ e.preventDefault();
17
17
  };
18
- const dragLeave = (e) => {
19
- if (!e.dataTransfer) {
20
- return;
21
- }
22
- e.currentTarget.removeAttribute("data-drop-enabled");
18
+ const dragLeave = e => {
19
+ if (!e.dataTransfer) {
20
+ return;
21
+ }
22
+ e.currentTarget.removeAttribute("data-drop-enabled");
23
23
  };
24
- const eventDrop = (e) => {
25
- if (!e.dataTransfer) {
26
- return;
24
+ const eventDrop = e => {
25
+ if (!e.dataTransfer) {
26
+ return;
27
+ }
28
+ e.preventDefault();
29
+ const currentTarget = e.currentTarget;
30
+ currentTarget.removeAttribute("data-drop-enabled");
31
+ const uploadEvent = StringHelper.fromHyphenToCamel(currentTarget.getAttribute("data-upload-event"));
32
+ const uploadRequested = StringHelper.fromHyphenToCamel(currentTarget.getAttribute("data-upload-requested"));
33
+ const extra = currentTarget.getAttribute("data-extra");
34
+ const convert = currentTarget.getAttribute("data-convert") === "true";
35
+ const maxSize = parseInt(currentTarget.getAttribute("data-max-size") || "0", 10);
36
+ const fileHandlesPromises = [...e.dataTransfer.items].filter(item => item.kind === "file").map(item => supportsFileSystemAccessAPI ? item.getAsFileSystemHandle() : supportsWebkitGetAsEntry ? item.webkitGetAsEntry() : item.getAsFile());
37
+ const files = [];
38
+ const getFiles = async (dir, parent = dir.name) => {
39
+ const all = [];
40
+ for await (const [name, handle] of dir.entries()) {
41
+ const path = `${parent}/${handle.name}`;
42
+ if (handle.kind === "directory" || handle.isDirectory) {
43
+ all.push(...(await getFiles(handle, path)));
44
+ continue;
45
+ }
46
+ const file = await handle.getFile();
47
+ Object.defineProperty(file, "webkitRelativePath", {
48
+ value: path
49
+ });
50
+ all.push(file);
51
+ }
52
+ return all;
53
+ };
54
+ const control = AtomControl.from(e.currentTarget);
55
+ control.app.runAsync(async () => {
56
+ for await (const handle of fileHandlesPromises) {
57
+ if (handle.kind === "directory" || handle.isDirectory) {
58
+ files.push(...(await getFiles(handle)));
59
+ } else {
60
+ files.push(await handle.getFile());
61
+ }
27
62
  }
28
- e.preventDefault();
29
- const currentTarget = e.currentTarget;
30
- currentTarget.removeAttribute("data-drop-enabled");
31
- const uploadEvent = StringHelper.fromHyphenToCamel(currentTarget.getAttribute("data-upload-event"));
32
- const uploadRequested = StringHelper.fromHyphenToCamel(currentTarget.getAttribute("data-upload-requested"));
33
- const extra = currentTarget.getAttribute("data-extra");
34
- const convert = currentTarget.getAttribute("data-convert") === "true";
35
- const maxSize = parseInt(currentTarget.getAttribute("data-max-size") || "0", 10);
36
- const fileHandlesPromises = [...e.dataTransfer.items]
37
- .filter((item) => item.kind === "file")
38
- .map((item) => supportsFileSystemAccessAPI
39
- ? item.getAsFileSystemHandle()
40
- : supportsWebkitGetAsEntry
41
- ? item.webkitGetAsEntry()
42
- : item.getAsFile());
43
- const files = [];
44
- const getFiles = async (dir, parent = dir.name) => {
45
- const all = [];
46
- for await (const [name, handle] of dir.entries()) {
47
- const path = `${parent}/${handle.name}`;
48
- if (handle.kind === "directory" || handle.isDirectory) {
49
- all.push(...(await getFiles(handle, path)));
50
- continue;
51
- }
52
- const file = await handle.getFile();
53
- Object.defineProperty(file, "webkitRelativePath", { value: path });
54
- all.push(file);
55
- }
56
- return all;
63
+ const detail = {
64
+ files,
65
+ extra,
66
+ convert,
67
+ maxSize,
68
+ uploadEvent
57
69
  };
58
- const control = AtomControl.from(e.currentTarget);
59
- control.app.runAsync(async () => {
60
- for await (const handle of fileHandlesPromises) {
61
- if (handle.kind === "directory" || handle.isDirectory) {
62
- files.push(...await getFiles(handle));
63
- }
64
- else {
65
- files.push(await handle.getFile());
66
- }
67
- }
68
- const detail = {
69
- files,
70
- extra,
71
- convert,
72
- maxSize,
73
- uploadEvent
74
- };
75
- currentTarget.dispatchEvent(new CustomEvent(uploadRequested, { detail, bubbles: true, cancelable: true }));
76
- });
70
+ currentTarget.dispatchEvent(new CustomEvent(uploadRequested, {
71
+ detail,
72
+ bubbles: true,
73
+ cancelable: true
74
+ }));
75
+ });
77
76
  };
78
- export const FilesDragDrop = ({ uploadEvent = "files-available", uploadRequested = "upload-requested", convert = false, maxSize = 50 * 1024 * 1024, extra = "", }) => ({
79
- "data-extra": extra,
80
- "data-drag-drop": "1",
81
- "data-convert": convert,
82
- "data-upload-event": uploadEvent,
83
- "data-upload-requested": uploadRequested,
84
- "data-max-size": maxSize,
85
- "event-dragenter": dragEnter,
86
- "event-dragleave": dragLeave,
87
- "event-dragover": dragOver,
88
- "event-drop": eventDrop
89
- });
90
- //# sourceMappingURL=FilesDragDrop.js.map
77
+ export const FilesDragDrop = ({
78
+ uploadEvent = "files-available",
79
+ uploadRequested = "upload-requested",
80
+ convert = false,
81
+ maxSize = 50 * 1024 * 1024,
82
+ extra = ""
83
+ }) => ({
84
+ "data-extra": extra,
85
+ "data-drag-drop": "1",
86
+ "data-convert": convert,
87
+ "data-upload-event": uploadEvent,
88
+ "data-upload-requested": uploadRequested,
89
+ "data-max-size": maxSize,
90
+ "event-dragenter": dragEnter,
91
+ "event-dragleave": dragLeave,
92
+ "event-dragover": dragOver,
93
+ "event-drop": eventDrop
94
+ });
@@ -1,61 +1,89 @@
1
1
  import Bind from "@web-atoms/core/dist/core/Bind.js";
2
2
  import { StringHelper } from "@web-atoms/core/dist/core/StringHelper.js";
3
3
  import XNode from "@web-atoms/core/dist/core/XNode.js";
4
- import "../styles/form.global.css";
5
- const checkClick = (e) => {
6
- const form = e.currentTarget;
7
- const element = e.target;
8
- let target = element;
9
- while (target.tagName !== "BUTTON") {
10
- target = target.parentElement;
11
- if (!target || target === form) {
12
- return;
13
- }
4
+ ESMPack.installStyleSheet(import.meta.resolve("../styles/form.global.css"));
5
+ const checkClick = e => {
6
+ const form = e.currentTarget;
7
+ const element = e.target;
8
+ let target = element;
9
+ while (target.tagName !== "BUTTON") {
10
+ target = target.parentElement;
11
+ if (!target || target === form) {
12
+ return;
14
13
  }
15
- const submitEvent = target.getAttribute("data-submit-event");
16
- if (!submitEvent) {
17
- if (!/submit/i.test(target.getAttribute("type") ?? target.getAttribute("data-type"))) {
18
- return;
19
- }
14
+ }
15
+ const submitEvent = target.getAttribute("data-submit-event");
16
+ if (!submitEvent) {
17
+ if (!/submit/i.test(target.getAttribute("type") ?? target.getAttribute("data-type"))) {
18
+ return;
20
19
  }
21
- form.setAttribute("data-show-validation", "true");
22
- setTimeout(() => {
23
- const all = Array.from(form.getElementsByClassName("field-error"));
24
- for (const iterator of all) {
25
- if (iterator.textContent) {
26
- form.setAttribute("data-valid", "false");
27
- return;
28
- }
29
- }
30
- form.setAttribute("data-valid", "true");
31
- const eventName = StringHelper.fromHyphenToCamel(submitEvent ?? form.getAttribute("data-submit-event"));
32
- target.dispatchEvent(new CustomEvent(eventName, { bubbles: true, cancelable: true }));
33
- }, 100);
20
+ }
21
+ form.setAttribute("data-show-validation", "true");
22
+ setTimeout(() => {
23
+ const all = Array.from(form.getElementsByClassName("field-error"));
24
+ for (const iterator of all) {
25
+ if (iterator.textContent) {
26
+ form.setAttribute("data-valid", "false");
27
+ return;
28
+ }
29
+ }
30
+ form.setAttribute("data-valid", "true");
31
+ const eventName = StringHelper.fromHyphenToCamel(submitEvent ?? form.getAttribute("data-submit-event"));
32
+ target.dispatchEvent(new CustomEvent(eventName, {
33
+ bubbles: true,
34
+ cancelable: true
35
+ }));
36
+ }, 100);
34
37
  };
35
- export default function Form({ "data-submit-event": submitEvent = "submitForm", "data-show-validation": showValidation = "false", "data-error-message": errorMessage = "Please fix all validations", ...a }, ...nodes) {
36
- return XNode.create("div", { ...a, "data-submit-event": submitEvent, "data-form": "form", "data-valid": "true", "data-show-validation": showValidation, "data-error-message": errorMessage, "event-click": checkClick },
37
- XNode.create("div", { class: "error-message", text: errorMessage }),
38
- ...nodes);
38
+ export default function Form({
39
+ "data-submit-event": submitEvent = "submitForm",
40
+ "data-show-validation": showValidation = "false",
41
+ "data-error-message": errorMessage = "Please fix all validations",
42
+ ...a
43
+ }, ...nodes) {
44
+ return XNode.create("div", {
45
+ ...a,
46
+ "data-submit-event": submitEvent,
47
+ "data-form": "form",
48
+ "data-valid": "true",
49
+ "data-show-validation": showValidation,
50
+ "data-error-message": errorMessage,
51
+ "event-click": checkClick
52
+ }, XNode.create("div", {
53
+ class: "error-message",
54
+ text: errorMessage
55
+ }), ...nodes);
39
56
  }
40
- export const BindError = ({ value, message = (v, l) => `${l} is invalid`, isValid = (v, e) => !!v, }) => {
41
- function f2(sender, element) {
42
- const isRequired = element.parentElement.querySelector(`[data-required]`);
43
- const msg = value.call(this, sender);
44
- if (!msg) {
45
- if (!isRequired) {
46
- return "";
47
- }
48
- }
49
- if (isValid(msg, element)) {
50
- return "";
51
- }
52
- return message(msg, element.parentElement.querySelector(`[data-element=label]`)?.textContent || "This field ");
57
+ export const BindError = ({
58
+ value,
59
+ message = (v, l) => `${l} is invalid`,
60
+ isValid = (v, e) => !!v
61
+ }) => {
62
+ function f2(sender, element) {
63
+ const isRequired = element.parentElement.querySelector(`[data-required]`);
64
+ const msg = value.call(this, sender);
65
+ if (!msg) {
66
+ if (!isRequired) {
67
+ return "";
68
+ }
53
69
  }
54
- ;
55
- f2.toString = () => value.toString();
56
- return Bind.oneWay(f2);
57
- };
58
- export const BindEmailError = ({ value, message = (v, l) => `${l} is not a valid email address`, isValid = (v, e) => /[^\@]+\@[^\@]+\.[^\@]+/i.test(v), }) => {
59
- return BindError({ value, message, isValid });
70
+ if (isValid(msg, element)) {
71
+ return "";
72
+ }
73
+ return message(msg, element.parentElement.querySelector(`[data-element=label]`)?.textContent || "This field ");
74
+ }
75
+ ;
76
+ f2.toString = () => value.toString();
77
+ return Bind.oneWay(f2);
60
78
  };
61
- //# sourceMappingURL=Form.js.map
79
+ export const BindEmailError = ({
80
+ value,
81
+ message = (v, l) => `${l} is not a valid email address`,
82
+ isValid = (v, e) => /[^\@]+\@[^\@]+\.[^\@]+/i.test(v)
83
+ }) => {
84
+ return BindError({
85
+ value,
86
+ message,
87
+ isValid
88
+ });
89
+ };
@@ -1,122 +1,180 @@
1
1
  import Bind from "@web-atoms/core/dist/core/Bind.js";
2
2
  import XNode from "@web-atoms/core/dist/core/XNode.js";
3
3
  import PopupService, { PopupWindow } from "@web-atoms/core/dist/web/services/PopupService.js";
4
- import "./styles/form-field.global.css";
5
- document.body.addEventListener("click", (e) => {
6
- let label = e.target;
7
- while (label && label.tagName !== "LABEL") {
8
- if (label.getAttribute("data-element") === "label") {
9
- break;
10
- }
11
- label = label.parentElement;
12
- if (label === document.body) {
13
- return;
14
- }
15
- }
16
- if (!label) {
17
- return;
4
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/form-field.global.css"));
5
+ document.body.addEventListener("click", e => {
6
+ let label = e.target;
7
+ while (label && label.tagName !== "LABEL") {
8
+ if (label.getAttribute("data-element") === "label") {
9
+ break;
18
10
  }
19
- const formField = label.parentElement;
20
- if (!formField.hasAttribute("data-wa-form-field")) {
21
- return;
11
+ label = label.parentElement;
12
+ if (label === document.body) {
13
+ return;
22
14
  }
23
- const selectable = formField.querySelector("select,input,textarea");
24
- selectable?.focus?.();
15
+ }
16
+ if (!label) {
17
+ return;
18
+ }
19
+ const formField = label.parentElement;
20
+ if (!formField.hasAttribute("data-wa-form-field")) {
21
+ return;
22
+ }
23
+ const selectable = formField.querySelector("select,input,textarea");
24
+ selectable?.focus?.();
25
25
  });
26
- document.addEventListener("focusin", (e) => {
27
- let target = e.target;
28
- while (target) {
29
- if (target.getAttribute("data-wa-form-field") === "wa-form-field") {
30
- target.setAttribute("data-focused", "true");
31
- break;
32
- }
33
- target = target.parentElement;
26
+ document.addEventListener("focusin", e => {
27
+ let target = e.target;
28
+ while (target) {
29
+ if (target.getAttribute("data-wa-form-field") === "wa-form-field") {
30
+ target.setAttribute("data-focused", "true");
31
+ break;
34
32
  }
33
+ target = target.parentElement;
34
+ }
35
35
  });
36
- document.addEventListener("focusout", (e) => {
37
- let target = e.target;
38
- while (target) {
39
- if (target.getAttribute("data-wa-form-field") === "wa-form-field") {
40
- target.removeAttribute("data-focused");
41
- break;
42
- }
43
- target = target.parentElement;
36
+ document.addEventListener("focusout", e => {
37
+ let target = e.target;
38
+ while (target) {
39
+ if (target.getAttribute("data-wa-form-field") === "wa-form-field") {
40
+ target.removeAttribute("data-focused");
41
+ break;
44
42
  }
43
+ target = target.parentElement;
44
+ }
45
45
  });
46
- export default function FormField({ label, required, error, helpIcon = "fas fa-question-circle", help, helpEventClick, helpTitle, border = false, ...others }, node) {
47
- if (node) {
48
- const na = node.attributes ??= {};
49
- na["data-element"] = "content";
50
- }
51
- if (!helpEventClick && help) {
52
- helpEventClick = Bind.event((s, e) => {
53
- const app = s.app;
54
- if (typeof help === "string" || help instanceof XNode) {
55
- PopupService.notify(help).catch(console.error);
56
- return;
57
- }
58
- class HelpPopup extends PopupWindow {
59
- create() {
60
- this.render(XNode.create("div", { "data-form-field-help": "help-window" }, help));
61
- }
62
- }
63
- HelpPopup.showWindow({ title: helpTitle ?? "Help", modal: true });
64
- });
65
- }
66
- let labelIsNode = false;
67
- if (label) {
68
- if (label instanceof XNode) {
69
- const la = label.attributes ??= {};
70
- la["data-element"] = "label";
71
- labelIsNode = true;
46
+ export default function FormField({
47
+ label,
48
+ required,
49
+ error,
50
+ helpIcon = "fas fa-question-circle",
51
+ help,
52
+ helpEventClick,
53
+ helpTitle,
54
+ border = false,
55
+ ...others
56
+ }, node) {
57
+ if (node) {
58
+ const na = node.attributes ??= {};
59
+ na["data-element"] = "content";
60
+ }
61
+ if (!helpEventClick && help) {
62
+ helpEventClick = Bind.event((s, e) => {
63
+ const app = s.app;
64
+ if (typeof help === "string" || help instanceof XNode) {
65
+ PopupService.notify(help).catch(console.error);
66
+ return;
67
+ }
68
+ class HelpPopup extends PopupWindow {
69
+ create() {
70
+ this.render(XNode.create("div", {
71
+ "data-form-field-help": "help-window"
72
+ }, help));
72
73
  }
73
- else {
74
- if (node) {
75
- if (!(node.attributes?.ariaLabel || node.attributes?.["aria-label"])) {
76
- (node.attributes ??= {})["aria-label"] = label;
77
- }
78
- }
74
+ }
75
+ HelpPopup.showWindow({
76
+ title: helpTitle ?? "Help",
77
+ modal: true
78
+ });
79
+ });
80
+ }
81
+ let labelIsNode = false;
82
+ if (label) {
83
+ if (label instanceof XNode) {
84
+ const la = label.attributes ??= {};
85
+ la["data-element"] = "label";
86
+ labelIsNode = true;
87
+ } else {
88
+ if (node) {
89
+ if (!(node.attributes?.ariaLabel || node.attributes?.["aria-label"])) {
90
+ (node.attributes ??= {})["aria-label"] = label;
79
91
  }
92
+ }
80
93
  }
81
- return XNode.create("div", { "data-wa-form-field": "wa-form-field", "data-border": border, ...others },
82
- label && (labelIsNode ? label : XNode.create("label", { "data-element": "label", text: label })),
83
- required && XNode.create("span", { "data-required": "required", class: required, text: "*" }),
84
- border && XNode.create("i", { "data-border": "border" }),
85
- node,
86
- help && XNode.create("i", { "data-help": "help", class: helpIcon, title: helpTitle, eventClick: helpEventClick }),
87
- XNode.create("div", { class: "field-error", text: error }));
94
+ }
95
+ return XNode.create("div", {
96
+ "data-wa-form-field": "wa-form-field",
97
+ "data-border": border,
98
+ ...others
99
+ }, label && (labelIsNode ? label : XNode.create("label", {
100
+ "data-element": "label",
101
+ text: label
102
+ })), required && XNode.create("span", {
103
+ "data-required": "required",
104
+ class: required,
105
+ text: "*"
106
+ }), border && XNode.create("i", {
107
+ "data-border": "border"
108
+ }), node, help && XNode.create("i", {
109
+ "data-help": "help",
110
+ class: helpIcon,
111
+ title: helpTitle,
112
+ eventClick: helpEventClick
113
+ }), XNode.create("div", {
114
+ class: "field-error",
115
+ text: error
116
+ }));
88
117
  }
89
- export function HorizontalFormField({ label, required, error, helpIcon = "fas fa-question-circle", help, helpEventClick, helpTitle, border = false, ...others }, node) {
90
- if (node) {
91
- const na = node.attributes ??= {};
92
- na["data-content"] = "content";
93
- }
94
- if (!helpEventClick && help) {
95
- helpEventClick = Bind.event((s, e) => {
96
- const app = s.app;
97
- if (typeof help === "string" || help instanceof XNode) {
98
- PopupService.notify(help).catch(console.error);
99
- return;
100
- }
101
- class HelpPopup extends PopupWindow {
102
- create() {
103
- this.render(XNode.create("div", { "data-form-field-help": "help-window" }, help));
104
- }
105
- }
106
- HelpPopup.showWindow({ title: helpTitle ?? "Help" });
107
- });
108
- }
109
- if (node) {
110
- if (!(node.attributes?.ariaLabel || node.attributes?.["aria-label"])) {
111
- (node.attributes ??= {})["aria-label"] = label;
118
+ export function HorizontalFormField({
119
+ label,
120
+ required,
121
+ error,
122
+ helpIcon = "fas fa-question-circle",
123
+ help,
124
+ helpEventClick,
125
+ helpTitle,
126
+ border = false,
127
+ ...others
128
+ }, node) {
129
+ if (node) {
130
+ const na = node.attributes ??= {};
131
+ na["data-content"] = "content";
132
+ }
133
+ if (!helpEventClick && help) {
134
+ helpEventClick = Bind.event((s, e) => {
135
+ const app = s.app;
136
+ if (typeof help === "string" || help instanceof XNode) {
137
+ PopupService.notify(help).catch(console.error);
138
+ return;
139
+ }
140
+ class HelpPopup extends PopupWindow {
141
+ create() {
142
+ this.render(XNode.create("div", {
143
+ "data-form-field-help": "help-window"
144
+ }, help));
112
145
  }
146
+ }
147
+ HelpPopup.showWindow({
148
+ title: helpTitle ?? "Help"
149
+ });
150
+ });
151
+ }
152
+ if (node) {
153
+ if (!(node.attributes?.ariaLabel || node.attributes?.["aria-label"])) {
154
+ (node.attributes ??= {})["aria-label"] = label;
113
155
  }
114
- return XNode.create("div", { "data-wa-form-field": "wa-form-field", "data-layout": "horizontal", "data-border": border, ...others },
115
- label && XNode.create("label", { class: "label", text: label }),
116
- required && XNode.create("span", { "data-required": "required", class: required, text: "*" }),
117
- border && XNode.create("i", { "data-border": "border" }),
118
- node,
119
- help && XNode.create("i", { "data-help": "help", class: helpIcon, title: helpTitle, eventClick: helpEventClick }),
120
- XNode.create("div", { class: "field-error", text: error }));
121
- }
122
- //# sourceMappingURL=FormField.js.map
156
+ }
157
+ return XNode.create("div", {
158
+ "data-wa-form-field": "wa-form-field",
159
+ "data-layout": "horizontal",
160
+ "data-border": border,
161
+ ...others
162
+ }, label && XNode.create("label", {
163
+ class: "label",
164
+ text: label
165
+ }), required && XNode.create("span", {
166
+ "data-required": "required",
167
+ class: required,
168
+ text: "*"
169
+ }), border && XNode.create("i", {
170
+ "data-border": "border"
171
+ }), node, help && XNode.create("i", {
172
+ "data-help": "help",
173
+ class: helpIcon,
174
+ title: helpTitle,
175
+ eventClick: helpEventClick
176
+ }), XNode.create("div", {
177
+ class: "field-error",
178
+ text: error
179
+ }));
180
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=IElement.js.map
1
+ export {};