@atscript/vue-table 0.1.105 → 0.1.107
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/dist/as-action-form-dialog.cjs +1 -1
- package/dist/as-action-form-dialog.mjs +1 -1
- package/dist/{as-action-menu-content-DsAb2Z1_.cjs → as-action-menu-content-C566-BZi.cjs} +1 -1
- package/dist/{as-action-menu-content-DEOJ4c9c.mjs → as-action-menu-content-QLqwcIyN.mjs} +1 -1
- package/dist/{as-config-dialog-BSYeHrVi.cjs → as-config-dialog-6QNcUtFs.cjs} +2 -2
- package/dist/{as-config-dialog-ejWEs-Mk.mjs → as-config-dialog-mz5oML3g.mjs} +2 -2
- package/dist/as-config-dialog.cjs +1 -1
- package/dist/as-config-dialog.mjs +1 -1
- package/dist/{as-confirm-dialog-DThHWg1q.mjs → as-confirm-dialog-Dj-nIpgR.mjs} +1 -1
- package/dist/{as-confirm-dialog-Ds0bsoxY.cjs → as-confirm-dialog-dnSPMGyB.cjs} +1 -1
- package/dist/as-confirm-dialog.cjs +1 -1
- package/dist/as-confirm-dialog.mjs +1 -1
- package/dist/{as-filter-dialog-C-Iw1pEJ.cjs → as-filter-dialog-BBMHtQRx.cjs} +7 -7
- package/dist/{as-filter-dialog-CtMsxzJG.mjs → as-filter-dialog-BFy5tg8o.mjs} +7 -7
- package/dist/as-filter-dialog.cjs +1 -1
- package/dist/as-filter-dialog.mjs +1 -1
- package/dist/{as-filter-field-r-vkcWBY.cjs → as-filter-field-BRSNhFa5.cjs} +3 -3
- package/dist/{as-filter-field-DPb7bhIf.mjs → as-filter-field-DiSwUOJG.mjs} +3 -3
- package/dist/as-filter-field.cjs +1 -1
- package/dist/as-filter-field.mjs +1 -1
- package/dist/{as-filters-CHtxp1Fx.cjs → as-filters-B82jw5f5.cjs} +3 -3
- package/dist/{as-filters-xplRbLmV.mjs → as-filters-N95wOVF4.mjs} +3 -3
- package/dist/as-filters.cjs +1 -1
- package/dist/as-filters.mjs +1 -1
- package/dist/{as-preset-dialog-DnK_Gi_z.mjs → as-preset-dialog-DZ106BdC.mjs} +1 -1
- package/dist/{as-preset-dialog-zsbgrl-D.cjs → as-preset-dialog-KUcH4G-M.cjs} +1 -1
- package/dist/as-preset-dialog.cjs +1 -1
- package/dist/as-preset-dialog.mjs +1 -1
- package/dist/{as-preset-picker-BuyHHYD6.mjs → as-preset-picker-DUEObd_i.mjs} +1 -1
- package/dist/{as-preset-picker-B2FVgmXk.cjs → as-preset-picker-DrhvxmxV.cjs} +1 -1
- package/dist/as-preset-picker.cjs +1 -1
- package/dist/as-preset-picker.mjs +1 -1
- package/dist/{as-row-actions-Cq_Eoxpn.mjs → as-row-actions-CrqYfsva.mjs} +2 -2
- package/dist/{as-row-actions-DJXX81aA.cjs → as-row-actions-DSsKbKGO.cjs} +2 -2
- package/dist/as-row-actions.cjs +1 -1
- package/dist/as-row-actions.mjs +1 -1
- package/dist/{as-table-BhtyI18Z.mjs → as-table-Bo2dAWTD.mjs} +10 -3
- package/dist/{as-table-GS-99KAe.cjs → as-table-MKVsJZxT.cjs} +10 -3
- package/dist/{as-table-actions-42ObwQBE.mjs → as-table-actions-CJfrl39w.mjs} +9 -4
- package/dist/{as-table-actions-CmvhBaZH.cjs → as-table-actions-_kHRpDah.cjs} +9 -4
- package/dist/as-table-actions.cjs +1 -1
- package/dist/as-table-actions.d.cts +1 -1
- package/dist/as-table-actions.d.mts +1 -1
- package/dist/as-table-actions.mjs +1 -1
- package/dist/{as-table-actions.vue-C36YeIUD.d.cts → as-table-actions.vue-CCCICVBr.d.cts} +1 -1
- package/dist/{as-table-actions.vue-CnL92_MD.d.mts → as-table-actions.vue-l3DnLVxA.d.mts} +1 -1
- package/dist/{as-table-base-BZV-Nd_X.mjs → as-table-base-BxruWtW2.mjs} +23 -6
- package/dist/{as-table-base-C1GvdzBY.cjs → as-table-base-D6VP4rrr.cjs} +23 -6
- package/dist/{as-table-header-cell-BRG9MJMO.cjs → as-table-header-cell-BeHbNQjP.cjs} +1 -1
- package/dist/{as-table-header-cell-CwFFk8f0.mjs → as-table-header-cell-xKGgCjbF.mjs} +1 -1
- package/dist/as-table-header-cell.cjs +1 -1
- package/dist/as-table-header-cell.mjs +1 -1
- package/dist/{as-table-root-DOE4CqP1.mjs → as-table-root-CqjewHJz.mjs} +4 -4
- package/dist/{as-table-root-CAuiC2K_.cjs → as-table-root-DFYbEtFF.cjs} +4 -4
- package/dist/as-table-root.cjs +1 -1
- package/dist/as-table-root.d.cts +1 -1
- package/dist/as-table-root.d.mts +1 -1
- package/dist/as-table-root.mjs +1 -1
- package/dist/{as-table-root.vue-Boq6pDr1.d.mts → as-table-root.vue-BjeThuub.d.mts} +4 -4
- package/dist/{as-table-root.vue-CYmnf5SH.d.cts → as-table-root.vue-BukHIoYu.d.cts} +4 -4
- package/dist/{as-table-status-D8DJYUYF.mjs → as-table-status-4OaguC5n.mjs} +81 -8
- package/dist/{as-table-status-DHgPM8vQ.cjs → as-table-status-Diyy3DFB.cjs} +86 -7
- package/dist/as-table.cjs +1 -1
- package/dist/as-table.d.cts +1 -1
- package/dist/as-table.d.mts +1 -1
- package/dist/as-table.mjs +1 -1
- package/dist/{as-table.vue-4NViMhLE.d.cts → as-table.vue-CDPbZQRG.d.cts} +13 -5
- package/dist/{as-table.vue-UzgniXai.d.mts → as-table.vue-DaVtNFIe.d.mts} +13 -5
- package/dist/{as-window-table-C1U2gHNy.mjs → as-window-table-BUrMxrbr.mjs} +139 -113
- package/dist/{as-window-table-C4jdyIdV.cjs → as-window-table-DtnaCKyR.cjs} +139 -113
- package/dist/as-window-table.cjs +1 -1
- package/dist/as-window-table.d.cts +1 -1
- package/dist/as-window-table.d.mts +1 -1
- package/dist/as-window-table.mjs +1 -1
- package/dist/{as-window-table.vue-BGz0OaFR.d.cts → as-window-table.vue-DvzoPu-B.d.cts} +13 -5
- package/dist/{as-window-table.vue-CuMQMCnY.d.mts → as-window-table.vue-Gs52IsYw.d.mts} +13 -5
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +17 -17
- package/dist/{use-table-DCH9Sl8T.mjs → use-table-BDkSpj7h.mjs} +1 -1
- package/dist/{use-table-column-handlers-cm0GxR2u.mjs → use-table-column-handlers-CpiiIniD.mjs} +1 -2
- package/dist/{use-table-column-handlers-BgC4gUJV.cjs → use-table-column-handlers-ehreEzcx.cjs} +1 -2
- package/dist/{use-table-component-BIpRevq0.cjs → use-table-component-Bs1T8Mk3.cjs} +1 -1
- package/dist/{use-table-component-Be6w6eL4.mjs → use-table-component-D1Ea4qv_.mjs} +1 -1
- package/dist/{use-table-nav-bridge-jCmNrUfV.cjs → use-table-nav-bridge-DVAQCVrs.cjs} +1 -1
- package/dist/{use-table-nav-bridge-D5B1YBDN.mjs → use-table-nav-bridge-jZMWrBI8.mjs} +1 -1
- package/dist/{use-table-state-C8aMAtiS.mjs → use-table-state-C0m71e4n.mjs} +72 -23
- package/dist/{use-table-state-C3IJ8dJ4.cjs → use-table-state-CmTX31G4.cjs} +77 -22
- package/dist/{use-table-EVIJL8m4.cjs → use-table-w7Bpuk95.cjs} +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_table_header_cell = require("./as-table-header-cell-
|
|
1
|
+
const require_as_table_header_cell = require("./as-table-header-cell-BeHbNQjP.cjs");
|
|
2
2
|
module.exports = require_as_table_header_cell.as_table_header_cell_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
1
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-xKGgCjbF.mjs";
|
|
2
2
|
export { as_table_header_cell_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as useRegisterMainActionListener } from "./use-table-state-
|
|
2
|
-
import { n as useTable } from "./use-table-
|
|
3
|
-
import { t as useTableNavBridge } from "./use-table-nav-bridge-
|
|
1
|
+
import { i as useRegisterMainActionListener } from "./use-table-state-C0m71e4n.mjs";
|
|
2
|
+
import { n as useTable } from "./use-table-BDkSpj7h.mjs";
|
|
3
|
+
import { t as useTableNavBridge } from "./use-table-nav-bridge-jZMWrBI8.mjs";
|
|
4
4
|
import { t as useHasEmitListener } from "./use-has-emit-listener-BTMDIv2e.mjs";
|
|
5
|
-
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-
|
|
5
|
+
import { t as as_confirm_dialog_default } from "./as-confirm-dialog-Dj-nIpgR.mjs";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineAsyncComponent, defineComponent, mergeModels, openBlock, ref, renderSlot, resolveDynamicComponent, unref, useModel, watch } from "vue";
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/components/as-table-root.vue
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_use_table = require("./use-table-
|
|
3
|
-
const require_use_table_nav_bridge = require("./use-table-nav-bridge-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-CmTX31G4.cjs");
|
|
2
|
+
const require_use_table = require("./use-table-w7Bpuk95.cjs");
|
|
3
|
+
const require_use_table_nav_bridge = require("./use-table-nav-bridge-DVAQCVrs.cjs");
|
|
4
4
|
const require_use_has_emit_listener = require("./use-has-emit-listener-hhOH8CBI.cjs");
|
|
5
|
-
const require_as_confirm_dialog = require("./as-confirm-dialog-
|
|
5
|
+
const require_as_confirm_dialog = require("./as-confirm-dialog-dnSPMGyB.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/components/as-table-root.vue
|
package/dist/as-table-root.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_table_root = require("./as-table-root-
|
|
1
|
+
const require_as_table_root = require("./as-table-root-DFYbEtFF.cjs");
|
|
2
2
|
module.exports = require_as_table_root.as_table_root_default;
|
package/dist/as-table-root.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table-root.vue-
|
|
1
|
+
import { t as _default } from "./as-table-root.vue-BukHIoYu.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-table-root.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table-root.vue-
|
|
1
|
+
import { t as _default } from "./as-table-root.vue-BjeThuub.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-table-root.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_table_root_default } from "./as-table-root-
|
|
1
|
+
import { t as as_table_root_default } from "./as-table-root-CqjewHJz.mjs";
|
|
2
2
|
export { as_table_root_default as default };
|
|
@@ -2255,17 +2255,17 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
|
|
|
2255
2255
|
"update:selectedRows": (value: unknown[]) => any;
|
|
2256
2256
|
"update:urlQuery": (value: string | undefined) => any;
|
|
2257
2257
|
} & {
|
|
2258
|
-
action: (
|
|
2259
|
-
|
|
2258
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
2259
|
+
action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
|
|
2260
2260
|
}, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
2261
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
2262
|
+
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
|
|
2261
2263
|
"onUpdate:filterFields"?: ((value: string[]) => any) | undefined;
|
|
2262
2264
|
"onUpdate:columnNames"?: ((value: string[]) => any) | undefined;
|
|
2263
2265
|
"onUpdate:columnWidths"?: ((value: ColumnWidthsMap) => any) | undefined;
|
|
2264
2266
|
"onUpdate:sorters"?: ((value: SortControl[]) => any) | undefined;
|
|
2265
2267
|
"onUpdate:selectedRows"?: ((value: unknown[]) => any) | undefined;
|
|
2266
2268
|
"onUpdate:urlQuery"?: ((value: string | undefined) => any) | undefined;
|
|
2267
|
-
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent | undefined) => any) | undefined;
|
|
2268
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
2269
2269
|
}>, {
|
|
2270
2270
|
queryOnMount: boolean;
|
|
2271
2271
|
selectionPersistence: SelectionPersistence;
|
|
@@ -2255,17 +2255,17 @@ declare const __VLS_base: vue.DefineComponent<__VLS_PublicProps, {
|
|
|
2255
2255
|
"update:selectedRows": (value: unknown[]) => any;
|
|
2256
2256
|
"update:urlQuery": (value: string | undefined) => any;
|
|
2257
2257
|
} & {
|
|
2258
|
-
action: (
|
|
2259
|
-
|
|
2258
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
2259
|
+
action: (action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any;
|
|
2260
2260
|
}, string, vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
2261
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
2262
|
+
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: MouseEvent | KeyboardEvent | undefined) => any) | undefined;
|
|
2261
2263
|
"onUpdate:filterFields"?: ((value: string[]) => any) | undefined;
|
|
2262
2264
|
"onUpdate:columnNames"?: ((value: string[]) => any) | undefined;
|
|
2263
2265
|
"onUpdate:columnWidths"?: ((value: ColumnWidthsMap) => any) | undefined;
|
|
2264
2266
|
"onUpdate:sorters"?: ((value: SortControl[]) => any) | undefined;
|
|
2265
2267
|
"onUpdate:selectedRows"?: ((value: unknown[]) => any) | undefined;
|
|
2266
2268
|
"onUpdate:urlQuery"?: ((value: string | undefined) => any) | undefined;
|
|
2267
|
-
onAction?: ((action: TVueTableActionInfo, ids: unknown[], result: ActionResult, event?: KeyboardEvent | MouseEvent | undefined) => any) | undefined;
|
|
2268
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
2269
2269
|
}>, {
|
|
2270
2270
|
queryOnMount: boolean;
|
|
2271
2271
|
selectionPersistence: SelectionPersistence;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as useTableContextOptional } from "./use-table-state-
|
|
2
|
-
import { t as useTableComponent } from "./use-table-component-
|
|
3
|
-
import { t as as_table_header_cell_default } from "./as-table-header-cell-
|
|
4
|
-
import { t as as_row_actions_default } from "./as-row-actions-
|
|
1
|
+
import { o as useTableContextOptional } from "./use-table-state-C0m71e4n.mjs";
|
|
2
|
+
import { t as useTableComponent } from "./use-table-component-D1Ea4qv_.mjs";
|
|
3
|
+
import { t as as_table_header_cell_default } from "./as-table-header-cell-xKGgCjbF.mjs";
|
|
4
|
+
import { t as as_row_actions_default } from "./as-row-actions-CrqYfsva.mjs";
|
|
5
5
|
import { t as as_table_cell_value_default } from "./as-table-cell-value-Byrb_Zyh.mjs";
|
|
6
6
|
import { UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_STYLES, UI_TABLE_STYLES, getFieldMeta, parseStaticAttrs, resolveAttrs, resolveFieldProp } from "@atscript/ui";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withModifiers } from "vue";
|
|
@@ -194,6 +194,19 @@ function useRafBatch(onFlush) {
|
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
196
|
//#region src/composables/use-column-header-drag-resize.ts
|
|
197
|
+
/**
|
|
198
|
+
* Pure width lookup shared by the header `<th>` and the `<colgroup>` `<col>`.
|
|
199
|
+
* Resolves the applied width for a column from the widths map, falling back to
|
|
200
|
+
* `col.width` for columns the table-state-side reconcile doesn't see — chiefly
|
|
201
|
+
* the synthesized `__actions` pseudo-column, which lives in `<AsTable>`'s
|
|
202
|
+
* `effectiveColumns` but never enters `state.columnWidths` (reconcile runs on
|
|
203
|
+
* `def.columns` only). Without this fallback the synthesized column collapses
|
|
204
|
+
* to 0 and its cells become invisible. Both the `<col>` and `<th>` MUST resolve
|
|
205
|
+
* width through this single function so they never disagree.
|
|
206
|
+
*/
|
|
207
|
+
function resolveColumnWidth(columnWidths, col) {
|
|
208
|
+
return columnWidths[col.path]?.w ?? col.width;
|
|
209
|
+
}
|
|
197
210
|
function pathOf(event) {
|
|
198
211
|
return event.currentTarget?.dataset.columnPath ?? null;
|
|
199
212
|
}
|
|
@@ -282,9 +295,8 @@ function useColumnHeaderDragResize(opts) {
|
|
|
282
295
|
opts.onAutoFit(found.th, found.path);
|
|
283
296
|
}
|
|
284
297
|
function widthStyle(col) {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
if (col.width) return { width: col.width };
|
|
298
|
+
const w = resolveColumnWidth(opts.columnWidths(), col);
|
|
299
|
+
return w ? { width: w } : void 0;
|
|
288
300
|
}
|
|
289
301
|
function thClasses(path) {
|
|
290
302
|
const reorder = opts.reorderable();
|
|
@@ -312,6 +324,62 @@ function useColumnHeaderDragResize(opts) {
|
|
|
312
324
|
};
|
|
313
325
|
}
|
|
314
326
|
//#endregion
|
|
327
|
+
//#region src/components/internal/as-table-colgroup.vue?vue&type=script&setup=true&lang.ts
|
|
328
|
+
const _hoisted_1$2 = {
|
|
329
|
+
key: 0,
|
|
330
|
+
class: "as-col-select"
|
|
331
|
+
};
|
|
332
|
+
const _hoisted_2$2 = ["data-column-path"];
|
|
333
|
+
const _hoisted_3$2 = {
|
|
334
|
+
key: 1,
|
|
335
|
+
class: "as-col-filler"
|
|
336
|
+
};
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/components/internal/as-table-colgroup.vue
|
|
339
|
+
var as_table_colgroup_default = /* @__PURE__ */ defineComponent({
|
|
340
|
+
__name: "as-table-colgroup",
|
|
341
|
+
props: {
|
|
342
|
+
columns: {
|
|
343
|
+
type: Array,
|
|
344
|
+
required: true
|
|
345
|
+
},
|
|
346
|
+
columnWidths: {
|
|
347
|
+
type: Object,
|
|
348
|
+
required: true
|
|
349
|
+
},
|
|
350
|
+
hasSelect: {
|
|
351
|
+
type: Boolean,
|
|
352
|
+
required: true
|
|
353
|
+
},
|
|
354
|
+
withFiller: {
|
|
355
|
+
type: Boolean,
|
|
356
|
+
required: true
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
setup(__props) {
|
|
360
|
+
const props = __props;
|
|
361
|
+
function colStyle(col) {
|
|
362
|
+
const w = resolveColumnWidth(props.columnWidths, col);
|
|
363
|
+
return w ? { width: w } : void 0;
|
|
364
|
+
}
|
|
365
|
+
return (_ctx, _cache) => {
|
|
366
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode("\n `<colgroup>` carries column widths independently of the header so widths\n survive when `<thead>` is omitted (`headless`). Col order MUST match the\n body `<td>` order exactly: select col (when `hasSelect`), data columns,\n then the filler col (when `withFiller`).\n "), createElementVNode("colgroup", null, [
|
|
367
|
+
createCommentVNode(" Placeholder for the leading select column. No width — `as-td-select`\n self-sizes (`w-[4em]`); the col exists only for positional alignment. "),
|
|
368
|
+
__props.hasSelect ? (openBlock(), createElementBlock("col", _hoisted_1$2)) : createCommentVNode("v-if", true),
|
|
369
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
|
|
370
|
+
return openBlock(), createElementBlock("col", {
|
|
371
|
+
key: col.path,
|
|
372
|
+
"data-column-path": col.path,
|
|
373
|
+
style: normalizeStyle(colStyle(col))
|
|
374
|
+
}, null, 12, _hoisted_2$2);
|
|
375
|
+
}), 128)),
|
|
376
|
+
createCommentVNode(" Trailing filler col; absorbs leftover space, no width. "),
|
|
377
|
+
__props.withFiller ? (openBlock(), createElementBlock("col", _hoisted_3$2)) : createCommentVNode("v-if", true)
|
|
378
|
+
])], 2112);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
//#endregion
|
|
315
383
|
//#region src/components/internal/as-table-header.vue?vue&type=script&setup=true&lang.ts
|
|
316
384
|
const _hoisted_1$1 = {
|
|
317
385
|
key: 0,
|
|
@@ -448,11 +516,16 @@ var as_table_header_default = /* @__PURE__ */ defineComponent({
|
|
|
448
516
|
const origTableWidth = table.style.width;
|
|
449
517
|
const origTableMinWidth = table.style.minWidth;
|
|
450
518
|
const origThWidth = th.style.width;
|
|
519
|
+
const path = th.dataset.columnPath;
|
|
520
|
+
const col = path ? table.querySelector(`colgroup col[data-column-path="${path}"]`) : null;
|
|
521
|
+
const origColWidth = col?.style.width;
|
|
451
522
|
table.style.tableLayout = "auto";
|
|
452
523
|
table.style.minWidth = "0";
|
|
453
524
|
table.style.width = "max-content";
|
|
454
525
|
th.style.width = "max-content";
|
|
526
|
+
if (col) col.style.width = "";
|
|
455
527
|
const measured = th.offsetWidth;
|
|
528
|
+
if (col) col.style.width = origColWidth ?? "";
|
|
456
529
|
th.style.width = origThWidth;
|
|
457
530
|
table.style.width = origTableWidth;
|
|
458
531
|
table.style.minWidth = origTableMinWidth;
|
|
@@ -635,4 +708,4 @@ var as_table_status_default = /* @__PURE__ */ defineComponent({
|
|
|
635
708
|
}
|
|
636
709
|
});
|
|
637
710
|
//#endregion
|
|
638
|
-
export {
|
|
711
|
+
export { useCellComponents as a, useRafBatch as i, as_table_header_default as n, useCellResolver as o, as_table_colgroup_default as r, as_table_status_default as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_use_table_state = require("./use-table-state-
|
|
2
|
-
const require_use_table_component = require("./use-table-component-
|
|
3
|
-
const require_as_table_header_cell = require("./as-table-header-cell-
|
|
4
|
-
const require_as_row_actions = require("./as-row-actions-
|
|
1
|
+
const require_use_table_state = require("./use-table-state-CmTX31G4.cjs");
|
|
2
|
+
const require_use_table_component = require("./use-table-component-Bs1T8Mk3.cjs");
|
|
3
|
+
const require_as_table_header_cell = require("./as-table-header-cell-BeHbNQjP.cjs");
|
|
4
|
+
const require_as_row_actions = require("./as-row-actions-DSsKbKGO.cjs");
|
|
5
5
|
const require_as_table_cell_value = require("./as-table-cell-value-CcWR5oG4.cjs");
|
|
6
6
|
let _atscript_ui = require("@atscript/ui");
|
|
7
7
|
let vue = require("vue");
|
|
@@ -194,6 +194,19 @@ function useRafBatch(onFlush) {
|
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
196
|
//#region src/composables/use-column-header-drag-resize.ts
|
|
197
|
+
/**
|
|
198
|
+
* Pure width lookup shared by the header `<th>` and the `<colgroup>` `<col>`.
|
|
199
|
+
* Resolves the applied width for a column from the widths map, falling back to
|
|
200
|
+
* `col.width` for columns the table-state-side reconcile doesn't see — chiefly
|
|
201
|
+
* the synthesized `__actions` pseudo-column, which lives in `<AsTable>`'s
|
|
202
|
+
* `effectiveColumns` but never enters `state.columnWidths` (reconcile runs on
|
|
203
|
+
* `def.columns` only). Without this fallback the synthesized column collapses
|
|
204
|
+
* to 0 and its cells become invisible. Both the `<col>` and `<th>` MUST resolve
|
|
205
|
+
* width through this single function so they never disagree.
|
|
206
|
+
*/
|
|
207
|
+
function resolveColumnWidth(columnWidths, col) {
|
|
208
|
+
return columnWidths[col.path]?.w ?? col.width;
|
|
209
|
+
}
|
|
197
210
|
function pathOf(event) {
|
|
198
211
|
return event.currentTarget?.dataset.columnPath ?? null;
|
|
199
212
|
}
|
|
@@ -282,9 +295,8 @@ function useColumnHeaderDragResize(opts) {
|
|
|
282
295
|
opts.onAutoFit(found.th, found.path);
|
|
283
296
|
}
|
|
284
297
|
function widthStyle(col) {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
if (col.width) return { width: col.width };
|
|
298
|
+
const w = resolveColumnWidth(opts.columnWidths(), col);
|
|
299
|
+
return w ? { width: w } : void 0;
|
|
288
300
|
}
|
|
289
301
|
function thClasses(path) {
|
|
290
302
|
const reorder = opts.reorderable();
|
|
@@ -312,6 +324,62 @@ function useColumnHeaderDragResize(opts) {
|
|
|
312
324
|
};
|
|
313
325
|
}
|
|
314
326
|
//#endregion
|
|
327
|
+
//#region src/components/internal/as-table-colgroup.vue?vue&type=script&setup=true&lang.ts
|
|
328
|
+
const _hoisted_1$2 = {
|
|
329
|
+
key: 0,
|
|
330
|
+
class: "as-col-select"
|
|
331
|
+
};
|
|
332
|
+
const _hoisted_2$2 = ["data-column-path"];
|
|
333
|
+
const _hoisted_3$2 = {
|
|
334
|
+
key: 1,
|
|
335
|
+
class: "as-col-filler"
|
|
336
|
+
};
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/components/internal/as-table-colgroup.vue
|
|
339
|
+
var as_table_colgroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
340
|
+
__name: "as-table-colgroup",
|
|
341
|
+
props: {
|
|
342
|
+
columns: {
|
|
343
|
+
type: Array,
|
|
344
|
+
required: true
|
|
345
|
+
},
|
|
346
|
+
columnWidths: {
|
|
347
|
+
type: Object,
|
|
348
|
+
required: true
|
|
349
|
+
},
|
|
350
|
+
hasSelect: {
|
|
351
|
+
type: Boolean,
|
|
352
|
+
required: true
|
|
353
|
+
},
|
|
354
|
+
withFiller: {
|
|
355
|
+
type: Boolean,
|
|
356
|
+
required: true
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
setup(__props) {
|
|
360
|
+
const props = __props;
|
|
361
|
+
function colStyle(col) {
|
|
362
|
+
const w = resolveColumnWidth(props.columnWidths, col);
|
|
363
|
+
return w ? { width: w } : void 0;
|
|
364
|
+
}
|
|
365
|
+
return (_ctx, _cache) => {
|
|
366
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)("\n `<colgroup>` carries column widths independently of the header so widths\n survive when `<thead>` is omitted (`headless`). Col order MUST match the\n body `<td>` order exactly: select col (when `hasSelect`), data columns,\n then the filler col (when `withFiller`).\n "), (0, vue.createElementVNode)("colgroup", null, [
|
|
367
|
+
(0, vue.createCommentVNode)(" Placeholder for the leading select column. No width — `as-td-select`\n self-sizes (`w-[4em]`); the col exists only for positional alignment. "),
|
|
368
|
+
__props.hasSelect ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_1$2)) : (0, vue.createCommentVNode)("v-if", true),
|
|
369
|
+
((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.columns, (col) => {
|
|
370
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("col", {
|
|
371
|
+
key: col.path,
|
|
372
|
+
"data-column-path": col.path,
|
|
373
|
+
style: (0, vue.normalizeStyle)(colStyle(col))
|
|
374
|
+
}, null, 12, _hoisted_2$2);
|
|
375
|
+
}), 128)),
|
|
376
|
+
(0, vue.createCommentVNode)(" Trailing filler col; absorbs leftover space, no width. "),
|
|
377
|
+
__props.withFiller ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("col", _hoisted_3$2)) : (0, vue.createCommentVNode)("v-if", true)
|
|
378
|
+
])], 2112);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
//#endregion
|
|
315
383
|
//#region src/components/internal/as-table-header.vue?vue&type=script&setup=true&lang.ts
|
|
316
384
|
const _hoisted_1$1 = {
|
|
317
385
|
key: 0,
|
|
@@ -448,11 +516,16 @@ var as_table_header_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
448
516
|
const origTableWidth = table.style.width;
|
|
449
517
|
const origTableMinWidth = table.style.minWidth;
|
|
450
518
|
const origThWidth = th.style.width;
|
|
519
|
+
const path = th.dataset.columnPath;
|
|
520
|
+
const col = path ? table.querySelector(`colgroup col[data-column-path="${path}"]`) : null;
|
|
521
|
+
const origColWidth = col?.style.width;
|
|
451
522
|
table.style.tableLayout = "auto";
|
|
452
523
|
table.style.minWidth = "0";
|
|
453
524
|
table.style.width = "max-content";
|
|
454
525
|
th.style.width = "max-content";
|
|
526
|
+
if (col) col.style.width = "";
|
|
455
527
|
const measured = th.offsetWidth;
|
|
528
|
+
if (col) col.style.width = origColWidth ?? "";
|
|
456
529
|
th.style.width = origThWidth;
|
|
457
530
|
table.style.width = origTableWidth;
|
|
458
531
|
table.style.minWidth = origTableMinWidth;
|
|
@@ -635,6 +708,12 @@ var as_table_status_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
635
708
|
}
|
|
636
709
|
});
|
|
637
710
|
//#endregion
|
|
711
|
+
Object.defineProperty(exports, "as_table_colgroup_default", {
|
|
712
|
+
enumerable: true,
|
|
713
|
+
get: function() {
|
|
714
|
+
return as_table_colgroup_default;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
638
717
|
Object.defineProperty(exports, "as_table_header_default", {
|
|
639
718
|
enumerable: true,
|
|
640
719
|
get: function() {
|
package/dist/as-table.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_table = require("./as-table-
|
|
1
|
+
const require_as_table = require("./as-table-MKVsJZxT.cjs");
|
|
2
2
|
module.exports = require_as_table.as_table_default;
|
package/dist/as-table.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table.vue-
|
|
1
|
+
import { t as _default } from "./as-table.vue-CDPbZQRG.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-table.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-table.vue-
|
|
1
|
+
import { t as _default } from "./as-table.vue-DaVtNFIe.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-table.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_table_default } from "./as-table-
|
|
1
|
+
import { t as as_table_default } from "./as-table-Bo2dAWTD.mjs";
|
|
2
2
|
export { as_table_default as default };
|
|
@@ -47,27 +47,35 @@ type __VLS_Props = {
|
|
|
47
47
|
* compose their own column layout.
|
|
48
48
|
*/
|
|
49
49
|
rowActionsColumn?: "first" | "last" | "merge-select" | false;
|
|
50
|
+
/**
|
|
51
|
+
* Render without a header row. Omits `<thead>` entirely (not
|
|
52
|
+
* `display:none`); column widths are carried by the `<colgroup>`, so data
|
|
53
|
+
* columns keep their annotated/seeded widths. Header-driven interactions
|
|
54
|
+
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
55
|
+
*/
|
|
56
|
+
headless?: boolean;
|
|
50
57
|
};
|
|
51
58
|
declare var __VLS_21: string, __VLS_22: any, __VLS_24: {};
|
|
52
59
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any } & {
|
|
53
60
|
'query-loading'?: (props: typeof __VLS_24) => any;
|
|
54
61
|
};
|
|
55
62
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
56
|
-
"main-action": (row: Record<string, unknown>, absIndex: number, event:
|
|
63
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
57
64
|
"row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
58
65
|
"row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
59
66
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event:
|
|
67
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
61
68
|
"onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
62
69
|
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
63
70
|
}>, {
|
|
64
|
-
|
|
65
|
-
virtualOverscan: number;
|
|
71
|
+
select: SelectionMode;
|
|
66
72
|
reorderable: boolean;
|
|
67
73
|
resizable: boolean;
|
|
68
74
|
columnMinWidth: number;
|
|
69
|
-
select: SelectionMode;
|
|
70
75
|
rowDelete: boolean | RowDeleteOpt;
|
|
76
|
+
headless: boolean;
|
|
77
|
+
stickyHeader: boolean;
|
|
78
|
+
virtualOverscan: number;
|
|
71
79
|
rowActionsColumn: "first" | "last" | "merge-select" | false;
|
|
72
80
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
73
81
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -47,27 +47,35 @@ type __VLS_Props = {
|
|
|
47
47
|
* compose their own column layout.
|
|
48
48
|
*/
|
|
49
49
|
rowActionsColumn?: "first" | "last" | "merge-select" | false;
|
|
50
|
+
/**
|
|
51
|
+
* Render without a header row. Omits `<thead>` entirely (not
|
|
52
|
+
* `display:none`); column widths are carried by the `<colgroup>`, so data
|
|
53
|
+
* columns keep their annotated/seeded widths. Header-driven interactions
|
|
54
|
+
* (sort/filter/reorder/resize) are unavailable in headless mode.
|
|
55
|
+
*/
|
|
56
|
+
headless?: boolean;
|
|
50
57
|
};
|
|
51
58
|
declare var __VLS_21: string, __VLS_22: any, __VLS_24: {};
|
|
52
59
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any } & {
|
|
53
60
|
'query-loading'?: (props: typeof __VLS_24) => any;
|
|
54
61
|
};
|
|
55
62
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
56
|
-
"main-action": (row: Record<string, unknown>, absIndex: number, event:
|
|
63
|
+
"main-action": (row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any;
|
|
57
64
|
"row-click": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
58
65
|
"row-dblclick": (row: Record<string, unknown>, event: MouseEvent) => any;
|
|
59
66
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
-
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event:
|
|
67
|
+
"onMain-action"?: ((row: Record<string, unknown>, absIndex: number, event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
61
68
|
"onRow-click"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
62
69
|
"onRow-dblclick"?: ((row: Record<string, unknown>, event: MouseEvent) => any) | undefined;
|
|
63
70
|
}>, {
|
|
64
|
-
|
|
65
|
-
virtualOverscan: number;
|
|
71
|
+
select: SelectionMode;
|
|
66
72
|
reorderable: boolean;
|
|
67
73
|
resizable: boolean;
|
|
68
74
|
columnMinWidth: number;
|
|
69
|
-
select: SelectionMode;
|
|
70
75
|
rowDelete: boolean | RowDeleteOpt;
|
|
76
|
+
headless: boolean;
|
|
77
|
+
stickyHeader: boolean;
|
|
78
|
+
virtualOverscan: number;
|
|
71
79
|
rowActionsColumn: "first" | "last" | "merge-select" | false;
|
|
72
80
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
73
81
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|