@adapttable/element-plus 0.0.0 → 0.1.1

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 (357) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +534 -1
  3. package/dist/ElementCard-BRZekaHr.cjs +41 -0
  4. package/dist/ElementCard-BRZekaHr.cjs.map +1 -0
  5. package/dist/ElementCard-DZdAU6x8.js +36 -0
  6. package/dist/ElementCard-DZdAU6x8.js.map +1 -0
  7. package/dist/ElementCheckbox-BQN4_eas.js +99 -0
  8. package/dist/ElementCheckbox-BQN4_eas.js.map +1 -0
  9. package/dist/ElementCheckbox-BewKx6sv.cjs +104 -0
  10. package/dist/ElementCheckbox-BewKx6sv.cjs.map +1 -0
  11. package/dist/ElementColumnMenuPanel-D9oWJf02.js +131 -0
  12. package/dist/ElementColumnMenuPanel-D9oWJf02.js.map +1 -0
  13. package/dist/ElementColumnMenuPanel-DavsUQAR.cjs +142 -0
  14. package/dist/ElementColumnMenuPanel-DavsUQAR.cjs.map +1 -0
  15. package/dist/ElementFilterHeaderRow-CR1aax4I.cjs +202 -0
  16. package/dist/ElementFilterHeaderRow-CR1aax4I.cjs.map +1 -0
  17. package/dist/ElementFilterHeaderRow-CjduRYN5.js +191 -0
  18. package/dist/ElementFilterHeaderRow-CjduRYN5.js.map +1 -0
  19. package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.cts +33 -0
  20. package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.cts.map +1 -0
  21. package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.ts +33 -0
  22. package/dist/ElementFilterHeaderRow.vue-aMWpPgI9.d.ts.map +1 -0
  23. package/dist/ElementFilterSurface-B8Fo3hPb.cjs +308 -0
  24. package/dist/ElementFilterSurface-B8Fo3hPb.cjs.map +1 -0
  25. package/dist/ElementFilterSurface-BR_nBvZU.js +291 -0
  26. package/dist/ElementFilterSurface-BR_nBvZU.js.map +1 -0
  27. package/dist/ElementInput-BsoAvPfO.js +55 -0
  28. package/dist/ElementInput-BsoAvPfO.js.map +1 -0
  29. package/dist/ElementInput-vBVDBaLp.cjs +60 -0
  30. package/dist/ElementInput-vBVDBaLp.cjs.map +1 -0
  31. package/dist/ElementRowActions-BKfX2XRn.js +59 -0
  32. package/dist/ElementRowActions-BKfX2XRn.js.map +1 -0
  33. package/dist/ElementRowActions-B_rR7qSj.cjs +64 -0
  34. package/dist/ElementRowActions-B_rR7qSj.cjs.map +1 -0
  35. package/dist/ElementSelect-Cl5ZjuQM.js +65 -0
  36. package/dist/ElementSelect-Cl5ZjuQM.js.map +1 -0
  37. package/dist/ElementSelect-K1rRvu5q.cjs +70 -0
  38. package/dist/ElementSelect-K1rRvu5q.cjs.map +1 -0
  39. package/dist/assistant.cjs +301 -0
  40. package/dist/assistant.cjs.map +1 -0
  41. package/dist/assistant.d.cts +10 -0
  42. package/dist/assistant.d.cts.map +1 -0
  43. package/dist/assistant.d.ts +10 -0
  44. package/dist/assistant.d.ts.map +1 -0
  45. package/dist/assistant.js +297 -0
  46. package/dist/assistant.js.map +1 -0
  47. package/dist/batch-editing.cjs +4 -0
  48. package/dist/batch-editing.d.cts +2 -0
  49. package/dist/batch-editing.d.ts +2 -0
  50. package/dist/batch-editing.js +2 -0
  51. package/dist/bulk-actions.cjs +15 -0
  52. package/dist/bulk-actions.cjs.map +1 -0
  53. package/dist/bulk-actions.d.cts +6 -0
  54. package/dist/bulk-actions.d.cts.map +1 -0
  55. package/dist/bulk-actions.d.ts +6 -0
  56. package/dist/bulk-actions.d.ts.map +1 -0
  57. package/dist/bulk-actions.js +14 -0
  58. package/dist/bulk-actions.js.map +1 -0
  59. package/dist/button-BFjBL9m3.cjs +77 -0
  60. package/dist/button-BFjBL9m3.cjs.map +1 -0
  61. package/dist/button-DwB4UxI2.js +66 -0
  62. package/dist/button-DwB4UxI2.js.map +1 -0
  63. package/dist/cell-navigation-BXE28fwQ.cjs +85 -0
  64. package/dist/cell-navigation-BXE28fwQ.cjs.map +1 -0
  65. package/dist/cell-navigation-THnr6YdK.js +74 -0
  66. package/dist/cell-navigation-THnr6YdK.js.map +1 -0
  67. package/dist/cell-navigation.cjs +4 -0
  68. package/dist/cell-navigation.d.cts +9 -0
  69. package/dist/cell-navigation.d.cts.map +1 -0
  70. package/dist/cell-navigation.d.ts +9 -0
  71. package/dist/cell-navigation.d.ts.map +1 -0
  72. package/dist/cell-navigation.js +2 -0
  73. package/dist/cell-span.cjs +8 -0
  74. package/dist/cell-span.d.cts +2 -0
  75. package/dist/cell-span.d.ts +2 -0
  76. package/dist/cell-span.js +2 -0
  77. package/dist/checkbox-DhUYYwWe.cjs +26 -0
  78. package/dist/checkbox-DhUYYwWe.cjs.map +1 -0
  79. package/dist/classNamesContext-18Wbxy4F.js +2 -0
  80. package/dist/column-groups.cjs +8 -0
  81. package/dist/column-groups.d.cts +2 -0
  82. package/dist/column-groups.d.ts +2 -0
  83. package/dist/column-groups.js +2 -0
  84. package/dist/column-menu-C6gwlyUQ.js +115 -0
  85. package/dist/column-menu-C6gwlyUQ.js.map +1 -0
  86. package/dist/column-menu-CtaKQS3b.cjs +126 -0
  87. package/dist/column-menu-CtaKQS3b.cjs.map +1 -0
  88. package/dist/column-menu.cjs +4 -0
  89. package/dist/column-menu.d.cts +34 -0
  90. package/dist/column-menu.d.cts.map +1 -0
  91. package/dist/column-menu.d.ts +34 -0
  92. package/dist/column-menu.d.ts.map +1 -0
  93. package/dist/column-menu.js +2 -0
  94. package/dist/column-selection.cjs +3 -0
  95. package/dist/column-selection.d.cts +2 -0
  96. package/dist/column-selection.d.ts +2 -0
  97. package/dist/column-selection.js +2 -0
  98. package/dist/columns.cjs +26 -0
  99. package/dist/columns.d.cts +3 -0
  100. package/dist/columns.d.ts +3 -0
  101. package/dist/columns.js +2 -0
  102. package/dist/command-palette.cjs +43 -0
  103. package/dist/command-palette.cjs.map +1 -0
  104. package/dist/command-palette.d.cts +7 -0
  105. package/dist/command-palette.d.cts.map +1 -0
  106. package/dist/command-palette.d.ts +7 -0
  107. package/dist/command-palette.d.ts.map +1 -0
  108. package/dist/command-palette.js +42 -0
  109. package/dist/command-palette.js.map +1 -0
  110. package/dist/context-menu.cjs +34 -0
  111. package/dist/context-menu.cjs.map +1 -0
  112. package/dist/context-menu.d.cts +7 -0
  113. package/dist/context-menu.d.cts.map +1 -0
  114. package/dist/context-menu.d.ts +7 -0
  115. package/dist/context-menu.d.ts.map +1 -0
  116. package/dist/context-menu.js +33 -0
  117. package/dist/context-menu.js.map +1 -0
  118. package/dist/density-Bj1pck4x.cjs +82 -0
  119. package/dist/density-Bj1pck4x.cjs.map +1 -0
  120. package/dist/density-ChRp0NG3.js +77 -0
  121. package/dist/density-ChRp0NG3.js.map +1 -0
  122. package/dist/density.cjs +3 -0
  123. package/dist/density.d.cts +7 -0
  124. package/dist/density.d.cts.map +1 -0
  125. package/dist/density.d.ts +7 -0
  126. package/dist/density.d.ts.map +1 -0
  127. package/dist/density.js +2 -0
  128. package/dist/editing-BX-jUtdO.cjs +423 -0
  129. package/dist/editing-BX-jUtdO.cjs.map +1 -0
  130. package/dist/editing-BnLdNDlo.d.ts +60 -0
  131. package/dist/editing-BnLdNDlo.d.ts.map +1 -0
  132. package/dist/editing-C1Hy-MCQ.js +383 -0
  133. package/dist/editing-C1Hy-MCQ.js.map +1 -0
  134. package/dist/editing-Cg6ZNvSa.d.cts +60 -0
  135. package/dist/editing-Cg6ZNvSa.d.cts.map +1 -0
  136. package/dist/editing.cjs +22 -0
  137. package/dist/editing.d.cts +2 -0
  138. package/dist/editing.d.ts +2 -0
  139. package/dist/editing.js +2 -0
  140. package/dist/elementActionSlots-CbKE3WnM.js +8 -0
  141. package/dist/elementActionSlots-CbKE3WnM.js.map +1 -0
  142. package/dist/elementActionSlots-DlhU82H7.cjs +13 -0
  143. package/dist/elementActionSlots-DlhU82H7.cjs.map +1 -0
  144. package/dist/elementHierarchyControlSlots-Ctcmq3T2.js +21 -0
  145. package/dist/elementHierarchyControlSlots-Ctcmq3T2.js.map +1 -0
  146. package/dist/elementRemainingControls-BPGBbbUF.js +243 -0
  147. package/dist/elementRemainingControls-BPGBbbUF.js.map +1 -0
  148. package/dist/elementRemainingControls-CtY2jZWN.cjs +266 -0
  149. package/dist/elementRemainingControls-CtY2jZWN.cjs.map +1 -0
  150. package/dist/export-CL36qPVY.cjs +79 -0
  151. package/dist/export-CL36qPVY.cjs.map +1 -0
  152. package/dist/export-DR1t4N5Q.js +74 -0
  153. package/dist/export-DR1t4N5Q.js.map +1 -0
  154. package/dist/export.cjs +3 -0
  155. package/dist/export.d.cts +8 -0
  156. package/dist/export.d.cts.map +1 -0
  157. package/dist/export.d.ts +8 -0
  158. package/dist/export.d.ts.map +1 -0
  159. package/dist/export.js +2 -0
  160. package/dist/extra-rows.cjs +8 -0
  161. package/dist/extra-rows.d.cts +2 -0
  162. package/dist/extra-rows.d.ts +2 -0
  163. package/dist/extra-rows.js +2 -0
  164. package/dist/filters-C9_trRXw.js +191 -0
  165. package/dist/filters-C9_trRXw.js.map +1 -0
  166. package/dist/filters-DOlxNQqE.cjs +201 -0
  167. package/dist/filters-DOlxNQqE.cjs.map +1 -0
  168. package/dist/filters.cjs +14 -0
  169. package/dist/filters.d.cts +54 -0
  170. package/dist/filters.d.cts.map +1 -0
  171. package/dist/filters.d.ts +54 -0
  172. package/dist/filters.d.ts.map +1 -0
  173. package/dist/filters.js +3 -0
  174. package/dist/find-in-table--8ZBYijC.js +57 -0
  175. package/dist/find-in-table--8ZBYijC.js.map +1 -0
  176. package/dist/find-in-table-DOn2Hua1.cjs +61 -0
  177. package/dist/find-in-table-DOn2Hua1.cjs.map +1 -0
  178. package/dist/find-in-table.cjs +3 -0
  179. package/dist/find-in-table.d.cts +9 -0
  180. package/dist/find-in-table.d.cts.map +1 -0
  181. package/dist/find-in-table.d.ts +9 -0
  182. package/dist/find-in-table.d.ts.map +1 -0
  183. package/dist/find-in-table.js +2 -0
  184. package/dist/fit-columns.cjs +8 -0
  185. package/dist/fit-columns.d.cts +2 -0
  186. package/dist/fit-columns.d.ts +2 -0
  187. package/dist/fit-columns.js +2 -0
  188. package/dist/fullscreen.cjs +15 -0
  189. package/dist/fullscreen.cjs.map +1 -0
  190. package/dist/fullscreen.d.cts +6 -0
  191. package/dist/fullscreen.d.cts.map +1 -0
  192. package/dist/fullscreen.d.ts +6 -0
  193. package/dist/fullscreen.d.ts.map +1 -0
  194. package/dist/fullscreen.js +14 -0
  195. package/dist/fullscreen.js.map +1 -0
  196. package/dist/grouping-panel.cjs +144 -0
  197. package/dist/grouping-panel.cjs.map +1 -0
  198. package/dist/grouping-panel.d.cts +8 -0
  199. package/dist/grouping-panel.d.cts.map +1 -0
  200. package/dist/grouping-panel.d.ts +8 -0
  201. package/dist/grouping-panel.d.ts.map +1 -0
  202. package/dist/grouping-panel.js +144 -0
  203. package/dist/grouping-panel.js.map +1 -0
  204. package/dist/grouping.cjs +41 -0
  205. package/dist/grouping.cjs.map +1 -0
  206. package/dist/grouping.d.cts +10 -0
  207. package/dist/grouping.d.cts.map +1 -0
  208. package/dist/grouping.d.ts +10 -0
  209. package/dist/grouping.d.ts.map +1 -0
  210. package/dist/grouping.js +22 -0
  211. package/dist/grouping.js.map +1 -0
  212. package/dist/header-filters-Chknfchw.js +67 -0
  213. package/dist/header-filters-Chknfchw.js.map +1 -0
  214. package/dist/header-filters-D71v75Us.cjs +77 -0
  215. package/dist/header-filters-D71v75Us.cjs.map +1 -0
  216. package/dist/header-filters.cjs +7 -0
  217. package/dist/header-filters.d.cts +24 -0
  218. package/dist/header-filters.d.cts.map +1 -0
  219. package/dist/header-filters.d.ts +24 -0
  220. package/dist/header-filters.d.ts.map +1 -0
  221. package/dist/header-filters.js +3 -0
  222. package/dist/index.cjs +485 -0
  223. package/dist/index.cjs.map +1 -0
  224. package/dist/index.d.cts +25 -0
  225. package/dist/index.d.cts.map +1 -0
  226. package/dist/index.d.ts +25 -0
  227. package/dist/index.d.ts.map +1 -0
  228. package/dist/index.js +483 -0
  229. package/dist/index.js.map +1 -0
  230. package/dist/multi-sort.cjs +8 -0
  231. package/dist/multi-sort.d.cts +2 -0
  232. package/dist/multi-sort.d.ts +2 -0
  233. package/dist/multi-sort.js +2 -0
  234. package/dist/nested-table.cjs +8 -0
  235. package/dist/nested-table.d.cts +2 -0
  236. package/dist/nested-table.d.ts +2 -0
  237. package/dist/nested-table.js +2 -0
  238. package/dist/pinned-summary-rows.cjs +8 -0
  239. package/dist/pinned-summary-rows.d.cts +2 -0
  240. package/dist/pinned-summary-rows.d.ts +2 -0
  241. package/dist/pinned-summary-rows.js +2 -0
  242. package/dist/pivot.cjs +82 -0
  243. package/dist/pivot.cjs.map +1 -0
  244. package/dist/pivot.d.cts +11 -0
  245. package/dist/pivot.d.cts.map +1 -0
  246. package/dist/pivot.d.ts +11 -0
  247. package/dist/pivot.d.ts.map +1 -0
  248. package/dist/pivot.js +81 -0
  249. package/dist/pivot.js.map +1 -0
  250. package/dist/preset.cjs +40 -0
  251. package/dist/preset.cjs.map +1 -0
  252. package/dist/preset.d.cts +21 -0
  253. package/dist/preset.d.cts.map +1 -0
  254. package/dist/preset.d.ts +21 -0
  255. package/dist/preset.d.ts.map +1 -0
  256. package/dist/preset.js +38 -0
  257. package/dist/preset.js.map +1 -0
  258. package/dist/print.cjs +15 -0
  259. package/dist/print.cjs.map +1 -0
  260. package/dist/print.d.cts +6 -0
  261. package/dist/print.d.cts.map +1 -0
  262. package/dist/print.d.ts +6 -0
  263. package/dist/print.d.ts.map +1 -0
  264. package/dist/print.js +14 -0
  265. package/dist/print.js.map +1 -0
  266. package/dist/resizable-columns.cjs +8 -0
  267. package/dist/resizable-columns.d.cts +2 -0
  268. package/dist/resizable-columns.d.ts +2 -0
  269. package/dist/resizable-columns.js +2 -0
  270. package/dist/row-actions.cjs +15 -0
  271. package/dist/row-actions.cjs.map +1 -0
  272. package/dist/row-actions.d.cts +7 -0
  273. package/dist/row-actions.d.cts.map +1 -0
  274. package/dist/row-actions.d.ts +7 -0
  275. package/dist/row-actions.d.ts.map +1 -0
  276. package/dist/row-actions.js +14 -0
  277. package/dist/row-actions.js.map +1 -0
  278. package/dist/row-appearance.cjs +8 -0
  279. package/dist/row-appearance.d.cts +2 -0
  280. package/dist/row-appearance.d.ts +2 -0
  281. package/dist/row-appearance.js +2 -0
  282. package/dist/row-detail.cjs +28 -0
  283. package/dist/row-detail.d.cts +4 -0
  284. package/dist/row-detail.d.ts +4 -0
  285. package/dist/row-detail.js +4 -0
  286. package/dist/row-pinning.cjs +15 -0
  287. package/dist/row-pinning.cjs.map +1 -0
  288. package/dist/row-pinning.d.cts +8 -0
  289. package/dist/row-pinning.d.cts.map +1 -0
  290. package/dist/row-pinning.d.ts +8 -0
  291. package/dist/row-pinning.d.ts.map +1 -0
  292. package/dist/row-pinning.js +14 -0
  293. package/dist/row-pinning.js.map +1 -0
  294. package/dist/row-reorder.cjs +163 -0
  295. package/dist/row-reorder.cjs.map +1 -0
  296. package/dist/row-reorder.d.cts +6 -0
  297. package/dist/row-reorder.d.cts.map +1 -0
  298. package/dist/row-reorder.d.ts +6 -0
  299. package/dist/row-reorder.d.ts.map +1 -0
  300. package/dist/row-reorder.js +157 -0
  301. package/dist/row-reorder.js.map +1 -0
  302. package/dist/rowActionsSlot-CdnzwBmt.js +11 -0
  303. package/dist/rowActionsSlot-CdnzwBmt.js.map +1 -0
  304. package/dist/rowActionsSlot-Ps5hHI6n.cjs +21 -0
  305. package/dist/rowActionsSlot-Ps5hHI6n.cjs.map +1 -0
  306. package/dist/rows.cjs +30 -0
  307. package/dist/rows.d.cts +6 -0
  308. package/dist/rows.d.ts +6 -0
  309. package/dist/rows.js +4 -0
  310. package/dist/saved-views-BTJxWOyY.cjs +146 -0
  311. package/dist/saved-views-BTJxWOyY.cjs.map +1 -0
  312. package/dist/saved-views-DW8WybwV.js +135 -0
  313. package/dist/saved-views-DW8WybwV.js.map +1 -0
  314. package/dist/saved-views.cjs +4 -0
  315. package/dist/saved-views.d.cts +15 -0
  316. package/dist/saved-views.d.cts.map +1 -0
  317. package/dist/saved-views.d.ts +15 -0
  318. package/dist/saved-views.d.ts.map +1 -0
  319. package/dist/saved-views.js +2 -0
  320. package/dist/scrollbarGutter-B-QczwA9.cjs +21 -0
  321. package/dist/scrollbarGutter-B-QczwA9.cjs.map +1 -0
  322. package/dist/scrollbarGutter-BNp0-4l1.js +16 -0
  323. package/dist/scrollbarGutter-BNp0-4l1.js.map +1 -0
  324. package/dist/selection-stats.cjs +3 -0
  325. package/dist/selection-stats.d.cts +2 -0
  326. package/dist/selection-stats.d.ts +2 -0
  327. package/dist/selection-stats.js +2 -0
  328. package/dist/side-panel.cjs +29 -0
  329. package/dist/side-panel.cjs.map +1 -0
  330. package/dist/side-panel.d.cts +7 -0
  331. package/dist/side-panel.d.cts.map +1 -0
  332. package/dist/side-panel.d.ts +7 -0
  333. package/dist/side-panel.d.ts.map +1 -0
  334. package/dist/side-panel.js +28 -0
  335. package/dist/side-panel.js.map +1 -0
  336. package/dist/status-bar-C-XuZg77.cjs +78 -0
  337. package/dist/status-bar-C-XuZg77.cjs.map +1 -0
  338. package/dist/status-bar-DaWh0Agh.js +68 -0
  339. package/dist/status-bar-DaWh0Agh.js.map +1 -0
  340. package/dist/status-bar.cjs +4 -0
  341. package/dist/status-bar.d.cts +7 -0
  342. package/dist/status-bar.d.cts.map +1 -0
  343. package/dist/status-bar.d.ts +7 -0
  344. package/dist/status-bar.d.ts.map +1 -0
  345. package/dist/status-bar.js +2 -0
  346. package/dist/styles.css +434 -0
  347. package/dist/tree.cjs +21 -0
  348. package/dist/tree.d.cts +3 -0
  349. package/dist/tree.d.ts +3 -0
  350. package/dist/tree.js +3 -0
  351. package/dist/types-CLQKtnFl.d.cts +2 -0
  352. package/dist/types-CLQKtnFl.d.ts +2 -0
  353. package/dist/virtualize.cjs +8 -0
  354. package/dist/virtualize.d.cts +2 -0
  355. package/dist/virtualize.d.ts +2 -0
  356. package/dist/virtualize.js +2 -0
  357. package/package.json +465 -4
