vueye-table 3.0.0-beta.2 → 3.0.0-beta.4

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/index.d.ts CHANGED
@@ -247,6 +247,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
247
247
  readonly type: NumberConstructor;
248
248
  readonly default: 120;
249
249
  };
250
+ rowAttrs: {
251
+ readonly type: PropType<import("@vueye-table/headless").AnyRowAttrs | undefined>;
252
+ readonly default: undefined;
253
+ };
250
254
  validateRow: {
251
255
  readonly type: PropType<import("@vueye-table/core").TableOptions<any>["validateRow"]>;
252
256
  readonly default: undefined;
@@ -521,6 +525,10 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
521
525
  readonly type: NumberConstructor;
522
526
  readonly default: 120;
523
527
  };
528
+ rowAttrs: {
529
+ readonly type: PropType<import("@vueye-table/headless").AnyRowAttrs | undefined>;
530
+ readonly default: undefined;
531
+ };
524
532
  validateRow: {
525
533
  readonly type: PropType<import("@vueye-table/core").TableOptions<any>["validateRow"]>;
526
534
  readonly default: undefined;
@@ -623,6 +631,7 @@ declare const VueyeGrid: import("vue").DefineComponent<import("vue").ExtractProp
623
631
  overscan: number;
624
632
  virtualColumns: boolean;
625
633
  columnWidth: number;
634
+ rowAttrs: import("@vueye-table/headless").AnyRowAttrs | undefined;
626
635
  asyncValidation: "held" | "optimistic" | undefined;
627
636
  createRow: (() => any) | undefined;
628
637
  removeRows: boolean;
@@ -900,6 +909,10 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
900
909
  readonly type: NumberConstructor;
901
910
  readonly default: 120;
902
911
  };
912
+ rowAttrs: {
913
+ readonly type: PropType<import("@vueye-table/headless").AnyRowAttrs | undefined>;
914
+ readonly default: undefined;
915
+ };
903
916
  validateRow: {
904
917
  readonly type: PropType<import("@vueye-table/core").TableOptions<any>["validateRow"]>;
905
918
  readonly default: undefined;
@@ -1169,6 +1182,10 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1169
1182
  readonly type: NumberConstructor;
1170
1183
  readonly default: 120;
1171
1184
  };
