@xleddyl/443-components-vue 0.16.36 → 0.16.38
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/CATALOG.md
CHANGED
|
@@ -293,12 +293,12 @@ Nuxt ready layouts: with `k: { layouts: true }` the module registers the layouts
|
|
|
293
293
|
|
|
294
294
|
Import from `@xleddyl/443-components-vue/grid`. It wraps AG Grid Community.
|
|
295
295
|
|
|
296
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
297
|
-
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
298
|
-
| `DataGrid` | Big table: virtual scroll, column menu, search, CSV export, selection, server sort and paging, inline editing. For small tables use `Table`. | Models: `v-model:query`, `v-model:page`, `v-model:pageSize`, `v-model:sort` (`{ column, direction }`). Props: `rows`, `columns` (AG Grid `ColDef`), `rowIdKey` or `getRowId`, `storageKey` (columns and page size in the preferences store), `density`, `selectable`, `loading`, `height`, `fill`, `autoHeight`, `toolbar`, `searchable`, `columnMenu`, `exportable`, `serverSort`, `pagination`, `serverPagination`, `total`, `filterable`, `editable`, `spreadsheet`, `gridOptions`, `messages`, `filterCount`. Slots: `actions`, `actions-end` (after the column menu and export buttons), `filters` (`{ close, count }`, hosted in a modal opened by a funnel button next to the search). Events: `filtersReset`, `rowClick`, `selectionChange`, `sortChange`, `filterChange`, `cellsChange`, `cellsInvalid`, `dirtyChange`, `rangeChange`, `copy`. | `grid/data-grid.vue` |
|
|
299
|
-
| `DataGrid` with `spreadsheet` | Excel-like editing: cell range selection, copy and paste (TSV), fill down and right, clear, undo and redo, dirty cell tracking. Set `rowIdKey` or `getRowId`. | Template ref methods (`GridSpreadsheetMethods`): `getRange`, `getSelectedCells`, `selectRange`, `selectAll`, `setRangeValue`, `copyRange`, `paste`, `fillDown`, `fillRight`, `clearCells`, `undo`, `redo`, `getDirtyCells`, `clearDirty`. The `actions` slot gets the same methods plus `range`, `selectedCellCount`, `dirtyCount`, `canUndo`, `canRedo`. Use `cellsChange` to save edits, `cellsInvalid` for rejected input.
|
|
300
|
-
| `GridToolbar` | Toolbar of `DataGrid` (search, column menu, export). `DataGrid` already renders it. Use it alone only for a custom grid setup. | Props: `api`, `searchable`, `columnMenu`, `exportable`, `exportFileName`, `debounce`, `filterCount`. Model: `v-model` (query). Slots: default (actions), `filters`. Events: `resetColumns`, `filtersReset`.
|
|
301
|
-
| Cell renderers | Use as `cellRenderer` in a column definition, with `cellRendererParams`. | `BadgeCell` (`tones`, `colors`, `labels`, `titles` (a record or a function of the value), `defaultTone`, `variant`; array values render one badge each, `max` adds a `+N` badge, `wrap`), `BooleanCell` (`trueLabel`, `falseLabel`), `DateCell` (`locale`, `options`, `relative`), `EmptyCell` (placeholder for empty values), `ImageCell` (`alt`, `rounded`, `fit`: `cover`, `contain` or `natural` (original aspect, height `size`), `size`), `LinkCell` (`href`, `label`, `target`), `ButtonCell` (`onClick`, `label`, `ariaLabel`, `emptyLabel`; an inline button that does not trigger the row click).
|
|
296
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
297
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
|
|
298
|
+
| `DataGrid` | Big table: virtual scroll, column menu, search, CSV export, selection, server sort and paging, inline editing. For small tables use `Table`. | Models: `v-model:query`, `v-model:page`, `v-model:pageSize`, `v-model:sort` (`{ column, direction }`). Props: `rows`, `columns` (AG Grid `ColDef`), `rowIdKey` or `getRowId`, `storageKey` (columns and page size in the preferences store; without `columnMenu` the column visibility always comes from `columns`), `density`, `selectable`, `loading`, `height`, `fill`, `autoHeight`, `toolbar`, `searchable`, `columnMenu`, `exportable`, `serverSort`, `pagination`, `serverPagination`, `total`, `filterable`, `editable`, `spreadsheet`, `gridOptions`, `messages`, `filterCount`. Slots: `actions`, `actions-end` (after the column menu and export buttons), `filters` (`{ close, count }`, hosted in a modal opened by a funnel button next to the search). Events: `filtersReset`, `rowClick`, `selectionChange`, `sortChange`, `filterChange`, `cellsChange`, `cellsInvalid`, `dirtyChange`, `rangeChange`, `copy`. | `grid/data-grid.vue` |
|
|
299
|
+
| `DataGrid` with `spreadsheet` | Excel-like editing: cell range selection, copy and paste (TSV), fill down and right, clear, undo and redo, dirty cell tracking. Set `rowIdKey` or `getRowId`. | Template ref methods (`GridSpreadsheetMethods`): `getRange`, `getSelectedCells`, `selectRange`, `selectAll`, `setRangeValue`, `copyRange`, `paste`, `fillDown`, `fillRight`, `clearCells`, `undo`, `redo`, `getDirtyCells`, `clearDirty`. The `actions` slot gets the same methods plus `range`, `selectedCellCount`, `dirtyCount`, `canUndo`, `canRedo`. Use `cellsChange` to save edits, `cellsInvalid` for rejected input. | `grid/spreadsheet.vue` |
|
|
300
|
+
| `GridToolbar` | Toolbar of `DataGrid` (search, column menu, export). `DataGrid` already renders it. Use it alone only for a custom grid setup. | Props: `api`, `searchable`, `columnMenu`, `exportable`, `exportFileName`, `debounce`, `filterCount`. Model: `v-model` (query). Slots: default (actions), `filters`. Events: `resetColumns`, `filtersReset`. | - |
|
|
301
|
+
| Cell renderers | Use as `cellRenderer` in a column definition, with `cellRendererParams`. | `BadgeCell` (`tones`, `colors`, `labels`, `titles` (a record or a function of the value), `defaultTone`, `variant`; array values render one badge each, `max` adds a `+N` badge, `wrap`), `BooleanCell` (`trueLabel`, `falseLabel`), `DateCell` (`locale`, `options`, `relative`), `EmptyCell` (placeholder for empty values), `ImageCell` (`alt`, `rounded`, `fit`: `cover`, `contain` or `natural` (original aspect, height `size`), `size`), `LinkCell` (`href`, `label`, `target`), `ButtonCell` (`onClick`, `label`, `ariaLabel`, `emptyLabel`; an inline button that does not trigger the row click). | `grid/data-grid.vue` |
|
|
302
302
|
|
|
303
303
|
Grid helpers: `registerGridModules`, `registerGridEditorModules`, `registerGridFilterModules`, `registerGridSpreadsheetModules` (register AG Grid modules by hand), `createGridTheme`, `parseTsv`, `formatTsv`.
|
|
304
304
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@close="emit('close')"
|
|
24
24
|
@after-leave="emit('afterLeave')"
|
|
25
25
|
>
|
|
26
|
-
<template v-for="name in slotNames" #[name]="scope">
|
|
26
|
+
<template v-for="name in slotNames()" #[name]="scope">
|
|
27
27
|
<slot :name="name" v-bind="scope" />
|
|
28
28
|
</template>
|
|
29
29
|
</DialogFrame>
|
|
@@ -50,7 +50,7 @@ defineProps({
|
|
|
50
50
|
backLabel: { type: String, required: false }
|
|
51
51
|
});
|
|
52
52
|
const slots = defineSlots();
|
|
53
|
-
const slotNames =
|
|
53
|
+
const slotNames = () => Object.keys(slots);
|
|
54
54
|
const emit = defineEmits(["open", "close", "afterLeave", "navigate"]);
|
|
55
55
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
56
56
|
const tab = defineModel("tab", { type: [String, Number] });
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
@close="emit('close')"
|
|
25
25
|
@after-leave="emit('afterLeave')"
|
|
26
26
|
>
|
|
27
|
-
<template v-for="name in slotNames" #[name]="scope">
|
|
27
|
+
<template v-for="name in slotNames()" #[name]="scope">
|
|
28
28
|
<slot :name="name" v-bind="scope" />
|
|
29
29
|
</template>
|
|
30
30
|
</DialogFrame>
|
|
@@ -57,7 +57,7 @@ const sizeStyle = computed(() => ({
|
|
|
57
57
|
"--k-modal-min-height": props.minHeight
|
|
58
58
|
}));
|
|
59
59
|
const slots = defineSlots();
|
|
60
|
-
const slotNames =
|
|
60
|
+
const slotNames = () => Object.keys(slots);
|
|
61
61
|
const emit = defineEmits(["open", "close", "afterLeave", "navigate"]);
|
|
62
62
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
63
63
|
const tab = defineModel("tab", { type: [String, Number] });
|
package/dist/grid/DataGrid.vue
CHANGED
|
@@ -383,7 +383,8 @@ function writePreference(patch) {
|
|
|
383
383
|
}
|
|
384
384
|
function readStoredState() {
|
|
385
385
|
const columns = readPreference()?.columns;
|
|
386
|
-
|
|
386
|
+
if (!Array.isArray(columns)) return null;
|
|
387
|
+
return props.columnMenu ? columns : columns.map(({ hide: _hide, ...column }) => column);
|
|
387
388
|
}
|
|
388
389
|
function clearStoredState() {
|
|
389
390
|
writePreference({ columns: void 0 });
|
|
@@ -391,7 +392,9 @@ function clearStoredState() {
|
|
|
391
392
|
function persistState(event) {
|
|
392
393
|
if (event && event.finished === false) return;
|
|
393
394
|
if (!preferenceKey.value || !api.value) return;
|
|
394
|
-
const columns = api.value.getColumnState().map(
|
|
395
|
+
const columns = api.value.getColumnState().map(
|
|
396
|
+
({ colId, hide, width, pinned }) => props.columnMenu ? { colId, hide, width, pinned } : { colId, width, pinned }
|
|
397
|
+
);
|
|
395
398
|
writePreference({ columns });
|
|
396
399
|
}
|
|
397
400
|
function isPageSize(value) {
|
package/package.json
CHANGED