@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,7 +2,7 @@ import { AtomDisposableList } from "@web-atoms/core/dist/core/AtomDisposableList
2
2
  import { CancelToken } from "@web-atoms/core/dist/core/types.js";
3
3
  import XNode, { xnodeSymbol } from "@web-atoms/core/dist/core/XNode.js";
4
4
  import { AtomControl, ElementValueSetters } from "@web-atoms/core/dist/web/controls/AtomControl.js";
5
- import "./AtomPopover.css";
5
+ ESMPack.installStyleSheet(import.meta.resolve("./AtomPopover.css"));
6
6
  import { relativeRect } from "./relativeRect.js";
7
7
  import getContainingBlock from "./getContainingBlock.js";
8
8
  ElementValueSetters["anchor-left"] = (c, e, v) => e.setAttribute("anchor-left", v);
@@ -10,270 +10,287 @@ ElementValueSetters["anchor-right"] = (c, e, v) => e.setAttribute("anchor-right"
10
10
  ElementValueSetters["anchor-top"] = (c, e, v) => e.setAttribute("anchor-top", v);
11
11
  ElementValueSetters["anchor-bottom"] = (c, e, v) => e.setAttribute("anchor-bottom", v);
12
12
  class AtomPopoverElement extends HTMLElement {
13
- constructor() {
14
- super(...arguments);
15
- this.aborted = "cancel";
16
- this.closePopover = (e) => {
17
- const cancelOnBlur = /^(true|yes|1)$/i.test(this.getAttribute("cancel-on-blur") || "true");
18
- if (!cancelOnBlur) {
19
- return;
20
- }
21
- setTimeout(() => {
22
- let target = e.target;
23
- while (target) {
24
- if (target.hasAttribute("data-close-on-click")) {
25
- break;
26
- }
27
- if (target === this.parentElement) {
28
- return;
29
- }
30
- target = target.parentElement;
31
- }
32
- this.lastParent = null;
33
- const ce = new CustomEvent("removing", {
34
- detail: { result: this.result, aborted: this.aborted },
35
- bubbles: true,
36
- cancelable: true
37
- });
38
- this.dispatchEvent(ce);
39
- if (ce.defaultPrevented) {
40
- return;
41
- }
42
- this.dispatchEvent(new CustomEvent("removed", {
43
- detail: { result: this.result, aborted: this.aborted },
44
- bubbles: true,
45
- }));
46
- this.remove();
47
- }, 250);
48
- };
49
- this.updatePosition = () => {
50
- if (!this.parentElement) {
51
- return;
52
- }
53
- const lastParent = this.lastParent = this.parentElement;
54
- if (!lastParent) {
55
- return;
56
- }
57
- const cb = getContainingBlock(lastParent);
58
- if (!cb) {
59
- return;
60
- }
61
- this.containingBlock = cb;
62
- const cbr = cb.getBoundingClientRect();
63
- const rrSelf = relativeRect(this, cb);
64
- const rrParent = relativeRect(this.parentElement, cb);
65
- let anchorBottom = this.getAttribute("anchor-bottom");
66
- let anchorRight = this.getAttribute("anchor-right");
67
- let anchorTop = this.getAttribute("anchor-top");
68
- let anchorLeft = this.getAttribute("anchor-left");
69
- const firstChild = this.firstElementChild.getBoundingClientRect();
70
- let diffTop = Math.min(window.visualViewport.height, cbr.height) - (rrParent.top + firstChild.height);
71
- if (diffTop > 0) {
72
- diffTop = 0;
73
- }
74
- else {
75
- diffTop -= 40;
76
- if (!anchorBottom) {
77
- anchorBottom = "parent-top";
78
- anchorTop = void 0;
79
- }
80
- }
81
- let diffBottom = rrParent.top - firstChild.height;
82
- if (diffBottom > 0) {
83
- diffBottom = 0;
84
- }
85
- const topLeft = {
86
- "parent-left": `${rrParent.left}px`,
87
- "parent-right": `${rrSelf.left}px`,
88
- "parent-top": `${rrParent.top + diffTop}px`,
89
- "parent-bottom": `${rrParent.top + rrParent.height + diffTop}px`
90
- };
91
- const bottomRight = {
92
- "parent-left": `${rrParent.right}px`,
93
- "parent-right": `${rrSelf.right}px`,
94
- "parent-top": `${rrParent.bottom + rrSelf.height + diffBottom}px`,
95
- "parent-bottom": `${rrParent.bottom + rrParent.height + diffBottom}px`
96
- };
97
- const style = this.slotElement.style;
98
- style.removeProperty("left");
99
- style.removeProperty("top");
100
- style.removeProperty("right");
101
- style.removeProperty("bottom");
102
- if (!anchorBottom) {
103
- anchorTop ||= "parent-bottom";
104
- }
105
- if (!anchorRight) {
106
- anchorLeft ||= "parent-right";
107
- }
108
- if (anchorTop) {
109
- style.top = topLeft[anchorTop];
110
- }
111
- if (anchorLeft) {
112
- style.left = topLeft[anchorLeft];
113
- }
114
- if (anchorBottom) {
115
- style.bottom = bottomRight[anchorBottom];
116
- }
117
- if (anchorRight) {
118
- style.right = bottomRight[anchorRight];
119
- }
120
- };
121
- }
122
- connectedCallback() {
123
- if (!this.root) {
124
- const root = this.root = this.attachShadow({ mode: "open" });
125
- const slot = document.createElement("slot");
126
- slot.setAttribute("part", "container");
127
- this.slotElement = slot;
128
- root.appendChild(slot);
13
+ constructor() {
14
+ super(...arguments);
15
+ this.aborted = "cancel";
16
+ this.closePopover = e => {
17
+ const cancelOnBlur = /^(true|yes|1)$/i.test(this.getAttribute("cancel-on-blur") || "true");
18
+ if (!cancelOnBlur) {
19
+ return;
20
+ }
21
+ setTimeout(() => {
22
+ let target = e.target;
23
+ while (target) {
24
+ if (target.hasAttribute("data-close-on-click")) {
25
+ break;
26
+ }
27
+ if (target === this.parentElement) {
28
+ return;
29
+ }
30
+ target = target.parentElement;
129
31
  }
130
- setTimeout(() => this.updatePosition(), 100);
131
- window.addEventListener("scroll", this.updatePosition, { passive: true, capture: true });
132
- setTimeout(() => {
133
- document.body.addEventListener("click", this.closePopover);
134
- }, 100);
135
- }
136
- disconnectedCallback() {
137
- if (this.lastParent?.isConnected) {
138
- this.dispatchEvent(new CustomEvent("removed", {
139
- detail: { result: this.result, aborted: this.aborted },
140
- bubbles: true
141
- }));
32
+ this.lastParent = null;
33
+ const ce = new CustomEvent("removing", {
34
+ detail: {
35
+ result: this.result,
36
+ aborted: this.aborted
37
+ },
38
+ bubbles: true,
39
+ cancelable: true
40
+ });
41
+ this.dispatchEvent(ce);
42
+ if (ce.defaultPrevented) {
43
+ return;
142
44
  }
143
- document.body.removeEventListener("click", this.closePopover);
144
- window.removeEventListener("scroll", this.updatePosition);
145
- clearInterval(this.timer);
45
+ this.dispatchEvent(new CustomEvent("removed", {
46
+ detail: {
47
+ result: this.result,
48
+ aborted: this.aborted
49
+ },
50
+ bubbles: true
51
+ }));
52
+ this.remove();
53
+ }, 250);
54
+ };
55
+ this.updatePosition = () => {
56
+ if (!this.parentElement) {
57
+ return;
58
+ }
59
+ const lastParent = this.lastParent = this.parentElement;
60
+ if (!lastParent) {
61
+ return;
62
+ }
63
+ const cb = getContainingBlock(lastParent);
64
+ if (!cb) {
65
+ return;
66
+ }
67
+ this.containingBlock = cb;
68
+ const cbr = cb.getBoundingClientRect();
69
+ const rrSelf = relativeRect(this, cb);
70
+ const rrParent = relativeRect(this.parentElement, cb);
71
+ let anchorBottom = this.getAttribute("anchor-bottom");
72
+ let anchorRight = this.getAttribute("anchor-right");
73
+ let anchorTop = this.getAttribute("anchor-top");
74
+ let anchorLeft = this.getAttribute("anchor-left");
75
+ const firstChild = this.firstElementChild.getBoundingClientRect();
76
+ let diffTop = Math.min(window.visualViewport.height, cbr.height) - (rrParent.top + firstChild.height);
77
+ if (diffTop > 0) {
78
+ diffTop = 0;
79
+ } else {
80
+ diffTop -= 40;
81
+ if (!anchorBottom) {
82
+ anchorBottom = "parent-top";
83
+ anchorTop = void 0;
84
+ }
85
+ }
86
+ let diffBottom = rrParent.top - firstChild.height;
87
+ if (diffBottom > 0) {
88
+ diffBottom = 0;
89
+ }
90
+ const topLeft = {
91
+ "parent-left": `${rrParent.left}px`,
92
+ "parent-right": `${rrSelf.left}px`,
93
+ "parent-top": `${rrParent.top + diffTop}px`,
94
+ "parent-bottom": `${rrParent.top + rrParent.height + diffTop}px`
95
+ };
96
+ const bottomRight = {
97
+ "parent-left": `${rrParent.right}px`,
98
+ "parent-right": `${rrSelf.right}px`,
99
+ "parent-top": `${rrParent.bottom + rrSelf.height + diffBottom}px`,
100
+ "parent-bottom": `${rrParent.bottom + rrParent.height + diffBottom}px`
101
+ };
102
+ const style = this.slotElement.style;
103
+ style.removeProperty("left");
104
+ style.removeProperty("top");
105
+ style.removeProperty("right");
106
+ style.removeProperty("bottom");
107
+ if (!anchorBottom) {
108
+ anchorTop ||= "parent-bottom";
109
+ }
110
+ if (!anchorRight) {
111
+ anchorLeft ||= "parent-right";
112
+ }
113
+ if (anchorTop) {
114
+ style.top = topLeft[anchorTop];
115
+ }
116
+ if (anchorLeft) {
117
+ style.left = topLeft[anchorLeft];
118
+ }
119
+ if (anchorBottom) {
120
+ style.bottom = bottomRight[anchorBottom];
121
+ }
122
+ if (anchorRight) {
123
+ style.right = bottomRight[anchorRight];
124
+ }
125
+ };
126
+ }
127
+ connectedCallback() {
128
+ if (!this.root) {
129
+ const root = this.root = this.attachShadow({
130
+ mode: "open"
131
+ });
132
+ const slot = document.createElement("slot");
133
+ slot.setAttribute("part", "container");
134
+ this.slotElement = slot;
135
+ root.appendChild(slot);
136
+ }
137
+ setTimeout(() => this.updatePosition(), 100);
138
+ window.addEventListener("scroll", this.updatePosition, {
139
+ passive: true,
140
+ capture: true
141
+ });
142
+ setTimeout(() => {
143
+ document.body.addEventListener("click", this.closePopover);
144
+ }, 100);
145
+ }
146
+ disconnectedCallback() {
147
+ if (this.lastParent?.isConnected) {
148
+ this.dispatchEvent(new CustomEvent("removed", {
149
+ detail: {
150
+ result: this.result,
151
+ aborted: this.aborted
152
+ },
153
+ bubbles: true
154
+ }));
146
155
  }
156
+ document.body.removeEventListener("click", this.closePopover);
157
+ window.removeEventListener("scroll", this.updatePosition);
158
+ clearInterval(this.timer);
159
+ }
147
160
  }
148
161
  const existingPopup = Symbol("popup");
149
162
  export default class AtomPopover {
150
- static create(parent, options = {}) {
151
- return parent[existingPopup] ??= new this(parent, options);
163
+ static create(parent, options = {}) {
164
+ return parent[existingPopup] ??= new this(parent, options);
165
+ }
166
+ static show(parent, options = {}) {
167
+ const p = parent[existingPopup] ??= new this(parent, options);
168
+ return p.resultPromise;
169
+ }
170
+ static menu(parent, node, options = {}) {
171
+ const ct = new CancelToken();
172
+ options.nodeFactory = () => node;
173
+ const p = new this(parent, options);
174
+ p.result = 1;
175
+ p.disposables.add(p.owner.bindEvent(p.popover, "click", () => {
176
+ setTimeout(() => {
177
+ ct.cancel();
178
+ }, 10);
179
+ }));
180
+ return p;
181
+ }
182
+ set renderer(v) {
183
+ const owner = this.owner;
184
+ let first = this.popoverContainer.firstElementChild;
185
+ while (first) {
186
+ const next = first.nextElementSibling;
187
+ owner.dispose(first);
188
+ first.remove();
189
+ first = next;
152
190
  }
153
- static show(parent, options = {}) {
154
- const p = (parent[existingPopup] ??= new this(parent, options));
155
- return p.resultPromise;
191
+ if (!v) {
192
+ return;
156
193
  }
157
- static menu(parent, node, options = {}) {
158
- const ct = new CancelToken();
159
- options.nodeFactory = () => node;
160
- const p = new this(parent, options);
161
- p.result = 1;
162
- p.disposables.add(p.owner.bindEvent(p.popover, "click", () => {
163
- setTimeout(() => {
164
- ct.cancel();
165
- }, 10);
166
- }));
167
- return p;
194
+ if (v[xnodeSymbol]) {
195
+ this.owner.render(XNode.create("div", null, " ", v, " "), this.popoverContainer, this.owner);
196
+ } else {
197
+ this.popoverContainer.appendChild(v);
168
198
  }
169
- set renderer(v) {
170
- const owner = this.owner;
171
- let first = this.popoverContainer.firstElementChild;
172
- while (first) {
173
- const next = first.nextElementSibling;
174
- owner.dispose(first);
175
- first.remove();
176
- first = next;
177
- }
178
- if (!v) {
179
- return;
199
+ this.popoverContainer.updatePosition?.();
200
+ }
201
+ constructor(parent, options = {}) {
202
+ this.disposables = new AtomDisposableList();
203
+ this.removing = ce => {
204
+ if (this.cancel) {
205
+ ce?.preventDefault();
206
+ const c = this.cancel?.();
207
+ if (c?.then) {
208
+ c.then(() => {
209
+ this.renderer = void 0;
210
+ this.remove();
211
+ }, console.warn);
180
212
  }
181
- if (v[xnodeSymbol]) {
182
- this.owner.render(XNode.create("div", null,
183
- " ",
184
- v,
185
- " "), this.popoverContainer, this.owner);
186
- }
187
- else {
188
- this.popoverContainer.appendChild(v);
189
- }
190
- this.popoverContainer.updatePosition?.();
213
+ }
214
+ };
215
+ this.remove = () => {
216
+ const {
217
+ result
218
+ } = this.popover;
219
+ if (result === void 0) {
220
+ this.resultReject?.("canceled");
221
+ } else {
222
+ this.resultResolve?.(result);
223
+ }
224
+ this.disposables.dispose();
225
+ this.popover.remove();
226
+ };
227
+ const p1 = parent;
228
+ this.disposables.add(() => p1[existingPopup] = null);
229
+ if (parent instanceof AtomControl) {
230
+ this.owner = parent;
231
+ parent = this.owner.element;
232
+ } else {
233
+ this.owner = AtomControl.from(parent);
191
234
  }
192
- constructor(parent, options = {}) {
193
- this.disposables = new AtomDisposableList();
194
- this.removing = (ce) => {
195
- if (this.cancel) {
196
- ce?.preventDefault();
197
- const c = this.cancel?.();
198
- if (c?.then) {
199
- c.then(() => {
200
- this.renderer = void 0;
201
- this.remove();
202
- }, console.warn);
203
- }
204
- }
205
- };
206
- this.remove = () => {
207
- const { result } = this.popover;
208
- if (result === void 0) {
209
- this.resultReject?.("canceled");
210
- }
211
- else {
212
- this.resultResolve?.(result);
213
- }
214
- this.disposables.dispose();
215
- this.popover.remove();
216
- };
217
- const p1 = parent;
218
- this.disposables.add(() => p1[existingPopup] = null);
219
- if (parent instanceof AtomControl) {
220
- this.owner = parent;
221
- parent = this.owner.element;
222
- }
223
- else {
224
- this.owner = AtomControl.from(parent);
225
- }
226
- const popover = this.popover = document.createElement("atom-pop-over");
227
- this.popoverContainer = popover;
228
- parent.appendChild(popover);
229
- const { cancelToken, nodeFactory, dataFactory, closeOnClick = true, "anchor-left": anchorLeft, "anchor-right": anchorRight, "anchor-top": anchorTop, "anchor-bottom": anchorBottom } = options;
230
- cancelToken?.registerForCancel(this.removing);
231
- if (anchorLeft) {
232
- popover.setAttribute("anchor-left", anchorLeft);
233
- }
234
- if (anchorRight) {
235
- popover.setAttribute("anchor-right", anchorRight);
236
- }
237
- if (anchorTop) {
238
- popover.setAttribute("anchor-top", anchorTop);
239
- }
240
- if (anchorBottom) {
241
- popover.setAttribute("anchor-bottom", anchorBottom);
242
- }
243
- if (closeOnClick) {
244
- popover.setAttribute("data-close-on-click", "1");
245
- }
246
- popover.addEventListener("removing", this.removing);
247
- popover.addEventListener("removed", this.remove);
248
- this.disposables.add(() => {
249
- popover.removeEventListener("removed", this.remove);
250
- popover.removeEventListener("removing", this.removing);
251
- });
252
- this.init ??= (data) => {
253
- if (nodeFactory) {
254
- this.renderer = nodeFactory(data);
255
- }
256
- };
257
- const p = this.init?.(dataFactory?.());
258
- if (p?.then) {
259
- p.then(() => void 0, console.warn);
260
- }
261
- this.resultPromise = new Promise((resolve, reject) => {
262
- this.resultResolve = resolve;
263
- this.resultReject = reject;
264
- });
265
- this.resultPromise.catch(() => void 0);
235
+ const popover = this.popover = document.createElement("atom-pop-over");
236
+ this.popoverContainer = popover;
237
+ parent.appendChild(popover);
238
+ const {
239
+ cancelToken,
240
+ nodeFactory,
241
+ dataFactory,
242
+ closeOnClick = true,
243
+ "anchor-left": anchorLeft,
244
+ "anchor-right": anchorRight,
245
+ "anchor-top": anchorTop,
246
+ "anchor-bottom": anchorBottom
247
+ } = options;
248
+ cancelToken?.registerForCancel(this.removing);
249
+ if (anchorLeft) {
250
+ popover.setAttribute("anchor-left", anchorLeft);
251
+ }
252
+ if (anchorRight) {
253
+ popover.setAttribute("anchor-right", anchorRight);
254
+ }
255
+ if (anchorTop) {
256
+ popover.setAttribute("anchor-top", anchorTop);
257
+ }
258
+ if (anchorBottom) {
259
+ popover.setAttribute("anchor-bottom", anchorBottom);
266
260
  }
267
- close(r) {
268
- this.removed = true;
269
- this.popover.result = r ?? null;
270
- this.popover.remove();
261
+ if (closeOnClick) {
262
+ popover.setAttribute("data-close-on-click", "1");
271
263
  }
272
- async cancel() {
273
- this.removed = true;
274
- delete this.popover.result;
275
- this.popover.remove();
264
+ popover.addEventListener("removing", this.removing);
265
+ popover.addEventListener("removed", this.remove);
266
+ this.disposables.add(() => {
267
+ popover.removeEventListener("removed", this.remove);
268
+ popover.removeEventListener("removing", this.removing);
269
+ });
270
+ this.init ??= data => {
271
+ if (nodeFactory) {
272
+ this.renderer = nodeFactory(data);
273
+ }
274
+ };
275
+ const p = this.init?.(dataFactory?.());
276
+ if (p?.then) {
277
+ p.then(() => void 0, console.warn);
276
278
  }
279
+ this.resultPromise = new Promise((resolve, reject) => {
280
+ this.resultResolve = resolve;
281
+ this.resultReject = reject;
282
+ });
283
+ this.resultPromise.catch(() => void 0);
284
+ }
285
+ close(r) {
286
+ this.removed = true;
287
+ this.popover.result = r ?? null;
288
+ this.popover.remove();
289
+ }
290
+ async cancel() {
291
+ this.removed = true;
292
+ delete this.popover.result;
293
+ this.popover.remove();
294
+ }
277
295
  }
278
- customElements.define("atom-pop-over", AtomPopoverElement);
279
- //# sourceMappingURL=AtomPopover.js.map
296
+ customElements.define("atom-pop-over", AtomPopoverElement);
@@ -1,37 +1,36 @@
1
- const getContainingBlock = (node) => {
2
- if (!node || !node.parentElement) {
3
- return document.body;
4
- }
5
- let start = node.parentElement;
6
- while (start) {
7
- const cs = getComputedStyle(start);
8
- if (cs.filter !== "none") {
9
- return start;
10
- }
11
- if (cs.backdropFilter !== "none") {
12
- return start;
13
- }
14
- if (cs.transform !== "none") {
15
- return start;
16
- }
17
- if (cs.perspective !== "none") {
18
- return start;
19
- }
20
- if (/layout|paint|strict|content/i.test(cs.contain)) {
21
- return start;
22
- }
23
- if (cs.containerType && cs.containerType !== "normal") {
24
- return start;
25
- }
26
- if (/filter|transform/i.test(cs.willChange)) {
27
- return start;
28
- }
29
- if (/auto/i.test(cs.contentVisibility)) {
30
- return start;
31
- }
32
- start = start.parentElement;
33
- }
1
+ const getContainingBlock = node => {
2
+ if (!node || !node.parentElement) {
34
3
  return document.body;
4
+ }
5
+ let start = node.parentElement;
6
+ while (start) {
7
+ const cs = getComputedStyle(start);
8
+ if (cs.filter !== "none") {
9
+ return start;
10
+ }
11
+ if (cs.backdropFilter !== "none") {
12
+ return start;
13
+ }
14
+ if (cs.transform !== "none") {
15
+ return start;
16
+ }
17
+ if (cs.perspective !== "none") {
18
+ return start;
19
+ }
20
+ if (/layout|paint|strict|content/i.test(cs.contain)) {
21
+ return start;
22
+ }
23
+ if (cs.containerType && cs.containerType !== "normal") {
24
+ return start;
25
+ }
26
+ if (/filter|transform/i.test(cs.willChange)) {
27
+ return start;
28
+ }
29
+ if (/auto/i.test(cs.contentVisibility)) {
30
+ return start;
31
+ }
32
+ start = start.parentElement;
33
+ }
34
+ return document.body;
35
35
  };
36
- export default getContainingBlock;
37
- //# sourceMappingURL=getContainingBlock.js.map
36
+ export default getContainingBlock;
@@ -1,24 +1,43 @@
1
1
  const getScreenRect = (e, cbr = e.getBoundingClientRect()) => {
2
- const { left, top, height, width } = cbr;
3
- const right = visualViewport.width - left - width;
4
- const bottom = visualViewport.height - top - height;
5
- return { left, top, right, bottom, height, width };
2
+ const {
3
+ left,
4
+ top,
5
+ height,
6
+ width
7
+ } = cbr;
8
+ const right = visualViewport.width - left - width;
9
+ const bottom = visualViewport.height - top - height;
10
+ return {
11
+ left,
12
+ top,
13
+ right,
14
+ bottom,
15
+ height,
16
+ width
17
+ };
6
18
  };
7
19
  export function relativeRect(e, cb) {
8
- const ebr = getScreenRect(e);
9
- const cbr = getScreenRect(cb);
10
- let left = ebr.left;
11
- let top = ebr.top;
12
- let bottom = ebr.bottom;
13
- let right = ebr.right;
14
- if (cb.offsetParent) {
15
- left -= cbr.left;
16
- top -= cbr.top;
17
- bottom -= cbr.bottom;
18
- right -= cbr.right;
19
- }
20
- const height = e.offsetHeight;
21
- const width = e.offsetWidth;
22
- return { left, top, bottom, right, width, height, e };
23
- }
24
- //# sourceMappingURL=relativeRect.js.map
20
+ const ebr = getScreenRect(e);
21
+ const cbr = getScreenRect(cb);
22
+ let left = ebr.left;
23
+ let top = ebr.top;
24
+ let bottom = ebr.bottom;
25
+ let right = ebr.right;
26
+ if (cb.offsetParent) {
27
+ left -= cbr.left;
28
+ top -= cbr.top;
29
+ bottom -= cbr.bottom;
30
+ right -= cbr.right;
31
+ }
32
+ const height = e.offsetHeight;
33
+ const width = e.offsetWidth;
34
+ return {
35
+ left,
36
+ top,
37
+ bottom,
38
+ right,
39
+ width,
40
+ height,
41
+ e
42
+ };
43
+ }