@dolusoft/query-table 3.20.0 → 3.21.0

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.
@@ -1,28 +0,0 @@
1
- import { inject, provide } from "vue";
2
- //#region src/core/cell-labels.ts
3
- /**
4
- * English defaults of the cell labels. This module imports nothing but
5
- * types, so the `/cells` entry carries these three and not the defaults of
6
- * the table, whose condition labels come from the protocol (ADR 0022,
7
- * K320-6).
8
- */
9
- var cellLabelDefaults = {
10
- copyValue: (value) => `Copy ${value}`,
11
- previewValue: (text) => `Preview ${text}`,
12
- emptyValue: "-"
13
- };
14
- //#endregion
15
- //#region src/core/table-context.ts
16
- var tableContextKey = Symbol("query-table");
17
- var provideTableContext = (context) => {
18
- provide(tableContextKey, context);
19
- };
20
- var useTableContext = () => {
21
- const context = inject(tableContextKey);
22
- if (!context) throw new Error("Header parts must be rendered inside a QueryTable");
23
- return context;
24
- };
25
- //#endregion
26
- export { cellLabelDefaults as i, tableContextKey as n, useTableContext as r, provideTableContext as t };
27
-
28
- //# sourceMappingURL=table-context-Duuqp9Jq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"table-context-Duuqp9Jq.js","names":[],"sources":["../src/core/cell-labels.ts","../src/core/table-context.ts"],"sourcesContent":["import type { TableLabels } from '../contract'\n\n/** The texts the cell components write (C-129), every one filled. */\nexport type CellLabels = Required<\n Pick<TableLabels, 'copyValue' | 'previewValue' | 'emptyValue'>\n>\n\n/**\n * English defaults of the cell labels. This module imports nothing but\n * types, so the `/cells` entry carries these three and not the defaults of\n * the table, whose condition labels come from the protocol (ADR 0022,\n * K320-6).\n */\nexport const cellLabelDefaults: CellLabels = {\n copyValue: value => `Copy ${value}`,\n previewValue: text => `Preview ${text}`,\n emptyValue: '-'\n}\n","import { inject, provide, type InjectionKey } from 'vue'\n\nimport type { ResolvedLabels } from './labels'\nimport type { ColumnReorder } from '../reorder/use-column-reorder'\nimport type { ColumnResize } from '../resize/use-column-resize'\nimport type {\n QueryTableFilters,\n QueryTableLayout,\n QueryTableSelection,\n QueryTableSort\n} from '../use-query-table'\n\n/**\n * What the header parts call: the filter inputs, the sort gate and the\n * layout actions of the composable, the resize and reorder actions and the\n * labels. Only actions and getters travel here; data (`columns`, `query`)\n * comes down as props.\n */\nexport interface TableContext {\n filters: QueryTableFilters\n sort: QueryTableSort\n /** The `control` of the header and filter-menu slots (C-70). */\n layout: QueryTableLayout\n resize: ColumnResize\n /** The reorder handles: drag, keys and the drag preview (C-73). */\n reorder: ColumnReorder\n /** The select-all checkbox of the selection column (C-59). */\n selection: Pick<\n QueryTableSelection<object>,\n 'allSelected' | 'someSelected' | 'toggleAll'\n >\n labels: () => ResolvedLabels\n}\n\nexport const tableContextKey: InjectionKey<TableContext> = Symbol('query-table')\n\nexport const provideTableContext = (context: TableContext) => {\n provide(tableContextKey, context)\n}\n\nexport const useTableContext = (): TableContext => {\n const context = inject(tableContextKey)\n if (!context) {\n throw new Error('Header parts must be rendered inside a QueryTable')\n }\n return context\n}\n"],"mappings":";;;;;;;;AAaA,IAAa,oBAAgC;CAC3C,YAAW,UAAS,QAAQ;CAC5B,eAAc,SAAQ,WAAW;CACjC,YAAY;AACd;;;ACiBA,IAAa,kBAA8C,OAAO,aAAa;AAE/E,IAAa,uBAAuB,YAA0B;CAC5D,QAAQ,iBAAiB,OAAO;AAClC;AAEA,IAAa,wBAAsC;CACjD,MAAM,UAAU,OAAO,eAAe;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,mDAAmD;CAErE,OAAO;AACT"}