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