@witchcraft/ui 0.3.26 → 0.4.0-beta.10

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 (287) hide show
  1. package/README.md +54 -61
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/assets/animations.css +1 -1
  5. package/dist/runtime/assets/locales/en.json +2 -0
  6. package/dist/runtime/build/WitchcraftUiResolver.js +2 -2
  7. package/dist/runtime/components/TestControls/TestControls.vue +3 -3
  8. package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
  9. package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
  10. package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
  11. package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
  12. package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
  13. package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
  14. package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +45 -0
  15. package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
  16. package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +45 -0
  17. package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
  18. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
  19. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
  20. package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +7 -6
  21. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
  22. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +7 -6
  23. package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
  24. package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
  25. package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
  26. package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
  27. package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
  28. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +8 -13
  29. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
  30. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +8 -13
  31. package/dist/runtime/components/WDatePicker/WDatePicker.d.vue.ts +40 -0
  32. package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  33. package/dist/runtime/components/WDatePicker/WDatePicker.vue.d.ts +40 -0
  34. package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  35. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  36. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.d.vue.ts → WDatePicker/WTimeZonePicker.d.vue.ts} +1 -11
  37. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  38. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue.d.ts → WDatePicker/WTimeZonePicker.vue.d.ts} +1 -11
  39. package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
  40. package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +0 -3
  41. package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +0 -3
  42. package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
  43. package/dist/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +74 -57
  44. package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
  45. package/dist/runtime/components/{Icon/Icon.vue.d.ts → WIcon/WIcon.d.vue.ts} +2 -6
  46. package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
  47. package/dist/runtime/components/{Icon/Icon.d.vue.ts → WIcon/WIcon.vue.d.ts} +2 -6
  48. package/dist/runtime/components/{LibMultiValues/LibMultiValues.d.vue.ts → WMultiValues/WMultiValues.d.vue.ts} +8 -14
  49. package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
  50. package/dist/runtime/components/{LibMultiValues/LibMultiValues.vue.d.ts → WMultiValues/WMultiValues.vue.d.ts} +8 -14
  51. package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
  52. package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +34 -47
  53. package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
  54. package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
  55. package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +35 -17
  56. package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
  57. package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
  58. package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
  59. package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
  60. package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
  61. package/dist/runtime/components/WPagination/WPagination.vue +182 -0
  62. package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
  63. package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
  64. package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  65. package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
  66. package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
  67. package/dist/runtime/components/WPopover/WPopover.vue +144 -0
  68. package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
  69. package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
  70. package/dist/runtime/components/WPopup/WPopup.vue +106 -0
  71. package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
  72. package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +14 -18
  73. package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
  74. package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +14 -18
  75. package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +14 -29
  76. package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
  77. package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +14 -29
  78. package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +6 -5
  79. package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
  80. package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +6 -5
  81. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.d.vue.ts → WSimpleInput/WSimpleInput.d.vue.ts} +10 -16
  82. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
  83. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +10 -16
  84. package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
  85. package/dist/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +13 -14
  86. package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
  87. package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
  88. package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
  89. package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
  90. package/dist/runtime/components/index.d.ts +20 -20
  91. package/dist/runtime/components/index.js +20 -20
  92. package/dist/runtime/composables/index.d.ts +4 -4
  93. package/dist/runtime/composables/index.js +4 -4
  94. package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
  95. package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
  96. package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
  97. package/dist/runtime/composables/useDisplayForReka.js +16 -0
  98. package/dist/runtime/composables/useFallbackId.d.ts +3 -0
  99. package/dist/runtime/composables/useFallbackId.js +5 -0
  100. package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
  101. package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
  102. package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
  103. package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
  104. package/dist/runtime/composables/useSetupDarkMode.js +90 -4
  105. package/dist/runtime/helpers/NotificationHandler.d.ts +2 -2
  106. package/dist/runtime/injectionKeys.d.ts +1 -5
  107. package/dist/runtime/injectionKeys.js +0 -2
  108. package/dist/runtime/types/index.d.ts +85 -27
  109. package/dist/runtime/types/index.js +1 -0
  110. package/package.json +1 -1
  111. package/src/module.ts +1 -1
  112. package/src/runtime/assets/animations.css +3 -3
  113. package/src/runtime/assets/locales/en.json +2 -0
  114. package/src/runtime/build/WitchcraftUiResolver.ts +2 -2
  115. package/src/runtime/components/TestControls/TestControls.vue +3 -3
  116. package/src/runtime/components/WButton/WButton.stories.ts +112 -0
  117. package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
  118. package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
  119. package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
  120. package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
  121. package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
  122. package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
  123. package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
  124. package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
  125. package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
  126. package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
  127. package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
  128. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
  129. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
  130. package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
  131. package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  132. package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  133. package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  134. package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  135. package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
  136. package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
  137. package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
  138. package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +7 -7
  139. package/src/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +98 -97
  140. package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
  141. package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
  142. package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
  143. package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +9 -9
  144. package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +45 -65
  145. package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
  146. package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +51 -29
  147. package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
  148. package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
  149. package/src/runtime/components/WPagination/WPagination.vue +207 -0
  150. package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
  151. package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  152. package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
  153. package/src/runtime/components/WPopover/WPopover.vue +168 -0
  154. package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
  155. package/src/runtime/components/WPopup/WPopup.vue +125 -0
  156. package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
  157. package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
  158. package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
  159. package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
  160. package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
  161. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
  162. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -44
  163. package/src/runtime/components/{LibTable/LibTable.stories.ts → WTable/WTable.stories.ts} +60 -52
  164. package/src/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +85 -88
  165. package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
  166. package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
  167. package/src/runtime/components/index.ts +20 -20
  168. package/src/runtime/composables/index.ts +4 -4
  169. package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
  170. package/src/runtime/composables/useDisplayForReka.ts +37 -0
  171. package/src/runtime/composables/useFallbackId.ts +6 -0
  172. package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
  173. package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
  174. package/src/runtime/composables/useSetupDarkMode.ts +122 -4
  175. package/src/runtime/helpers/NotificationHandler.ts +2 -2
  176. package/src/runtime/injectionKeys.ts +1 -7
  177. package/src/runtime/types/index.ts +105 -32
  178. package/types/components.d.ts +14 -15
  179. package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -6
  180. package/dist/runtime/components/Aria/Aria.vue +0 -16
  181. package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -6
  182. package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -37
  183. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -37
  184. package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -41
  185. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
  186. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -41
  187. package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +0 -64
  188. package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
  189. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -64
  190. package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +0 -191
  191. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -191
  192. package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -46
  193. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -46
  194. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -256
  195. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
  196. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -256
  197. package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -27
  198. package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
  199. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
  200. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
  201. package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -45
  202. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -45
  203. package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -15
  204. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -15
  205. package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -105
  206. package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
  207. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -105
  208. package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -15
  209. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -15
  210. package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -52
  211. package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
  212. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -52
  213. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
  214. package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -99
  215. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
  216. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -99
  217. package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -125
  218. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -125
  219. package/dist/runtime/components/Template/NAME.d.vue.ts +0 -18
  220. package/dist/runtime/components/Template/NAME.vue +0 -27
  221. package/dist/runtime/components/Template/NAME.vue.d.ts +0 -18
  222. package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
  223. package/dist/runtime/components/Template/TemplateStory.js +0 -22
  224. package/dist/runtime/components/shared/props.d.ts +0 -171
  225. package/dist/runtime/components/shared/props.js +0 -2
  226. package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
  227. package/dist/runtime/composables/useAriaLabel.js +0 -15
  228. package/dist/runtime/composables/useDarkMode.d.ts +0 -77
  229. package/dist/runtime/composables/useDarkMode.js +0 -89
  230. package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
  231. package/dist/runtime/composables/useDivideAttrs.js +0 -27
  232. package/dist/runtime/composables/useSuggestions.d.ts +0 -40
  233. package/dist/runtime/composables/useSuggestions.js +0 -263
  234. package/src/runtime/components/Aria/Aria.vue +0 -26
  235. package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
  236. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -131
  237. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
  238. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
  239. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -419
  240. package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
  241. package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
  242. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
  243. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -131
  244. package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
  245. package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
  246. package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
  247. package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
  248. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
  249. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
  250. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
  251. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
  252. package/src/runtime/components/Template/NAME.vue +0 -49
  253. package/src/runtime/components/Template/TemplateStory.ts +0 -37
  254. package/src/runtime/components/shared/props.ts +0 -199
  255. package/src/runtime/composables/useAriaLabel.ts +0 -23
  256. package/src/runtime/composables/useDarkMode.ts +0 -199
  257. package/src/runtime/composables/useDivideAttrs.ts +0 -53
  258. package/src/runtime/composables/useSuggestions.ts +0 -339
  259. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
  260. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
  261. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
  262. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
  263. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
  264. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
  265. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
  266. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
  267. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.d.vue.ts → WDatePicker/WRangeDatePicker.d.vue.ts} +0 -0
  268. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue.d.ts → WDatePicker/WRangeDatePicker.vue.d.ts} +0 -0
  269. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +0 -0
  270. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +0 -0
  271. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
  272. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
  273. /package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +0 -0
  274. /package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +0 -0
  275. /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
  276. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.d.vue.ts → WNotifications/WNotificationTestMessageComponent.d.vue.ts} +0 -0
  277. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  278. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue.d.ts → WNotifications/WNotificationTestMessageComponent.vue.d.ts} +0 -0
  279. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.d.ts +0 -0
  280. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.js +0 -0
  281. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
  282. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
  283. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
  284. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
  285. /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
  286. /package/src/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  287. /package/src/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.ts +0 -0
