@servicetitan/anvil2 2.3.0 → 2.5.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/CHANGELOG.md +26 -0
- package/dist/{Combobox-B6saoDAP.js → Combobox-Drqb3GVU.js} +2 -2
- package/dist/{Combobox-B6saoDAP.js.map → Combobox-Drqb3GVU.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-NzX8SCYT.js → DataTable-BLuJ4FtH.js} +272 -42
- package/dist/DataTable-BLuJ4FtH.js.map +1 -0
- package/dist/{DateFieldRange-DgGgNSzN.js → DateFieldRange-CvlOeE4v.js} +2 -2
- package/dist/{DateFieldRange-DgGgNSzN.js.map → DateFieldRange-CvlOeE4v.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BR4nJNVl.js → DateFieldSingle-9UHxIxIA.js} +2 -2
- package/dist/{DateFieldSingle-BR4nJNVl.js.map → DateFieldSingle-9UHxIxIA.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-mqvM2uVP.js → DateFieldYearless-HNydELvO.js} +2 -2
- package/dist/{DateFieldYearless-mqvM2uVP.js.map → DateFieldYearless-HNydELvO.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-CLuyUoGF.js → DateFieldYearlessRange-COb8v2CG.js} +2 -2
- package/dist/{DateFieldYearlessRange-CLuyUoGF.js.map → DateFieldYearlessRange-COb8v2CG.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{Dialog-yA2jYtgv.js → Dialog-DEAR058v.js} +2 -2
- package/dist/{Dialog-yA2jYtgv.js.map → Dialog-DEAR058v.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Drawer-Dt4dqAxQ.js → Drawer-CnMskBQl.js} +2 -2
- package/dist/{Drawer-Dt4dqAxQ.js.map → Drawer-CnMskBQl.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.js +1 -1
- package/dist/{FieldDialog-BghhsL2B.js → FieldDialog-C5mwMjrr.js} +2 -2
- package/dist/{FieldDialog-BghhsL2B.js.map → FieldDialog-C5mwMjrr.js.map} +1 -1
- package/dist/List-CX-BrNX5.js +101 -0
- package/dist/List-CX-BrNX5.js.map +1 -0
- package/dist/List.css +67 -0
- package/dist/List.d.ts +6 -0
- package/dist/List.js +2 -0
- package/dist/List.js.map +1 -0
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-ChDuxvhE.js → MultiSelectFieldSync-BnPzYM72.js} +2 -2
- package/dist/{MultiSelectFieldSync-ChDuxvhE.js.map → MultiSelectFieldSync-BnPzYM72.js.map} +1 -1
- package/dist/{Page-CkcnGPPK.js → Page-qOkG6psI.js} +4 -4
- package/dist/{Page-CkcnGPPK.js.map → Page-qOkG6psI.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-DO9NORlw.js → Pagination-BuiyhZlJ.js} +11 -4
- package/dist/Pagination-BuiyhZlJ.js.map +1 -0
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-D_BmwIOW.js → Popover-CYWYCj7l.js} +2 -2
- package/dist/{Popover-D_BmwIOW.js.map → Popover-CYWYCj7l.js.map} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-DfP3eETZ.js → SelectFieldSync-DCrafdbx.js} +2 -2
- package/dist/{SelectFieldSync-DfP3eETZ.js.map → SelectFieldSync-DCrafdbx.js.map} +1 -1
- package/dist/{Tab-CeXt6A_D.js → Tab-DXivEqur.js} +47 -6
- package/dist/Tab-DXivEqur.js.map +1 -0
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{TimeField-CbdxhawY.js → TimeField-DREFzFkw.js} +2 -2
- package/dist/{TimeField-CbdxhawY.js.map → TimeField-DREFzFkw.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/{Toolbar-4VdevLJd.js → Toolbar-jfZ-CupZ.js} +7 -7
- package/dist/{Toolbar-4VdevLJd.js.map → Toolbar-jfZ-CupZ.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{YearlessDateInputWithPicker-BADNBDmy.js → YearlessDateInputWithPicker-mW5KykHZ.js} +2 -2
- package/dist/{YearlessDateInputWithPicker-BADNBDmy.js.map → YearlessDateInputWithPicker-mW5KykHZ.js.map} +1 -1
- package/dist/assets/icons/st/ai_chat.svg +1 -0
- package/dist/assets/icons/st/ai_edit.svg +1 -0
- package/dist/assets/icons/st/ai_form.svg +1 -0
- package/dist/assets/icons/st/ai_mic.svg +1 -0
- package/dist/assets/icons/st/ai_search.svg +1 -0
- package/dist/assets/icons/st.ts +5 -0
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +12 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableBooleanCell.d.ts +7 -0
- package/dist/beta/components/Table/DataTable/internal/util/getTanStackColumnDef.d.ts +4 -0
- package/dist/beta/components/Table/createColumnHelper.d.ts +18 -7
- package/dist/beta/components/Table/types.d.ts +44 -3
- package/dist/beta.js +5 -5
- package/dist/components/Divider/Divider.figma.d.ts +1 -0
- package/dist/components/List/List.d.ts +67 -0
- package/dist/components/List/ListItem.d.ts +7 -0
- package/dist/components/List/index.d.ts +4 -0
- package/dist/components/Pagination/Pagination.d.ts +3 -0
- package/dist/components/Pagination/internal/PaginationItemsPerPageMenu.d.ts +5 -0
- package/dist/components/Tab/Tab.d.ts +41 -2
- package/dist/components/Tab/internal/TabContext.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/{index.esm-BZV0wNKZ.js → index.esm-K9kxJhLx.js} +2 -1
- package/dist/{index.esm-BZV0wNKZ.js.map → index.esm-K9kxJhLx.js.map} +1 -1
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/internal/components/ManualTestLayout/ManualTestLayout.d.ts +16 -0
- package/dist/internal/components/ManualTestLayout/index.d.ts +1 -0
- package/dist/internal/components/index.d.ts +1 -0
- package/dist/{useDrilldown-C8TRwNE9.js → useDrilldown-hUxMOdnz.js} +2 -2
- package/dist/{useDrilldown-C8TRwNE9.js.map → useDrilldown-hUxMOdnz.js.map} +1 -1
- package/dist/{useInitialFocus-CdoVwSbr.js → useInitialFocus-BRRbylek.js} +2 -2
- package/dist/{useInitialFocus-CdoVwSbr.js.map → useInitialFocus-BRRbylek.js.map} +1 -1
- package/package.json +3 -3
- package/dist/DataTable-NzX8SCYT.js.map +0 -1
- package/dist/Pagination-DO9NORlw.js.map +0 -1
- package/dist/Tab-CeXt6A_D.js.map +0 -1
package/dist/Combobox.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as Combobox, a as ComboboxElement, c as ComboboxList, b as ComboboxSelect, C as default } from './Combobox-
|
|
1
|
+
export { C as Combobox, a as ComboboxElement, c as ComboboxList, b as ComboboxSelect, C as default } from './Combobox-Drqb3GVU.js';
|
|
2
2
|
export { u as useInfiniteCombobox } from './useInfiniteCombobox-WcRgC9p6.js';
|
|
3
3
|
//# sourceMappingURL=Combobox.js.map
|
|
@@ -15,7 +15,7 @@ import { S as SrOnly } from './SrOnly-CrdBTl6E.js';
|
|
|
15
15
|
import { u as useNumberField } from './useNumberField-eMyk7MB8.js';
|
|
16
16
|
import { u as useMergeRefs, m as mergeRefs } from './useMergeRefs-Dfmtq9cI.js';
|
|
17
17
|
import { M as Menu } from './Menu-CpRnsr0v.js';
|
|
18
|
-
import { P as Popover } from './Popover-
|
|
18
|
+
import { P as Popover } from './Popover-CYWYCj7l.js';
|
|
19
19
|
import { S as SearchField } from './SearchField-CtdtcrVV.js';
|
|
20
20
|
import { L as ListView } from './ListView-CN8zu-cq.js';
|
|
21
21
|
import { S as SvgError } from './error-DR_wWdYY.js';
|
|
@@ -23,7 +23,7 @@ import { T as Tooltip } from './Tooltip-Bt62hC5J.js';
|
|
|
23
23
|
import { flushSync } from 'react-dom';
|
|
24
24
|
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';
|
|
25
25
|
import './anvil-fonts.css';import './DataTable.css';/* empty css */
|
|
26
|
-
import { P as Pagination } from './Pagination-
|
|
26
|
+
import { P as Pagination } from './Pagination-BuiyhZlJ.js';
|
|
27
27
|
import { T as ThemeProviderContext } from './ThemeProviderContext-l52GohYT.js';
|
|
28
28
|
import { S as Spinner } from './Spinner-CpEm3Lud.js';
|
|
29
29
|
import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
|
|
@@ -4163,34 +4163,19 @@ function DataTableEditableTextCellInner(props, ref) {
|
|
|
4163
4163
|
const columnId = getColumnId(cell);
|
|
4164
4164
|
const cellValue = getCellValue(cell);
|
|
4165
4165
|
const [initialValue, isValidValueType] = useMemo(() => {
|
|
4166
|
-
let value;
|
|
4167
|
-
let isValid = true;
|
|
4168
4166
|
if (cellValue === void 0 || cellValue === null) {
|
|
4169
|
-
|
|
4170
|
-
isValid = true;
|
|
4171
|
-
return [value, isValid];
|
|
4172
|
-
}
|
|
4173
|
-
switch (typeof cellValue) {
|
|
4174
|
-
case "string":
|
|
4175
|
-
value = cellValue;
|
|
4176
|
-
break;
|
|
4177
|
-
case "boolean":
|
|
4178
|
-
value = String(cellValue);
|
|
4179
|
-
break;
|
|
4180
|
-
default:
|
|
4181
|
-
value = "";
|
|
4182
|
-
isValid = false;
|
|
4183
|
-
break;
|
|
4167
|
+
return ["", true];
|
|
4184
4168
|
}
|
|
4185
|
-
if (
|
|
4186
|
-
|
|
4187
|
-
columnId: String(columnId),
|
|
4188
|
-
editMode: "text",
|
|
4189
|
-
expectedType: "string",
|
|
4190
|
-
receivedType: Array.isArray(cellValue) ? "array" : typeof cellValue
|
|
4191
|
-
});
|
|
4169
|
+
if (typeof cellValue === "string") {
|
|
4170
|
+
return [cellValue, true];
|
|
4192
4171
|
}
|
|
4193
|
-
|
|
4172
|
+
logWarningForInvalidCellValueType({
|
|
4173
|
+
columnId: String(columnId),
|
|
4174
|
+
editMode: "text",
|
|
4175
|
+
expectedType: "string",
|
|
4176
|
+
receivedType: Array.isArray(cellValue) ? "array" : typeof cellValue
|
|
4177
|
+
});
|
|
4178
|
+
return ["", false];
|
|
4194
4179
|
}, [cellValue, columnId]);
|
|
4195
4180
|
const [draftValue, setDraftValue] = useState(initialValue);
|
|
4196
4181
|
const [tabIndex, setTabIndex] = useState(-1);
|
|
@@ -5022,6 +5007,231 @@ const DataTableEditableMultiselectCell = Object.assign(
|
|
|
5022
5007
|
{ displayName: "DataTableEditableMultiselectCell" }
|
|
5023
5008
|
);
|
|
5024
5009
|
|
|
5010
|
+
function DataTableEditableBooleanCellInner(props, ref) {
|
|
5011
|
+
const { cell, cellProps, cellPosition, children } = props;
|
|
5012
|
+
const { onKeyDown: onCellKeyDown } = cellProps;
|
|
5013
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
5014
|
+
const columnId = getColumnId(cell);
|
|
5015
|
+
const cellValue = getCellValue(cell);
|
|
5016
|
+
const [initialValue, isValidValueType] = useMemo(() => {
|
|
5017
|
+
let value;
|
|
5018
|
+
let isValid = true;
|
|
5019
|
+
if (cellValue === void 0 || cellValue === null) {
|
|
5020
|
+
value = null;
|
|
5021
|
+
isValid = true;
|
|
5022
|
+
return [value, isValid];
|
|
5023
|
+
}
|
|
5024
|
+
if (typeof cellValue === "boolean") {
|
|
5025
|
+
value = cellValue;
|
|
5026
|
+
} else {
|
|
5027
|
+
value = null;
|
|
5028
|
+
isValid = false;
|
|
5029
|
+
}
|
|
5030
|
+
if (!isValid) {
|
|
5031
|
+
logWarningForInvalidCellValueType({
|
|
5032
|
+
columnId: String(columnId),
|
|
5033
|
+
editMode: "boolean",
|
|
5034
|
+
expectedType: "boolean",
|
|
5035
|
+
receivedType: Array.isArray(cellValue) ? "array" : typeof cellValue
|
|
5036
|
+
});
|
|
5037
|
+
}
|
|
5038
|
+
return [value, isValid];
|
|
5039
|
+
}, [cellValue, columnId]);
|
|
5040
|
+
const options = useMemo(() => {
|
|
5041
|
+
const editConfig = cell.column.columnDef.meta?.editConfig;
|
|
5042
|
+
const config = editConfig?.mode === "boolean" ? editConfig : {
|
|
5043
|
+
trueLabel: void 0,
|
|
5044
|
+
falseLabel: void 0,
|
|
5045
|
+
allowNull: false,
|
|
5046
|
+
nullLabel: void 0
|
|
5047
|
+
};
|
|
5048
|
+
const typeConfig = cell.column.columnDef.meta?.columnDef?.type;
|
|
5049
|
+
const typeOptions = typeof typeConfig === "object" && typeConfig.type === "boolean" ? typeConfig.options : void 0;
|
|
5050
|
+
const items = [
|
|
5051
|
+
{
|
|
5052
|
+
value: true,
|
|
5053
|
+
label: config.trueLabel ?? typeOptions?.trueLabel ?? "True"
|
|
5054
|
+
},
|
|
5055
|
+
{
|
|
5056
|
+
value: false,
|
|
5057
|
+
label: config.falseLabel ?? typeOptions?.falseLabel ?? "False"
|
|
5058
|
+
}
|
|
5059
|
+
];
|
|
5060
|
+
if (config.allowNull) {
|
|
5061
|
+
items.push({ value: null, label: config.nullLabel ?? "Unset" });
|
|
5062
|
+
}
|
|
5063
|
+
return items;
|
|
5064
|
+
}, [
|
|
5065
|
+
cell.column.columnDef.meta?.editConfig,
|
|
5066
|
+
cell.column.columnDef.meta?.columnDef?.type
|
|
5067
|
+
]);
|
|
5068
|
+
const [tabIndex, setTabIndex] = useState(-1);
|
|
5069
|
+
const { moveFocusToCell } = useDTFocusDispatchContext();
|
|
5070
|
+
const cellRef = useRef(null);
|
|
5071
|
+
const rowId = cell.row.id;
|
|
5072
|
+
const menuElement = useRef(null);
|
|
5073
|
+
useImperativeHandle(ref, () => ({
|
|
5074
|
+
invoke: beginEditing,
|
|
5075
|
+
focus: () => {
|
|
5076
|
+
cellRef.current?.focus();
|
|
5077
|
+
setTabIndex(0);
|
|
5078
|
+
}
|
|
5079
|
+
}));
|
|
5080
|
+
const beginEditing = useCallback(() => {
|
|
5081
|
+
setIsEditing(true);
|
|
5082
|
+
}, [setIsEditing]);
|
|
5083
|
+
const stopEditing = useCallback(() => {
|
|
5084
|
+
setIsEditing(false);
|
|
5085
|
+
}, [setIsEditing]);
|
|
5086
|
+
const onChange = getCellOnChange(cell);
|
|
5087
|
+
const commitValue = useCallback(
|
|
5088
|
+
(value) => {
|
|
5089
|
+
if (value !== initialValue) {
|
|
5090
|
+
onChange?.(value, rowId);
|
|
5091
|
+
}
|
|
5092
|
+
stopEditing();
|
|
5093
|
+
},
|
|
5094
|
+
[rowId, onChange, initialValue, stopEditing]
|
|
5095
|
+
);
|
|
5096
|
+
const cellClasses = cx(
|
|
5097
|
+
styles$a["data-table-body-cell-editable"],
|
|
5098
|
+
cellProps.className,
|
|
5099
|
+
{ [styles$9["data-table-body-cell-editing"]]: isEditing }
|
|
5100
|
+
);
|
|
5101
|
+
const handleCellKeyDown = useCallback(
|
|
5102
|
+
(event, handleMenuKeydown) => {
|
|
5103
|
+
if (isEditing) {
|
|
5104
|
+
if (event.key === "Escape" || event.key === "F2") {
|
|
5105
|
+
stopEditing();
|
|
5106
|
+
return;
|
|
5107
|
+
}
|
|
5108
|
+
handleMenuKeydown?.(event);
|
|
5109
|
+
return;
|
|
5110
|
+
}
|
|
5111
|
+
onCellKeyDown?.(event);
|
|
5112
|
+
},
|
|
5113
|
+
[onCellKeyDown, isEditing, stopEditing]
|
|
5114
|
+
);
|
|
5115
|
+
const handleOutsidePress = useCallback(() => {
|
|
5116
|
+
stopEditing();
|
|
5117
|
+
setTabIndex(-1);
|
|
5118
|
+
}, [stopEditing]);
|
|
5119
|
+
const handleCellMouseDown = useCallback(() => {
|
|
5120
|
+
if (isEditing) {
|
|
5121
|
+
stopEditing();
|
|
5122
|
+
return;
|
|
5123
|
+
}
|
|
5124
|
+
moveFocusToCell(cellPosition);
|
|
5125
|
+
beginEditing();
|
|
5126
|
+
}, [beginEditing, cellPosition, moveFocusToCell, isEditing, stopEditing]);
|
|
5127
|
+
const handleCellBlur = useCallback(
|
|
5128
|
+
(e) => {
|
|
5129
|
+
if (menuElement.current?.contains(e.relatedTarget)) {
|
|
5130
|
+
return;
|
|
5131
|
+
}
|
|
5132
|
+
setTabIndex(-1);
|
|
5133
|
+
stopEditing();
|
|
5134
|
+
},
|
|
5135
|
+
[setTabIndex, menuElement, stopEditing]
|
|
5136
|
+
);
|
|
5137
|
+
const handleCellFocus = useCallback(
|
|
5138
|
+
(event) => {
|
|
5139
|
+
if (event.target !== cellRef.current) {
|
|
5140
|
+
return;
|
|
5141
|
+
}
|
|
5142
|
+
event.preventDefault();
|
|
5143
|
+
setTabIndex(0);
|
|
5144
|
+
},
|
|
5145
|
+
[setTabIndex]
|
|
5146
|
+
);
|
|
5147
|
+
const handleMenuItemClick = useCallback(
|
|
5148
|
+
(value) => {
|
|
5149
|
+
commitValue(value);
|
|
5150
|
+
},
|
|
5151
|
+
[commitValue]
|
|
5152
|
+
);
|
|
5153
|
+
const handleMenuItemKeyDown = useCallback(
|
|
5154
|
+
(event) => {
|
|
5155
|
+
if (event.key === "Escape" || event.key === "F2") {
|
|
5156
|
+
cellRef.current?.focus();
|
|
5157
|
+
stopEditing();
|
|
5158
|
+
}
|
|
5159
|
+
},
|
|
5160
|
+
[stopEditing]
|
|
5161
|
+
);
|
|
5162
|
+
const cellFocusContextValue = useMemo(
|
|
5163
|
+
() => ({ isCellFocused: tabIndex === 0 && !isEditing }),
|
|
5164
|
+
[tabIndex, isEditing]
|
|
5165
|
+
);
|
|
5166
|
+
if (!isValidValueType) {
|
|
5167
|
+
const { cellProps: _cellProps, ...immutableCellProps } = props;
|
|
5168
|
+
return /* @__PURE__ */ jsx(DataTableBodyImmutableCell, { ...immutableCellProps });
|
|
5169
|
+
}
|
|
5170
|
+
return /* @__PURE__ */ jsx(
|
|
5171
|
+
Menu,
|
|
5172
|
+
{
|
|
5173
|
+
open: isEditing,
|
|
5174
|
+
onOutsidePress: handleOutsidePress,
|
|
5175
|
+
trigger: ({
|
|
5176
|
+
ref: triggerRef,
|
|
5177
|
+
onKeyDown: menuOnTriggerKeydown,
|
|
5178
|
+
["aria-controls"]: triggerAriaControls,
|
|
5179
|
+
["aria-expanded"]: triggerAriaExpanded,
|
|
5180
|
+
["aria-haspopup"]: triggerAriaHaspopup,
|
|
5181
|
+
["data-open"]: triggerDataOpen,
|
|
5182
|
+
["data-state"]: triggerDataState
|
|
5183
|
+
}) => {
|
|
5184
|
+
menuElement.current = document.querySelector(`#${triggerAriaControls}`) || null;
|
|
5185
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
5186
|
+
TableBodyCell,
|
|
5187
|
+
{
|
|
5188
|
+
ref: mergeRefs([
|
|
5189
|
+
triggerRef,
|
|
5190
|
+
cellRef
|
|
5191
|
+
]),
|
|
5192
|
+
tabIndex,
|
|
5193
|
+
type: "data-table",
|
|
5194
|
+
...cellProps,
|
|
5195
|
+
className: cellClasses,
|
|
5196
|
+
onMouseDown: handleCellMouseDown,
|
|
5197
|
+
onBlur: handleCellBlur,
|
|
5198
|
+
onFocus: handleCellFocus,
|
|
5199
|
+
"data-cell-pos": formatCellPositionString(cellPosition),
|
|
5200
|
+
"aria-controls": triggerAriaControls,
|
|
5201
|
+
"aria-expanded": triggerAriaExpanded,
|
|
5202
|
+
"aria-haspopup": triggerAriaHaspopup,
|
|
5203
|
+
"data-open": triggerDataOpen,
|
|
5204
|
+
"data-state": triggerDataState,
|
|
5205
|
+
onKeyDown: (e) => handleCellKeyDown(e, menuOnTriggerKeydown),
|
|
5206
|
+
children: [
|
|
5207
|
+
/* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
|
|
5208
|
+
children,
|
|
5209
|
+
!isEditing && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
|
|
5210
|
+
] }),
|
|
5211
|
+
/* @__PURE__ */ jsx(SrOnly, { children: isEditing ? "Press Enter or Space to select a cell value. Press Escape or F2 to cancel." : "Press Enter or F2 to edit cell value." })
|
|
5212
|
+
]
|
|
5213
|
+
}
|
|
5214
|
+
) });
|
|
5215
|
+
},
|
|
5216
|
+
children: isEditing && options.map((item) => {
|
|
5217
|
+
return /* @__PURE__ */ jsx(
|
|
5218
|
+
Menu.Item,
|
|
5219
|
+
{
|
|
5220
|
+
label: item.label,
|
|
5221
|
+
onClick: () => handleMenuItemClick(item.value),
|
|
5222
|
+
onKeyDown: handleMenuItemKeyDown
|
|
5223
|
+
},
|
|
5224
|
+
String(item.value)
|
|
5225
|
+
);
|
|
5226
|
+
})
|
|
5227
|
+
}
|
|
5228
|
+
);
|
|
5229
|
+
}
|
|
5230
|
+
const DataTableEditableBooleanCell = Object.assign(
|
|
5231
|
+
forwardRef(DataTableEditableBooleanCellInner),
|
|
5232
|
+
{ displayName: "DataTableEditableBooleanCell" }
|
|
5233
|
+
);
|
|
5234
|
+
|
|
5025
5235
|
function DataTableBodyMutableCell(props) {
|
|
5026
5236
|
const { cell, cellPosition, children, isHovered, ...rest } = props;
|
|
5027
5237
|
const editableCellRef = useRef(null);
|
|
@@ -5098,6 +5308,9 @@ function DataTableBodyMutableCell(props) {
|
|
|
5098
5308
|
if (editMode === "multiselect") {
|
|
5099
5309
|
return DataTableEditableMultiselectCell;
|
|
5100
5310
|
}
|
|
5311
|
+
if (editMode === "boolean") {
|
|
5312
|
+
return DataTableEditableBooleanCell;
|
|
5313
|
+
}
|
|
5101
5314
|
}, [editMode]);
|
|
5102
5315
|
if (!EditableComponent) {
|
|
5103
5316
|
return null;
|
|
@@ -5757,12 +5970,13 @@ function DataTableHeaderCellInner(props, forwardedRef) {
|
|
|
5757
5970
|
}
|
|
5758
5971
|
case " ":
|
|
5759
5972
|
case "Enter": {
|
|
5760
|
-
|
|
5973
|
+
const isDisabled = header.column.columnDef.meta?.disableHeaderAction;
|
|
5974
|
+
if (isSelectCell && !isDisabled) {
|
|
5761
5975
|
event.preventDefault();
|
|
5762
5976
|
header.table.toggleAllRowsSelected();
|
|
5763
5977
|
return;
|
|
5764
5978
|
}
|
|
5765
|
-
if (isExpandCell) {
|
|
5979
|
+
if (isExpandCell && !isDisabled) {
|
|
5766
5980
|
event.preventDefault();
|
|
5767
5981
|
header.table.toggleAllRowsExpanded();
|
|
5768
5982
|
return;
|
|
@@ -6374,6 +6588,8 @@ function DataTableInner(props, ref) {
|
|
|
6374
6588
|
defaultExpandedRowIds,
|
|
6375
6589
|
defaultSelectedRowIds,
|
|
6376
6590
|
defaultSortedColumn,
|
|
6591
|
+
disableExpandAll,
|
|
6592
|
+
disableSelectAll,
|
|
6377
6593
|
expandedRowIds,
|
|
6378
6594
|
isSelectable,
|
|
6379
6595
|
onSelectRow,
|
|
@@ -6554,7 +6770,9 @@ function DataTableInner(props, ref) {
|
|
|
6554
6770
|
size: 44,
|
|
6555
6771
|
maxSize: 44,
|
|
6556
6772
|
minSize: 44,
|
|
6773
|
+
meta: { disableHeaderAction: disableExpandAll },
|
|
6557
6774
|
header: ({ table: table2 }) => {
|
|
6775
|
+
if (disableExpandAll) return null;
|
|
6558
6776
|
return /* @__PURE__ */ jsx(Flex, { grow: 1, justifyContent: "center", children: /* @__PURE__ */ jsx(
|
|
6559
6777
|
Button,
|
|
6560
6778
|
{
|
|
@@ -6613,17 +6831,21 @@ function DataTableInner(props, ref) {
|
|
|
6613
6831
|
size: 44,
|
|
6614
6832
|
maxSize: 44,
|
|
6615
6833
|
minSize: 44,
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6834
|
+
meta: { disableHeaderAction: disableSelectAll },
|
|
6835
|
+
header: ({ table: table2 }) => {
|
|
6836
|
+
if (disableSelectAll) return null;
|
|
6837
|
+
return /* @__PURE__ */ jsx(Flex, { grow: 1, justifyContent: "center", children: /* @__PURE__ */ jsx(
|
|
6838
|
+
Checkbox,
|
|
6839
|
+
{
|
|
6840
|
+
tabIndex: -1,
|
|
6841
|
+
"aria-label": table2.getIsAllRowsSelected() ? "Deselect all rows" : "Select all rows",
|
|
6842
|
+
checked: table2.getIsAllRowsSelected(),
|
|
6843
|
+
indeterminate: table2.getIsSomeRowsSelected(),
|
|
6844
|
+
onChange: table2.getToggleAllRowsSelectedHandler(),
|
|
6845
|
+
"data-cell-action": "select"
|
|
6846
|
+
}
|
|
6847
|
+
) });
|
|
6848
|
+
},
|
|
6627
6849
|
cell: ({ row }) => {
|
|
6628
6850
|
if (row.getParentRow()?.getCanExpand() && isSelectable) {
|
|
6629
6851
|
return null;
|
|
@@ -6644,7 +6866,15 @@ function DataTableInner(props, ref) {
|
|
|
6644
6866
|
});
|
|
6645
6867
|
}
|
|
6646
6868
|
return tableColumns;
|
|
6647
|
-
}, [
|
|
6869
|
+
}, [
|
|
6870
|
+
columnsProp,
|
|
6871
|
+
disableExpandAll,
|
|
6872
|
+
disableSelectAll,
|
|
6873
|
+
hasRowErrors,
|
|
6874
|
+
hasSubComponent,
|
|
6875
|
+
isExpandable,
|
|
6876
|
+
isSelectable
|
|
6877
|
+
]);
|
|
6648
6878
|
const table = useReactTable({
|
|
6649
6879
|
data: tableData ?? [],
|
|
6650
6880
|
columns,
|
|
@@ -6867,4 +7097,4 @@ function DataTableInner(props, ref) {
|
|
|
6867
7097
|
const DataTable = forwardRef(DataTableInner);
|
|
6868
7098
|
|
|
6869
7099
|
export { COLUMN_TYPE_DEFAULTS as C, DataTable as D, chipsFormatter as a, booleanFormatter as b, createColumnHelper$1 as c, currencyFormatter as d, dateFormatter as e, dateTimeFormatter as f, getColumnTypeDefaults as g, dateFormatPresets as h, timeFormatter as i, numberFormatter as n, percentFormatter as p, resolveColumnTypeConfig as r, timeFormatPresets as t, yearlessDateFormatter as y };
|
|
6870
|
-
//# sourceMappingURL=DataTable-
|
|
7100
|
+
//# sourceMappingURL=DataTable-BLuJ4FtH.js.map
|