@platforma-sdk/ui-vue 1.40.5 → 1.40.6

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.
Files changed (26) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +9 -0
  4. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts +1 -4
  5. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
  6. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +155 -172
  7. package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
  8. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +2 -2
  9. package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
  10. package/dist/components/PlAgDataTable/sources/table-source-v2.js +110 -105
  11. package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
  12. package/dist/components/PlAgDataTable/types.d.ts +27 -43
  13. package/dist/components/PlAgDataTable/types.d.ts.map +1 -1
  14. package/dist/components/PlAgDataTable/types.js +32 -43
  15. package/dist/components/PlAgDataTable/types.js.map +1 -1
  16. package/dist/lib/model/common/dist/index.js.map +1 -1
  17. package/dist/lib/ui/uikit/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
  18. package/dist/lib/ui/uikit/dist/lib/model/common/dist/index.js +5 -5
  19. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +18 -18
  20. package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
  21. package/dist/sdk/model/dist/index.js +80 -75
  22. package/dist/sdk/model/dist/index.js.map +1 -1
  23. package/package.json +7 -7
  24. package/src/components/PlAgDataTable/PlAgDataTableV2.vue +6 -31
  25. package/src/components/PlAgDataTable/sources/table-source-v2.ts +29 -29
  26. package/src/components/PlAgDataTable/types.ts +42 -70
@@ -5,8 +5,7 @@ export type PlDataTableFilterConfig = {
5
5
  options?: PlTableFilterType[];
6
6
  default?: PlTableFilter;
7
7
  };
