@adapttable/vue-headless-ui 0.0.0-stage → 0.1.2
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.
- package/LICENSE +21 -0
- package/README.md +197 -2
- package/dist/FilterField-BRcf96Xt.js +173 -0
- package/dist/FilterField-BRcf96Xt.js.map +1 -0
- package/dist/FilterField-DEyQh8de.cjs +195 -0
- package/dist/FilterField-DEyQh8de.cjs.map +1 -0
- package/dist/HeadlessRowActions--xEzkpxa.js +44 -0
- package/dist/HeadlessRowActions--xEzkpxa.js.map +1 -0
- package/dist/HeadlessRowActions-CL8yo3k-.cjs +49 -0
- package/dist/HeadlessRowActions-CL8yo3k-.cjs.map +1 -0
- package/dist/HeadlessSurface-CrOMvxVj.cjs +149 -0
- package/dist/HeadlessSurface-CrOMvxVj.cjs.map +1 -0
- package/dist/HeadlessSurface-gPmhSxmK.js +144 -0
- package/dist/HeadlessSurface-gPmhSxmK.js.map +1 -0
- package/dist/assistant.cjs +268 -0
- package/dist/assistant.cjs.map +1 -0
- package/dist/assistant.d.cts +10 -0
- package/dist/assistant.d.cts.map +1 -0
- package/dist/assistant.d.ts +10 -0
- package/dist/assistant.d.ts.map +1 -0
- package/dist/assistant.js +264 -0
- package/dist/assistant.js.map +1 -0
- package/dist/basic-BUT5yxns.cjs +42 -0
- package/dist/basic-BUT5yxns.cjs.map +1 -0
- package/dist/basic-DX6Oejyw.js +31 -0
- package/dist/basic-DX6Oejyw.js.map +1 -0
- package/dist/batch-editing.cjs +4 -0
- package/dist/batch-editing.d.cts +2 -0
- package/dist/batch-editing.d.ts +2 -0
- package/dist/batch-editing.js +2 -0
- package/dist/bulk-actions.cjs +16 -0
- package/dist/bulk-actions.cjs.map +1 -0
- package/dist/bulk-actions.d.cts +7 -0
- package/dist/bulk-actions.d.cts.map +1 -0
- package/dist/bulk-actions.d.ts +7 -0
- package/dist/bulk-actions.d.ts.map +1 -0
- package/dist/bulk-actions.js +15 -0
- package/dist/bulk-actions.js.map +1 -0
- package/dist/cell-navigation.cjs +31 -0
- package/dist/cell-navigation.cjs.map +1 -0
- package/dist/cell-navigation.d.cts +9 -0
- package/dist/cell-navigation.d.cts.map +1 -0
- package/dist/cell-navigation.d.ts +9 -0
- package/dist/cell-navigation.d.ts.map +1 -0
- package/dist/cell-navigation.js +29 -0
- package/dist/cell-navigation.js.map +1 -0
- package/dist/cell-span.cjs +8 -0
- package/dist/cell-span.d.cts +2 -0
- package/dist/cell-span.d.ts +2 -0
- package/dist/cell-span.js +2 -0
- package/dist/checkbox-Bjsm3kP_.js +49 -0
- package/dist/checkbox-Bjsm3kP_.js.map +1 -0
- package/dist/checkbox-cy6E_PMS.cjs +60 -0
- package/dist/checkbox-cy6E_PMS.cjs.map +1 -0
- package/dist/column-groups.cjs +8 -0
- package/dist/column-groups.d.cts +2 -0
- package/dist/column-groups.d.ts +2 -0
- package/dist/column-groups.js +2 -0
- package/dist/column-layout.cjs +24 -0
- package/dist/column-layout.cjs.map +1 -0
- package/dist/column-layout.d.cts +12 -0
- package/dist/column-layout.d.cts.map +1 -0
- package/dist/column-layout.d.ts +12 -0
- package/dist/column-layout.d.ts.map +1 -0
- package/dist/column-layout.js +22 -0
- package/dist/column-layout.js.map +1 -0
- package/dist/column-menu-Dkdnp8Wk.js +89 -0
- package/dist/column-menu-Dkdnp8Wk.js.map +1 -0
- package/dist/column-menu-_nvHPN8r.cjs +100 -0
- package/dist/column-menu-_nvHPN8r.cjs.map +1 -0
- package/dist/column-menu.cjs +4 -0
- package/dist/column-menu.d.cts +23 -0
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +23 -0
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +2 -0
- package/dist/column-selection.cjs +19 -0
- package/dist/column-selection.cjs.map +1 -0
- package/dist/column-selection.d.cts +7 -0
- package/dist/column-selection.d.cts.map +1 -0
- package/dist/column-selection.d.ts +7 -0
- package/dist/column-selection.d.ts.map +1 -0
- package/dist/column-selection.js +18 -0
- package/dist/column-selection.js.map +1 -0
- package/dist/columns.cjs +26 -0
- package/dist/columns.d.cts +3 -0
- package/dist/columns.d.ts +3 -0
- package/dist/columns.js +2 -0
- package/dist/command-palette.cjs +117 -0
- package/dist/command-palette.cjs.map +1 -0
- package/dist/command-palette.d.cts +7 -0
- package/dist/command-palette.d.cts.map +1 -0
- package/dist/command-palette.d.ts +7 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +116 -0
- package/dist/command-palette.js.map +1 -0
- package/dist/context-B4_4jyr7.js +2 -0
- package/dist/context-menu.cjs +118 -0
- package/dist/context-menu.cjs.map +1 -0
- package/dist/context-menu.d.cts +7 -0
- package/dist/context-menu.d.cts.map +1 -0
- package/dist/context-menu.d.ts +7 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +117 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/density.cjs +57 -0
- package/dist/density.cjs.map +1 -0
- package/dist/density.d.cts +6 -0
- package/dist/density.d.cts.map +1 -0
- package/dist/density.d.ts +6 -0
- package/dist/density.d.ts.map +1 -0
- package/dist/density.js +56 -0
- package/dist/density.js.map +1 -0
- package/dist/dialog-BFiJHEU0.js +61 -0
- package/dist/dialog-BFiJHEU0.js.map +1 -0
- package/dist/dialog-kLRPt0eo.cjs +66 -0
- package/dist/dialog-kLRPt0eo.cjs.map +1 -0
- package/dist/direction-BddXmM5u.js +14 -0
- package/dist/direction-BddXmM5u.js.map +1 -0
- package/dist/direction-BoccEkT5.cjs +25 -0
- package/dist/direction-BoccEkT5.cjs.map +1 -0
- package/dist/editing-BDFeEaa7.cjs +320 -0
- package/dist/editing-BDFeEaa7.cjs.map +1 -0
- package/dist/editing-DmrzTZmJ.js +274 -0
- package/dist/editing-DmrzTZmJ.js.map +1 -0
- package/dist/editing-Zuj4SiEJ.d.cts +64 -0
- package/dist/editing-Zuj4SiEJ.d.cts.map +1 -0
- package/dist/editing-jRKWRTeo.d.ts +64 -0
- package/dist/editing-jRKWRTeo.d.ts.map +1 -0
- package/dist/editing.cjs +13 -0
- package/dist/editing.d.cts +2 -0
- package/dist/editing.d.ts +2 -0
- package/dist/editing.js +2 -0
- package/dist/export-csv-B7LpklZy.js +10 -0
- package/dist/export-csv-B7LpklZy.js.map +1 -0
- package/dist/export-csv-IWCNspOS.cjs +15 -0
- package/dist/export-csv-IWCNspOS.cjs.map +1 -0
- package/dist/export-pdf.cjs +53 -0
- package/dist/export-pdf.cjs.map +1 -0
- package/dist/export-pdf.d.cts +8 -0
- package/dist/export-pdf.d.cts.map +1 -0
- package/dist/export-pdf.d.ts +8 -0
- package/dist/export-pdf.d.ts.map +1 -0
- package/dist/export-pdf.js +10 -0
- package/dist/export-pdf.js.map +1 -0
- package/dist/export-xlsx.cjs +23 -0
- package/dist/export-xlsx.cjs.map +1 -0
- package/dist/export-xlsx.d.cts +8 -0
- package/dist/export-xlsx.d.cts.map +1 -0
- package/dist/export-xlsx.d.ts +8 -0
- package/dist/export-xlsx.d.ts.map +1 -0
- package/dist/export-xlsx.js +10 -0
- package/dist/export-xlsx.js.map +1 -0
- package/dist/export.cjs +3 -0
- package/dist/export.d.cts +8 -0
- package/dist/export.d.cts.map +1 -0
- package/dist/export.d.ts +8 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +2 -0
- package/dist/extra-rows.cjs +8 -0
- package/dist/extra-rows.d.cts +2 -0
- package/dist/extra-rows.d.ts +2 -0
- package/dist/extra-rows.js +2 -0
- package/dist/filtering.cjs +22 -0
- package/dist/filtering.cjs.map +1 -0
- package/dist/filtering.d.cts +13 -0
- package/dist/filtering.d.cts.map +1 -0
- package/dist/filtering.d.ts +13 -0
- package/dist/filtering.d.ts.map +1 -0
- package/dist/filtering.js +21 -0
- package/dist/filtering.js.map +1 -0
- package/dist/filters-0eDneZJ3.cjs +342 -0
- package/dist/filters-0eDneZJ3.cjs.map +1 -0
- package/dist/filters-BGdDaMAO.d.ts +90 -0
- package/dist/filters-BGdDaMAO.d.ts.map +1 -0
- package/dist/filters-MgBA-9UX.d.cts +90 -0
- package/dist/filters-MgBA-9UX.d.cts.map +1 -0
- package/dist/filters-PK2rSgg_.js +290 -0
- package/dist/filters-PK2rSgg_.js.map +1 -0
- package/dist/filters.cjs +21 -0
- package/dist/filters.d.cts +2 -0
- package/dist/filters.d.ts +2 -0
- package/dist/filters.js +3 -0
- package/dist/find-in-table-CdSzaSEf.cjs +60 -0
- package/dist/find-in-table-CdSzaSEf.cjs.map +1 -0
- package/dist/find-in-table-DLueFbHI.js +56 -0
- package/dist/find-in-table-DLueFbHI.js.map +1 -0
- package/dist/find-in-table.cjs +3 -0
- package/dist/find-in-table.d.cts +8 -0
- package/dist/find-in-table.d.cts.map +1 -0
- package/dist/find-in-table.d.ts +8 -0
- package/dist/find-in-table.d.ts.map +1 -0
- package/dist/find-in-table.js +2 -0
- package/dist/fit-columns.cjs +8 -0
- package/dist/fit-columns.d.cts +2 -0
- package/dist/fit-columns.d.ts +2 -0
- package/dist/fit-columns.js +2 -0
- package/dist/formula.cjs +9 -0
- package/dist/formula.d.cts +1 -0
- package/dist/formula.d.ts +1 -0
- package/dist/formula.js +1 -0
- package/dist/fullscreen.cjs +15 -0
- package/dist/fullscreen.cjs.map +1 -0
- package/dist/fullscreen.d.cts +6 -0
- package/dist/fullscreen.d.cts.map +1 -0
- package/dist/fullscreen.d.ts +6 -0
- package/dist/fullscreen.d.ts.map +1 -0
- package/dist/fullscreen.js +14 -0
- package/dist/fullscreen.js.map +1 -0
- package/dist/grouping-panel.cjs +134 -0
- package/dist/grouping-panel.cjs.map +1 -0
- package/dist/grouping-panel.d.cts +8 -0
- package/dist/grouping-panel.d.cts.map +1 -0
- package/dist/grouping-panel.d.ts +8 -0
- package/dist/grouping-panel.d.ts.map +1 -0
- package/dist/grouping-panel.js +134 -0
- package/dist/grouping-panel.js.map +1 -0
- package/dist/grouping.cjs +43 -0
- package/dist/grouping.cjs.map +1 -0
- package/dist/grouping.d.cts +9 -0
- package/dist/grouping.d.cts.map +1 -0
- package/dist/grouping.d.ts +9 -0
- package/dist/grouping.d.ts.map +1 -0
- package/dist/grouping.js +24 -0
- package/dist/grouping.js.map +1 -0
- package/dist/header-filters-BjP_iXlH.js +217 -0
- package/dist/header-filters-BjP_iXlH.js.map +1 -0
- package/dist/header-filters-q7r79WaS.cjs +239 -0
- package/dist/header-filters-q7r79WaS.cjs.map +1 -0
- package/dist/header-filters.cjs +6 -0
- package/dist/header-filters.d.cts +52 -0
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +52 -0
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/header-filters.js +2 -0
- package/dist/index.cjs +336 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +336 -0
- package/dist/index.js.map +1 -0
- package/dist/managedPanel-Bb8ep_cT.js +27 -0
- package/dist/managedPanel-Bb8ep_cT.js.map +1 -0
- package/dist/managedPanel-BwjP8QJ9.cjs +31 -0
- package/dist/managedPanel-BwjP8QJ9.cjs.map +1 -0
- package/dist/menu-Cg-P5uJv.js +66 -0
- package/dist/menu-Cg-P5uJv.js.map +1 -0
- package/dist/menu-RAcylhSS.cjs +77 -0
- package/dist/menu-RAcylhSS.cjs.map +1 -0
- package/dist/multi-sort.cjs +8 -0
- package/dist/multi-sort.d.cts +2 -0
- package/dist/multi-sort.d.ts +2 -0
- package/dist/multi-sort.js +2 -0
- package/dist/nested-table.cjs +8 -0
- package/dist/nested-table.d.cts +2 -0
- package/dist/nested-table.d.ts +2 -0
- package/dist/nested-table.js +2 -0
- package/dist/overlay-BELaYa9y.cjs +140 -0
- package/dist/overlay-BELaYa9y.cjs.map +1 -0
- package/dist/overlay-CGNQ_Qbl.js +111 -0
- package/dist/overlay-CGNQ_Qbl.js.map +1 -0
- package/dist/pinned-summary-rows.cjs +8 -0
- package/dist/pinned-summary-rows.d.cts +2 -0
- package/dist/pinned-summary-rows.d.ts +2 -0
- package/dist/pinned-summary-rows.js +2 -0
- package/dist/pivot.cjs +79 -0
- package/dist/pivot.cjs.map +1 -0
- package/dist/pivot.d.cts +9 -0
- package/dist/pivot.d.cts.map +1 -0
- package/dist/pivot.d.ts +9 -0
- package/dist/pivot.d.ts.map +1 -0
- package/dist/pivot.js +78 -0
- package/dist/pivot.js.map +1 -0
- package/dist/portal-BeSwili6.cjs +81 -0
- package/dist/portal-BeSwili6.cjs.map +1 -0
- package/dist/portal-CdNXlwQR.js +58 -0
- package/dist/portal-CdNXlwQR.js.map +1 -0
- package/dist/preset.cjs +40 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.d.cts +16 -0
- package/dist/preset.d.cts.map +1 -0
- package/dist/preset.d.ts +16 -0
- package/dist/preset.d.ts.map +1 -0
- package/dist/preset.js +38 -0
- package/dist/preset.js.map +1 -0
- package/dist/primitive-BOve5bNE.cjs +42 -0
- package/dist/primitive-BOve5bNE.cjs.map +1 -0
- package/dist/primitive-DzjBBhOj.js +31 -0
- package/dist/primitive-DzjBBhOj.js.map +1 -0
- package/dist/print.cjs +16 -0
- package/dist/print.cjs.map +1 -0
- package/dist/print.d.cts +6 -0
- package/dist/print.d.cts.map +1 -0
- package/dist/print.d.ts +6 -0
- package/dist/print.d.ts.map +1 -0
- package/dist/print.js +15 -0
- package/dist/print.js.map +1 -0
- package/dist/resizable-columns.cjs +8 -0
- package/dist/resizable-columns.d.cts +2 -0
- package/dist/resizable-columns.d.ts +2 -0
- package/dist/resizable-columns.js +2 -0
- package/dist/row-actions.cjs +15 -0
- package/dist/row-actions.cjs.map +1 -0
- package/dist/row-actions.d.cts +7 -0
- package/dist/row-actions.d.cts.map +1 -0
- package/dist/row-actions.d.ts +7 -0
- package/dist/row-actions.d.ts.map +1 -0
- package/dist/row-actions.js +14 -0
- package/dist/row-actions.js.map +1 -0
- package/dist/row-appearance.cjs +8 -0
- package/dist/row-appearance.d.cts +2 -0
- package/dist/row-appearance.d.ts +2 -0
- package/dist/row-appearance.js +2 -0
- package/dist/row-detail.cjs +28 -0
- package/dist/row-detail.d.cts +4 -0
- package/dist/row-detail.d.ts +4 -0
- package/dist/row-detail.js +4 -0
- package/dist/row-pinning.cjs +15 -0
- package/dist/row-pinning.cjs.map +1 -0
- package/dist/row-pinning.d.cts +8 -0
- package/dist/row-pinning.d.cts.map +1 -0
- package/dist/row-pinning.d.ts +8 -0
- package/dist/row-pinning.d.ts.map +1 -0
- package/dist/row-pinning.js +14 -0
- package/dist/row-pinning.js.map +1 -0
- package/dist/row-reorder.cjs +161 -0
- package/dist/row-reorder.cjs.map +1 -0
- package/dist/row-reorder.d.cts +7 -0
- package/dist/row-reorder.d.cts.map +1 -0
- package/dist/row-reorder.d.ts +7 -0
- package/dist/row-reorder.d.ts.map +1 -0
- package/dist/row-reorder.js +155 -0
- package/dist/row-reorder.js.map +1 -0
- package/dist/rowActionsSlot-Dpy_3Wey.js +11 -0
- package/dist/rowActionsSlot-Dpy_3Wey.js.map +1 -0
- package/dist/rowActionsSlot-LFWTvwEJ.cjs +21 -0
- package/dist/rowActionsSlot-LFWTvwEJ.cjs.map +1 -0
- package/dist/rows.cjs +30 -0
- package/dist/rows.d.cts +6 -0
- package/dist/rows.d.ts +6 -0
- package/dist/rows.js +4 -0
- package/dist/saved-views-CE7IEzY3.d.ts +12 -0
- package/dist/saved-views-CE7IEzY3.d.ts.map +1 -0
- package/dist/saved-views-CNXfj7FZ.d.cts +12 -0
- package/dist/saved-views-CNXfj7FZ.d.cts.map +1 -0
- package/dist/saved-views-CNZTPbnn.js +117 -0
- package/dist/saved-views-CNZTPbnn.js.map +1 -0
- package/dist/saved-views-DhUO_HoG.cjs +128 -0
- package/dist/saved-views-DhUO_HoG.cjs.map +1 -0
- package/dist/saved-views.cjs +4 -0
- package/dist/saved-views.d.cts +2 -0
- package/dist/saved-views.d.ts +2 -0
- package/dist/saved-views.js +2 -0
- package/dist/select-DchWHRTE.cjs +150 -0
- package/dist/select-DchWHRTE.cjs.map +1 -0
- package/dist/select-ofDZbnd6.js +139 -0
- package/dist/select-ofDZbnd6.js.map +1 -0
- package/dist/selection-stats-B8YUI68M.cjs +82 -0
- package/dist/selection-stats-B8YUI68M.cjs.map +1 -0
- package/dist/selection-stats-CAv_JysE.js +72 -0
- package/dist/selection-stats-CAv_JysE.js.map +1 -0
- package/dist/selection-stats.cjs +3 -0
- package/dist/selection-stats.d.cts +6 -0
- package/dist/selection-stats.d.cts.map +1 -0
- package/dist/selection-stats.d.ts +6 -0
- package/dist/selection-stats.d.ts.map +1 -0
- package/dist/selection-stats.js +2 -0
- package/dist/selection.cjs +8 -0
- package/dist/selection.d.cts +2 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +2 -0
- package/dist/side-panel.cjs +71 -0
- package/dist/side-panel.cjs.map +1 -0
- package/dist/side-panel.d.cts +7 -0
- package/dist/side-panel.d.cts.map +1 -0
- package/dist/side-panel.d.ts +7 -0
- package/dist/side-panel.d.ts.map +1 -0
- package/dist/side-panel.js +70 -0
- package/dist/side-panel.js.map +1 -0
- package/dist/signal-CJNKPFud.cjs +23 -0
- package/dist/signal-CJNKPFud.cjs.map +1 -0
- package/dist/signal-G-6BhqAT.js +18 -0
- package/dist/signal-G-6BhqAT.js.map +1 -0
- package/dist/sparkline.cjs +9 -0
- package/dist/sparkline.d.cts +1 -0
- package/dist/sparkline.d.ts +1 -0
- package/dist/sparkline.js +1 -0
- package/dist/status-bar.cjs +14 -0
- package/dist/status-bar.cjs.map +1 -0
- package/dist/status-bar.d.cts +7 -0
- package/dist/status-bar.d.cts.map +1 -0
- package/dist/status-bar.d.ts +7 -0
- package/dist/status-bar.d.ts.map +1 -0
- package/dist/status-bar.js +12 -0
- package/dist/status-bar.js.map +1 -0
- package/dist/stream.cjs +9 -0
- package/dist/stream.d.cts +1 -0
- package/dist/stream.d.ts +1 -0
- package/dist/stream.js +1 -0
- package/dist/styles.css +1152 -0
- package/dist/target-B-JQVtw9.js +73 -0
- package/dist/target-B-JQVtw9.js.map +1 -0
- package/dist/target-CZ60Sqrg.cjs +90 -0
- package/dist/target-CZ60Sqrg.cjs.map +1 -0
- package/dist/tree.cjs +21 -0
- package/dist/tree.d.cts +3 -0
- package/dist/tree.d.ts +3 -0
- package/dist/tree.js +3 -0
- package/dist/virtualize.cjs +8 -0
- package/dist/virtualize.d.cts +2 -0
- package/dist/virtualize.d.ts +2 -0
- package/dist/virtualize.js +2 -0
- package/dist/withHeadlessExport-BWtz333c.cjs +76 -0
- package/dist/withHeadlessExport-BWtz333c.cjs.map +1 -0
- package/dist/withHeadlessExport-BccRGCD8.js +71 -0
- package/dist/withHeadlessExport-BccRGCD8.js.map +1 -0
- package/package.json +565 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent, h, shallowRef } from "vue";
|
|
2
|
+
import { useElementRef } from "@adapttable/vue/adapter";
|
|
3
|
+
//#region src/controls/target.ts
|
|
4
|
+
/** Resolve only the primitive's documented public element. */
|
|
5
|
+
function headlessElement(component) {
|
|
6
|
+
const element = "$el" in component ? component.$el : component;
|
|
7
|
+
return typeof HTMLElement !== "undefined" && element instanceof HTMLElement ? element : null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Headless UI merges the handlers it is given only when each is one function,
|
|
11
|
+
* and drops a list. Vue's own merge produces lists, so fold each into one.
|
|
12
|
+
*/
|
|
13
|
+
function singleHandlers(attrs) {
|
|
14
|
+
const out = { ...attrs };
|
|
15
|
+
for (const [name, value] of Object.entries(attrs)) {
|
|
16
|
+
if (!name.startsWith("on") || !Array.isArray(value)) continue;
|
|
17
|
+
const handlers = value.filter((handler) => typeof handler === "function");
|
|
18
|
+
out[name] = (...args) => {
|
|
19
|
+
for (const handler of handlers) handler(...args);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
function isElementRef(value) {
|
|
25
|
+
return typeof value === "function";
|
|
26
|
+
}
|
|
27
|
+
/** One setup scope owns the native target and reconciles its callback owner. */
|
|
28
|
+
function useTargetAttrs(attrs) {
|
|
29
|
+
const target = shallowRef(null);
|
|
30
|
+
useElementRef(() => target.value ? headlessElement(target.value) : null, () => {
|
|
31
|
+
const owner = attrs().ref;
|
|
32
|
+
return isElementRef(owner) ? owner : void 0;
|
|
33
|
+
});
|
|
34
|
+
const capture = (component) => {
|
|
35
|
+
target.value = component;
|
|
36
|
+
};
|
|
37
|
+
const read = () => {
|
|
38
|
+
const rest = { ...singleHandlers(attrs()) };
|
|
39
|
+
delete rest.ref;
|
|
40
|
+
return {
|
|
41
|
+
...rest,
|
|
42
|
+
ref: capture
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** The native element the target currently resolves to. */
|
|
46
|
+
read.element = () => target.value ? headlessElement(target.value) : null;
|
|
47
|
+
return read;
|
|
48
|
+
}
|
|
49
|
+
const HeadlessTarget = defineComponent((props, { slots }) => {
|
|
50
|
+
const attrs = useTargetAttrs(() => props.targetAttrs);
|
|
51
|
+
return () => h(props.component, attrs(), slots);
|
|
52
|
+
}, {
|
|
53
|
+
name: "HeadlessTarget",
|
|
54
|
+
props: {
|
|
55
|
+
component: { type: [Object, Function] },
|
|
56
|
+
targetAttrs: { type: Object }
|
|
57
|
+
},
|
|
58
|
+
inheritAttrs: false
|
|
59
|
+
});
|
|
60
|
+
/** A stable instance boundary for controls assembled by Chrome render slots. */
|
|
61
|
+
function headlessTarget(component, attrs, slots, instanceRef) {
|
|
62
|
+
const key = attrs.key;
|
|
63
|
+
return h(HeadlessTarget, {
|
|
64
|
+
key: typeof key === "string" || typeof key === "number" || typeof key === "symbol" ? key : void 0,
|
|
65
|
+
component,
|
|
66
|
+
targetAttrs: attrs,
|
|
67
|
+
ref: instanceRef
|
|
68
|
+
}, slots);
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { singleHandlers as n, useTargetAttrs as r, headlessTarget as t };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=target-B-JQVtw9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-B-JQVtw9.js","names":[],"sources":["../src/controls/target.ts"],"sourcesContent":["import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\n/** Resolve only the primitive's documented public element. */\nexport function headlessElement(\n component: Element | ComponentPublicInstance\n): HTMLElement | null {\n const element: unknown = \"$el\" in component ? component.$el : component;\n return typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement\n ? element\n : null;\n}\n\n/**\n * Headless UI merges the handlers it is given only when each is one function,\n * and drops a list. Vue's own merge produces lists, so fold each into one.\n */\nexport function singleHandlers(attrs: Attrs): Attrs {\n const out: Record<string, unknown> = { ...attrs };\n for (const [name, value] of Object.entries(attrs)) {\n if (!name.startsWith(\"on\") || !Array.isArray(value)) continue;\n const handlers = value.filter(\n (handler): handler is (...args: unknown[]) => unknown =>\n typeof handler === \"function\"\n );\n out[name] = (...args: unknown[]) => {\n for (const handler of handlers) handler(...args);\n };\n }\n return out;\n}\n\nfunction isElementRef(value: unknown): value is ElementRef<HTMLElement> {\n return typeof value === \"function\";\n}\n\n/** One setup scope owns the native target and reconciles its callback owner. */\nexport function useTargetAttrs(attrs: () => Attrs) {\n const target = shallowRef<Element | ComponentPublicInstance | null>(null);\n useElementRef(\n () => (target.value ? headlessElement(target.value) : null),\n () => {\n const owner = attrs().ref;\n return isElementRef(owner) ? owner : undefined;\n }\n );\n const capture = (component: Element | ComponentPublicInstance | null) => {\n target.value = component;\n };\n const read = () => {\n const rest: Record<string, unknown> = { ...singleHandlers(attrs()) };\n delete rest.ref;\n return { ...rest, ref: capture };\n };\n /** The native element the target currently resolves to. */\n read.element = (): HTMLElement | null =>\n target.value ? headlessElement(target.value) : null;\n return read;\n}\n\nconst HeadlessTarget = defineComponent(\n (\n props: { readonly component: Component; readonly targetAttrs: Attrs },\n { slots }\n ) => {\n const attrs = useTargetAttrs(() => props.targetAttrs);\n return () => h(props.component, attrs(), slots);\n },\n {\n name: \"HeadlessTarget\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n targetAttrs: { type: Object as PropType<Attrs> },\n },\n inheritAttrs: false,\n }\n);\n\n/** A stable instance boundary for controls assembled by Chrome render slots. */\nexport function headlessTarget(\n component: Component,\n attrs: Attrs,\n slots?: Record<string, () => VNodeChild>,\n instanceRef?: (instance: unknown) => void\n) {\n const key = attrs.key;\n return h(\n HeadlessTarget,\n {\n key:\n typeof key === \"string\" ||\n typeof key === \"number\" ||\n typeof key === \"symbol\"\n ? key\n : undefined,\n component,\n targetAttrs: attrs,\n ref: instanceRef,\n },\n slots\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,gBACd,WACoB;CACpB,MAAM,UAAmB,SAAS,YAAY,UAAU,MAAM;CAC9D,OAAO,OAAO,gBAAgB,eAAe,mBAAmB,cAC5D,UACA;AACN;;;;;AAMA,SAAgB,eAAe,OAAqB;CAClD,MAAM,MAA+B,EAAE,GAAG,MAAM;CAChD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAAK,GAAG;EACjD,IAAI,CAAC,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,QAAQ,KAAK,GAAG;EACrD,MAAM,WAAW,MAAM,QACpB,YACC,OAAO,YAAY,UACvB;EACA,IAAI,SAAS,GAAG,SAAoB;GAClC,KAAK,MAAM,WAAW,UAAU,QAAQ,GAAG,IAAI;EACjD;CACF;CACA,OAAO;AACT;AAEA,SAAS,aAAa,OAAkD;CACtE,OAAO,OAAO,UAAU;AAC1B;;AAGA,SAAgB,eAAe,OAAoB;CACjD,MAAM,SAAS,WAAqD,IAAI;CACxE,oBACS,OAAO,QAAQ,gBAAgB,OAAO,KAAK,IAAI,YAChD;EACJ,MAAM,QAAQ,MAAM,CAAC,CAAC;EACtB,OAAO,aAAa,KAAK,IAAI,QAAQ,KAAA;CACvC,CACF;CACA,MAAM,WAAW,cAAwD;EACvE,OAAO,QAAQ;CACjB;CACA,MAAM,aAAa;EACjB,MAAM,OAAgC,EAAE,GAAG,eAAe,MAAM,CAAC,EAAE;EACnE,OAAO,KAAK;EACZ,OAAO;GAAE,GAAG;GAAM,KAAK;EAAQ;CACjC;;CAEA,KAAK,gBACH,OAAO,QAAQ,gBAAgB,OAAO,KAAK,IAAI;CACjD,OAAO;AACT;AAEA,MAAM,iBAAiB,iBAEnB,OACA,EAAE,YACC;CACH,MAAM,QAAQ,qBAAqB,MAAM,WAAW;CACpD,aAAa,EAAE,MAAM,WAAW,MAAM,GAAG,KAAK;AAChD,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAyB;EAC7D,aAAa,EAAE,MAAM,OAA0B;CACjD;CACA,cAAc;AAChB,CACF;;AAGA,SAAgB,eACd,WACA,OACA,OACA,aACA;CACA,MAAM,MAAM,MAAM;CAClB,OAAO,EACL,gBACA;EACE,KACE,OAAO,QAAQ,YACf,OAAO,QAAQ,YACf,OAAO,QAAQ,WACX,MACA,KAAA;EACN;EACA,aAAa;EACb,KAAK;CACP,GACA,KACF;AACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
3
|
+
//#region src/controls/target.ts
|
|
4
|
+
/** Resolve only the primitive's documented public element. */
|
|
5
|
+
function headlessElement(component) {
|
|
6
|
+
const element = "$el" in component ? component.$el : component;
|
|
7
|
+
return typeof HTMLElement !== "undefined" && element instanceof HTMLElement ? element : null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Headless UI merges the handlers it is given only when each is one function,
|
|
11
|
+
* and drops a list. Vue's own merge produces lists, so fold each into one.
|
|
12
|
+
*/
|
|
13
|
+
function singleHandlers(attrs) {
|
|
14
|
+
const out = { ...attrs };
|
|
15
|
+
for (const [name, value] of Object.entries(attrs)) {
|
|
16
|
+
if (!name.startsWith("on") || !Array.isArray(value)) continue;
|
|
17
|
+
const handlers = value.filter((handler) => typeof handler === "function");
|
|
18
|
+
out[name] = (...args) => {
|
|
19
|
+
for (const handler of handlers) handler(...args);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
function isElementRef(value) {
|
|
25
|
+
return typeof value === "function";
|
|
26
|
+
}
|
|
27
|
+
/** One setup scope owns the native target and reconciles its callback owner. */
|
|
28
|
+
function useTargetAttrs(attrs) {
|
|
29
|
+
const target = (0, vue.shallowRef)(null);
|
|
30
|
+
(0, _adapttable_vue_adapter.useElementRef)(() => target.value ? headlessElement(target.value) : null, () => {
|
|
31
|
+
const owner = attrs().ref;
|
|
32
|
+
return isElementRef(owner) ? owner : void 0;
|
|
33
|
+
});
|
|
34
|
+
const capture = (component) => {
|
|
35
|
+
target.value = component;
|
|
36
|
+
};
|
|
37
|
+
const read = () => {
|
|
38
|
+
const rest = { ...singleHandlers(attrs()) };
|
|
39
|
+
delete rest.ref;
|
|
40
|
+
return {
|
|
41
|
+
...rest,
|
|
42
|
+
ref: capture
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** The native element the target currently resolves to. */
|
|
46
|
+
read.element = () => target.value ? headlessElement(target.value) : null;
|
|
47
|
+
return read;
|
|
48
|
+
}
|
|
49
|
+
const HeadlessTarget = (0, vue.defineComponent)((props, { slots }) => {
|
|
50
|
+
const attrs = useTargetAttrs(() => props.targetAttrs);
|
|
51
|
+
return () => (0, vue.h)(props.component, attrs(), slots);
|
|
52
|
+
}, {
|
|
53
|
+
name: "HeadlessTarget",
|
|
54
|
+
props: {
|
|
55
|
+
component: { type: [Object, Function] },
|
|
56
|
+
targetAttrs: { type: Object }
|
|
57
|
+
},
|
|
58
|
+
inheritAttrs: false
|
|
59
|
+
});
|
|
60
|
+
/** A stable instance boundary for controls assembled by Chrome render slots. */
|
|
61
|
+
function headlessTarget(component, attrs, slots, instanceRef) {
|
|
62
|
+
const key = attrs.key;
|
|
63
|
+
return (0, vue.h)(HeadlessTarget, {
|
|
64
|
+
key: typeof key === "string" || typeof key === "number" || typeof key === "symbol" ? key : void 0,
|
|
65
|
+
component,
|
|
66
|
+
targetAttrs: attrs,
|
|
67
|
+
ref: instanceRef
|
|
68
|
+
}, slots);
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
Object.defineProperty(exports, "headlessTarget", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function() {
|
|
74
|
+
return headlessTarget;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "singleHandlers", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return singleHandlers;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "useTargetAttrs", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return useTargetAttrs;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=target-CZ60Sqrg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-CZ60Sqrg.cjs","names":["shallowRef","defineComponent","h"],"sources":["../src/controls/target.ts"],"sourcesContent":["import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef } from \"@adapttable/vue/adapter\";\nimport {\n type Component,\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n type VNodeChild,\n} from \"vue\";\n\n/** Resolve only the primitive's documented public element. */\nexport function headlessElement(\n component: Element | ComponentPublicInstance\n): HTMLElement | null {\n const element: unknown = \"$el\" in component ? component.$el : component;\n return typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement\n ? element\n : null;\n}\n\n/**\n * Headless UI merges the handlers it is given only when each is one function,\n * and drops a list. Vue's own merge produces lists, so fold each into one.\n */\nexport function singleHandlers(attrs: Attrs): Attrs {\n const out: Record<string, unknown> = { ...attrs };\n for (const [name, value] of Object.entries(attrs)) {\n if (!name.startsWith(\"on\") || !Array.isArray(value)) continue;\n const handlers = value.filter(\n (handler): handler is (...args: unknown[]) => unknown =>\n typeof handler === \"function\"\n );\n out[name] = (...args: unknown[]) => {\n for (const handler of handlers) handler(...args);\n };\n }\n return out;\n}\n\nfunction isElementRef(value: unknown): value is ElementRef<HTMLElement> {\n return typeof value === \"function\";\n}\n\n/** One setup scope owns the native target and reconciles its callback owner. */\nexport function useTargetAttrs(attrs: () => Attrs) {\n const target = shallowRef<Element | ComponentPublicInstance | null>(null);\n useElementRef(\n () => (target.value ? headlessElement(target.value) : null),\n () => {\n const owner = attrs().ref;\n return isElementRef(owner) ? owner : undefined;\n }\n );\n const capture = (component: Element | ComponentPublicInstance | null) => {\n target.value = component;\n };\n const read = () => {\n const rest: Record<string, unknown> = { ...singleHandlers(attrs()) };\n delete rest.ref;\n return { ...rest, ref: capture };\n };\n /** The native element the target currently resolves to. */\n read.element = (): HTMLElement | null =>\n target.value ? headlessElement(target.value) : null;\n return read;\n}\n\nconst HeadlessTarget = defineComponent(\n (\n props: { readonly component: Component; readonly targetAttrs: Attrs },\n { slots }\n ) => {\n const attrs = useTargetAttrs(() => props.targetAttrs);\n return () => h(props.component, attrs(), slots);\n },\n {\n name: \"HeadlessTarget\",\n props: {\n component: { type: [Object, Function] as PropType<Component> },\n targetAttrs: { type: Object as PropType<Attrs> },\n },\n inheritAttrs: false,\n }\n);\n\n/** A stable instance boundary for controls assembled by Chrome render slots. */\nexport function headlessTarget(\n component: Component,\n attrs: Attrs,\n slots?: Record<string, () => VNodeChild>,\n instanceRef?: (instance: unknown) => void\n) {\n const key = attrs.key;\n return h(\n HeadlessTarget,\n {\n key:\n typeof key === \"string\" ||\n typeof key === \"number\" ||\n typeof key === \"symbol\"\n ? key\n : undefined,\n component,\n targetAttrs: attrs,\n ref: instanceRef,\n },\n slots\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,gBACd,WACoB;CACpB,MAAM,UAAmB,SAAS,YAAY,UAAU,MAAM;CAC9D,OAAO,OAAO,gBAAgB,eAAe,mBAAmB,cAC5D,UACA;AACN;;;;;AAMA,SAAgB,eAAe,OAAqB;CAClD,MAAM,MAA+B,EAAE,GAAG,MAAM;CAChD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAAK,GAAG;EACjD,IAAI,CAAC,KAAK,WAAW,IAAI,KAAK,CAAC,MAAM,QAAQ,KAAK,GAAG;EACrD,MAAM,WAAW,MAAM,QACpB,YACC,OAAO,YAAY,UACvB;EACA,IAAI,SAAS,GAAG,SAAoB;GAClC,KAAK,MAAM,WAAW,UAAU,QAAQ,GAAG,IAAI;EACjD;CACF;CACA,OAAO;AACT;AAEA,SAAS,aAAa,OAAkD;CACtE,OAAO,OAAO,UAAU;AAC1B;;AAGA,SAAgB,eAAe,OAAoB;CACjD,MAAM,UAAA,GAASA,IAAAA,WAAAA,CAAqD,IAAI;CACxE,CAAA,GAAA,wBAAA,cAAA,OACS,OAAO,QAAQ,gBAAgB,OAAO,KAAK,IAAI,YAChD;EACJ,MAAM,QAAQ,MAAM,CAAC,CAAC;EACtB,OAAO,aAAa,KAAK,IAAI,QAAQ,KAAA;CACvC,CACF;CACA,MAAM,WAAW,cAAwD;EACvE,OAAO,QAAQ;CACjB;CACA,MAAM,aAAa;EACjB,MAAM,OAAgC,EAAE,GAAG,eAAe,MAAM,CAAC,EAAE;EACnE,OAAO,KAAK;EACZ,OAAO;GAAE,GAAG;GAAM,KAAK;EAAQ;CACjC;;CAEA,KAAK,gBACH,OAAO,QAAQ,gBAAgB,OAAO,KAAK,IAAI;CACjD,OAAO;AACT;AAEA,MAAM,kBAAA,GAAiBC,IAAAA,gBAAAA,EAEnB,OACA,EAAE,YACC;CACH,MAAM,QAAQ,qBAAqB,MAAM,WAAW;CACpD,cAAA,GAAaC,IAAAA,EAAAA,CAAE,MAAM,WAAW,MAAM,GAAG,KAAK;AAChD,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAyB;EAC7D,aAAa,EAAE,MAAM,OAA0B;CACjD;CACA,cAAc;AAChB,CACF;;AAGA,SAAgB,eACd,WACA,OACA,OACA,aACA;CACA,MAAM,MAAM,MAAM;CAClB,QAAA,GAAOA,IAAAA,EAAAA,CACL,gBACA;EACE,KACE,OAAO,QAAQ,YACf,OAAO,QAAQ,YACf,OAAO,QAAQ,WACX,MACA,KAAA;EACN;EACA,aAAa;EACb,KAAK;CACP,GACA,KACF;AACF"}
|
package/dist/tree.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
3
|
+
let _adapttable_vue = require("@adapttable/vue");
|
|
4
|
+
Object.defineProperty(exports, "tree", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return _adapttable_vue_features.tree;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "useLazyChildren", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return _adapttable_vue.useLazyChildren;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "useTreeExpansion", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return _adapttable_vue.useTreeExpansion;
|
|
20
|
+
}
|
|
21
|
+
});
|
package/dist/tree.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TableTree, TreeExpansionOptions, useLazyChildren, useTreeExpansion } from "@adapttable/vue";
|
|
2
|
+
import { TreeFeatureOptions, tree } from "@adapttable/vue/features";
|
|
3
|
+
export { type TableTree, type TreeExpansionOptions, type TreeFeatureOptions, tree, useLazyChildren, useTreeExpansion };
|
package/dist/tree.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TreeFeatureOptions, tree } from "@adapttable/vue/features";
|
|
2
|
+
import { TableTree, TreeExpansionOptions, useLazyChildren, useTreeExpansion } from "@adapttable/vue";
|
|
3
|
+
export { type TableTree, type TreeExpansionOptions, type TreeFeatureOptions, tree, useLazyChildren, useTreeExpansion };
|
package/dist/tree.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
3
|
+
Object.defineProperty(exports, "virtualize", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _adapttable_vue_features.virtualize;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const require_primitive = require("./primitive-BOve5bNE.cjs");
|
|
2
|
+
const require_basic = require("./basic-BUT5yxns.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
|
+
//#region src/actions/exportControls.ts
|
|
6
|
+
const headlessExportControls = (names = {}) => ({
|
|
7
|
+
Button: ({ attrs, label, icon }) => require_basic.headlessButton(attrs, [attrs["aria-busy"] === true ? (0, vue.h)("span", {
|
|
8
|
+
"data-adapttable-part": "export-spinner",
|
|
9
|
+
class: ["at-headless-spinner", names.exportSpinner],
|
|
10
|
+
"aria-hidden": true
|
|
11
|
+
}) : icon, label]),
|
|
12
|
+
Surface: (control) => (0, vue.h)("section", {
|
|
13
|
+
"data-adapttable-part": "export-progress-surface",
|
|
14
|
+
class: names.exportProgress,
|
|
15
|
+
role: "region",
|
|
16
|
+
"aria-label": control.heading
|
|
17
|
+
}, [
|
|
18
|
+
(0, vue.h)("h3", control.heading),
|
|
19
|
+
control.status === "busy" ? (0, vue.h)(require_primitive.HeadlessPrimitive, {
|
|
20
|
+
as: "div",
|
|
21
|
+
role: "progressbar",
|
|
22
|
+
"data-adapttable-part": "export-progress-bar",
|
|
23
|
+
class: ["at-headless-progress", names.exportProgressBar],
|
|
24
|
+
"aria-valuemin": 0,
|
|
25
|
+
"aria-valuemax": 100,
|
|
26
|
+
"aria-valuenow": control.progress,
|
|
27
|
+
"aria-label": control.progressLabel,
|
|
28
|
+
"data-state": control.progress === void 0 ? "indeterminate" : "loading"
|
|
29
|
+
}, { default: () => (0, vue.h)("div", {
|
|
30
|
+
class: "at-headless-progress-indicator",
|
|
31
|
+
style: { inlineSize: control.progress === void 0 ? "40%" : `${control.progress}%` }
|
|
32
|
+
}) }) : null,
|
|
33
|
+
control.message ? (0, vue.h)("p", {
|
|
34
|
+
"data-adapttable-part": "export-progress-message",
|
|
35
|
+
class: names.exportProgressMessage
|
|
36
|
+
}, control.message) : null,
|
|
37
|
+
control.error ? (0, vue.h)("p", {
|
|
38
|
+
"data-adapttable-part": "export-progress-message",
|
|
39
|
+
class: names.exportProgressMessage,
|
|
40
|
+
role: "alert"
|
|
41
|
+
}, control.error) : null,
|
|
42
|
+
(0, vue.h)("div", { "data-adapttable-part": "export-progress-actions" }, [...[
|
|
43
|
+
["cancel", control.cancel],
|
|
44
|
+
["retry", control.retry],
|
|
45
|
+
["dismiss", control.dismiss]
|
|
46
|
+
].map(([key, action]) => action ? require_basic.headlessButton({
|
|
47
|
+
key,
|
|
48
|
+
"data-adapttable-part": `export-progress-${key}`,
|
|
49
|
+
class: names.exportProgressButton,
|
|
50
|
+
onClick: action.onAction
|
|
51
|
+
}, action.label) : null), control.download ? (0, vue.h)(require_primitive.HeadlessPrimitive, {
|
|
52
|
+
as: "a",
|
|
53
|
+
"data-adapttable-part": "export-progress-download",
|
|
54
|
+
class: names.exportProgressDownload,
|
|
55
|
+
href: control.download.url,
|
|
56
|
+
download: ""
|
|
57
|
+
}, { default: () => control.download?.label }) : null])
|
|
58
|
+
])
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/actions/withHeadlessExport.ts
|
|
62
|
+
function withHeadlessExport(feature) {
|
|
63
|
+
return (0, _adapttable_vue_adapter.extendFeature)(feature, [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.EXPORT_CONTROL, (props) => (0, vue.h)(_adapttable_vue_adapter.ExportChrome, {
|
|
64
|
+
...props,
|
|
65
|
+
slots: headlessExportControls(props.classNames)
|
|
66
|
+
}))]);
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
Object.defineProperty(exports, "withHeadlessExport", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function() {
|
|
72
|
+
return withHeadlessExport;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=withHeadlessExport-BWtz333c.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withHeadlessExport-BWtz333c.cjs","names":["headlessButton","h","HeadlessPrimitive","extendFeature","slotRender","EXPORT_CONTROL","h","ExportChrome"],"sources":["../src/actions/exportControls.ts","../src/actions/withHeadlessExport.ts"],"sourcesContent":["import type { ActionButton, ExportSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { headlessButton } from \"../controls/basic\";\nimport { HeadlessPrimitive } from \"../controls/primitive\";\n\nexport const headlessActionButton = ({ label, attrs, icon }: ActionButton) =>\n headlessButton(attrs, [icon, label]);\n\nexport const headlessExportControls = (\n names: Readonly<Record<string, string | undefined>> = {}\n): ExportSlots => ({\n Button: ({ attrs, label, icon }) =>\n headlessButton(attrs, [\n attrs[\"aria-busy\"] === true\n ? h(\"span\", {\n \"data-adapttable-part\": \"export-spinner\",\n class: [\"at-headless-spinner\", names.exportSpinner],\n \"aria-hidden\": true,\n })\n : icon,\n label,\n ]),\n Surface: (control) =>\n h(\n \"section\",\n {\n \"data-adapttable-part\": \"export-progress-surface\",\n class: names.exportProgress,\n role: \"region\",\n \"aria-label\": control.heading,\n },\n [\n h(\"h3\", control.heading),\n control.status === \"busy\"\n ? h(\n HeadlessPrimitive,\n {\n as: \"div\",\n role: \"progressbar\",\n \"data-adapttable-part\": \"export-progress-bar\",\n class: [\"at-headless-progress\", names.exportProgressBar],\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n \"aria-valuenow\": control.progress,\n \"aria-label\": control.progressLabel,\n \"data-state\":\n control.progress === undefined ? \"indeterminate\" : \"loading\",\n },\n {\n default: () =>\n h(\"div\", {\n class: \"at-headless-progress-indicator\",\n style: {\n inlineSize:\n control.progress === undefined\n ? \"40%\"\n : `${control.progress}%`,\n },\n }),\n }\n )\n : null,\n control.message\n ? h(\n \"p\",\n {\n \"data-adapttable-part\": \"export-progress-message\",\n class: names.exportProgressMessage,\n },\n control.message\n )\n : null,\n control.error\n ? h(\n \"p\",\n {\n \"data-adapttable-part\": \"export-progress-message\",\n class: names.exportProgressMessage,\n role: \"alert\",\n },\n control.error\n )\n : null,\n h(\"div\", { \"data-adapttable-part\": \"export-progress-actions\" }, [\n ...(\n [\n [\"cancel\", control.cancel],\n [\"retry\", control.retry],\n [\"dismiss\", control.dismiss],\n ] as const\n ).map(([key, action]) =>\n action\n ? headlessButton(\n {\n key,\n \"data-adapttable-part\": `export-progress-${key}`,\n class: names.exportProgressButton,\n onClick: action.onAction,\n },\n action.label\n )\n : null\n ),\n control.download\n ? h(\n HeadlessPrimitive,\n {\n as: \"a\",\n \"data-adapttable-part\": \"export-progress-download\",\n class: names.exportProgressDownload,\n href: control.download.url,\n download: \"\",\n },\n { default: () => control.download?.label }\n )\n : null,\n ]),\n ]\n ),\n});\n","import type { TableFeature } from \"@adapttable/vue\";\nimport {\n EXPORT_CONTROL,\n ExportChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { headlessExportControls } from \"./exportControls\";\n\nexport function withHeadlessExport<TRow>(\n feature: TableFeature<TRow>\n): TableFeature<TRow> {\n return extendFeature(feature, [\n slotRender(EXPORT_CONTROL, (props) =>\n h(ExportChrome, {\n ...props,\n slots: headlessExportControls(props.classNames),\n })\n ),\n ]);\n}\n"],"mappings":";;;;;AASA,MAAa,0BACX,QAAsD,CAAC,OACtC;CACjB,SAAS,EAAE,OAAO,OAAO,WACvBA,cAAAA,eAAe,OAAO,CACpB,MAAM,iBAAiB,QAAA,GACnBC,IAAAA,EAAAA,CAAE,QAAQ;EACR,wBAAwB;EACxB,OAAO,CAAC,uBAAuB,MAAM,aAAa;EAClD,eAAe;CACjB,CAAC,IACD,MACJ,KACF,CAAC;CACH,UAAU,aAAA,GACRA,IAAAA,EAAAA,CACE,WACA;EACE,wBAAwB;EACxB,OAAO,MAAM;EACb,MAAM;EACN,cAAc,QAAQ;CACxB,GACA;GACEA,GAAAA,IAAAA,EAAAA,CAAE,MAAM,QAAQ,OAAO;EACvB,QAAQ,WAAW,UAAA,GACfA,IAAAA,EAAAA,CACEC,kBAAAA,mBACA;GACE,IAAI;GACJ,MAAM;GACN,wBAAwB;GACxB,OAAO,CAAC,wBAAwB,MAAM,iBAAiB;GACvD,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,QAAQ;GACzB,cAAc,QAAQ;GACtB,cACE,QAAQ,aAAa,KAAA,IAAY,kBAAkB;EACvD,GACA,EACE,gBAAA,GACED,IAAAA,EAAAA,CAAE,OAAO;GACP,OAAO;GACP,OAAO,EACL,YACE,QAAQ,aAAa,KAAA,IACjB,QACA,GAAG,QAAQ,SAAS,GAC5B;EACF,CAAC,EACL,CACF,IACA;EACJ,QAAQ,WAAA,GACJA,IAAAA,EAAAA,CACE,KACA;GACE,wBAAwB;GACxB,OAAO,MAAM;EACf,GACA,QAAQ,OACV,IACA;EACJ,QAAQ,SAAA,GACJA,IAAAA,EAAAA,CACE,KACA;GACE,wBAAwB;GACxB,OAAO,MAAM;GACb,MAAM;EACR,GACA,QAAQ,KACV,IACA;GACJA,GAAAA,IAAAA,EAAAA,CAAE,OAAO,EAAE,wBAAwB,0BAA0B,GAAG,CAC9D,GACE;GACE,CAAC,UAAU,QAAQ,MAAM;GACzB,CAAC,SAAS,QAAQ,KAAK;GACvB,CAAC,WAAW,QAAQ,OAAO;EAC7B,CAAC,CACD,KAAK,CAAC,KAAK,YACX,SACID,cAAAA,eACE;GACE;GACA,wBAAwB,mBAAmB;GAC3C,OAAO,MAAM;GACb,SAAS,OAAO;EAClB,GACA,OAAO,KACT,IACA,IACN,GACA,QAAQ,YAAA,GACJC,IAAAA,EAAAA,CACEC,kBAAAA,mBACA;GACE,IAAI;GACJ,wBAAwB;GACxB,OAAO,MAAM;GACb,MAAM,QAAQ,SAAS;GACvB,UAAU;EACZ,GACA,EAAE,eAAe,QAAQ,UAAU,MAAM,CAC3C,IACA,IACN,CAAC;CACH,CACF;AACJ;;;AC7GA,SAAgB,mBACd,SACoB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,CAAc,SAAS,EAAA,GAC5BC,wBAAAA,WAAAA,CAAWC,wBAAAA,iBAAiB,WAAA,GAC1BC,IAAAA,EAAAA,CAAEC,wBAAAA,cAAc;EACd,GAAG;EACH,OAAO,uBAAuB,MAAM,UAAU;CAChD,CAAC,CACH,CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { n as HeadlessPrimitive } from "./primitive-DzjBBhOj.js";
|
|
2
|
+
import { t as headlessButton } from "./basic-DX6Oejyw.js";
|
|
3
|
+
import { h } from "vue";
|
|
4
|
+
import { EXPORT_CONTROL, ExportChrome, extendFeature, slotRender } from "@adapttable/vue/adapter";
|
|
5
|
+
//#region src/actions/exportControls.ts
|
|
6
|
+
const headlessExportControls = (names = {}) => ({
|
|
7
|
+
Button: ({ attrs, label, icon }) => headlessButton(attrs, [attrs["aria-busy"] === true ? h("span", {
|
|
8
|
+
"data-adapttable-part": "export-spinner",
|
|
9
|
+
class: ["at-headless-spinner", names.exportSpinner],
|
|
10
|
+
"aria-hidden": true
|
|
11
|
+
}) : icon, label]),
|
|
12
|
+
Surface: (control) => h("section", {
|
|
13
|
+
"data-adapttable-part": "export-progress-surface",
|
|
14
|
+
class: names.exportProgress,
|
|
15
|
+
role: "region",
|
|
16
|
+
"aria-label": control.heading
|
|
17
|
+
}, [
|
|
18
|
+
h("h3", control.heading),
|
|
19
|
+
control.status === "busy" ? h(HeadlessPrimitive, {
|
|
20
|
+
as: "div",
|
|
21
|
+
role: "progressbar",
|
|
22
|
+
"data-adapttable-part": "export-progress-bar",
|
|
23
|
+
class: ["at-headless-progress", names.exportProgressBar],
|
|
24
|
+
"aria-valuemin": 0,
|
|
25
|
+
"aria-valuemax": 100,
|
|
26
|
+
"aria-valuenow": control.progress,
|
|
27
|
+
"aria-label": control.progressLabel,
|
|
28
|
+
"data-state": control.progress === void 0 ? "indeterminate" : "loading"
|
|
29
|
+
}, { default: () => h("div", {
|
|
30
|
+
class: "at-headless-progress-indicator",
|
|
31
|
+
style: { inlineSize: control.progress === void 0 ? "40%" : `${control.progress}%` }
|
|
32
|
+
}) }) : null,
|
|
33
|
+
control.message ? h("p", {
|
|
34
|
+
"data-adapttable-part": "export-progress-message",
|
|
35
|
+
class: names.exportProgressMessage
|
|
36
|
+
}, control.message) : null,
|
|
37
|
+
control.error ? h("p", {
|
|
38
|
+
"data-adapttable-part": "export-progress-message",
|
|
39
|
+
class: names.exportProgressMessage,
|
|
40
|
+
role: "alert"
|
|
41
|
+
}, control.error) : null,
|
|
42
|
+
h("div", { "data-adapttable-part": "export-progress-actions" }, [...[
|
|
43
|
+
["cancel", control.cancel],
|
|
44
|
+
["retry", control.retry],
|
|
45
|
+
["dismiss", control.dismiss]
|
|
46
|
+
].map(([key, action]) => action ? headlessButton({
|
|
47
|
+
key,
|
|
48
|
+
"data-adapttable-part": `export-progress-${key}`,
|
|
49
|
+
class: names.exportProgressButton,
|
|
50
|
+
onClick: action.onAction
|
|
51
|
+
}, action.label) : null), control.download ? h(HeadlessPrimitive, {
|
|
52
|
+
as: "a",
|
|
53
|
+
"data-adapttable-part": "export-progress-download",
|
|
54
|
+
class: names.exportProgressDownload,
|
|
55
|
+
href: control.download.url,
|
|
56
|
+
download: ""
|
|
57
|
+
}, { default: () => control.download?.label }) : null])
|
|
58
|
+
])
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/actions/withHeadlessExport.ts
|
|
62
|
+
function withHeadlessExport(feature) {
|
|
63
|
+
return extendFeature(feature, [slotRender(EXPORT_CONTROL, (props) => h(ExportChrome, {
|
|
64
|
+
...props,
|
|
65
|
+
slots: headlessExportControls(props.classNames)
|
|
66
|
+
}))]);
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { withHeadlessExport as t };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=withHeadlessExport-BccRGCD8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withHeadlessExport-BccRGCD8.js","names":[],"sources":["../src/actions/exportControls.ts","../src/actions/withHeadlessExport.ts"],"sourcesContent":["import type { ActionButton, ExportSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { headlessButton } from \"../controls/basic\";\nimport { HeadlessPrimitive } from \"../controls/primitive\";\n\nexport const headlessActionButton = ({ label, attrs, icon }: ActionButton) =>\n headlessButton(attrs, [icon, label]);\n\nexport const headlessExportControls = (\n names: Readonly<Record<string, string | undefined>> = {}\n): ExportSlots => ({\n Button: ({ attrs, label, icon }) =>\n headlessButton(attrs, [\n attrs[\"aria-busy\"] === true\n ? h(\"span\", {\n \"data-adapttable-part\": \"export-spinner\",\n class: [\"at-headless-spinner\", names.exportSpinner],\n \"aria-hidden\": true,\n })\n : icon,\n label,\n ]),\n Surface: (control) =>\n h(\n \"section\",\n {\n \"data-adapttable-part\": \"export-progress-surface\",\n class: names.exportProgress,\n role: \"region\",\n \"aria-label\": control.heading,\n },\n [\n h(\"h3\", control.heading),\n control.status === \"busy\"\n ? h(\n HeadlessPrimitive,\n {\n as: \"div\",\n role: \"progressbar\",\n \"data-adapttable-part\": \"export-progress-bar\",\n class: [\"at-headless-progress\", names.exportProgressBar],\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n \"aria-valuenow\": control.progress,\n \"aria-label\": control.progressLabel,\n \"data-state\":\n control.progress === undefined ? \"indeterminate\" : \"loading\",\n },\n {\n default: () =>\n h(\"div\", {\n class: \"at-headless-progress-indicator\",\n style: {\n inlineSize:\n control.progress === undefined\n ? \"40%\"\n : `${control.progress}%`,\n },\n }),\n }\n )\n : null,\n control.message\n ? h(\n \"p\",\n {\n \"data-adapttable-part\": \"export-progress-message\",\n class: names.exportProgressMessage,\n },\n control.message\n )\n : null,\n control.error\n ? h(\n \"p\",\n {\n \"data-adapttable-part\": \"export-progress-message\",\n class: names.exportProgressMessage,\n role: \"alert\",\n },\n control.error\n )\n : null,\n h(\"div\", { \"data-adapttable-part\": \"export-progress-actions\" }, [\n ...(\n [\n [\"cancel\", control.cancel],\n [\"retry\", control.retry],\n [\"dismiss\", control.dismiss],\n ] as const\n ).map(([key, action]) =>\n action\n ? headlessButton(\n {\n key,\n \"data-adapttable-part\": `export-progress-${key}`,\n class: names.exportProgressButton,\n onClick: action.onAction,\n },\n action.label\n )\n : null\n ),\n control.download\n ? h(\n HeadlessPrimitive,\n {\n as: \"a\",\n \"data-adapttable-part\": \"export-progress-download\",\n class: names.exportProgressDownload,\n href: control.download.url,\n download: \"\",\n },\n { default: () => control.download?.label }\n )\n : null,\n ]),\n ]\n ),\n});\n","import type { TableFeature } from \"@adapttable/vue\";\nimport {\n EXPORT_CONTROL,\n ExportChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { headlessExportControls } from \"./exportControls\";\n\nexport function withHeadlessExport<TRow>(\n feature: TableFeature<TRow>\n): TableFeature<TRow> {\n return extendFeature(feature, [\n slotRender(EXPORT_CONTROL, (props) =>\n h(ExportChrome, {\n ...props,\n slots: headlessExportControls(props.classNames),\n })\n ),\n ]);\n}\n"],"mappings":";;;;;AASA,MAAa,0BACX,QAAsD,CAAC,OACtC;CACjB,SAAS,EAAE,OAAO,OAAO,WACvB,eAAe,OAAO,CACpB,MAAM,iBAAiB,OACnB,EAAE,QAAQ;EACR,wBAAwB;EACxB,OAAO,CAAC,uBAAuB,MAAM,aAAa;EAClD,eAAe;CACjB,CAAC,IACD,MACJ,KACF,CAAC;CACH,UAAU,YACR,EACE,WACA;EACE,wBAAwB;EACxB,OAAO,MAAM;EACb,MAAM;EACN,cAAc,QAAQ;CACxB,GACA;EACE,EAAE,MAAM,QAAQ,OAAO;EACvB,QAAQ,WAAW,SACf,EACE,mBACA;GACE,IAAI;GACJ,MAAM;GACN,wBAAwB;GACxB,OAAO,CAAC,wBAAwB,MAAM,iBAAiB;GACvD,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,QAAQ;GACzB,cAAc,QAAQ;GACtB,cACE,QAAQ,aAAa,KAAA,IAAY,kBAAkB;EACvD,GACA,EACE,eACE,EAAE,OAAO;GACP,OAAO;GACP,OAAO,EACL,YACE,QAAQ,aAAa,KAAA,IACjB,QACA,GAAG,QAAQ,SAAS,GAC5B;EACF,CAAC,EACL,CACF,IACA;EACJ,QAAQ,UACJ,EACE,KACA;GACE,wBAAwB;GACxB,OAAO,MAAM;EACf,GACA,QAAQ,OACV,IACA;EACJ,QAAQ,QACJ,EACE,KACA;GACE,wBAAwB;GACxB,OAAO,MAAM;GACb,MAAM;EACR,GACA,QAAQ,KACV,IACA;EACJ,EAAE,OAAO,EAAE,wBAAwB,0BAA0B,GAAG,CAC9D,GACE;GACE,CAAC,UAAU,QAAQ,MAAM;GACzB,CAAC,SAAS,QAAQ,KAAK;GACvB,CAAC,WAAW,QAAQ,OAAO;EAC7B,CAAC,CACD,KAAK,CAAC,KAAK,YACX,SACI,eACE;GACE;GACA,wBAAwB,mBAAmB;GAC3C,OAAO,MAAM;GACb,SAAS,OAAO;EAClB,GACA,OAAO,KACT,IACA,IACN,GACA,QAAQ,WACJ,EACE,mBACA;GACE,IAAI;GACJ,wBAAwB;GACxB,OAAO,MAAM;GACb,MAAM,QAAQ,SAAS;GACvB,UAAU;EACZ,GACA,EAAE,eAAe,QAAQ,UAAU,MAAM,CAC3C,IACA,IACN,CAAC;CACH,CACF;AACJ;;;AC7GA,SAAgB,mBACd,SACoB;CACpB,OAAO,cAAc,SAAS,CAC5B,WAAW,iBAAiB,UAC1B,EAAE,cAAc;EACd,GAAG;EACH,OAAO,uBAAuB,MAAM,UAAU;CAChD,CAAC,CACH,CACF,CAAC;AACH"}
|