@economic/taco 2.45.0-create.3 → 2.45.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/AlertDialog/AlertDialog.d.ts +2 -1
- package/dist/components/AlertDialog/components/Content.d.ts +2 -0
- package/dist/components/Menu/components/Content.d.ts +1 -1
- package/dist/components/Menu/components/SubMenu.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Provider/Localization.d.ts +0 -2
- package/dist/components/Report/Report.d.ts +1 -1
- package/dist/components/Select2/components/Search.d.ts +0 -6
- package/dist/components/Table3/Table3.d.ts +14 -2
- package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +2 -1
- package/dist/components/Table3/components/Row/Editing/CreateRowButton.d.ts +11 -0
- package/dist/components/Table3/features/useTableEditing.d.ts +36 -24
- package/dist/components/Table3/types.d.ts +8 -23
- package/dist/components/Table3/useTable3.d.ts +0 -6
- package/dist/components/Table3/util/editing.d.ts +1 -0
- package/dist/esm/index.css +2 -6
- package/dist/esm/node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js +17 -17
- package/dist/esm/node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js +2 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +7 -2
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +1 -0
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +1 -0
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +2 -2
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +3 -5
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +20 -39
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +2 -12
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +19 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +7 -21
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +18 -24
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +36 -5
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +12 -17
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js +90 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +14 -2
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +3 -4
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +2 -7
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +406 -16
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +32 -37
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +7 -21
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +25 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +0 -4
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +4 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +3 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +3 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +8 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +0 -11
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +17 -13
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/index.css +2 -6
- package/dist/primitives/Table/Core/Table.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Columns/Internal/Actions.d.ts +1 -3
- package/dist/primitives/Table/Core/components/Footer/Footer.d.ts +2 -2
- package/dist/primitives/Table/Core/features/useTableStyle.d.ts +3 -3
- package/dist/primitives/Table/types.d.ts +2 -2
- package/dist/primitives/Table/useTableManager/useTableManager.d.ts +1 -1
- package/dist/taco.cjs.development.js +691 -921
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/dom.d.ts +0 -1
- package/package.json +17 -16
- package/dist/components/Table3/components/Editing/DiscardChangesConfirmationDialog.d.ts +0 -7
- package/dist/components/Table3/components/Row/Editing/CreateNewRow.d.ts +0 -13
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +0 -12
- package/dist/components/Table3/features/useEditingState.d.ts +0 -29
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +0 -34
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +0 -88
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +0 -93
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +0 -514
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +0 -1
package/dist/utils/dom.d.ts
CHANGED
@@ -2,7 +2,6 @@ export declare const hasFocusableElement: (element: HTMLElement | null) => boole
|
|
2
2
|
export declare const isOverflowing: (element: HTMLElement | null) => boolean;
|
3
3
|
export declare const getIndexOfFirstChildOverflowingParent: (element: HTMLElement, overscan?: number) => number | null;
|
4
4
|
export declare const getNextFocussableElement: (currentElement: HTMLElement | null) => HTMLElement | null;
|
5
|
-
export declare function isElementTriggeredFromContainer(element: Element | null, container: Element | null): any;
|
6
5
|
export declare function isElementInsideOrTriggeredFromContainer(element: Element | null, container: Element | null): any;
|
7
6
|
export declare function isElementInsideOverlay(element: Element | null): boolean;
|
8
7
|
export declare function isSiblingElementInsideSameParentOverlay(element: Element | null, sibling: Element | null): boolean;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@economic/taco",
|
3
|
-
"version": "2.45.0
|
3
|
+
"version": "2.45.0",
|
4
4
|
"description": "> TODO: description",
|
5
5
|
"author": "Matt Daly <matthew.daly@visma.com>",
|
6
6
|
"homepage": "https://github.com/e-conomic/taco#readme",
|
@@ -42,20 +42,20 @@
|
|
42
42
|
"@dnd-kit/modifiers": "^7.0.0",
|
43
43
|
"@dnd-kit/sortable": "^7.0.1",
|
44
44
|
"@economic/taco-tokens": "^1.4.1",
|
45
|
-
"@radix-ui/react-accordion": "^1.
|
46
|
-
"@radix-ui/react-alert-dialog": "^1.
|
47
|
-
"@radix-ui/react-checkbox": "^1.
|
48
|
-
"@radix-ui/react-collapsible": "^1.
|
49
|
-
"@radix-ui/react-dialog": "^1.
|
50
|
-
"@radix-ui/react-dropdown-menu": "^2.
|
51
|
-
"@radix-ui/react-hover-card": "^1.
|
52
|
-
"@radix-ui/react-popover": "^1.
|
53
|
-
"@radix-ui/react-radio-group": "^1.1
|
54
|
-
"@radix-ui/react-scroll-area": "^1.0
|
55
|
-
"@radix-ui/react-switch": "^1.
|
56
|
-
"@radix-ui/react-tabs": "^1.
|
57
|
-
"@radix-ui/react-tooltip": "^1.
|
58
|
-
"@radix-ui/react-use-controllable-state": "^1.
|
45
|
+
"@radix-ui/react-accordion": "^1.2.1",
|
46
|
+
"@radix-ui/react-alert-dialog": "^1.1.2",
|
47
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
48
|
+
"@radix-ui/react-collapsible": "^1.1.1",
|
49
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
50
|
+
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
51
|
+
"@radix-ui/react-hover-card": "^1.1.2",
|
52
|
+
"@radix-ui/react-popover": "^1.1.2",
|
53
|
+
"@radix-ui/react-radio-group": "^1.2.1",
|
54
|
+
"@radix-ui/react-scroll-area": "^1.2.0",
|
55
|
+
"@radix-ui/react-switch": "^1.1.1",
|
56
|
+
"@radix-ui/react-tabs": "^1.1.1",
|
57
|
+
"@radix-ui/react-tooltip": "^1.1.3",
|
58
|
+
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
59
59
|
"@react-aria/focus": "^3.9.0",
|
60
60
|
"@react-aria/interactions": "^3.12.0",
|
61
61
|
"@tanstack/react-table": "^8.20.5",
|
@@ -128,5 +128,6 @@
|
|
128
128
|
"Firefox ESR",
|
129
129
|
"not ie < 11"
|
130
130
|
]
|
131
|
-
}
|
131
|
+
},
|
132
|
+
"gitHead": "638edb075ce8c92504a00b29d1667dfd0069bd3c"
|
132
133
|
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { DialogProps } from '../../../Dialog/Dialog';
|
3
|
-
declare type DiscardChangesConfirmationDialogProps = Partial<DialogProps> & {
|
4
|
-
onDiscard: () => void;
|
5
|
-
};
|
6
|
-
export declare function DiscardChangesConfirmationDialog(props: DiscardChangesConfirmationDialogProps): JSX.Element;
|
7
|
-
export {};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';
|
3
|
-
import { Table3EditingCreateHandler } from '../../../types';
|
4
|
-
import { TableRef } from '../../../../../primitives/Table/types';
|
5
|
-
declare type CreateNewRowProps<TType = unknown> = {
|
6
|
-
buttonRef: React.Ref<HTMLButtonElement>;
|
7
|
-
onEditingCreate?: Table3EditingCreateHandler<TType>;
|
8
|
-
table: ReactTable<TType>;
|
9
|
-
tableMeta: ReactTableMeta<TType>;
|
10
|
-
tableRef: React.RefObject<TableRef>;
|
11
|
-
};
|
12
|
-
export declare function CreateNewRow<TType = unknown>(props: CreateNewRowProps<TType>): JSX.Element;
|
13
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';
|
3
|
-
import { TableRef } from '../../../../../primitives/Table/types';
|
4
|
-
declare type TemporaryRowProps<TType = unknown> = {
|
5
|
-
buttonRef: React.RefObject<HTMLButtonElement>;
|
6
|
-
rowIdentityAccessor: string;
|
7
|
-
table: ReactTable<TType>;
|
8
|
-
tableMeta: ReactTableMeta<TType>;
|
9
|
-
tableRef: React.RefObject<TableRef>;
|
10
|
-
};
|
11
|
-
export declare function TemporaryRow<TType = unknown>(props: TemporaryRowProps<TType>): JSX.Element;
|
12
|
-
export {};
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { Table as ReactTable, Cell as ReactTableCell } from '@tanstack/react-table';
|
2
|
-
import { Table3EditingChangeHandler, Table3EditingSaveHandler, Table3EditingValidatorFn } from '../types';
|
3
|
-
export declare const TEMPORARY_ROW_ID_PREFIX = "temp-";
|
4
|
-
declare type EditingSaveState = 'saving' | 'saved' | 'errored';
|
5
|
-
export declare function usePendingChangesState<TType = unknown>(handleSave: Table3EditingSaveHandler<TType> | undefined, handleChange: Table3EditingChangeHandler<TType> | undefined, rowIdentityAccessor: keyof TType, validator: Table3EditingValidatorFn<TType> | undefined): {
|
6
|
-
setRowValue: <T extends TType>(rowId: string, original: T, value: Partial<T>) => Promise<void>;
|
7
|
-
getRowValue: (rowId: string) => any;
|
8
|
-
getRowMoveReason: (rowId: string) => unknown;
|
9
|
-
hasRowErrors: (rowId: string) => boolean;
|
10
|
-
hasRowErrorsShownInAlert: (rowId: string) => boolean;
|
11
|
-
getRowStatus: (rowId: string) => any;
|
12
|
-
setRowStatus: (rowId: string, status: EditingSaveState | undefined) => void;
|
13
|
-
setCellValue: <T_1 extends TType>(cell: ReactTableCell<T_1, unknown>, value: unknown) => void;
|
14
|
-
getCellValue: <T_2 extends TType>(cell: ReactTableCell<T_2, unknown>) => unknown | undefined;
|
15
|
-
getCellError: <T_3 extends TType>(cell: ReactTableCell<T_3, unknown>) => string | undefined;
|
16
|
-
onCellChanged: <T_4 extends TType>(cell: ReactTableCell<T_4, unknown>, rowIndex: number) => Promise<void>;
|
17
|
-
getErrorsShownInAlert: <T_5 extends TType>() => {
|
18
|
-
rowId: string;
|
19
|
-
changes: Partial<T_5>;
|
20
|
-
errors: any;
|
21
|
-
}[];
|
22
|
-
hasChanges: (rowId?: string | undefined) => boolean;
|
23
|
-
saveChanges: <T_6 extends TType>(table: ReactTable<T_6>, rowId?: string | undefined) => Promise<boolean>;
|
24
|
-
discardChanges: <T_7 extends TType>(rowId: string, table: ReactTable<T_7>) => void;
|
25
|
-
hasSaved: () => boolean;
|
26
|
-
createRow: <T_8 extends TType>(data: Partial<T_8>) => Promise<string>;
|
27
|
-
temporaryRows: any;
|
28
|
-
};
|
29
|
-
export {};
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { useLocalization } from '../../../Provider/Localization.js';
|
3
|
-
import { Button } from '../../../Button/Button.js';
|
4
|
-
import { Dialog } from '../../../Dialog/Dialog.js';
|
5
|
-
import { Group } from '../../../Group/Group.js';
|
6
|
-
|
7
|
-
function DiscardChangesConfirmationDialog(props) {
|
8
|
-
const {
|
9
|
-
onDiscard: handleDiscard,
|
10
|
-
...dialogProps
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
texts
|
14
|
-
} = useLocalization();
|
15
|
-
const handleClickInsideDialogContent = event => {
|
16
|
-
// Prevents the click event from propagating to the table, ensuring the row isn't saved when a click occurs
|
17
|
-
// inside the dialog
|
18
|
-
event.stopPropagation();
|
19
|
-
};
|
20
|
-
return /*#__PURE__*/React__default.createElement(Dialog, Object.assign({}, dialogProps), /*#__PURE__*/React__default.createElement(Dialog.Content, {
|
21
|
-
"aria-label": texts.table3.editing.clearChangesConfirmationDialog.title,
|
22
|
-
onClick: handleClickInsideDialogContent
|
23
|
-
}, /*#__PURE__*/React__default.createElement(Dialog.Title, null, texts.table3.editing.clearChangesConfirmationDialog.title), /*#__PURE__*/React__default.createElement("p", null, texts.table3.editing.clearChangesConfirmationDialog.description), /*#__PURE__*/React__default.createElement(Dialog.Footer, null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Dialog.Close, null, /*#__PURE__*/React__default.createElement(Button, {
|
24
|
-
tabIndex: 0
|
25
|
-
}, texts.table3.editing.clearChangesConfirmationDialog.cancel)), /*#__PURE__*/React__default.createElement(Dialog.Close, null, /*#__PURE__*/React__default.createElement(Button, {
|
26
|
-
autoFocus: true,
|
27
|
-
tabIndex: 0,
|
28
|
-
appearance: "primary",
|
29
|
-
onClick: handleDiscard
|
30
|
-
}, texts.table3.editing.clearChangesConfirmationDialog.confirm))))));
|
31
|
-
}
|
32
|
-
|
33
|
-
export { DiscardChangesConfirmationDialog };
|
34
|
-
//# sourceMappingURL=DiscardChangesConfirmationDialog.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DiscardChangesConfirmationDialog.js","sources":["../../../../../../../../../src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { Dialog, DialogProps } from '../../../Dialog/Dialog';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { Group } from '../../../Group/Group';\nimport { Button } from '../../../Button/Button';\n\ntype DiscardChangesConfirmationDialogProps = Partial<DialogProps> & {\n onDiscard: () => void;\n};\n\nexport function DiscardChangesConfirmationDialog(props: DiscardChangesConfirmationDialogProps) {\n const { onDiscard: handleDiscard, ...dialogProps } = props;\n const { texts } = useLocalization();\n\n const handleClickInsideDialogContent = (event: React.MouseEvent) => {\n // Prevents the click event from propagating to the table, ensuring the row isn't saved when a click occurs\n // inside the dialog\n event.stopPropagation();\n };\n\n return (\n <Dialog {...dialogProps}>\n <Dialog.Content\n aria-label={texts.table3.editing.clearChangesConfirmationDialog.title}\n onClick={handleClickInsideDialogContent}>\n <Dialog.Title>{texts.table3.editing.clearChangesConfirmationDialog.title}</Dialog.Title>\n\n <p>{texts.table3.editing.clearChangesConfirmationDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button tabIndex={0}>{texts.table3.editing.clearChangesConfirmationDialog.cancel}</Button>\n </Dialog.Close>\n <Dialog.Close>\n <Button autoFocus tabIndex={0} appearance=\"primary\" onClick={handleDiscard}>\n {texts.table3.editing.clearChangesConfirmationDialog.confirm}\n </Button>\n </Dialog.Close>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["DiscardChangesConfirmationDialog","props","onDiscard","handleDiscard","dialogProps","texts","useLocalization","handleClickInsideDialogContent","event","stopPropagation","React","Dialog","Content","table3","editing","clearChangesConfirmationDialog","title","onClick","Title","description","Footer","Group","Close","Button","tabIndex","cancel","autoFocus","appearance","confirm"],"mappings":";;;;;;SAUgBA,gCAAgCA,CAACC,KAA4C;EACzF,MAAM;IAAEC,SAAS,EAAEC,aAAa;IAAE,GAAGC;GAAa,GAAGH,KAAK;EAC1D,MAAM;IAAEI;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,8BAA8B,GAAIC,KAAuB;;;IAG3DA,KAAK,CAACC,eAAe,EAAE;GAC1B;EAED,oBACIC,6BAACC,MAAM,oBAAKP,WAAW,gBACnBM,6BAACC,MAAM,CAACC,OAAO;kBACCP,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,8BAA8B,CAACC,KAAK;IACrEC,OAAO,EAAEV;kBACTG,6BAACC,MAAM,CAACO,KAAK,QAAEb,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,8BAA8B,CAACC,KAAK,CAAgB,eAExFN,wCAAIL,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,8BAA8B,CAACI,WAAW,CAAK,eAExET,6BAACC,MAAM,CAACS,MAAM,qBACVV,6BAACW,KAAK,qBACFX,6BAACC,MAAM,CAACW,KAAK,qBACTZ,6BAACa,MAAM;IAACC,QAAQ,EAAE;KAAInB,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,8BAA8B,CAACU,MAAM,CAAU,CAC/E,eACff,6BAACC,MAAM,CAACW,KAAK,qBACTZ,6BAACa,MAAM;IAACG,SAAS;IAACF,QAAQ,EAAE,CAAC;IAAEG,UAAU,EAAC,SAAS;IAACV,OAAO,EAAEd;KACxDE,KAAK,CAACQ,MAAM,CAACC,OAAO,CAACC,8BAA8B,CAACa,OAAO,CACvD,CACE,CACX,CACI,CACH,CACZ;AAEjB;;;;"}
|
@@ -1,88 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import { Icon } from '../../../../Icon/Icon.js';
|
3
|
-
import { useLocalization } from '../../../../Provider/Localization.js';
|
4
|
-
import { Button } from '../../../../Button/Button.js';
|
5
|
-
|
6
|
-
function CreateNewRow(props) {
|
7
|
-
var _temporaryRows$0$tabl, _temporaryRows$, _table$getState$colum;
|
8
|
-
const {
|
9
|
-
buttonRef,
|
10
|
-
onEditingCreate: handleEditingCreate,
|
11
|
-
table,
|
12
|
-
tableMeta
|
13
|
-
} = props;
|
14
|
-
const {
|
15
|
-
texts
|
16
|
-
} = useLocalization();
|
17
|
-
const temporaryRows = tableMeta.editing.temporaryRows;
|
18
|
-
const temporaryRowId = (_temporaryRows$0$tabl = (_temporaryRows$ = temporaryRows[0]) === null || _temporaryRows$ === void 0 ? void 0 : _temporaryRows$[tableMeta.rowIdentityAccessor]) !== null && _temporaryRows$0$tabl !== void 0 ? _temporaryRows$0$tabl : '';
|
19
|
-
const isDisabled = !!table.getState().globalFilter || !!((_table$getState$colum = table.getState().columnFilters) !== null && _table$getState$colum !== void 0 && _table$getState$colum.length) || !!temporaryRowId && !!tableMeta.editing.hasRowErrors(temporaryRowId);
|
20
|
-
const isSaving = !!temporaryRowId && tableMeta.editing.getRowStatus(temporaryRowId) === 'saving';
|
21
|
-
const handleCreate = function (event) {
|
22
|
-
try {
|
23
|
-
// prevent save being triggered by click outside - TODO: investigate why the button triggers clickoutside
|
24
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
25
|
-
if (!handleEditingCreate || isDisabled) {
|
26
|
-
return Promise.resolve();
|
27
|
-
}
|
28
|
-
return Promise.resolve(tableMeta.editing.saveChanges(table)).then(function (saved) {
|
29
|
-
if (!saved) {
|
30
|
-
return;
|
31
|
-
}
|
32
|
-
try {
|
33
|
-
const changeset = handleEditingCreate();
|
34
|
-
if (changeset) {
|
35
|
-
// change the row before reating because it triggers a save
|
36
|
-
// saving would trigger the validation flow and immediately make the row red
|
37
|
-
tableMeta.rowActive.setRowActiveIndex(-1);
|
38
|
-
requestAnimationFrame(function () {
|
39
|
-
try {
|
40
|
-
tableMeta.editing.toggleEditing(true, table);
|
41
|
-
return Promise.resolve(tableMeta.editing.createRow(changeset)).then(function (rowId) {
|
42
|
-
tableMeta.editing.setLastFocusedCellIndex(0);
|
43
|
-
try {
|
44
|
-
const row = table.getRow(rowId);
|
45
|
-
row.pin('bottom');
|
46
|
-
} catch {
|
47
|
-
//
|
48
|
-
}
|
49
|
-
});
|
50
|
-
} catch (e) {
|
51
|
-
return Promise.reject(e);
|
52
|
-
}
|
53
|
-
});
|
54
|
-
}
|
55
|
-
} catch (error) {
|
56
|
-
console.error(error);
|
57
|
-
}
|
58
|
-
});
|
59
|
-
} catch (e) {
|
60
|
-
return Promise.reject(e);
|
61
|
-
}
|
62
|
-
};
|
63
|
-
let tooltip;
|
64
|
-
if (isSaving) {
|
65
|
-
tooltip = texts.table3.editing.buttons.create.saving;
|
66
|
-
} else if (isDisabled) {
|
67
|
-
tooltip = texts.table3.editing.buttons.create.disabled;
|
68
|
-
}
|
69
|
-
return /*#__PURE__*/React__default.createElement("tr", {
|
70
|
-
"data-row-create": true,
|
71
|
-
className: "border-grey-300 group/row",
|
72
|
-
tabIndex: -1
|
73
|
-
}, /*#__PURE__*/React__default.createElement("td", {
|
74
|
-
className: "!bg-grey-50 col-span-full !border-b-0 !px-1"
|
75
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
76
|
-
appearance: "transparent",
|
77
|
-
className: "group-hover:bg-grey-200 sticky left-[4px]",
|
78
|
-
disabled: isDisabled,
|
79
|
-
onClick: handleCreate,
|
80
|
-
ref: buttonRef,
|
81
|
-
tooltip: tooltip
|
82
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
83
|
-
name: "circle-plus"
|
84
|
-
}), texts.table3.editing.buttons.create.label)));
|
85
|
-
}
|
86
|
-
|
87
|
-
export { CreateNewRow };
|
88
|
-
//# sourceMappingURL=CreateNewRow.js.map
|
package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CreateNewRow.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/CreateNewRow.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { Button } from '../../../../Button/Button';\nimport { useLocalization } from '../../../../Provider/Localization';\nimport { Icon } from '../../../../Icon/Icon';\nimport { Table3EditingCreateHandler } from '../../../types';\nimport { TableRef } from '../../../../../primitives/Table/types';\n\ntype CreateNewRowProps<TType = unknown> = {\n buttonRef: React.Ref<HTMLButtonElement>;\n onEditingCreate?: Table3EditingCreateHandler<TType>;\n table: ReactTable<TType>;\n tableMeta: ReactTableMeta<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function CreateNewRow<TType = unknown>(props: CreateNewRowProps<TType>) {\n const { buttonRef, onEditingCreate: handleEditingCreate, table, tableMeta } = props;\n const { texts } = useLocalization();\n\n const temporaryRows = tableMeta.editing.temporaryRows as TType[];\n const temporaryRowId: string = temporaryRows[0]?.[tableMeta.rowIdentityAccessor as string] ?? '';\n\n const isDisabled =\n !!table.getState().globalFilter ||\n !!table.getState().columnFilters?.length ||\n (!!temporaryRowId && !!tableMeta.editing.hasRowErrors(temporaryRowId));\n const isSaving = !!temporaryRowId && tableMeta.editing.getRowStatus(temporaryRowId) === 'saving';\n\n const handleCreate = async event => {\n // prevent save being triggered by click outside - TODO: investigate why the button triggers clickoutside\n event?.stopPropagation();\n\n if (!handleEditingCreate || isDisabled) {\n return;\n }\n\n const saved = await tableMeta.editing.saveChanges(table);\n\n if (!saved) {\n return;\n }\n\n try {\n const changeset = handleEditingCreate();\n\n if (changeset) {\n // change the row before reating because it triggers a save\n // saving would trigger the validation flow and immediately make the row red\n tableMeta.rowActive.setRowActiveIndex(-1);\n\n requestAnimationFrame(async () => {\n tableMeta.editing.toggleEditing(true, table);\n const rowId = await tableMeta.editing.createRow(changeset);\n tableMeta.editing.setLastFocusedCellIndex(0);\n\n try {\n const row = table.getRow(rowId);\n row.pin('bottom');\n } catch {\n //\n }\n });\n }\n } catch (error) {\n console.error(error);\n }\n };\n\n let tooltip;\n\n if (isSaving) {\n tooltip = texts.table3.editing.buttons.create.saving;\n } else if (isDisabled) {\n tooltip = texts.table3.editing.buttons.create.disabled;\n }\n\n return (\n <tr data-row-create className=\"border-grey-300 group/row\" tabIndex={-1}>\n <td className=\"!bg-grey-50 col-span-full !border-b-0 !px-1\">\n <Button\n appearance=\"transparent\"\n className=\"group-hover:bg-grey-200 sticky left-[4px]\"\n disabled={isDisabled}\n onClick={handleCreate}\n ref={buttonRef}\n tooltip={tooltip}>\n <Icon name=\"circle-plus\" />\n {texts.table3.editing.buttons.create.label}\n </Button>\n </td>\n </tr>\n );\n}\n"],"names":["CreateNewRow","props","buttonRef","onEditingCreate","handleEditingCreate","table","tableMeta","texts","useLocalization","temporaryRows","editing","temporaryRowId","_temporaryRows$0$tabl","_temporaryRows$","rowIdentityAccessor","isDisabled","getState","globalFilter","_table$getState$colum","columnFilters","length","hasRowErrors","isSaving","getRowStatus","handleCreate","event","stopPropagation","Promise","resolve","saveChanges","then","saved","changeset","rowActive","setRowActiveIndex","requestAnimationFrame","toggleEditing","createRow","rowId","setLastFocusedCellIndex","row","getRow","pin","e","reject","error","console","tooltip","table3","buttons","create","saving","disabled","React","className","tabIndex","Button","appearance","onClick","ref","Icon","name","label"],"mappings":";;;;;SAgBgBA,YAAYA,CAAkBC,KAA+B;;EACzE,MAAM;IAAEC,SAAS;IAAEC,eAAe,EAAEC,mBAAmB;IAAEC,KAAK;IAAEC;GAAW,GAAGL,KAAK;EACnF,MAAM;IAAEM;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,aAAa,GAAGH,SAAS,CAACI,OAAO,CAACD,aAAwB;EAChE,MAAME,cAAc,IAAAC,qBAAA,IAAAC,eAAA,GAAWJ,aAAa,CAAC,CAAC,CAAC,cAAAI,eAAA,uBAAhBA,eAAA,CAAmBP,SAAS,CAACQ,mBAA6B,CAAC,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,EAAE;EAEhG,MAAMG,UAAU,GACZ,CAAC,CAACV,KAAK,CAACW,QAAQ,EAAE,CAACC,YAAY,IAC/B,CAAC,GAAAC,qB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A;gBAAA,OAAAhB,OAAA,CAAAiB,MAAA,CAAAD,CAAA;;cAAC;;SAET,CAAC,OAAOE,KAAK,EAAE;UACZC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;;;KAE3B,QAAAF,CAAA;MAAA,OAAAhB,OAAA,CAAAiB,MAAA,CAAAD,CAAA;;;EAED,IAAII,OAAO;EAEX,IAAIzB,QAAQ,EAAE;IACVyB,OAAO,GAAGxC,KAAK,CAACyC,MAAM,CAACtC,OAAO,CAACuC,OAAO,CAACC,MAAM,CAACC,MAAM;GACvD,MAAM,IAAIpC,UAAU,EAAE;IACnBgC,OAAO,GAAGxC,KAAK,CAACyC,MAAM,CAACtC,OAAO,CAACuC,OAAO,CAACC,MAAM,CAACE,QAAQ;;EAG1D,oBACIC;;IAAoBC,SAAS,EAAC,2BAA2B;IAACC,QAAQ,EAAE,CAAC;kBACjEF;IAAIC,SAAS,EAAC;kBACVD,6BAACG,MAAM;IACHC,UAAU,EAAC,aAAa;IACxBH,SAAS,EAAC,2CAA2C;IACrDF,QAAQ,EAAErC,UAAU;IACpB2C,OAAO,EAAElC,YAAY;IACrBmC,GAAG,EAAEzD,SAAS;IACd6C,OAAO,EAAEA;kBACTM,6BAACO,IAAI;IAACC,IAAI,EAAC;IAAgB,EAC1BtD,KAAK,CAACyC,MAAM,CAACtC,OAAO,CAACuC,OAAO,CAACC,MAAM,CAACY,KAAK,CACrC,CACR,CACJ;AAEb;;;;"}
|
@@ -1,93 +0,0 @@
|
|
1
|
-
import React__default from 'react';
|
2
|
-
import cn from 'clsx';
|
3
|
-
import { isElementTriggeredFromContainer } from '../../../../../utils/dom.js';
|
4
|
-
import { Row } from '../../../../../primitives/Table/Core/components/Row/Row.js';
|
5
|
-
import { DiscardChangesConfirmationDialog } from '../../Editing/DiscardChangesConfirmationDialog.js';
|
6
|
-
import { RENDERERS } from '../../../useTable3.js';
|
7
|
-
|
8
|
-
function TemporaryRow(props) {
|
9
|
-
var _tableRef$current, _tableRef$current2;
|
10
|
-
const {
|
11
|
-
buttonRef,
|
12
|
-
rowIdentityAccessor,
|
13
|
-
table,
|
14
|
-
tableMeta,
|
15
|
-
tableRef
|
16
|
-
} = props;
|
17
|
-
const temporaryRows = tableMeta.editing.temporaryRows;
|
18
|
-
// discard new row
|
19
|
-
const [showDiscardDialog, setShowDiscardDialog] = React__default.useState(false);
|
20
|
-
function handleDiscard() {
|
21
|
-
if (temporaryRows[0]) {
|
22
|
-
var _buttonRef$current;
|
23
|
-
tableMeta.editing.discardChanges(temporaryRows[0][rowIdentityAccessor], table);
|
24
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
|
25
|
-
}
|
26
|
-
}
|
27
|
-
const handleKeyDown = function (event) {
|
28
|
-
try {
|
29
|
-
const _temp2 = function () {
|
30
|
-
if (event.key === 'ArrowDown') {
|
31
|
-
event.preventDefault();
|
32
|
-
const _temp = function () {
|
33
|
-
if (!isElementTriggeredFromContainer(event.target, event.currentTarget)) {
|
34
|
-
return Promise.resolve(tableMeta.editing.saveChanges(table)).then(function (saved) {
|
35
|
-
if (saved) {
|
36
|
-
var _buttonRef$current2;
|
37
|
-
(_buttonRef$current2 = buttonRef.current) === null || _buttonRef$current2 === void 0 ? void 0 : _buttonRef$current2.focus();
|
38
|
-
}
|
39
|
-
});
|
40
|
-
}
|
41
|
-
}();
|
42
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
43
|
-
} else if (event.key === 'ArrowUp') {
|
44
|
-
event.preventDefault();
|
45
|
-
event.stopPropagation();
|
46
|
-
}
|
47
|
-
}();
|
48
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
49
|
-
} catch (e) {
|
50
|
-
return Promise.reject(e);
|
51
|
-
}
|
52
|
-
};
|
53
|
-
const handleKeyDownCapture = event => {
|
54
|
-
if (event.key === 'Escape') {
|
55
|
-
event.preventDefault();
|
56
|
-
event.stopPropagation();
|
57
|
-
setShowDiscardDialog(true);
|
58
|
-
} else if (event.key === 'ArrowLeft' && tableMeta.editing.lastFocusedCellIndex === 0) {
|
59
|
-
event.preventDefault();
|
60
|
-
event.stopPropagation();
|
61
|
-
} else if (event.key === 'ArrowRight' && tableMeta.editing.lastFocusedCellIndex) {
|
62
|
-
if (tableMeta.editing.lastFocusedCellIndex === table.getVisibleFlatColumns().length - 1) {
|
63
|
-
event.preventDefault();
|
64
|
-
event.stopPropagation();
|
65
|
-
}
|
66
|
-
}
|
67
|
-
};
|
68
|
-
const isScrolled = tableRef.current ? ((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.scrollHeight) > ((_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : _tableRef$current2.clientHeight) : false;
|
69
|
-
const className = cn('group/row border-grey-300 !sticky z-[21]', {
|
70
|
-
'bottom-20': tableMeta.footer.isEnabled,
|
71
|
-
'bottom-10': !tableMeta.footer.isEnabled,
|
72
|
-
'border-b border-t-2 shadow-[0px_-5px_20px_0px_rgba(0,0,0,0.1)] border-t-grey-500/[0.5]': isScrolled
|
73
|
-
});
|
74
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, table.getBottomRows().map(row => (/*#__PURE__*/React__default.createElement(Row, {
|
75
|
-
key: row.id,
|
76
|
-
cellRenderer: RENDERERS.cell,
|
77
|
-
index: -1,
|
78
|
-
measureRow: () => null,
|
79
|
-
renderer: RENDERERS.row,
|
80
|
-
row: row,
|
81
|
-
table: table,
|
82
|
-
className: className,
|
83
|
-
onKeyDown: handleKeyDown,
|
84
|
-
onKeyDownCapture: handleKeyDownCapture
|
85
|
-
}))), /*#__PURE__*/React__default.createElement(DiscardChangesConfirmationDialog, {
|
86
|
-
open: showDiscardDialog,
|
87
|
-
onChange: setShowDiscardDialog,
|
88
|
-
onDiscard: handleDiscard
|
89
|
-
}));
|
90
|
-
}
|
91
|
-
|
92
|
-
export { TemporaryRow };
|
93
|
-
//# sourceMappingURL=TemporaryRow.js.map
|
package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TemporaryRow.js","sources":["../../../../../../../../../../src/components/Table3/components/Row/Editing/TemporaryRow.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport clsx from 'clsx';\nimport { Row } from '../../../../../primitives/Table/Core/components/Row/Row';\nimport { RENDERERS } from '../../../useTable3';\nimport { isElementTriggeredFromContainer } from '../../../../../utils/dom';\nimport { DiscardChangesConfirmationDialog } from '../../Editing/DiscardChangesConfirmationDialog';\nimport { TableRef } from '../../../../../primitives/Table/types';\n\ntype TemporaryRowProps<TType = unknown> = {\n buttonRef: React.RefObject<HTMLButtonElement>;\n rowIdentityAccessor: string;\n table: ReactTable<TType>;\n tableMeta: ReactTableMeta<TType>;\n tableRef: React.RefObject<TableRef>;\n};\n\nexport function TemporaryRow<TType = unknown>(props: TemporaryRowProps<TType>) {\n const { buttonRef, rowIdentityAccessor, table, tableMeta, tableRef } = props;\n const temporaryRows = tableMeta.editing.temporaryRows as TType[];\n\n // discard new row\n const [showDiscardDialog, setShowDiscardDialog] = React.useState(false);\n\n function handleDiscard() {\n if (temporaryRows[0]) {\n tableMeta.editing.discardChanges(temporaryRows[0][rowIdentityAccessor], table);\n buttonRef.current?.focus();\n }\n }\n\n const handleKeyDown = async (event: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!isElementTriggeredFromContainer(event.target as Element, event.currentTarget)) {\n const saved = await tableMeta.editing.saveChanges(table);\n\n if (saved) {\n buttonRef.current?.focus();\n }\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n const handleKeyDownCapture = (event: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n setShowDiscardDialog(true);\n } else if (event.key === 'ArrowLeft' && tableMeta.editing.lastFocusedCellIndex === 0) {\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === 'ArrowRight' && tableMeta.editing.lastFocusedCellIndex) {\n if (tableMeta.editing.lastFocusedCellIndex === table.getVisibleFlatColumns().length - 1) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n };\n\n const isScrolled = tableRef.current ? tableRef.current?.scrollHeight > tableRef.current?.clientHeight : false;\n const className = clsx('group/row border-grey-300 !sticky z-[21]', {\n 'bottom-20': tableMeta.footer.isEnabled,\n 'bottom-10': !tableMeta.footer.isEnabled,\n 'border-b border-t-2 shadow-[0px_-5px_20px_0px_rgba(0,0,0,0.1)] border-t-grey-500/[0.5]': isScrolled,\n });\n return (\n <>\n {table.getBottomRows().map(row => (\n <Row<TType>\n key={row.id}\n cellRenderer={RENDERERS.cell}\n index={-1}\n measureRow={() => null}\n renderer={RENDERERS.row}\n row={row}\n table={table}\n className={className}\n onKeyDown={handleKeyDown}\n onKeyDownCapture={handleKeyDownCapture}\n />\n ))}\n <DiscardChangesConfirmationDialog\n open={showDiscardDialog}\n onChange={setShowDiscardDialog}\n onDiscard={handleDiscard}\n />\n </>\n );\n}\n"],"names":["TemporaryRow","props","buttonRef","rowIdentityAccessor","table","tableMeta","tableRef","temporaryRows","editing","showDiscardDialog","setShowDiscardDialog","React","useState","handleDiscard","_buttonRef$current","discardChanges","current","focus","handleKeyDown","event","key","preventDefault","_temp","isElementTriggeredFromContainer","target","currentTarget","Promise","resolve","saveChanges","then","saved","_buttonRef$current2","stopPropagation","_temp2","e","reject","handleKeyDownCapture","lastFocusedCellIndex","getVisibleFlatColumns","length","isScrolled","_tableRef$current","scrollHeight","_tableRef$current2","clientHeight","className","clsx","footer","isEnabled","getBottomRows","map","row","Row","id","cellRenderer","RENDERERS","cell","index","measureRow","renderer","onKeyDown","onKeyDownCapture","DiscardChangesConfirmationDialog","open","onChange","onDiscard"],"mappings":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