@@ -1,105 +0,0 @@
1
- import { type HTMLAttributes } from "vue";
2
- import type { TailwindClassProp } from "../shared/props.js";
3
- /**
4
- * Pagination component.
5
- *
6
- * Can be passed a slot like so to use a custom link element (like NuxtLink):
7
- * ```vue
8
- * <template #link="{ href, i, text, ariaLabel, ariaCurrent}">
9
- * <NuxtLink :to="href" :aria-label="ariaLabel" :aria-current="ariaCurrent ?? false">{{ text ?? i }}</NuxtLink>
10
- * </template>
11
- * ```
12
- */
13
- declare const _default: typeof __VLS_export;
14
- export default _default;
15
- type RealProps = {
16
- /** The total number of pages. */
17
- total: number;
18
- /** The number of the current page. It must be valid, between 0 - total or the component will throw an error. */
19
- current: number;
20
- /** The base route/link path for the page. Should end with a forward slash `/`. */
21
- route: string;
22
- /**
23
- * A function to customize the output href and page link number. By default, page 0 is page 1, page 1 is 1, then everything else is normal.
24
- *
25
- * This is because usually we have routes like: `/page/1`, `/page/2`, not `/page/0`.
26
- *
27
- * You can use this function to customize things further. For example, make `/page/1` just `/`
28
- */
29
- customRoute?: (route: string, i: number) => {
30
- i: number;
31
- href: string;
32
- };
33
- /** How many extra pages to show to each side of the current page. */
34
- extraPages?: number;
35
- };
36
- interface Props extends
37
- /** @vue-ignore */
38
- Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
39
- }
40
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
41
- customRoute: (route: string, i: number) => {
42
- i: number;
43
- href: string;
44
- };
45
- extraPages: number;
46
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
47
- link?: (props: {
48
- class: string;
49
- i: number;
50
- href: string;
51
- text: string;
52
- ariaLabel: string;
53
- }) => any;
54
- } & {
55
- link?: (props: {
56
- class: string;
57
- i: number;
58
- href: string;
59
- text: number;
60
- ariaLabel: string;
61
- }) => any;
62
- } & {
63
- link?: (props: {
64
- i: number;
65
- href: string;
66
- ariaLabel: string;
67
- class: string;
68
- }) => any;
69
- } & {
70
- current?: (props: {
71
- tabindex: string;
72
- i: number;
73
- ariaLabel: string;
74
- aria_current: boolean;
75
- class: string;
76
- }) => any;
77
- } & {
78
- link?: (props: {
79
- i: number;
80
- href: string;
81
- ariaLabel: string;
82
- class: string;
83
- }) => any;
84
- } & {
85
- link?: (props: {
86
- i: number;
87
- href: string;
88
- text: number;
89
- ariaLabel: string;
90
- class: string;
91
- }) => any;
92
- } & {
93
- link?: (props: {
94
- i: number;
95
- href: string;
96
- text: string;
97
- ariaLabel: string;
98
- class: string;
99
- }) => any;
100
- }>;
101
- type __VLS_WithSlots<T, S> = T & {
102
- new (): {
103
- $slots: S;
104
- };
105
- };
@@ -1,15 +0,0 @@
1
- import type { Theme } from "metamorphosis";
2
- import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js";
3
- declare const _default: typeof __VLS_export;
4
- export default _default;
5
- declare const __VLS_export: import("vue").DefineComponent<LinkableByIdProps & BaseInteractiveProps & {
6
- theme?: Theme;
7
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkableByIdProps & BaseInteractiveProps & {
8
- theme?: Theme;
9
- }> & Readonly<{}>, {
10
- theme: Theme;
11
- disabled: boolean;
12
- readonly: boolean;
13
- border: boolean;
14
- unstyle: boolean;
15
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,15 +0,0 @@
1
- import type { Theme } from "metamorphosis";
2
- import type { BaseInteractiveProps, LinkableByIdProps } from "../shared/props.js";
3
- declare const _default: typeof __VLS_export;
4
- export default _default;
5
- declare const __VLS_export: import("vue").DefineComponent<LinkableByIdProps & BaseInteractiveProps & {
6
- theme?: Theme;
7
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkableByIdProps & BaseInteractiveProps & {
8
- theme?: Theme;
9
- }> & Readonly<{}>, {
10
- theme: Theme;
11
- disabled: boolean;
12
- readonly: boolean;
13
- border: boolean;
14
- unstyle: boolean;
15
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,52 +0,0 @@
1
- import { type HTMLAttributes } from "vue";
2
- import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js";
3
- import type { IPopupReference } from "../../types/index.js";
4
- type RealProps = LinkableByIdProps & PopupProps;
5
- interface Props extends
6
- /** @vue-ignore */
7
- Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
8
- }
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
11
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props & {
12
- modelValue?: boolean;
13
- }, {
14
- recompute: (force?: boolean) => void;
15
- setReference: (el: IPopupReference | null) => void;
16
- setBackground: (el: IPopupReference | null) => void;
17
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- "update:modelValue": (value: boolean) => any;
19
- } & {
20
- close: () => any;
21
- }, string, import("vue").PublicProps, Readonly<Props & {
22
- modelValue?: boolean;
23
- }> & Readonly<{
24
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
25
- onClose?: (() => any) | undefined;
26
- }>, {
27
- canClose: boolean;
28
- useDialogForBackdrop: false;
29
- useBackdrop: boolean;
30
- preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
31
- preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
32
- avoidRepositioning: boolean;
33
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
34
- button?: (props: {
35
- extractEl: (_: any) => any;
36
- }) => any;
37
- } & {
38
- popup?: (props: {
39
- position: {
40
- x: number;
41
- y: number;
42
- maxWidth?: number | undefined;
43
- maxHeight?: number | undefined;
44
- };
45
- extractEl: (_: any) => any;
46
- }) => any;
47
- }>;
48
- type __VLS_WithSlots<T, S> = T & {
49
- new (): {
50
- $slots: S;
51
- };
52
- };
@@ -1,365 +0,0 @@
1
- <template>
2
- <slot
3
- name="button"
4
- :extract-el="(_) => buttonEl = _"
5
- />
6
- <!-- <Transition> -->
7
- <component
8
- v-if="modelValue || useDialogForBackdrop"
9
- :id="id ?? fallbackId"
10
- :class="twMerge(
11
- useBackdrop && useDialogForBackdrop && `
12
- popup--backdrop
13
- bg-transparent
14
- p-0
15
- backdrop:bg-transparent
16
- `,
17
- modelValue && useBackdrop && !useDialogForBackdrop && `
18
- popup--backdrop
19
- z-100
20
- fixed
21
- inset-0
22
- `,
23
- $attrs.class
24
- )"
25
- v-bind="{ ...$attrs, class: void 0 }"
26
- :is="useDialogForBackdrop ? 'dialog' : 'div'"
27
- ref="dialogEl"
28
- @mousedown.self="handleMouseup"
29
- >
30
- <div
31
- v-if="modelValue"
32
- :class="`popup z-100 fixed ${props.avoidRepositioning ? 'transition-[top,left]' : ''}`"
33
- :style="`
34
- top:${pos.y}px;
35
- left:${pos.x}px;
36
- ${pos.maxWidth ? `max-width:${pos.maxWidth}px` : ''}
37
- ${pos.maxHeight ? `max-height:${pos.maxHeight}px` : ''}
38
- `"
39
- >
40
- <slot
41
- name="popup"
42
- :position="pos"
43
- :extract-el="(_) => popupEl = _"
44
- />
45
- </div>
46
- </component>
47
- <!-- </Transition> -->
48
- </template>
49
-
50
- <script setup>
51
- import { onMounted, ref, useAttrs, watch } from "vue";
52
- import { getFallbackId } from "../shared/props.js";
53
- import { twMerge } from "../../utils/twMerge.js";
54
- import { castType } from "@alanscodelog/utils/castType";
55
- import { isArray } from "@alanscodelog/utils/isArray";
56
- const fallbackId = getFallbackId();
57
- const props = defineProps({
58
- id: { type: String, required: false },
59
- useDialogForBackdrop: { type: Boolean, required: false, default: false },
60
- useBackdrop: { type: Boolean, required: false, default: true },
61
- preferredHorizontal: { type: [Array, Function], required: false, default: () => ["center-most", "either"] },
62
- preferredVertical: { type: [Array, Function], required: false, default: () => ["top", "bottom", "either"] },
63
- avoidRepositioning: { type: Boolean, required: false, default: false },
64
- modifyPosition: { type: Function, required: false },
65
- canClose: { type: Boolean, required: false, default: true }
66
- });
67
- const $attrs = useAttrs();
68
- defineOptions({
69
- name: "LibPopup",
70
- inheritAttrs: false
71
- });
72
- const emit = defineEmits(["close"]);
73
- const dialogEl = ref(null);
74
- const popupEl = ref(null);
75
- const buttonEl = ref(null);
76
- const backgroundEl = ref(null);
77
- const pos = ref({});
78
- const modelValue = defineModel({ type: Boolean, ...{ default: false } });
79
- let isOpen = modelValue.value;
80
- const getDialogBoundingRect = () => ({
81
- x: 0,
82
- y: 0,
83
- width: window.innerWidth,
84
- height: window.innerHeight,
85
- top: 0,
86
- bottom: 0,
87
- left: 0,
88
- right: 0
89
- });
90
- let lastButtonElPos;
91
- const recompute = (force = false) => {
92
- requestAnimationFrame(() => {
93
- const horzHasCenterScreen = isArray(props.preferredHorizontal) && props.preferredHorizontal[0] === "center-screen";
94
- const vertHasCenterScreen = isArray(props.preferredVertical) && props.preferredVertical[0] === "center-screen";
95
- const canBePositionedWithoutButton = (horzHasCenterScreen || typeof props.preferredHorizontal === "function") && (vertHasCenterScreen || typeof props.preferredVertical === "function");
96
- if (!popupEl.value || !dialogEl.value || !buttonEl.value && !canBePositionedWithoutButton) {
97
- pos.value = {};
98
- return;
99
- }
100
- const el = buttonEl.value?.getBoundingClientRect();
101
- const bg = backgroundEl.value?.getBoundingClientRect() ?? (props.useBackdrop ? getDialogBoundingRect() : document.body.getBoundingClientRect());
102
- const popup = popupEl.value.getBoundingClientRect();
103
- let finalPos = {};
104
- if (!force && modelValue.value && props.avoidRepositioning && buttonEl.value && lastButtonElPos) {
105
- const shiftX = buttonEl.value.getBoundingClientRect().x - lastButtonElPos.x;
106
- const shiftY = buttonEl.value.getBoundingClientRect().y - lastButtonElPos.y;
107
- pos.value.x += shiftX;
108
- pos.value.y += shiftY;
109
- lastButtonElPos = el;
110
- return;
111
- }
112
- const space = {
113
- left: 0,
114
- right: 0,
115
- leftLeft: 0,
116
- rightRight: 0,
117
- leftFromCenter: 0,
118
- rightFromCenter: 0,
119
- topFromCenter: 0,
120
- bottomFromCenter: 0,
121
- top: 0,
122
- bottom: 0
123
- };
124
- if (el) {
125
- space.left = el.x + el.width - bg.x;
126
- space.leftLeft = el.x - bg.x;
127
- space.right = bg.x + bg.width - (el.x + el.width);
128
- space.rightRight = bg.x + bg.width - el.x;
129
- space.leftFromCenter = el.x + el.width / 2 - bg.x;
130
- space.rightFromCenter = bg.x + bg.width - (el.x + el.width / 2);
131
- space.topFromCenter = el.y + el.height / 2 - bg.y;
132
- space.bottomFromCenter = bg.y + bg.height - (el.y + el.height / 2);
133
- space.top = el.y - bg.y;
134
- space.bottom = bg.y + bg.height - (el.y + el.height);
135
- }
136
- const { preferredHorizontal, preferredVertical } = props;
137
- let maxWidth;
138
- let maxHeight;
139
- if (typeof preferredHorizontal === "function") {
140
- finalPos.x = preferredHorizontal(el, popup, bg, space);
141
- } else {
142
- outerloop:
143
- for (const type of preferredHorizontal) {
144
- switch (type) {
145
- case "center-screen":
146
- if (popup.width < bg.width) {
147
- finalPos.x = bg.width / 2 - popup.width / 2;
148
- } else {
149
- finalPos.x = 0;
150
- maxWidth = finalPos.x;
151
- }
152
- break;
153
- case "center-most":
154
- case "center":
155
- castType(el);
156
- if (space.leftFromCenter >= popup.width / 2 && space.rightFromCenter >= popup.width / 2) {
157
- finalPos.x = el.x + el.width / 2 - popup.width / 2;
158
- break outerloop;
159
- }
160
- if (space.rightFromCenter + space.leftFromCenter <= popup.width) {
161
- finalPos.x = 0;
162
- break outerloop;
163
- }
164
- if (type === "center-most") {
165
- if (space.leftFromCenter < space.rightFromCenter) {
166
- finalPos.x = el.x + el.width / 2 - space.leftFromCenter;
167
- break outerloop;
168
- } else {
169
- finalPos.x = el.x + el.width / 2 + space.rightFromCenter - popup.width;
170
- break outerloop;
171
- }
172
- }
173
- break;
174
- case "left-most":
175
- castType(el);
176
- if (space.left >= popup.width) {
177
- finalPos.x = el.x - popup.width;
178
- break outerloop;
179
- } else {
180
- finalPos.x = 0;
181
- break outerloop;
182
- }
183
- case "right-most":
184
- castType(el);
185
- if (space.right >= popup.width) {
186
- finalPos.x = el.x + el.width;
187
- break outerloop;
188
- } else {
189
- finalPos.x = bg.x + bg.width - popup.width;
190
- break outerloop;
191
- }
192
- case "right":
193
- castType(el);
194
- if (space.right >= popup.width) {
195
- finalPos.x = el.x;
196
- break outerloop;
197
- }
198
- break;
199
- case "left":
200
- castType(el);
201
- if (space.left >= popup.width) {
202
- finalPos.x = el.x + el.width - popup.width;
203
- break outerloop;
204
- }
205
- break;
206
- case "either": {
207
- castType(el);
208
- if (space.right >= space.left) {
209
- finalPos.x = el.x;
210
- break outerloop;
211
- } else {
212
- finalPos.x = el.x + el.width - popup.width;
213
- break outerloop;
214
- }
215
- }
216
- }
217
- }
218
- }
219
- if (typeof preferredVertical === "function") {
220
- finalPos.y = preferredVertical(el, popup, bg, space);
221
- } else {
222
- outerloop:
223
- for (const type of preferredVertical) {
224
- switch (type) {
225
- case "center-screen":
226
- if (popup.height < bg.height) {
227
- finalPos.y = bg.height / 2 - popup.height / 2;
228
- } else {
229
- finalPos.y = 0;
230
- maxHeight = finalPos.y;
231
- }
232
- break;
233
- case "top":
234
- castType(el);
235
- if (space.top >= popup.height) {
236
- finalPos.y = el.y - popup.height;
237
- break outerloop;
238
- }
239
- break;
240
- case "bottom":
241
- castType(el);
242
- if (space.bottom >= popup.height) {
243
- finalPos.y = el.y + el.height;
244
- break outerloop;
245
- }
246
- break;
247
- case "top-most":
248
- castType(el);
249
- if (space.top >= popup.height) {
250
- finalPos.y = el.y - popup.height;
251
- break outerloop;
252
- } else {
253
- finalPos.y = 0;
254
- break outerloop;
255
- }
256
- case "bottom-most":
257
- castType(el);
258
- if (space.bottom >= popup.height) {
259
- finalPos.y = el.y + el.height;
260
- break outerloop;
261
- } else {
262
- finalPos.y = bg.y + bg.height - popup.height;
263
- break outerloop;
264
- }
265
- case "center-most":
266
- case "center":
267
- castType(el);
268
- if (space.topFromCenter >= popup.height / 2 && space.bottomFromCenter >= popup.height / 2) {
269
- finalPos.y = el.y + el.height / 2 - popup.height / 2;
270
- break outerloop;
271
- }
272
- if (space.bottomFromCenter + space.topFromCenter <= popup.height) {
273
- finalPos.y = 0;
274
- break outerloop;
275
- }
276
- if (type === "center-most") {
277
- if (space.topFromCenter < space.bottomFromCenter) {
278
- finalPos.y = el.y + el.height / 2 - space.topFromCenter;
279
- break outerloop;
280
- } else {
281
- finalPos.y = el.y + el.height / 2 + space.bottomFromCenter - popup.height;
282
- break outerloop;
283
- }
284
- }
285
- break;
286
- case "either": {
287
- castType(el);
288
- if (space.top >= space.bottom) {
289
- finalPos.y = el.y - popup.height;
290
- break outerloop;
291
- } else {
292
- finalPos.y = el.y + el.height;
293
- break outerloop;
294
- }
295
- }
296
- }
297
- }
298
- }
299
- finalPos.maxWidth = maxWidth ?? void 0;
300
- finalPos.maxHeight = maxHeight ?? void 0;
301
- if (props.modifyPosition) {
302
- finalPos = props.modifyPosition(finalPos, el, popup, bg, space);
303
- }
304
- pos.value = finalPos;
305
- lastButtonElPos = el;
306
- });
307
- };
308
- const show = () => {
309
- if (!isOpen) {
310
- isOpen = true;
311
- modelValue.value = isOpen;
312
- if (props.useBackdrop && props.useDialogForBackdrop) dialogEl.value?.showModal();
313
- recompute(true);
314
- }
315
- };
316
- const close = () => {
317
- if (isOpen) {
318
- const res = props.canClose ?? false;
319
- emit("close");
320
- if (res === false) return;
321
- isOpen = false;
322
- modelValue.value = isOpen;
323
- pos.value.maxWidth = void 0;
324
- if (props.useBackdrop && props.useDialogForBackdrop) dialogEl.value?.close();
325
- }
326
- };
327
- const recomputeListener = () => recompute();
328
- const bindListeners = () => {
329
- window.addEventListener("resize", recomputeListener);
330
- window.addEventListener("scroll", recomputeListener, true);
331
- };
332
- const unbindListeners = () => {
333
- window.removeEventListener("resize", recomputeListener);
334
- window.removeEventListener("scroll", recomputeListener, true);
335
- };
336
- watch([modelValue, popupEl], () => {
337
- if (modelValue.value) {
338
- show();
339
- bindListeners();
340
- } else {
341
- close();
342
- unbindListeners();
343
- }
344
- });
345
- const handleMouseup = ($event) => {
346
- $event.preventDefault();
347
- close();
348
- };
349
- onMounted(() => {
350
- recompute();
351
- });
352
- defineExpose({
353
- recompute,
354
- setReference: (el) => {
355
- buttonEl.value = el;
356
- },
357
- setBackground: (el) => {
358
- backgroundEl.value = el;
359
- }
360
- });
361
- </script>
362
-
363
- <script>
364
-
365
- </script>
@@ -1,52 +0,0 @@
1
- import { type HTMLAttributes } from "vue";
2
- import { type LinkableByIdProps, type TailwindClassProp, type PopupProps } from "../shared/props.js";
3
- import type { IPopupReference } from "../../types/index.js";
4
- type RealProps = LinkableByIdProps & PopupProps;
5
- interface Props extends
6
- /** @vue-ignore */
7
- Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>, RealProps {
8
- }
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
11
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Props & {
12
- modelValue?: boolean;
13
- }, {
14
- recompute: (force?: boolean) => void;
15
- setReference: (el: IPopupReference | null) => void;
16
- setBackground: (el: IPopupReference | null) => void;
17
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
- "update:modelValue": (value: boolean) => any;
19
- } & {
20
- close: () => any;
21
- }, string, import("vue").PublicProps, Readonly<Props & {
22
- modelValue?: boolean;
23
- }> & Readonly<{
24
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
25
- onClose?: (() => any) | undefined;
26
- }>, {
27
- canClose: boolean;
28
- useDialogForBackdrop: false;
29
- useBackdrop: boolean;
30
- preferredHorizontal: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
31
- preferredVertical: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | import("../../main.lib.js").PopupPositioner;
32
- avoidRepositioning: boolean;
33
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
34
- button?: (props: {
35
- extractEl: (_: any) => any;
36
- }) => any;
37
- } & {
38
- popup?: (props: {
39
- position: {
40
- x: number;
41
- y: number;
42
- maxWidth?: number | undefined;
43
- maxHeight?: number | undefined;
44
- };
45
- extractEl: (_: any) => any;
46
- }) => any;
47
- }>;
48
- type __VLS_WithSlots<T, S> = T & {
49
- new (): {
50
- $slots: S;
51
- };
52
- };