persian-data-grid 0.6.0 → 0.7.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/README.md +1 -1
- package/dist/{ERPTableGroupRow-PSAPAHGL.js → ERPTableGroupRow-E5Q6FYDS.js} +4 -4
- package/dist/{ERPTableGroupRow-PSAPAHGL.js.map → ERPTableGroupRow-E5Q6FYDS.js.map} +1 -1
- package/dist/{ERPTableGroupRow-J5Z2LRC5.cjs → ERPTableGroupRow-F2IPDYL5.cjs} +9 -9
- package/dist/{ERPTableGroupRow-J5Z2LRC5.cjs.map → ERPTableGroupRow-F2IPDYL5.cjs.map} +1 -1
- package/dist/{GridPlugin-CJCaYnlw.d.ts → GridPlugin-Bewn0X51.d.ts} +1 -1
- package/dist/{GridPlugin-oxhq8AsM.d.cts → GridPlugin-DewWufGZ.d.cts} +1 -1
- package/dist/{GridSession-Bc7UIawO.d.ts → GridSession-CeIfVFck.d.ts} +142 -9
- package/dist/{GridSession-B-9lLcoB.d.cts → GridSession-CmQn2RnL.d.cts} +142 -9
- package/dist/GridSyncService-3JQLEY65.cjs +12 -0
- package/dist/{GridSyncService-TAPAHABV.cjs.map → GridSyncService-3JQLEY65.cjs.map} +1 -1
- package/dist/GridSyncService-GECXGEKL.js +3 -0
- package/dist/{GridSyncService-KTLB4KP3.js.map → GridSyncService-GECXGEKL.js.map} +1 -1
- package/dist/{PdfRenderer-CBg7hWNS.d.cts → PdfRenderer-B9FJaCo_.d.cts} +1 -1
- package/dist/{PdfRenderer-1HFh6UeR.d.ts → PdfRenderer-bN7ca_Aj.d.ts} +1 -1
- package/dist/{UITableController-DU8RopUM.d.ts → UITableController-C71LXBiX.d.ts} +48 -2
- package/dist/{UITableController-Cuwq481K.d.cts → UITableController-CIwnHIw8.d.cts} +48 -2
- package/dist/{VazirmatnPdfRenderer-BCMpC1zy.d.cts → VazirmatnPdfRenderer-CpCqA-Wh.d.cts} +2 -2
- package/dist/{VazirmatnPdfRenderer-Dz_G-m3c.d.ts → VazirmatnPdfRenderer-D46smncn.d.ts} +2 -2
- package/dist/adapters/arian-erp.cjs +16 -4
- package/dist/adapters/arian-erp.cjs.map +1 -1
- package/dist/adapters/arian-erp.d.cts +3 -1
- package/dist/adapters/arian-erp.d.ts +3 -1
- package/dist/adapters/arian-erp.js +11 -3
- package/dist/adapters/arian-erp.js.map +1 -1
- package/dist/{applyImportedRows-BO6yxoAN.d.cts → applyImportedRows-C2fWYoPy.d.cts} +3 -3
- package/dist/{applyImportedRows-D4zVY8uD.d.ts → applyImportedRows-Cqh_N_0k.d.ts} +3 -3
- package/dist/{applyRowVisibilityHandler-LXCOGESZ.cjs → applyRowVisibilityHandler-Q64ZFC7A.cjs} +7 -6
- package/dist/applyRowVisibilityHandler-Q64ZFC7A.cjs.map +1 -0
- package/dist/{applyRowVisibilityHandler-KS6TMCBN.js → applyRowVisibilityHandler-ZLZXQEGY.js} +6 -5
- package/dist/applyRowVisibilityHandler-ZLZXQEGY.js.map +1 -0
- package/dist/callbackRemoteApi-BYLjmSI6.d.ts +51 -0
- package/dist/callbackRemoteApi-Cv26MmSD.d.cts +51 -0
- package/dist/{cellRenderContext-DB7V_mlu.d.ts → cellRenderContext-BaNh4qn_.d.ts} +2 -2
- package/dist/{cellRenderContext-DG5BOlxK.d.cts → cellRenderContext-DvngkptV.d.cts} +2 -2
- package/dist/{chunk-HTNJT2QU.js → chunk-27ALJSZP.js} +617 -104
- package/dist/chunk-27ALJSZP.js.map +1 -0
- package/dist/{chunk-KUBVDIF7.cjs → chunk-3HP3HQCW.cjs} +52 -17
- package/dist/chunk-3HP3HQCW.cjs.map +1 -0
- package/dist/{chunk-DXRCYW42.cjs → chunk-52LFOPXD.cjs} +43 -23
- package/dist/chunk-52LFOPXD.cjs.map +1 -0
- package/dist/{chunk-VVGYRZ7S.cjs → chunk-72IVAOTK.cjs} +4 -4
- package/dist/{chunk-VVGYRZ7S.cjs.map → chunk-72IVAOTK.cjs.map} +1 -1
- package/dist/{chunk-LJ7LMEXO.js → chunk-7GWV5HGO.js} +3 -3
- package/dist/{chunk-LJ7LMEXO.js.map → chunk-7GWV5HGO.js.map} +1 -1
- package/dist/{chunk-RM6ZWNT3.js → chunk-7T6AWRPU.js} +43 -23
- package/dist/chunk-7T6AWRPU.js.map +1 -0
- package/dist/{chunk-PXCHPZTP.cjs → chunk-CMQ4VLCW.cjs} +8 -7
- package/dist/{chunk-EHHHC5JV.js.map → chunk-CMQ4VLCW.cjs.map} +1 -1
- package/dist/chunk-E2J533UH.cjs +53 -0
- package/dist/chunk-E2J533UH.cjs.map +1 -0
- package/dist/chunk-F6EMC75A.cjs +34 -0
- package/dist/chunk-F6EMC75A.cjs.map +1 -0
- package/dist/chunk-GKE33FOJ.js +32 -0
- package/dist/chunk-GKE33FOJ.js.map +1 -0
- package/dist/{chunk-QQMU44KJ.js → chunk-HLOHWFOA.js} +52 -19
- package/dist/chunk-HLOHWFOA.js.map +1 -0
- package/dist/{chunk-633KP74Z.js → chunk-KCNTKYUY.js} +19 -2
- package/dist/chunk-KCNTKYUY.js.map +1 -0
- package/dist/{chunk-BLYVOV3G.cjs → chunk-LY27YAXE.cjs} +19 -2
- package/dist/chunk-LY27YAXE.cjs.map +1 -0
- package/dist/{chunk-EHHHC5JV.js → chunk-NB5GCGHL.js} +5 -4
- package/dist/chunk-NB5GCGHL.js.map +1 -0
- package/dist/{chunk-6XBXZPBW.js → chunk-NQUVAJQA.js} +3 -3
- package/dist/{chunk-6XBXZPBW.js.map → chunk-NQUVAJQA.js.map} +1 -1
- package/dist/chunk-SVO62ZV2.js +50 -0
- package/dist/chunk-SVO62ZV2.js.map +1 -0
- package/dist/{chunk-MU3RY46O.js → chunk-VBAZ77Q4.js} +3 -3
- package/dist/{chunk-MU3RY46O.js.map → chunk-VBAZ77Q4.js.map} +1 -1
- package/dist/{chunk-H2LESGMX.cjs → chunk-VSAFQTW5.cjs} +4 -4
- package/dist/{chunk-H2LESGMX.cjs.map → chunk-VSAFQTW5.cjs.map} +1 -1
- package/dist/{chunk-2BJCRYOS.cjs → chunk-VYJQ2HTA.cjs} +5 -5
- package/dist/{chunk-2BJCRYOS.cjs.map → chunk-VYJQ2HTA.cjs.map} +1 -1
- package/dist/{chunk-IIISFUW4.cjs → chunk-WTHTVKVI.cjs} +621 -108
- package/dist/chunk-WTHTVKVI.cjs.map +1 -0
- package/dist/{createEngineGridQuery-Mt1hc33m.d.ts → createEngineGridQuery-BBkud5oE.d.ts} +61 -6
- package/dist/{createEngineGridQuery-Dmq3i5v3.d.cts → createEngineGridQuery-D-fgO_jg.d.cts} +61 -6
- package/dist/date-picker-jalali.cjs +17 -17
- package/dist/date-picker-jalali.d.cts +3 -3
- package/dist/date-picker-jalali.d.ts +3 -3
- package/dist/date-picker-jalali.js +1 -1
- package/dist/headless.cjs +102 -102
- package/dist/headless.d.cts +13 -9
- package/dist/headless.d.ts +13 -9
- package/dist/headless.js +4 -4
- package/dist/index.cjs +440 -382
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -14
- package/dist/index.d.ts +34 -14
- package/dist/index.js +200 -143
- package/dist/index.js.map +1 -1
- package/dist/plugins/csv.cjs +3 -3
- package/dist/plugins/csv.d.cts +2 -2
- package/dist/plugins/csv.d.ts +2 -2
- package/dist/plugins/csv.js +2 -2
- package/dist/plugins/excel.cjs +11 -11
- package/dist/plugins/excel.d.cts +4 -4
- package/dist/plugins/excel.d.ts +4 -4
- package/dist/plugins/excel.js +3 -3
- package/dist/plugins/pdf/fonts/vazirmatn.cjs +6 -6
- package/dist/plugins/pdf/fonts/vazirmatn.d.cts +4 -4
- package/dist/plugins/pdf/fonts/vazirmatn.d.ts +4 -4
- package/dist/plugins/pdf/fonts/vazirmatn.js +3 -3
- package/dist/plugins/pdf.cjs +5 -5
- package/dist/plugins/pdf.d.cts +5 -5
- package/dist/plugins/pdf.d.ts +5 -5
- package/dist/plugins/pdf.js +2 -2
- package/dist/presence.d.cts +3 -3
- package/dist/presence.d.ts +3 -3
- package/dist/sync.cjs +2 -2
- package/dist/sync.d.cts +3 -3
- package/dist/sync.d.ts +3 -3
- package/dist/sync.js +1 -1
- package/package.json +3 -3
- package/dist/GridSyncService-KTLB4KP3.js +0 -3
- package/dist/GridSyncService-TAPAHABV.cjs +0 -12
- package/dist/applyRowVisibilityHandler-KS6TMCBN.js.map +0 -1
- package/dist/applyRowVisibilityHandler-LXCOGESZ.cjs.map +0 -1
- package/dist/callbackRemoteApi-BlXO5NJz.d.ts +0 -30
- package/dist/callbackRemoteApi-DgnXH-i0.d.cts +0 -30
- package/dist/chunk-633KP74Z.js.map +0 -1
- package/dist/chunk-ASPTRYRD.cjs +0 -21
- package/dist/chunk-ASPTRYRD.cjs.map +0 -1
- package/dist/chunk-BHDRUZH5.cjs +0 -33
- package/dist/chunk-BHDRUZH5.cjs.map +0 -1
- package/dist/chunk-BLYVOV3G.cjs.map +0 -1
- package/dist/chunk-DXRCYW42.cjs.map +0 -1
- package/dist/chunk-HTNJT2QU.js.map +0 -1
- package/dist/chunk-IIISFUW4.cjs.map +0 -1
- package/dist/chunk-KUBVDIF7.cjs.map +0 -1
- package/dist/chunk-KYAOSBQN.js +0 -31
- package/dist/chunk-KYAOSBQN.js.map +0 -1
- package/dist/chunk-PXCHPZTP.cjs.map +0 -1
- package/dist/chunk-QQMU44KJ.js.map +0 -1
- package/dist/chunk-RM6ZWNT3.js.map +0 -1
- package/dist/chunk-Y6W5V2CI.js +0 -19
- package/dist/chunk-Y6W5V2CI.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useColumnWindowOrAll, ColumnWindowCells, columnPinCellProps, ariaColIndex, gridCellA11y, ariaDataRowIndex, indexPinDataAttr, indexPinClassName, gridCellDomId, ariaGridRowCount, ColumnWindowProvider, ARIA_HEADER_ROW_INDEX, ariaFooterRowIndex, ariaPinnedTopRowIndex, ariaPinnedBottomRowIndex, columnPinClassName } from './chunk-
|
|
2
|
-
import { resolveFillCorner, resolveCellRangePresentation, cellRangeEdgeAttr, cellRangeClassName, resolveCellAddressFromPoint, createGridTableKey, createGrid, flattenColDefOrGroup, DEFAULT_MEMORY_STORE, isPersistentStore, SparseRowIndex, maxColumnGroupDepth, buildColumnGroupHeaderModel, resolveFilterUi, isColumnFilterActive, canSetColumnVisible, trapTabKey, collectUniqueFilterValues, resolveGroupBlockReorder } from './chunk-
|
|
3
|
-
export { ColumnAggIndex, DEFAULT_EVENT_STORE_PREFIX, DEFAULT_GRID_ACTOR, DEFAULT_MEMORY_STORE, EVENT_CATALOG, InMemoryEventStore, InMemorySnapshotStore, IndexedDbEventStore, LEGACY_EVENT_STORE_PREFIX, MemoryKvDatabase, NoopRemoteApi, OfflineStatus, PluginHost, QuickFilterIndex, SnapshotStrategy, SparseRowIndex, TableEngine, accumulateAdd, accumulateRemove, alwaysOnlineConnectivity, applyAgg, applyFilter, applyHostRowDataToTable, applyQuickFilter, buildQuickFilterBlob, collectUniqueFilterValues, columnDefFieldName, createAccumulator, createBrowserConnectivity, createERPTable, createEngineGridQuery, createGrid, createGridApi, createGridTableKey, createLocalStorageWatermark, defaultGetRowId, ensureIndexColumnDef, eventStoreDbName, getEventCatalogEntry, isAggFuncName, isColumnFilterActive, isColumnGroupDef, isCustomAggFunc, isServerRowModel, listUndoableEventTypes, mapColDefOrGroups, mapColumnDefs, mapColumnSchemas, mapColumnSchemasToDefs, mapRowDataToRowInputs, normalizeFilterText, normalizeQuickFilterText, openIndexedDbDatabase, pageWindow, readAccumulator, resolveBuiltinFilterKind, resolveColumnAggSpecs, resolveCreateGridDefaults, toColumnDef, toColumnDefinition, toColumnSchema, toColumnViewBinding, toMinorUnits } from './chunk-
|
|
1
|
+
import { useColumnWindowOrAll, ColumnWindowCells, columnPinCellProps, ariaColIndex, gridCellA11y, ariaDataRowIndex, indexPinDataAttr, indexPinClassName, gridCellDomId, ariaGridRowCount, ColumnWindowProvider, ARIA_HEADER_ROW_INDEX, ariaFooterRowIndex, ariaPinnedTopRowIndex, ariaPinnedBottomRowIndex, columnPinClassName } from './chunk-NQUVAJQA.js';
|
|
2
|
+
import { resolveFillCorner, resolveCellRangePresentation, cellRangeEdgeAttr, cellRangeClassName, resolveCellAddressFromPoint, createGridTableKey, createGrid, flattenColDefOrGroup, DEFAULT_MEMORY_STORE, isPersistentStore, SparseRowIndex, maxColumnGroupDepth, buildColumnGroupHeaderModel, resolveFilterUi, isColumnFilterActive, canSetColumnVisible, trapTabKey, collectUniqueFilterValues, resolveGroupBlockReorder } from './chunk-27ALJSZP.js';
|
|
3
|
+
export { ColumnAggIndex, DEFAULT_EVENT_STORE_PREFIX, DEFAULT_GRID_ACTOR, DEFAULT_MEMORY_STORE, EVENT_CATALOG, InMemoryEventStore, InMemorySnapshotStore, IndexedDbEventStore, LEGACY_EVENT_STORE_PREFIX, MemoryKvDatabase, NoopRemoteApi, OfflineStatus, PluginHost, QuickFilterIndex, SnapshotStrategy, SparseRowIndex, TableEngine, accumulateAdd, accumulateRemove, alwaysOnlineConnectivity, applyAgg, applyFilter, applyHostRowDataToTable, applyQuickFilter, buildQuickFilterBlob, collectUniqueFilterValues, columnDefFieldName, createAccumulator, createBrowserConnectivity, createERPTable, createEngineGridQuery, createGrid, createGridApi, createGridTableKey, createLocalStorageWatermark, defaultGetRowId, ensureIndexColumnDef, eventStoreDbName, getEventCatalogEntry, isAggFuncName, isColumnFilterActive, isColumnGroupDef, isCustomAggFunc, isServerRowModel, listUndoableEventTypes, mapColDefOrGroups, mapColumnDefs, mapColumnSchemas, mapColumnSchemasToDefs, mapRowDataToRowInputs, normalizeFilterText, normalizeQuickFilterText, openIndexedDbDatabase, pageWindow, readAccumulator, resolveBuiltinFilterKind, resolveColumnAggSpecs, resolveCreateGridDefaults, toColumnDef, toColumnDefinition, toColumnSchema, toColumnViewBinding, toMinorUnits } from './chunk-27ALJSZP.js';
|
|
4
4
|
import './chunk-5HKVMPBD.js';
|
|
5
5
|
import { columnSizeStyle, overlayStoredColumnWidth, ViewportCalculator, isIndexColumn, clampColumnWidth } from './chunk-IPPIXOVQ.js';
|
|
6
6
|
export { ViewportCalculator, buildCumulativeWidths, calculateColumnViewport } from './chunk-IPPIXOVQ.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-7T6AWRPU.js';
|
|
8
8
|
import './chunk-KHMG6EI2.js';
|
|
9
9
|
import './chunk-RKVSJU46.js';
|
|
10
|
-
import { useLocale, hasDependValue, buildDependencyBody, useRemoteQuery, useThemePortalStyle, useTranslations, useNumberingSystem, useERPTableHost, useDateAdapter, useLazyRemote,
|
|
11
|
-
export { AR_MESSAGES, EN_MESSAGES, ERPTableHostProvider, FA_MESSAGES, GridTheme, bindGridHostEvents, gregorianAdapter, themeDark, themeDefault, themeErp, themeErpDark, useERPTableTheme, useStaticDependOn } from './chunk-
|
|
10
|
+
import { useLocale, useHostDependOn, hasDependValue, buildDependencyBody, useRemoteQuery, getStaticDependValue, getDependFieldName, useThemePortalStyle, useTranslations, useNumberingSystem, useERPTableHost, useDateAdapter, useLazyRemote, useERPTableTheme, translate, themeDefault, isStockDarkTheme, resolveActiveTheme, useGridHostEvents, useMediaQuery, ERPTableHostProvider, themeToStyle, useDirection, useHostToast } from './chunk-HLOHWFOA.js';
|
|
11
|
+
export { AR_MESSAGES, EN_MESSAGES, ERPTableHostProvider, FA_MESSAGES, GridTheme, bindGridHostEvents, gregorianAdapter, themeDark, themeDefault, themeErp, themeErpDark, useERPTableTheme, useStaticDependOn } from './chunk-HLOHWFOA.js';
|
|
12
12
|
import { formatLocaleNumber, resolveDirection } from './chunk-SZ7BLAY3.js';
|
|
13
13
|
export { formatLocaleDate, formatLocaleNumber, resolveDirection, resolveLocaleMeta } from './chunk-SZ7BLAY3.js';
|
|
14
14
|
import './chunk-F4PYOYHR.js';
|
|
@@ -16,17 +16,17 @@ import './chunk-77UXAJII.js';
|
|
|
16
16
|
import './chunk-TN4MG6FY.js';
|
|
17
17
|
export { jalaliAdapter } from './chunk-GQEDLUMB.js';
|
|
18
18
|
export { CATALOG_TO_HOST_CALLBACKS, ROW_DATA_UPDATED_CATALOG_TYPES, dispatchCatalogHostEvent, subscribeCatalogHostEvents } from './chunk-MUQQKPWR.js';
|
|
19
|
-
import {
|
|
19
|
+
import { ariaSortForColumn, sortPriorityForColumn, HEADER_SORT_CLICK_MAX_MOVE_PX, isHeaderColumnSortable, shouldCommitHeaderSortClick, cycleSortModel } from './chunk-AU3RDJYQ.js';
|
|
20
20
|
export { HEADER_SORT_CLICK_MAX_MOVE_PX, INDEX_COL_ID, applySort, ariaSortForColumn, compareSortValues, compareTypedValues, cycleSortModel, isBlankSortValue, isHeaderColumnSortable, normalizeDigits, shouldCommitHeaderSortClick, sortPriorityForColumn } from './chunk-AU3RDJYQ.js';
|
|
21
|
-
import { exportActiveCollectionToExcel } from './chunk-
|
|
22
|
-
export { ExcelExportPlugin, ExcelImportPlugin, applyImportedRows, exportActiveCollectionToExcel, mapImportedSheet, parseXlsxBlob } from './chunk-
|
|
21
|
+
import { exportActiveCollectionToExcel } from './chunk-NB5GCGHL.js';
|
|
22
|
+
export { ExcelExportPlugin, ExcelImportPlugin, applyImportedRows, exportActiveCollectionToExcel, mapImportedSheet, parseXlsxBlob } from './chunk-NB5GCGHL.js';
|
|
23
23
|
import { Viewport } from './chunk-XLRE2J25.js';
|
|
24
24
|
export { RowStateEnum, Viewport } from './chunk-XLRE2J25.js';
|
|
25
|
-
export { buildExportTable } from './chunk-
|
|
25
|
+
export { buildExportTable } from './chunk-7GWV5HGO.js';
|
|
26
26
|
import './chunk-3Y3KKGEC.js';
|
|
27
|
-
export { PdfExportPlugin, TextPdfRenderer, VazirmatnPdfRenderer } from './chunk-
|
|
27
|
+
export { PdfExportPlugin, TextPdfRenderer, VazirmatnPdfRenderer } from './chunk-VBAZ77Q4.js';
|
|
28
28
|
export { buildXlsxBlob } from './chunk-PQY54EL5.js';
|
|
29
|
-
import './chunk-
|
|
29
|
+
import './chunk-GKE33FOJ.js';
|
|
30
30
|
import React7, { lazy, forwardRef, useMemo, useState, useRef, useEffect, createElement, Suspense, useCallback, useLayoutEffect, useId } from 'react';
|
|
31
31
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
32
32
|
import { createPortal } from 'react-dom';
|
|
@@ -1794,12 +1794,18 @@ var DescriptionComponent = forwardRef((props, ref) => {
|
|
|
1794
1794
|
} = props;
|
|
1795
1795
|
const showSearchHit = !!(isCurrentSearchMatch && searchQuery?.trim());
|
|
1796
1796
|
const { endpoint, dependOn } = meta.dynamicSource ?? {};
|
|
1797
|
-
const
|
|
1798
|
-
|
|
1797
|
+
const { dependencyBody: hostValues } = useHostDependOn(dependOn, {
|
|
1798
|
+
enabled: true
|
|
1799
|
+
});
|
|
1800
|
+
const resolveDepend = (item) => getStaticDependValue(item) ?? hostValues[getDependFieldName(item)];
|
|
1801
|
+
const isReady = hasDependValue(dependOn, resolveDepend);
|
|
1802
|
+
const dependencyBody = buildDependencyBody(dependOn, resolveDepend);
|
|
1799
1803
|
const { data: menuData } = useRemoteQuery({
|
|
1800
1804
|
url: endpoint,
|
|
1801
1805
|
body: {
|
|
1802
1806
|
...dependencyBody,
|
|
1807
|
+
RepoViewId: 0,
|
|
1808
|
+
RepoId: 0,
|
|
1803
1809
|
PagingInfo: {
|
|
1804
1810
|
PageNumber: 1,
|
|
1805
1811
|
PageRecordCount: 1e4
|
|
@@ -1942,6 +1948,8 @@ var ERPTableDynamicSelect = ({
|
|
|
1942
1948
|
const {
|
|
1943
1949
|
endpoint,
|
|
1944
1950
|
repoViewId,
|
|
1951
|
+
// UI-only flag of the host's select config; never part of the request body.
|
|
1952
|
+
addButton: _addButton,
|
|
1945
1953
|
dependOn,
|
|
1946
1954
|
...bodyRequest
|
|
1947
1955
|
} = dynamicValue ?? {};
|
|
@@ -2121,7 +2129,8 @@ var ERPTableDynamicSelect = ({
|
|
|
2121
2129
|
)
|
|
2122
2130
|
] });
|
|
2123
2131
|
};
|
|
2124
|
-
var CellRenderer = ({
|
|
2132
|
+
var CellRenderer = (props) => props.meta ? /* @__PURE__ */ jsx(CellRendererBody, { ...props, meta: props.meta }) : null;
|
|
2133
|
+
var CellRendererBody = ({
|
|
2125
2134
|
tableKey,
|
|
2126
2135
|
row,
|
|
2127
2136
|
columnId,
|
|
@@ -2136,7 +2145,6 @@ var CellRenderer = ({
|
|
|
2136
2145
|
const numberingSystem = useNumberingSystem();
|
|
2137
2146
|
const dateAdapter = useDateAdapter();
|
|
2138
2147
|
const searchState = useGridSearchState(controller);
|
|
2139
|
-
if (!meta) return null;
|
|
2140
2148
|
const disable = typeof row.visibilityCondition[columnId] === "boolean" && row.visibilityCondition[columnId] === false;
|
|
2141
2149
|
const viewCell = controller.getCell(row.id, columnId);
|
|
2142
2150
|
const draft = controller.getEditDraft(row.id, columnId);
|
|
@@ -2464,6 +2472,7 @@ var CellRenderer = ({
|
|
|
2464
2472
|
popupRender: (menu) => /* @__PURE__ */ jsx("div", { className: "w-full", children: menu }),
|
|
2465
2473
|
disabled: isDeleted || !isEditable,
|
|
2466
2474
|
value: selectValue,
|
|
2475
|
+
valueLabel: display != null && display !== "" ? String(display) : void 0,
|
|
2467
2476
|
dynamicValue: meta?.dynamicSource,
|
|
2468
2477
|
filterOption: (input, option) => {
|
|
2469
2478
|
if (meta?.dynamicSelectFilterOption) {
|
|
@@ -2911,7 +2920,7 @@ var ERPTableRow = React7.memo(ERPTableRowComponent, (prev, next) => {
|
|
|
2911
2920
|
return prev.row === next.row && prev.index === next.index && prev.stripeIndex === next.stripeIndex && prev.controller === next.controller && prev.tableKey === next.tableKey && prev.isSelected === next.isSelected && prev.isActive === next.isActive && prev.isCut === next.isCut && prev.table.columns === next.table.columns && prev.table.columnWidths === next.table.columnWidths && prev.table.activeCell?.rowId === next.table.activeCell?.rowId && prev.table.activeCell?.columnId === next.table.activeCell?.columnId && prev.table.cellRanges === next.table.cellRanges && prev.moreDetailComponent === next.moreDetailComponent;
|
|
2912
2921
|
});
|
|
2913
2922
|
var ERPTableGroupRow = React7.lazy(
|
|
2914
|
-
() => import('./ERPTableGroupRow-
|
|
2923
|
+
() => import('./ERPTableGroupRow-E5Q6FYDS.js').then((m) => ({ default: m.ERPTableGroupRow }))
|
|
2915
2924
|
);
|
|
2916
2925
|
function ERPTableBody({
|
|
2917
2926
|
controller,
|
|
@@ -3118,6 +3127,83 @@ function resolveColumnReorder(columns, sourceField, destField) {
|
|
|
3118
3127
|
if (isIndexColumn(source) || isIndexColumn(dest)) return null;
|
|
3119
3128
|
return { sourceIndex, destIndex };
|
|
3120
3129
|
}
|
|
3130
|
+
|
|
3131
|
+
// engine/dataOps/columnMenu.ts
|
|
3132
|
+
function isColumnMenuCustomItem(item) {
|
|
3133
|
+
return typeof item === "object" && item !== null && "name" in item;
|
|
3134
|
+
}
|
|
3135
|
+
function isColumnFilterable(column) {
|
|
3136
|
+
const ui = resolveFilterUi(column);
|
|
3137
|
+
return ui != null;
|
|
3138
|
+
}
|
|
3139
|
+
function isColumnSortableInGrid(column, pagedWindow) {
|
|
3140
|
+
if (!isHeaderColumnSortable(column)) return false;
|
|
3141
|
+
return !pagedWindow || column.columnDef?.sortable === true;
|
|
3142
|
+
}
|
|
3143
|
+
function isColumnFilterableInGrid(column, pagedWindow) {
|
|
3144
|
+
if (!isColumnFilterable(column)) return false;
|
|
3145
|
+
if (!pagedWindow) return true;
|
|
3146
|
+
const def = column.columnDef?.filter;
|
|
3147
|
+
return def != null && def !== false;
|
|
3148
|
+
}
|
|
3149
|
+
function buildDefaultColumnMenuItems(ctx) {
|
|
3150
|
+
const items = [];
|
|
3151
|
+
if (ctx.sortable) {
|
|
3152
|
+
items.push("sortAsc", "sortDesc", "sortNone", "separator");
|
|
3153
|
+
}
|
|
3154
|
+
if (ctx.filterable) items.push("filter");
|
|
3155
|
+
if (ctx.hideable) items.push("hideColumn");
|
|
3156
|
+
if (ctx.pinnable) {
|
|
3157
|
+
items.push("pinStart", "pinEnd", "pinNone", "separator");
|
|
3158
|
+
}
|
|
3159
|
+
items.push("autoSize", "columnsPanel");
|
|
3160
|
+
return items;
|
|
3161
|
+
}
|
|
3162
|
+
function resolveColumnMenuItems(column, config, options) {
|
|
3163
|
+
const pagedWindow = options?.pagedWindow === true;
|
|
3164
|
+
const ctx = {
|
|
3165
|
+
sortable: isColumnSortableInGrid(column, pagedWindow),
|
|
3166
|
+
filterable: isColumnFilterableInGrid(column, pagedWindow),
|
|
3167
|
+
hideable: !isIndexColumn(column),
|
|
3168
|
+
pinnable: !isIndexColumn(column)
|
|
3169
|
+
};
|
|
3170
|
+
const defaults = buildDefaultColumnMenuItems(ctx);
|
|
3171
|
+
if (!config) return defaults;
|
|
3172
|
+
if (typeof config === "function") return config(defaults);
|
|
3173
|
+
return config;
|
|
3174
|
+
}
|
|
3175
|
+
function columnMenuItemLabelKey(id) {
|
|
3176
|
+
switch (id) {
|
|
3177
|
+
case "sortAsc":
|
|
3178
|
+
return "columnMenu.sortAsc";
|
|
3179
|
+
case "sortDesc":
|
|
3180
|
+
return "columnMenu.sortDesc";
|
|
3181
|
+
case "sortNone":
|
|
3182
|
+
return "columnMenu.sortNone";
|
|
3183
|
+
case "filter":
|
|
3184
|
+
return "columnMenu.filter";
|
|
3185
|
+
case "hideColumn":
|
|
3186
|
+
return "columnMenu.hideColumn";
|
|
3187
|
+
case "pinStart":
|
|
3188
|
+
return "columnMenu.pinStart";
|
|
3189
|
+
case "pinEnd":
|
|
3190
|
+
return "columnMenu.pinEnd";
|
|
3191
|
+
case "pinNone":
|
|
3192
|
+
return "columnMenu.pinNone";
|
|
3193
|
+
case "autoSize":
|
|
3194
|
+
return "columnMenu.autoSize";
|
|
3195
|
+
case "columnsPanel":
|
|
3196
|
+
return "columnMenu.columnsPanel";
|
|
3197
|
+
default:
|
|
3198
|
+
return id;
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
function sortModelForMenuAction(current, colId, action) {
|
|
3202
|
+
if (action === "none") {
|
|
3203
|
+
return current.filter((entry) => entry.colId !== colId);
|
|
3204
|
+
}
|
|
3205
|
+
return [{ colId, sort: action }];
|
|
3206
|
+
}
|
|
3121
3207
|
var GRID_REVALIDATE_EVENT = "pdg-grid:revalidate";
|
|
3122
3208
|
var LEGACY_GRID_REVALIDATE_EVENT = "erp-table:revalidate";
|
|
3123
3209
|
function useRevalidateRevision() {
|
|
@@ -3832,72 +3918,6 @@ function ColumnGroupHeaderRows({
|
|
|
3832
3918
|
`group-row-${level}`
|
|
3833
3919
|
)) });
|
|
3834
3920
|
}
|
|
3835
|
-
|
|
3836
|
-
// engine/dataOps/columnMenu.ts
|
|
3837
|
-
function isColumnMenuCustomItem(item) {
|
|
3838
|
-
return typeof item === "object" && item !== null && "name" in item;
|
|
3839
|
-
}
|
|
3840
|
-
function isColumnFilterable(column) {
|
|
3841
|
-
const ui = resolveFilterUi(column);
|
|
3842
|
-
return ui != null;
|
|
3843
|
-
}
|
|
3844
|
-
function buildDefaultColumnMenuItems(ctx) {
|
|
3845
|
-
const items = [];
|
|
3846
|
-
if (ctx.sortable) {
|
|
3847
|
-
items.push("sortAsc", "sortDesc", "sortNone", "separator");
|
|
3848
|
-
}
|
|
3849
|
-
if (ctx.filterable) items.push("filter");
|
|
3850
|
-
if (ctx.hideable) items.push("hideColumn");
|
|
3851
|
-
if (ctx.pinnable) {
|
|
3852
|
-
items.push("pinStart", "pinEnd", "pinNone", "separator");
|
|
3853
|
-
}
|
|
3854
|
-
items.push("autoSize", "columnsPanel");
|
|
3855
|
-
return items;
|
|
3856
|
-
}
|
|
3857
|
-
function resolveColumnMenuItems(column, config) {
|
|
3858
|
-
const ctx = {
|
|
3859
|
-
sortable: isHeaderColumnSortable(column),
|
|
3860
|
-
filterable: isColumnFilterable(column),
|
|
3861
|
-
hideable: !isIndexColumn(column),
|
|
3862
|
-
pinnable: !isIndexColumn(column)
|
|
3863
|
-
};
|
|
3864
|
-
const defaults = buildDefaultColumnMenuItems(ctx);
|
|
3865
|
-
if (!config) return defaults;
|
|
3866
|
-
if (typeof config === "function") return config(defaults);
|
|
3867
|
-
return config;
|
|
3868
|
-
}
|
|
3869
|
-
function columnMenuItemLabelKey(id) {
|
|
3870
|
-
switch (id) {
|
|
3871
|
-
case "sortAsc":
|
|
3872
|
-
return "columnMenu.sortAsc";
|
|
3873
|
-
case "sortDesc":
|
|
3874
|
-
return "columnMenu.sortDesc";
|
|
3875
|
-
case "sortNone":
|
|
3876
|
-
return "columnMenu.sortNone";
|
|
3877
|
-
case "filter":
|
|
3878
|
-
return "columnMenu.filter";
|
|
3879
|
-
case "hideColumn":
|
|
3880
|
-
return "columnMenu.hideColumn";
|
|
3881
|
-
case "pinStart":
|
|
3882
|
-
return "columnMenu.pinStart";
|
|
3883
|
-
case "pinEnd":
|
|
3884
|
-
return "columnMenu.pinEnd";
|
|
3885
|
-
case "pinNone":
|
|
3886
|
-
return "columnMenu.pinNone";
|
|
3887
|
-
case "autoSize":
|
|
3888
|
-
return "columnMenu.autoSize";
|
|
3889
|
-
case "columnsPanel":
|
|
3890
|
-
return "columnMenu.columnsPanel";
|
|
3891
|
-
default:
|
|
3892
|
-
return id;
|
|
3893
|
-
}
|
|
3894
|
-
}
|
|
3895
|
-
function sortModelForMenuAction(current, colId, action) {
|
|
3896
|
-
if (action === "none") {
|
|
3897
|
-
return current.filter((entry) => entry.colId !== colId);
|
|
3898
|
-
}
|
|
3899
|
-
return [{ colId, sort: action }];
|
|
3900
|
-
}
|
|
3901
3921
|
function buildRows(items, column, controller, sortModel, onCustomAction, onOpenFilter, onOpenColumnsPanel, t) {
|
|
3902
3922
|
const colId = column.fieldName;
|
|
3903
3923
|
const rows = [];
|
|
@@ -3982,9 +4002,10 @@ function ColumnMenuPopover({
|
|
|
3982
4002
|
left: pos.left,
|
|
3983
4003
|
zIndex: 1200
|
|
3984
4004
|
});
|
|
4005
|
+
const pagedWindow = controller.isPagedWindow();
|
|
3985
4006
|
const items = useMemo(
|
|
3986
|
-
() => resolveColumnMenuItems(column, itemsConfig),
|
|
3987
|
-
[column, itemsConfig]
|
|
4007
|
+
() => resolveColumnMenuItems(column, itemsConfig, { pagedWindow }),
|
|
4008
|
+
[column, itemsConfig, pagedWindow]
|
|
3988
4009
|
);
|
|
3989
4010
|
const rows = useMemo(
|
|
3990
4011
|
() => buildRows(
|
|
@@ -4329,6 +4350,7 @@ function ERPTableHeader({
|
|
|
4329
4350
|
const columnMenuItems = host.columnMenuItems;
|
|
4330
4351
|
const onColumnMenuAction = host.onColumnMenuAction;
|
|
4331
4352
|
const table = controller.getViewState();
|
|
4353
|
+
const pagedWindow = controller.isPagedWindow();
|
|
4332
4354
|
const draggedFieldRef = useRef(null);
|
|
4333
4355
|
const draggedGroupRef = useRef(null);
|
|
4334
4356
|
const pointerOriginRef = useRef(null);
|
|
@@ -4441,8 +4463,8 @@ function ERPTableHeader({
|
|
|
4441
4463
|
col.fieldName
|
|
4442
4464
|
);
|
|
4443
4465
|
}
|
|
4444
|
-
const sortable =
|
|
4445
|
-
const filterUi = resolveFilterUi(col);
|
|
4466
|
+
const sortable = isColumnSortableInGrid(col, pagedWindow);
|
|
4467
|
+
const filterUi = isColumnFilterableInGrid(col, pagedWindow) ? resolveFilterUi(col) : null;
|
|
4446
4468
|
const customFilter = filterUi?.mode === "custom" ? resolveFilterComponent(filterUi.name, filters) : void 0;
|
|
4447
4469
|
const filterable = filterUi != null && (filterUi.mode === "builtin" || customFilter != null);
|
|
4448
4470
|
const filterActive = isColumnFilterActive(filterModel, col.fieldName);
|
|
@@ -4605,7 +4627,7 @@ function ERPTableHeader({
|
|
|
4605
4627
|
};
|
|
4606
4628
|
const renderFloatingFilterColumn = (col, index) => {
|
|
4607
4629
|
const size = columnSizeStyle(col, table.columnWidths, colWindow.layoutWidths);
|
|
4608
|
-
const ui = resolveFilterUi(col);
|
|
4630
|
+
const ui = isColumnFilterableInGrid(col, pagedWindow) ? resolveFilterUi(col) : null;
|
|
4609
4631
|
if (isIndexColumn(col) || !ui || ui.mode !== "builtin") {
|
|
4610
4632
|
return /* @__PURE__ */ jsx(
|
|
4611
4633
|
"th",
|
|
@@ -4963,12 +4985,14 @@ function useVirtualWindow(session, items, options) {
|
|
|
4963
4985
|
() => {
|
|
4964
4986
|
const vp = session.getViewport();
|
|
4965
4987
|
const itemCount = isSparseRowIndex(items) ? session.getUiRowCount() : items.length;
|
|
4988
|
+
const indexRevision = isSparseRowIndex(items) ? items.revision : 0;
|
|
4966
4989
|
return {
|
|
4967
4990
|
scrollOffset: vp.scrollOffset,
|
|
4968
4991
|
viewportSize: vp.viewportSize,
|
|
4969
4992
|
rowHeight: vp.rowHeight,
|
|
4970
4993
|
overscan: vp.overscan,
|
|
4971
|
-
itemCount
|
|
4994
|
+
itemCount,
|
|
4995
|
+
indexRevision
|
|
4972
4996
|
};
|
|
4973
4997
|
},
|
|
4974
4998
|
sync,
|
|
@@ -4991,7 +5015,7 @@ function useVirtualWindow(session, items, options) {
|
|
|
4991
5015
|
};
|
|
4992
5016
|
}
|
|
4993
5017
|
var ERPTableGroupRow2 = React7.lazy(
|
|
4994
|
-
() => import('./ERPTableGroupRow-
|
|
5018
|
+
() => import('./ERPTableGroupRow-E5Q6FYDS.js').then((m) => ({ default: m.ERPTableGroupRow }))
|
|
4995
5019
|
);
|
|
4996
5020
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
4997
5021
|
function ERPTableVirtualBody({
|
|
@@ -7040,6 +7064,9 @@ function isInsideSelect(el) {
|
|
|
7040
7064
|
);
|
|
7041
7065
|
}
|
|
7042
7066
|
function isGridShortcutKey(e) {
|
|
7067
|
+
if (typeof e.getModifierState === "function" && e.getModifierState("AltGraph")) {
|
|
7068
|
+
return false;
|
|
7069
|
+
}
|
|
7043
7070
|
if (e.altKey) return true;
|
|
7044
7071
|
return e.ctrlKey && (e.code === "Space" || e.code === "ArrowUp" || e.code === "ArrowDown" || e.code === "End");
|
|
7045
7072
|
}
|
|
@@ -7054,6 +7081,20 @@ function shouldSkipGridNavigation(target, code) {
|
|
|
7054
7081
|
}
|
|
7055
7082
|
return false;
|
|
7056
7083
|
}
|
|
7084
|
+
function resolveGridKeyScope(target, root) {
|
|
7085
|
+
if (!root) return "cell";
|
|
7086
|
+
if (typeof Element === "undefined" || !(target instanceof Element)) return "page";
|
|
7087
|
+
if (typeof document !== "undefined" && (target === document.body || target === document.documentElement)) {
|
|
7088
|
+
return "page";
|
|
7089
|
+
}
|
|
7090
|
+
const owner = target.closest("[data-pdg-grid]");
|
|
7091
|
+
if (owner && owner !== root) return "other-grid";
|
|
7092
|
+
if (!root.contains(target)) return "outside";
|
|
7093
|
+
if (target.closest('[role="menu"], [role="dialog"], .erp-table-modal')) return "outside";
|
|
7094
|
+
if (target.closest('[role="gridcell"], [data-erp-cell-textarea]')) return "cell";
|
|
7095
|
+
if (target.closest('[role="grid"], [role="treegrid"]') === target) return "cell";
|
|
7096
|
+
return "outside";
|
|
7097
|
+
}
|
|
7057
7098
|
function useGrid(config) {
|
|
7058
7099
|
const generatedKeyRef = useRef(void 0);
|
|
7059
7100
|
if (config.tableKey) {
|
|
@@ -7066,6 +7107,7 @@ function useGrid(config) {
|
|
|
7066
7107
|
const [api, setApi] = useState(null);
|
|
7067
7108
|
const [session, setSession] = useState(null);
|
|
7068
7109
|
const [pluginHost, setPluginHost] = useState(null);
|
|
7110
|
+
const [eventStore, setEventStore] = useState(null);
|
|
7069
7111
|
const [rows, setRows] = useState(null);
|
|
7070
7112
|
const [, setViewVersion] = useState(0);
|
|
7071
7113
|
const [undoFlags, setUndoFlags] = useState({ canUndo: false, canRedo: false });
|
|
@@ -7073,42 +7115,53 @@ function useGrid(config) {
|
|
|
7073
7115
|
const [changelog, setChangelog] = useState([]);
|
|
7074
7116
|
const pagedIdb = config.persistence === "paged-idb";
|
|
7075
7117
|
const disabled = pagedIdb && !config.tableKey;
|
|
7076
|
-
const
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
[tableKey, disabled, generation, config.columns, config.columnDefs, config.store]
|
|
7080
|
-
);
|
|
7118
|
+
const configRef = useRef(config);
|
|
7119
|
+
configRef.current = config;
|
|
7120
|
+
const teardownRef = useRef(Promise.resolve());
|
|
7081
7121
|
useEffect(() => {
|
|
7082
7122
|
let cancelled = false;
|
|
7123
|
+
let built = null;
|
|
7083
7124
|
setController(null);
|
|
7084
7125
|
setApi(null);
|
|
7085
7126
|
setSession(null);
|
|
7086
7127
|
setPluginHost(null);
|
|
7128
|
+
setEventStore(null);
|
|
7087
7129
|
setRows(null);
|
|
7088
|
-
if (
|
|
7089
|
-
|
|
7130
|
+
if (disabled) return void 0;
|
|
7131
|
+
const previous = teardownRef.current;
|
|
7132
|
+
void previous.then(() => {
|
|
7090
7133
|
if (cancelled) return;
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7134
|
+
const grid = createGrid({ ...configRef.current, tableKey });
|
|
7135
|
+
built = grid;
|
|
7136
|
+
void grid.ready.then((result) => {
|
|
7137
|
+
if (cancelled) return;
|
|
7138
|
+
setController(result.controller);
|
|
7139
|
+
setApi(result.api);
|
|
7140
|
+
setSession(result.session);
|
|
7141
|
+
setPluginHost(result.pluginHost);
|
|
7142
|
+
setEventStore(result.eventStore);
|
|
7143
|
+
});
|
|
7095
7144
|
});
|
|
7096
7145
|
return () => {
|
|
7097
7146
|
cancelled = true;
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7147
|
+
const grid = built;
|
|
7148
|
+
if (!grid) {
|
|
7149
|
+
teardownRef.current = previous;
|
|
7150
|
+
return;
|
|
7101
7151
|
}
|
|
7152
|
+
teardownRef.current = previous.then(
|
|
7153
|
+
() => grid.ready.then(
|
|
7154
|
+
(result) => pagedIdb ? result.controller.dispose() : result.controller.releaseResources(),
|
|
7155
|
+
() => void 0
|
|
7156
|
+
)
|
|
7157
|
+
);
|
|
7102
7158
|
};
|
|
7103
|
-
}, [
|
|
7159
|
+
}, [tableKey, disabled, pagedIdb, config.columns, config.columnDefs, config.store]);
|
|
7104
7160
|
useEffect(() => {
|
|
7105
7161
|
if (!controller || config.rowData === void 0) return;
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
config.getRowId
|
|
7110
|
-
);
|
|
7111
|
-
}, [controller, config.rowData, config.columnDefs, config.getRowId]);
|
|
7162
|
+
const { columnDefs, getRowId } = configRef.current;
|
|
7163
|
+
controller.applyHostRowData(config.rowData, columnDefs, getRowId);
|
|
7164
|
+
}, [controller, config.rowData]);
|
|
7112
7165
|
useEffect(() => {
|
|
7113
7166
|
if (!controller || !config.columnDefs) return;
|
|
7114
7167
|
for (const def of flattenColDefOrGroup(config.columnDefs)) {
|
|
@@ -7180,7 +7233,7 @@ function useGrid(config) {
|
|
|
7180
7233
|
unsubChangelog();
|
|
7181
7234
|
};
|
|
7182
7235
|
}, [controller]);
|
|
7183
|
-
if (!
|
|
7236
|
+
if (!eventStore || !controller || !api || !session || !pluginHost || !controller.getViewState()) {
|
|
7184
7237
|
return { ready: false };
|
|
7185
7238
|
}
|
|
7186
7239
|
return {
|
|
@@ -7189,7 +7242,7 @@ function useGrid(config) {
|
|
|
7189
7242
|
api,
|
|
7190
7243
|
session,
|
|
7191
7244
|
pluginHost,
|
|
7192
|
-
eventStore
|
|
7245
|
+
eventStore,
|
|
7193
7246
|
store: isPersistentStore(config.store) ? config.store : DEFAULT_MEMORY_STORE,
|
|
7194
7247
|
tableKey,
|
|
7195
7248
|
rows: rows ?? controller.getSnapShot("active"),
|
|
@@ -7227,12 +7280,6 @@ function assignRef(ref, value) {
|
|
|
7227
7280
|
}
|
|
7228
7281
|
function DataGrid(props) {
|
|
7229
7282
|
const {
|
|
7230
|
-
columns,
|
|
7231
|
-
rowAccess,
|
|
7232
|
-
rows,
|
|
7233
|
-
actor,
|
|
7234
|
-
store,
|
|
7235
|
-
tableKey,
|
|
7236
7283
|
apiRef,
|
|
7237
7284
|
onReady,
|
|
7238
7285
|
onGridReady,
|
|
@@ -7246,8 +7293,6 @@ function DataGrid(props) {
|
|
|
7246
7293
|
footer,
|
|
7247
7294
|
footerRows,
|
|
7248
7295
|
tableHeight,
|
|
7249
|
-
activeCollection,
|
|
7250
|
-
recordPerPage,
|
|
7251
7296
|
multiSelectConfig,
|
|
7252
7297
|
moreDetailComponent,
|
|
7253
7298
|
virtualization,
|
|
@@ -7262,10 +7307,7 @@ function DataGrid(props) {
|
|
|
7262
7307
|
themeToggle = true,
|
|
7263
7308
|
components,
|
|
7264
7309
|
filterComponents,
|
|
7265
|
-
plugins,
|
|
7266
7310
|
rowData,
|
|
7267
|
-
columnDefs,
|
|
7268
|
-
getRowId,
|
|
7269
7311
|
floatingFilter = false,
|
|
7270
7312
|
loading = false,
|
|
7271
7313
|
loadingOverlayComponent,
|
|
@@ -7279,10 +7321,15 @@ function DataGrid(props) {
|
|
|
7279
7321
|
onClipboardPaste,
|
|
7280
7322
|
columnMenuItems,
|
|
7281
7323
|
onColumnMenuAction,
|
|
7282
|
-
|
|
7324
|
+
useDependOn,
|
|
7283
7325
|
pinnedTopRowData,
|
|
7284
7326
|
pinnedBottomRowData
|
|
7285
7327
|
} = props;
|
|
7328
|
+
const rootRef = useRef(null);
|
|
7329
|
+
const insideEventRef = useRef(null);
|
|
7330
|
+
const markInsideEvent = useCallback((e) => {
|
|
7331
|
+
insideEventRef.current = e.nativeEvent;
|
|
7332
|
+
}, []);
|
|
7286
7333
|
const requestedTheme = themeProp ?? themeDefault;
|
|
7287
7334
|
const requestedKey = JSON.stringify(requestedTheme.params);
|
|
7288
7335
|
const [preferDark, setPreferDark] = useState(
|
|
@@ -7303,22 +7350,8 @@ function DataGrid(props) {
|
|
|
7303
7350
|
setPreferDark((value) => !value);
|
|
7304
7351
|
}, []);
|
|
7305
7352
|
const result = useGrid({
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
activeCollection,
|
|
7309
|
-
columns,
|
|
7310
|
-
rows,
|
|
7311
|
-
actor,
|
|
7312
|
-
rowAccess,
|
|
7313
|
-
tableHeight,
|
|
7314
|
-
recordPerPage,
|
|
7315
|
-
rowHeight: resolvedTheme.params.rowHeight,
|
|
7316
|
-
remoteApi,
|
|
7317
|
-
plugins,
|
|
7318
|
-
rowData,
|
|
7319
|
-
columnDefs,
|
|
7320
|
-
getRowId,
|
|
7321
|
-
stateKey
|
|
7353
|
+
...props,
|
|
7354
|
+
rowHeight: resolvedTheme.params.rowHeight
|
|
7322
7355
|
});
|
|
7323
7356
|
useEffect(() => {
|
|
7324
7357
|
if (!result.ready) return;
|
|
@@ -7356,7 +7389,11 @@ function DataGrid(props) {
|
|
|
7356
7389
|
}
|
|
7357
7390
|
};
|
|
7358
7391
|
const handler = (e) => {
|
|
7359
|
-
|
|
7392
|
+
const scope = resolveGridKeyScope(e.target, rootRef.current);
|
|
7393
|
+
if (scope === "other-grid") return;
|
|
7394
|
+
const shortcut = isGridShortcutKey(e);
|
|
7395
|
+
if (scope === "outside" && !shortcut) return;
|
|
7396
|
+
if (shortcut) {
|
|
7360
7397
|
e.preventDefault();
|
|
7361
7398
|
e.stopPropagation();
|
|
7362
7399
|
} else if (shouldSkipGridNavigation(e.target, e.code)) {
|
|
@@ -7381,6 +7418,22 @@ function DataGrid(props) {
|
|
|
7381
7418
|
window.removeEventListener("keydown", handler, true);
|
|
7382
7419
|
};
|
|
7383
7420
|
}, [result.ready, result]);
|
|
7421
|
+
const readyController = result.ready ? result.controller : null;
|
|
7422
|
+
useEffect(() => {
|
|
7423
|
+
if (!readyController || typeof document === "undefined") return;
|
|
7424
|
+
const onDocument = (event) => {
|
|
7425
|
+
window.setTimeout(() => {
|
|
7426
|
+
if (insideEventRef.current === event) return;
|
|
7427
|
+
void readyController.leaveGridFocus();
|
|
7428
|
+
}, 0);
|
|
7429
|
+
};
|
|
7430
|
+
document.addEventListener("focusin", onDocument, true);
|
|
7431
|
+
document.addEventListener("pointerdown", onDocument, true);
|
|
7432
|
+
return () => {
|
|
7433
|
+
document.removeEventListener("focusin", onDocument, true);
|
|
7434
|
+
document.removeEventListener("pointerdown", onDocument, true);
|
|
7435
|
+
};
|
|
7436
|
+
}, [readyController]);
|
|
7384
7437
|
useGridHostEvents({
|
|
7385
7438
|
ready: result.ready,
|
|
7386
7439
|
controller: result.ready ? result.controller : null,
|
|
@@ -7467,11 +7520,15 @@ function DataGrid(props) {
|
|
|
7467
7520
|
filterComponents,
|
|
7468
7521
|
columnMenuItems,
|
|
7469
7522
|
onColumnMenuAction,
|
|
7523
|
+
useDependOn,
|
|
7470
7524
|
children: /* @__PURE__ */ jsx(
|
|
7471
7525
|
"div",
|
|
7472
7526
|
{
|
|
7527
|
+
ref: rootRef,
|
|
7473
7528
|
className: "pdg-grid erp-table",
|
|
7474
7529
|
dir,
|
|
7530
|
+
onFocusCapture: markInsideEvent,
|
|
7531
|
+
onPointerDownCapture: markInsideEvent,
|
|
7475
7532
|
"data-pdg-grid": true,
|
|
7476
7533
|
"data-erp-table": true,
|
|
7477
7534
|
"data-erp-theme": themeMode,
|
|
@@ -9311,6 +9368,6 @@ function VirtualList({
|
|
|
9311
9368
|
);
|
|
9312
9369
|
}
|
|
9313
9370
|
|
|
9314
|
-
export { CellRenderer, DEFAULT_CELL_COMPONENTS, DEFAULT_PERFORMANCE_BUDGETS, DataGrid, ERPTable, GRID_REVALIDATE_EVENT, GridHistoryPanel, GridOfflineStatus, GridOverlays, LEGACY_GRID_REVALIDATE_EVENT, TextAreaCell, VirtualList, buildVirtualWindow, checkBudget, highlightIfCurrentSearch, highlightSearchText, injectERPTableStyles, injectGridStyles, isGridShortcutKey, mergeCellComponents, resolveBoundCellNode, resolveCustomCellNode, resolveFilterComponent, resolveGridOverlay, resolveRegisteredCellNode, runBenchmark, shouldSkipGridNavigation, useERPTable, useGrid, useVirtualWindow };
|
|
9371
|
+
export { CellRenderer, DEFAULT_CELL_COMPONENTS, DEFAULT_PERFORMANCE_BUDGETS, DataGrid, ERPTable, GRID_REVALIDATE_EVENT, GridHistoryPanel, GridOfflineStatus, GridOverlays, LEGACY_GRID_REVALIDATE_EVENT, TextAreaCell, VirtualList, buildVirtualWindow, checkBudget, highlightIfCurrentSearch, highlightSearchText, injectERPTableStyles, injectGridStyles, isGridShortcutKey, mergeCellComponents, resolveBoundCellNode, resolveCustomCellNode, resolveFilterComponent, resolveGridKeyScope, resolveGridOverlay, resolveRegisteredCellNode, runBenchmark, shouldSkipGridNavigation, useERPTable, useGrid, useVirtualWindow };
|
|
9315
9372
|
//# sourceMappingURL=index.js.map
|
|
9316
9373
|
//# sourceMappingURL=index.js.map
|