@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
@@ -6,230 +6,238 @@ import XNode from "@web-atoms/core/dist/core/XNode.js";
6
6
  import DateTime from "@web-atoms/date-time/dist/DateTime.js";
7
7
  import AtomRepeater from "./AtomRepeater.js";
8
8
  import Select from "./Select.js";
9
- import "./styles/calendar.global.css";
9
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/calendar.global.css"));
10
10
  const start = DateTime.now;
11
11
  const getWeekDays = (locale, type) => {
12
- const baseDate = new Date(Date.UTC(2017, 0, 2));
13
- const weekDays = [];
14
- for (let i = 0; i < 7; i++) {
15
- weekDays.push(baseDate.toLocaleDateString(locale, { weekday: type }));
16
- baseDate.setDate(baseDate.getDate() + 1);
17
- }
18
- return weekDays;
12
+ const baseDate = new Date(Date.UTC(2017, 0, 2));
13
+ const weekDays = [];
14
+ for (let i = 0; i < 7; i++) {
15
+ weekDays.push(baseDate.toLocaleDateString(locale, {
16
+ weekday: type
17
+ }));
18
+ baseDate.setDate(baseDate.getDate() + 1);
19
+ }
20
+ return weekDays;
19
21
  };
20
22
  const getMonths = (locale, type) => {
21
- const baseDate = new Date(Date.UTC(2017, 0, 2));
22
- const weekDays = [];
23
- for (let i = 0; i < 12; i++) {
24
- weekDays.push(baseDate.toLocaleDateString(locale, { month: type }));
25
- baseDate.setMonth(i + 1);
26
- }
27
- return weekDays;
23
+ const baseDate = new Date(Date.UTC(2017, 0, 2));
24
+ const weekDays = [];
25
+ for (let i = 0; i < 12; i++) {
26
+ weekDays.push(baseDate.toLocaleDateString(locale, {
27
+ month: type
28
+ }));
29
+ baseDate.setMonth(i + 1);
30
+ }
31
+ return weekDays;
28
32
  };
29
33
  function setValue(target, name, value) {
30
- Object.defineProperty(target, name, { value });
31
- return value;
34
+ Object.defineProperty(target, name, {
35
+ value
36
+ });
37
+ return value;
32
38
  }
33
39
  export const weekdays = {
34
- get short() {
35
- return setValue(this, "short", getWeekDays(navigator.language, "short"));
36
- },
37
- get long() {
38
- return setValue(this, "long", getWeekDays(navigator.language, "long"));
39
- }
40
+ get short() {
41
+ return setValue(this, "short", getWeekDays(navigator.language, "short"));
42
+ },
43
+ get long() {
44
+ return setValue(this, "long", getWeekDays(navigator.language, "long"));
45
+ }
40
46
  };
41
47
  export const months = {
42
- get short() {
43
- return setValue(this, "short", getMonths(navigator.language, "short"));
44
- },
45
- get long() {
46
- return setValue(this, "long", getMonths(navigator.language, "long"));
47
- },
48
- get items() {
49
- return setValue(this, "items", this.long.map((x, i) => ({ label: x, value: i })));
50
- }
48
+ get short() {
49
+ return setValue(this, "short", getMonths(navigator.language, "short"));
50
+ },
51
+ get long() {
52
+ return setValue(this, "long", getMonths(navigator.language, "long"));
53
+ },
54
+ get items() {
55
+ return setValue(this, "items", this.long.map((x, i) => ({
56
+ label: x,
57
+ value: i
58
+ })));
59
+ }
51
60
  };
