@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
@@ -3,215 +3,237 @@ import Bind from "@web-atoms/core/dist/core/Bind.js";
3
3
  import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty.js";
4
4
  import XNode from "@web-atoms/core/dist/core/XNode.js";
5
5
  import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl.js";
6
- import "./styles/pinch-zoom-view.global.css";
7
- const center = (ev) => {
8
- const touch = ev.touches[0];
9
- if (touch) {
10
- return {
11
- x: touch.clientX,
12
- y: touch.clientY
13
- };
14
- }
6
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/pinch-zoom-view.global.css"));
7
+ const center = ev => {
8
+ const touch = ev.touches[0];
9
+ if (touch) {
15
10
  return {
16
- x: 0,
17
- y: 0
11
+ x: touch.clientX,
12
+ y: touch.clientY
18
13
  };
14
+ }
15
+ return {
16
+ x: 0,
17
+ y: 0
18
+ };
19
19
  };
20
20
  const distance = (first, second) => {
21
- return Math.hypot(first.pageX - second.pageX, first.pageY - second.pageY);
21
+ return Math.hypot(first.pageX - second.pageX, first.pageY - second.pageY);
22
22
  };
23
23
  export default class PinchZoomView extends AtomControl {
24
- preCreate() {
25
- this.element.title = "Use mouse wheel to zoom";
24
+ preCreate() {
25
+ this.element.title = "Use mouse wheel to zoom";
26
+ this.loading = false;
27
+ this.zoom = {
28
+ scale: 0,
29
+ anchorX: 0,
30
+ anchorY: 0,
31
+ x: 0,
32
+ y: 0
33
+ };
34
+ this.element.dataset.pinchZoom = "true";
35
+ this.element.draggable = false;
36
+ this.render(XNode.create("div", null, XNode.create("div", {
37
+ class: "image-container"
38
+ }, XNode.create("img", {
39
+ src: Bind.oneWay(() => this.getSource(this.source)),
40
+ "style-opacity": Bind.oneWay(() => this.loading ? "0.3" : "1"),
41
+ "event-load": () => {
26
42
  this.loading = false;
27
- this.zoom = {
28
- scale: 0,
29
- anchorX: 0,
30
- anchorY: 0,
31
- x: 0,
32
- y: 0
33
- };
34
- this.element.dataset.pinchZoom = "true";
35
- this.element.draggable = false;
36
- this.render(XNode.create("div", null,
37
- XNode.create("div", { class: "image-container" },
38
- XNode.create("img", { src: Bind.oneWay(() => this.getSource(this.source)), "style-opacity": Bind.oneWay(() => this.loading ? "0.3" : "1"), "event-load": () => {
39
- this.loading = false;
40
- this.updateZoom(this.zoom);
41
- } })),
42
- XNode.create("i", { class: Bind.oneWay(() => this.loading ? "spinner fa-duotone fa-spinner fa-spin" : "hide") }),
43
- XNode.create("i", { "event-click": () => this.updateZoom(), class: Bind.oneWay(() => this.zoom.scale ? "scale" : "hide"), title: "Display entire image" })));
44
- this.imageContainer = this.element.firstElementChild;
45
- this.image = this.imageContainer.firstElementChild;
46
- const scrollView = this.element;
47
- let previous;
48
- let touchMoveDisposable;
49
- let touchEndDisposable;
50
- this.bindEvent(scrollView, "touchstart", (evs) => {
51
- previous = center(evs);
52
- let previousDistance = undefined;
53
- touchMoveDisposable ??= this.bindEvent(scrollView, "touchmove", (ev) => {
54
- let { x, y, anchorX, anchorY, scale } = this.zoom;
55
- if (ev.touches.length === 2) {
56
- ev.preventDefault();
57
- ev.stopImmediatePropagation();
58
- const rect = this.element.getBoundingClientRect();
59
- const first = ev.touches[0];
60
- const second = ev.touches[1];
61
- anchorX = ((first.clientX + second.clientX) / 2) - rect.left;
62
- anchorY = ((first.clientY + second.clientY) / 2) - rect.top;
63
- const newScale = distance(first, second);
64
- if (previousDistance === void 0) {
65
- previousDistance = newScale;
66
- return;
67
- }
68
- if (previousDistance === newScale) {
69
- return;
70
- }
71
- scale += newScale - previousDistance;
72
- previousDistance = newScale;
73
- this.updateZoom({
74
- anchorX,
75
- anchorY,
76
- x,
77
- y,
78
- scale
79
- });
80
- return;
81
- }
82
- if (!previous) {
83
- return;
84
- }
85
- const cp = center(ev);
86
- x += (cp.x - previous.x);
87
- y += (cp.y - previous.y);
88
- previous = cp;
89
- this.updateZoom({
90
- anchorX,
91
- anchorY,
92
- x,
93
- y,
94
- scale
95
- });
96
- });
97
- touchEndDisposable ??= this.bindEvent(scrollView, "touchend", (ev) => {
98
- touchMoveDisposable?.dispose();
99
- touchEndDisposable?.dispose();
100
- touchMoveDisposable = undefined;
101
- touchEndDisposable = undefined;
102
- previousDistance = undefined;
103
- });
104
- });
105
- let mouseMoveDisposable;
106
- let mouseUpDisposable;
107
- this.bindEvent(scrollView, "dragstart", (ev) => {
108
- ev.preventDefault();
109
- ev.stopImmediatePropagation();
110
- });
111
- this.bindEvent(scrollView, "mousedown", (ev) => {
112
- this.element.dataset.state = "grabbing";
113
- previous = {
114
- x: ev.clientX,
115
- y: ev.clientY
116
- };
117
- mouseMoveDisposable ??= this.bindEvent(scrollView, "mousemove", (e) => {
118
- e.preventDefault();
119
- e.stopImmediatePropagation?.();
120
- const { anchorX, anchorY, scale } = this.zoom;
121
- let { x, y } = this.zoom;
122
- const cp = { x: e.clientX, y: e.clientY };
123
- x += (cp.x - previous.x);
124
- y += (cp.y - previous.y);
125
- previous = cp;
126
- this.updateZoom({
127
- anchorX,
128
- anchorY,
129
- x,
130
- y,
131
- scale
132
- });
133
- });
134
- mouseUpDisposable ??= this.bindEvent(scrollView, "mouseup", (e) => {
135
- e.preventDefault();
136
- e.stopImmediatePropagation?.();
137
- this.element.dataset.state = "";
138
- previous = null;
139
- mouseMoveDisposable.dispose();
140
- mouseUpDisposable.dispose();
141
- mouseMoveDisposable = undefined;
142
- mouseUpDisposable = undefined;
143
- });
43
+ this.updateZoom(this.zoom);
44
+ }
45
+ })), XNode.create("i", {
46
+ class: Bind.oneWay(() => this.loading ? "spinner fa-duotone fa-spinner fa-spin" : "hide")
47
+ }), XNode.create("i", {
48
+ "event-click": () => this.updateZoom(),
49
+ class: Bind.oneWay(() => this.zoom.scale ? "scale" : "hide"),
50
+ title: "Display entire image"
51
+ })));
52
+ this.imageContainer = this.element.firstElementChild;
53
+ this.image = this.imageContainer.firstElementChild;
54
+ const scrollView = this.element;
55
+ let previous;
56
+ let touchMoveDisposable;
57
+ let touchEndDisposable;
58
+ this.bindEvent(scrollView, "touchstart", evs => {
59
+ previous = center(evs);
60
+ let previousDistance = undefined;
61
+ touchMoveDisposable ??= this.bindEvent(scrollView, "touchmove", ev => {
62
+ let {
63
+ x,
64
+ y,
65
+ anchorX,
66
+ anchorY,
67
+ scale
68
+ } = this.zoom;
69
+ if (ev.touches.length === 2) {
70
+ ev.preventDefault();
71
+ ev.stopImmediatePropagation();
72
+ const rect = this.element.getBoundingClientRect();
73
+ const first = ev.touches[0];
74
+ const second = ev.touches[1];
75
+ anchorX = (first.clientX + second.clientX) / 2 - rect.left;
76
+ anchorY = (first.clientY + second.clientY) / 2 - rect.top;
77
+ const newScale = distance(first, second);
78
+ if (previousDistance === void 0) {
79
+ previousDistance = newScale;
80
+ return;
81
+ }
82
+ if (previousDistance === newScale) {
83
+ return;
84
+ }
85
+ scale += newScale - previousDistance;
86
+ previousDistance = newScale;
87
+ this.updateZoom({
88
+ anchorX,
89
+ anchorY,
90
+ x,
91
+ y,
92
+ scale
93
+ });
94
+ return;
95
+ }
96
+ if (!previous) {
97
+ return;
98
+ }
99
+ const cp = center(ev);
100
+ x += cp.x - previous.x;
101
+ y += cp.y - previous.y;
102
+ previous = cp;
103
+ this.updateZoom({
104
+ anchorX,
105
+ anchorY,
106
+ x,
107
+ y,
108
+ scale
144
109
  });
145
- this.bindEvent(scrollView, "wheel", (ev) => {
146
- const target = ev.currentTarget;
147
- ev.preventDefault();
148
- ev.stopImmediatePropagation?.();
149
- const newScale = this.zoom.scale - (ev.deltaY < 0 ? -50 : 50);
150
- const anchorX = ev.offsetX;
151
- const anchorY = ev.offsetY;
152
- const { x, y } = this.zoom;
153
- this.updateZoom({
154
- anchorX,
155
- anchorY,
156
- x,
157
- y,
158
- scale: newScale < 0 ? 0 : newScale
159
- });
160
- }, undefined, {
161
- passive: false
110
+ });
111
+ touchEndDisposable ??= this.bindEvent(scrollView, "touchend", ev => {
112
+ touchMoveDisposable?.dispose();
113
+ touchEndDisposable?.dispose();
114
+ touchMoveDisposable = undefined;
115
+ touchEndDisposable = undefined;
116
+ previousDistance = undefined;
117
+ });
118
+ });
119
+ let mouseMoveDisposable;
120
+ let mouseUpDisposable;
121
+ this.bindEvent(scrollView, "dragstart", ev => {
122
+ ev.preventDefault();
123
+ ev.stopImmediatePropagation();
124
+ });
125
+ this.bindEvent(scrollView, "mousedown", ev => {
126
+ this.element.dataset.state = "grabbing";
127
+ previous = {
128
+ x: ev.clientX,
129
+ y: ev.clientY
130
+ };
131
+ mouseMoveDisposable ??= this.bindEvent(scrollView, "mousemove", e => {
132
+ e.preventDefault();
133
+ e.stopImmediatePropagation?.();
134
+ const {
135
+ anchorX,
136
+ anchorY,
137
+ scale
138
+ } = this.zoom;
139
+ let {
140
+ x,
141
+ y
142
+ } = this.zoom;
143
+ const cp = {
144
+ x: e.clientX,
145
+ y: e.clientY
146
+ };
147
+ x += cp.x - previous.x;
148
+ y += cp.y - previous.y;
149
+ previous = cp;
150
+ this.updateZoom({
151
+ anchorX,
152
+ anchorY,
153
+ x,
154
+ y,
155
+ scale
162
156
  });
157
+ });
158
+ mouseUpDisposable ??= this.bindEvent(scrollView, "mouseup", e => {
159
+ e.preventDefault();
160
+ e.stopImmediatePropagation?.();
161
+ this.element.dataset.state = "";
162
+ previous = null;
163
+ mouseMoveDisposable.dispose();
164
+ mouseUpDisposable.dispose();
165
+ mouseMoveDisposable = undefined;
166
+ mouseUpDisposable = undefined;
167
+ });
168
+ });
169
+ this.bindEvent(scrollView, "wheel", ev => {
170
+ const target = ev.currentTarget;
171
+ ev.preventDefault();
172
+ ev.stopImmediatePropagation?.();
173
+ const newScale = this.zoom.scale - (ev.deltaY < 0 ? -50 : 50);
174
+ const anchorX = ev.offsetX;
175
+ const anchorY = ev.offsetY;
176
+ const {
177
+ x,
178
+ y
179
+ } = this.zoom;
180
+ this.updateZoom({
181
+ anchorX,
182
+ anchorY,
183
+ x,
184
+ y,
185
+ scale: newScale < 0 ? 0 : newScale
186
+ });
187
+ }, undefined, {
188
+ passive: false
189
+ });
190
+ }
191
+ getSource(text) {
192
+ if (text) {
193
+ this.loading = true;
163
194
  }
164
- getSource(text) {
165
- if (text) {
166
- this.loading = true;
167
- }
168
- return text;
195
+ return text;
196
+ }
197
+ updateZoom(zoom = {
198
+ x: 0,
199
+ y: 0,
200
+ anchorX: 0,
201
+ anchorY: 0,
202
+ scale: 0
203
+ }) {
204
+ const {
205
+ anchorX,
206
+ anchorY,
207
+ x,
208
+ y
209
+ } = zoom;
210
+ let {
211
+ scale
212
+ } = zoom;
213
+ this.zoom = zoom;
214
+ const image = this.image;
215
+ if (!image.naturalHeight) {
216
+ return;
169
217
  }
170
- updateZoom(zoom = {
171
- x: 0,
172
- y: 0,
173
- anchorX: 0,
174
- anchorY: 0,
175
- scale: 0
176
- }) {
177
- const { anchorX, anchorY, x, y } = zoom;
178
- let { scale } = zoom;
179
- this.zoom = zoom;
180
- const image = this.image;
181
- if (!image.naturalHeight) {
182
- return;
183
- }
184
- const maxHeight = this.element.clientWidth > this.element.clientHeight;
185
- const s = maxHeight
186
- ? this.element.clientWidth / image.naturalWidth
187
- : this.element.clientHeight / image.naturalHeight;
188
- if (scale <= 0) {
189
- scale = 0;
190
- }
191
- const newWidth = (this.element.clientWidth + scale) + "px";
192
- const newHeight = (this.element.clientHeight + scale) + "px";
193
- this.image.style.maxWidth = this.element.clientWidth + "px";
194
- this.image.style.maxHeight = this.element.clientHeight + "px";
195
- if (scale <= 0) {
196
- this.imageContainer.style.transform = "";
197
- return;
198
- }
199
- const clientWidth = this.element.clientWidth;
200
- const scaleFactor = (clientWidth + scale) / clientWidth;
201
- this.imageContainer.style.transformOrigin = `${anchorX}px ${anchorY}`;
202
- this.imageContainer.style.transform = `translate(${x}px, ${y}px) scale(${scaleFactor})`;
218
+ const maxHeight = this.element.clientWidth > this.element.clientHeight;
219
+ const s = maxHeight ? this.element.clientWidth / image.naturalWidth : this.element.clientHeight / image.naturalHeight;
220
+ if (scale <= 0) {
221
+ scale = 0;
222
+ }
223
+ const newWidth = this.element.clientWidth + scale + "px";
224
+ const newHeight = this.element.clientHeight + scale + "px";
225
+ this.image.style.maxWidth = this.element.clientWidth + "px";
226
+ this.image.style.maxHeight = this.element.clientHeight + "px";
227
+ if (scale <= 0) {
228
+ this.imageContainer.style.transform = "";
229
+ return;
203
230
  }
231
+ const clientWidth = this.element.clientWidth;
232
+ const scaleFactor = (clientWidth + scale) / clientWidth;
233
+ this.imageContainer.style.transformOrigin = `${anchorX}px ${anchorY}`;
234
+ this.imageContainer.style.transform = `translate(${x}px, ${y}px) scale(${scaleFactor})`;
235
+ }
204
236
  }
205
- __decorate([
206
- BindableProperty,
207
- __metadata("design:type", Object)
208
- ], PinchZoomView.prototype, "zoom", void 0);
209
- __decorate([
210
- BindableProperty,
211
- __metadata("design:type", String)
212
- ], PinchZoomView.prototype, "source", void 0);
213
- __decorate([
214
- BindableProperty,
215
- __metadata("design:type", Boolean)
216
- ], PinchZoomView.prototype, "loading", void 0);
217
- //# sourceMappingURL=PinchZoomView.js.map
237
+ __decorate([BindableProperty, __metadata("design:type", Object)], PinchZoomView.prototype, "zoom", void 0);
238
+ __decorate([BindableProperty, __metadata("design:type", String)], PinchZoomView.prototype, "source", void 0);
239
+ __decorate([BindableProperty, __metadata("design:type", Boolean)], PinchZoomView.prototype, "loading", void 0);
@@ -1,21 +1,44 @@
1
1
  import XNode from "@web-atoms/core/dist/core/XNode.js";
2
- import "./styles/popup-button.global.css";
2
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/popup-button.global.css"));
3
3
  import InlinePopupButton from "./InlinePopupButton.js";
4
- export function MenuItem({ label, icon, eventClick, href, target, ...others }) {
5
- if (href) {
6
- return XNode.create("a", { "data-menu-item": "menu-item", href: href, target: target, ...others },
7
- icon && XNode.create("i", { "data-element": "icon", class: icon }),
8
- label && XNode.create("span", { "data-element": "label", text: label }));
9
- }
10
- return XNode.create("div", { "data-menu-item": "menu-item", eventClick: eventClick, ...others },
11
- icon && XNode.create("i", { "data-element": "icon", class: icon }),
12
- label && XNode.create("span", { "data-element": "label", text: label }));
4
+ export function MenuItem({
5
+ label,
6
+ icon,
7
+ eventClick,
8
+ href,
9
+ target,
10
+ ...others
11
+ }) {
12
+ if (href) {
13
+ return XNode.create("a", {
14
+ "data-menu-item": "menu-item",
15
+ href: href,
16
+ target: target,
17
+ ...others
18
+ }, icon && XNode.create("i", {
19
+ "data-element": "icon",
20
+ class: icon
21
+ }), label && XNode.create("span", {
22
+ "data-element": "label",
23
+ text: label
24
+ }));
25
+ }
26
+ return XNode.create("div", {
27
+ "data-menu-item": "menu-item",
28
+ eventClick: eventClick,
29
+ ...others
30
+ }, icon && XNode.create("i", {
31
+ "data-element": "icon",
32
+ class: icon
33
+ }), label && XNode.create("span", {
34
+ "data-element": "label",
35
+ text: label
36
+ }));
13
37
  }
14
38
  export default InlinePopupButton;
15
39
  export function PopupActionButton(a, ...nodes) {
16
- a.closeOnClick ??= true;
17
- a["anchor-top"] = "parent-bottom";
18
- a["anchor-right"] = "parent-left";
19
- return InlinePopupButton(a, ...nodes);
20
- }
21
- //# sourceMappingURL=PopupButton.js.map
40
+ a.closeOnClick ??= true;
41
+ a["anchor-top"] = "parent-bottom";
42
+ a["anchor-right"] = "parent-left";
43
+ return InlinePopupButton(a, ...nodes);
44
+ }
@@ -1,6 +1,5 @@
1
1
  import InlinePopupButton from "./InlinePopupButton.js";
2
2
  export default function PopupMenu(a, ...nodes) {
3
- a.closeOnClick ??= true;
4
- return InlinePopupButton(a, ...nodes);
5
- }
6
- //# sourceMappingURL=PopupMenu.js.map
3
+ a.closeOnClick ??= true;
4
+ return InlinePopupButton(a, ...nodes);
5
+ }
@@ -1,28 +1,38 @@
1
1
  import XNode from "@web-atoms/core/dist/core/XNode.js";
2
2
  import AtomRepeater from "./AtomRepeater.js";
3
- import "./styles/radio-button-list.global.css";
3
+ ESMPack.installStyleSheet(import.meta.resolve("./styles/radio-button-list.global.css"));
4
4
  export default class RadioButtonList extends AtomRepeater {
5
- preCreate() {
6
- super.preCreate();
7
- this.valuePath = (item) => item?.value ?? item;
8
- this.bindEvent(this.element, "itemClick", (e) => {
9
- const s = this.selectedItems;
10
- if (!s) {
11
- return;
12
- }
13
- const item = e.detail;
14
- const old = this.selectedItem;
15
- if (old) {
16
- this.element.dispatchEvent(new CustomEvent("itemDeselect", { detail: old, bubbles: false }));
17
- }
18
- this.selectedItem = item;
19
- this.element.dispatchEvent(new CustomEvent("itemSelect", { detail: item, bubbles: false }));
20
- });
21
- this.element.dataset.radioButtonList = "radio-button-list";
22
- this.itemRenderer = (item) => XNode.create("div", { "data-item-type": "radio" },
23
- XNode.create("i", { class: "far fa-dot-circle" }),
24
- XNode.create("i", { class: "far fa-circle" }),
25
- XNode.create("span", { text: item.label }));
26
- }
27
- }
28
- //# sourceMappingURL=RadioButtonList.js.map
5
+ preCreate() {
6
+ super.preCreate();
7
+ this.valuePath = item => item?.value ?? item;
8
+ this.bindEvent(this.element, "itemClick", e => {
9
+ const s = this.selectedItems;
10
+ if (!s) {
11
+ return;
12
+ }
13
+ const item = e.detail;
14
+ const old = this.selectedItem;
15
+ if (old) {
16
+ this.element.dispatchEvent(new CustomEvent("itemDeselect", {
17
+ detail: old,
18
+ bubbles: false
19
+ }));
20
+ }
21
+ this.selectedItem = item;
22
+ this.element.dispatchEvent(new CustomEvent("itemSelect", {
23
+ detail: item,
24
+ bubbles: false
25
+ }));
26
+ });
27
+ this.element.dataset.radioButtonList = "radio-button-list";
28
+ this.itemRenderer = item => XNode.create("div", {
29
+ "data-item-type": "radio"
30
+ }, XNode.create("i", {
31
+ class: "far fa-dot-circle"
32
+ }), XNode.create("i", {
33
+ class: "far fa-circle"
34
+ }), XNode.create("span", {
35
+ text: item.label
36
+ }));
37
+ }
38
+ }
@@ -1,45 +1,44 @@
1
1
  export default class RefreshLock {
2
- constructor(app, e) {
3
- this.app = app;
4
- this.map = new Map();
5
- this.begin = (ce) => {
6
- if (ce.target === ce.currentTarget) {
7
- return;
8
- }
9
- const previous = this.promise;
10
- this.promise = this.setupNew(previous, ce.detail.id);
11
- this.app.runAsync(() => this.promise);
12
- };
13
- this.end = (ce) => {
14
- if (ce.target === ce.currentTarget) {
15
- return;
16
- }
17
- const resolver = this.map.get(ce.detail.id);
18
- resolver?.();
19
- };
20
- e.addEventListener("refreshLockBegin", this.begin);
21
- e.addEventListener("refreshLockEnd", this.end);
22
- this.dispose = () => {
23
- e.removeEventListener("refreshLockBegin", this.begin);
24
- e.removeEventListener("refreshLockEnd", this.begin);
25
- };
2
+ constructor(app, e) {
3
+ this.app = app;
4
+ this.map = new Map();
5
+ this.begin = ce => {
6
+ if (ce.target === ce.currentTarget) {
7
+ return;
8
+ }
9
+ const previous = this.promise;
10
+ this.promise = this.setupNew(previous, ce.detail.id);
11
+ this.app.runAsync(() => this.promise);
12
+ };
13
+ this.end = ce => {
14
+ if (ce.target === ce.currentTarget) {
15
+ return;
16
+ }
17
+ const resolver = this.map.get(ce.detail.id);
18
+ resolver?.();
19
+ };
20
+ e.addEventListener("refreshLockBegin", this.begin);
21
+ e.addEventListener("refreshLockEnd", this.end);
22
+ this.dispose = () => {
23
+ e.removeEventListener("refreshLockBegin", this.begin);
24
+ e.removeEventListener("refreshLockEnd", this.begin);
25
+ };
26
+ }
27
+ queue(fx) {
28
+ if (this.promise) {
29
+ this.promise.then(fx);
30
+ return;
26
31
  }
27
- queue(fx) {
28
- if (this.promise) {
29
- this.promise.then(fx);
30
- return;
31
- }
32
- fx();
32
+ fx();
33
+ }
34
+ async setupNew(previous, id) {
35
+ if (previous) {
36
+ await previous;
33
37
  }
34
- async setupNew(previous, id) {
35
- if (previous) {
36
- await previous;
37
- }
38
- await new Promise((resolve, reject) => {
39
- this.map.set(id, resolve);
40
- });
41
- this.map.delete(id);
42
- this.promise = null;
43
- }
44
- }
45
- //# sourceMappingURL=RefreshLock.js.map
38
+ await new Promise((resolve, reject) => {
39
+ this.map.set(id, resolve);
40
+ });
41
+ this.map.delete(id);
42
+ this.promise = null;
43
+ }
44
+ }