@platforma-sdk/ui-vue 1.40.0 → 1.40.2
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/.turbo/turbo-build.log +27 -30
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/AgGridVue/selection.d.ts.map +1 -1
- package/dist/AgGridVue/selection.js +11 -10
- package/dist/AgGridVue/selection.js.map +1 -1
- package/dist/AgGridVue/useAgGridOptions.js +53 -54
- package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts +4 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +184 -155
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +6 -7
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/focus-row.d.ts +5 -6
- package/dist/components/PlAgDataTable/sources/focus-row.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/focus-row.js +23 -27
- package/dist/components/PlAgDataTable/sources/focus-row.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/menu-items.js +1 -1
- package/dist/components/PlAgDataTable/sources/menu-items.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +13 -6
- package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-source-v2.js +121 -113
- package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.js +48 -49
- package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
- package/dist/components/PlAgDataTable/types.d.ts +18 -5
- package/dist/components/PlAgDataTable/types.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/types.js +26 -25
- package/dist/components/PlAgDataTable/types.js.map +1 -1
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +9 -10
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
- package/dist/components/PlAgRowNumHeader.vue.js +2 -3
- package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlDropdown/PlDropdown.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlFileInput/PlFileInput.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/components/PlTextField/PlTextField.vue.js +1 -1
- package/dist/lib/ui/uikit/dist/composition/computedCached.js +13 -14
- package/dist/lib/ui/uikit/dist/composition/computedCached.js.map +1 -1
- package/dist/lib/ui/uikit/dist/composition/watchCached.js +15 -15
- package/dist/lib/ui/uikit/dist/composition/watchCached.js.map +1 -1
- package/dist/lib/ui/uikit/dist/generated/components/svg/images/{SvgRequired.vue.js → SvgRequired.vue2.js} +1 -1
- package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue2.js.map +1 -0
- package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js +1 -1
- package/dist/lib/ui/uikit/dist/sdk/model/dist/index.js.map +1 -1
- package/dist/lib.js +256 -257
- package/dist/sdk/model/dist/index.js +111 -111
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +5 -7
- package/src/AgGridVue/selection.ts +12 -10
- package/src/components/PlAgDataTable/PlAgDataTableV2.vue +66 -27
- package/src/components/PlAgDataTable/sources/focus-row.ts +26 -33
- package/src/components/PlAgDataTable/sources/menu-items.ts +1 -1
- package/src/components/PlAgDataTable/sources/table-source-v2.ts +75 -47
- package/src/components/PlAgDataTable/sources/table-state-v2.ts +30 -33
- package/src/components/PlAgDataTable/types.ts +23 -7
- package/dist/_virtual/lodash.js +0 -6
- package/dist/_virtual/lodash.js.map +0 -1
- package/dist/_virtual/lodash2.js +0 -5
- package/dist/_virtual/lodash2.js.map +0 -1
- package/dist/components/PlAgDataTable/sources/file-source.d.ts +0 -7
- package/dist/components/PlAgDataTable/sources/file-source.d.ts.map +0 -1
- package/dist/lib/ui/uikit/dist/generated/components/svg/images/SvgRequired.vue.js.map +0 -1
- package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js +0 -3678
- package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js.map +0 -1
- package/src/components/PlAgDataTable/sources/file-source.ts +0 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-state-v2.js","sources":["../../../../src/components/PlAgDataTable/sources/table-state-v2.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"table-state-v2.js","sources":["../../../../src/components/PlAgDataTable/sources/table-state-v2.ts"],"sourcesContent":["import {\n makeDefaultPTableParams,\n parseJson,\n upgradePlDataTableStateV2,\n type PlDataTableGridStateCore,\n type PlDataTableSheetState,\n type PlDataTableStateV2,\n type PlDataTableFilterState,\n type PlDataTableStateV2CacheEntry,\n type PlDataTableStateV2Normalized,\n type PObjectId,\n type PTableParamsV2,\n type PTableRecordFilter,\n type PTableSorting,\n} from '@platforma-sdk/model';\nimport {\n computed,\n watch,\n type Ref,\n type WritableComputedRef,\n} from 'vue';\nimport type {\n PlDataTableSettingsV2,\n} from '../types';\nimport { isJsonEqual } from '@milaboratories/helpers';\nimport { makePredicate } from '../../PlTableFilters/filters_logic';\nimport { computedCached } from '@milaboratories/uikit';\n\ntype PlDataTableStateV2CacheEntryNullable = PlDataTableStateV2CacheEntry | {\n sourceId: null;\n gridState: Record<string, never>;\n sheetsState: [];\n filtersState: [];\n};\n\nfunction makeDefaultState(): PlDataTableStateV2CacheEntryNullable {\n return {\n sourceId: null,\n gridState: {},\n sheetsState: [],\n filtersState: [],\n };\n}\n\nfunction getHiddenColIds(state: PlDataTableGridStateCore['columnVisibility']): PObjectId[] | null {\n return state?.hiddenColIds\n ?.map(parseJson)\n .reduce((acc, c) => {\n if (c.source.type === 'column') {\n acc.push(c.source.id);\n }\n return acc;\n }, [] as PObjectId[])\n ?? null;\n}\n\nfunction makePartitionFilters(sheetsState: PlDataTableSheetState[]): PTableRecordFilter[] {\n return sheetsState.map((s) => ({\n type: 'bySingleColumnV2',\n column: {\n type: 'axis',\n id: s.axisId,\n },\n predicate: {\n operator: 'Equal',\n reference: s.value,\n },\n }));\n}\n\nfunction makeFilters(columnsState: PlDataTableFilterState[]): PTableRecordFilter[] {\n return columnsState\n .reduce((acc, s) => {\n if (!s.filter || s.filter.disabled) {\n return acc;\n }\n acc.push({\n type: 'bySingleColumnV2',\n column: s.id,\n predicate: makePredicate(s.alphabetic, s.filter.value),\n });\n return acc;\n }, [] as PTableRecordFilter[]);\n}\n\nfunction makeSorting(state: PlDataTableGridStateCore['sort']): PTableSorting[] {\n return (\n state?.sortModel.map((item) => {\n const { spec: _, ...column } = parseJson(\n item.colId,\n ).labeled;\n return {\n column,\n ascending: item.sort === 'asc',\n naAndAbsentAreLeastValues: item.sort === 'asc',\n };\n }) ?? []\n );\n}\n\nfunction makePTableParams(state: PlDataTableStateV2CacheEntry): PTableParamsV2 {\n return {\n sourceId: state.sourceId,\n hiddenColIds: getHiddenColIds(state.gridState.columnVisibility),\n partitionFilters: makePartitionFilters(state.sheetsState),\n filters: makeFilters(state.filtersState),\n sorting: makeSorting(state.gridState.sort),\n };\n}\n\nexport function useTableState(\n tableStateDenormalized: Ref<PlDataTableStateV2>,\n settings: Ref<PlDataTableSettingsV2>,\n): {\n gridState: WritableComputedRef<PlDataTableGridStateCore>;\n sheetsState: WritableComputedRef<PlDataTableSheetState[]>;\n filtersState: WritableComputedRef<PlDataTableFilterState[]>;\n } {\n const tableStateNormalized = computedCached<PlDataTableStateV2Normalized>({\n get: () => upgradePlDataTableStateV2(tableStateDenormalized.value),\n set: (newState) => tableStateDenormalized.value = newState,\n });\n\n const tableState = computed<PlDataTableStateV2CacheEntryNullable>({\n get: () => {\n const defaultState = makeDefaultState();\n\n const sourceId = settings.value.sourceId;\n if (!sourceId) return defaultState;\n\n const cachedState = tableStateNormalized.value.stateCache\n .find((entry) => entry.sourceId === sourceId);\n if (!cachedState) return {\n ...defaultState,\n sourceId,\n };\n\n return cachedState;\n },\n set: (state) => {\n const oldState = { ...tableStateNormalized.value };\n const newState: PlDataTableStateV2Normalized = {\n ...oldState,\n pTableParams: makeDefaultPTableParams(),\n };\n\n if (state.sourceId) {\n newState.pTableParams = makePTableParams(state);\n\n const stateIdx = newState.stateCache.findIndex((entry) => entry.sourceId === state.sourceId);\n if (stateIdx !== -1) {\n newState.stateCache[stateIdx] = state;\n } else {\n const CacheDepth = 5;\n newState.stateCache.push(state);\n newState.stateCache = newState.stateCache.slice(-CacheDepth);\n }\n }\n\n tableStateNormalized.value = newState;\n },\n });\n\n // Update pTableParams when sourceId changes\n watch(\n () => tableState.value,\n (state) => {\n const newParams = state.sourceId ? makePTableParams(state) : makeDefaultPTableParams();\n const oldParams = tableStateNormalized.value.pTableParams;\n if (!isJsonEqual(newParams, oldParams)) {\n tableStateNormalized.value = {\n ...tableStateNormalized.value,\n pTableParams: newParams,\n };\n }\n },\n { deep: true },\n );\n\n const gridState = computed<PlDataTableGridStateCore>({\n get: () => tableState.value.gridState,\n set: (gridState) => {\n const oldState = tableState.value;\n if (oldState.sourceId) {\n tableState.value = {\n ...oldState,\n gridState,\n };\n }\n },\n });\n\n const sheetsState = computed<PlDataTableSheetState[]>({\n get: () => tableState.value.sheetsState,\n set: (sheetsState) => {\n const oldState = tableState.value;\n if (oldState.sourceId) {\n tableState.value = {\n ...oldState,\n sheetsState,\n };\n }\n },\n });\n\n const filtersState = computed<PlDataTableFilterState[]>({\n get: () => tableState.value.filtersState,\n set: (filtersState) => {\n const oldState = tableState.value;\n if (oldState.sourceId) {\n tableState.value = {\n ...oldState,\n filtersState,\n };\n }\n },\n });\n\n return { gridState, sheetsState, filtersState };\n}\n"],"names":["makeDefaultState","getHiddenColIds","state","_a","parseJson","acc","c","makePartitionFilters","sheetsState","s","makeFilters","columnsState","makePredicate","makeSorting","item","_","column","makePTableParams","useTableState","tableStateDenormalized","settings","tableStateNormalized","computedCached","upgradePlDataTableStateV2","newState","tableState","computed","defaultState","sourceId","cachedState","entry","makeDefaultPTableParams","stateIdx","watch","newParams","oldParams","isJsonEqual","gridState","oldState","filtersState"],"mappings":";;;;;;;AAmCA,SAASA,IAAyD;AACzD,SAAA;AAAA,IACL,UAAU;AAAA,IACV,WAAW,CAAC;AAAA,IACZ,aAAa,CAAC;AAAA,IACd,cAAc,CAAA;AAAA,EAChB;AACF;AAEA,SAASC,EAAgBC,GAAyE;;AACzF,WAAAC,IAAAD,KAAA,gBAAAA,EAAO,iBAAP,gBAAAC,EACH,IAAIC,GACL,OAAO,CAACC,GAAKC,OACRA,EAAE,OAAO,SAAS,YAChBD,EAAA,KAAKC,EAAE,OAAO,EAAE,GAEfD,IACN,CAAA,OACA;AACP;AAEA,SAASE,EAAqBC,GAA4D;AACjF,SAAAA,EAAY,IAAI,CAACC,OAAO;AAAA,IAC7B,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,IAAIA,EAAE;AAAA,IACR;AAAA,IACA,WAAW;AAAA,MACT,UAAU;AAAA,MACV,WAAWA,EAAE;AAAA,IAAA;AAAA,EACf,EACA;AACJ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,YAAM8B,IAAWb,EAAW;AAC5B,MAAIa,EAAS,aACXb,EAAW,QAAQ;AAAA,QACjB,GAAGa;AAAA,QACH,aAAA9B;AAAAA,MACF;AAAA,IACF;AAAA,EACF,CACD,GAEK+B,IAAeb,EAAmC;AAAA,IACtD,KAAK,MAAMD,EAAW,MAAM;AAAA,IAC5B,KAAK,CAACc,MAAiB;AACrB,YAAMD,IAAWb,EAAW;AAC5B,MAAIa,EAAS,aACXb,EAAW,QAAQ;AAAA,QACjB,GAAGa;AAAA,QACH,cAAAC;AAAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AAEM,SAAA,EAAE,WAAAF,GAAW,aAAA7B,GAAa,cAAA+B,EAAa;AAChD;"}
|
|
@@ -87,16 +87,29 @@ export type PlAgDataTableV2Controller = {
|
|
|
87
87
|
*/
|
|
88
88
|
focusRow: (rowKey: PTableKey) => Promise<void>;
|
|
89
89
|
};
|
|
90
|
-
export type
|
|
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>;
|
|
91
97
|
/** PlAgDataTableV2 row */
|
|
92
98
|
export type PlAgDataTableV2Row = {
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
/** Unique row identifier
|
|
96
|
-
id:
|
|
99
|
+
/** Axes key */
|
|
100
|
+
axesKey: PTableKey;
|
|
101
|
+
/** Unique row identifier */
|
|
102
|
+
id: PlTableRowIdJson;
|
|
97
103
|
/** Row values by column; sheet axes and labeled axes are excluded */
|
|
98
104
|
[field: `${number}`]: PTableValue | PTableHidden;
|
|
99
105
|
};
|
|
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
|
+
};
|
|
100
113
|
export type PlAgOverlayLoadingParams = {
|
|
101
114
|
/**
|
|
102
115
|
* 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;
|
|
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,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AEF,mEAAmE;AACnE,MAAM,MAAM,4BAA4B,GAAG;IACzC,6CAA6C;IAC7C,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,wDAAwD;IACxD,mBAAmB,EAAE,SAAS,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,4CAA4C;IAC5C,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,2CAA2C;IAC3C,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;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,25 +1,26 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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) => {
|
|
5
6
|
try {
|
|
6
|
-
return
|
|
7
|
+
return u({
|
|
7
8
|
sourceId: JSON.parse(e.sourceId),
|
|
8
9
|
column: e.column
|
|
9
10
|
});
|
|
10
|
-
} catch (
|
|
11
|
-
return console.error(`filtersConfig failed for sourceId: ${e.sourceId}, column: ${JSON.stringify(e.column)} - using default config`,
|
|
11
|
+
} catch (r) {
|
|
12
|
+
return console.error(`filtersConfig failed for sourceId: ${e.sourceId}, column: ${JSON.stringify(e.column)} - using default config`, r), {};
|
|
12
13
|
}
|
|
13
14
|
} : () => ({});
|
|
14
|
-
return
|
|
15
|
-
const e = l(
|
|
16
|
-
if ("sourceId" in
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
sourceId:
|
|
22
|
-
sheets:
|
|
15
|
+
return f(() => {
|
|
16
|
+
const e = l(s.model);
|
|
17
|
+
if ("sourceId" in s) {
|
|
18
|
+
const r = c(l(s.sourceId));
|
|
19
|
+
if (s.sheets) {
|
|
20
|
+
const n = c(l(s.sheets));
|
|
21
|
+
return r && n ? {
|
|
22
|
+
sourceId: o(r),
|
|
23
|
+
sheets: n,
|
|
23
24
|
model: e,
|
|
24
25
|
filtersConfig: t
|
|
25
26
|
} : {
|
|
@@ -27,8 +28,8 @@ function d(r) {
|
|
|
27
28
|
filtersConfig: t
|
|
28
29
|
};
|
|
29
30
|
} else
|
|
30
|
-
return
|
|
31
|
-
sourceId:
|
|
31
|
+
return r ? {
|
|
32
|
+
sourceId: o(r),
|
|
32
33
|
sheets: [],
|
|
33
34
|
model: e,
|
|
34
35
|
filtersConfig: t
|
|
@@ -36,11 +37,11 @@ function d(r) {
|
|
|
36
37
|
sourceId: null,
|
|
37
38
|
filtersConfig: t
|
|
38
39
|
};
|
|
39
|
-
} else if (
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
sourceId:
|
|
43
|
-
sheets:
|
|
40
|
+
} else if (s.sheets) {
|
|
41
|
+
const r = l(s.sheets);
|
|
42
|
+
return r ? {
|
|
43
|
+
sourceId: o("static"),
|
|
44
|
+
sheets: r,
|
|
44
45
|
model: e,
|
|
45
46
|
filtersConfig: t
|
|
46
47
|
} : {
|
|
@@ -49,7 +50,7 @@ function d(r) {
|
|
|
49
50
|
};
|
|
50
51
|
} else
|
|
51
52
|
return e ? {
|
|
52
|
-
sourceId:
|
|
53
|
+
sourceId: o("static"),
|
|
53
54
|
sheets: [],
|
|
54
55
|
model: e,
|
|
55
56
|
filtersConfig: t
|
|
@@ -60,6 +61,6 @@ function d(r) {
|
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
+
m as usePlDataTableSettingsV2
|
|
64
65
|
};
|
|
65
66
|
//# 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';\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 = toValue(options.sourceId);\n if (options.sheets) {\n const sheetsValue = 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
|
|
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,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;AACxC,QAAI,cAAcA,GAAS;AACzB,YAAMQ,IAAgBC,EAAUF,EAAQP,EAAQ,QAAQ,CAAC;AACzD,UAAIA,EAAQ,QAAQ;AAClB,cAAMU,IAAcD,EAAUF,EAAQP,EAAQ,MAAM,CAAC;AACrD,eAAOQ,KAAiBE,IACpB;AAAA,UACE,UAAUC,EAAaH,CAAa;AAAA,UACpC,QAAQE;AAAA,UACR,OAAOJ;AAAA,UACP,eAAeJ;AAAA,QAAA,IAEjB;AAAA,UACE,UAAU;AAAA,UACV,eAAeA;AAAA,QACjB;AAAA,MAAA;AAEJ,eAAOM,IACH;AAAA,UACE,UAAUG,EAAaH,CAAa;AAAA,UACpC,QAAQ,CAAC;AAAA,UACT,OAAOF;AAAA,UACP,eAAeJ;AAAA,QAAA,IAEjB;AAAA,UACE,UAAU;AAAA,UACV,eAAeA;AAAA,QACjB;AAAA,IACN,WAEIF,EAAQ,QAAQ;AACZ,YAAAU,IAAcH,EAAQP,EAAQ,MAAM;AAC1C,aAAOU,IACH;AAAA,QACE,UAAUC,EAAa,QAAQ;AAAA,QAC/B,QAAQD;AAAA,QACR,OAAOJ;AAAA,QACP,eAAeJ;AAAA,MAAA,IAEjB;AAAA,QACE,UAAU;AAAA,QACV,eAAeA;AAAA,MACjB;AAAA,IAAA;AAEJ,aAAOI,IACH;AAAA,QACE,UAAUK,EAAa,QAAQ;AAAA,QAC/B,QAAQ,CAAC;AAAA,QACT,OAAOL;AAAA,QACP,eAAeJ;AAAA,MAAA,IAEjB;AAAA,QACE,UAAU;AAAA,QACV,eAAeA;AAAA,MACjB;AAAA,EAER,CACD;AACH;"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
.pl-ag-chart-stacked-bar-cell{height:100%;display:flex;flex-direction:row;align-items:center}.pl-ag-chart-stacked-bar-cell__not-ready{color:var(--txt-03)!important}
|
|
8
8
|
.pl-ag-chart-histogram-cell{height:100%;display:flex;flex-direction:row;align-items:center}.pl-ag-chart-histogram-cell__not-ready{color:var(--txt-03)!important}
|
|
9
9
|
.pl-ag-cell-status-tag{height:100%;padding:0 12px}`)),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
import { defineComponent as x, ref as c, computed as C, onBeforeMount as h, onBeforeUnmount as y, createElementBlock as d, openBlock as
|
|
10
|
+
import { defineComponent as x, ref as c, computed as C, onBeforeMount as h, onBeforeUnmount as y, createElementBlock as d, openBlock as i, normalizeClass as n, unref as t, createCommentVNode as u, createBlock as B, toDisplayString as b } from "vue";
|
|
11
11
|
import "../../lib/ui/uikit/dist/index.js";
|
|
12
12
|
import r from "./pl-ag-row-num-checkbox.module.scss.js";
|
|
13
13
|
|
|
@@ -20,7 +20,6 @@ import "ag-grid-vue3";
|
|
|
20
20
|
import "ag-grid-enterprise";
|
|
21
21
|
|
|
22
22
|
import "../../_virtual/canonicalize.js";
|
|
23
|
-
import "../../_virtual/lodash.js";
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
import "../../_virtual/index.js";
|
|
@@ -32,7 +31,7 @@ import "../PlMultiSequenceAlignment/data.js";
|
|
|
32
31
|
import "@milaboratories/biowasm-tools";
|
|
33
32
|
import "../../composition/fileContent.js";
|
|
34
33
|
import E from "../../lib/ui/uikit/dist/components/PlCheckbox/PlCheckbox.vue.js";
|
|
35
|
-
const
|
|
34
|
+
const W = /* @__PURE__ */ x({
|
|
36
35
|
__name: "PlAgRowNumCheckbox",
|
|
37
36
|
props: {
|
|
38
37
|
params: {}
|
|
@@ -40,21 +39,21 @@ const X = /* @__PURE__ */ x({
|
|
|
40
39
|
setup(f) {
|
|
41
40
|
const e = f, a = e.params.api, o = c(!!e.params.node.isSelected()), v = C(() => o.value || p(a)), S = c(p(a)), m = () => {
|
|
42
41
|
o.value = e.params.node.isSelected() !== !1;
|
|
43
|
-
}, k = (
|
|
44
|
-
p(a) && (e.params.node.setSelected(
|
|
42
|
+
}, k = (l) => {
|
|
43
|
+
p(a) && (e.params.node.setSelected(l), m());
|
|
45
44
|
};
|
|
46
45
|
return h(() => {
|
|
47
46
|
e.params.node.addEventListener("rowSelected", m);
|
|
48
47
|
}), y(() => {
|
|
49
48
|
e.params.node.removeEventListener("rowSelected", m);
|
|
50
|
-
}), (
|
|
49
|
+
}), (l, s) => (i(), d("div", {
|
|
51
50
|
class: n([t(r).container, { [t(r)["allowed-selection"]]: S.value }, "d-flex", "justify-center", "align-center"])
|
|
52
51
|
}, [
|
|
53
|
-
o.value ? u("", !0) : (
|
|
52
|
+
o.value ? u("", !0) : (i(), d("div", {
|
|
54
53
|
key: 0,
|
|
55
54
|
class: n([t(r).text])
|
|
56
|
-
}, b(
|
|
57
|
-
v.value ? (
|
|
55
|
+
}, b(l.params.value), 3)),
|
|
56
|
+
v.value ? (i(), B(t(E), {
|
|
58
57
|
key: 1,
|
|
59
58
|
modelValue: o.value,
|
|
60
59
|
"onUpdate:modelValue": [
|
|
@@ -67,6 +66,6 @@ const X = /* @__PURE__ */ x({
|
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
68
|
export {
|
|
70
|
-
|
|
69
|
+
W as default
|
|
71
70
|
};
|
|
72
71
|
//# sourceMappingURL=PlAgRowNumCheckbox.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgRowNumCheckbox.vue.js","sources":["../../../src/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ICellRendererParams } from 'ag-grid-enterprise';\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport { ref, computed, onBeforeMount, onBeforeUnmount } from 'vue';\nimport $styles from './pl-ag-row-num-checkbox.module.scss';\nimport { isSelectionEnabled } from '../../lib';\n\nconst props = defineProps<{ params: ICellRendererParams }>();\n\nconst api = props.params.api;\nconst isChecked = ref(!!props.params.node.isSelected());\nconst forceShowCheckbox = computed(() => isChecked.value || isSelectionEnabled(api));\nconst allowedSelection = ref(isSelectionEnabled(api));\n\nconst updateSelection = () => {\n isChecked.value = props.params.node.isSelected() !== false;\n};\n\nconst setSelection = (val: boolean) => {\n if (isSelectionEnabled(api)) {\n props.params.node.setSelected(val);\n updateSelection();\n }\n};\n\nonBeforeMount(() => {\n props.params.node.addEventListener('rowSelected', updateSelection);\n});\n\nonBeforeUnmount(() => {\n props.params.node.removeEventListener('rowSelected', updateSelection);\n});\n</script>\n\n<template>\n <div :class=\"[$styles.container, { [$styles['allowed-selection']]: allowedSelection }, 'd-flex', 'justify-center', 'align-center']\">\n <div v-if=\"!isChecked\" :class=\"[$styles.text]\">{{ params.value }}</div>\n <PlCheckbox\n v-if=\"forceShowCheckbox\"\n v-model=\"isChecked\"\n :class=\"[$styles.checkbox, isChecked && $styles.checked]\"\n @update:modelValue=\"setSelection\"\n />\n </div>\n</template>\n"],"names":["props","__props","api","isChecked","ref","forceShowCheckbox","computed","isSelectionEnabled","allowedSelection","updateSelection","setSelection","val","onBeforeMount","onBeforeUnmount"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgRowNumCheckbox.vue.js","sources":["../../../src/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ICellRendererParams } from 'ag-grid-enterprise';\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport { ref, computed, onBeforeMount, onBeforeUnmount } from 'vue';\nimport $styles from './pl-ag-row-num-checkbox.module.scss';\nimport { isSelectionEnabled } from '../../lib';\n\nconst props = defineProps<{ params: ICellRendererParams }>();\n\nconst api = props.params.api;\nconst isChecked = ref(!!props.params.node.isSelected());\nconst forceShowCheckbox = computed(() => isChecked.value || isSelectionEnabled(api));\nconst allowedSelection = ref(isSelectionEnabled(api));\n\nconst updateSelection = () => {\n isChecked.value = props.params.node.isSelected() !== false;\n};\n\nconst setSelection = (val: boolean) => {\n if (isSelectionEnabled(api)) {\n props.params.node.setSelected(val);\n updateSelection();\n }\n};\n\nonBeforeMount(() => {\n props.params.node.addEventListener('rowSelected', updateSelection);\n});\n\nonBeforeUnmount(() => {\n props.params.node.removeEventListener('rowSelected', updateSelection);\n});\n</script>\n\n<template>\n <div :class=\"[$styles.container, { [$styles['allowed-selection']]: allowedSelection }, 'd-flex', 'justify-center', 'align-center']\">\n <div v-if=\"!isChecked\" :class=\"[$styles.text]\">{{ params.value }}</div>\n <PlCheckbox\n v-if=\"forceShowCheckbox\"\n v-model=\"isChecked\"\n :class=\"[$styles.checkbox, isChecked && $styles.checked]\"\n @update:modelValue=\"setSelection\"\n />\n </div>\n</template>\n"],"names":["props","__props","api","isChecked","ref","forceShowCheckbox","computed","isSelectionEnabled","allowedSelection","updateSelection","setSelection","val","onBeforeMount","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,UAAMA,IAAQC,GAERC,IAAMF,EAAM,OAAO,KACnBG,IAAYC,EAAI,CAAC,CAACJ,EAAM,OAAO,KAAK,YAAY,GAChDK,IAAoBC,EAAS,MAAMH,EAAU,SAASI,EAAmBL,CAAG,CAAC,GAC7EM,IAAmBJ,EAAIG,EAAmBL,CAAG,CAAC,GAE9CO,IAAkB,MAAM;AAC5B,MAAAN,EAAU,QAAQH,EAAM,OAAO,KAAK,iBAAiB;AAAA,IACvD,GAEMU,IAAe,CAACC,MAAiB;AACjC,MAAAJ,EAAmBL,CAAG,MAClBF,EAAA,OAAO,KAAK,YAAYW,CAAG,GACjBF,EAAA;AAAA,IAEpB;AAEA,WAAAG,EAAc,MAAM;AAClB,MAAAZ,EAAM,OAAO,KAAK,iBAAiB,eAAeS,CAAe;AAAA,IAAA,CAClE,GAEDI,EAAgB,MAAM;AACpB,MAAAb,EAAM,OAAO,KAAK,oBAAoB,eAAeS,CAAe;AAAA,IAAA,CACrE;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,7 +19,6 @@ import "ag-grid-vue3";
|
|
|
19
19
|
import "ag-grid-enterprise";
|
|
20
20
|
|
|
21
21
|
import "../_virtual/canonicalize.js";
|
|
22
|
-
import "../_virtual/lodash.js";
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
import "../_virtual/index.js";
|
|
@@ -31,7 +30,7 @@ import "./PlMultiSequenceAlignment/data.js";
|
|
|
31
30
|
import "@milaboratories/biowasm-tools";
|
|
32
31
|
import "../composition/fileContent.js";
|
|
33
32
|
import h from "../lib/ui/uikit/dist/components/PlCheckbox/PlCheckbox.vue.js";
|
|
34
|
-
const k = { style: { position: "absolute", inset: "0", display: "flex", "justify-content": "center", "align-items": "center" } }, B = { key: 1 },
|
|
33
|
+
const k = { style: { position: "absolute", inset: "0", display: "flex", "justify-content": "center", "align-items": "center" } }, B = { key: 1 }, $ = /* @__PURE__ */ E({
|
|
35
34
|
__name: "PlAgRowNumHeader",
|
|
36
35
|
props: {
|
|
37
36
|
params: {}
|
|
@@ -66,6 +65,6 @@ const k = { style: { position: "absolute", inset: "0", display: "flex", "justify
|
|
|
66
65
|
}
|
|
67
66
|
});
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
$ as default
|
|
70
69
|
};
|
|
71
70
|
//# sourceMappingURL=PlAgRowNumHeader.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgRowNumHeader.vue.js","sources":["../../src/components/PlAgRowNumHeader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport type { IHeaderParams } from 'ag-grid-enterprise';\nimport { computed, onBeforeMount, onBeforeUnmount, ref } from 'vue';\nimport { deselectAll, getSelectedRowsCount, getTotalRowsCount, isSelectionEnabled, selectAll } from '../lib';\n\nconst { params } = defineProps<{\n params: IHeaderParams;\n}>();\n\nconst selectedRowCount = ref(getSelectedRowsCount(params.api));\nconst totalRowCount = ref(getTotalRowsCount(params.api));\nconst isSelectable = ref(isSelectionEnabled(params.api));\n\nconst someRowsSelected = computed(() =>\n selectedRowCount.value > 0,\n);\n\nconst allRowsSelected = computed(() =>\n someRowsSelected.value\n && selectedRowCount.value === totalRowCount.value,\n);\n\nfunction toggleSelectAll() {\n if (someRowsSelected.value) {\n deselectAll(params.api);\n } else {\n selectAll(params.api);\n }\n}\n\nfunction updateRowCounts() {\n selectedRowCount.value = getSelectedRowsCount(params.api);\n totalRowCount.value = getTotalRowsCount(params.api);\n}\n\nfunction updateIsSelectable() {\n isSelectable.value = isSelectionEnabled(params.api);\n}\n\nonBeforeMount(() => {\n params.api.addEventListener('selectionChanged', updateRowCounts);\n params.api.addEventListener('rowDataUpdated', updateRowCounts);\n params.api.addEventListener('modelUpdated', updateRowCounts);\n params.api.addEventListener('stateUpdated', updateIsSelectable);\n});\n\nonBeforeUnmount(() => {\n params.api.removeEventListener('selectionChanged', updateRowCounts);\n params.api.removeEventListener('rowDataUpdated', updateRowCounts);\n params.api.removeEventListener('modelUpdated', updateRowCounts);\n params.api.removeEventListener('stateUpdated', updateIsSelectable);\n});\n</script>\n\n<template>\n <div\n style=\"\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n \"\n >\n <PlCheckbox\n v-if=\"isSelectable\"\n :model-value=\"someRowsSelected\"\n :indeterminate=\"someRowsSelected && !allRowsSelected\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span v-else>\n {{ params.displayName }}\n </span>\n </div>\n</template>\n"],"names":["selectedRowCount","ref","getSelectedRowsCount","__props","totalRowCount","getTotalRowsCount","isSelectable","isSelectionEnabled","someRowsSelected","computed","allRowsSelected","toggleSelectAll","deselectAll","selectAll","updateRowCounts","updateIsSelectable","onBeforeMount","onBeforeUnmount"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgRowNumHeader.vue.js","sources":["../../src/components/PlAgRowNumHeader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport type { IHeaderParams } from 'ag-grid-enterprise';\nimport { computed, onBeforeMount, onBeforeUnmount, ref } from 'vue';\nimport { deselectAll, getSelectedRowsCount, getTotalRowsCount, isSelectionEnabled, selectAll } from '../lib';\n\nconst { params } = defineProps<{\n params: IHeaderParams;\n}>();\n\nconst selectedRowCount = ref(getSelectedRowsCount(params.api));\nconst totalRowCount = ref(getTotalRowsCount(params.api));\nconst isSelectable = ref(isSelectionEnabled(params.api));\n\nconst someRowsSelected = computed(() =>\n selectedRowCount.value > 0,\n);\n\nconst allRowsSelected = computed(() =>\n someRowsSelected.value\n && selectedRowCount.value === totalRowCount.value,\n);\n\nfunction toggleSelectAll() {\n if (someRowsSelected.value) {\n deselectAll(params.api);\n } else {\n selectAll(params.api);\n }\n}\n\nfunction updateRowCounts() {\n selectedRowCount.value = getSelectedRowsCount(params.api);\n totalRowCount.value = getTotalRowsCount(params.api);\n}\n\nfunction updateIsSelectable() {\n isSelectable.value = isSelectionEnabled(params.api);\n}\n\nonBeforeMount(() => {\n params.api.addEventListener('selectionChanged', updateRowCounts);\n params.api.addEventListener('rowDataUpdated', updateRowCounts);\n params.api.addEventListener('modelUpdated', updateRowCounts);\n params.api.addEventListener('stateUpdated', updateIsSelectable);\n});\n\nonBeforeUnmount(() => {\n params.api.removeEventListener('selectionChanged', updateRowCounts);\n params.api.removeEventListener('rowDataUpdated', updateRowCounts);\n params.api.removeEventListener('modelUpdated', updateRowCounts);\n params.api.removeEventListener('stateUpdated', updateIsSelectable);\n});\n</script>\n\n<template>\n <div\n style=\"\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n \"\n >\n <PlCheckbox\n v-if=\"isSelectable\"\n :model-value=\"someRowsSelected\"\n :indeterminate=\"someRowsSelected && !allRowsSelected\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span v-else>\n {{ params.displayName }}\n </span>\n </div>\n</template>\n"],"names":["selectedRowCount","ref","getSelectedRowsCount","__props","totalRowCount","getTotalRowsCount","isSelectable","isSelectionEnabled","someRowsSelected","computed","allRowsSelected","toggleSelectAll","deselectAll","selectAll","updateRowCounts","updateIsSelectable","onBeforeMount","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAmBC,EAAIC,EAAqBC,EAAM,OAAC,GAAG,CAAC,GACvDC,IAAgBH,EAAII,EAAkBF,EAAA,OAAO,GAAG,CAAC,GACjDG,IAAeL,EAAIM,EAAmBJ,EAAA,OAAO,GAAG,CAAC,GAEjDK,IAAmBC;AAAA,MAAS,MAChCT,EAAiB,QAAQ;AAAA,IAC3B,GAEMU,IAAkBD;AAAA,MAAS,MAC/BD,EAAiB,SACdR,EAAiB,UAAUI,EAAc;AAAA,IAC9C;AAEA,aAASO,IAAkB;AACzB,MAAIH,EAAiB,QACPI,EAAAT,EAAA,OAAO,GAAG,IAEZU,EAAAV,EAAA,OAAO,GAAG;AAAA,IACtB;AAGF,aAASW,IAAkB;AACzB,MAAAd,EAAiB,QAAQE,EAAqBC,SAAO,GAAG,GACxDC,EAAc,QAAQC,EAAkBF,SAAO,GAAG;AAAA,IAAA;AAGpD,aAASY,IAAqB;AAC5B,MAAAT,EAAa,QAAQC,EAAmBJ,SAAO,GAAG;AAAA,IAAA;AAGpD,WAAAa,EAAc,MAAM;AAClB,MAAAb,EAAM,OAAC,IAAI,iBAAiB,oBAAoBW,CAAe,GAC/DX,EAAM,OAAC,IAAI,iBAAiB,kBAAkBW,CAAe,GAC7DX,EAAM,OAAC,IAAI,iBAAiB,gBAAgBW,CAAe,GAC3DX,EAAM,OAAC,IAAI,iBAAiB,gBAAgBY,CAAkB;AAAA,IAAA,CAC/D,GAEDE,EAAgB,MAAM;AACpB,MAAAd,EAAA,OAAO,IAAI,oBAAoB,oBAAoBW,CAAe,GAClEX,EAAA,OAAO,IAAI,oBAAoB,kBAAkBW,CAAe,GAChEX,EAAM,OAAC,IAAI,oBAAoB,gBAAgBW,CAAe,GAC9DX,EAAA,OAAO,IAAI,oBAAoB,gBAAgBY,CAAkB;AAAA,IAAA,CAClE;;;;;;;;;;"}
|
|
@@ -11,7 +11,7 @@ import Le from "../PlIcon16/PlIcon16.vue.js";
|
|
|
11
11
|
import Se from "../PlIcon24/PlIcon24.vue.js";
|
|
12
12
|
import $e from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
13
13
|
import { useWatchFetch as U } from "../../composition/useWatchFetch.js";
|
|
14
|
-
import Ie from "../../generated/components/svg/images/SvgRequired.
|
|
14
|
+
import Ie from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
15
15
|
import { getErrorMessage as Ee } from "../../helpers/error.js";
|
|
16
16
|
import { debouncedRef as Ce } from "../../node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js";
|
|
17
17
|
(function() {
|
|
@@ -8,7 +8,7 @@ import xo from "../LongText.vue.js";
|
|
|
8
8
|
import { normalizeListOptions as go } from "../../helpers/utils.js";
|
|
9
9
|
import bo from "../PlIcon16/PlIcon16.vue.js";
|
|
10
10
|
import _o from "../PlIcon24/PlIcon24.vue.js";
|
|
11
|
-
import ko from "../../generated/components/svg/images/SvgRequired.
|
|
11
|
+
import ko from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
12
12
|
import { getErrorMessage as yo } from "../../helpers/error.js";
|
|
13
13
|
import Lo from "./OptionList.vue.js";
|
|
14
14
|
import { useGroupBy as zo } from "./useGroupBy.js";
|
|
@@ -10,7 +10,7 @@ import me from "../LongText.vue.js";
|
|
|
10
10
|
import xe from "../PlIcon16/PlIcon16.vue.js";
|
|
11
11
|
import be from "../PlIcon24/PlIcon24.vue.js";
|
|
12
12
|
import { normalizeListOptions as ye } from "../../helpers/utils.js";
|
|
13
|
-
import ke from "../../generated/components/svg/images/SvgRequired.
|
|
13
|
+
import ke from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
14
14
|
import { getErrorMessage as _e } from "../../helpers/error.js";
|
|
15
15
|
(function() {
|
|
16
16
|
try {
|
|
@@ -9,7 +9,7 @@ import { deepEqual as _, deepIncludes as T } from "../../helpers/objects.js";
|
|
|
9
9
|
import { normalizeListOptions as ho } from "../../helpers/utils.js";
|
|
10
10
|
import mo from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
11
11
|
import vo from "../PlIcon24/PlIcon24.vue.js";
|
|
12
|
-
import wo from "../../generated/components/svg/images/SvgRequired.
|
|
12
|
+
import wo from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
13
13
|
import { getErrorMessage as fo } from "../../helpers/error.js";
|
|
14
14
|
(function() {
|
|
15
15
|
try {
|
|
@@ -6,7 +6,7 @@ import "../../sdk/model/dist/index.js";
|
|
|
6
6
|
import A from "../../utils/DoubleContour.vue.js";
|
|
7
7
|
import { useLabelNotch as G } from "../../utils/useLabelNotch.js";
|
|
8
8
|
import { prettyBytes as x } from "../../lib/util/helpers/dist/index.js";
|
|
9
|
-
import J from "../../generated/components/svg/images/SvgRequired.
|
|
9
|
+
import J from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
10
10
|
import { getErrorMessage as W } from "../../helpers/error.js";
|
|
11
11
|
import { getFileNameFromHandle as X, getFilePathFromHandle as Z } from "../../lib/model/common/dist/index.js";
|
|
12
12
|
(function() {
|
|
@@ -3,7 +3,7 @@ import T from "../PlTooltip/PlTooltip.vue.js";
|
|
|
3
3
|
import q from "../../utils/DoubleContour.vue.js";
|
|
4
4
|
import { useLabelNotch as D } from "../../utils/useLabelNotch.js";
|
|
5
5
|
import { useValidation as P } from "../../utils/useValidation.js";
|
|
6
|
-
import U from "../../generated/components/svg/images/SvgRequired.
|
|
6
|
+
import U from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
7
7
|
import { getErrorMessage as A } from "../../helpers/error.js";
|
|
8
8
|
(function() {
|
|
9
9
|
try {
|
|
@@ -5,7 +5,7 @@ import { useLabelNotch as I } from "../../utils/useLabelNotch.js";
|
|
|
5
5
|
import { useValidation as J } from "../../utils/useValidation.js";
|
|
6
6
|
import K from "../PlIcon16/PlIcon16.vue.js";
|
|
7
7
|
import O from "../PlIcon24/PlIcon24.vue.js";
|
|
8
|
-
import Q from "../../generated/components/svg/images/SvgRequired.
|
|
8
|
+
import Q from "../../generated/components/svg/images/SvgRequired.vue2.js";
|
|
9
9
|
import { getErrorMessage as W } from "../../helpers/error.js";
|
|
10
10
|
(function() {
|
|
11
11
|
try {
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { isJsonEqual as
|
|
2
|
-
import { ref as
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { get: o, set: a, deep: p } = t, e = n(o());
|
|
1
|
+
import { isJsonEqual as o, deepClone as n } from "../lib/util/helpers/dist/index.js";
|
|
2
|
+
import { ref as p, computed as r, watch as s } from "vue";
|
|
3
|
+
function d(t) {
|
|
4
|
+
let a, l;
|
|
5
|
+
typeof t == "function" ? a = t : (a = t.get, l = t.set);
|
|
6
|
+
const e = p(a());
|
|
8
7
|
return s(
|
|
9
|
-
|
|
8
|
+
a,
|
|
10
9
|
(u) => {
|
|
11
|
-
|
|
10
|
+
o(u, e.value) || (e.value = n(u));
|
|
12
11
|
},
|
|
13
|
-
{ deep:
|
|
14
|
-
),
|
|
12
|
+
{ deep: !0 }
|
|
13
|
+
), l ? r({
|
|
15
14
|
get: () => e.value,
|
|
16
15
|
set: (u) => {
|
|
17
|
-
|
|
16
|
+
o(u, e.value) || (e.value = u, l(u));
|
|
18
17
|
}
|
|
19
|
-
}) :
|
|
18
|
+
}) : r(() => e.value);
|
|
20
19
|
}
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
d as computedCached
|
|
23
22
|
};
|
|
24
23
|
//# sourceMappingURL=computedCached.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computedCached.js","sources":["../../../../../../../../lib/ui/uikit/src/composition/computedCached.ts"],"sourcesContent":["import { isJsonEqual } from '@milaboratories/helpers';\nimport {\n computed,\n ref,\n watch,\n type ComputedGetter,\n type ComputedSetter,\n type ComputedRef,\n type WritableComputedRef,\n} from 'vue';\n\
|
|
1
|
+
{"version":3,"file":"computedCached.js","sources":["../../../../../../../../lib/ui/uikit/src/composition/computedCached.ts"],"sourcesContent":["import { deepClone, isJsonEqual } from '@milaboratories/helpers';\nimport {\n computed,\n ref,\n watch,\n type ComputedGetter,\n type ComputedSetter,\n type ComputedRef,\n type WritableComputedRef,\n} from 'vue';\n\n/**\n * Alternative to `computed`, but triggering only on actual data changes.\n * Always `deep` as the plain `computed` is.\n */\nexport function computedCached<T>(options: {\n get: ComputedGetter<T>;\n set: ComputedSetter<T>;\n}): WritableComputedRef<T>;\nexport function computedCached<T>(getter: ComputedGetter<T>): ComputedRef<T>;\nexport function computedCached<T>(arg: ComputedGetter<T> | {\n get: ComputedGetter<T>;\n set: ComputedSetter<T>;\n}) {\n let getter: ComputedGetter<T>;\n let setter: ComputedSetter<T> | undefined = undefined;\n if (typeof arg === 'function') {\n getter = arg;\n } else {\n getter = arg.get;\n setter = arg.set;\n }\n\n const cachedValue = ref<T>(getter());\n watch(\n getter,\n (newValue) => {\n if (!isJsonEqual(newValue, cachedValue.value)) {\n // `deepClone` is needed because in case some fields are patched the deep would be triggered,\n // but objects would be equal as the saved value was also patched\n cachedValue.value = deepClone(newValue);\n }\n },\n { deep: true },\n );\n\n if (setter) {\n return computed({\n get: () => cachedValue.value,\n set: (newValue) => {\n if (!isJsonEqual(newValue, cachedValue.value)) {\n cachedValue.value = newValue;\n setter(newValue);\n }\n },\n });\n } else {\n return computed(() => cachedValue.value);\n }\n}\n"],"names":["computedCached","arg","getter","setter","cachedValue","ref","watch","newValue","isJsonEqual","deepClone","computed"],"mappings":";;AAoBO,SAASA,EAAkBC,GAG/B;AACG,MAAAC,GACAC;AACA,SAAOF,KAAQ,aACRC,IAAAD,KAETC,IAASD,EAAI,KACbE,IAASF,EAAI;AAGTG,QAAAA,IAAcC,EAAOH,GAAQ;AACnCI,SAAAA;AAAAA,IACEJ;AAAAA,IACA,CAACK,MAAa;AACPC,MAAAA,EAAYD,GAAUH,EAAY,KAAK,MAG9BA,EAAA,QAAQK,EAAUF,CAAQ;AAAA,IAE1C;AAAA,IACA,EAAE,MAAM,GAAK;AAAA,EAAA,GAGXJ,IACKO,EAAS;AAAA,IACd,KAAK,MAAMN,EAAY;AAAA,IACvB,KAAK,CAACG,MAAa;AACZC,MAAAA,EAAYD,GAAUH,EAAY,KAAK,MAC1CA,EAAY,QAAQG,GACpBJ,EAAOI,CAAQ;AAAA,IAAA;AAAA,EAGpB,CAAA,IAEMG,EAAS,MAAMN,EAAY,KAAK;AAE3C;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { isJsonEqual as
|
|
2
|
-
import { ref as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
(
|
|
7
|
-
|
|
1
|
+
import { isJsonEqual as r, deepClone as d } from "../lib/util/helpers/dist/index.js";
|
|
2
|
+
import { ref as n, watch as u } from "vue";
|
|
3
|
+
function s(i, m, a) {
|
|
4
|
+
const e = n(), o = u(
|
|
5
|
+
i,
|
|
6
|
+
(t) => {
|
|
7
|
+
r(t, e.value) || (e.value = d(t));
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
deep:
|
|
10
|
+
deep: !0,
|
|
11
11
|
immediate: !0
|
|
12
12
|
// always initialize cachedValue
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
|
-
return
|
|
16
|
-
() =>
|
|
15
|
+
return u(
|
|
16
|
+
() => e.value,
|
|
17
17
|
// `as T` is safe as we always initialize cachedValue
|
|
18
|
-
|
|
18
|
+
m,
|
|
19
19
|
// separate watch so that `onWatcherCleanup` would only be triggerred here
|
|
20
20
|
{
|
|
21
21
|
// standard vue `WatchOptions` conform to `WatchCachedOptions` interface,
|
|
22
22
|
// so construct new options to remove unsupported entries
|
|
23
|
-
deep:
|
|
24
|
-
immediate:
|
|
23
|
+
deep: !0,
|
|
24
|
+
immediate: a == null ? void 0 : a.immediate
|
|
25
25
|
}
|
|
26
|
-
),
|
|
26
|
+
), o;
|
|
27
27
|
}
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
s as watchCached
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=watchCached.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchCached.js","sources":["../../../../../../../../lib/ui/uikit/src/composition/watchCached.ts"],"sourcesContent":["import { isJsonEqual } from '@milaboratories/helpers';\nimport {\n ref,\n watch,\n type WatchCallback,\n type WatchHandle,\n type WatchSource,\n} from 'vue';\n\ntype MaybeUndefined<T, I> = I extends true ? T | undefined : T;\nexport interface WatchCachedOptions<Immediate = boolean> {\n immediate?: Immediate;\n deep
|
|
1
|
+
{"version":3,"file":"watchCached.js","sources":["../../../../../../../../lib/ui/uikit/src/composition/watchCached.ts"],"sourcesContent":["import { deepClone, isJsonEqual } from '@milaboratories/helpers';\nimport {\n ref,\n watch,\n type WatchCallback,\n type WatchHandle,\n type WatchSource,\n} from 'vue';\n\ntype MaybeUndefined<T, I> = I extends true ? T | undefined : T;\nexport interface WatchCachedOptions<Immediate = boolean> {\n immediate?: Immediate;\n // deep: true; - caching is useless when you are using the source as a `shallowRef`\n // once: false; - caching is useless when you need a single shot, use plain watch instead\n}\n/** Alternative to `watch`, but triggering only on actual data changes */\nexport function watchCached<T, Immediate extends Readonly<boolean> = false>(\n source: WatchSource<T>,\n cb: WatchCallback<T, MaybeUndefined<T, Immediate>>,\n options?: WatchCachedOptions<Immediate>,\n): WatchHandle {\n const cachedValue = ref<T>();\n const handle = watch(\n source,\n (newValue) => {\n if (!isJsonEqual(newValue, cachedValue.value)) {\n // `deepClone` is needed because in case some fields are patched the deep would be triggered,\n // but objects would be equal as the saved value was also patched\n cachedValue.value = deepClone(newValue);\n }\n },\n {\n deep: true,\n immediate: true, // always initialize cachedValue\n },\n );\n watch<T, Immediate>(\n () => cachedValue.value as T, // `as T` is safe as we always initialize cachedValue\n cb, // separate watch so that `onWatcherCleanup` would only be triggerred here\n {\n // standard vue `WatchOptions` conform to `WatchCachedOptions` interface,\n // so construct new options to remove unsupported entries\n deep: true,\n immediate: options?.immediate,\n },\n );\n return handle; // stopping first handle would effectively stop the second one\n}\n"],"names":["watchCached","source","cb","options","cachedValue","ref","handle","watch","newValue","isJsonEqual","deepClone"],"mappings":";;AAgBgB,SAAAA,EACdC,GACAC,GACAC,GACa;AACPC,QAAAA,IAAcC,KACdC,IAASC;AAAAA,IACbN;AAAAA,IACA,CAACO,MAAa;AACPC,MAAAA,EAAYD,GAAUJ,EAAY,KAAK,MAG9BA,EAAA,QAAQM,EAAUF,CAAQ;AAAA,IAE1C;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,IAAA;AAAA,EAEf;AACAD,SAAAA;AAAAA,IACE,MAAMH,EAAY;AAAA;AAAA,IAClBF;AAAAA;AAAAA,IACA;AAAA;AAAA;AAAA,MAGE,MAAM;AAAA,MACN,WAAWC,KAAA,OAAA,SAAAA,EAAS;AAAA,IAAA;AAAA,EAAA,GAGjBG;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgRequired.vue2.js","sources":["../../../../../../../../../../../lib/ui/uikit/src/generated/components/svg/images/SvgRequired.vue"],"sourcesContent":["<!-- ⚠️ AUTOGENERATED. DO NOT EDIT. -->\n<script lang=\"ts\">\nimport '../svg-styles.css';\nexport default { name: 'SvgRequired' };\n</script>\n\n<template>\n <div class=\"svg-icon SvgRequired\" style=\"width: 5px; height: 12px\" />\n</template>\n\n<style>\n .SvgRequired { background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%225%22%20height%3D%2212%22%20viewBox%3D%220%200%205%2012%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M1.51685%204.8L2.5%203.34159L3.47612%204.8L4.39607%204.12743L3.31461%202.7469L5%202.25133L4.64888%201.16106L3.00562%201.77699L3.06882%200H1.93118L1.99438%201.77699L0.351124%201.16106L0%202.25133L1.68539%202.7469L0.59691%204.12743L1.51685%204.8Z%22%20fill%3D%22%23F1222F%22%2F%3E%3C%2Fsvg%3E\"); }\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;AAOoC,MAAA,IAAA;AAAA,EAAA,OAAA;AAAA;;;;;;"}
|