@economic/taco 2.66.1-test.0 → 2.67.1-footer-fix.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/dist/taco.cjs +93 -35
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.d.ts +4 -3
- package/dist/taco.js +93 -35
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.d.ts
CHANGED
@@ -3066,6 +3066,7 @@ export declare type Table3Ref = TableRef & {
|
|
3066
3066
|
createRow?: (row: unknown) => Promise<void>;
|
3067
3067
|
save: (rowId?: string) => Promise<boolean>;
|
3068
3068
|
removeRowChanges: (rowId: string) => Promise<void>;
|
3069
|
+
forceValidate: () => Promise<string[]>;
|
3069
3070
|
};
|
3070
3071
|
};
|
3071
3072
|
};
|
@@ -3382,7 +3383,7 @@ export declare enum TableFilterComparator {
|
|
3382
3383
|
IsNoneOf = 15
|
3383
3384
|
}
|
3384
3385
|
|
3385
|
-
export declare type TableFilterHandler = (filters: TableColumnFilter[], hiddenColumns: string[]) => Promise<void
|
3386
|
+
export declare type TableFilterHandler = (filters: TableColumnFilter[], hiddenColumns: string[]) => Promise<void> | void;
|
3386
3387
|
|
3387
3388
|
export declare type TableFilterValue = {
|
3388
3389
|
comparator: TableFilterComparator;
|
@@ -3455,7 +3456,7 @@ export declare type TableScrollToIndexHandler = (index: number, options?: {
|
|
3455
3456
|
align: 'start' | 'center' | 'end' | 'auto';
|
3456
3457
|
}) => void;
|
3457
3458
|
|
3458
|
-
export declare type TableSearchHandler = (search: string | undefined, hiddenColumns: string[]) => Promise<void
|
3459
|
+
export declare type TableSearchHandler = (search: string | undefined, hiddenColumns: string[]) => Promise<void> | void;
|
3459
3460
|
|
3460
3461
|
export declare type TableServerLoadAllHandler = (sorting: TableColumnSort[], filters: TableColumnFilter[], hiddenColumns: string[], search: string | undefined) => Promise<void>;
|
3461
3462
|
|
@@ -3495,7 +3496,7 @@ export declare type TableShortcutHandlerObject<TType = unknown> = {
|
|
3495
3496
|
|
3496
3497
|
export declare type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;
|
3497
3498
|
|
3498
|
-
export declare type TableSortHandler = (sorting: TableColumnSort[]) => Promise<void
|
3499
|
+
export declare type TableSortHandler = (sorting: TableColumnSort[]) => Promise<void> | void;
|
3499
3500
|
|
3500
3501
|
export declare type TableTexts = {
|
3501
3502
|
columns: {
|
package/dist/taco.js
CHANGED
@@ -26960,7 +26960,7 @@ const Content$4 = React.forwardRef(function HangerContent(props, ref) {
|
|
26960
26960
|
const context = React.useContext(HangerContext);
|
26961
26961
|
const { texts } = useLocalization();
|
26962
26962
|
const className = clsx(
|
26963
|
-
"wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm",
|
26963
|
+
"wcag-blue-500 border border-transparent rounded p-3 pr-12 yt-shadow focus:border-transparent max-w-sm print:hidden",
|
26964
26964
|
props.className
|
26965
26965
|
);
|
26966
26966
|
const handleInteractOutside = (event) => {
|
@@ -35546,7 +35546,7 @@ function configureReactTableOptions(options, props, localization) {
|
|
35546
35546
|
if (originalRow) {
|
35547
35547
|
return String(originalRow[props.rowIdentityAccessor]);
|
35548
35548
|
}
|
35549
|
-
return
|
35549
|
+
return `skeleton-${index2}-${Math.random().toString(36).substr(2, 9)}`;
|
35550
35550
|
};
|
35551
35551
|
}
|
35552
35552
|
const tableOptions = {
|
@@ -35633,7 +35633,7 @@ function useReactTableInitialState(props, columns, persistedSettings, defaults2)
|
|
35633
35633
|
columnOrder
|
35634
35634
|
);
|
35635
35635
|
} else {
|
35636
|
-
if (props.defaultColumnFreezingIndex) {
|
35636
|
+
if (props.defaultColumnFreezingIndex !== void 0) {
|
35637
35637
|
columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
|
35638
35638
|
} else {
|
35639
35639
|
columnPinning.left = unfreezeAllExternalColumns(columnOrder);
|
@@ -37834,12 +37834,12 @@ function getScrollPaddingEndOffset(table) {
|
|
37834
37834
|
}
|
37835
37835
|
return height;
|
37836
37836
|
}
|
37837
|
-
function getPaddingEndOffset(table
|
37837
|
+
function getPaddingEndOffset(table) {
|
37838
37838
|
const bottomRows = table.getBottomRows() ?? [];
|
37839
|
-
return ROW_HEIGHT_ESTIMATES.medium * 1 * bottomRows.length
|
37839
|
+
return ROW_HEIGHT_ESTIMATES.medium * 1 * bottomRows.length;
|
37840
37840
|
}
|
37841
37841
|
const OVERSCAN_ROW_COUNT = 8;
|
37842
|
-
function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIndex
|
37842
|
+
function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIndex) {
|
37843
37843
|
var _a, _b, _c, _d, _e;
|
37844
37844
|
const tableMeta = table.options.meta;
|
37845
37845
|
const isTableRowGrouped = !!((_a = table.getState().grouping) == null ? void 0 : _a.length);
|
@@ -37858,10 +37858,12 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
|
|
37858
37858
|
// correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list
|
37859
37859
|
scrollPaddingStart,
|
37860
37860
|
scrollPaddingEnd: getScrollPaddingEndOffset(table),
|
37861
|
-
paddingEnd: getPaddingEndOffset(table
|
37861
|
+
paddingEnd: getPaddingEndOffset(table)
|
37862
37862
|
});
|
37863
37863
|
const expandedState = table.getState().expanded;
|
37864
37864
|
const previousExpandedStateRef = React__default.useRef(false);
|
37865
|
+
const sortingState = table.getState().sorting;
|
37866
|
+
const previousSortingStateRef = React__default.useRef(JSON.stringify(sortingState));
|
37865
37867
|
React__default.useEffect(() => {
|
37866
37868
|
const isEmpty = JSON.stringify(expandedState) === "{}";
|
37867
37869
|
if (expandedState === true || isEmpty && previousExpandedStateRef.current === true) {
|
@@ -37869,18 +37871,25 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
|
|
37869
37871
|
virtualiser.measure();
|
37870
37872
|
}
|
37871
37873
|
}, [expandedState]);
|
37874
|
+
React__default.useEffect(() => {
|
37875
|
+
const currentSortingString = JSON.stringify(sortingState);
|
37876
|
+
if (currentSortingString !== previousSortingStateRef.current) {
|
37877
|
+
previousSortingStateRef.current = currentSortingString;
|
37878
|
+
virtualiser.measure();
|
37879
|
+
}
|
37880
|
+
}, [sortingState]);
|
37872
37881
|
const totalSize = virtualiser.getTotalSize();
|
37873
37882
|
const virtualItems = virtualiser.getVirtualItems();
|
37874
37883
|
const scrollToIndex = React__default.useCallback(
|
37875
|
-
(index2,
|
37876
|
-
const notSmooth = { ...
|
37884
|
+
(index2, options = { align: "auto", behavior: "smooth" }) => {
|
37885
|
+
const notSmooth = { ...options, behavior: "auto" };
|
37877
37886
|
if (tableRef.current) {
|
37878
37887
|
if (index2 === 0) {
|
37879
37888
|
virtualiser.scrollToOffset(0, notSmooth);
|
37880
37889
|
} else if (index2 === count2 - 1) {
|
37881
37890
|
tableRef.current.scrollTop = tableRef.current.scrollHeight;
|
37882
37891
|
} else {
|
37883
|
-
virtualiser.scrollToIndex(index2,
|
37892
|
+
virtualiser.scrollToIndex(index2, options);
|
37884
37893
|
}
|
37885
37894
|
}
|
37886
37895
|
},
|
@@ -38318,17 +38327,10 @@ const INTERNAL_RENDERERS = {
|
|
38318
38327
|
rowExpansion: renderer$1,
|
38319
38328
|
rowSelection: renderer
|
38320
38329
|
};
|
38321
|
-
function useTable$1(props, externalRef, renderers, meta
|
38330
|
+
function useTable$1(props, externalRef, renderers, meta) {
|
38322
38331
|
const ref = useMergedRef(externalRef);
|
38323
38332
|
const manager = useTableManager(props, ref, meta, INTERNAL_RENDERERS);
|
38324
|
-
const renderer2 = useTableRenderer(
|
38325
|
-
renderers,
|
38326
|
-
manager.instance,
|
38327
|
-
ref,
|
38328
|
-
manager.meta.length,
|
38329
|
-
props.defaultRowActiveIndex,
|
38330
|
-
options
|
38331
|
-
);
|
38333
|
+
const renderer2 = useTableRenderer(renderers, manager.instance, ref, manager.meta.length, props.defaultRowActiveIndex);
|
38332
38334
|
const { style, stylesheet } = useTableStyle(manager.id, manager.instance);
|
38333
38335
|
useTableGlobalShortcuts(manager.instance, ref, renderer2.scrollToIndex, props.enableLocalKeyboardShortcuts);
|
38334
38336
|
useTableRef(manager.instance, ref);
|
@@ -39019,6 +39021,9 @@ function Header$1(props) {
|
|
39019
39021
|
if (canHide) {
|
39020
39022
|
memoedProps.onHide = header.column.getToggleVisibilityHandler();
|
39021
39023
|
}
|
39024
|
+
if (header.id === "__expansion") {
|
39025
|
+
memoedProps.isExpanded = table.getIsSomeRowsExpanded();
|
39026
|
+
}
|
39022
39027
|
if (canPin) {
|
39023
39028
|
memoedProps.onPin = (index2) => {
|
39024
39029
|
table.setColumnPinning((pinningState) => {
|
@@ -39069,6 +39074,7 @@ const MemoedHeader = React__default.memo(function MemoedHeader2(props) {
|
|
39069
39074
|
hasMenu,
|
39070
39075
|
id: id2,
|
39071
39076
|
index: index2,
|
39077
|
+
isExpanded,
|
39072
39078
|
isFiltered,
|
39073
39079
|
isGroup: isGroup2,
|
39074
39080
|
isPinned,
|
@@ -39108,6 +39114,7 @@ const MemoedHeader = React__default.memo(function MemoedHeader2(props) {
|
|
39108
39114
|
"data-cell-id": id2,
|
39109
39115
|
"data-cell-pinned": isPinned ? isPinned : void 0,
|
39110
39116
|
"data-taco": isGroup2 ? "grouped-column-header" : "column-header",
|
39117
|
+
"data-rows-expanded": isExpanded ? isExpanded : void 0,
|
39111
39118
|
style,
|
39112
39119
|
ref: setRef
|
39113
39120
|
},
|
@@ -39302,10 +39309,10 @@ function Summary(props) {
|
|
39302
39309
|
} else if (!tableMeta.server.isEnabled && (((_a = table.getState().columnFilters) == null ? void 0 : _a.length) || // filtered data
|
39303
39310
|
!!table.getState().globalFilter && table.options.enableGlobalFilter)) {
|
39304
39311
|
label = texts.table.footer.summary.records;
|
39305
|
-
count2 = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("strong",
|
39312
|
+
count2 = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("strong", { "data-taco": "table-footer-current-count" }, new Intl.NumberFormat(locale2).format(currentLength)), " ", texts.table.footer.summary.count, " ", /* @__PURE__ */ React__default.createElement("strong", { "data-taco": "table-footer-total-count" }, new Intl.NumberFormat(locale2).format(length)));
|
39306
39313
|
} else {
|
39307
39314
|
label = texts.table.footer.summary.records;
|
39308
|
-
count2 = /* @__PURE__ */ React__default.createElement("strong",
|
39315
|
+
count2 = /* @__PURE__ */ React__default.createElement("strong", { "data-taco": "table-footer-total-count" }, new Intl.NumberFormat(locale2).format(length));
|
39309
39316
|
}
|
39310
39317
|
return /* @__PURE__ */ React__default.createElement(
|
39311
39318
|
"div",
|
@@ -39464,7 +39471,7 @@ const SearchInput22 = React__default.forwardRef(function SearchInput222(props, r
|
|
39464
39471
|
);
|
39465
39472
|
}
|
39466
39473
|
if (hasFind && isActive) {
|
39467
|
-
postfix = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("span", { className: "text-grey-700 flex h-4 items-center" }, loading ? /* @__PURE__ */ React__default.createElement(Spinner, { className: "h-4 w-4" }) : showTotal ? /* @__PURE__ */ React__default.createElement("span", { className: "border-r border-black/[0.25] pr-2" }, `${findCurrent ?? 0}/${findTotal ?? 0}`) : null), findCurrent ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
39474
|
+
postfix = /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("span", { className: "text-grey-700 flex h-4 items-center" }, loading ? /* @__PURE__ */ React__default.createElement(Spinner, { className: "h-4 w-4" }) : showTotal ? /* @__PURE__ */ React__default.createElement("span", { className: "border-r border-black/[0.25] pr-2", "data-taco": "search-matches-counter" }, `${findCurrent ?? 0}/${findTotal ?? 0}`) : null), findCurrent ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
39468
39475
|
IconButton,
|
39469
39476
|
{
|
39470
39477
|
"aria-label": texts.searchInput.findPrevious,
|
@@ -45156,6 +45163,7 @@ function Print(props) {
|
|
45156
45163
|
{
|
45157
45164
|
icon: "print",
|
45158
45165
|
"aria-label": texts.table.print.tooltip,
|
45166
|
+
id: `${tableId}-toolbar-print`,
|
45159
45167
|
dialog: (dialogProps) => /* @__PURE__ */ React__default.createElement(
|
45160
45168
|
PrintDialog,
|
45161
45169
|
{
|
@@ -45492,7 +45500,7 @@ function Filter(props) {
|
|
45492
45500
|
ref.current.focus();
|
45493
45501
|
}
|
45494
45502
|
}, [id2]);
|
45495
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "flex items-start gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right" }, position > 0 ? texts.table.filters.conditions.and : texts.table.filters.conditions.where), /* @__PURE__ */ React__default.createElement(FilterColumn, { allHeaders, onChange: handleChangeColumn, value: id2, ref }), /* @__PURE__ */ React__default.createElement(FilterComparator, { column: column == null ? void 0 : column.column, onChange: handleChangeComparator, value: comparator }), /* @__PURE__ */ React__default.createElement(FilterValue, { column: column == null ? void 0 : column.column, comparator, onChange: handleChangeValue, value }), onRemove ? /* @__PURE__ */ React__default.createElement(IconButton, { appearance: "discrete", className: "ml-auto", icon: "close", onClick: handleRemove }) : null);
|
45503
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "flex items-start gap-2", "data-taco": "filter-row" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex min-h-[theme(spacing.8)] w-14 flex-shrink-0 items-center justify-end pr-2 text-right" }, position > 0 ? texts.table.filters.conditions.and : texts.table.filters.conditions.where), /* @__PURE__ */ React__default.createElement(FilterColumn, { allHeaders, onChange: handleChangeColumn, value: id2, ref }), /* @__PURE__ */ React__default.createElement(FilterComparator, { column: column == null ? void 0 : column.column, onChange: handleChangeComparator, value: comparator }), /* @__PURE__ */ React__default.createElement(FilterValue, { column: column == null ? void 0 : column.column, comparator, onChange: handleChangeValue, value }), onRemove ? /* @__PURE__ */ React__default.createElement(IconButton, { appearance: "discrete", className: "ml-auto", icon: "close", onClick: handleRemove }) : null);
|
45496
45504
|
}
|
45497
45505
|
const placeholderFilter = { id: "", value: { comparator: TableFilterComparator.Contains, value: void 0 } };
|
45498
45506
|
function ManageFiltersPopover(props) {
|
@@ -45573,10 +45581,10 @@ function ManageFiltersPopover(props) {
|
|
45573
45581
|
onChange: handleChangeFilter,
|
45574
45582
|
onRemove: filters.length > 0 && filters.some((f2) => f2.id) || filters.length > 1 ? handleRemoveFilter : void 0
|
45575
45583
|
}
|
45576
|
-
)), /* @__PURE__ */ React__default.createElement("div", { className: "justify-start" }, /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "discrete", onClick: handleCreate }, "+ ", texts.table.filters.buttons.addFilter))), /* @__PURE__ */ React__default.createElement(Group$6, { className: "ml-auto" }, /* @__PURE__ */ React__default.createElement(Popover.Close, null, /* @__PURE__ */ React__default.createElement(Button$4,
|
45584
|
+
)), /* @__PURE__ */ React__default.createElement("div", { className: "justify-start" }, /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "discrete", onClick: handleCreate, name: "add-filter" }, "+ ", texts.table.filters.buttons.addFilter))), /* @__PURE__ */ React__default.createElement(Group$6, { className: "ml-auto" }, /* @__PURE__ */ React__default.createElement(Popover.Close, null, /* @__PURE__ */ React__default.createElement(Button$4, { name: "close-filters" }, texts.table.filters.buttons.cancel)), /* @__PURE__ */ React__default.createElement(Button$4, { name: "clear-filters", onClick: handleClear }, texts.table.filters.buttons.clear), /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "primary", name: "apply-filters", onClick: handleApply }, texts.table.filters.buttons.apply))))));
|
45577
45585
|
}
|
45578
45586
|
function Filters(props) {
|
45579
|
-
const { length, table } = props;
|
45587
|
+
const { length, tableId, table } = props;
|
45580
45588
|
const { texts } = useLocalization();
|
45581
45589
|
const isLargeScreen = useIsLargeScreen();
|
45582
45590
|
const columnFilters = table.getState().columnFilters;
|
@@ -45589,7 +45597,8 @@ function Filters(props) {
|
|
45589
45597
|
popover: (popoverProps) => /* @__PURE__ */ React__default.createElement(ManageFiltersPopover, { ...popoverProps, length, table }),
|
45590
45598
|
shortcut: shortcut2,
|
45591
45599
|
ref,
|
45592
|
-
tooltip: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, texts.table.filters.tooltip, /* @__PURE__ */ React__default.createElement(Shortcut, { className: "ml-2", keys: shortcut2 }))
|
45600
|
+
tooltip: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, texts.table.filters.tooltip, /* @__PURE__ */ React__default.createElement(Shortcut, { className: "ml-2", keys: shortcut2 })),
|
45601
|
+
id: `${tableId}-toolbar-filters`
|
45593
45602
|
};
|
45594
45603
|
React__default.useEffect(() => {
|
45595
45604
|
var _a;
|
@@ -45622,7 +45631,7 @@ function TableToolbar(props) {
|
|
45622
45631
|
"data-taco": "table-toolbar"
|
45623
45632
|
},
|
45624
45633
|
table.props.toolbarLeft,
|
45625
|
-
/* @__PURE__ */ React__default.createElement(Group$6, { className: "ml-auto flex-shrink-0 items-center print:hidden" }, customTools, canFilter ? /* @__PURE__ */ React__default.createElement(Filters, { length: table.meta.length, table: table.instance }) : null, table.props.toolbarRight, canPrint ? /* @__PURE__ */ React__default.createElement(Print, { table: table.instance, tableId: table.id, tableRef: table.ref }) : null, canSettings ? /* @__PURE__ */ React__default.createElement(Settings, { customSettings: table.props.customSettings, id: `${id2}-settings`, table: table.instance }) : null, canSearch ? /* @__PURE__ */ React__default.createElement(Search$1, { scrollToIndex: table.renderer.scrollToIndex, table: table.instance, tableRef: table.ref }) : null)
|
45634
|
+
/* @__PURE__ */ React__default.createElement(Group$6, { className: "ml-auto flex-shrink-0 items-center print:hidden" }, customTools, canFilter ? /* @__PURE__ */ React__default.createElement(Filters, { length: table.meta.length, tableId: table.id, table: table.instance }) : null, table.props.toolbarRight, canPrint ? /* @__PURE__ */ React__default.createElement(Print, { table: table.instance, tableId: table.id, tableRef: table.ref }) : null, canSettings ? /* @__PURE__ */ React__default.createElement(Settings, { customSettings: table.props.customSettings, id: `${id2}-settings`, table: table.instance }) : null, canSearch ? /* @__PURE__ */ React__default.createElement(Search$1, { scrollToIndex: table.renderer.scrollToIndex, table: table.instance, tableRef: table.ref }) : null)
|
45626
45635
|
), table.props.toolbarPanel ? /* @__PURE__ */ React__default.createElement("div", { className: "mb-4" }, table.props.toolbarPanel) : void 0);
|
45627
45636
|
}
|
45628
45637
|
function canChangeSettings(table, customSettings) {
|
@@ -55267,6 +55276,13 @@ function reducer(state, action) {
|
|
55267
55276
|
indexes: setWith(state.indexes, rowId, index2, Object)
|
55268
55277
|
};
|
55269
55278
|
}
|
55279
|
+
case "forceValidate": {
|
55280
|
+
const { newState } = payload;
|
55281
|
+
return {
|
55282
|
+
...state,
|
55283
|
+
...newState
|
55284
|
+
};
|
55285
|
+
}
|
55270
55286
|
default:
|
55271
55287
|
return state;
|
55272
55288
|
}
|
@@ -55426,6 +55442,46 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55426
55442
|
}
|
55427
55443
|
});
|
55428
55444
|
}
|
55445
|
+
async function forceValidate(table) {
|
55446
|
+
if (validator && table.getRowModel().rows.length) {
|
55447
|
+
const newState = { ...state };
|
55448
|
+
const returnIds = [];
|
55449
|
+
await Promise.all(
|
55450
|
+
table.getRowModel().rows.map(async (row, index2) => {
|
55451
|
+
var _a, _b;
|
55452
|
+
const rowWithChanges = { ...row.original, ...state.changes.rows[row.id] };
|
55453
|
+
if (rowWithChanges) {
|
55454
|
+
const cellErrors = await validator(rowWithChanges);
|
55455
|
+
if (cellErrors) {
|
55456
|
+
newState.changes.dirty[row.id] = true;
|
55457
|
+
newState.changes.originals[row.id] = row.original;
|
55458
|
+
newState.changes.moveReasons[row.id] = { ...newState.changes.moveReasons[row.id] };
|
55459
|
+
newState.changes.rows[row.id] = { ...newState.changes.rows[row.id] };
|
55460
|
+
newState.changes.status[row.id] = "errored";
|
55461
|
+
newState.indexes[row.id] = index2;
|
55462
|
+
newState.changes.errors[row.id] = {
|
55463
|
+
cells: cellErrors,
|
55464
|
+
row: ((_a = newState.changes.errors[row.id]) == null ? void 0 : _a.row) ?? void 0,
|
55465
|
+
shouldShowErrorAlert: ((_b = newState.changes.errors[row.id]) == null ? void 0 : _b.shouldShowErrorAlert) ?? false
|
55466
|
+
};
|
55467
|
+
Object.keys(cellErrors).forEach((columnId) => {
|
55468
|
+
newState.changes.rows[row.id][columnId] = rowWithChanges[columnId];
|
55469
|
+
});
|
55470
|
+
returnIds.push(row.id);
|
55471
|
+
}
|
55472
|
+
}
|
55473
|
+
})
|
55474
|
+
);
|
55475
|
+
dispatch({
|
55476
|
+
type: "forceValidate",
|
55477
|
+
payload: {
|
55478
|
+
newState
|
55479
|
+
}
|
55480
|
+
});
|
55481
|
+
return returnIds;
|
55482
|
+
}
|
55483
|
+
return [];
|
55484
|
+
}
|
55429
55485
|
function getErrors() {
|
55430
55486
|
return Object.keys(state.changes.errors);
|
55431
55487
|
}
|
@@ -55554,6 +55610,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55554
55610
|
hasTemporaryRowErrors,
|
55555
55611
|
getRowStatus,
|
55556
55612
|
setRowStatus,
|
55613
|
+
forceValidate,
|
55557
55614
|
// cells
|
55558
55615
|
setCellValue,
|
55559
55616
|
getCellValue,
|
@@ -56307,14 +56364,7 @@ function useTable3(props, ref) {
|
|
56307
56364
|
]) : props.rowActions
|
56308
56365
|
};
|
56309
56366
|
const meta = { editing };
|
56310
|
-
const
|
56311
|
-
virtualiserPaddingEndOffset: 0
|
56312
|
-
};
|
56313
|
-
if (props.enableEditing) {
|
56314
|
-
const validationErrorLabelHeight = 17;
|
56315
|
-
options.virtualiserPaddingEndOffset = editing.getErrors().length * validationErrorLabelHeight;
|
56316
|
-
}
|
56317
|
-
const table = useTable$1(extendedProps, ref, RENDERERS, meta, options);
|
56367
|
+
const table = useTable$1(extendedProps, ref, RENDERERS, meta);
|
56318
56368
|
const toggleEditing = (enabled) => table.meta.editing.toggleEditing(enabled ?? ((editing2) => !editing2), table.instance, table.renderer.scrollToIndex);
|
56319
56369
|
React__default.useEffect(() => {
|
56320
56370
|
if (props.defaultToggleEditing) {
|
@@ -56337,6 +56387,14 @@ function useTable3(props, ref) {
|
|
56337
56387
|
}
|
56338
56388
|
}
|
56339
56389
|
}, [table.ref.current, table.meta.editing.isEnabled]);
|
56390
|
+
React__default.useEffect(() => {
|
56391
|
+
if (table.ref.current) {
|
56392
|
+
const instance = table.ref.current.instance;
|
56393
|
+
if (table.meta.editing.isEnabled) {
|
56394
|
+
instance.editing.forceValidate = async () => table.meta.editing.forceValidate(table.instance);
|
56395
|
+
}
|
56396
|
+
}
|
56397
|
+
}, [table.meta.editing.forceValidate]);
|
56340
56398
|
return table;
|
56341
56399
|
}
|
56342
56400
|
function Alert(props) {
|