@platforma-sdk/ui-vue 1.63.12 → 1.65.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.
- package/.turbo/turbo-build.log +38 -32
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +24 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.js.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.style.js.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts +3 -8
- package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +164 -151
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.js.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.style.js +8 -7
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.style.js.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.css +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts +24 -8
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +176 -110
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/types.d.ts +2 -0
- package/dist/components/PlAdvancedFilter/types.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +116 -109
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js +3 -3
- package/dist/components/PlAgDataTable/compositions/useFilterableColumns.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts +6 -5
- package/dist/components/PlAgDataTable/sources/table-source-v2.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-source-v2.js +122 -88
- package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts +6 -3
- package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.js +182 -97
- package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js +37 -42
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/useFilteredItems.d.ts +5 -5
- package/dist/components/PlAgGridColumnManager/useFilteredItems.d.ts.map +1 -1
- package/dist/components/PlAgGridColumnManager/useFilteredItems.js +2 -2
- package/dist/components/PlAgGridColumnManager/useFilteredItems.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/useGridColumns.js +14 -0
- package/dist/components/PlAgGridColumnManager/useGridColumns.js.map +1 -0
- package/dist/components/PlAnnotations/components/FilterSidebar.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.style.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +7 -4
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.style.js +5 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.style.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue.css +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts +7 -9
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js +72 -47
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/util/helpers/dist/functions.js.map +1 -1
- package/dist/lib/util/helpers/dist/objects.js +4 -1
- package/dist/lib/util/helpers/dist/objects.js.map +1 -1
- package/package.json +8 -7
- package/src/components/PlAdvancedFilter/FilterEditor.vue +99 -55
- package/src/components/PlAdvancedFilter/PlAdvancedFilter.vue +163 -95
- package/src/components/PlAdvancedFilter/types.ts +6 -1
- package/src/components/PlAgDataTable/PlAgDataTableV2.vue +26 -7
- package/src/components/PlAgDataTable/compositions/useFilterableColumns.ts +4 -4
- package/src/components/PlAgDataTable/sources/table-source-v2.ts +231 -131
- package/src/components/PlAgDataTable/sources/table-state-v2.ts +249 -70
- package/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue +17 -35
- package/src/components/PlAgGridColumnManager/useFilteredItems.ts +9 -11
- package/src/components/PlAgGridColumnManager/useGridColumns.ts +26 -0
- package/src/components/PlAnnotations/components/FilterSidebar.vue +3 -2
- package/src/components/PlTableFilters/PlTableFiltersV2.vue +76 -26
- package/src/index.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"../../AgGridVue/AgGridTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"../../AgGridVue/AgGridTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst defaultFilters = computed(() =>\n settings.value.sourceId !== null ? settings.value.model?.defaultFilters : undefined,\n);\nconst {\n gridState,\n sheetsState,\n searchString,\n filtersState,\n defaultFiltersState,\n resetDefaultFilters,\n} = useTableState(tableState, settings, visibleFilterableColumns, defaultFilters);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec !== undefined && spec.type === \"column\" && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n if (\n settings.model?.fullTableHandle === undefined ||\n settings.model?.visibleTableHandle === undefined\n ) {\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n fullTableHandle: settings.model?.fullTableHandle,\n visibleTableHandle: settings.model?.visibleTableHandle,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n :filters=\"filtersState\"\n :default-filters=\"defaultFiltersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n @updateFilters=\"(v) => (filtersState = v)\"\n @resetDefaultFilters=\"resetDefaultFilters\"\n @updateDefaultFilters=\"(v) => (defaultFiltersState = v)\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgDataTableV2.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgDataTableV2.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"names":[],"mappings":"AA+kBA,OAAO,KAAK,EACV,MAAM,EAEN,kBAAkB,EAClB,gBAAgB,EAGhB,SAAS,EACV,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,wBAAwB,EAAsB,MAAM,oBAAoB,CAAC;AAcvF,OAAO,KAAK,EAEV,kBAAkB,EAGlB,qBAAqB,EAGtB,MAAM,SAAS,CAAC;AAUjB,KAAK,WAAW,GAAG;IACjB,kCAAkC;IAClC,QAAQ,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;;;OAMG;IACH,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAE5C,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;CACrE,CAAC;AAsbF,KAAK,iBAAiB,GAAG;IACzB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAC9B,GAAG,WAAW,CAAC;AAMhB,iBAAS,cAAc;WAwIT,OAAO,IAA6B;;iCAXZ,GAAG;gCACJ,GAAG;;;;EAevC;AA2BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;6FASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -10,19 +10,19 @@ import o from "../PlTableFastSearch/PlTableFastSearch.js";
|
|
|
10
10
|
import "../PlTableFastSearch/index.js";
|
|
11
11
|
import s from "./PlAgDataTableSheets.js";
|
|
12
12
|
import c from "./PlAgRowCount.js";
|
|
13
|
-
import { DeferredCircular as
|
|
14
|
-
import { calculateGridOptions as
|
|
13
|
+
import { DeferredCircular as l, ensureNodeVisible as ee } from "./sources/focus-row.js";
|
|
14
|
+
import { calculateGridOptions as te } from "./sources/table-source-v2.js";
|
|
15
15
|
import { useTableState as u } from "./sources/table-state-v2.js";
|
|
16
16
|
import { useFilterableColumns as ne } from "./compositions/useFilterableColumns.js";
|
|
17
17
|
import { useGrid as re } from "./compositions/useGrid.js";
|
|
18
18
|
import { AgGridTheme as ie } from "../../AgGridVue/AgGridTheme.js";
|
|
19
|
-
import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as ae, createSlots as
|
|
20
|
-
import { canonicalizeJson as
|
|
21
|
-
import { AgGridVue as
|
|
19
|
+
import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as ae, createSlots as oe, createVNode as m, defineComponent as h, effectScope as g, isRef as _, mergeModels as v, nextTick as se, normalizeClass as y, openBlock as b, ref as x, renderSlot as S, toRefs as ce, unref as C, useModel as w, watch as T, watchEffect as le, withCtx as E } from "vue";
|
|
20
|
+
import { canonicalizeJson as D, createPlSelectionModel as O, getAxisId as k, getRawPlatformaInstance as A, isAbortError as j, isColumnOptional as ue, matchAxisId as M } from "@platforma-sdk/model";
|
|
21
|
+
import { AgGridVue as de } from "ag-grid-vue3";
|
|
22
22
|
//#region src/components/PlAgDataTable/PlAgDataTableV2.vue?vue&type=script&setup=true&lang.ts
|
|
23
|
-
var
|
|
23
|
+
var N = /* @__PURE__ */ h({
|
|
24
24
|
__name: "PlAgDataTableV2",
|
|
25
|
-
props: /* @__PURE__ */
|
|
25
|
+
props: /* @__PURE__ */ v({
|
|
26
26
|
settings: {},
|
|
27
27
|
disableColumnsPanel: { type: Boolean },
|
|
28
28
|
disableFiltersPanel: { type: Boolean },
|
|
@@ -40,39 +40,39 @@ var P = /* @__PURE__ */ g({
|
|
|
40
40
|
selection: {},
|
|
41
41
|
selectionModifiers: {}
|
|
42
42
|
}),
|
|
43
|
-
emits: /* @__PURE__ */
|
|
43
|
+
emits: /* @__PURE__ */ v([
|
|
44
44
|
"rowDoubleClicked",
|
|
45
45
|
"cellButtonClicked",
|
|
46
46
|
"newDataRendered"
|
|
47
47
|
], ["update:modelValue", "update:selection"]),
|
|
48
|
-
setup(
|
|
49
|
-
let
|
|
50
|
-
selection:
|
|
51
|
-
noRowsText:
|
|
52
|
-
runningText:
|
|
53
|
-
loadingText:
|
|
54
|
-
notReadyText:
|
|
55
|
-
cellRendererSelector:
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
e.data && e.data.axesKey &&
|
|
61
|
-
},
|
|
62
|
-
let n = J(q(t.state),
|
|
63
|
-
|
|
48
|
+
setup(h, { expose: v, emit: N }) {
|
|
49
|
+
let fe = w(h, "modelValue"), P = w(h, "selection"), F = h, { settings: I } = ce(F), L = N, R = new l(), { gridApi: z, gridOptions: B } = re({
|
|
50
|
+
selection: P,
|
|
51
|
+
noRowsText: F.noRowsText,
|
|
52
|
+
runningText: F.runningText,
|
|
53
|
+
loadingText: F.loadingText,
|
|
54
|
+
notReadyText: F.notReadyText,
|
|
55
|
+
cellRendererSelector: F.cellRendererSelector
|
|
56
|
+
}), V = !1;
|
|
57
|
+
B.value.onGridPreDestroyed = (e) => {
|
|
58
|
+
V || (B.value.initialState = H.value = J(q(e.api.getState()), H.value, e.api)), z.value = null;
|
|
59
|
+
}, B.value.onRowDoubleClicked = (e) => {
|
|
60
|
+
e.data && e.data.axesKey && L("rowDoubleClicked", e.data.axesKey);
|
|
61
|
+
}, B.value.onStateUpdated = (t) => {
|
|
62
|
+
let n = J(q(t.state), H.value, t.api);
|
|
63
|
+
B.value.initialState = H.value = n, e(t.sources, ["columnSizing"]) || t.api.autoSizeColumns(t.api.getAllDisplayedColumns().filter((e) => e.getColId() !== r));
|
|
64
64
|
};
|
|
65
|
-
let [
|
|
66
|
-
let e = { ...
|
|
65
|
+
let [pe, me] = ne(() => I.value.sourceId, () => B.value.columnDefs ?? null), { gridState: H, sheetsState: U, searchString: W, filtersState: G, defaultFiltersState: K, resetDefaultFilters: he } = u(fe, I, me, d(() => I.value.sourceId === null ? void 0 : I.value.model?.defaultFilters)), ge = d(() => {
|
|
66
|
+
let e = { ...I.value };
|
|
67
67
|
return e.sourceId === null ? {
|
|
68
68
|
sheets: [],
|
|
69
69
|
cachedState: []
|
|
70
70
|
} : {
|
|
71
71
|
sheets: e.sheets ?? [],
|
|
72
|
-
cachedState: [...
|
|
72
|
+
cachedState: [...U.value]
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
B.value.initialState = H.value;
|
|
76
76
|
function q(e) {
|
|
77
77
|
return {
|
|
78
78
|
columnOrder: e.columnOrder,
|
|
@@ -86,17 +86,17 @@ var P = /* @__PURE__ */ g({
|
|
|
86
86
|
...e,
|
|
87
87
|
columnVisibility: { hiddenColIds: [] }
|
|
88
88
|
};
|
|
89
|
-
let r =
|
|
89
|
+
let r = _e(n);
|
|
90
90
|
return r.length > 0 ? {
|
|
91
91
|
...e,
|
|
92
92
|
columnVisibility: { hiddenColIds: r }
|
|
93
93
|
} : e;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function _e(e) {
|
|
96
96
|
let t = e.getAllGridColumns();
|
|
97
97
|
return t ? t.filter((e) => {
|
|
98
98
|
let t = e.getColDef().context;
|
|
99
|
-
return t &&
|
|
99
|
+
return t !== void 0 && t.type === "column" && ue(t.spec);
|
|
100
100
|
}).map((e) => e.getColId()) : [];
|
|
101
101
|
}
|
|
102
102
|
function Y(e) {
|
|
@@ -106,43 +106,43 @@ var P = /* @__PURE__ */ g({
|
|
|
106
106
|
columnVisibility: n
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
let X =
|
|
110
|
-
|
|
109
|
+
let X = x(0);
|
|
110
|
+
T(() => [z.value, H.value], ([t, n]) => {
|
|
111
111
|
if (!t || t.isDestroyed()) return;
|
|
112
112
|
let r = q(t.getState());
|
|
113
|
-
!e(n, {}) && !e(Y(n), Y(r)) && (
|
|
114
|
-
|
|
113
|
+
!e(n, {}) && !e(Y(n), Y(r)) && (V = !0, B.value.initialState = n, ++X.value, se(() => {
|
|
114
|
+
V = !1;
|
|
115
115
|
}));
|
|
116
116
|
});
|
|
117
|
-
let
|
|
118
|
-
|
|
117
|
+
let ve = d(() => F.cellRendererSelector ?? null);
|
|
118
|
+
T(() => [z.value, ve.value], ([e, t]) => {
|
|
119
119
|
!e || e.isDestroyed() || e.setGridOption("defaultColDef", {
|
|
120
|
-
...
|
|
120
|
+
...B.value.defaultColDef,
|
|
121
121
|
cellRendererSelector: t ?? void 0
|
|
122
122
|
});
|
|
123
|
-
}),
|
|
123
|
+
}), v({
|
|
124
124
|
focusRow: async (t) => {
|
|
125
|
-
let n = await
|
|
126
|
-
return n.isDestroyed() ? !1 :
|
|
125
|
+
let n = await R.promise;
|
|
126
|
+
return n.isDestroyed() ? !1 : ee(n, (n) => e(n.data?.axesKey, t));
|
|
127
127
|
},
|
|
128
128
|
updateSelection: async ({ axesSpec: n, selectedKeys: r }) => {
|
|
129
|
-
let i = await
|
|
129
|
+
let i = await R.promise;
|
|
130
130
|
if (i.isDestroyed()) return !1;
|
|
131
|
-
let a =
|
|
131
|
+
let a = P.value?.axesSpec;
|
|
132
132
|
if (!a || a.length !== n.length) return !1;
|
|
133
133
|
let o = n.map((e) => {
|
|
134
|
-
let t =
|
|
135
|
-
return a.findIndex((e) =>
|
|
134
|
+
let t = k(e);
|
|
135
|
+
return a.findIndex((e) => M(e, t));
|
|
136
136
|
}), s = new Set(o);
|
|
137
137
|
if (s.has(-1) || s.size !== n.length) return !1;
|
|
138
|
-
let c = r.map((e) =>
|
|
138
|
+
let c = r.map((e) => D(o.map((t) => e[t])));
|
|
139
139
|
if (!e(i.getServerSideSelectionState()?.toggledNodes ?? [], c)) {
|
|
140
140
|
i.setServerSideSelectionState({
|
|
141
141
|
selectAll: !1,
|
|
142
142
|
toggledNodes: c
|
|
143
143
|
});
|
|
144
|
-
let e =
|
|
145
|
-
e.run(() =>
|
|
144
|
+
let e = g(), { resolve: n, promise: r } = Promise.withResolvers();
|
|
145
|
+
e.run(() => T(P, n, { once: !0 }));
|
|
146
146
|
try {
|
|
147
147
|
await t(r, 500);
|
|
148
148
|
} catch {
|
|
@@ -154,33 +154,34 @@ var P = /* @__PURE__ */ g({
|
|
|
154
154
|
return !0;
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
let Z =
|
|
158
|
-
return
|
|
157
|
+
let Z = O(), Q = null, $ = x(0);
|
|
158
|
+
return T(() => [z.value, I.value], ([t, n]) => {
|
|
159
159
|
if (!(!t || t.isDestroyed()) && !e(n, Q)) {
|
|
160
160
|
++$.value;
|
|
161
161
|
try {
|
|
162
|
-
if (t.hideOverlay(),
|
|
162
|
+
if (t.hideOverlay(), R.reset(), n.sourceId === null) {
|
|
163
163
|
t.updateGridOptions({
|
|
164
164
|
loading: !0,
|
|
165
165
|
loadingOverlayComponentParams: {
|
|
166
|
-
...
|
|
166
|
+
...B.value.loadingOverlayComponentParams,
|
|
167
167
|
variant: n.pending ? "running" : "not-ready"
|
|
168
168
|
},
|
|
169
169
|
columnDefs: void 0,
|
|
170
170
|
serverSideDatasource: void 0
|
|
171
|
-
}),
|
|
171
|
+
}), P.value && (P.value && !e(P.value, Z) && (P.value = O()), t.setServerSideSelectionState({
|
|
172
172
|
selectAll: !1,
|
|
173
173
|
toggledNodes: []
|
|
174
174
|
}));
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
+
if (n.model?.fullTableHandle === void 0 || n.model?.visibleTableHandle === void 0) return;
|
|
177
178
|
n.sourceId !== Q?.sourceId && (t.updateGridOptions({
|
|
178
179
|
loading: !0,
|
|
179
180
|
loadingOverlayComponentParams: {
|
|
180
|
-
...
|
|
181
|
+
...B.value.loadingOverlayComponentParams,
|
|
181
182
|
variant: "loading"
|
|
182
183
|
}
|
|
183
|
-
}),
|
|
184
|
+
}), P.value && Q?.sourceId && (P.value && !e(P.value, Z) && (P.value = O()), t.setServerSideSelectionState({
|
|
184
185
|
selectAll: !1,
|
|
185
186
|
toggledNodes: []
|
|
186
187
|
})));
|
|
@@ -195,41 +196,42 @@ var P = /* @__PURE__ */ g({
|
|
|
195
196
|
} } });
|
|
196
197
|
}
|
|
197
198
|
let i = $.value;
|
|
198
|
-
|
|
199
|
+
te({
|
|
199
200
|
generation: $,
|
|
200
|
-
pfDriver:
|
|
201
|
-
|
|
201
|
+
pfDriver: A().pFrameDriver,
|
|
202
|
+
fullTableHandle: n.model?.fullTableHandle,
|
|
203
|
+
visibleTableHandle: n.model?.visibleTableHandle,
|
|
202
204
|
sheets: n.sheets ?? [],
|
|
203
|
-
dataRenderedTracker:
|
|
204
|
-
hiddenColIds:
|
|
205
|
+
dataRenderedTracker: R,
|
|
206
|
+
hiddenColIds: H.value.columnVisibility?.hiddenColIds,
|
|
205
207
|
cellButtonAxisParams: {
|
|
206
|
-
showCellButtonForAxisId:
|
|
207
|
-
cellButtonInvokeRowsOnDoubleClick:
|
|
208
|
-
trigger: (e) =>
|
|
208
|
+
showCellButtonForAxisId: F.showCellButtonForAxisId,
|
|
209
|
+
cellButtonInvokeRowsOnDoubleClick: F.cellButtonInvokeRowsOnDoubleClick,
|
|
210
|
+
trigger: (e) => L("cellButtonClicked", e)
|
|
209
211
|
}
|
|
210
212
|
}).then((n) => {
|
|
211
213
|
if (t.isDestroyed() || i !== $.value) return;
|
|
212
214
|
let { axesSpec: r, ...a } = n;
|
|
213
|
-
if (t.updateGridOptions({ ...a }),
|
|
214
|
-
let { axesSpec: n, selectedKeys: i } =
|
|
215
|
+
if (t.updateGridOptions({ ...a }), P.value) {
|
|
216
|
+
let { axesSpec: n, selectedKeys: i } = P.value;
|
|
215
217
|
if (!e(n, r)) {
|
|
216
218
|
if (!n || r.length !== n.length) {
|
|
217
219
|
let n = {
|
|
218
220
|
axesSpec: r,
|
|
219
221
|
selectedKeys: []
|
|
220
222
|
};
|
|
221
|
-
return e(
|
|
223
|
+
return e(P.value, n) || (P.value = n), t.setServerSideSelectionState({
|
|
222
224
|
selectAll: !1,
|
|
223
225
|
toggledNodes: []
|
|
224
226
|
});
|
|
225
227
|
}
|
|
226
|
-
let a = n.map(
|
|
228
|
+
let a = n.map(k).map((e) => r.findIndex((t) => M(t, e))), o = new Set(a);
|
|
227
229
|
if (o.has(-1) || o.size !== r.length) {
|
|
228
230
|
let n = {
|
|
229
231
|
axesSpec: r,
|
|
230
232
|
selectedKeys: []
|
|
231
233
|
};
|
|
232
|
-
return e(
|
|
234
|
+
return e(P.value, n) || (P.value = n), t.setServerSideSelectionState({
|
|
233
235
|
selectAll: !1,
|
|
234
236
|
toggledNodes: []
|
|
235
237
|
});
|
|
@@ -238,89 +240,94 @@ var P = /* @__PURE__ */ g({
|
|
|
238
240
|
axesSpec: r,
|
|
239
241
|
selectedKeys: s
|
|
240
242
|
};
|
|
241
|
-
return e(
|
|
243
|
+
return e(P.value, c) || (P.value = c), t.setServerSideSelectionState({
|
|
242
244
|
selectAll: !1,
|
|
243
|
-
toggledNodes: s.map((e) =>
|
|
245
|
+
toggledNodes: s.map((e) => D(e))
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
}).catch((e) => {
|
|
248
|
-
t.isDestroyed() || i !== $.value ||
|
|
250
|
+
t.isDestroyed() || i !== $.value || j(e) || console.trace(e);
|
|
249
251
|
}).finally(() => {
|
|
250
252
|
t.isDestroyed() || i !== $.value || t.updateGridOptions({ loading: !1 });
|
|
251
|
-
}),
|
|
253
|
+
}), R.promise.then(() => L("newDataRendered"));
|
|
252
254
|
} catch (e) {
|
|
253
255
|
console.trace(e);
|
|
254
256
|
} finally {
|
|
255
257
|
Q = n;
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
|
-
}),
|
|
259
|
-
gridApi:
|
|
260
|
-
loadingText:
|
|
261
|
-
runningText:
|
|
262
|
-
notReadyText:
|
|
263
|
-
noRowsText:
|
|
260
|
+
}), T(() => ({
|
|
261
|
+
gridApi: z.value,
|
|
262
|
+
loadingText: F.loadingText,
|
|
263
|
+
runningText: F.runningText,
|
|
264
|
+
notReadyText: F.notReadyText,
|
|
265
|
+
noRowsText: F.noRowsText
|
|
264
266
|
}), ({ gridApi: e, loadingText: t, runningText: n, notReadyText: r, noRowsText: i }) => {
|
|
265
267
|
!e || e.isDestroyed() || e.updateGridOptions({
|
|
266
268
|
loadingOverlayComponentParams: {
|
|
267
|
-
...
|
|
269
|
+
...B.value.loadingOverlayComponentParams,
|
|
268
270
|
loadingText: t,
|
|
269
271
|
runningText: n,
|
|
270
272
|
notReadyText: r
|
|
271
273
|
},
|
|
272
274
|
noRowsOverlayComponentParams: {
|
|
273
|
-
...
|
|
275
|
+
...B.value.noRowsOverlayComponentParams,
|
|
274
276
|
text: i
|
|
275
277
|
}
|
|
276
278
|
});
|
|
277
|
-
}),
|
|
278
|
-
!
|
|
279
|
+
}), le(() => {
|
|
280
|
+
!z.value || z.value?.isDestroyed() || z.value.updateGridOptions({ statusBar: B.value.loading ? void 0 : { statusPanels: [{
|
|
279
281
|
statusPanel: c,
|
|
280
282
|
align: "left"
|
|
281
283
|
}] } });
|
|
282
|
-
}), (e, t) => (
|
|
283
|
-
|
|
284
|
+
}), (e, t) => (b(), ae("div", { class: y(e.$style.container) }, [
|
|
285
|
+
C(z) && !h.disableColumnsPanel ? (b(), f(C(i), {
|
|
284
286
|
key: 0,
|
|
285
|
-
api:
|
|
287
|
+
api: C(z)
|
|
286
288
|
}, null, 8, ["api"])) : p("", !0),
|
|
287
|
-
|
|
289
|
+
h.disableFiltersPanel ? p("", !0) : (b(), f(a, {
|
|
288
290
|
key: 1,
|
|
289
|
-
|
|
290
|
-
"
|
|
291
|
-
"pframe-handle": "model" in
|
|
292
|
-
columns:
|
|
291
|
+
filters: C(G),
|
|
292
|
+
"default-filters": C(K),
|
|
293
|
+
"pframe-handle": "model" in C(I) ? C(I)?.model?.fullPframeHandle : void 0,
|
|
294
|
+
columns: C(pe),
|
|
295
|
+
onUpdateFilters: t[0] ||= (e) => G.value = e,
|
|
296
|
+
onResetDefaultFilters: C(he),
|
|
297
|
+
onUpdateDefaultFilters: t[1] ||= (e) => K.value = e
|
|
293
298
|
}, null, 8, [
|
|
294
|
-
"
|
|
299
|
+
"filters",
|
|
300
|
+
"default-filters",
|
|
295
301
|
"pframe-handle",
|
|
296
|
-
"columns"
|
|
302
|
+
"columns",
|
|
303
|
+
"onResetDefaultFilters"
|
|
297
304
|
])),
|
|
298
|
-
|
|
305
|
+
C(z) && h.showExportButton ? (b(), f(n, {
|
|
299
306
|
key: 2,
|
|
300
|
-
api:
|
|
307
|
+
api: C(z)
|
|
301
308
|
}, null, 8, ["api"])) : p("", !0),
|
|
302
|
-
|
|
303
|
-
modelValue:
|
|
304
|
-
"onUpdate:modelValue": t[
|
|
305
|
-
settings:
|
|
306
|
-
},
|
|
309
|
+
m(s, {
|
|
310
|
+
modelValue: C(U),
|
|
311
|
+
"onUpdate:modelValue": t[2] ||= (e) => _(U) ? U.value = e : null,
|
|
312
|
+
settings: ge.value
|
|
313
|
+
}, oe({ _: 2 }, [e.$slots["before-sheets"] ? {
|
|
307
314
|
name: "before",
|
|
308
|
-
fn:
|
|
315
|
+
fn: E(() => [S(e.$slots, "before-sheets")]),
|
|
309
316
|
key: "0"
|
|
310
317
|
} : void 0, e.$slots["after-sheets"] ? {
|
|
311
318
|
name: "after",
|
|
312
|
-
fn:
|
|
319
|
+
fn: E(() => [S(e.$slots, "after-sheets")]),
|
|
313
320
|
key: "1"
|
|
314
321
|
} : void 0]), 1032, ["modelValue", "settings"]),
|
|
315
|
-
|
|
316
|
-
modelValue:
|
|
317
|
-
"onUpdate:modelValue": t[
|
|
322
|
+
m(C(o), {
|
|
323
|
+
modelValue: C(W),
|
|
324
|
+
"onUpdate:modelValue": t[3] ||= (e) => _(W) ? W.value = e : null
|
|
318
325
|
}, null, 8, ["modelValue"]),
|
|
319
|
-
(
|
|
326
|
+
(b(), f(C(de), {
|
|
320
327
|
key: X.value,
|
|
321
|
-
theme:
|
|
322
|
-
class:
|
|
323
|
-
"grid-options":
|
|
328
|
+
theme: C(ie),
|
|
329
|
+
class: y(e.$style.grid),
|
|
330
|
+
"grid-options": C(B)
|
|
324
331
|
}, null, 8, [
|
|
325
332
|
"theme",
|
|
326
333
|
"class",
|
|
@@ -330,6 +337,6 @@ var P = /* @__PURE__ */ g({
|
|
|
330
337
|
}
|
|
331
338
|
});
|
|
332
339
|
//#endregion
|
|
333
|
-
export {
|
|
340
|
+
export { N as default };
|
|
334
341
|
|
|
335
342
|
//# sourceMappingURL=PlAgDataTableV2.vue2.js.map
|