1185
+ rowAttrs: {
1186
+ readonly type: PropType<import("@vueye-table/headless").AnyRowAttrs | undefined>;
1187
+ readonly default: undefined;
1188
+ };
1172
1189
  validateRow: {
1173
1190
  readonly type: PropType<import("@vueye-table/core").TableOptions<any>["validateRow"]>;
1174
1191
  readonly default: undefined;
@@ -1275,6 +1292,7 @@ declare const VueyeTable: import("vue").DefineComponent<import("vue").ExtractPro
1275
1292
  overscan: number;
1276
1293
  virtualColumns: boolean;
1277
1294
  columnWidth: number;
1295
+ rowAttrs: import("@vueye-table/headless").AnyRowAttrs | undefined;
1278
1296
  asyncValidation: "held" | "optimistic" | undefined;
1279
1297
  createRow: (() => any) | undefined;
1280
1298
  removeRows: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/plugin.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/index.ts"],"mappings":";;;;;;;;;;KAOY,0BAA0B;;;;;cAMzB,kBAAkB,QAAQ;;;;;;;;;cCsC1B,yBAAS,8BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBO,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAXF,MAAA;;;;;;EAkBE,iBAAA,QAAA;EACF,gBAAA;EACN,OAAA,mBAAS;EACF,eAAA,kBAAS;EAClB,SAAA;EACC,SAAA,gBAAO,MAAQ;EACb,WAAA,gBAAO,MAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAXR,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BZ;IAAE;;EACJ,OAAA;EACE,SAAA;EACD;IAAE;;EACF,QAAA;EACE,UAAA;kCAsVd;;;;YChdiB;IACf,mBAAmB;IACnB,kBAAkB"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { inferColumns } from "@vueye-table/core";
2
- import { DataTableBody, DataTableCaption, DataTableCell, DataTableEditCell, DataTableEditRoot, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, hierarchyProps, resolveTreeColumn, virtualProps } from "@vueye-table/headless";
2
+ import { DataTableBody, DataTableCaption, DataTableCell, DataTableEditCell, DataTableEditRoot, DataTableRoot, DataTableRow, DataTableSelectAll, DataTableSelectRow, DataTableViewport, hierarchyProps, resolveTreeColumn, rowAttributes, virtualProps } from "@vueye-table/headless";
3
3
  import { VtColumnVisibility, VtEmpty, VtExpandToggle, VtGrid, VtHeader, VtLoadMore, VtPageSize, VtPagination, VtRowActions, VtSearch, VtStatus, VtToolbar, VtTreeCell } from "@vueye-table/styled";
4
4
  import { provideDataTable, provideTableLocale, tableLocaleKey, useDataTable, useTableLocale } from "@vueye-table/vue";
5
5
  import { computed, defineComponent, h, mergeProps } from "vue";
@@ -55,6 +55,14 @@ const CellContent = defineComponent({
55
55
  });
56
56
  /** Props both full components share. */
57
57
  const commonProps = {
58
+ /**
59
+ * `(item, row) => attributes`: a class, a style, and `data-*` and `aria-*` attributes for each
60
+ * body row, read on every render. The row's own attributes win, and handlers are left out.
61
+ */
62
+ rowAttrs: {
63
+ type: Function,
64
+ default: void 0
65
+ },
58
66
  validateRow: {
59
67
  type: Function,
60
68
  default: void 0
@@ -557,6 +565,7 @@ const VueyeGrid = defineComponent({
557
565
  label: props.label ?? locale().messages.spreadsheet,
558
566
  "aria-describedby": attrs["aria-describedby"],
559
567
  rowNumbers: props.rowNumbers,
568
+ rowAttrs: props.rowAttrs,
560
569
  rowActions: props.editable || props.removeRows,
561
570
  removable: props.removeRows,
562
571
  onSave: (result) => emit("save", result),
@@ -750,6 +759,7 @@ const VueyeTable = defineComponent({
750
759
  key: row.key,
751
760
  row,
752
761
  rowIndex,
762
+ attributes: rowAttributes(props.rowAttrs, row),
753
763
  onClick: () => emit("row-click", row.original, row)
754
764
  }, {
755
765
  default: () => cells(row, rowIndex),
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n type ExpandedState,\n type ExpandMode,\n type TreeOptions,\n type TableRow,\n type TableColumn,\n type TableOptions,\n type EditResult,\n type TableIssue,\n type CellChange,\n type TableMessages,\n type TextNormalizer,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport { hierarchyProps } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport { defineComponent, type PropType, type VNodeChild } from \"vue\";\n\ninterface ContentProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly column: TableColumn<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly editable: boolean;\n}\n/** Isolate application cell slots from unrelated table/grid navigation updates. */\nexport const CellContent = defineComponent({\n name: \"VueyeCellContent\",\n props: {\n row: { type: Object as PropType<TableRow<unknown>>, required: true },\n column: { type: Object as PropType<TableColumn<unknown>>, required: true },\n value: { type: null as unknown as PropType<unknown>, required: true },\n display: { type: String, required: true },\n editable: { type: Boolean, default: false },\n render: { type: Function as PropType<(props: ContentProps) => VNodeChild>, required: true },\n },\n setup(props) {\n return () =>\n props.render({\n item: props.row.original,\n row: props.row,\n column: props.column,\n value: props.value,\n display: props.display,\n editable: props.editable,\n });\n },\n});\n\n/** Props both full components share. */\nexport const commonProps = {\n validateRow: { type: Function as PropType<TableOptions<any>[\"validateRow\"]>, default: undefined },\n asyncValidation: {\n type: String as PropType<\"held\" | \"optimistic\" | undefined>,\n default: undefined,\n },\n createRow: { type: Function as PropType<(() => any) | undefined>, default: undefined },\n setParentKey: {\n type: Function as PropType<TableOptions<any>[\"setParentKey\"]>,\n default: undefined,\n },\n addRow: { type: Boolean, default: false },\n removeRows: { type: Boolean, default: false },\n ...virtualProps,\n ...hierarchyProps,\n rowCanExpand: {\n type: Function as PropType<((row: any) => boolean) | undefined>,\n default: undefined,\n },\n expandMode: { type: String as PropType<ExpandMode>, default: \"multiple\" },\n expanded: { type: [Boolean, Array] as PropType<ExpandedState | undefined>, default: undefined },\n getChildren: { type: Function as PropType<TreeOptions<any>[\"getChildren\"]>, default: undefined },\n setChildren: { type: Function as PropType<TreeOptions<any>[\"setChildren\"]>, default: undefined },\n getParentKey: {\n type: Function as PropType<TreeOptions<any>[\"getParentKey\"]>,\n default: undefined,\n },\n hasChildren: { type: Function as PropType<TreeOptions<any>[\"hasChildren\"]>, default: undefined },\n loadChildren: {\n type: Function as PropType<TreeOptions<any, AbortSignal>[\"loadChildren\"]>,\n default: undefined,\n },\n treeFilter: { type: String as PropType<TreeOptions<unknown>[\"treeFilter\"]>, default: undefined },\n paginateBy: { type: String as PropType<TreeOptions<unknown>[\"paginateBy\"]>, default: undefined },\n source: {\n type: [Object, Function] as PropType<TableSource<unknown> | undefined>,\n default: undefined,\n },\n loadMore: { type: Function as PropType<LoadMore<unknown> | undefined>, default: undefined },\n endThreshold: { type: Number, default: 5 },\n manual: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n /**\n * `\"light\"` or `\"dark\"` forces a palette; by default the table follows `prefers-color-scheme`.\n * `\"inherit\"` uses no built-in palette: the host declares the `--vt-*` tokens on an ancestor,\n * in its own light and dark themes.\n */\n theme: { type: String as PropType<\"light\" | \"dark\" | \"inherit\">, default: undefined },\n /**\n * The BCP 47 locale numbers are written and text is ordered in, such as `\"fr\"` or `\"ar-DZ\"`.\n * Defaults to the plugin's, then the runtime's. Ordering reads it once, when the table is\n * created; give the table a new `key` to change it.\n */\n locale: { type: String as PropType<string | undefined>, default: undefined },\n /** The host's words for what the table shows and announces, over the plugin's and English. */\n messages: { type: Object as PropType<Partial<TableMessages> | undefined>, default: undefined },\n /**\n * How search and text filters read text. Defaults to `foldText`: case, accents and Arabic\n * letter shapes ignored. Read once, when the table is created.\n */\n normalizeText: { type: Function as PropType<TextNormalizer | undefined>, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n /** Defaults to the messages' `searchPlaceholder`. */\n searchPlaceholder: { type: String as PropType<string | undefined>, default: undefined },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const editingEmits = {\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n save: (_result: EditResult<unknown>) => true,\n cancel: (_key: RowKey) => true,\n \"edit-issues\": (_issues: readonly TableIssue[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n};\n\nexport function editingOptions(\n props: Pick<\n TableOptions<unknown>,\n \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"\n >,\n): Pick<TableOptions<unknown>, \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"> {\n return {\n validateRow: props.validateRow,\n asyncValidation: props.asyncValidation,\n createRow: props.createRow,\n setParentKey: props.setParentKey,\n };\n}\n\n/** The `v-model` events of table state, typed by the value each carries. */\nexport const stateEmitValidators = {\n \"update:page\": (_page: number) => true,\n \"update:pageSize\": (_pageSize: number) => true,\n \"update:sorting\": (_sorting: readonly SortRule[]) => true,\n \"update:search\": (_search: string) => true,\n \"update:filters\": (_filters: Readonly<Record<string, unknown>>) => true,\n \"update:hiddenColumns\": (_hiddenColumns: readonly string[]) => true,\n \"update:selected\": (_selected: readonly RowKey[]) => true,\n \"update:expanded\": (_expanded: ExpandedState) => true,\n};\n\nexport const stateEmits = Object.keys(\n stateEmitValidators,\n) as readonly (keyof typeof stateEmitValidators)[];\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n readonly expanded?: ExpandedState | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n expanded: props.expanded,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n if (state.expanded !== previous.expanded) emit(\"update:expanded\", state.expanded);\n}\n\nexport function expansionOptions(\n props: {\n readonly rowCanExpand: ((row: any) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n } & TreeOptions<unknown, AbortSignal>,\n detail: boolean,\n): Omit<TreeOptions<unknown, AbortSignal>, \"treeFilter\"> & {\n readonly treeFilter: () => TreeOptions<unknown>[\"treeFilter\"];\n readonly getRowCanExpand: ((row: unknown) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n} {\n return {\n getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : undefined),\n expandMode: props.expandMode,\n getChildren: props.getChildren,\n setChildren: props.setChildren,\n getParentKey: props.getParentKey,\n hasChildren: props.hasChildren,\n loadChildren: props.loadChildren,\n treeFilter: () => props.treeFilter,\n paginateBy: props.paginateBy,\n };\n}\n\nexport function emitExpansionChanges(\n emit: {\n (event: \"expand\", item: unknown, row: TableRow<unknown>): void;\n (event: \"collapse\", item: unknown, row: TableRow<unknown>): void;\n },\n state: TableState,\n previous: TableState,\n table:\n | {\n readonly processedRows: readonly TableRow<unknown>[];\n getRow(key: RowKey): TableRow<unknown> | undefined;\n }\n | undefined,\n): void {\n if (!table || state.expanded === previous.expanded) return;\n const keys = new Set([\n ...table.processedRows.map((row) => row.key),\n ...(state.expanded === true ? [] : state.expanded),\n ...(previous.expanded === true ? [] : previous.expanded),\n ]);\n for (const key of keys) {\n const before = previous.expanded === true || previous.expanded.includes(key);\n const after = state.expanded === true || state.expanded.includes(key);\n const row = table.getRow(key);\n if (row?.canExpand && before !== after) {\n if (after) emit(\"expand\", row.original, row);\n else emit(\"collapse\", row.original, row);\n }\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type {\n CellChange,\n ColumnDef,\n TableIssue,\n TableState,\n TableRow,\n EditResult,\n} from \"@vueye-table/core\";\nimport type {\n GridCellSlotProps,\n TableStatusSlotProps,\n DetailSlotProps,\n CellEditorSlotProps,\n} from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingOptions,\n editingEmits,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown };\n [key: `editor.${string}`]: CellEditorSlotProps;\n } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n expanded?: (props: DetailSlotProps) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */\n label: { type: String as PropType<string | undefined>, default: undefined },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const resolveColumns = createColumnResolver();\n let previousColumns:\n | { source: readonly unknown[]; editable: boolean; columns: readonly ColumnDef<unknown>[] }\n | undefined;\n const columns = computed(() => {\n const source = resolveColumns(props.columns, props.data);\n if (previousColumns?.source === source && previousColumns.editable === props.editable)\n return previousColumns.columns;\n const resolved = source.map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n );\n previousColumns = { source, editable: props.editable, columns: resolved };\n return resolved;\n });\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n manual: props.manual,\n rowCount: () => props.rowCount,\n columns,\n rowKey: props.rowKey as never,\n locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\n paginate:\n props.paginate ??\n (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n emit(\"edit-issues\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n if (slots.expanded) forwarded[\"expanded\"] = slots.expanded;\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\")) {\n const cellSlot = slots[name as `cell.${string}`];\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n cellSlot ? h(CellContent, { ...cellProps, render: cellSlot }) : cellProps.display;\n } else if (name.startsWith(\"editor.\")) {\n forwarded[name] = slot;\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? button(locale().messages.addRow, false, () => {\n table.insertRows();\n })\n : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(locale().messages.undo, !table.canUndo, () => table.undo()),\n button(locale().messages.redo, !table.canRedo, () => table.redo()),\n button(locale().messages.exportCsv, false, () =>\n emit(\"export\", table.exportRows()),\n ),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label ?? locale().messages.spreadsheet,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n rowActions: props.editable || props.removeRows,\n removable: props.removeRows,\n onSave: (result: unknown) => emit(\"save\", result as EditResult<unknown>),\n onCancel: (key: unknown) => emit(\"cancel\", key as string | number),\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading:\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\",\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status || table.tree\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: TableStatusSlotProps) => slots.status?.(status) }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n props.pagination && table.paginate\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]);\n },\n});\n","import type {\n ColumnDef,\n RowKey,\n SortInfo,\n TableRow,\n TableState,\n EditResult,\n} from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n type TableStatusSlotProps,\n type DetailSlotProps,\n resolveTreeColumn,\n DataTableEditRoot,\n DataTableEditCell,\n type CellEditorSlotProps,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n VtExpandToggle,\n VtTreeCell,\n VtRowActions,\n} from \"@vueye-table/styled\";\nimport {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} from \"@vueye-table/vue\";\nimport {\n computed,\n defineComponent,\n h,\n mergeProps,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingEmits,\n editingOptions,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/**\n * What a `<VueyeTable>` exposes on its template ref: the table binding, with every snapshot field\n * and operation. `useTemplateRef<VueyeTableExposed>(\"table\")` reads it typed.\n */\nexport interface VueyeTableExposed {\n readonly table: DataTableBinding<unknown>;\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport type StatusSlotProps = TableStatusSlotProps;\n\n/**\n * Slot props of `header.<column id>`. The slot fills the header cell; on a sortable column it sits\n * inside the sort button, so the header still sorts on click and shows its indicator.\n */\nexport interface HeaderSlotProps {\n readonly column: { readonly id: string; readonly header: string };\n readonly sort: SortInfo | undefined;\n readonly toggleSort: (multi?: boolean) => void;\n}\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n editMode: { type: String as PropType<\"cell\" | \"row\" | undefined>, default: undefined },\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String as PropType<string | undefined>, default: undefined },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `editor.${string}`]: CellEditorSlotProps;\n [key: `header.${string}`]: HeaderSlotProps;\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n expanded: DetailSlotProps;\n }\n >,\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const loadingText = (): string => props.loadingText ?? locale().messages.loading;\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\n manual: props.manual,\n paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onEditIssues(issues) {\n emit(\"edit-issues\", issues);\n emit(\"edit-error\", issues);\n },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table } satisfies VueyeTableExposed);\n const busy = (): boolean =>\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\";\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (\n row: TableRow<unknown>,\n column: (typeof table.columns)[number],\n rowIndex: number,\n ): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);\n return h(\n props.editMode ? DataTableEditCell : DataTableCell,\n {\n key: column.id,\n row,\n column,\n tree: false,\n ...(props.editMode\n ? {\n rowIndex,\n onSave: (result: EditResult<unknown>) => emit(\"save\", result),\n onCancel: (key: RowKey) => emit(\"cancel\", key),\n }\n : {}),\n },\n {\n editor: slots[`editor.${column.id}`],\n default: ({ value, display }: { value: unknown; display: string }) => {\n const content = () =>\n slot ? h(CellContent, { row, column, value, display, render: slot }) : display;\n return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();\n },\n $stable: true,\n },\n );\n };\n\n const hasDetails = (): boolean => !!slots.expanded && !table.tree;\n const hasActions = (): boolean => !!props.editMode || props.removeRows;\n const leadingColumns = (): number =>\n Number(hasActions()) + Number(hasDetails()) + Number(selectable());\n const width = (): number =>\n table.columns.length +\n (selectable() ? 1 : 0) +\n (hasDetails() ? 1 : 0) +\n (hasActions() ? 1 : 0);\n const emptyBody = (): VNodeChild => {\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = busy()\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: loadingText() }))\n : (slots.empty?.({}) ??\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"error\"\n ? locale().messages.couldNotLoadRows\n : locale().messages.noMatchingRows,\n }));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width()) }, content)]);\n }\n return null;\n };\n const cells = (row: TableRow<unknown>, rowIndex: number): VNodeChild[] => {\n const result = [\n hasActions()\n ? h(\n \"td\",\n {\n class: \"vt-row-controls\",\n \"aria-colindex\": 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [\n h(VtRowActions, {\n row,\n editable: props.editMode === \"row\",\n removable: props.removeRows,\n }),\n ],\n )\n : null,\n hasDetails()\n ? h(\"td\", { class: \"vt-expansion-cell\", \"aria-colindex\": Number(hasActions()) + 1 }, [\n h(VtExpandToggle, { row }),\n ])\n : null,\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column, rowIndex)),\n ];\n return result;\n };\n const bodyRow = ({ row, rowIndex }: DetailSlotProps): VNodeChild =>\n h(\n DataTableRow,\n { key: row.key, row, rowIndex, onClick: () => emit(\"row-click\", row.original, row) },\n { default: () => cells(row, rowIndex), $stable: true },\n );\n\n const headerSlots = () => {\n return {\n header: (header: HeaderSlotProps) =>\n slots[`header.${header.column.id}`]?.(header) ?? header.column.header,\n before: () => [\n hasActions()\n ? h(\n \"th\",\n { class: \"vt-row-controls\", scope: \"col\", \"aria-colindex\": 1 },\n locale().messages.rowActions,\n )\n : null,\n hasDetails()\n ? h(\"th\", {\n class: \"vt-expansion-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + 1,\n \"aria-label\": locale().messages.details,\n })\n : null,\n selectable()\n ? h(\n \"th\",\n {\n class: \"vt-selection-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n ],\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: width() },\n {\n ...(table.rows.length === 0 ? { default: emptyBody } : {}),\n row: bodyRow,\n detail: slots.expanded\n ? (detail: DetailSlotProps) => slots.expanded?.(detail)\n : undefined,\n },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n DataTableRoot,\n {\n table,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children,\n ),\n ]);\n };\n\n const surface = () =>\n h(\n \"div\",\n mergeProps(attrs, {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": busy() ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n }),\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? h(\n \"button\",\n { type: \"button\", class: \"vt-button\", onClick: () => table.insertRows() },\n locale().messages.addRow,\n )\n : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) ||\n slots.footer ||\n slots.status ||\n table.tree ||\n table.loadingMode\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => loadingText() }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n slots.footer?.({ table }),\n props.pagination && table.paginate && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n return () =>\n props.editMode\n ? h(\n DataTableEditRoot,\n {\n table,\n mode: props.editMode,\n onSave: (result) => emit(\"save\", result),\n onCancel: (key) => emit(\"cancel\", key),\n },\n surface,\n )\n : surface();\n },\n});\n","import { tableLocaleKey, type TableLocaleOptions } from \"@vueye-table/vue\";\nimport type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Options of `VueyeTablePlugin`: the application's language, which every table speaks. */\nexport type VueyeTablePluginOptions = TableLocaleOptions;\n\n/**\n * Register `<VueyeTable>` and `<VueyeGrid>` globally. A `locale` and `messages` given here are\n * the default of every table in the application; a table's own props win over them.\n */\nexport const VueyeTablePlugin: Plugin<[VueyeTablePluginOptions?]> = {\n install(app: App, options?: VueyeTablePluginOptions): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n if (options?.locale !== undefined || options?.messages !== undefined) {\n const language: TableLocaleOptions = { locale: options.locale, messages: options.messages };\n app.provide(tableLocaleKey, () => language);\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,OAAO;EACL,KAAK;GAAE,MAAM;GAAuC,UAAU;EAAK;EACnE,QAAQ;GAAE,MAAM;GAA0C,UAAU;EAAK;EACzE,OAAO;GAAE,MAAM;GAAsC,UAAU;EAAK;EACpE,SAAS;GAAE,MAAM;GAAQ,UAAU;EAAK;EACxC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,QAAQ;GAAE,MAAM;GAA2D,UAAU;EAAK;CAC5F;CACA,MAAM,OAAO;EACX,aACE,MAAM,OAAO;GACX,MAAM,MAAM,IAAI;GAChB,KAAK,MAAM;GACX,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,UAAU,MAAM;EAClB,CAAC;CACL;AACF,CAAC;;AAGD,MAAa,cAAc;CACzB,aAAa;EAAE,MAAM;EAAwD,SAAS;CAAU;CAChG,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;CACA,WAAW;EAAE,MAAM;EAA+C,SAAS;CAAU;CACrF,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,QAAQ;EAAE,MAAM;EAAS,SAAS;CAAM;CACxC,YAAY;EAAE,MAAM;EAAS,SAAS;CAAM;CAC5C,GAAG;CACH,GAAG;CACH,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,YAAY;EAAE,MAAM;EAAgC,SAAS;CAAW;CACxE,UAAU;EAAE,MAAM,CAAC,SAAS,KAAK;EAA0C,SAAS;CAAU;CAC9F,aAAa;EAAE,MAAM;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AM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;EACF,aACE,MAAM,WACF,EACE,mBACA;GACE;GACA,MAAM,MAAM;GACZ,SAAS,WAAW,KAAK,QAAQ,MAAM;GACvC,WAAW,QAAQ,KAAK,UAAU,GAAG;EACvC,GACA,OACF,IACA,QAAQ;CAChB;AACF,CAAC;;;;;;;;AC9cD,MAAa,mBAAuD,EAClE,QAAQ,KAAU,SAAyC;CACzD,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;CACpC,IAAI,SAAS,WAAW,UAAa,SAAS,aAAa,QAAW;EACpE,MAAM,WAA+B;GAAE,QAAQ,QAAQ;GAAQ,UAAU,QAAQ;EAAS;EAC1F,IAAI,QAAQ,sBAAsB,QAAQ;CAC5C;AACF,EACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/shared.ts","../src/vueye-grid.ts","../src/vueye-table.ts","../src/plugin.ts"],"sourcesContent":["import {\n inferColumns,\n type AnyColumnDef,\n type PaginationState,\n type RowKey,\n type SelectScope,\n type SortRule,\n type TableState,\n type TableStatePatch,\n type ExpandedState,\n type ExpandMode,\n type TreeOptions,\n type TableRow,\n type TableColumn,\n type TableOptions,\n type EditResult,\n type TableIssue,\n type CellChange,\n type TableMessages,\n type TextNormalizer,\n} from \"@vueye-table/core\";\nimport { virtualProps } from \"@vueye-table/headless\";\nimport { hierarchyProps, type AnyRowAttrs } from \"@vueye-table/headless\";\nimport type { Density } from \"@vueye-table/styled\";\nimport type { TableSource, LoadMore } from \"@vueye-table/vue\";\nimport { defineComponent, type PropType, type VNodeChild } from \"vue\";\n\ninterface ContentProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly column: TableColumn<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly editable: boolean;\n}\n/** Isolate application cell slots from unrelated table/grid navigation updates. */\nexport const CellContent = defineComponent({\n name: \"VueyeCellContent\",\n props: {\n row: { type: Object as PropType<TableRow<unknown>>, required: true },\n column: { type: Object as PropType<TableColumn<unknown>>, required: true },\n value: { type: null as unknown as PropType<unknown>, required: true },\n display: { type: String, required: true },\n editable: { type: Boolean, default: false },\n render: { type: Function as PropType<(props: ContentProps) => VNodeChild>, required: true },\n },\n setup(props) {\n return () =>\n props.render({\n item: props.row.original,\n row: props.row,\n column: props.column,\n value: props.value,\n display: props.display,\n editable: props.editable,\n });\n },\n});\n\n/** Props both full components share. */\nexport const commonProps = {\n /**\n * `(item, row) => attributes`: a class, a style, and `data-*` and `aria-*` attributes for each\n * body row, read on every render. The row's own attributes win, and handlers are left out.\n */\n rowAttrs: { type: Function as PropType<AnyRowAttrs | undefined>, default: undefined },\n validateRow: { type: Function as PropType<TableOptions<any>[\"validateRow\"]>, default: undefined },\n asyncValidation: {\n type: String as PropType<\"held\" | \"optimistic\" | undefined>,\n default: undefined,\n },\n createRow: { type: Function as PropType<(() => any) | undefined>, default: undefined },\n setParentKey: {\n type: Function as PropType<TableOptions<any>[\"setParentKey\"]>,\n default: undefined,\n },\n addRow: { type: Boolean, default: false },\n removeRows: { type: Boolean, default: false },\n ...virtualProps,\n ...hierarchyProps,\n rowCanExpand: {\n type: Function as PropType<((row: any) => boolean) | undefined>,\n default: undefined,\n },\n expandMode: { type: String as PropType<ExpandMode>, default: \"multiple\" },\n expanded: { type: [Boolean, Array] as PropType<ExpandedState | undefined>, default: undefined },\n getChildren: { type: Function as PropType<TreeOptions<any>[\"getChildren\"]>, default: undefined },\n setChildren: { type: Function as PropType<TreeOptions<any>[\"setChildren\"]>, default: undefined },\n getParentKey: {\n type: Function as PropType<TreeOptions<any>[\"getParentKey\"]>,\n default: undefined,\n },\n hasChildren: { type: Function as PropType<TreeOptions<any>[\"hasChildren\"]>, default: undefined },\n loadChildren: {\n type: Function as PropType<TreeOptions<any, AbortSignal>[\"loadChildren\"]>,\n default: undefined,\n },\n treeFilter: { type: String as PropType<TreeOptions<unknown>[\"treeFilter\"]>, default: undefined },\n paginateBy: { type: String as PropType<TreeOptions<unknown>[\"paginateBy\"]>, default: undefined },\n source: {\n type: [Object, Function] as PropType<TableSource<unknown> | undefined>,\n default: undefined,\n },\n loadMore: { type: Function as PropType<LoadMore<unknown> | undefined>, default: undefined },\n endThreshold: { type: Number, default: 5 },\n manual: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n rowCount: { type: Number as PropType<number | undefined>, default: undefined },\n /** Override the virtual default of no pagination; permits virtualizing a large page. */\n paginate: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Column definitions. Without them, columns are inferred from the data. */\n columns: { type: Array as PropType<readonly AnyColumnDef[]>, default: undefined },\n /** A path into each row, or a function, giving its key. Defaults to `id`, then position. */\n rowKey: {\n type: [String, Function] as PropType<string | ((row: any, index: number) => RowKey)>,\n default: undefined,\n },\n caption: { type: String, default: undefined },\n loading: { type: Boolean, default: false },\n density: { type: String as PropType<Density>, default: \"comfortable\" },\n striped: { type: Boolean, default: false },\n bordered: { type: Boolean, default: false },\n hover: { type: Boolean, default: true },\n stickyHeader: { type: Boolean, default: false },\n /**\n * `\"light\"` or `\"dark\"` forces a palette; by default the table follows `prefers-color-scheme`.\n * `\"inherit\"` uses no built-in palette: the host declares the `--vt-*` tokens on an ancestor,\n * in its own light and dark themes.\n */\n theme: { type: String as PropType<\"light\" | \"dark\" | \"inherit\">, default: undefined },\n /**\n * The BCP 47 locale numbers are written and text is ordered in, such as `\"fr\"` or `\"ar-DZ\"`.\n * Defaults to the plugin's, then the runtime's. Ordering reads it once, when the table is\n * created; give the table a new `key` to change it.\n */\n locale: { type: String as PropType<string | undefined>, default: undefined },\n /** The host's words for what the table shows and announces, over the plugin's and English. */\n messages: { type: Object as PropType<Partial<TableMessages> | undefined>, default: undefined },\n /**\n * How search and text filters read text. Defaults to `foldText`: case, accents and Arabic\n * letter shapes ignored. Read once, when the table is created.\n */\n normalizeText: { type: Function as PropType<TextNormalizer | undefined>, default: undefined },\n /** A CSS height that makes the body scroll, such as `\"24rem\"`. */\n maxHeight: { type: String, default: undefined },\n\n searchable: { type: Boolean, default: true },\n /** Defaults to the messages' `searchPlaceholder`. */\n searchPlaceholder: { type: String as PropType<string | undefined>, default: undefined },\n columnToggle: { type: Boolean, default: true },\n pagination: { type: Boolean, default: true },\n pageSizeOptions: { type: Array as PropType<readonly number[]>, default: () => [5, 10, 20, 50] },\n\n page: { type: Number, default: undefined },\n pageSize: { type: Number, default: undefined },\n sorting: { type: Array as PropType<readonly SortRule[]>, default: undefined },\n search: { type: String, default: undefined },\n filters: { type: Object as PropType<Readonly<Record<string, unknown>>>, default: undefined },\n hiddenColumns: { type: Array as PropType<readonly string[]>, default: undefined },\n selectScope: { type: String as PropType<SelectScope>, default: \"all\" },\n} as const;\n\nexport const editingEmits = {\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n save: (_result: EditResult<unknown>) => true,\n cancel: (_key: RowKey) => true,\n \"edit-issues\": (_issues: readonly TableIssue[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n};\n\nexport function editingOptions(\n props: Pick<\n TableOptions<unknown>,\n \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"\n >,\n): Pick<TableOptions<unknown>, \"validateRow\" | \"asyncValidation\" | \"createRow\" | \"setParentKey\"> {\n return {\n validateRow: props.validateRow,\n asyncValidation: props.asyncValidation,\n createRow: props.createRow,\n setParentKey: props.setParentKey,\n };\n}\n\n/** The `v-model` events of table state, typed by the value each carries. */\nexport const stateEmitValidators = {\n \"update:page\": (_page: number) => true,\n \"update:pageSize\": (_pageSize: number) => true,\n \"update:sorting\": (_sorting: readonly SortRule[]) => true,\n \"update:search\": (_search: string) => true,\n \"update:filters\": (_filters: Readonly<Record<string, unknown>>) => true,\n \"update:hiddenColumns\": (_hiddenColumns: readonly string[]) => true,\n \"update:selected\": (_selected: readonly RowKey[]) => true,\n \"update:expanded\": (_expanded: ExpandedState) => true,\n};\n\nexport const stateEmits = Object.keys(\n stateEmitValidators,\n) as readonly (keyof typeof stateEmitValidators)[];\n\ninterface ControlledProps {\n readonly page: number | undefined;\n readonly pageSize: number | undefined;\n readonly sorting: readonly SortRule[] | undefined;\n readonly search: string | undefined;\n readonly filters: Readonly<Record<string, unknown>> | undefined;\n readonly hiddenColumns: readonly string[] | undefined;\n readonly selected?: readonly RowKey[] | undefined;\n readonly expanded?: ExpandedState | undefined;\n}\n\n/** The state a parent controls through `v-model`, as a table state patch. */\nexport function controlledState(props: ControlledProps, current: PaginationState): TableStatePatch {\n return {\n sorting: props.sorting,\n search: props.search,\n filters: props.filters,\n hiddenColumns: props.hiddenColumns,\n selection: props.selected,\n expanded: props.expanded,\n pagination:\n props.page !== undefined || props.pageSize !== undefined\n ? { page: props.page ?? current.page, pageSize: props.pageSize ?? current.pageSize }\n : undefined,\n };\n}\n\n/**\n * Emit a `v-model` update for each piece of state that changed. The state is frozen and replaced\n * piece by piece, so identity tells what changed.\n */\nexport function emitStateChanges(\n emit: (event: (typeof stateEmits)[number], value: unknown) => void,\n state: TableState,\n previous: TableState,\n): void {\n if (state.pagination.page !== previous.pagination.page) {\n emit(\"update:page\", state.pagination.page);\n }\n if (state.pagination.pageSize !== previous.pagination.pageSize) {\n emit(\"update:pageSize\", state.pagination.pageSize);\n }\n if (state.sorting !== previous.sorting) {\n emit(\"update:sorting\", state.sorting);\n }\n if (state.search !== previous.search) {\n emit(\"update:search\", state.search);\n }\n if (state.filters !== previous.filters) {\n emit(\"update:filters\", state.filters);\n }\n if (state.hiddenColumns !== previous.hiddenColumns) {\n emit(\"update:hiddenColumns\", state.hiddenColumns);\n }\n if (state.selection !== previous.selection) {\n emit(\"update:selected\", state.selection);\n }\n if (state.expanded !== previous.expanded) emit(\"update:expanded\", state.expanded);\n}\n\nexport function expansionOptions(\n props: {\n readonly rowCanExpand: ((row: any) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n } & TreeOptions<unknown, AbortSignal>,\n detail: boolean,\n): Omit<TreeOptions<unknown, AbortSignal>, \"treeFilter\"> & {\n readonly treeFilter: () => TreeOptions<unknown>[\"treeFilter\"];\n readonly getRowCanExpand: ((row: unknown) => boolean) | undefined;\n readonly expandMode: ExpandMode;\n} {\n return {\n getRowCanExpand: props.rowCanExpand ?? (detail ? () => true : undefined),\n expandMode: props.expandMode,\n getChildren: props.getChildren,\n setChildren: props.setChildren,\n getParentKey: props.getParentKey,\n hasChildren: props.hasChildren,\n loadChildren: props.loadChildren,\n treeFilter: () => props.treeFilter,\n paginateBy: props.paginateBy,\n };\n}\n\nexport function emitExpansionChanges(\n emit: {\n (event: \"expand\", item: unknown, row: TableRow<unknown>): void;\n (event: \"collapse\", item: unknown, row: TableRow<unknown>): void;\n },\n state: TableState,\n previous: TableState,\n table:\n | {\n readonly processedRows: readonly TableRow<unknown>[];\n getRow(key: RowKey): TableRow<unknown> | undefined;\n }\n | undefined,\n): void {\n if (!table || state.expanded === previous.expanded) return;\n const keys = new Set([\n ...table.processedRows.map((row) => row.key),\n ...(state.expanded === true ? [] : state.expanded),\n ...(previous.expanded === true ? [] : previous.expanded),\n ]);\n for (const key of keys) {\n const before = previous.expanded === true || previous.expanded.includes(key);\n const after = state.expanded === true || state.expanded.includes(key);\n const row = table.getRow(key);\n if (row?.canExpand && before !== after) {\n if (after) emit(\"expand\", row.original, row);\n else emit(\"collapse\", row.original, row);\n }\n }\n}\n\n/**\n * The given columns, or columns inferred from the data. Inferred columns are reused while the\n * data keeps the same fields, so an edit that replaces the array does not rebuild every row.\n */\nexport function createColumnResolver(): (\n columns: readonly AnyColumnDef[] | undefined,\n data: readonly unknown[],\n) => readonly AnyColumnDef[] {\n let inferred:\n | { readonly signature: string; readonly columns: readonly AnyColumnDef[] }\n | undefined;\n return (columns, data) => {\n if (columns) {\n return columns;\n }\n const next = inferColumns(data);\n const signature = next.map((column) => column.id).join(\"\\u0000\");\n if (inferred?.signature !== signature) {\n inferred = { signature, columns: next };\n }\n return inferred.columns;\n };\n}\n","import type {\n CellChange,\n ColumnDef,\n TableIssue,\n TableState,\n TableRow,\n EditResult,\n} from \"@vueye-table/core\";\nimport type {\n GridCellSlotProps,\n TableStatusSlotProps,\n DetailSlotProps,\n CellEditorSlotProps,\n} from \"@vueye-table/headless\";\nimport {\n VtGrid,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n} from \"@vueye-table/styled\";\nimport {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} from \"@vueye-table/vue\";\nimport { computed, defineComponent, h, type PropType, type SlotsType, type VNode } from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingOptions,\n editingEmits,\n} from \"./shared\";\n\n/**\n * An editable spreadsheet over an array. Cells are edited in place with the keyboard or a double\n * click, ranges are selected with Shift or by dragging, and copy, cut, paste, clear, undo, and\n * redo work like a spreadsheet application. Every edit produces a new array through\n * `update:data`; the array passed in is never mutated.\n */\nexport const VueyeGrid = defineComponent({\n name: \"VueyeGrid\",\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: GridCellSlotProps & { readonly item: unknown };\n [key: `editor.${string}`]: CellEditorSlotProps;\n } & {\n default?: (props: Record<string, unknown>) => VNode[];\n status?: (props: TableStatusSlotProps) => VNode[];\n expanded?: (props: DetailSlotProps) => VNode[];\n }\n >,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n searchable: { type: Boolean, default: false },\n columnToggle: { type: Boolean, default: false },\n /** Page the grid. By default every row is on one page. */\n pagination: { type: Boolean, default: false },\n /** Columns are editable unless their definition says otherwise. Set `false` to lock all. */\n editable: { type: Boolean, default: true },\n rowNumbers: { type: Boolean, default: true },\n columnLetters: { type: Boolean, default: false },\n /** The grid's accessible name. Defaults to the messages' `spreadsheet`. */\n label: { type: String as PropType<string | undefined>, default: undefined },\n /** Show undo, redo, and CSV export buttons. */\n toolbar: { type: Boolean, default: true },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\n \"state-change\": (_state: TableState) => true,\n \"update:data\": (_data: readonly unknown[]) => true,\n edit: (_changes: readonly CellChange<unknown>[]) => true,\n \"edit-error\": (_issues: readonly TableIssue[]) => true,\n export: (_csv: string) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const resolveColumns = createColumnResolver();\n let previousColumns:\n | { source: readonly unknown[]; editable: boolean; columns: readonly ColumnDef<unknown>[] }\n | undefined;\n const columns = computed(() => {\n const source = resolveColumns(props.columns, props.data);\n if (previousColumns?.source === source && previousColumns.editable === props.editable)\n return previousColumns.columns;\n const resolved = source.map(\n (column) =>\n ({\n ...column,\n editable: props.editable ? (column.editable ?? true) : false,\n }) as ColumnDef<unknown>,\n );\n previousColumns = { source, editable: props.editable, columns: resolved };\n return resolved;\n });\n const everyRow = (): number => Math.max(1, props.data.length);\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pagination ? (props.pageSize ?? props.pageSizeOptions[0] ?? 10) : everyRow(),\n };\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n manual: props.manual,\n rowCount: () => props.rowCount,\n columns,\n rowKey: props.rowKey as never,\n locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\n paginate:\n props.paginate ??\n (props.source || props.loadMore ? false : props.virtual ? props.pagination : true),\n selectionMode: \"none\",\n initialState: { pagination: initialPagination },\n state: () => {\n const controlled = controlledState(\n props,\n binding?.table.getState().pagination ?? initialPagination,\n );\n return {\n ...controlled,\n selection: undefined,\n pagination: props.pagination ? controlled.pagination : { page: 1, pageSize: everyRow() },\n };\n },\n onEditIssues(issues) {\n emit(\"edit-error\", issues);\n emit(\"edit-issues\", issues);\n },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table });\n\n // `cell.<id>` slots also receive the row's data as `item`, as they do on `<VueyeTable>`.\n const gridSlots = (): Record<string, unknown> => {\n const forwarded: Record<string, unknown> = {};\n if (slots.expanded) forwarded[\"expanded\"] = slots.expanded;\n for (const [name, slot] of Object.entries(slots)) {\n if (name === \"default\" && slot) {\n forwarded[name] = slot;\n } else if (name.startsWith(\"cell.\")) {\n const cellSlot = slots[name as `cell.${string}`];\n forwarded[name] = (cellProps: GridCellSlotProps) =>\n cellSlot ? h(CellContent, { ...cellProps, render: cellSlot }) : cellProps.display;\n } else if (name.startsWith(\"editor.\")) {\n forwarded[name] = slot;\n }\n }\n return forwarded;\n };\n\n const button = (label: string, disabled: boolean, onClick: () => void) =>\n h(\"button\", { type: \"button\", class: \"vt-button\", disabled, onClick }, label);\n\n return () =>\n h(\"div\", { class: \"vt-theme vueye-grid\", \"data-vt-theme\": props.theme }, [\n props.toolbar || props.searchable || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? button(locale().messages.addRow, false, () => {\n table.insertRows();\n })\n : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n props.toolbar\n ? [\n button(locale().messages.undo, !table.canUndo, () => table.undo()),\n button(locale().messages.redo, !table.canRedo, () => table.redo()),\n button(locale().messages.exportCsv, false, () =>\n emit(\"export\", table.exportRows()),\n ),\n ]\n : null,\n ])\n : null,\n h(\n VtGrid,\n {\n table,\n label: props.label ?? locale().messages.spreadsheet,\n \"aria-describedby\": attrs[\"aria-describedby\"],\n rowNumbers: props.rowNumbers,\n rowAttrs: props.rowAttrs,\n rowActions: props.editable || props.removeRows,\n removable: props.removeRows,\n onSave: (result: unknown) => emit(\"save\", result as EditResult<unknown>),\n onCancel: (key: unknown) => emit(\"cancel\", key as string | number),\n columnLetters: props.columnLetters,\n density: props.density,\n striped: props.striped,\n bordered: props.bordered,\n hover: false,\n stickyHeader: props.stickyHeader,\n loading:\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\",\n theme: props.theme,\n virtual: props.virtual,\n virtualColumns: props.virtualColumns,\n height: props.height,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n columnWidth: props.columnWidth,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n ...(props.maxHeight ? { style: { \"--vt-max-height\": props.maxHeight } } : {}),\n },\n gridSlots(),\n ),\n props.pagination || table.loadingMode || slots.status || table.tree\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: TableStatusSlotProps) => slots.status?.(status) }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n props.pagination && table.paginate\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]);\n },\n});\n","import type {\n ColumnDef,\n RowKey,\n SortInfo,\n TableRow,\n TableState,\n EditResult,\n} from \"@vueye-table/core\";\nimport {\n DataTableBody,\n DataTableCaption,\n DataTableCell,\n DataTableRow,\n DataTableSelectAll,\n DataTableSelectRow,\n DataTableRoot,\n DataTableViewport,\n type TableStatusSlotProps,\n type DetailSlotProps,\n resolveTreeColumn,\n DataTableEditRoot,\n DataTableEditCell,\n type CellEditorSlotProps,\n rowAttributes,\n} from \"@vueye-table/headless\";\nimport {\n VtColumnVisibility,\n VtEmpty,\n VtHeader,\n VtPageSize,\n VtPagination,\n VtSearch,\n VtStatus,\n VtLoadMore,\n VtToolbar,\n VtExpandToggle,\n VtTreeCell,\n VtRowActions,\n} from \"@vueye-table/styled\";\nimport {\n provideDataTable,\n provideTableLocale,\n useDataTable,\n useTableLocale,\n type DataTableBinding,\n} from \"@vueye-table/vue\";\nimport {\n computed,\n defineComponent,\n h,\n mergeProps,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from \"vue\";\n\nimport {\n commonProps,\n controlledState,\n createColumnResolver,\n emitStateChanges,\n stateEmitValidators,\n expansionOptions,\n emitExpansionChanges,\n CellContent,\n editingEmits,\n editingOptions,\n} from \"./shared\";\n\n/** Slot props of `cell.<column id>` and `cell`. */\nexport interface CellSlotProps {\n readonly item: unknown;\n readonly row: TableRow<unknown>;\n readonly value: unknown;\n readonly display: string;\n readonly column: { readonly id: string; readonly header: string };\n}\n\n/**\n * What a `<VueyeTable>` exposes on its template ref: the table binding, with every snapshot field\n * and operation. `useTemplateRef<VueyeTableExposed>(\"table\")` reads it typed.\n */\nexport interface VueyeTableExposed {\n readonly table: DataTableBinding<unknown>;\n}\n\n/** Slot props of `status`, the \"1–10 of 57 rows\" line. */\nexport type StatusSlotProps = TableStatusSlotProps;\n\n/**\n * Slot props of `header.<column id>`. The slot fills the header cell; on a sortable column it sits\n * inside the sort button, so the header still sorts on click and shows its indicator.\n */\nexport interface HeaderSlotProps {\n readonly column: { readonly id: string; readonly header: string };\n readonly sort: SortInfo | undefined;\n readonly toggleSort: (multi?: boolean) => void;\n}\n\n/**\n * A complete data table: search, column visibility, sorting, selection, pagination, a live\n * status line, loading and empty states, and theming. Every piece of state is available as a\n * `v-model`, and `manual` hands searching, sorting, and paging to a server.\n */\nexport const VueyeTable = defineComponent({\n name: \"VueyeTable\",\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<readonly unknown[]>, default: () => [] },\n ...commonProps,\n editMode: { type: String as PropType<\"cell\" | \"row\" | undefined>, default: undefined },\n /** `true` or `\"multiple\"` for checkboxes, `\"single\"` for one row at a time. */\n selectable: {\n type: [Boolean, String] as PropType<boolean | \"single\" | \"multiple\">,\n default: false,\n },\n selected: { type: Array as PropType<readonly RowKey[]>, default: undefined },\n /** The data is one page from a server; `rowCount` is the total. */\n /** Shown instead of the empty state while `loading` and there are no rows yet. */\n loadingText: { type: String as PropType<string | undefined>, default: undefined },\n },\n emits: {\n ...editingEmits,\n ...stateEmitValidators,\n \"state-change\": (_state: TableState) => true,\n \"row-click\": (_item: unknown, _row: TableRow<unknown>) => true,\n expand: (_item: unknown, _row: TableRow<unknown>) => true,\n collapse: (_item: unknown, _row: TableRow<unknown>) => true,\n },\n slots: Object as SlotsType<\n {\n [key: `cell.${string}`]: CellSlotProps;\n [key: `editor.${string}`]: CellEditorSlotProps;\n [key: `header.${string}`]: HeaderSlotProps;\n } & {\n toolbar: { table: unknown };\n empty: Record<string, never>;\n loading: Record<string, never>;\n footer: { table: unknown };\n status: StatusSlotProps;\n expanded: DetailSlotProps;\n }\n >,\n setup(props, { emit, slots, expose, attrs }) {\n const inherited = useTableLocale();\n const locale = provideTableLocale(() => ({ locale: props.locale, messages: props.messages }));\n const loadingText = (): string => props.loadingText ?? locale().messages.loading;\n const selectionMode = computed(() =>\n props.selectable === false ? \"none\" : props.selectable === \"single\" ? \"single\" : \"multiple\",\n );\n const initialPagination = {\n page: props.page ?? 1,\n pageSize: props.pageSize ?? props.pageSizeOptions[0] ?? 10,\n };\n const resolveColumns = createColumnResolver();\n let binding: DataTableBinding<unknown> | undefined;\n const table = useDataTable<unknown>({\n ...expansionOptions(props, !!slots.expanded),\n ...editingOptions(props),\n data: () => props.data,\n source: computed(() => props.source),\n loadMore: computed(() => props.loadMore),\n endThreshold: props.endThreshold,\n columns: () => resolveColumns(props.columns, props.data) as readonly ColumnDef<unknown>[],\n rowKey: props.rowKey as never,\n locale: props.locale ?? inherited().locale,\n normalizeText: props.normalizeText,\n manual: props.manual,\n paginate: props.paginate ?? !(props.virtual || props.source || props.loadMore),\n rowCount: () => props.rowCount,\n selectionMode: selectionMode.value,\n selectScope: props.selectScope,\n initialState: { pagination: initialPagination },\n onDataChange(data, changes) {\n emit(\"update:data\", data);\n emit(\"edit\", changes);\n },\n onEditIssues(issues) {\n emit(\"edit-issues\", issues);\n emit(\"edit-error\", issues);\n },\n state: () =>\n controlledState(props, binding?.table.getState().pagination ?? initialPagination),\n onStateChange(state, previous) {\n emitStateChanges(emit as never, state, previous);\n emitExpansionChanges(emit, state, previous, binding?.table.getSnapshot());\n emit(\"state-change\", state);\n },\n });\n binding = table;\n provideDataTable(table);\n expose({ table } satisfies VueyeTableExposed);\n const busy = (): boolean =>\n props.loading || table.loadState === \"loading\" || table.loadState === \"streaming\";\n\n const selectable = (): boolean => selectionMode.value !== \"none\";\n\n const cell = (\n row: TableRow<unknown>,\n column: (typeof table.columns)[number],\n rowIndex: number,\n ): VNodeChild => {\n const slot = slots[`cell.${column.id}`];\n const treeCell = table.tree && column.id === resolveTreeColumn(table, props.treeColumn);\n return h(\n props.editMode ? DataTableEditCell : DataTableCell,\n {\n key: column.id,\n row,\n column,\n tree: false,\n ...(props.editMode\n ? {\n rowIndex,\n onSave: (result: EditResult<unknown>) => emit(\"save\", result),\n onCancel: (key: RowKey) => emit(\"cancel\", key),\n }\n : {}),\n },\n {\n editor: slots[`editor.${column.id}`],\n default: ({ value, display }: { value: unknown; display: string }) => {\n const content = () =>\n slot ? h(CellContent, { row, column, value, display, render: slot }) : display;\n return treeCell ? h(VtTreeCell, { row }, { default: content }) : content();\n },\n $stable: true,\n },\n );\n };\n\n const hasDetails = (): boolean => !!slots.expanded && !table.tree;\n const hasActions = (): boolean => !!props.editMode || props.removeRows;\n const leadingColumns = (): number =>\n Number(hasActions()) + Number(hasDetails()) + Number(selectable());\n const width = (): number =>\n table.columns.length +\n (selectable() ? 1 : 0) +\n (hasDetails() ? 1 : 0) +\n (hasActions() ? 1 : 0);\n const emptyBody = (): VNodeChild => {\n if (table.rows.length === 0) {\n // While the first page is loading there is nothing to match yet, so say that instead.\n const content = busy()\n ? (slots.loading?.({}) ?? h(VtEmpty, { text: loadingText() }))\n : (slots.empty?.({}) ??\n h(VtEmpty, {\n text:\n table.loadingMode && table.loadState === \"error\"\n ? locale().messages.couldNotLoadRows\n : locale().messages.noMatchingRows,\n }));\n return h(\"tr\", { \"data-empty\": \"\" }, [h(\"td\", { colspan: Math.max(1, width()) }, content)]);\n }\n return null;\n };\n const cells = (row: TableRow<unknown>, rowIndex: number): VNodeChild[] => {\n const result = [\n hasActions()\n ? h(\n \"td\",\n {\n class: \"vt-row-controls\",\n \"aria-colindex\": 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [\n h(VtRowActions, {\n row,\n editable: props.editMode === \"row\",\n removable: props.removeRows,\n }),\n ],\n )\n : null,\n hasDetails()\n ? h(\"td\", { class: \"vt-expansion-cell\", \"aria-colindex\": Number(hasActions()) + 1 }, [\n h(VtExpandToggle, { row }),\n ])\n : null,\n selectable()\n ? h(\n \"td\",\n {\n class: \"vt-selection-cell\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n onClick: (event: Event) => event.stopPropagation(),\n },\n [h(DataTableSelectRow, { row })],\n )\n : null,\n ...table.columns.map((column) => cell(row, column, rowIndex)),\n ];\n return result;\n };\n const bodyRow = ({ row, rowIndex }: DetailSlotProps): VNodeChild =>\n h(\n DataTableRow,\n {\n key: row.key,\n row,\n rowIndex,\n attributes: rowAttributes(props.rowAttrs, row),\n onClick: () => emit(\"row-click\", row.original, row),\n },\n { default: () => cells(row, rowIndex), $stable: true },\n );\n\n const headerSlots = () => {\n return {\n header: (header: HeaderSlotProps) =>\n slots[`header.${header.column.id}`]?.(header) ?? header.column.header,\n before: () => [\n hasActions()\n ? h(\n \"th\",\n { class: \"vt-row-controls\", scope: \"col\", \"aria-colindex\": 1 },\n locale().messages.rowActions,\n )\n : null,\n hasDetails()\n ? h(\"th\", {\n class: \"vt-expansion-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + 1,\n \"aria-label\": locale().messages.details,\n })\n : null,\n selectable()\n ? h(\n \"th\",\n {\n class: \"vt-selection-cell\",\n scope: \"col\",\n \"aria-colindex\": Number(hasActions()) + Number(hasDetails()) + 1,\n },\n selectionMode.value === \"multiple\" ? [h(DataTableSelectAll)] : [],\n )\n : null,\n ],\n };\n };\n\n const tableContent = (): VNodeChild => {\n const children = () => [\n props.caption ? h(DataTableCaption, () => props.caption) : null,\n h(VtHeader, null, headerSlots()),\n h(\n DataTableBody,\n { class: \"vt-body\", colspan: width() },\n {\n ...(table.rows.length === 0 ? { default: emptyBody } : {}),\n row: bodyRow,\n detail: slots.expanded\n ? (detail: DetailSlotProps) => slots.expanded?.(detail)\n : undefined,\n },\n ),\n ];\n return props.virtual\n ? h(\n DataTableViewport,\n {\n class: \"vt-scroll\",\n height: props.height ?? \"24rem\",\n style: { \"--vt-row-height\": `${props.rowHeight}px` },\n },\n {\n default: () =>\n h(\n DataTableRoot,\n {\n table,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n virtual: props.virtual,\n rowHeight: props.rowHeight,\n overscan: props.overscan,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n },\n children,\n ),\n },\n )\n : h(\"div\", { class: \"vt-scroll\" }, [\n h(\n DataTableRoot,\n {\n table,\n treeColumn: props.treeColumn,\n keepAliveDetail: props.keepAliveDetail,\n class: \"vt-table\",\n leadingColumns: leadingColumns(),\n \"aria-busy\": busy() ? \"true\" : undefined,\n },\n children,\n ),\n ]);\n };\n\n const surface = () =>\n h(\n \"div\",\n mergeProps(attrs, {\n class: \"vt-surface vueye-table\",\n \"data-density\": props.density,\n \"data-striped\": props.striped ? \"\" : undefined,\n \"data-bordered\": props.bordered ? \"\" : undefined,\n \"data-hover\": props.hover ? \"\" : undefined,\n \"data-sticky-header\": props.stickyHeader || props.virtual ? \"\" : undefined,\n \"data-virtual\": props.virtual ? \"\" : undefined,\n \"data-loading\": busy() ? \"\" : undefined,\n \"data-vt-theme\": props.theme,\n \"aria-busy\": props.loading ? \"true\" : undefined,\n style: props.maxHeight ? { \"--vt-max-height\": props.maxHeight } : undefined,\n }),\n [\n h(\"div\", { class: \"vt-root\" }, [\n props.searchable || props.columnToggle || slots.toolbar || props.addRow\n ? h(VtToolbar, () => [\n props.searchable\n ? h(VtSearch, {\n placeholder: props.searchPlaceholder ?? locale().messages.searchPlaceholder,\n })\n : null,\n props.addRow\n ? h(\n \"button\",\n { type: \"button\", class: \"vt-button\", onClick: () => table.insertRows() },\n locale().messages.addRow,\n )\n : null,\n h(\"div\", { class: \"vt-toolbar-spacer\" }),\n slots.toolbar?.({ table }),\n props.columnToggle ? h(VtColumnVisibility) : null,\n ])\n : null,\n h(\"div\", { class: \"vt-progress\", role: \"presentation\" }),\n tableContent(),\n (props.pagination && (!props.virtual || table.paginate)) ||\n slots.footer ||\n slots.status ||\n table.tree ||\n table.loadingMode\n ? h(VtToolbar, { class: \"vt-footer\" }, () => [\n h(\n VtStatus,\n null,\n slots.status\n ? { default: (status: StatusSlotProps) => slots.status?.(status) }\n : props.loading && table.rows.length === 0\n ? { default: () => loadingText() }\n : undefined,\n ),\n ...(table.loadingMode ? [h(VtLoadMore)] : []),\n slots.footer?.({ table }),\n props.pagination && table.paginate && (!props.virtual || table.paginate)\n ? h(\"div\", { class: \"vt-footer-controls\" }, [\n h(VtPageSize, { options: props.pageSizeOptions }),\n h(VtPagination),\n ])\n : null,\n ])\n : null,\n ]),\n ],\n );\n return () =>\n props.editMode\n ? h(\n DataTableEditRoot,\n {\n table,\n mode: props.editMode,\n onSave: (result) => emit(\"save\", result),\n onCancel: (key) => emit(\"cancel\", key),\n },\n surface,\n )\n : surface();\n },\n});\n","import { tableLocaleKey, type TableLocaleOptions } from \"@vueye-table/vue\";\nimport type { App, Plugin } from \"vue\";\n\nimport { VueyeGrid } from \"./vueye-grid\";\nimport { VueyeTable } from \"./vueye-table\";\n\n/** Options of `VueyeTablePlugin`: the application's language, which every table speaks. */\nexport type VueyeTablePluginOptions = TableLocaleOptions;\n\n/**\n * Register `<VueyeTable>` and `<VueyeGrid>` globally. A `locale` and `messages` given here are\n * the default of every table in the application; a table's own props win over them.\n */\nexport const VueyeTablePlugin: Plugin<[VueyeTablePluginOptions?]> = {\n install(app: App, options?: VueyeTablePluginOptions): void {\n app.component(\"VueyeTable\", VueyeTable);\n app.component(\"VueyeGrid\", VueyeGrid);\n if (options?.locale !== undefined || options?.messages !== undefined) {\n const language: TableLocaleOptions = { locale: options.locale, messages: options.messages };\n app.provide(tableLocaleKey, () => language);\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAa,cAAc,gBAAgB;CACzC,MAAM;CACN,OAAO;EACL,KAAK;GAAE,MAAM;GAAuC,UAAU;EAAK;EACnE,QAAQ;GAAE,MAAM;GAA0C,UAAU;EAAK;EACzE,OAAO;GAAE,MAAM;GAAsC,UAAU;EAAK;EACpE,SAAS;GAAE,MAAM;GAAQ,UAAU;EAAK;EACxC,UAAU;GAAE,MAAM;GAAS,SAAS;EAAM;EAC1C,QAAQ;GAAE,MAAM;GAA2D,UAAU;EAAK;CAC5F;CACA,MAAM,OAAO;EACX,aACE,MAAM,OAAO;GACX,MAAM,MAAM,IAAI;GAChB,KAAK,MAAM;GACX,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,UAAU,MAAM;EAClB,CAAC;CACL;AACF,CAAC;;AAGD,MAAa,cAAc;;;;;CAKzB,UAAU;EAAE,MAAM;EAA+C,SAAS;CAAU;CACpF,aAAa;EAAE,MAAM;EAAwD,SAAS;CAAU;CAChG,iBAAiB;EACf,MAAM;EACN,SAAS;CACX;CACA,WAAW;EAAE,MAAM;EAA+C,SAAS;CAAU;CACrF,cAAc;EACZ,MAAM;EACN,SAAS;CACX;CACA,QAAQ;EAAE,MAAM;EAAS,SAAS;CAAM;CACxC,YAA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W,IACrC,EAAE,eAAe,YAAY,EAAE,IAC/B,MACR;IACA,GAAI,MAAM,cAAc,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAC3C,MAAM,SAAS,EAAE,MAAM,CAAC;IACxB,MAAM,cAAc,MAAM,aAAa,CAAC,MAAM,WAAW,MAAM,YAC3D,EAAE,OAAO,EAAE,OAAO,qBAAqB,GAAG,CACxC,EAAE,YAAY,EAAE,SAAS,MAAM,gBAAgB,CAAC,GAChD,EAAE,YAAY,CAChB,CAAC,IACD;GACN,CAAC,IACD;EACN,CAAC,CACH,CACF;EACF,aACE,MAAM,WACF,EACE,mBACA;GACE;GACA,MAAM,MAAM;GACZ,SAAS,WAAW,KAAK,QAAQ,MAAM;GACvC,WAAW,QAAQ,KAAK,UAAU,GAAG;EACvC,GACA,OACF,IACA,QAAQ;CAChB;AACF,CAAC;;;;;;;;ACrdD,MAAa,mBAAuD,EAClE,QAAQ,KAAU,SAAyC;CACzD,IAAI,UAAU,cAAc,UAAU;CACtC,IAAI,UAAU,aAAa,SAAS;CACpC,IAAI,SAAS,WAAW,UAAa,SAAS,aAAa,QAAW;EACpE,MAAM,WAA+B;GAAE,QAAQ,QAAQ;GAAQ,UAAU,QAAQ;EAAS;EAC1F,IAAI,QAAQ,sBAAsB,QAAQ;CAC5C;AACF,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueye-table",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "A Vue framework for data tables and spreadsheets: a complete, themeable data table and grid, plus every layer beneath them.",
5
5
  "keywords": [
6
6
  "data-grid",
@@ -42,10 +42,10 @@
42
42
  "provenance": true
43
43
  },
44
44
  "dependencies": {
45
- "@vueye-table/headless": "3.0.0-beta.2",
46
- "@vueye-table/vue": "3.0.0-beta.2",
47
- "@vueye-table/core": "3.0.0-beta.2",
48
- "@vueye-table/styled": "3.0.0-beta.2"
45
+ "@vueye-table/core": "3.0.0-beta.4",
46
+ "@vueye-table/headless": "3.0.0-beta.4",
47
+ "@vueye-table/vue": "3.0.0-beta.4",
48
+ "@vueye-table/styled": "3.0.0-beta.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "vue": "3.5.43",