@falcon-ui/falcon-ui 1.0.0

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 (289) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +182 -0
  3. package/cjs/JsBarcode-BlUjuVmB.cjs +3519 -0
  4. package/cjs/JsBarcode-BlUjuVmB.cjs.map +1 -0
  5. package/cjs/chunk-D4y6LrGi.cjs +40 -0
  6. package/cjs/components/JsBarcode-BOXEZn4Q.cjs +3519 -0
  7. package/cjs/components/JsBarcode-BOXEZn4Q.cjs.map +1 -0
  8. package/cjs/components/barcode/JsBarcode-BOXEZn4Q.cjs +3519 -0
  9. package/cjs/components/barcode/JsBarcode-BOXEZn4Q.cjs.map +1 -0
  10. package/cjs/components/barcode/chunk-D4y6LrGi.cjs +40 -0
  11. package/cjs/components/barcode/index.cjs +211 -0
  12. package/cjs/components/barcode/index.cjs.map +1 -0
  13. package/cjs/components/barcode/src/JsBarcode-BOXEZn4Q.cjs +3519 -0
  14. package/cjs/components/barcode/src/JsBarcode-BOXEZn4Q.cjs.map +1 -0
  15. package/cjs/components/barcode/src/barcode.cjs +102 -0
  16. package/cjs/components/barcode/src/barcode.cjs.map +1 -0
  17. package/cjs/components/barcode/src/barcode.vue.cjs +200 -0
  18. package/cjs/components/barcode/src/barcode.vue.cjs.map +1 -0
  19. package/cjs/components/barcode/src/chunk-D4y6LrGi.cjs +40 -0
  20. package/cjs/components/button/index.cjs +135 -0
  21. package/cjs/components/button/index.cjs.map +1 -0
  22. package/cjs/components/button/src/button.cjs +16 -0
  23. package/cjs/components/button/src/button.cjs.map +1 -0
  24. package/cjs/components/button/src/button.vue.cjs +124 -0
  25. package/cjs/components/button/src/button.vue.cjs.map +1 -0
  26. package/cjs/components/chunk-D4y6LrGi.cjs +40 -0
  27. package/cjs/components/date-picker/index.cjs +164 -0
  28. package/cjs/components/date-picker/index.cjs.map +1 -0
  29. package/cjs/components/date-picker/src/date-picker.cjs +25 -0
  30. package/cjs/components/date-picker/src/date-picker.cjs.map +1 -0
  31. package/cjs/components/date-picker/src/date-picker.vue.cjs +153 -0
  32. package/cjs/components/date-picker/src/date-picker.vue.cjs.map +1 -0
  33. package/cjs/components/dialog/index.cjs +346 -0
  34. package/cjs/components/dialog/index.cjs.map +1 -0
  35. package/cjs/components/dialog/src/dialog.cjs +40 -0
  36. package/cjs/components/dialog/src/dialog.cjs.map +1 -0
  37. package/cjs/components/dialog/src/dialog.vue.cjs +343 -0
  38. package/cjs/components/dialog/src/dialog.vue.cjs.map +1 -0
  39. package/cjs/components/index.cjs +9450 -0
  40. package/cjs/components/index.cjs.map +1 -0
  41. package/cjs/components/input/index.cjs +175 -0
  42. package/cjs/components/input/index.cjs.map +1 -0
  43. package/cjs/components/input/src/input.cjs +27 -0
  44. package/cjs/components/input/src/input.cjs.map +1 -0
  45. package/cjs/components/input/src/input.vue.cjs +164 -0
  46. package/cjs/components/input/src/input.vue.cjs.map +1 -0
  47. package/cjs/components/input-number/index.cjs +374 -0
  48. package/cjs/components/input-number/index.cjs.map +1 -0
  49. package/cjs/components/input-number/src/input-number.cjs +48 -0
  50. package/cjs/components/input-number/src/input-number.cjs.map +1 -0
  51. package/cjs/components/input-number/src/input-number.vue.cjs +363 -0
  52. package/cjs/components/input-number/src/input-number.vue.cjs.map +1 -0
  53. package/cjs/components/input-search/index.cjs +286 -0
  54. package/cjs/components/input-search/index.cjs.map +1 -0
  55. package/cjs/components/input-search/src/input-search.cjs +55 -0
  56. package/cjs/components/input-search/src/input-search.cjs.map +1 -0
  57. package/cjs/components/input-search/src/input-search.vue.cjs +275 -0
  58. package/cjs/components/input-search/src/input-search.vue.cjs.map +1 -0
  59. package/cjs/components/qr-code/index.cjs +1975 -0
  60. package/cjs/components/qr-code/index.cjs.map +1 -0
  61. package/cjs/components/qr-code/src/qr-code.cjs +63 -0
  62. package/cjs/components/qr-code/src/qr-code.cjs.map +1 -0
  63. package/cjs/components/qr-code/src/qr-code.vue.cjs +1964 -0
  64. package/cjs/components/qr-code/src/qr-code.vue.cjs.map +1 -0
  65. package/cjs/components/radial-menu/index.cjs +983 -0
  66. package/cjs/components/radial-menu/index.cjs.map +1 -0
  67. package/cjs/components/radial-menu/src/radial-menu.cjs +96 -0
  68. package/cjs/components/radial-menu/src/radial-menu.cjs.map +1 -0
  69. package/cjs/components/radial-menu/src/radial-menu.vue.cjs +921 -0
  70. package/cjs/components/radial-menu/src/radial-menu.vue.cjs.map +1 -0
  71. package/cjs/components/select/index.cjs +163 -0
  72. package/cjs/components/select/index.cjs.map +1 -0
  73. package/cjs/components/select/src/select.cjs +16 -0
  74. package/cjs/components/select/src/select.cjs.map +1 -0
  75. package/cjs/components/select/src/select.vue.cjs +152 -0
  76. package/cjs/components/select/src/select.vue.cjs.map +1 -0
  77. package/cjs/components/table/index.cjs +3351 -0
  78. package/cjs/components/table/index.cjs.map +1 -0
  79. package/cjs/components/table/src/table.cjs +62 -0
  80. package/cjs/components/table/src/table.cjs.map +1 -0
  81. package/cjs/components/table/src/table.vue.cjs +3085 -0
  82. package/cjs/components/table/src/table.vue.cjs.map +1 -0
  83. package/cjs/dialog-CJU00aEV.cjs +614 -0
  84. package/cjs/dialog-CJU00aEV.cjs.map +1 -0
  85. package/cjs/dialog-DcH26KbE.cjs +2 -0
  86. package/cjs/hooks/dialog-DpYPBcKV.cjs +266 -0
  87. package/cjs/hooks/dialog-DpYPBcKV.cjs.map +1 -0
  88. package/cjs/hooks/hooks-D2Jaq5kO.cjs +328 -0
  89. package/cjs/hooks/hooks-D2Jaq5kO.cjs.map +1 -0
  90. package/cjs/hooks/index.cjs +8 -0
  91. package/cjs/icons/index.cjs +86 -0
  92. package/cjs/icons/index.cjs.map +1 -0
  93. package/cjs/index.cjs +9141 -0
  94. package/cjs/index.cjs.map +1 -0
  95. package/cjs/utils/index.cjs +69 -0
  96. package/cjs/utils/index.cjs.map +1 -0
  97. package/esm/JsBarcode-kVJER62m.js +3514 -0
  98. package/esm/JsBarcode-kVJER62m.js.map +1 -0
  99. package/esm/chunk-BuRq7rDw.js +23 -0
  100. package/esm/components/JsBarcode-CzzxrEd_.js +3514 -0
  101. package/esm/components/JsBarcode-CzzxrEd_.js.map +1 -0
  102. package/esm/components/barcode/JsBarcode-C5ux6wsb.js +3514 -0
  103. package/esm/components/barcode/JsBarcode-C5ux6wsb.js.map +1 -0
  104. package/esm/components/barcode/chunk--em_ddB3.js +23 -0
  105. package/esm/components/barcode/index.mjs +204 -0
  106. package/esm/components/barcode/index.mjs.map +1 -0
  107. package/esm/components/barcode/src/JsBarcode-C5ux6wsb.js +3514 -0
  108. package/esm/components/barcode/src/JsBarcode-C5ux6wsb.js.map +1 -0
  109. package/esm/components/barcode/src/barcode.mjs +98 -0
  110. package/esm/components/barcode/src/barcode.mjs.map +1 -0
  111. package/esm/components/barcode/src/barcode.vue.mjs +194 -0
  112. package/esm/components/barcode/src/barcode.vue.mjs.map +1 -0
  113. package/esm/components/barcode/src/chunk--em_ddB3.js +23 -0
  114. package/esm/components/button/index.mjs +126 -0
  115. package/esm/components/button/index.mjs.map +1 -0
  116. package/esm/components/button/src/button.mjs +14 -0
  117. package/esm/components/button/src/button.mjs.map +1 -0
  118. package/esm/components/button/src/button.vue.mjs +117 -0
  119. package/esm/components/button/src/button.vue.mjs.map +1 -0
  120. package/esm/components/chunk-BuRq7rDw.js +23 -0
  121. package/esm/components/date-picker/index.mjs +155 -0
  122. package/esm/components/date-picker/index.mjs.map +1 -0
  123. package/esm/components/date-picker/src/date-picker.mjs +23 -0
  124. package/esm/components/date-picker/src/date-picker.mjs.map +1 -0
  125. package/esm/components/date-picker/src/date-picker.vue.mjs +146 -0
  126. package/esm/components/date-picker/src/date-picker.vue.mjs.map +1 -0
  127. package/esm/components/dialog/index.mjs +335 -0
  128. package/esm/components/dialog/index.mjs.map +1 -0
  129. package/esm/components/dialog/src/dialog.mjs +38 -0
  130. package/esm/components/dialog/src/dialog.mjs.map +1 -0
  131. package/esm/components/dialog/src/dialog.vue.mjs +334 -0
  132. package/esm/components/dialog/src/dialog.vue.mjs.map +1 -0
  133. package/esm/components/index.mjs +9386 -0
  134. package/esm/components/index.mjs.map +1 -0
  135. package/esm/components/input/index.mjs +166 -0
  136. package/esm/components/input/index.mjs.map +1 -0
  137. package/esm/components/input/src/input.mjs +25 -0
  138. package/esm/components/input/src/input.mjs.map +1 -0
  139. package/esm/components/input/src/input.vue.mjs +157 -0
  140. package/esm/components/input/src/input.vue.mjs.map +1 -0
  141. package/esm/components/input-number/index.mjs +365 -0
  142. package/esm/components/input-number/index.mjs.map +1 -0
  143. package/esm/components/input-number/src/input-number.mjs +45 -0
  144. package/esm/components/input-number/src/input-number.mjs.map +1 -0
  145. package/esm/components/input-number/src/input-number.vue.mjs +356 -0
  146. package/esm/components/input-number/src/input-number.vue.mjs.map +1 -0
  147. package/esm/components/input-search/index.mjs +277 -0
  148. package/esm/components/input-search/index.mjs.map +1 -0
  149. package/esm/components/input-search/src/input-search.mjs +53 -0
  150. package/esm/components/input-search/src/input-search.mjs.map +1 -0
  151. package/esm/components/input-search/src/input-search.vue.mjs +268 -0
  152. package/esm/components/input-search/src/input-search.vue.mjs.map +1 -0
  153. package/esm/components/qr-code/index.mjs +1967 -0
  154. package/esm/components/qr-code/index.mjs.map +1 -0
  155. package/esm/components/qr-code/src/qr-code.mjs +59 -0
  156. package/esm/components/qr-code/src/qr-code.mjs.map +1 -0
  157. package/esm/components/qr-code/src/qr-code.vue.mjs +1958 -0
  158. package/esm/components/qr-code/src/qr-code.vue.mjs.map +1 -0
  159. package/esm/components/radial-menu/index.mjs +974 -0
  160. package/esm/components/radial-menu/index.mjs.map +1 -0
  161. package/esm/components/radial-menu/src/radial-menu.mjs +94 -0
  162. package/esm/components/radial-menu/src/radial-menu.mjs.map +1 -0
  163. package/esm/components/radial-menu/src/radial-menu.vue.mjs +916 -0
  164. package/esm/components/radial-menu/src/radial-menu.vue.mjs.map +1 -0
  165. package/esm/components/select/index.mjs +154 -0
  166. package/esm/components/select/index.mjs.map +1 -0
  167. package/esm/components/select/src/select.mjs +14 -0
  168. package/esm/components/select/src/select.mjs.map +1 -0
  169. package/esm/components/select/src/select.vue.mjs +145 -0
  170. package/esm/components/select/src/select.vue.mjs.map +1 -0
  171. package/esm/components/table/index.mjs +3342 -0
  172. package/esm/components/table/index.mjs.map +1 -0
  173. package/esm/components/table/src/table.mjs +60 -0
  174. package/esm/components/table/src/table.mjs.map +1 -0
  175. package/esm/components/table/src/table.vue.mjs +3080 -0
  176. package/esm/components/table/src/table.vue.mjs.map +1 -0
  177. package/esm/dialog-Cm3Px-Bu.js +537 -0
  178. package/esm/dialog-Cm3Px-Bu.js.map +1 -0
  179. package/esm/dialog-CzZm50XM.js +2 -0
  180. package/esm/hooks/dialog-d4SMZWbw.js +261 -0
  181. package/esm/hooks/dialog-d4SMZWbw.js.map +1 -0
  182. package/esm/hooks/hooks-DdjieG2I.js +281 -0
  183. package/esm/hooks/hooks-DdjieG2I.js.map +1 -0
  184. package/esm/hooks/index.mjs +2 -0
  185. package/esm/icons/index.mjs +79 -0
  186. package/esm/icons/index.mjs.map +1 -0
  187. package/esm/index.mjs +9065 -0
  188. package/esm/index.mjs.map +1 -0
  189. package/esm/utils/index.mjs +65 -0
  190. package/esm/utils/index.mjs.map +1 -0
  191. package/global.d.ts +39 -0
  192. package/package.json +131 -0
  193. package/theme/index.css +1 -0
  194. package/theme/index.scss +16 -0
  195. package/theme/src/barcode.scss +14 -0
  196. package/theme/src/button.scss +65 -0
  197. package/theme/src/date-picker.scss +87 -0
  198. package/theme/src/dialog.scss +146 -0
  199. package/theme/src/ep-vars.scss +11 -0
  200. package/theme/src/input-number.scss +66 -0
  201. package/theme/src/input-search.scss +78 -0
  202. package/theme/src/input.scss +66 -0
  203. package/theme/src/mixins/bem.scss +35 -0
  204. package/theme/src/mixins/color.scss +8 -0
  205. package/theme/src/qr-code.scss +23 -0
  206. package/theme/src/radial-menu.scss +346 -0
  207. package/theme/src/select.scss +44 -0
  208. package/theme/src/table.scss +143 -0
  209. package/theme/src/tokens.scss +26 -0
  210. package/theme/src/tree-select.scss +45 -0
  211. package/theme/src/tree.scss +369 -0
  212. package/types/components/barcode/index.d.ts +183 -0
  213. package/types/components/barcode/src/barcode.d.ts +147 -0
  214. package/types/components/barcode/src/barcode.vue.d.ts +184 -0
  215. package/types/components/button/index.d.ts +135 -0
  216. package/types/components/button/src/button.d.ts +33 -0
  217. package/types/components/button/src/button.vue.d.ts +138 -0
  218. package/types/components/date-picker/index.d.ts +508 -0
  219. package/types/components/date-picker/src/date-picker.d.ts +35 -0
  220. package/types/components/date-picker/src/date-picker.vue.d.ts +509 -0
  221. package/types/components/dialog/index.d.ts +630 -0
  222. package/types/components/dialog/src/dialog.d.ts +70 -0
  223. package/types/components/dialog/src/dialog.vue.d.ts +257 -0
  224. package/types/components/index.d.ts +27 -0
  225. package/types/components/input/index.d.ts +233 -0
  226. package/types/components/input/src/input.d.ts +65 -0
  227. package/types/components/input/src/input.vue.d.ts +239 -0
  228. package/types/components/input-number/index.d.ts +713 -0
  229. package/types/components/input-number/src/input-number.d.ts +101 -0
  230. package/types/components/input-number/src/input-number.vue.d.ts +283 -0
  231. package/types/components/input-search/index.d.ts +113 -0
  232. package/types/components/input-search/src/input-search.d.ts +128 -0
  233. package/types/components/input-search/src/input-search.vue.d.ts +114 -0
  234. package/types/components/qr-code/index.d.ts +109 -0
  235. package/types/components/qr-code/src/qr-code.d.ts +93 -0
  236. package/types/components/qr-code/src/qr-code.vue.d.ts +109 -0
  237. package/types/components/radial-menu/index.d.ts +499 -0
  238. package/types/components/radial-menu/src/radial-menu-item.d.ts +40 -0
  239. package/types/components/radial-menu/src/radial-menu-item.vue.d.ts +95 -0
  240. package/types/components/radial-menu/src/radial-menu.d.ts +92 -0
  241. package/types/components/radial-menu/src/radial-menu.vue.d.ts +200 -0
  242. package/types/components/radial-menu/src/types.d.ts +48 -0
  243. package/types/components/radial-menu/src/use-radial-menu-items.d.ts +19 -0
  244. package/types/components/radial-menu/src/use-radial-menu-keyboard.d.ts +17 -0
  245. package/types/components/radial-menu/src/use-radial-menu-position.d.ts +45 -0
  246. package/types/components/radial-menu/src/use-radial-menu-shortcut.d.ts +8 -0
  247. package/types/components/radial-menu/src/use-radial-menu-state.d.ts +15 -0
  248. package/types/components/select/index.d.ts +5 -0
  249. package/types/components/select/src/select.d.ts +30 -0
  250. package/types/components/select/src/select.vue.d.ts +25 -0
  251. package/types/components/table/index.d.ts +8 -0
  252. package/types/components/table/src/editor-registry.d.ts +24 -0
  253. package/types/components/table/src/proxy-data.d.ts +10 -0
  254. package/types/components/table/src/table-editor.d.ts +18 -0
  255. package/types/components/table/src/table-editor.vue.d.ts +43 -0
  256. package/types/components/table/src/table.d.ts +179 -0
  257. package/types/components/table/src/table.vue.d.ts +121 -0
  258. package/types/components/tree/index.d.ts +5 -0
  259. package/types/components/tree/src/tree-node.vue.d.ts +88 -0
  260. package/types/components/tree/src/tree-types.d.ts +90 -0
  261. package/types/components/tree/src/tree.d.ts +448 -0
  262. package/types/components/tree/src/tree.vue.d.ts +301 -0
  263. package/types/components/tree/src/use-tree-check-conduct.d.ts +43 -0
  264. package/types/components/tree/src/use-tree-checked-state.d.ts +34 -0
  265. package/types/components/tree/src/use-tree-drag.d.ts +45 -0
  266. package/types/components/tree/src/use-tree-expanded-state.d.ts +41 -0
  267. package/types/components/tree/src/use-tree-keyboard.d.ts +21 -0
  268. package/types/components/tree/src/use-tree-load.d.ts +25 -0
  269. package/types/components/tree/src/use-tree-scroll.d.ts +17 -0
  270. package/types/components/tree/src/use-tree-selected-state.d.ts +29 -0
  271. package/types/components/tree-select/index.d.ts +5 -0
  272. package/types/components/tree-select/src/tree-select.d.ts +26 -0
  273. package/types/components/tree-select/src/tree-select.vue.d.ts +25 -0
  274. package/types/falcon-ui/index.d.ts +8 -0
  275. package/types/hooks/index.d.ts +3 -0
  276. package/types/hooks/src/use-clearable-state.d.ts +10 -0
  277. package/types/hooks/src/use-component.d.ts +15 -0
  278. package/types/hooks/src/use-dialog.d.ts +49 -0
  279. package/types/icons/index.d.ts +1 -0
  280. package/types/icons/src/components/holder-outlined.vue.d.ts +3 -0
  281. package/types/icons/src/components/index.d.ts +3 -0
  282. package/types/icons/src/components/minus-square-outlined.vue.d.ts +3 -0
  283. package/types/icons/src/components/plus-square-outlined.vue.d.ts +3 -0
  284. package/types/utils/index.d.ts +3 -0
  285. package/types/utils/src/bem.d.ts +11 -0
  286. package/types/utils/src/component.d.ts +6 -0
  287. package/types/utils/src/install.d.ts +5 -0
  288. package/umd/falcon-ui.umd.js +13297 -0
  289. package/umd/falcon-ui.umd.js.map +1 -0