52
61
  export default class Calendar extends AtomRepeater {
53
- constructor() {
54
- super(...arguments);
55
- this.dateModified = false;
62
+ constructor() {
63
+ super(...arguments);
64
+ this.dateModified = false;
65
+ }
66
+ set startDate(v) {
67
+ if (this.dateModified) {
68
+ return;
69
+ }
70
+ const year = v.getFullYear();
71
+ const month = v.getMonth();
72
+ if (this.year !== year) {
73
+ this.year = year;
56
74
  }
57
- set startDate(v) {
58
- if (this.dateModified) {
59
- return;
60
- }
61
- const year = v.getFullYear();
62
- const month = v.getMonth();
63
- if (this.year !== year) {
64
- this.year = year;
65
- }
66
- if (this.month !== month) {
67
- this.month = month;
68
- }
75
+ if (this.month !== month) {
76
+ this.month = month;
69
77
  }
70
- get dates() {
71
- const year = this.year;
72
- const tm = this.month;
73
- if (tm === undefined || year === undefined) {
74
- return [];
75
- }
76
- const month = Number(tm);
77
- const today = DateTime.today;
78
- let startDate = new DateTime(year, month, 1);
79
- while (startDate.dayOfWeek !== 1) {
80
- startDate = startDate.add(-1);
81
- }
82
- const a = [];
83
- const y = startDate.year;
84
- const m = startDate.month;
85
- const ef = this.enableFunc;
86
- for (let index = 0; index < 42; index++) {
87
- const cd = startDate.add(index);
88
- const item = {
89
- label: cd.day + "",
90
- row: Math.floor(index / 7),
91
- column: index % 7,
92
- type: null,
93
- value: cd,
94
- isToday: cd.equals(today),
95
- isOtherMonth: month !== cd.month,
96
- isWeekend: (cd.dayOfWeek === 0 || cd.dayOfWeek === 6),
97
- disabled: false
98
- };
99
- if (ef) {
100
- item.disabled = !(ef(item));
101
- }
102
- a.push(item);
103
- }
104
- return a;
78
+ }
79
+ get dates() {
80
+ const year = this.year;
81
+ const tm = this.month;
82
+ if (tm === undefined || year === undefined) {
83
+ return [];
105
84
  }
106
- get years() {
107
- const years = [];
108
- const s = start.year + this.yearStart;
109
- const e = start.year + this.yearEnd + 1;
110
- for (let index = s; index < e; index++) {
111
- years.push({
112
- label: index.toString(),
113
- value: index
114
- });
115
- }
116
- return years;
85
+ const month = Number(tm);
86
+ const today = DateTime.today;
87
+ let startDate = new DateTime(year, month, 1);
88
+ while (startDate.dayOfWeek !== 1) {
89
+ startDate = startDate.add(-1);
117
90
  }
118
- get value() {
119
- return super.value;
91
+ const a = [];
92
+ const y = startDate.year;
93
+ const m = startDate.month;
94
+ const ef = this.enableFunc;
95
+ for (let index = 0; index < 42; index++) {
96
+ const cd = startDate.add(index);
97
+ const item = {
98
+ label: cd.day + "",
99
+ row: Math.floor(index / 7),
100
+ column: index % 7,
101
+ type: null,
102
+ value: cd,
103
+ isToday: cd.equals(today),
104
+ isOtherMonth: month !== cd.month,
105
+ isWeekend: cd.dayOfWeek === 0 || cd.dayOfWeek === 6,
106
+ disabled: false
107
+ };
108
+ if (ef) {
109
+ item.disabled = !ef(item);
110
+ }
111
+ a.push(item);
120
112
  }
121
- set value(v) {
122
- if (v instanceof Date) {
123
- this.startDate = v;
124
- }
125
- super.value = v;
113
+ return a;
114
+ }
115
+ get years() {
116
+ const years = [];
117
+ const s = start.year + this.yearStart;
118
+ const e = start.year + this.yearEnd + 1;
119
+ for (let index = s; index < e; index++) {
120
+ years.push({
121
+ label: index.toString(),
122
+ value: index
123
+ });
126
124
  }
127
- onPropertyChanged(name) {
128
- super.onPropertyChanged(name);
129
- switch (name) {
130
- case "enableFunc":
131
- case "dateRenderer":
132
- this.updateItems();
133
- break;
134
- }
125
+ return years;
126
+ }
127
+ get value() {
128
+ return super.value;
129
+ }
130
+ set value(v) {
131
+ if (v instanceof Date) {
132
+ this.startDate = v;
135
133
  }
136
- next() {
137
- if (this.month === 11) {
138
- this.year++;
139
- this.month = 0;
140
- return;
141
- }
142
- this.month++;
134
+ super.value = v;
135
+ }
136
+ onPropertyChanged(name) {
137
+ super.onPropertyChanged(name);
138
+ switch (name) {
139
+ case "enableFunc":
140
+ case "dateRenderer":
141
+ this.updateItems();
142
+ break;
143
143
  }
144
- prev() {
145
- if (this.month === 0) {
146
- this.year--;
147
- this.month = 11;
148
- return;
149
- }
150
- this.month--;
144
+ }
145
+ next() {
146
+ if (this.month === 11) {
147
+ this.year++;
148
+ this.month = 0;
149
+ return;
151
150
  }
152
- preCreate() {
153
- super.preCreate();
154
- const now = new Date();
155
- this.selectedItems = [];
156
- this.valuePath = (i) => i?.value;
157
- this.yearStart = -10;
158
- this.yearEnd = 10;
159
- this.year = now.getFullYear();
160
- this.month = now.getMonth();
161
- this.comparer = (left, right) => left && right &&
162
- DateTime.from(left).date?.msSinceEpoch === DateTime.from(right).date?.msSinceEpoch;
163
- this.bindEvent(this.element, "change", () => this.dateModified = true, null, { capture: true });
164
- this.bindEvent(this.element, "itemSelect", (e) => e.detail.disabled ? e.preventDefault() : null);
165
- this.render(XNode.create("div", { "data-calendar": "calendar", items: Bind.oneWay(() => this.dates) },
166
- XNode.create("i", { "data-element": "previous", "event-click": () => this.prev(), class: "fa-solid fa-circle-chevron-left", title: "Previous Month" }),
167
- XNode.create(Select, { "data-element": "month", items: months.items, value: Bind.twoWays(() => this.month) }),
168
- XNode.create(Select, { "data-element": "year", items: Bind.oneWay(() => this.years), value: Bind.twoWays(() => this.year) }),
169
- XNode.create("i", { "data-element": "next", "event-click": () => this.next(), class: "fa-solid fa-circle-chevron-right", title: "Next Month" }),
170
- XNode.create("div", { class: "week" }),
171
- XNode.create("div", { "data-click-event": "item-select", class: "dates" })));
172
- this.itemsPresenter = this.element.lastElementChild;
173
- const week = this.element.lastElementChild.previousElementSibling;
174
- let w = 1;
175
- for (const iterator of weekdays.short) {
176
- const text = document.createElement("span");
177
- text.textContent = iterator;
178
- week.appendChild(text);
179
- text.style.gridColumnStart = `${w++}`;
180
- }
181
- this.dateRenderer = (item) => XNode.create("div", { text: item.label });
182
- this.itemRenderer = (item) => {
183
- const d = this.dateRenderer(item);
184
- const a = d.attributes ??= {};
185
- if (item.isToday) {
186
- a["data-is-today"] = item.isToday;
187
- }
188
- if (item.isOtherMonth) {
189
- a["data-is-other-month"] = item.isOtherMonth;
190
- }
191
- if (item.isWeekend) {
192
- a["data-is-weekend"] = item.isWeekend;
193
- }
194
- if (item.disabled) {
195
- a["data-disabled"] = item.disabled;
196
- }
197
- return d;
198
- };
151
+ this.month++;
152
+ }
153
+ prev() {
154
+ if (this.month === 0) {
155
+ this.year--;
156
+ this.month = 11;
157
+ return;
199
158
  }
200
- dispatchItemEvent(eventName, item, recreate, originalTarget, nestedItem) {
201
- this.dateModified = true;
202
- super.dispatchItemEvent(eventName, item, recreate, originalTarget, nestedItem);
159
+ this.month--;
160
+ }
161
+ preCreate() {
162
+ super.preCreate();
163
+ const now = new Date();
164
+ this.selectedItems = [];
165
+ this.valuePath = i => i?.value;
166
+ this.yearStart = -10;
167
+ this.yearEnd = 10;
168
+ this.year = now.getFullYear();
169
+ this.month = now.getMonth();
170
+ this.comparer = (left, right) => left && right && DateTime.from(left).date?.msSinceEpoch === DateTime.from(right).date?.msSinceEpoch;
171
+ this.bindEvent(this.element, "change", () => this.dateModified = true, null, {
172
+ capture: true
173
+ });
174
+ this.bindEvent(this.element, "itemSelect", e => e.detail.disabled ? e.preventDefault() : null);
175
+ this.render(XNode.create("div", {
176
+ "data-calendar": "calendar",
177
+ items: Bind.oneWay(() => this.dates)
178
+ }, XNode.create("i", {
179
+ "data-element": "previous",
180
+ "event-click": () => this.prev(),
181
+ class: "fa-solid fa-circle-chevron-left",
182
+ title: "Previous Month"
183
+ }), XNode.create(Select, {
184
+ "data-element": "month",
185
+ items: months.items,
186
+ value: Bind.twoWays(() => this.month)
187
+ }), XNode.create(Select, {
188
+ "data-element": "year",
189
+ items: Bind.oneWay(() => this.years),
190
+ value: Bind.twoWays(() => this.year)
191
+ }), XNode.create("i", {
192
+ "data-element": "next",
193
+ "event-click": () => this.next(),
194
+ class: "fa-solid fa-circle-chevron-right",
195
+ title: "Next Month"
196
+ }), XNode.create("div", {
197
+ class: "week"
198
+ }), XNode.create("div", {
199
+ "data-click-event": "item-select",
200
+ class: "dates"
201
+ })));
202
+ this.itemsPresenter = this.element.lastElementChild;
203
+ const week = this.element.lastElementChild.previousElementSibling;
204
+ let w = 1;
205
+ for (const iterator of weekdays.short) {
206
+ const text = document.createElement("span");
207
+ text.textContent = iterator;
208
+ week.appendChild(text);
209
+ text.style.gridColumnStart = `${w++}`;
203
210
  }
211
+ this.dateRenderer = item => XNode.create("div", {
212
+ text: item.label
213
+ });
214
+ this.itemRenderer = item => {
215
+ const d = this.dateRenderer(item);
216
+ const a = d.attributes ??= {};
217
+ if (item.isToday) {
218
+ a["data-is-today"] = item.isToday;
219
+ }
220
+ if (item.isOtherMonth) {
221
+ a["data-is-other-month"] = item.isOtherMonth;
222
+ }
223
+ if (item.isWeekend) {
224
+ a["data-is-weekend"] = item.isWeekend;
225
+ }
226
+ if (item.disabled) {
227
+ a["data-disabled"] = item.disabled;
228
+ }
229
+ return d;
230
+ };
231
+ }
232
+ dispatchItemEvent(eventName, item, recreate, originalTarget, nestedItem) {
233
+ this.dateModified = true;
234
+ super.dispatchItemEvent(eventName, item, recreate, originalTarget, nestedItem);
235
+ }
204
236
  }
205
- __decorate([
206
- BindableProperty,
207
- __metadata("design:type", Number)
208
- ], Calendar.prototype, "year", void 0);
209
- __decorate([
210
- BindableProperty,
211
- __metadata("design:type", Number)
212
- ], Calendar.prototype, "month", void 0);
213
- __decorate([
214
- BindableProperty,
215
- __metadata("design:type", Number)
216
- ], Calendar.prototype, "yearStart", void 0);
217
- __decorate([
218
- BindableProperty,
219
- __metadata("design:type", Number)
220
- ], Calendar.prototype, "yearEnd", void 0);
221
- __decorate([
222
- BindableProperty,
223
- __metadata("design:type", Function)
224
- ], Calendar.prototype, "dateRenderer", void 0);
225
- __decorate([
226
- WatchProperty,
227
- __metadata("design:type", Object),
228
- __metadata("design:paramtypes", [])
229
- ], Calendar.prototype, "dates", null);
230
- __decorate([
231
- WatchProperty,
232
- __metadata("design:type", Object),
233
- __metadata("design:paramtypes", [])
234
- ], Calendar.prototype, "years", null);
235
- //# sourceMappingURL=Calendar.js.map
237
+ __decorate([BindableProperty, __metadata("design:type", Number)], Calendar.prototype, "year", void 0);
238
+ __decorate([BindableProperty, __metadata("design:type", Number)], Calendar.prototype, "month", void 0);
239
+ __decorate([BindableProperty, __metadata("design:type", Number)], Calendar.prototype, "yearStart", void 0);
240
+ __decorate([BindableProperty, __metadata("design:type", Number)], Calendar.prototype, "yearEnd", void 0);
241
+ __decorate([BindableProperty, __metadata("design:type", Function)], Calendar.prototype, "dateRenderer", void 0);
242
+ __decorate([WatchProperty, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Calendar.prototype, "dates", null);
243
+ __decorate([WatchProperty, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Calendar.prototype, "years", null);
@@ -2,77 +2,97 @@ import { __decorate, __metadata } from "tslib";
2
2
  import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty.js";
3
3
  import XNode from "@web-atoms/core/dist/core/XNode.js";
4
4
  import AtomRepeater, { SameObjectValue } from "./AtomRepeater.js";
5
- import "./styles/check-box-list.global.css";
5
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/check-box-list.global.css"));
6
6
  export default class CheckBoxList extends AtomRepeater {
7
- preCreate() {
8
- super.preCreate();
9
- this.element.dataset.checkboxList = "checkbox-list";
10
- this.bindEvent(this.element, "itemClick", (e) => {
11
- const s = this.selectedItems;
12
- if (!s) {
13
- return;
7
+ preCreate() {
8
+ super.preCreate();
9
+ this.element.dataset.checkboxList = "checkbox-list";
10
+ this.bindEvent(this.element, "itemClick", e => {
11
+ const s = this.selectedItems;
12
+ if (!s) {
13
+ return;
14
+ }
15
+ const item = e.detail;
16
+ const vp = this.valuePath ?? SameObjectValue;
17
+ const value = vp(item);
18
+ let existing = s.find(i => vp(i) === value);
19
+ if (!existing) {
20
+ s.add(item);
21
+ this.element.dispatchEvent(new CustomEvent("itemSelect", {
22
+ detail: item,
23
+ bubbles: false
24
+ }));
25
+ if (this.softDeleteProperty) {
26
+ item[this.softDeleteProperty] = false;
27
+ }
28
+ this.refreshItem(item);
29
+ } else {
30
+ if (this.softDeleteProperty) {
31
+ const existingItem = this.items.find(i => vp(i) === value);
32
+ if (existing[this.softDeleteProperty] === true) {
33
+ existing[this.softDeleteProperty] = false;
34
+ if (existingItem && existingItem !== existing) {
35
+ existingItem[this.softDeleteProperty] = false;
36
+ this.element.dispatchEvent(new CustomEvent("itemSelect", {
37
+ detail: item,
38
+ bubbles: false
39
+ }));
40
+ this.refreshItem(existingItem);
14
41
  }
15
- const item = e.detail;
16
- const vp = this.valuePath ?? SameObjectValue;
17
- const value = vp(item);
18
- let existing = s.find((i) => vp(i) === value);
19
- if (!existing) {
20
- s.add(item);
21
- this.element.dispatchEvent(new CustomEvent("itemSelect", { detail: item, bubbles: false }));
22
- if (this.softDeleteProperty) {
23
- item[this.softDeleteProperty] = false;
24
- }
25
- this.refreshItem(item);
42
+ this.element.dispatchEvent(new CustomEvent("itemSelect", {
43
+ detail: item,
44
+ bubbles: false
45
+ }));
46
+ } else {
47
+ existing[this.softDeleteProperty] = true;
48
+ if (existingItem && existingItem !== existing) {
49
+ existingItem[this.softDeleteProperty] = true;
50
+ this.element.dispatchEvent(new CustomEvent("itemDeselect", {
51
+ detail: item,
52
+ bubbles: false
53
+ }));
54
+ this.refreshItem(existingItem);
26
55
  }
27
- else {
28
- if (this.softDeleteProperty) {
29
- const existingItem = this.items.find((i) => vp(i) === value);
30
- if (existing[this.softDeleteProperty] === true) {
31
- existing[this.softDeleteProperty] = false;
32
- if (existingItem && existingItem !== existing) {
33
- existingItem[this.softDeleteProperty] = false;
34
- this.element.dispatchEvent(new CustomEvent("itemSelect", { detail: item, bubbles: false }));
35
- this.refreshItem(existingItem);
36
- }
37
- this.element.dispatchEvent(new CustomEvent("itemSelect", { detail: item, bubbles: false }));
38
- }
39
- else {
40
- existing[this.softDeleteProperty] = true;
41
- if (existingItem && existingItem !== existing) {
42
- existingItem[this.softDeleteProperty] = true;
43
- this.element.dispatchEvent(new CustomEvent("itemDeselect", { detail: item, bubbles: false }));
44
- this.refreshItem(existingItem);
45
- }
46
- this.element.dispatchEvent(new CustomEvent("itemDeselect", { detail: existing, bubbles: false }));
47
- }
48
- this.refreshItem(existing);
49
- }
50
- else {
51
- this.element.dispatchEvent(new CustomEvent("itemDeselect", { detail: existing, bubbles: false }));
52
- s.remove(existing);
53
- }
54
- }
55
- });
56
- this.itemRenderer = (item) => {
57
- if (this.softDeleteProperty) {
58
- return XNode.create("div", { "data-deleted": !!item[this.softDeleteProperty], "data-item-type": "checkbox" },
59
- XNode.create("i", { class: "far fa-square" }),
60
- XNode.create("i", { class: "fas fa-check-square" }),
61
- XNode.create("span", { text: item.label }));
62
- }
63
- return XNode.create("div", { "data-deleted": "none", "data-item-type": "checkbox" },
64
- XNode.create("i", { class: "far fa-square" }),
65
- XNode.create("i", { class: "fas fa-check-square" }),
66
- XNode.create("span", { text: item.label }));
67
- };
68
- }
56
+ this.element.dispatchEvent(new CustomEvent("itemDeselect", {
57
+ detail: existing,
58
+ bubbles: false
59
+ }));
60
+ }
61
+ this.refreshItem(existing);
62
+ } else {
63
+ this.element.dispatchEvent(new CustomEvent("itemDeselect", {
64
+ detail: existing,
65
+ bubbles: false
66
+ }));
67
+ s.remove(existing);
68
+ }
69
+ }
70
+ });
71
+ this.itemRenderer = item => {
72
+ if (this.softDeleteProperty) {
73
+ return XNode.create("div", {
74
+ "data-deleted": !!item[this.softDeleteProperty],
75
+ "data-item-type": "checkbox"
76
+ }, XNode.create("i", {
77
+ class: "far fa-square"
78
+ }), XNode.create("i", {
79
+ class: "fas fa-check-square"
80
+ }), XNode.create("span", {
81
+ text: item.label
82
+ }));
83
+ }
84
+ return XNode.create("div", {
85
+ "data-deleted": "none",
86
+ "data-item-type": "checkbox"
87
+ }, XNode.create("i", {
88
+ class: "far fa-square"
89
+ }), XNode.create("i", {
90
+ class: "fas fa-check-square"
91
+ }), XNode.create("span", {
92
+ text: item.label
93
+ }));
94
+ };
95
+ }
69
96
  }
70
- __decorate([
71
- BindableProperty,
72
- __metadata("design:type", Object)
73
- ], CheckBoxList.prototype, "labelPath", void 0);
74
- __decorate([
75
- BindableProperty,
76
- __metadata("design:type", String)
77
- ], CheckBoxList.prototype, "softDeleteProperty", void 0);
78
- //# sourceMappingURL=CheckBoxList.js.map
97
+ __decorate([BindableProperty, __metadata("design:type", Object)], CheckBoxList.prototype, "labelPath", void 0);
98
+ __decorate([BindableProperty, __metadata("design:type", String)], CheckBoxList.prototype, "softDeleteProperty", void 0);
@@ -1,9 +1,17 @@
1
1
  import XNode from "@web-atoms/core/dist/core/XNode.js";
2
- import "./styles/checkbox.global.css";
3
- export default function Checkbox({ checked, text, ...a }) {
4
- return XNode.create("div", { "data-check-box": "check-box", ...a },
5
- XNode.create("label", null,
6
- XNode.create("input", { type: "checkbox", checked: checked }),
7
- XNode.create("span", { text: text })));
8
- }
9
- //# sourceMappingURL=Checkbox.js.map
2
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/checkbox.global.css"));
3
+ export default function Checkbox({
4
+ checked,
5
+ text,
6
+ ...a
7
+ }) {
8
+ return XNode.create("div", {
9
+ "data-check-box": "check-box",
10
+ ...a
11
+ }, XNode.create("label", null, XNode.create("input", {
12
+ type: "checkbox",
13
+ checked: checked
14
+ }), XNode.create("span", {
15
+ text: text
16
+ })));
17
+ }