@@ -0,0 +1,243 @@
1
+ import { t as elementButton } from "./button-DwB4UxI2.js";
2
+ import { t as _sfc_main } from "./ElementInput-BsoAvPfO.js";
3
+ import { t as ElementCard } from "./ElementCard-DZdAU6x8.js";
4
+ import { defineComponent, h, nextTick, onScopeDispose, shallowRef, watch } from "vue";
5
+ import { managedCommandPaletteSurface, toVueAttrs, useScopeActivity } from "@adapttable/vue/adapter";
6
+ import { ElDialog, ElDivider, ElDropdown, ElDropdownItem, ElDropdownMenu } from "element-plus";
7
+ //#region src/actions/ElementCommandSurface.ts
8
+ /** ElDialog owns focus trapping, Escape and outside dismissal. */
9
+ const ElementCommandSurface = defineComponent((props) => {
10
+ const active = useScopeActivity();
11
+ const body = shallowRef(null);
12
+ return () => {
13
+ const owner = props.control;
14
+ return h(ElDialog, {
15
+ modelValue: active.value && owner.open && owner.isCurrent(),
16
+ title: owner.label,
17
+ class: owner.className,
18
+ dir: props.dir,
19
+ appendTo: props.container ?? "body",
20
+ appendToBody: true,
21
+ width: "min(32rem, calc(100vw - 2rem))",
22
+ destroyOnClose: true,
23
+ showClose: false,
24
+ closeOnClickModal: true,
25
+ closeOnPressEscape: true,
26
+ beforeClose: () => {
27
+ if (active.value && owner.isCurrent()) owner.onClose();
28
+ }
29
+ }, { default: () => h("div", {
30
+ ref: body,
31
+ "data-adapttable-part": "command-palette"
32
+ }, [owner.children]) });
33
+ };
34
+ }, {
35
+ name: "ElementCommandSurface",
36
+ props: {
37
+ control: { type: Object },
38
+ container: { type: Object },
39
+ dir: { type: String }
40
+ }
41
+ });
42
+ //#endregion
43
+ //#region src/actions/ElementContextSurface.ts
44
+ /** The public dropdown API synchronizes the primitive with the binding's open session. */
45
+ const ElementContextSurface = defineComponent((props) => {
46
+ const active = useScopeActivity();
47
+ const control = shallowRef();
48
+ let live = true;
49
+ let generation = 0;
50
+ onScopeDispose(() => {
51
+ live = false;
52
+ generation++;
53
+ });
54
+ const virtualAnchor = {
55
+ getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),
56
+ get contextElement() {
57
+ return props.anchorRef.current ?? void 0;
58
+ }
59
+ };
60
+ watch([active, () => props.at], () => {
61
+ generation++;
62
+ }, {
63
+ flush: "sync",
64
+ immediate: true
65
+ });
66
+ watch([
67
+ active,
68
+ control,
69
+ () => props.at
70
+ ], () => {
71
+ const ticket = generation;
72
+ nextTick(() => {
73
+ if (live && active.value && ticket === generation) control.value?.handleOpen();
74
+ else if (!active.value) control.value?.handleClose();
75
+ });
76
+ }, {
77
+ flush: "post",
78
+ immediate: true
79
+ });
80
+ return () => {
81
+ if (!active.value) return null;
82
+ const at = props.at;
83
+ const ticket = generation;
84
+ const onClose = props.onClose;
85
+ const isCurrent = () => live && active.value && ticket === generation && props.at === at && props.onClose === onClose;
86
+ return h(ElDropdown, {
87
+ ref: control,
88
+ virtualTriggering: true,
89
+ virtualRef: virtualAnchor,
90
+ trigger: "contextmenu",
91
+ role: "menu",
92
+ showTimeout: 0,
93
+ hideTimeout: 0,
94
+ hideOnClick: false,
95
+ placement: "bottom-start",
96
+ appendTo: props.container ?? "body",
97
+ teleported: true,
98
+ persistent: false,
99
+ showArrow: false,
100
+ maxHeight: "min(70vh, 32rem)",
101
+ popperStyle: { maxWidth: "calc(100vw - 1rem)" },
102
+ onVisibleChange: (visible) => {
103
+ if (visible || !isCurrent()) return;
104
+ onClose();
105
+ nextTick(() => {
106
+ if (isCurrent()) control.value?.handleOpen();
107
+ });
108
+ }
109
+ }, { dropdown: () => h(ElDropdownMenu, {
110
+ "aria-label": props.label,
111
+ class: props.className,
112
+ dir: props.dir,
113
+ "data-adapttable-part": "context-menu",
114
+ onKeydown: (event) => {
115
+ if (!isCurrent() || event.key !== "Escape" || event.defaultPrevented || event.isComposing || !(event.target instanceof Element) || event.target.closest("[role=\"menu\"]") !== event.currentTarget) return;
116
+ event.preventDefault();
117
+ event.stopPropagation();
118
+ control.value?.handleClose();
119
+ },
120
+ onFocus: (event) => {
121
+ if (!isCurrent() || event.target !== event.currentTarget || !(event.currentTarget instanceof HTMLElement)) return;
122
+ event.currentTarget.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus();
123
+ }
124
+ }, { default: () => props.children }) });
125
+ };
126
+ }, {
127
+ name: "ElementContextSurface",
128
+ props: {
129
+ at: { type: Object },
130
+ anchorRef: { type: Object },
131
+ label: { type: String },
132
+ onClose: { type: Function },
133
+ container: { type: Object },
134
+ children: {
135
+ type: [
136
+ String,
137
+ Number,
138
+ Boolean,
139
+ Array,
140
+ Object
141
+ ],
142
+ default: void 0
143
+ },
144
+ className: { type: String },
145
+ dir: { type: String }
146
+ }
147
+ });
148
+ //#endregion
149
+ //#region src/actions/elementRemainingControls.ts
150
+ const elementActionButton = ({ attrs, label, icon }) => elementButton(attrs, [icon, label]);
151
+ const elementPaletteSlots = (names = () => ({}), container = () => void 0, dir = () => void 0) => ({
152
+ Surface: managedCommandPaletteSurface((control) => h(ElementCommandSurface, {
153
+ control,
154
+ container: container(),
155
+ dir: dir()
156
+ })),
157
+ Input: ({ inputProps }) => {
158
+ const { onChange, ref, value, ...attrs } = inputProps;
159
+ return h(_sfc_main, {
160
+ ...toVueAttrs(attrs),
161
+ value,
162
+ inputRef: (element) => {
163
+ if (element instanceof HTMLInputElement || element === null) ref(element);
164
+ },
165
+ class: names().commandInput,
166
+ onChange
167
+ });
168
+ },
169
+ Item: ({ command, itemProps }) => elementButton({
170
+ ...toVueAttrs(itemProps),
171
+ class: names().commandItem,
172
+ type: "button",
173
+ tabindex: -1,
174
+ disabled: command.disabled
175
+ }, command.label),
176
+ Empty: ({ message }) => h("p", {
177
+ "data-adapttable-part": "command-empty",
178
+ class: names().commandEmpty
179
+ }, message)
180
+ });
181
+ const elementContextMenuSlots = (names = () => ({}), dir = () => void 0) => ({
182
+ Surface: (props) => h(ElementContextSurface, {
183
+ ...props,
184
+ dir: dir()
185
+ }),
186
+ Item: ({ item, onSelect }) => h(ElDropdownItem, {
187
+ disabled: item.disabled,
188
+ textValue: item.label,
189
+ "aria-disabled": item.disabled,
190
+ "data-danger": item.danger ? "" : void 0,
191
+ "data-adapttable-part": "context-menu-item",
192
+ class: names().contextMenuItem,
193
+ onClick: onSelect
194
+ }, { default: () => item.label }),
195
+ Separator: () => h(ElDivider, {
196
+ role: "separator",
197
+ "data-adapttable-part": "context-menu-separator",
198
+ class: names().contextMenuSeparator
199
+ })
200
+ });
201
+ const elementSidePanelSlots = (names = () => ({})) => {
202
+ let closeChoice;
203
+ return {
204
+ Frame: (props) => {
205
+ const close = closeChoice;
206
+ return h(ElementCard, { attrs: {
207
+ "data-adapttable-part": "side-panel",
208
+ class: props.className,
209
+ "data-side": props.side,
210
+ style: {
211
+ minWidth: "min(18rem,100%)",
212
+ maxWidth: "100%"
213
+ },
214
+ onKeydownCapture: (event) => {
215
+ const target = event.target;
216
+ if (event.key === "Escape" && !event.defaultPrevented && !event.isComposing && target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false" && !target.closest("[role=\"dialog\"],[role=\"menu\"]")) {
217
+ event.preventDefault();
218
+ event.stopPropagation();
219
+ close?.();
220
+ }
221
+ }
222
+ } }, { default: () => props.children });
223
+ },
224
+ Tab: (props) => elementButton({
225
+ ...toVueAttrs(props.buttonProps),
226
+ class: names().sidePanelTab
227
+ }, props.panel.label),
228
+ Close: (props) => {
229
+ closeChoice = props.onClose;
230
+ return elementButton({
231
+ type: "button",
232
+ "aria-label": props.label,
233
+ "data-adapttable-part": "side-panel-close",
234
+ class: names().sidePanelClose,
235
+ onClick: props.onClose
236
+ }, props.label);
237
+ }
238
+ };
239
+ };
240
+ //#endregion
241
+ export { elementSidePanelSlots as i, elementContextMenuSlots as n, elementPaletteSlots as r, elementActionButton as t };
242
+
243
+ //# sourceMappingURL=elementRemainingControls-BPGBbbUF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementRemainingControls-BPGBbbUF.js","names":["ElementInput"],"sources":["../src/actions/ElementCommandSurface.ts","../src/actions/ElementContextSurface.ts","../src/actions/elementRemainingControls.ts"],"sourcesContent":["import {\n type ManagedCommandPaletteSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDialog } from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef } from \"vue\";\n/** ElDialog owns focus trapping, Escape and outside dismissal. */\nexport const ElementCommandSurface = defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir?: \"ltr\" | \"rtl\";\n }) => {\n const active = useScopeActivity();\n const body = shallowRef<HTMLElement | null>(null);\n return () => {\n const owner = props.control;\n return h(\n ElDialog,\n {\n modelValue: active.value && owner.open && owner.isCurrent(),\n title: owner.label,\n class: owner.className,\n dir: props.dir,\n appendTo: props.container ?? \"body\",\n appendToBody: true,\n width: \"min(32rem, calc(100vw - 2rem))\",\n destroyOnClose: true,\n showClose: false,\n closeOnClickModal: true,\n closeOnPressEscape: true,\n beforeClose: () => {\n if (active.value && owner.isCurrent()) owner.onClose();\n },\n },\n {\n default: () =>\n h(\"div\", { ref: body, \"data-adapttable-part\": \"command-palette\" }, [\n owner.children,\n ]),\n }\n );\n };\n },\n {\n name: \"ElementCommandSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<(\"ltr\" | \"rtl\") | undefined> },\n },\n }\n);\n","import {\n type ContextMenuSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownMenu,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onScopeDispose,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n/** The public dropdown API synchronizes the primitive with the binding's open session. */\nexport const ElementContextSurface = defineComponent(\n (\n props: ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n }\n ) => {\n const active = useScopeActivity();\n const control = shallowRef<DropdownInstance>();\n let live = true;\n let generation = 0;\n onScopeDispose(() => {\n live = false;\n generation++;\n });\n const virtualAnchor = {\n getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),\n get contextElement() {\n return props.anchorRef.current ?? undefined;\n },\n };\n watch(\n [active, () => props.at],\n () => {\n generation++;\n },\n { flush: \"sync\", immediate: true }\n );\n watch(\n [active, control, () => props.at],\n () => {\n const ticket = generation;\n void nextTick(() => {\n if (live && active.value && ticket === generation)\n control.value?.handleOpen();\n else if (!active.value) control.value?.handleClose();\n });\n },\n { flush: \"post\", immediate: true }\n );\n return () => {\n if (!active.value) return null;\n const at = props.at;\n const ticket = generation;\n const onClose = props.onClose;\n const isCurrent = () =>\n live &&\n active.value &&\n ticket === generation &&\n props.at === at &&\n props.onClose === onClose;\n return h(\n ElDropdown,\n {\n ref: control,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"contextmenu\",\n role: \"menu\",\n showTimeout: 0,\n hideTimeout: 0,\n hideOnClick: false,\n placement: \"bottom-start\",\n appendTo: props.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n maxHeight: \"min(70vh, 32rem)\",\n popperStyle: { maxWidth: \"calc(100vw - 1rem)\" },\n onVisibleChange: (visible: boolean) => {\n if (visible || !isCurrent()) return;\n onClose();\n // A rejected controlled close keeps the same native session open.\n void nextTick(() => {\n if (isCurrent()) control.value?.handleOpen();\n });\n },\n },\n {\n dropdown: () =>\n h(\n ElDropdownMenu,\n {\n \"aria-label\": props.label,\n class: props.className,\n dir: props.dir,\n \"data-adapttable-part\": \"context-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (\n !isCurrent() ||\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !==\n event.currentTarget\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n control.value?.handleClose();\n },\n onFocus: (event: FocusEvent) => {\n if (\n !isCurrent() ||\n event.target !== event.currentTarget ||\n !(event.currentTarget instanceof HTMLElement)\n )\n return;\n event.currentTarget\n .querySelector<HTMLElement>(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ?.focus();\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"ElementContextSurface\",\n props: {\n at: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"at\"]\n >,\n },\n anchorRef: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"label\"]\n >,\n },\n onClose: {\n type: Function as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"className\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"dir\"]\n >,\n },\n },\n }\n);\n","import {\n type ActionButton,\n type CommandPaletteSlots,\n type ContextMenuSlots,\n managedCommandPaletteSurface,\n type SidePanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { ElDivider, ElDropdownItem } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementCommandSurface } from \"./ElementCommandSurface\";\nimport { ElementContextSurface } from \"./ElementContextSurface\";\nexport const elementActionButton = ({ attrs, label, icon }: ActionButton) =>\n elementButton(attrs, [icon, label]);\nexport const elementPaletteSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n container: () => HTMLElement | undefined = () => undefined,\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): CommandPaletteSlots => ({\n Surface: managedCommandPaletteSurface((control) =>\n h(ElementCommandSurface, { control, container: container(), dir: dir() })\n ),\n Input: ({ inputProps }) => {\n const { onChange, ref, value, ...attrs } = inputProps;\n return h(ElementInput, {\n ...toVueAttrs(attrs),\n value,\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n ref(element);\n },\n class: names().commandInput,\n onChange,\n });\n },\n Item: ({ command, itemProps }) =>\n elementButton(\n {\n ...toVueAttrs(itemProps),\n class: names().commandItem,\n type: \"button\",\n tabindex: -1,\n disabled: command.disabled,\n },\n command.label\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n { \"data-adapttable-part\": \"command-empty\", class: names().commandEmpty },\n message\n ),\n});\nexport const elementContextMenuSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): ContextMenuSlots => ({\n Surface: (props) => h(ElementContextSurface, { ...props, dir: dir() }),\n Item: ({ item, onSelect }) =>\n h(\n ElDropdownItem,\n {\n disabled: item.disabled,\n textValue: item.label,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names().contextMenuItem,\n onClick: onSelect,\n },\n { default: () => item.label }\n ),\n Separator: () =>\n h(ElDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names().contextMenuSeparator,\n }),\n});\nexport const elementSidePanelSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({})\n): SidePanelSlots => {\n let closeChoice: (() => void) | undefined;\n return {\n Frame: (props) => {\n const close = closeChoice;\n return h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n onKeydownCapture: (event: KeyboardEvent) => {\n const target = event.target;\n // ElSelect stops Escape even while closed; forward that case to the\n // binding's current close callback before the native event is consumed.\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\" &&\n !target.closest('[role=\"dialog\"],[role=\"menu\"]')\n ) {\n event.preventDefault();\n event.stopPropagation();\n close?.();\n }\n },\n },\n },\n { default: () => props.children }\n );\n },\n Tab: (props) =>\n elementButton(\n { ...toVueAttrs(props.buttonProps), class: names().sidePanelTab },\n props.panel.label\n ),\n Close: (props) => {\n closeChoice = props.onClose;\n return elementButton(\n {\n type: \"button\",\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names().sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n );\n },\n };\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,wBAAwB,iBAClC,UAIK;CACJ,MAAM,SAAS,iBAAiB;CAChC,MAAM,OAAO,WAA+B,IAAI;CAChD,aAAa;EACX,MAAM,QAAQ,MAAM;EACpB,OAAO,EACL,UACA;GACE,YAAY,OAAO,SAAS,MAAM,QAAQ,MAAM,UAAU;GAC1D,OAAO,MAAM;GACb,OAAO,MAAM;GACb,KAAK,MAAM;GACX,UAAU,MAAM,aAAa;GAC7B,cAAc;GACd,OAAO;GACP,gBAAgB;GAChB,WAAW;GACX,mBAAmB;GACnB,oBAAoB;G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AQ,UAAU;GAChB,MAAM,QAAQ;GACd,OAAO,EACL,aACA,EACE,OAAO;IACL,wBAAwB;IACxB,OAAO,MAAM;IACb,aAAa,MAAM;IACnB,OAAO;KAAE,UAAU;KAAmB,UAAU;IAAO;IACvD,mBAAmB,UAAyB;KAC1C,MAAM,SAAS,MAAM;KAGrB,IACE,MAAM,QAAQ,YACd,CAAC,MAAM,oBACP,CAAC,MAAM,eACP,kBAAkB,WAClB,OAAO,aAAa,MAAM,MAAM,cAChC,OAAO,aAAa,eAAe,MAAM,WACzC,CAAC,OAAO,QAAQ,mCAA+B,GAC/C;MACA,MAAM,eAAe;MACrB,MAAM,gBAAgB;MACtB,QAAQ;KACV;IACF;GACF,EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;EACF;EACA,MAAM,UACJ,cACE;GAAE,GAAG,WAAW,MAAM,WAAW;GAAG,OAAO,MAAM,CAAC,CAAC;EAAa,GAChE,MAAM,MAAM,KACd;EACF,QAAQ,UAAU;GAChB,cAAc,MAAM;GACpB,OAAO,cACL;IACE,MAAM;IACN,cAAc,MAAM;IACpB,wBAAwB;IACxB,OAAO,MAAM,CAAC,CAAC;IACf,SAAS,MAAM;GACjB,GACA,MAAM,KACR;EACF;CACF;AACF"}
@@ -0,0 +1,266 @@
1
+ const require_button = require("./button-BFjBL9m3.cjs");
2
+ const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
3
+ const require_ElementCard = require("./ElementCard-BRZekaHr.cjs");
4
+ let vue = require("vue");
5
+ let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
6
+ let element_plus = require("element-plus");
7
+ //#region src/actions/ElementCommandSurface.ts
8
+ /** ElDialog owns focus trapping, Escape and outside dismissal. */
9
+ const ElementCommandSurface = (0, vue.defineComponent)((props) => {
10
+ const active = (0, _adapttable_vue_adapter.useScopeActivity)();
11
+ const body = (0, vue.shallowRef)(null);
12
+ return () => {
13
+ const owner = props.control;
14
+ return (0, vue.h)(element_plus.ElDialog, {
15
+ modelValue: active.value && owner.open && owner.isCurrent(),
16
+ title: owner.label,
17
+ class: owner.className,
18
+ dir: props.dir,
19
+ appendTo: props.container ?? "body",
20
+ appendToBody: true,
21
+ width: "min(32rem, calc(100vw - 2rem))",
22
+ destroyOnClose: true,
23
+ showClose: false,
24
+ closeOnClickModal: true,
25
+ closeOnPressEscape: true,
26
+ beforeClose: () => {
27
+ if (active.value && owner.isCurrent()) owner.onClose();
28
+ }
29
+ }, { default: () => (0, vue.h)("div", {
30
+ ref: body,
31
+ "data-adapttable-part": "command-palette"
32
+ }, [owner.children]) });
33
+ };
34
+ }, {
35
+ name: "ElementCommandSurface",
36
+ props: {
37
+ control: { type: Object },
38
+ container: { type: Object },
39
+ dir: { type: String }
40
+ }
41
+ });
42
+ //#endregion
43
+ //#region src/actions/ElementContextSurface.ts
44
+ /** The public dropdown API synchronizes the primitive with the binding's open session. */
45
+ const ElementContextSurface = (0, vue.defineComponent)((props) => {
46
+ const active = (0, _adapttable_vue_adapter.useScopeActivity)();
47
+ const control = (0, vue.shallowRef)();
48
+ let live = true;
49
+ let generation = 0;
50
+ (0, vue.onScopeDispose)(() => {
51
+ live = false;
52
+ generation++;
53
+ });
54
+ const virtualAnchor = {
55
+ getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),
56
+ get contextElement() {
57
+ return props.anchorRef.current ?? void 0;
58
+ }
59
+ };
60
+ (0, vue.watch)([active, () => props.at], () => {
61
+ generation++;
62
+ }, {
63
+ flush: "sync",
64
+ immediate: true
65
+ });
66
+ (0, vue.watch)([
67
+ active,
68
+ control,
69
+ () => props.at
70
+ ], () => {
71
+ const ticket = generation;
72
+ (0, vue.nextTick)(() => {
73
+ if (live && active.value && ticket === generation) control.value?.handleOpen();
74
+ else if (!active.value) control.value?.handleClose();
75
+ });
76
+ }, {
77
+ flush: "post",
78
+ immediate: true
79
+ });
80
+ return () => {
81
+ if (!active.value) return null;
82
+ const at = props.at;
83
+ const ticket = generation;
84
+ const onClose = props.onClose;
85
+ const isCurrent = () => live && active.value && ticket === generation && props.at === at && props.onClose === onClose;
86
+ return (0, vue.h)(element_plus.ElDropdown, {
87
+ ref: control,
88
+ virtualTriggering: true,
89
+ virtualRef: virtualAnchor,
90
+ trigger: "contextmenu",
91
+ role: "menu",
92
+ showTimeout: 0,
93
+ hideTimeout: 0,
94
+ hideOnClick: false,
95
+ placement: "bottom-start",
96
+ appendTo: props.container ?? "body",
97
+ teleported: true,
98
+ persistent: false,
99
+ showArrow: false,
100
+ maxHeight: "min(70vh, 32rem)",
101
+ popperStyle: { maxWidth: "calc(100vw - 1rem)" },
102
+ onVisibleChange: (visible) => {
103
+ if (visible || !isCurrent()) return;
104
+ onClose();
105
+ (0, vue.nextTick)(() => {
106
+ if (isCurrent()) control.value?.handleOpen();
107
+ });
108
+ }
109
+ }, { dropdown: () => (0, vue.h)(element_plus.ElDropdownMenu, {
110
+ "aria-label": props.label,
111
+ class: props.className,
112
+ dir: props.dir,
113
+ "data-adapttable-part": "context-menu",
114
+ onKeydown: (event) => {
115
+ if (!isCurrent() || event.key !== "Escape" || event.defaultPrevented || event.isComposing || !(event.target instanceof Element) || event.target.closest("[role=\"menu\"]") !== event.currentTarget) return;
116
+ event.preventDefault();
117
+ event.stopPropagation();
118
+ control.value?.handleClose();
119
+ },
120
+ onFocus: (event) => {
121
+ if (!isCurrent() || event.target !== event.currentTarget || !(event.currentTarget instanceof HTMLElement)) return;
122
+ event.currentTarget.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus();
123
+ }
124
+ }, { default: () => props.children }) });
125
+ };
126
+ }, {
127
+ name: "ElementContextSurface",
128
+ props: {
129
+ at: { type: Object },
130
+ anchorRef: { type: Object },
131
+ label: { type: String },
132
+ onClose: { type: Function },
133
+ container: { type: Object },
134
+ children: {
135
+ type: [
136
+ String,
137
+ Number,
138
+ Boolean,
139
+ Array,
140
+ Object
141
+ ],
142
+ default: void 0
143
+ },
144
+ className: { type: String },
145
+ dir: { type: String }
146
+ }
147
+ });
148
+ //#endregion
149
+ //#region src/actions/elementRemainingControls.ts
150
+ const elementActionButton = ({ attrs, label, icon }) => require_button.elementButton(attrs, [icon, label]);
151
+ const elementPaletteSlots = (names = () => ({}), container = () => void 0, dir = () => void 0) => ({
152
+ Surface: (0, _adapttable_vue_adapter.managedCommandPaletteSurface)((control) => (0, vue.h)(ElementCommandSurface, {
153
+ control,
154
+ container: container(),
155
+ dir: dir()
156
+ })),
157
+ Input: ({ inputProps }) => {
158
+ const { onChange, ref, value, ...attrs } = inputProps;
159
+ return (0, vue.h)(require_ElementInput._sfc_main, {
160
+ ...(0, _adapttable_vue_adapter.toVueAttrs)(attrs),
161
+ value,
162
+ inputRef: (element) => {
163
+ if (element instanceof HTMLInputElement || element === null) ref(element);
164
+ },
165
+ class: names().commandInput,
166
+ onChange
167
+ });
168
+ },
169
+ Item: ({ command, itemProps }) => require_button.elementButton({
170
+ ...(0, _adapttable_vue_adapter.toVueAttrs)(itemProps),
171
+ class: names().commandItem,
172
+ type: "button",
173
+ tabindex: -1,
174
+ disabled: command.disabled
175
+ }, command.label),
176
+ Empty: ({ message }) => (0, vue.h)("p", {
177
+ "data-adapttable-part": "command-empty",
178
+ class: names().commandEmpty
179
+ }, message)
180
+ });
181
+ const elementContextMenuSlots = (names = () => ({}), dir = () => void 0) => ({
182
+ Surface: (props) => (0, vue.h)(ElementContextSurface, {
183
+ ...props,
184
+ dir: dir()
185
+ }),
186
+ Item: ({ item, onSelect }) => (0, vue.h)(element_plus.ElDropdownItem, {
187
+ disabled: item.disabled,
188
+ textValue: item.label,
189
+ "aria-disabled": item.disabled,
190
+ "data-danger": item.danger ? "" : void 0,
191
+ "data-adapttable-part": "context-menu-item",
192
+ class: names().contextMenuItem,
193
+ onClick: onSelect
194
+ }, { default: () => item.label }),
195
+ Separator: () => (0, vue.h)(element_plus.ElDivider, {
196
+ role: "separator",
197
+ "data-adapttable-part": "context-menu-separator",
198
+ class: names().contextMenuSeparator
199
+ })
200
+ });
201
+ const elementSidePanelSlots = (names = () => ({})) => {
202
+ let closeChoice;
203
+ return {
204
+ Frame: (props) => {
205
+ const close = closeChoice;
206
+ return (0, vue.h)(require_ElementCard.ElementCard, { attrs: {
207
+ "data-adapttable-part": "side-panel",
208
+ class: props.className,
209
+ "data-side": props.side,
210
+ style: {
211
+ minWidth: "min(18rem,100%)",
212
+ maxWidth: "100%"
213
+ },
214
+ onKeydownCapture: (event) => {
215
+ const target = event.target;
216
+ if (event.key === "Escape" && !event.defaultPrevented && !event.isComposing && target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false" && !target.closest("[role=\"dialog\"],[role=\"menu\"]")) {
217
+ event.preventDefault();
218
+ event.stopPropagation();
219
+ close?.();
220
+ }
221
+ }
222
+ } }, { default: () => props.children });
223
+ },
224
+ Tab: (props) => require_button.elementButton({
225
+ ...(0, _adapttable_vue_adapter.toVueAttrs)(props.buttonProps),
226
+ class: names().sidePanelTab
227
+ }, props.panel.label),
228
+ Close: (props) => {
229
+ closeChoice = props.onClose;
230
+ return require_button.elementButton({
231
+ type: "button",
232
+ "aria-label": props.label,
233
+ "data-adapttable-part": "side-panel-close",
234
+ class: names().sidePanelClose,
235
+ onClick: props.onClose
236
+ }, props.label);
237
+ }
238
+ };
239
+ };
240
+ //#endregion
241
+ Object.defineProperty(exports, "elementActionButton", {
242
+ enumerable: true,
243
+ get: function() {
244
+ return elementActionButton;
245
+ }
246
+ });
247
+ Object.defineProperty(exports, "elementContextMenuSlots", {
248
+ enumerable: true,
249
+ get: function() {
250
+ return elementContextMenuSlots;
251
+ }
252
+ });
253
+ Object.defineProperty(exports, "elementPaletteSlots", {
254
+ enumerable: true,
255
+ get: function() {
256
+ return elementPaletteSlots;
257
+ }
258
+ });
259
+ Object.defineProperty(exports, "elementSidePanelSlots", {
260
+ enumerable: true,
261
+ get: function() {
262
+ return elementSidePanelSlots;
263
+ }
264
+ });
265
+
266
+ //# sourceMappingURL=elementRemainingControls-CtY2jZWN.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementRemainingControls-CtY2jZWN.cjs","names":["defineComponent","useScopeActivity","shallowRef","h","ElDialog","defineComponent","useScopeActivity","shallowRef","nextTick","h","ElDropdown","ElDropdownMenu","elementButton","managedCommandPaletteSurface","h","ElementInput","toVueAttrs","ElDropdownItem","ElDivider","ElementCard"],"sources":["../src/actions/ElementCommandSurface.ts","../src/actions/ElementContextSurface.ts","../src/actions/elementRemainingControls.ts"],"sourcesContent":["import {\n type ManagedCommandPaletteSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDialog } from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef } from \"vue\";\n/** ElDialog owns focus trapping, Escape and outside dismissal. */\nexport const ElementCommandSurface = defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir?: \"ltr\" | \"rtl\";\n }) => {\n const active = useScopeActivity();\n const body = shallowRef<HTMLElement | null>(null);\n return () => {\n const owner = props.control;\n return h(\n ElDialog,\n {\n modelValue: active.value && owner.open && owner.isCurrent(),\n title: owner.label,\n class: owner.className,\n dir: props.dir,\n appendTo: props.container ?? \"body\",\n appendToBody: true,\n width: \"min(32rem, calc(100vw - 2rem))\",\n destroyOnClose: true,\n showClose: false,\n closeOnClickModal: true,\n closeOnPressEscape: true,\n beforeClose: () => {\n if (active.value && owner.isCurrent()) owner.onClose();\n },\n },\n {\n default: () =>\n h(\"div\", { ref: body, \"data-adapttable-part\": \"command-palette\" }, [\n owner.children,\n ]),\n }\n );\n };\n },\n {\n name: \"ElementCommandSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<(\"ltr\" | \"rtl\") | undefined> },\n },\n }\n);\n","import {\n type ContextMenuSurfaceProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownMenu,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onScopeDispose,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n/** The public dropdown API synchronizes the primitive with the binding's open session. */\nexport const ElementContextSurface = defineComponent(\n (\n props: ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n }\n ) => {\n const active = useScopeActivity();\n const control = shallowRef<DropdownInstance>();\n let live = true;\n let generation = 0;\n onScopeDispose(() => {\n live = false;\n generation++;\n });\n const virtualAnchor = {\n getBoundingClientRect: () => new DOMRect(props.at.x, props.at.y, 0, 0),\n get contextElement() {\n return props.anchorRef.current ?? undefined;\n },\n };\n watch(\n [active, () => props.at],\n () => {\n generation++;\n },\n { flush: \"sync\", immediate: true }\n );\n watch(\n [active, control, () => props.at],\n () => {\n const ticket = generation;\n void nextTick(() => {\n if (live && active.value && ticket === generation)\n control.value?.handleOpen();\n else if (!active.value) control.value?.handleClose();\n });\n },\n { flush: \"post\", immediate: true }\n );\n return () => {\n if (!active.value) return null;\n const at = props.at;\n const ticket = generation;\n const onClose = props.onClose;\n const isCurrent = () =>\n live &&\n active.value &&\n ticket === generation &&\n props.at === at &&\n props.onClose === onClose;\n return h(\n ElDropdown,\n {\n ref: control,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"contextmenu\",\n role: \"menu\",\n showTimeout: 0,\n hideTimeout: 0,\n hideOnClick: false,\n placement: \"bottom-start\",\n appendTo: props.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n maxHeight: \"min(70vh, 32rem)\",\n popperStyle: { maxWidth: \"calc(100vw - 1rem)\" },\n onVisibleChange: (visible: boolean) => {\n if (visible || !isCurrent()) return;\n onClose();\n // A rejected controlled close keeps the same native session open.\n void nextTick(() => {\n if (isCurrent()) control.value?.handleOpen();\n });\n },\n },\n {\n dropdown: () =>\n h(\n ElDropdownMenu,\n {\n \"aria-label\": props.label,\n class: props.className,\n dir: props.dir,\n \"data-adapttable-part\": \"context-menu\",\n onKeydown: (event: KeyboardEvent) => {\n if (\n !isCurrent() ||\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !==\n event.currentTarget\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n control.value?.handleClose();\n },\n onFocus: (event: FocusEvent) => {\n if (\n !isCurrent() ||\n event.target !== event.currentTarget ||\n !(event.currentTarget instanceof HTMLElement)\n )\n return;\n event.currentTarget\n .querySelector<HTMLElement>(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ?.focus();\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"ElementContextSurface\",\n props: {\n at: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"at\"]\n >,\n },\n anchorRef: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"label\"]\n >,\n },\n onClose: {\n type: Function as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"className\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ContextMenuSurfaceProps<VNodeChild> & {\n readonly dir?: \"ltr\" | \"rtl\";\n })[\"dir\"]\n >,\n },\n },\n }\n);\n","import {\n type ActionButton,\n type CommandPaletteSlots,\n type ContextMenuSlots,\n managedCommandPaletteSurface,\n type SidePanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { ElDivider, ElDropdownItem } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementCommandSurface } from \"./ElementCommandSurface\";\nimport { ElementContextSurface } from \"./ElementContextSurface\";\nexport const elementActionButton = ({ attrs, label, icon }: ActionButton) =>\n elementButton(attrs, [icon, label]);\nexport const elementPaletteSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n container: () => HTMLElement | undefined = () => undefined,\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): CommandPaletteSlots => ({\n Surface: managedCommandPaletteSurface((control) =>\n h(ElementCommandSurface, { control, container: container(), dir: dir() })\n ),\n Input: ({ inputProps }) => {\n const { onChange, ref, value, ...attrs } = inputProps;\n return h(ElementInput, {\n ...toVueAttrs(attrs),\n value,\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n ref(element);\n },\n class: names().commandInput,\n onChange,\n });\n },\n Item: ({ command, itemProps }) =>\n elementButton(\n {\n ...toVueAttrs(itemProps),\n class: names().commandItem,\n type: \"button\",\n tabindex: -1,\n disabled: command.disabled,\n },\n command.label\n ),\n Empty: ({ message }) =>\n h(\n \"p\",\n { \"data-adapttable-part\": \"command-empty\", class: names().commandEmpty },\n message\n ),\n});\nexport const elementContextMenuSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({}),\n dir: () => \"ltr\" | \"rtl\" | undefined = () => undefined\n): ContextMenuSlots => ({\n Surface: (props) => h(ElementContextSurface, { ...props, dir: dir() }),\n Item: ({ item, onSelect }) =>\n h(\n ElDropdownItem,\n {\n disabled: item.disabled,\n textValue: item.label,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names().contextMenuItem,\n onClick: onSelect,\n },\n { default: () => item.label }\n ),\n Separator: () =>\n h(ElDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names().contextMenuSeparator,\n }),\n});\nexport const elementSidePanelSlots = (\n names: () => Readonly<Record<string, string | undefined>> = () => ({})\n): SidePanelSlots => {\n let closeChoice: (() => void) | undefined;\n return {\n Frame: (props) => {\n const close = closeChoice;\n return h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n onKeydownCapture: (event: KeyboardEvent) => {\n const target = event.target;\n // ElSelect stops Escape even while closed; forward that case to the\n // binding's current close callback before the native event is consumed.\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\" &&\n !target.closest('[role=\"dialog\"],[role=\"menu\"]')\n ) {\n event.preventDefault();\n event.stopPropagation();\n close?.();\n }\n },\n },\n },\n { default: () => props.children }\n );\n },\n Tab: (props) =>\n elementButton(\n { ...toVueAttrs(props.buttonProps), class: names().sidePanelTab },\n props.panel.label\n ),\n Close: (props) => {\n closeChoice = props.onClose;\n return elementButton(\n {\n type: \"button\",\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names().sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n );\n },\n };\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,yBAAA,GAAwBA,IAAAA,gBAAAA,EAClC,UAIK;CACJ,MAAM,UAAA,GAASC,wBAAAA,iBAAA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ACzC,CAAC,OAAO,QAAQ,mCAA+B,GAC/C;MACA,MAAM,eAAe;MACrB,MAAM,gBAAgB;MACtB,QAAQ;KACV;IACF;GACF,EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;EACF;EACA,MAAM,UACJP,eAAAA,cACE;GAAE,IAAA,GAAGI,wBAAAA,WAAAA,CAAW,MAAM,WAAW;GAAG,OAAO,MAAM,CAAC,CAAC;EAAa,GAChE,MAAM,MAAM,KACd;EACF,QAAQ,UAAU;GAChB,cAAc,MAAM;GACpB,OAAOJ,eAAAA,cACL;IACE,MAAM;IACN,cAAc,MAAM;IACpB,wBAAwB;IACxB,OAAO,MAAM,CAAC,CAAC;IACf,SAAS,MAAM;GACjB,GACA,MAAM,KACR;EACF;CACF;AACF"}
@@ -0,0 +1,79 @@
1
+ const require_button = require("./button-BFjBL9m3.cjs");
2
+ const require_ElementCard = require("./ElementCard-BRZekaHr.cjs");
3
+ let vue = require("vue");
4
+ let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
5
+ let element_plus = require("element-plus");
6
+ let _adapttable_vue_features = require("@adapttable/vue/features");
7
+ //#region src/actions/elementExportSlots.ts
8
+ const elementExportSlots = (names = {}) => ({
9
+ Button: ({ attrs, label, icon }) => require_button.elementButton({
10
+ ...attrs,
11
+ loading: attrs["aria-busy"] === true
12
+ }, [attrs["aria-busy"] === true ? null : icon, label], () => (0, vue.h)(element_plus.ElIcon, {
13
+ "aria-hidden": "true",
14
+ "data-adapttable-part": "export-spinner",
15
+ class: ["is-loading", names.exportSpinner]
16
+ }, { default: () => (0, vue.h)("svg", {
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ stroke: "currentColor",
20
+ "stroke-width": 2
21
+ }, [(0, vue.h)("path", { d: "M21 12a9 9 0 1 1-6.22-8.56" })]) })),
22
+ Surface: (props) => (0, vue.h)(require_ElementCard.ElementCard, { attrs: {
23
+ "data-adapttable-part": "export-progress-surface",
24
+ class: names.exportProgress,
25
+ role: "region",
26
+ "aria-label": props.heading
27
+ } }, { default: () => [
28
+ (0, vue.h)("h3", props.heading),
29
+ props.status === "busy" ? (0, vue.h)(element_plus.ElProgress, {
30
+ "data-adapttable-part": "export-progress-bar",
31
+ class: names.exportProgressBar,
32
+ percentage: props.progress ?? 0,
33
+ indeterminate: props.progress === void 0,
34
+ "aria-label": props.progressLabel
35
+ }) : null,
36
+ props.message ? (0, vue.h)("p", {
37
+ "data-adapttable-part": "export-progress-message",
38
+ class: names.exportProgressMessage
39
+ }, props.message) : null,
40
+ props.error ? (0, vue.h)("p", {
41
+ role: "alert",
42
+ "data-adapttable-part": "export-progress-message",
43
+ class: names.exportProgressMessage
44
+ }, props.error) : null,
45
+ (0, vue.h)("div", { "data-adapttable-part": "export-progress-actions" }, [...[
46
+ ["cancel", props.cancel],
47
+ ["retry", props.retry],
48
+ ["dismiss", props.dismiss]
49
+ ].map(([key, action]) => action ? require_button.elementButton({
50
+ key,
51
+ type: "button",
52
+ "data-adapttable-part": `export-progress-${key}`,
53
+ class: names.exportProgressButton,
54
+ onClick: action.onAction
55
+ }, action.label) : null), props.download ? (0, vue.h)(element_plus.ElLink, {
56
+ "data-adapttable-part": "export-progress-download",
57
+ class: names.exportProgressDownload,
58
+ href: props.download.url,
59
+ download: ""
60
+ }, { default: () => props.download?.label }) : null])
61
+ ] })
62
+ });
63
+ //#endregion
64
+ //#region src/export.ts
65
+ function exportCsv(options = true) {
66
+ return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.exportCsv)(options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.EXPORT_CONTROL, (props) => (0, vue.h)(_adapttable_vue_adapter.ExportChrome, {
67
+ ...props,
68
+ slots: elementExportSlots(props.classNames)
69
+ }))]);
70
+ }
71
+ //#endregion
72
+ Object.defineProperty(exports, "exportCsv", {
73
+ enumerable: true,
74
+ get: function() {
75
+ return exportCsv;
76
+ }
77
+ });
78
+
79
+ //# sourceMappingURL=export-CL36qPVY.cjs.map