@@ -0,0 +1,921 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let vue = require("vue");
6
+ let element_plus = require("element-plus");
7
+ var defaultNamespace = "fl";
8
+ var statePrefix = "is-";
9
+ var buildBemName = (namespace, block, blockSuffix = "", element = "", modifier = "") => {
10
+ let className = `${namespace}-${block}`;
11
+ if (blockSuffix) className += `-${blockSuffix}`;
12
+ if (element) className += `__${element}`;
13
+ if (modifier) className += `--${modifier}`;
14
+ return className;
15
+ };
16
+ const useNamespace = (block, namespace = defaultNamespace) => {
17
+ const b = (blockSuffix = "") => buildBemName(namespace, block, blockSuffix);
18
+ const e = (element) => element ? buildBemName(namespace, block, "", element) : "";
19
+ const m = (modifier) => modifier ? buildBemName(namespace, block, "", "", modifier) : "";
20
+ const be = (blockSuffix, element) => {
21
+ if (!blockSuffix || !element) return "";
22
+ return buildBemName(namespace, block, blockSuffix, element);
23
+ };
24
+ const em = (element, modifier) => {
25
+ if (!element || !modifier) return "";
26
+ return buildBemName(namespace, block, "", element, modifier);
27
+ };
28
+ const bm = (blockSuffix, modifier) => {
29
+ if (!blockSuffix || !modifier) return "";
30
+ return buildBemName(namespace, block, blockSuffix, "", modifier);
31
+ };
32
+ const bem = (blockSuffix, element, modifier) => {
33
+ if (!blockSuffix && !element && !modifier) return b();
34
+ return buildBemName(namespace, block, blockSuffix, element, modifier);
35
+ };
36
+ const is = (name, state = true) => state ? `${statePrefix}${name}` : "";
37
+ return {
38
+ namespace,
39
+ b,
40
+ e,
41
+ m,
42
+ be,
43
+ em,
44
+ bm,
45
+ bem,
46
+ is
47
+ };
48
+ };
49
+ var radialMenuSizes = [
50
+ "large",
51
+ "medium",
52
+ "small"
53
+ ];
54
+ var radialMenuItemTypes = ["square", "circle"];
55
+ const flRadialMenuProps = {
56
+ items: {
57
+ type: Array,
58
+ default: () => []
59
+ },
60
+ mode: {
61
+ type: String,
62
+ default: "inline"
63
+ },
64
+ trigger: {
65
+ type: String,
66
+ default: "click"
67
+ },
68
+ modelValue: {
69
+ type: Boolean,
70
+ default: void 0
71
+ },
72
+ shortcut: {
73
+ type: String,
74
+ default: ""
75
+ },
76
+ shortcutEnabled: {
77
+ type: Boolean,
78
+ default: true
79
+ },
80
+ centerIcon: {
81
+ type: [Object, String],
82
+ default: void 0
83
+ },
84
+ centerLabel: {
85
+ type: String,
86
+ default: ""
87
+ },
88
+ disabled: {
89
+ type: Boolean,
90
+ default: false
91
+ },
92
+ maxRingItems: {
93
+ type: Number,
94
+ default: 6
95
+ },
96
+ closeOnSelect: {
97
+ type: Boolean,
98
+ default: true
99
+ },
100
+ moreText: {
101
+ type: String,
102
+ default: "More"
103
+ },
104
+ moreMode: {
105
+ type: String,
106
+ default: "text-ellipsis"
107
+ },
108
+ moreDropdownPlacement: {
109
+ type: String,
110
+ default: "bottom"
111
+ },
112
+ size: {
113
+ type: String,
114
+ default: void 0,
115
+ validator: (value) => radialMenuSizes.includes(value)
116
+ },
117
+ itemType: {
118
+ type: String,
119
+ default: "square",
120
+ validator: (value) => radialMenuItemTypes.includes(value)
121
+ },
122
+ teleport: {
123
+ type: [Boolean, String],
124
+ default: true
125
+ },
126
+ zIndex: {
127
+ type: Number,
128
+ default: 2e3
129
+ }
130
+ };
131
+ const flRadialMenuEmits = {
132
+ "update:modelValue": (opened) => typeof opened === "boolean",
133
+ open: (reason) => typeof reason === "string",
134
+ close: (reason) => typeof reason === "string",
135
+ select: (index, indexPath, item, context) => typeof index === "string" && Array.isArray(indexPath) && indexPath.every((path) => typeof path === "string") && item !== void 0 && context !== void 0,
136
+ "active-change": (item) => item === null || item !== void 0,
137
+ "more-open": () => true,
138
+ "more-close": () => true
139
+ };
140
+ const clampRingItemCount = (maxRingItems) => {
141
+ if (!Number.isFinite(maxRingItems)) return 6;
142
+ return Math.min(Math.max(Math.trunc(maxRingItems), 1), 6);
143
+ };
144
+ const resolveRadialMenuItemIndex = (item) => {
145
+ const rawIndex = item.index ?? item.key;
146
+ if (rawIndex === void 0 || rawIndex === null || rawIndex === "") return "";
147
+ return String(rawIndex);
148
+ };
149
+ const normalizeRadialMenuItems = (items, options = {}) => {
150
+ const seenIndexes = /* @__PURE__ */ new Set();
151
+ const normalizedItems = [];
152
+ for (const item of items) {
153
+ const index = resolveRadialMenuItemIndex(item);
154
+ if (!index) {
155
+ options.warn?.("Missing required prop: \"index\"");
156
+ continue;
157
+ }
158
+ if (seenIndexes.has(index)) {
159
+ options.warn?.(`Duplicate item index detected: ${index}`);
160
+ continue;
161
+ }
162
+ seenIndexes.add(index);
163
+ normalizedItems.push({
164
+ ...item,
165
+ index
166
+ });
167
+ }
168
+ return normalizedItems;
169
+ };
170
+ const splitRadialMenuItems = (items, maxRingItems) => {
171
+ const ringLimit = clampRingItemCount(maxRingItems);
172
+ const visibleItems = items.filter((item) => !item.hidden);
173
+ return {
174
+ visibleItems,
175
+ ringItems: visibleItems.slice(0, ringLimit),
176
+ moreItems: visibleItems.slice(ringLimit),
177
+ ringLimit
178
+ };
179
+ };
180
+ var findNextEnabledIndex = (items, currentIndex, direction) => {
181
+ if (items.length === 0) return -1;
182
+ for (let step = 1; step <= items.length; step += 1) {
183
+ const nextIndex = (currentIndex + step * direction + items.length) % items.length;
184
+ if (!items[nextIndex]?.disabled) return nextIndex;
185
+ }
186
+ return -1;
187
+ };
188
+ const useRadialMenuKeyboard = ({ ringItems, moreItems, ringRefs, moreRefs, closeMenu, closeMore, activateFocused }) => {
189
+ const focusRingItem = (index) => {
190
+ ringRefs.value[index]?.focus();
191
+ };
192
+ const focusFirstAvailableRingItem = () => {
193
+ const index = findNextEnabledIndex(ringItems.value, -1, 1);
194
+ if (index >= 0) focusRingItem(index);
195
+ };
196
+ const handleRingKeydown = (event, index) => {
197
+ if (event.key === "ArrowRight" || event.key === "ArrowDown") {
198
+ event.preventDefault();
199
+ const nextIndex = findNextEnabledIndex(ringItems.value, index, 1);
200
+ if (nextIndex >= 0) focusRingItem(nextIndex);
201
+ return;
202
+ }
203
+ if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
204
+ event.preventDefault();
205
+ const nextIndex = findNextEnabledIndex(ringItems.value, index, -1);
206
+ if (nextIndex >= 0) focusRingItem(nextIndex);
207
+ return;
208
+ }
209
+ if (event.key === "Enter" || event.key === " ") {
210
+ event.preventDefault();
211
+ activateFocused(event);
212
+ }
213
+ };
214
+ const handleMoreKeydown = (event, index) => {
215
+ if (event.key === "ArrowDown") {
216
+ event.preventDefault();
217
+ const nextIndex = findNextEnabledIndex(moreItems.value, index, 1);
218
+ moreRefs.value[nextIndex]?.focus();
219
+ return;
220
+ }
221
+ if (event.key === "ArrowUp") {
222
+ event.preventDefault();
223
+ const nextIndex = findNextEnabledIndex(moreItems.value, index, -1);
224
+ moreRefs.value[nextIndex]?.focus();
225
+ return;
226
+ }
227
+ if (event.key === "Enter" || event.key === " ") {
228
+ event.preventDefault();
229
+ activateFocused(event);
230
+ }
231
+ };
232
+ const handleMenuKeydown = (event) => {
233
+ if (event.key === "Escape") {
234
+ event.preventDefault();
235
+ closeMore();
236
+ closeMenu();
237
+ }
238
+ };
239
+ return {
240
+ focusFirstAvailableRingItem,
241
+ handleMenuKeydown,
242
+ handleRingKeydown,
243
+ handleMoreKeydown
244
+ };
245
+ };
246
+ var toRadians = (degree) => degree * Math.PI / 180;
247
+ var normalizeCircleCoordinate = (value) => Math.abs(value) < .001 ? 0 : value;
248
+ const normalizeRadialMenuAngle = (angle) => {
249
+ const normalized = angle % 360;
250
+ return normalized < 0 ? normalized + 360 : normalized;
251
+ };
252
+ var pointOnCircle = (radius, angle) => {
253
+ const radians = toRadians(angle);
254
+ return {
255
+ x: normalizeCircleCoordinate(Math.cos(radians) * radius),
256
+ y: normalizeCircleCoordinate(Math.sin(radians) * radius)
257
+ };
258
+ };
259
+ const getRadialMenuClockwiseArcPoints = ({ radius, targetAngle, startAngle = 0, steps = 7 }) => {
260
+ const safeSteps = Math.max(Math.floor(steps), 2);
261
+ const normalizedStartAngle = normalizeRadialMenuAngle(startAngle);
262
+ const clockwiseSweep = normalizeRadialMenuAngle(targetAngle - normalizedStartAngle);
263
+ return Array.from({ length: safeSteps }, (_, index) => {
264
+ return pointOnCircle(radius, normalizedStartAngle + clockwiseSweep * (index / (safeSteps - 1)));
265
+ });
266
+ };
267
+ const getRadialMenuClockwiseEntryOrder = (layouts, { startAngle = 0 } = {}) => {
268
+ const normalizedStartAngle = normalizeRadialMenuAngle(startAngle);
269
+ return layouts.map((layout, index) => ({
270
+ index,
271
+ distance: normalizeRadialMenuAngle(layout.angle - normalizedStartAngle)
272
+ })).sort((current, next) => next.distance - current.distance || current.index - next.index).map(({ index }) => index);
273
+ };
274
+ var getRadialMenuActiveAngles = ({ activeIndex, count, startAngle = -90 }) => {
275
+ const sectorAngle = 360 / Math.max(count, 1);
276
+ const gap = Math.min(6, sectorAngle / 4);
277
+ const centerAngle = startAngle + sectorAngle * activeIndex;
278
+ const start = centerAngle - sectorAngle / 2 + gap;
279
+ const end = centerAngle + sectorAngle / 2 - gap;
280
+ return {
281
+ start,
282
+ end,
283
+ largeArcFlag: end - start > 180 ? 1 : 0
284
+ };
285
+ };
286
+ const getRadialMenuItemLayout = ({ count, index, radius, startAngle = -90 }) => {
287
+ const angle = startAngle + 360 / Math.max(count, 1) * index;
288
+ const point = pointOnCircle(radius, angle);
289
+ return {
290
+ angle,
291
+ x: point.x,
292
+ y: point.y
293
+ };
294
+ };
295
+ const getRadialMenuSectorPath = ({ activeIndex, count, innerRadius, outerRadius, startAngle = -90 }) => {
296
+ if (outerRadius <= innerRadius) return "";
297
+ const { start, end, largeArcFlag } = getRadialMenuActiveAngles({
298
+ activeIndex,
299
+ count,
300
+ startAngle
301
+ });
302
+ const outerStart = pointOnCircle(outerRadius, start);
303
+ const outerEnd = pointOnCircle(outerRadius, end);
304
+ const innerEnd = pointOnCircle(innerRadius, end);
305
+ const innerStart = pointOnCircle(innerRadius, start);
306
+ return [
307
+ `M ${outerStart.x.toFixed(3)} ${outerStart.y.toFixed(3)}`,
308
+ `A ${outerRadius} ${outerRadius} 0 ${largeArcFlag} 1 ${outerEnd.x.toFixed(3)} ${outerEnd.y.toFixed(3)}`,
309
+ `L ${innerEnd.x.toFixed(3)} ${innerEnd.y.toFixed(3)}`,
310
+ `A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 0 ${innerStart.x.toFixed(3)} ${innerStart.y.toFixed(3)}`,
311
+ "Z"
312
+ ].join(" ");
313
+ };
314
+ const getRadialMenuTrackArcPath = ({ activeIndex, count, radius, innerRadius = 0, startAngle = -90 }) => {
315
+ if (radius <= innerRadius) return "";
316
+ const { start, end, largeArcFlag } = getRadialMenuActiveAngles({
317
+ activeIndex,
318
+ count,
319
+ startAngle
320
+ });
321
+ const arcStart = pointOnCircle(radius, start);
322
+ const arcEnd = pointOnCircle(radius, end);
323
+ return [`M ${arcStart.x.toFixed(3)} ${arcStart.y.toFixed(3)}`, `A ${radius} ${radius} 0 ${largeArcFlag} 1 ${arcEnd.x.toFixed(3)} ${arcEnd.y.toFixed(3)}`].join(" ");
324
+ };
325
+ const getRadialMenuTipPlacement = ({ x, y }) => {
326
+ if (Math.abs(x) > Math.abs(y)) return x < 0 ? "left" : "right";
327
+ return y < 0 ? "top" : "bottom";
328
+ };
329
+ var modifierKeys = new Set([
330
+ "alt",
331
+ "ctrl",
332
+ "control",
333
+ "meta",
334
+ "shift"
335
+ ]);
336
+ var isEditableTarget = (target) => {
337
+ if (!(target instanceof HTMLElement)) return false;
338
+ const tagName = target.tagName.toLowerCase();
339
+ return tagName === "input" || tagName === "textarea" || tagName === "select" || target.isContentEditable;
340
+ };
341
+ var normalizeShortcut = (value) => value.split("+").map((part) => part.trim().toLowerCase()).filter(Boolean);
342
+ var matchesShortcut = (event, shortcut) => {
343
+ const parts = normalizeShortcut(shortcut);
344
+ if (parts.length === 0) return false;
345
+ const key = parts.find((part) => !modifierKeys.has(part));
346
+ const expectsAlt = parts.includes("alt");
347
+ const expectsCtrl = parts.includes("ctrl") || parts.includes("control");
348
+ const expectsMeta = parts.includes("meta");
349
+ const expectsShift = parts.includes("shift");
350
+ return event.altKey === expectsAlt && event.ctrlKey === expectsCtrl && event.metaKey === expectsMeta && event.shiftKey === expectsShift && event.key.toLowerCase() === key;
351
+ };
352
+ var getViewportCenter = () => ({
353
+ x: typeof window === "undefined" ? 0 : window.innerWidth / 2,
354
+ y: typeof window === "undefined" ? 0 : window.innerHeight / 2
355
+ });
356
+ const useRadialMenuShortcut = ({ shortcut, enabled, open }) => {
357
+ const center = getViewportCenter();
358
+ let lastMouseX = center.x;
359
+ let lastMouseY = center.y;
360
+ const handleMouseMove = (event) => {
361
+ lastMouseX = event.clientX;
362
+ lastMouseY = event.clientY;
363
+ };
364
+ const handleKeydown = (event) => {
365
+ if (!enabled.value || !matchesShortcut(event, shortcut.value) || isEditableTarget(event.target)) return;
366
+ event.preventDefault();
367
+ open({
368
+ x: lastMouseX,
369
+ y: lastMouseY,
370
+ reason: "shortcut"
371
+ });
372
+ };
373
+ (0, vue.onMounted)(() => {
374
+ window.addEventListener("mousemove", handleMouseMove);
375
+ window.addEventListener("keydown", handleKeydown);
376
+ });
377
+ (0, vue.onUnmounted)(() => {
378
+ window.removeEventListener("mousemove", handleMouseMove);
379
+ window.removeEventListener("keydown", handleKeydown);
380
+ });
381
+ };
382
+ const useRadialMenuState = ({ modelValue, disabled, emitUpdate }) => {
383
+ const uncontrolledOpened = (0, vue.ref)(false);
384
+ const floatingX = (0, vue.ref)();
385
+ const floatingY = (0, vue.ref)();
386
+ const isControlled = (0, vue.computed)(() => modelValue.value !== void 0);
387
+ const opened = (0, vue.computed)(() => isControlled.value ? modelValue.value === true : uncontrolledOpened.value);
388
+ const setOpened = (nextOpened) => {
389
+ if (disabled.value && nextOpened) return;
390
+ if (!isControlled.value) uncontrolledOpened.value = nextOpened;
391
+ emitUpdate(nextOpened);
392
+ };
393
+ const open = (options = {}) => {
394
+ if (options.x !== void 0) floatingX.value = options.x;
395
+ if (options.y !== void 0) floatingY.value = options.y;
396
+ setOpened(true);
397
+ };
398
+ const close = (_reason = "manual") => {
399
+ setOpened(false);
400
+ };
401
+ const toggle = (options = {}) => {
402
+ if (opened.value) close("manual");
403
+ else open(options);
404
+ };
405
+ return {
406
+ opened,
407
+ floatingX,
408
+ floatingY,
409
+ open,
410
+ close,
411
+ toggle
412
+ };
413
+ };
414
+ var _hoisted_1 = ["disabled", "aria-expanded"];
415
+ var _hoisted_2 = ["r"];
416
+ var _hoisted_3 = ["d"];
417
+ var _hoisted_4 = ["d"];
418
+ var _hoisted_5 = [
419
+ "disabled",
420
+ "tabindex",
421
+ "aria-disabled",
422
+ "aria-label",
423
+ "data-radial-menu-index",
424
+ "onMouseenter",
425
+ "onFocus",
426
+ "onClick",
427
+ "onKeydown"
428
+ ];
429
+ var _hoisted_6 = ["aria-expanded"];
430
+ var _hoisted_7 = [
431
+ "disabled",
432
+ "tabindex",
433
+ "aria-disabled",
434
+ "aria-label",
435
+ "data-radial-menu-more-index",
436
+ "onClick",
437
+ "onKeydown"
438
+ ];
439
+ var radialMenuEntryTrackDelay = 120;
440
+ var radialMenuEntryItemMinDuration = 440;
441
+ var radialMenuEntryItemMaxDuration = 600;
442
+ var radialMenuEntryItemStagger = 90;
443
+ var radialMenuEntryArcSteps = 9;
444
+ var radialMenuEntryStartAngle = 180;
445
+ var radialMenuEntryEasing = "cubic-bezier(0.2, 0, 0, 1)";
446
+ var radial_menu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
447
+ name: "FlRadialMenu",
448
+ __name: "radial-menu",
449
+ props: flRadialMenuProps,
450
+ emits: flRadialMenuEmits,
451
+ setup(__props, { expose: __expose, emit: __emit }) {
452
+ const props = __props;
453
+ const emit = __emit;
454
+ const ns = useNamespace("radial-menu");
455
+ const slots = (0, vue.useSlots)();
456
+ const rootRef = (0, vue.useTemplateRef)("rootRef");
457
+ const centerRef = (0, vue.useTemplateRef)("centerRef");
458
+ const activeRingIndex = (0, vue.ref)(null);
459
+ const moreOpened = (0, vue.ref)(false);
460
+ const isEntryAnimating = (0, vue.ref)(false);
461
+ const ringButtonRefs = (0, vue.ref)([]);
462
+ const moreButtonRefs = (0, vue.ref)([]);
463
+ const warnedMessages = /* @__PURE__ */ new Set();
464
+ const globalSize = (0, element_plus.useGlobalSize)();
465
+ const radialMenuGeometryBySize = {
466
+ large: {
467
+ radius: 96,
468
+ centerSize: 56
469
+ },
470
+ medium: {
471
+ radius: 80,
472
+ centerSize: 48
473
+ },
474
+ small: {
475
+ radius: 64,
476
+ centerSize: 40
477
+ }
478
+ };
479
+ const mapGlobalSize = (size) => {
480
+ if (size === "large" || size === "small") return size;
481
+ if (size === "default") return "medium";
482
+ return "large";
483
+ };
484
+ const warnRadialMenu = (message) => {
485
+ if (warnedMessages.has(message)) return;
486
+ warnedMessages.add(message);
487
+ console.warn(`[FlRadialMenu] ${message}`);
488
+ };
489
+ const flattenSlotVNodes = (children) => {
490
+ const vnodes = [];
491
+ for (const child of children) {
492
+ if (Array.isArray(child)) {
493
+ vnodes.push(...flattenSlotVNodes(child));
494
+ continue;
495
+ }
496
+ if (!(0, vue.isVNode)(child)) continue;
497
+ if (child.type === vue.Fragment && Array.isArray(child.children)) {
498
+ vnodes.push(...flattenSlotVNodes(child.children));
499
+ continue;
500
+ }
501
+ vnodes.push(child);
502
+ }
503
+ return vnodes;
504
+ };
505
+ const isRadialMenuItemVNode = (vnode) => typeof vnode.type === "object" && "name" in vnode.type && vnode.type.name === "FlRadialMenuItem";
506
+ const readBooleanSlotProp = (value) => value === true || value === "";
507
+ const readOptionalBooleanSlotProp = (value) => value === void 0 ? void 0 : readBooleanSlotProp(value);
508
+ const readSlotItemSlots = (children) => {
509
+ if (!children || Array.isArray(children) || typeof children !== "object") return;
510
+ return children;
511
+ };
512
+ const readSlotItemProps = (vnode) => {
513
+ const vnodeProps = vnode.props ?? {};
514
+ const vnodeSlots = readSlotItemSlots(vnode.children);
515
+ return {
516
+ index: typeof vnodeProps.index === "string" ? vnodeProps.index : void 0,
517
+ label: typeof vnodeProps.label === "string" ? vnodeProps.label : "",
518
+ icon: vnodeProps.icon,
519
+ shortcut: typeof vnodeProps.shortcut === "string" ? vnodeProps.shortcut : void 0,
520
+ disabled: readBooleanSlotProp(vnodeProps.disabled),
521
+ hidden: readBooleanSlotProp(vnodeProps.hidden),
522
+ divided: readBooleanSlotProp(vnodeProps.divided),
523
+ closeOnSelect: readOptionalBooleanSlotProp(vnodeProps.closeOnSelect),
524
+ meta: vnodeProps.meta && typeof vnodeProps.meta === "object" ? vnodeProps.meta : void 0,
525
+ iconSlot: vnodeSlots?.icon,
526
+ labelSlot: vnodeSlots?.label
527
+ };
528
+ };
529
+ const slotItems = (0, vue.computed)(() => flattenSlotVNodes(slots.default?.() ?? []).filter(isRadialMenuItemVNode).map(readSlotItemProps));
530
+ const resolvedItems = (0, vue.computed)(() => normalizeRadialMenuItems(slotItems.value.length > 0 ? slotItems.value : props.items, { warn: warnRadialMenu }));
531
+ const splitItems = (0, vue.computed)(() => splitRadialMenuItems(resolvedItems.value, props.maxRingItems));
532
+ const ringItems = (0, vue.computed)(() => splitItems.value.ringItems);
533
+ const moreItems = (0, vue.computed)(() => splitItems.value.moreItems);
534
+ const resolvedSize = (0, vue.computed)(() => props.size ?? mapGlobalSize(globalSize.value));
535
+ const sizeGeometry = (0, vue.computed)(() => radialMenuGeometryBySize[resolvedSize.value]);
536
+ const resolvedRadius = (0, vue.computed)(() => sizeGeometry.value.radius);
537
+ const resolvedCenterSize = (0, vue.computed)(() => sizeGeometry.value.centerSize);
538
+ const activeItem = (0, vue.computed)(() => activeRingIndex.value === null ? null : ringItems.value[activeRingIndex.value] ?? null);
539
+ const sectorInnerRadius = (0, vue.computed)(() => resolvedCenterSize.value / 2 + 8);
540
+ const sectorPath = (0, vue.computed)(() => {
541
+ if (activeRingIndex.value === null || ringItems.value.length === 0) return "";
542
+ return getRadialMenuSectorPath({
543
+ activeIndex: activeRingIndex.value,
544
+ count: ringItems.value.length,
545
+ innerRadius: sectorInnerRadius.value,
546
+ outerRadius: resolvedRadius.value
547
+ });
548
+ });
549
+ const activeTrackPath = (0, vue.computed)(() => {
550
+ if (activeRingIndex.value === null || ringItems.value.length === 0) return "";
551
+ return getRadialMenuTrackArcPath({
552
+ activeIndex: activeRingIndex.value,
553
+ count: ringItems.value.length,
554
+ radius: resolvedRadius.value,
555
+ innerRadius: sectorInnerRadius.value
556
+ });
557
+ });
558
+ const { opened, floatingX, floatingY, open, close, toggle } = useRadialMenuState({
559
+ modelValue: (0, vue.toRef)(props, "modelValue"),
560
+ disabled: (0, vue.toRef)(props, "disabled"),
561
+ emitUpdate: (nextOpened) => emit("update:modelValue", nextOpened)
562
+ });
563
+ useRadialMenuShortcut({
564
+ shortcut: (0, vue.toRef)(props, "shortcut"),
565
+ enabled: (0, vue.computed)(() => props.shortcutEnabled && Boolean(props.shortcut)),
566
+ open
567
+ });
568
+ const rootClass = (0, vue.computed)(() => [
569
+ ns.b(),
570
+ ns.m(props.mode),
571
+ ns.m(resolvedSize.value),
572
+ ns.m(`item-${props.itemType}`),
573
+ ns.is("opened", opened.value),
574
+ ns.is("entering", isEntryAnimating.value),
575
+ ns.is("disabled", props.disabled)
576
+ ]);
577
+ const rootStyle = (0, vue.computed)(() => ({
578
+ "--fl-radial-menu-floating-x": `${floatingX.value ?? (typeof window === "undefined" ? 0 : window.innerWidth / 2)}px`,
579
+ "--fl-radial-menu-floating-y": `${floatingY.value ?? (typeof window === "undefined" ? 0 : window.innerHeight / 2)}px`,
580
+ "--fl-radial-menu-z-index": String(props.zIndex),
581
+ "--fl-radial-menu-more-enter-delay": `${radialMenuEntryTrackDelay + Math.max(ringItems.value.length - 1, 0) * radialMenuEntryItemStagger}ms`
582
+ }));
583
+ const getItemIcon = (item) => item.iconSlot ?? item.icon;
584
+ const RadialMenuItemLabel = ({ item }) => item.labelSlot?.() ?? item.label;
585
+ const getItemLayout = (index) => getRadialMenuItemLayout({
586
+ count: ringItems.value.length,
587
+ index,
588
+ radius: resolvedRadius.value
589
+ });
590
+ const formatEntryCoordinate = (value) => {
591
+ return `${Math.abs(value) < .001 ? 0 : Number(value.toFixed(3))}px`;
592
+ };
593
+ const getEntryTransform = (x, y, scale = 1) => `translate(calc(-50% + ${formatEntryCoordinate(x)}), calc(-50% + ${formatEntryCoordinate(y)})) scale(${scale})`;
594
+ const prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
595
+ const canUseWebAnimations = () => typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype.animate === "function";
596
+ const canAnimateElement = (element) => typeof element.animate === "function";
597
+ const getItemStyle = (index) => {
598
+ const layout = getItemLayout(index);
599
+ return {
600
+ "--fl-radial-menu-item-x": `${layout.x}px`,
601
+ "--fl-radial-menu-item-y": `${layout.y}px`,
602
+ "--fl-radial-menu-item-index": String(index)
603
+ };
604
+ };
605
+ const getItemLabelClass = (index) => {
606
+ const placement = getRadialMenuTipPlacement(getItemLayout(index));
607
+ return [
608
+ ns.e("item-label"),
609
+ ns.em("item-label", `tip-${placement}`),
610
+ moreItems.value.length > 0 && placement === "bottom" ? ns.em("item-label", "hidden-by-more") : ""
611
+ ];
612
+ };
613
+ const moreLabel = (0, vue.computed)(() => {
614
+ if (props.moreMode === "ellipsis") return "...";
615
+ if (props.moreMode === "text") return props.moreText;
616
+ return `${props.moreText} ...`;
617
+ });
618
+ const setActiveRingIndex = (index) => {
619
+ activeRingIndex.value = index;
620
+ emit("active-change", activeItem.value);
621
+ };
622
+ const setRingButtonRef = (element, index) => {
623
+ if (element instanceof HTMLButtonElement) ringButtonRefs.value[index] = element;
624
+ else delete ringButtonRefs.value[index];
625
+ };
626
+ const setMoreButtonRef = (element, index) => {
627
+ if (element instanceof HTMLButtonElement) moreButtonRefs.value[index] = element;
628
+ else delete moreButtonRefs.value[index];
629
+ };
630
+ const setMoreOpened = (nextOpened) => {
631
+ moreOpened.value = nextOpened;
632
+ if (nextOpened) emit("more-open");
633
+ else emit("more-close");
634
+ };
635
+ let isDocumentPointerdownBound = false;
636
+ const removeDocumentPointerdown = () => {
637
+ if (!isDocumentPointerdownBound || typeof document === "undefined") return;
638
+ document.removeEventListener("pointerdown", handleDocumentPointerdown);
639
+ isDocumentPointerdownBound = false;
640
+ };
641
+ const addDocumentPointerdown = () => {
642
+ if (isDocumentPointerdownBound || typeof document === "undefined") return;
643
+ document.addEventListener("pointerdown", handleDocumentPointerdown);
644
+ isDocumentPointerdownBound = true;
645
+ };
646
+ const handleDocumentPointerdown = (event) => {
647
+ const { target } = event;
648
+ if (!(target instanceof Node)) return;
649
+ if (rootRef.value?.contains(target)) return;
650
+ moreOpened.value = false;
651
+ close("click-outside");
652
+ };
653
+ const activateItem = (item, source, index, event) => {
654
+ if (item.disabled) return;
655
+ emit("select", item.index, [item.index], item, {
656
+ source,
657
+ index,
658
+ event
659
+ });
660
+ if (item.closeOnSelect ?? props.closeOnSelect) {
661
+ moreOpened.value = false;
662
+ close("select");
663
+ }
664
+ };
665
+ const activateKeyboardItem = (event) => {
666
+ const target = event.currentTarget;
667
+ if (!(target instanceof HTMLElement)) return;
668
+ target.click();
669
+ };
670
+ const { focusFirstAvailableRingItem, handleMenuKeydown, handleRingKeydown, handleMoreKeydown } = useRadialMenuKeyboard({
671
+ ringItems,
672
+ moreItems,
673
+ ringRefs: ringButtonRefs,
674
+ moreRefs: moreButtonRefs,
675
+ closeMenu: () => close("escape"),
676
+ closeMore: () => {
677
+ moreOpened.value = false;
678
+ },
679
+ activateFocused: activateKeyboardItem
680
+ });
681
+ let entryAnimations = [];
682
+ let entryAnimationToken = 0;
683
+ let entryFinishTimer;
684
+ const clearEntryFinishTimer = () => {
685
+ if (entryFinishTimer === void 0) return;
686
+ clearTimeout(entryFinishTimer);
687
+ entryFinishTimer = void 0;
688
+ };
689
+ const cancelEntryAnimations = () => {
690
+ entryAnimationToken += 1;
691
+ clearEntryFinishTimer();
692
+ for (const animation of entryAnimations) animation.cancel();
693
+ entryAnimations = [];
694
+ isEntryAnimating.value = false;
695
+ };
696
+ const finishEntryAnimations = (token) => {
697
+ if (token !== entryAnimationToken) return;
698
+ clearEntryFinishTimer();
699
+ for (const animation of entryAnimations) animation.cancel();
700
+ entryAnimations = [];
701
+ isEntryAnimating.value = false;
702
+ };
703
+ const getEntryOrderByIndex = () => {
704
+ const entryOrder = getRadialMenuClockwiseEntryOrder(ringItems.value.map((_, index) => getItemLayout(index)), { startAngle: radialMenuEntryStartAngle });
705
+ return new Map(entryOrder.map((itemIndex, orderIndex) => [itemIndex, orderIndex]));
706
+ };
707
+ const getRingItemEntryDistance = (index) => normalizeRadialMenuAngle(getItemLayout(index).angle - radialMenuEntryStartAngle);
708
+ const getRingItemEntryDuration = (index) => {
709
+ const distanceRatio = Math.min(getRingItemEntryDistance(index), 360) / 360;
710
+ return radialMenuEntryItemMinDuration + (radialMenuEntryItemMaxDuration - radialMenuEntryItemMinDuration) * distanceRatio;
711
+ };
712
+ const getRingItemEntryKeyframes = (index) => {
713
+ const layout = getItemLayout(index);
714
+ const finalOpacity = ringItems.value[index]?.disabled ? .5 : 1;
715
+ const points = getRadialMenuClockwiseArcPoints({
716
+ radius: resolvedRadius.value,
717
+ startAngle: radialMenuEntryStartAngle,
718
+ targetAngle: layout.angle,
719
+ steps: radialMenuEntryArcSteps
720
+ });
721
+ return points.map((point, pointIndex) => ({
722
+ offset: pointIndex / (points.length - 1),
723
+ opacity: pointIndex === 0 ? 0 : finalOpacity,
724
+ transform: getEntryTransform(point.x, point.y, pointIndex === 0 ? .86 : 1)
725
+ }));
726
+ };
727
+ const playEntryAnimations = () => {
728
+ if (prefersReducedMotion() || ringItems.value.length === 0) {
729
+ isEntryAnimating.value = false;
730
+ return;
731
+ }
732
+ const ringButtons = ringButtonRefs.value.slice(0, ringItems.value.length);
733
+ const entryOrderByIndex = getEntryOrderByIndex();
734
+ const animations = [];
735
+ let maxEntryEndTime = 0;
736
+ ringButtons.forEach((button, index) => {
737
+ if (!button || !canAnimateElement(button)) return;
738
+ const delay = radialMenuEntryTrackDelay + (entryOrderByIndex.get(index) ?? index) * radialMenuEntryItemStagger;
739
+ const duration = getRingItemEntryDuration(index);
740
+ const animation = button.animate(getRingItemEntryKeyframes(index), {
741
+ delay,
742
+ duration,
743
+ easing: radialMenuEntryEasing,
744
+ fill: "both"
745
+ });
746
+ maxEntryEndTime = Math.max(maxEntryEndTime, delay + duration);
747
+ animations.push(animation);
748
+ });
749
+ if (animations.length === 0) {
750
+ isEntryAnimating.value = false;
751
+ return;
752
+ }
753
+ entryAnimationToken += 1;
754
+ const token = entryAnimationToken;
755
+ entryAnimations = animations;
756
+ isEntryAnimating.value = true;
757
+ entryFinishTimer = setTimeout(() => finishEntryAnimations(token), Math.ceil(maxEntryEndTime) + 40);
758
+ };
759
+ (0, vue.watch)(opened, async (nextOpened) => {
760
+ cancelEntryAnimations();
761
+ if (!nextOpened) return;
762
+ isEntryAnimating.value = canUseWebAnimations() && !prefersReducedMotion() && ringItems.value.length > 0;
763
+ await (0, vue.nextTick)();
764
+ if (!opened.value) return;
765
+ playEntryAnimations();
766
+ focusFirstAvailableRingItem();
767
+ });
768
+ (0, vue.watch)(opened, (nextOpened) => {
769
+ if (nextOpened) addDocumentPointerdown();
770
+ else removeDocumentPointerdown();
771
+ }, { immediate: true });
772
+ (0, vue.onBeforeUnmount)(() => {
773
+ removeDocumentPointerdown();
774
+ cancelEntryAnimations();
775
+ });
776
+ const handleCenterClick = () => {
777
+ if (props.disabled || props.trigger !== "click") return;
778
+ toggle({ reason: "click" });
779
+ };
780
+ const handleMouseEnter = () => {
781
+ if (props.disabled || props.trigger !== "hover") return;
782
+ open({ reason: "hover" });
783
+ };
784
+ const handleMouseLeave = () => {
785
+ if (props.trigger !== "hover") return;
786
+ close("hover-leave");
787
+ };
788
+ const focus = () => {
789
+ centerRef.value?.focus();
790
+ };
791
+ __expose({
792
+ open: (options) => open(options),
793
+ close,
794
+ toggle,
795
+ focus
796
+ });
797
+ return (_ctx, _cache) => {
798
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
799
+ ref_key: "rootRef",
800
+ ref: rootRef,
801
+ class: (0, vue.normalizeClass)(rootClass.value),
802
+ style: (0, vue.normalizeStyle)(rootStyle.value),
803
+ onMouseenter: handleMouseEnter,
804
+ onMouseleave: handleMouseLeave
805
+ }, [(0, vue.createElementVNode)("button", {
806
+ ref_key: "centerRef",
807
+ ref: centerRef,
808
+ type: "button",
809
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("center")),
810
+ disabled: props.disabled,
811
+ "aria-expanded": (0, vue.unref)(opened),
812
+ "aria-haspopup": "menu",
813
+ onClick: handleCenterClick
814
+ }, [(0, vue.renderSlot)(_ctx.$slots, "center", {}, () => [props.centerIcon && typeof props.centerIcon !== "string" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.centerIcon), { key: 0 })) : props.centerIcon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
815
+ key: 1,
816
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("center-icon"))
817
+ }, (0, vue.toDisplayString)(props.centerIcon), 3)) : (0, vue.createCommentVNode)("v-if", true), props.centerLabel ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
818
+ key: 2,
819
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("center-label"))
820
+ }, (0, vue.toDisplayString)(props.centerLabel), 3)) : (0, vue.createCommentVNode)("v-if", true)])], 10, _hoisted_1), (0, vue.unref)(opened) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
821
+ key: 0,
822
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("panel")),
823
+ role: "menu",
824
+ onKeydown: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(handleMenuKeydown) && (0, vue.unref)(handleMenuKeydown)(...args))
825
+ }, [
826
+ ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
827
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("sector")),
828
+ viewBox: "-140 -140 280 280",
829
+ "aria-hidden": "true"
830
+ }, [
831
+ (0, vue.createElementVNode)("circle", {
832
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("track")),
833
+ cx: "0",
834
+ cy: "0",
835
+ r: resolvedRadius.value
836
+ }, null, 10, _hoisted_2),
837
+ sectorPath.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("path", {
838
+ key: 0,
839
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("sector-path")),
840
+ d: sectorPath.value
841
+ }, null, 10, _hoisted_3)) : (0, vue.createCommentVNode)("v-if", true),
842
+ activeTrackPath.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("path", {
843
+ key: 1,
844
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("track-active")),
845
+ d: activeTrackPath.value
846
+ }, null, 10, _hoisted_4)) : (0, vue.createCommentVNode)("v-if", true)
847
+ ], 2)),
848
+ ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(ringItems.value, (item, index) => {
849
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
850
+ key: item.index,
851
+ ref_for: true,
852
+ ref: (element) => setRingButtonRef(element, index),
853
+ type: "button",
854
+ role: "menuitem",
855
+ class: (0, vue.normalizeClass)([
856
+ (0, vue.unref)(ns).e("item"),
857
+ (0, vue.unref)(ns).is("active", activeRingIndex.value === index),
858
+ (0, vue.unref)(ns).is("disabled", item.disabled === true)
859
+ ]),
860
+ style: (0, vue.normalizeStyle)(getItemStyle(index)),
861
+ disabled: item.disabled,
862
+ tabindex: item.disabled ? -1 : 0,
863
+ "aria-disabled": item.disabled === true,
864
+ "aria-label": item.label,
865
+ "data-radial-menu-index": item.index,
866
+ onMouseenter: ($event) => setActiveRingIndex(index),
867
+ onFocus: ($event) => setActiveRingIndex(index),
868
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => setActiveRingIndex(null)),
869
+ onClick: ($event) => activateItem(item, "ring", index, $event),
870
+ onKeydown: ($event) => (0, vue.unref)(handleRingKeydown)($event, index)
871
+ }, [getItemIcon(item) && typeof getItemIcon(item) !== "string" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getItemIcon(item)), { key: 0 })) : getItemIcon(item) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
872
+ key: 1,
873
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item-icon"))
874
+ }, (0, vue.toDisplayString)(getItemIcon(item)), 3)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(getItemLabelClass(index)) }, [(0, vue.createVNode)(RadialMenuItemLabel, { item }, null, 8, ["item"])], 2)], 46, _hoisted_5);
875
+ }), 128)),
876
+ moreItems.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
877
+ key: 0,
878
+ type: "button",
879
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("more")),
880
+ "aria-haspopup": "menu",
881
+ "aria-expanded": moreOpened.value,
882
+ onClick: _cache[1] || (_cache[1] = ($event) => setMoreOpened(!moreOpened.value))
883
+ }, (0, vue.toDisplayString)(moreLabel.value), 11, _hoisted_6)) : (0, vue.createCommentVNode)("v-if", true),
884
+ moreOpened.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
885
+ key: 1,
886
+ class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("more-dropdown"), (0, vue.unref)(ns).m(`more-${props.moreDropdownPlacement}`)]),
887
+ role: "menu"
888
+ }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(moreItems.value, (item, index) => {
889
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
890
+ key: item.index,
891
+ ref_for: true,
892
+ ref: (element) => setMoreButtonRef(element, index),
893
+ type: "button",
894
+ role: "menuitem",
895
+ class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("more-item"), (0, vue.unref)(ns).is("disabled", item.disabled === true)]),
896
+ disabled: item.disabled,
897
+ tabindex: item.disabled ? -1 : 0,
898
+ "aria-disabled": item.disabled === true,
899
+ "aria-label": item.label,
900
+ "data-radial-menu-more-index": item.index,
901
+ onClick: ($event) => activateItem(item, "more", index, $event),
902
+ onKeydown: ($event) => (0, vue.unref)(handleMoreKeydown)($event, index)
903
+ }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("more-content")) }, [getItemIcon(item) && typeof getItemIcon(item) !== "string" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getItemIcon(item)), {
904
+ key: 0,
905
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("more-icon"))
906
+ }, null, 8, ["class"])) : getItemIcon(item) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
907
+ key: 1,
908
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("more-icon"))
909
+ }, (0, vue.toDisplayString)(getItemIcon(item)), 3)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("more-label")) }, [(0, vue.createVNode)(RadialMenuItemLabel, { item }, null, 8, ["item"])], 2)], 2), item.shortcut ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
910
+ key: 0,
911
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("shortcut"))
912
+ }, (0, vue.toDisplayString)(item.shortcut), 3)) : (0, vue.createCommentVNode)("v-if", true)], 42, _hoisted_7);
913
+ }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true)
914
+ ], 34)) : (0, vue.createCommentVNode)("v-if", true)], 38);
915
+ };
916
+ }
917
+ });
918
+ var radial_menu_default = radial_menu_vue_vue_type_script_setup_true_lang_default;
919
+ exports.default = radial_menu_default;
920
+
921
+ //# sourceMappingURL=radial-menu.vue.cjs.map