8
- /** Data table V2 settings */
9
- export type PlDataTableSettingsV2 = ({
8
+ export type PlDataTableSettingsV2Base = {
10
9
  sourceId: null;
11
10
  } | {
12
11
  /** Unique source id for state caching */
@@ -15,51 +14,48 @@ export type PlDataTableSettingsV2 = ({
15
14
  sheets: PlDataTableSheet[];
16
15
  /** Result of `createPlDataTableV2` */
17
16
  model: PlDataTableModel | undefined;
18
- }) & {
17
+ };
18
+ /** Data table V2 settings */
19
+ export type PlDataTableSettingsV2 = PlDataTableSettingsV2Base & {
19
20
  /** Callback configuring filters for the table */
20
21
  filtersConfig: (info: {
21
22
  sourceId: string;
22
23
  column: PTableColumnSpec;
23
24
  }) => PlDataTableFilterConfig;
24
25
  };
25
- type OptionsAdvanced<T> = {
26
- /**
27
- * Block property (such as inputAnchor) used to produce the data source.
28
- * Mandatory for cases when the table can change without block run.
29
- * Skip when the table is changed only after block run.
30
- * Ask developers for help if you don't know what to set here.
31
- */
32
- sourceId: MaybeRefOrGetter<T | undefined>;
26
+ type OptionsBasic = {
33
27
  /** Block output created by `createPlDataTableV2` */
34
28
  model: MaybeRefOrGetter<PlDataTableModel | undefined>;
35
29
  /**
36
- * Sheets for partitioned data sources.
37
- * Do not set if data source is never partitioned.
38
- */
30
+ * Sheets for partitioned data sources.
31
+ * Do not set if data source is never partitioned.
32
+ */
39
33
  sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;
34
+ };
35
+ type OptionsSimple = OptionsBasic & {
40
36
  /**
41
- * Callback configuring filters for the table.
42
- * If not provided, filtering will be disabled.
43
- * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.
44
- */
37
+ * Callback configuring filters for the table.
38
+ * If not provided, filtering will be disabled.
39
+ */
45
40
  filtersConfig?: (info: {
46
- sourceId: JsonCompatible<T>;
47
41
  column: PTableColumnSpec;
48
42
  }) => PlDataTableFilterConfig;
49
43
  };
50
- type OptionsSimple = {
51
- /** Block output created by `createPlDataTableV2` */
52
- model: MaybeRefOrGetter<PlDataTableModel | undefined>;
44
+ type OptionsAdvanced<T> = OptionsBasic & {
53
45
  /**
54
- * Sheets for partitioned data sources.
55
- * Do not set if data source is never partitioned.
56
- */
57
- sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;
46
+ * Block property (such as inputAnchor) used to produce the data source.
47
+ * Mandatory for cases when the table can change without block run.
48
+ * Skip when the table is changed only after block run.
49
+ * Ask developers for help if you don't know what to set here.
50
+ */
51
+ sourceId: MaybeRefOrGetter<T | undefined>;
58
52
  /**
59
- * Callback configuring filters for the table.
60
- * If not provided, filtering will be disabled.
61
- */
53
+ * Callback configuring filters for the table.
54
+ * If not provided, filtering will be disabled.
55
+ * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.
56
+ */
62
57
  filtersConfig?: (info: {
58
+ sourceId: JsonCompatible<T>;
63
59
  column: PTableColumnSpec;
64
60
  }) => PlDataTableFilterConfig;
65
61
  };
@@ -87,13 +83,8 @@ export type PlAgDataTableV2Controller = {
87
83
  */
88
84
  focusRow: (rowKey: PTableKey) => Promise<void>;
89
85
  };
90
- export type PlTableRowId = {
91
- /** Axes values */
92
- axesKey: PTableKey;
93
- /** Axes key where values of labeled axes are resolved to corresponding labels */
94
- labeled: PTableKey;
95
- };
96
- export type PlTableRowIdJson = CanonicalizedJson<PlTableRowId>;
86
+ export type PlTableRowId = PTableKey;
87
+ export type PlTableRowIdJson = CanonicalizedJson<PTableKey>;
97
88
  /** PlAgDataTableV2 row */
98
89
  export type PlAgDataTableV2Row = {
99
90
  /** Axes key */
@@ -103,13 +94,6 @@ export type PlAgDataTableV2Row = {
103
94
  /** Row values by column; sheet axes and labeled axes are excluded */
104
95
  [field: `${number}`]: PTableValue | PTableHidden;
105
96
  };
106
- /** PlSelectionModel with labeled axes replaced by label columns */
107
- export type PlTableLabeledSelectionModel = {
108
- /** Specs for valuess in {@link PTableKey} */
109
- spec: PTableColumnSpec[];
110
- /** Row keys (arrays of axes values) of selected rows */
111
- selectedLabeledKeys: PTableKey[];
112
- };
113
97
  export type PlAgOverlayLoadingParams = {
114
98
  /**
115
99
  * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgDataTable/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAKzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,6BAA6B;AAC7B,MAAM,MAAM,qBAAqB,GACjC,CACI;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAClB;IACA,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,sCAAsC;IACtC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACrC,CACF,GAAG;IACF,iDAAiD;IACjD,aAAa,EAAE,CAAC,IAAI,EAAE;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,gBAAgB,CAAC;KAC1B,KAAK,uBAAuB,CAAC;CAC/B,CAAC;AAEF,KA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AmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3C,+BAA+B;IAC/B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { computed as f, toValue as l } from "vue";
2
- import o from "../../_virtual/canonicalize.js";
3
- import { deepClone as c } from "../../lib/util/helpers/dist/index.js";
4
- function m(s) {
5
- const u = s.filtersConfig, t = typeof u == "function" ? (e) => {
2
+ import u from "../../_virtual/canonicalize.js";
3
+ import { deepClone as n } from "../../lib/util/helpers/dist/index.js";
4
+ function I(s) {
5
+ const c = s.filtersConfig, d = typeof c == "function" ? (e) => {
6
6
  try {
7
- return u({
7
+ return c({
8
8
  sourceId: JSON.parse(e.sourceId),
9
9
  column: e.column
10
10
  });
@@ -14,53 +14,42 @@ function m(s) {
14
14
  } : () => ({});
15
15
  return f(() => {
16
16
  const e = l(s.model);
17
+ let r;
17
18
  if ("sourceId" in s) {
18
- const r = c(l(s.sourceId));
19
+ const t = n(l(s.sourceId));
19
20
  if (s.sheets) {
20
- const n = c(l(s.sheets));
21
- return r && n ? {
22
- sourceId: o(r),
23
- sheets: n,
24
- model: e,
25
- filtersConfig: t
26
- } : {
27
- sourceId: null,
28
- filtersConfig: t
29
- };
21
+ const o = n(l(s.sheets));
22
+ r = t && o ? {
23
+ sourceId: u(t),
24
+ sheets: o,
25
+ model: e
26
+ } : { sourceId: null };
30
27
  } else
31
- return r ? {
32
- sourceId: o(r),
28
+ r = t ? {
29
+ sourceId: u(t),
33
30
  sheets: [],
34
- model: e,
35
- filtersConfig: t
36
- } : {
37
- sourceId: null,
38
- filtersConfig: t
39
- };
31
+ model: e
32
+ } : { sourceId: null };
40
33
  } else if (s.sheets) {
41
- const r = l(s.sheets);
42
- return r ? {
43
- sourceId: o("static"),
44
- sheets: r,
45
- model: e,
46
- filtersConfig: t
47
- } : {
48
- sourceId: null,
49
- filtersConfig: t
50
- };
34
+ const t = l(s.sheets);
35
+ r = t ? {
36
+ sourceId: u("static"),
37
+ sheets: t,
38
+ model: e
39
+ } : { sourceId: null };
51
40
  } else
52
- return e ? {
53
- sourceId: o("static"),
41
+ r = e ? {
42
+ sourceId: u("static"),
54
43
  sheets: [],
55
- model: e,
56
- filtersConfig: t
57
- } : {
58
- sourceId: null,
59
- filtersConfig: t
60
- };
44
+ model: e
45
+ } : { sourceId: null };
46
+ return {
47
+ ...r,
48
+ filtersConfig: d
49
+ };
61
50
  });
62
51
  }
63
52
  export {
64
- m as usePlDataTableSettingsV2
53
+ I as usePlDataTableSettingsV2
65
54
  };
66
55
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/PlAgDataTable/types.ts"],"sourcesContent":["import {\n type JsonCompatible,\n type AxisId,\n type CanonicalizedJson,\n type ListOptionBase,\n type PlDataTableModel,\n type PlDataTableSheet,\n type PlDataTableSheetState,\n type PlTableFilter,\n type PlTableFilterType,\n type PTableColumnId,\n type PTableColumnSpec,\n type PTableKey,\n type PTableValue,\n} from '@platforma-sdk/model';\nimport type { PTableHidden } from './sources/common';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\nimport canonicalize from 'canonicalize';\nimport { deepClone } from '@milaboratories/helpers';\n\nexport type PlDataTableFilterConfig = {\n options?: PlTableFilterType[];\n default?: PlTableFilter;\n};\n\n/** Data table V2 settings */\nexport type PlDataTableSettingsV2 =\n(\n | { sourceId: null }\n | {\n /** Unique source id for state caching */\n sourceId: string;\n /** Sheets that we want to show in our table */\n sheets: PlDataTableSheet[];\n /** Result of `createPlDataTableV2` */\n model: PlDataTableModel | undefined;\n }\n) & {\n /** Callback configuring filters for the table */\n filtersConfig: (info: {\n sourceId: string;\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\ntype OptionsAdvanced<T> = {\n /**\n * Block property (such as inputAnchor) used to produce the data source.\n * Mandatory for cases when the table can change without block run.\n * Skip when the table is changed only after block run.\n * Ask developers for help if you don't know what to set here.\n */\n sourceId: MaybeRefOrGetter<T | undefined>;\n /** Block output created by `createPlDataTableV2` */\n model: MaybeRefOrGetter<PlDataTableModel | undefined>;\n /**\n * Sheets for partitioned data sources.\n * Do not set if data source is never partitioned.\n */\n sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;\n /**\n * Callback configuring filters for the table.\n * If not provided, filtering will be disabled.\n * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.\n */\n filtersConfig?: (info: {\n sourceId: JsonCompatible<T>;\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\ntype OptionsSimple = {\n /** Block output created by `createPlDataTableV2` */\n model: MaybeRefOrGetter<PlDataTableModel | undefined>;\n /**\n * Sheets for partitioned data sources.\n * Do not set if data source is never partitioned.\n */\n sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;\n /**\n * Callback configuring filters for the table.\n * If not provided, filtering will be disabled.\n */\n filtersConfig?: (info: {\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\nexport function usePlDataTableSettingsV2<T>(options: OptionsAdvanced<T>): ComputedRef<PlDataTableSettingsV2>;\nexport function usePlDataTableSettingsV2(options: OptionsSimple): ComputedRef<PlDataTableSettingsV2>;\nexport function usePlDataTableSettingsV2<T>(options: OptionsAdvanced<T> | OptionsSimple): ComputedRef<PlDataTableSettingsV2> {\n const fc = options.filtersConfig;\n const filtersConfigValue = typeof fc === 'function'\n ? (ops: {\n sourceId: string;\n column: PTableColumnSpec;\n }) => {\n try {\n return fc({\n sourceId: JSON.parse(ops.sourceId) as JsonCompatible<T>,\n column: ops.column,\n });\n } catch (e) {\n console.error(`filtersConfig failed for sourceId: ${ops.sourceId}, column: ${JSON.stringify(ops.column)} - using default config`, e);\n return {};\n }\n }\n : () => ({});\n return computed(() => {\n const modelValue = toValue(options.model);\n if ('sourceId' in options) {\n const sourceIdValue = deepClone(toValue(options.sourceId));\n if (options.sheets) {\n const sheetsValue = deepClone(toValue(options.sheets));\n return sourceIdValue && sheetsValue\n ? {\n sourceId: canonicalize(sourceIdValue)!,\n sheets: sheetsValue,\n model: modelValue,\n filtersConfig: filtersConfigValue,\n }\n : {\n sourceId: null,\n filtersConfig: filtersConfigValue,\n };\n } else {\n return sourceIdValue\n ? {\n sourceId: canonicalize(sourceIdValue)!,\n sheets: [],\n model: modelValue,\n filtersConfig: filtersConfigValue,\n }\n : {\n sourceId: null,\n filtersConfig: filtersConfigValue,\n };\n }\n } else {\n if (options.sheets) {\n const sheetsValue = toValue(options.sheets);\n return sheetsValue\n ? {\n sourceId: canonicalize('static')!,\n sheets: sheetsValue,\n model: modelValue,\n filtersConfig: filtersConfigValue,\n }\n : {\n sourceId: null,\n filtersConfig: filtersConfigValue,\n };\n } else {\n return modelValue\n ? {\n sourceId: canonicalize('static')!,\n sheets: [],\n model: modelValue,\n filtersConfig: filtersConfigValue,\n }\n : {\n sourceId: null,\n filtersConfig: filtersConfigValue,\n };\n }\n }\n });\n};\n\n/** PlTableFilters restriction entry */\nexport type PlTableFiltersRestriction = {\n /** Spec of the column for which filter types should be restricted */\n column: PTableColumnId;\n /** List of filter types applicable to the column */\n allowedFilterTypes: PlTableFilterType[];\n};\n\n/** PlTableFilters default settings entry */\nexport type PlTableFiltersDefault = {\n /** Spec of the column the default should be applied */\n column: PTableColumnId;\n /** Filter entry */\n default: PlTableFilter;\n};\n\n/** PlAgDataTable controller contains all exported methods */\nexport type PlAgDataTableV2Controller = {\n /**\n * Scroll table to make row with provided key visible\n * Warning: works reliably only in client side mode.\n */\n focusRow: (rowKey: PTableKey) => Promise<void>;\n};\n\nexport type PlTableRowId = {\n /** Axes values */\n axesKey: PTableKey;\n /** Axes key where values of labeled axes are resolved to corresponding labels */\n labeled: PTableKey;\n};\n\nexport type PlTableRowIdJson = CanonicalizedJson<PlTableRowId>;\n\n/** PlAgDataTableV2 row */\nexport type PlAgDataTableV2Row = {\n /** Axes key */\n axesKey: PTableKey;\n /** Unique row identifier */\n id: PlTableRowIdJson;\n /** Row values by column; sheet axes and labeled axes are excluded */\n [field: `${number}`]: PTableValue | PTableHidden;\n};\n\n/** PlSelectionModel with labeled axes replaced by label columns */\nexport type PlTableLabeledSelectionModel = {\n /** Specs for valuess in {@link PTableKey} */\n spec: PTableColumnSpec[];\n /** Row keys (arrays of axes values) of selected rows */\n selectedLabeledKeys: PTableKey[];\n};\n\nexport type PlAgOverlayLoadingParams = {\n /**\n * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.\n */\n notReady?: boolean;\n /**\n * Prop to override default \"Loading\" text\n */\n loadingText?: string;\n /**\n * Prop to override default \"No datasource\" text (So why props name is notReady? Good question)\n */\n notReadyText?: string;\n /**\n * Use \"transparent\" to make table headers visible below the loading layer\n */\n overlayType?: 'transparent';\n};\n\nexport type PlAgOverlayNoRowsParams = {\n /**\n * Prop to override default \"Empty\" text\n */\n text?: string;\n};\n\nexport type PlDataTableSheetsSettings = {\n /** User-provided sheets for the sourceId */\n sheets: PlDataTableSheet[];\n /** Persisted selection for the sourceId */\n cachedState: PlDataTableSheetState[];\n};\n\nexport type PlDataTableSheetNormalized = {\n /** id of the axis */\n axisId: AxisId;\n /** sheet prefix */\n prefix: string;\n /** options to show in the filter dropdown */\n options: ListOptionBase<string | number>[];\n /** default (selected) value */\n defaultValue: string | number;\n};\n"],"names":["usePlDataTableSettingsV2","options","fc","filtersConfigValue","ops","e","computed","modelValue","toValue","sourceIdValue","deepClone","sheetsValue","canonicalize"],"mappings":";;;AA2FO,SAASA,EAA4BC,GAAiF;AAC3H,QAAMC,IAAKD,EAAQ,eACbE,IAAqB,OAAOD,KAAO,aACrC,CAACE,MAGK;AACA,QAAA;AACF,aAAOF,EAAG;AAAA,QACR,UAAU,KAAK,MAAME,EAAI,QAAQ;AAAA,QACjC,QAAQA,EAAI;AAAA,MAAA,CAC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ACH;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/PlAgDataTable/types.ts"],"sourcesContent":["import {\n type JsonCompatible,\n type AxisId,\n type CanonicalizedJson,\n type ListOptionBase,\n type PlDataTableModel,\n type PlDataTableSheet,\n type PlDataTableSheetState,\n type PlTableFilter,\n type PlTableFilterType,\n type PTableColumnId,\n type PTableColumnSpec,\n type PTableKey,\n type PTableValue,\n} from '@platforma-sdk/model';\nimport type { PTableHidden } from './sources/common';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\nimport canonicalize from 'canonicalize';\nimport { deepClone } from '@milaboratories/helpers';\n\nexport type PlDataTableFilterConfig = {\n options?: PlTableFilterType[];\n default?: PlTableFilter;\n};\n\nexport type PlDataTableSettingsV2Base =\n | { sourceId: null }\n | {\n /** Unique source id for state caching */\n sourceId: string;\n /** Sheets that we want to show in our table */\n sheets: PlDataTableSheet[];\n /** Result of `createPlDataTableV2` */\n model: PlDataTableModel | undefined;\n };\n\n/** Data table V2 settings */\nexport type PlDataTableSettingsV2 = PlDataTableSettingsV2Base & {\n /** Callback configuring filters for the table */\n filtersConfig: (info: {\n sourceId: string;\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\ntype OptionsBasic = {\n /** Block output created by `createPlDataTableV2` */\n model: MaybeRefOrGetter<PlDataTableModel | undefined>;\n /**\n * Sheets for partitioned data sources.\n * Do not set if data source is never partitioned.\n */\n sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;\n};\n\ntype OptionsSimple = OptionsBasic & {\n /**\n * Callback configuring filters for the table.\n * If not provided, filtering will be disabled.\n */\n filtersConfig?: (info: {\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\ntype OptionsAdvanced<T> = OptionsBasic & {\n /**\n * Block property (such as inputAnchor) used to produce the data source.\n * Mandatory for cases when the table can change without block run.\n * Skip when the table is changed only after block run.\n * Ask developers for help if you don't know what to set here.\n */\n sourceId: MaybeRefOrGetter<T | undefined>;\n /**\n * Callback configuring filters for the table.\n * If not provided, filtering will be disabled.\n * Parameter `sourceId` should be compared using `isJsonEqual` from `@milaboratories/helpers`.\n */\n filtersConfig?: (info: {\n sourceId: JsonCompatible<T>;\n column: PTableColumnSpec;\n }) => PlDataTableFilterConfig;\n};\n\nexport function usePlDataTableSettingsV2<T>(options: OptionsAdvanced<T>): ComputedRef<PlDataTableSettingsV2>;\nexport function usePlDataTableSettingsV2(options: OptionsSimple): ComputedRef<PlDataTableSettingsV2>;\nexport function usePlDataTableSettingsV2<T>(options: OptionsAdvanced<T> | OptionsSimple): ComputedRef<PlDataTableSettingsV2> {\n const fc = options.filtersConfig;\n const filtersConfigValue = typeof fc === 'function'\n ? (ops: {\n sourceId: string;\n column: PTableColumnSpec;\n }) => {\n try {\n return fc({\n sourceId: JSON.parse(ops.sourceId) as JsonCompatible<T>,\n column: ops.column,\n });\n } catch (e) {\n console.error(`filtersConfig failed for sourceId: ${ops.sourceId}, column: ${JSON.stringify(ops.column)} - using default config`, e);\n return {};\n }\n }\n : () => ({});\n return computed(() => {\n const modelValue = toValue(options.model);\n let settingsBase: PlDataTableSettingsV2Base;\n if ('sourceId' in options) {\n const sourceIdValue = deepClone(toValue(options.sourceId));\n if (options.sheets) {\n const sheetsValue = deepClone(toValue(options.sheets));\n settingsBase = sourceIdValue && sheetsValue\n ? {\n sourceId: canonicalize(sourceIdValue)!,\n sheets: sheetsValue,\n model: modelValue,\n }\n : { sourceId: null };\n } else {\n settingsBase = sourceIdValue\n ? {\n sourceId: canonicalize(sourceIdValue)!,\n sheets: [],\n model: modelValue,\n }\n : { sourceId: null };\n }\n } else {\n if (options.sheets) {\n const sheetsValue = toValue(options.sheets);\n settingsBase = sheetsValue\n ? {\n sourceId: canonicalize('static')!,\n sheets: sheetsValue,\n model: modelValue,\n }\n : { sourceId: null };\n } else {\n settingsBase = modelValue\n ? {\n sourceId: canonicalize('static')!,\n sheets: [],\n model: modelValue,\n }\n : { sourceId: null };\n }\n }\n return {\n ...settingsBase,\n filtersConfig: filtersConfigValue,\n };\n });\n};\n\n/** PlTableFilters restriction entry */\nexport type PlTableFiltersRestriction = {\n /** Spec of the column for which filter types should be restricted */\n column: PTableColumnId;\n /** List of filter types applicable to the column */\n allowedFilterTypes: PlTableFilterType[];\n};\n\n/** PlTableFilters default settings entry */\nexport type PlTableFiltersDefault = {\n /** Spec of the column the default should be applied */\n column: PTableColumnId;\n /** Filter entry */\n default: PlTableFilter;\n};\n\n/** PlAgDataTable controller contains all exported methods */\nexport type PlAgDataTableV2Controller = {\n /**\n * Scroll table to make row with provided key visible\n * Warning: works reliably only in client side mode.\n */\n focusRow: (rowKey: PTableKey) => Promise<void>;\n};\n\nexport type PlTableRowId = PTableKey;\n\nexport type PlTableRowIdJson = CanonicalizedJson<PTableKey>;\n\n/** PlAgDataTableV2 row */\nexport type PlAgDataTableV2Row = {\n /** Axes key */\n axesKey: PTableKey;\n /** Unique row identifier */\n id: PlTableRowIdJson;\n /** Row values by column; sheet axes and labeled axes are excluded */\n [field: `${number}`]: PTableValue | PTableHidden;\n};\n\nexport type PlAgOverlayLoadingParams = {\n /**\n * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.\n */\n notReady?: boolean;\n /**\n * Prop to override default \"Loading\" text\n */\n loadingText?: string;\n /**\n * Prop to override default \"No datasource\" text (So why props name is notReady? Good question)\n */\n notReadyText?: string;\n /**\n * Use \"transparent\" to make table headers visible below the loading layer\n */\n overlayType?: 'transparent';\n};\n\nexport type PlAgOverlayNoRowsParams = {\n /**\n * Prop to override default \"Empty\" text\n */\n text?: string;\n};\n\nexport type PlDataTableSheetsSettings = {\n /** User-provided sheets for the sourceId */\n sheets: PlDataTableSheet[];\n /** Persisted selection for the sourceId */\n cachedState: PlDataTableSheetState[];\n};\n\nexport type PlDataTableSheetNormalized = {\n /** id of the axis */\n axisId: AxisId;\n /** sheet prefix */\n prefix: string;\n /** options to show in the filter dropdown */\n options: ListOptionBase<string | number>[];\n /** default (selected) value */\n defaultValue: string | number;\n};\n"],"names":["usePlDataTableSettingsV2","options","fc","filtersConfigValue","ops","e","computed","modelValue","toValue","settingsBase","sourceIdValue","deepClone","sheetsValue","canonicalize"],"mappings":";;;AAuFO,SAASA,EAA4BC,GAAiF;AAC3H,QAAMC,IAAKD,EAAQ,eACbE,IAAqB,OAAOD,KAAO,aACrC,CAACE,MAGK;AACA,QAAA;AACF,aAAOF,EAAG;AAAA,QACR,UAAU,KAAK,MAAME,EAAI,QAAQ;AAAA,QACjC,QAAQA,EAAI;AAAA,MAAA,CACb;AAAA,aACMC,GAAG;AACF,qBAAA,MAAM,sCAAsCD,EAAI,QAAQ,aAAa,KAAK,UAAUA,EAAI,MAAM,CAAC,2BAA2BC,CAAC,GAC5H,CAAC;AAAA,IAAA;AAAA,EAEZ,IACA,OAAO,CAAA;AACX,SAAOC,EAAS,MAAM;AACd,UAAAC,IAAaC,EAAQP,EAAQ,KAAK;AACpC,QAAAQ;AACJ,QAAI,cAAcR,GAAS;AACzB,YAAMS,IAAgBC,EAAUH,EAAQP,EAAQ,QAAQ,CAAC;AACzD,UAAIA,EAAQ,QAAQ;AAClB,cAAMW,IAAcD,EAAUH,EAAQP,EAAQ,MAAM,CAAC;AACrD,QAAAQ,IAAeC,KAAiBE,IAC5B;AAAA,UACE,UAAUC,EAAaH,CAAa;AAAA,UACpC,QAAQE;AAAA,UACR,OAAOL;AAAA,QAAA,IAET,EAAE,UAAU,KAAK;AAAA,MAAA;AAErB,QAAAE,IAAeC,IACX;AAAA,UACE,UAAUG,EAAaH,CAAa;AAAA,UACpC,QAAQ,CAAC;AAAA,UACT,OAAOH;AAAA,QAAA,IAET,EAAE,UAAU,KAAK;AAAA,IACvB,WAEIN,EAAQ,QAAQ;AACZ,YAAAW,IAAcJ,EAAQP,EAAQ,MAAM;AAC1C,MAAAQ,IAAeG,IACX;AAAA,QACE,UAAUC,EAAa,QAAQ;AAAA,QAC/B,QAAQD;AAAA,QACR,OAAO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