@persona/design-system 0.10.1 → 0.10.3
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 +25 -0
- package/dist/{CheckboxGroupField-4dc7YXJY.d.mts → CheckboxGroupField-6E5o6bYi.d.mts} +2 -2
- package/dist/CheckboxGroupField.d.mts +1 -1
- package/dist/{Combobox-CcFJo68g.mjs → Combobox-CBM-oY-e.mjs} +6 -4
- package/dist/{Combobox-CcFJo68g.mjs.map → Combobox-CBM-oY-e.mjs.map} +1 -1
- package/dist/{Combobox-Bm2eSg56.d.mts → Combobox-DTeu9_RR.d.mts} +3 -3
- package/dist/Combobox.d.mts +2 -2
- package/dist/{ComboboxBase-B7ZcqU9p.d.mts → ComboboxBase-BMBdtP2Z.d.mts} +2 -2
- package/dist/ComboboxBase.d.mts +1 -1
- package/dist/{ComboboxMultiSelect-BkdRrH6K.d.mts → ComboboxMultiSelect-DY5bAep9.d.mts} +2 -2
- package/dist/ComboboxMultiSelect.d.mts +1 -1
- package/dist/{ComboboxSingleSelect-DIBRZmvS.d.mts → ComboboxSingleSelect-1NglA-u2.d.mts} +3 -3
- package/dist/ComboboxSingleSelect.d.mts +1 -1
- package/dist/{CompactBar-CfrrZ69k.d.mts → CompactBar-D9egXqY_.d.mts} +2 -2
- package/dist/CompactBar.d.mts +1 -1
- package/dist/{ControlBar-D9KflqmH.d.mts → ControlBar-RIz-xjxs.d.mts} +18 -1
- package/dist/ControlBar.d.mts +1 -1
- package/dist/{DataTable-BoAAKhVH.mjs → DataTable-DQ8axNfo.mjs} +3 -3
- package/dist/{DataTable-BoAAKhVH.mjs.map → DataTable-DQ8axNfo.mjs.map} +1 -1
- package/dist/{DataTable--_f1Obhj.d.mts → DataTable-l1bFeLXL.d.mts} +6 -5
- package/dist/DataTable.d.mts +1 -1
- package/dist/DropdownButton.d.mts +1 -1
- package/dist/{DropdownMenu-Bie2cWjb.d.mts → DropdownMenu-UIrnFxfG.d.mts} +2 -2
- package/dist/DropdownMenu.d.mts +1 -1
- package/dist/{FormField-C4B2qFgh.mjs → FormField-C0cd1zVd.mjs} +3 -3
- package/dist/{FormField-C4B2qFgh.mjs.map → FormField-C0cd1zVd.mjs.map} +1 -1
- package/dist/ImageThumbnail.d.mts +43 -0
- package/dist/IndexTableLayout.d.mts +3 -3
- package/dist/InlineCombobox.d.mts +1 -1
- package/dist/InlineInput.d.mts +1 -1
- package/dist/{ListBox-DIk8suJM.d.mts → ListBox-cH0dfeLN.d.mts} +2 -2
- package/dist/ListBox.d.mts +1 -1
- package/dist/{ListBoxField-DF8rqPsu.d.mts → ListBoxField-DOpaE0q4.d.mts} +4 -4
- package/dist/ListBoxField.d.mts +1 -1
- package/dist/{LogicRow-uxpe1vZ1.d.mts → LogicRow-CaxsteGU.d.mts} +2 -2
- package/dist/LogicRow.d.mts +1 -1
- package/dist/MaskedInput.d.mts +1 -1
- package/dist/{Menu-CrThaUX2.d.mts → Menu-5VknNr1T.d.mts} +2 -2
- package/dist/Menu.d.mts +1 -1
- package/dist/{Select-CsxK6A5m.d.mts → Select-CG_Xkx0m.d.mts} +2 -2
- package/dist/Select.d.mts +1 -1
- package/dist/SelectionCard.d.mts +46 -0
- package/dist/SelectionCardGroup.d.mts +37 -0
- package/dist/SmartTextInputField.d.mts +2 -2
- package/dist/{Spinner-uVZyOh1T.mjs → Spinner-7Camx1vs.mjs} +4 -3
- package/dist/{Spinner-uVZyOh1T.mjs.map → Spinner-7Camx1vs.mjs.map} +1 -1
- package/dist/{Table--o4ZLRbb.mjs → Table-BIDaC0uS.mjs} +2 -2
- package/dist/{Table--o4ZLRbb.mjs.map → Table-BIDaC0uS.mjs.map} +1 -1
- package/dist/{TableBox-3qunC9Nl.mjs → TableBox-Bn_XZEYd.mjs} +3 -3
- package/dist/{TableBox-3qunC9Nl.mjs.map → TableBox-Bn_XZEYd.mjs.map} +1 -1
- package/dist/TableBox.d.mts +1 -1
- package/dist/{TableBoxCell-okcOQ5Ec.d.mts → TableBoxCell-v_ag22E0.d.mts} +4 -4
- package/dist/TableBoxCell.d.mts +1 -1
- package/dist/{TableBoxField-DR-SJY9z.d.mts → TableBoxField-BTpSGmgW.d.mts} +5 -5
- package/dist/TableBoxField.d.mts +1 -1
- package/dist/{TableBoxRow-DiuAB_rV.d.mts → TableBoxRow-BBTztgTT.d.mts} +2 -2
- package/dist/TableBoxRow.d.mts +1 -1
- package/dist/{TableBoxRowActions-Cm4KJsAD.d.mts → TableBoxRowActions-B9QSVySz.d.mts} +2 -2
- package/dist/TableBoxRowActions.d.mts +1 -1
- package/dist/{TableControls-n16XKO9S.mjs → TableControls-qxoq5abn.mjs} +142 -61
- package/dist/TableControls-qxoq5abn.mjs.map +1 -0
- package/dist/{TableControls-B9bvsNUc.d.mts → TableControls-wM35j3g4.d.mts} +5 -4
- package/dist/TableControls.d.mts +1 -1
- package/dist/{TableControlsContext-CZThYoj5.d.mts → TableControlsContext-rTYwRi5S.d.mts} +2 -2
- package/dist/TableControlsContext.d.mts +1 -1
- package/dist/{TableViewConfigurationDropdown-CvN7tE98.d.mts → TableViewConfigurationDropdown-Gut16-vY.d.mts} +2 -2
- package/dist/TableViewConfigurationDropdown.d.mts +1 -1
- package/dist/{clientFilterUtils-BXEpzorX.d.mts → clientFilterUtils-D0Bwapen.d.mts} +2 -2
- package/dist/clientFilterUtils.d.mts +1 -1
- package/dist/components/Combobox/index.d.mts +2 -2
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/DataTable/TableControls/index.d.mts +7 -7
- package/dist/components/DataTable/TableControls/index.mjs +1 -1
- package/dist/components/DataTable/index.d.mts +5 -5
- package/dist/components/DataTable/index.mjs +1 -1
- package/dist/components/DataTable/types.d.mts +1 -1
- package/dist/components/DropdownMenu/index.d.mts +1 -1
- package/dist/components/FormField/index.d.mts +4 -4
- package/dist/components/FormField/index.mjs +1 -1
- package/dist/components/ImageTile/index.mjs +82 -52
- package/dist/components/ImageTile/index.mjs.map +1 -1
- package/dist/components/ListBox/index.d.mts +3 -3
- package/dist/components/Menu/index.d.mts +1 -1
- package/dist/components/Select/index.d.mts +1 -1
- package/dist/components/SelectionCard/index.d.mts +3 -0
- package/dist/components/SelectionCard/index.mjs +272 -0
- package/dist/components/SelectionCard/index.mjs.map +1 -0
- package/dist/components/SmartTextInput/index.mjs +1 -1
- package/dist/components/Spinner/index.mjs +1 -1
- package/dist/components/Table/index.mjs +1 -1
- package/dist/components/TableBox/index.d.mts +1 -1
- package/dist/components/TableBox/index.mjs +1 -1
- package/dist/components/VersionHistory/index.mjs +1 -1
- package/dist/fieldPickerOptions.d.mts +1 -1
- package/dist/{filters-ogUUmLEf.d.mts → filters-C8YLLbH3.d.mts} +2 -2
- package/dist/filters.d.mts +1 -1
- package/dist/{helpers-Dqw5PEva.d.mts → helpers-DvqDI2e5.d.mts} +2 -2
- package/dist/helpers.d.mts +1 -1
- package/dist/{index-Ck939aXd.d.mts → index-CNDe1Lij.d.mts} +3 -3
- package/dist/{inputFields-DVLg_2wz.d.mts → inputFields-BZcm1UV5.d.mts} +4 -4
- package/dist/inputFields.d.mts +1 -1
- package/dist/patterns/IndexTableLayout/index.mjs +1 -1
- package/dist/patterns/LayoutLoadingShimmer/index.mjs +1 -1
- package/dist/{types-Bdi8Y7ll.d.mts → types-Ci-KTHfu.d.mts} +3 -3
- package/dist/{types-BQP14Fng.d.mts → types-SYxBPX6o.d.mts} +2 -2
- package/dist/types5.d.mts +1 -1
- package/dist/useColumnConfiguration.d.mts +2 -2
- package/dist/useComboboxFooterAction.d.mts +1 -1
- package/dist/{useTableColumns-DdU0CLcU.d.mts → useTableColumns-PyxNyTD6.d.mts} +2 -2
- package/dist/useTableColumns.d.mts +1 -1
- package/dist/useTruncation.d.mts +1 -1
- package/llms.txt +2 -1
- package/package.json +4 -2
- package/skills/ui-authoring/COMPONENTS.md +1 -0
- package/skills/ui-authoring/PATTERNS.md +5 -1
- package/skills/ui-authoring/SKILL.md +8 -0
- package/skills/ui-authoring/STANDARD.md +137 -0
- package/skills/ui-authoring/TOKENS.md +3 -1
- package/skills/ui-authoring/lanes.json +22 -0
- package/dist/TableControls-n16XKO9S.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-
|
|
1
|
+
import { o as ComboboxOptionsOrGroups } from "./ComboboxBase-BMBdtP2Z.mjs";
|
|
2
2
|
import { a as TableCellProps, i as TableCell } from "./TableCell-4u5_BgTC.mjs";
|
|
3
|
-
import { r as TableBoxRowProps } from "./TableBoxRow-
|
|
3
|
+
import { r as TableBoxRowProps } from "./TableBoxRow-BBTztgTT.mjs";
|
|
4
4
|
import { n as ReorderConfig, t as DragDirection } from "./useTableBoxDragAndDrop-CKPIY98e.mjs";
|
|
5
|
-
import { t as RowAction } from "./TableBoxRowActions-
|
|
5
|
+
import { t as RowAction } from "./TableBoxRowActions-B9QSVySz.mjs";
|
|
6
6
|
import * as _$react from "react";
|
|
7
7
|
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
8
8
|
import * as _$styled_components0 from "styled-components";
|
|
@@ -273,4 +273,4 @@ declare const TableBoxCell: ({
|
|
|
273
273
|
}: TableBoxCellProps) => _$react_jsx_runtime0.JSX.Element;
|
|
274
274
|
//#endregion
|
|
275
275
|
export { TableBox as a, PinnedActionsCell as i, TableBoxCellProps as n, TableBoxContext as o, InlineEditConfig as r, TableBoxProps as s, TableBoxCell as t };
|
|
276
|
-
//# sourceMappingURL=TableBoxCell-
|
|
276
|
+
//# sourceMappingURL=TableBoxCell-v_ag22E0.d.mts.map
|
package/dist/TableBoxCell.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-
|
|
1
|
+
import { n as TableBoxCellProps, t as TableBoxCell } from "./TableBoxCell-v_ag22E0.mjs";
|
|
2
2
|
export { TableBoxCellProps, TableBoxCell as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
2
|
-
import { o as ImplementsFormField } from "./inputFields-
|
|
3
|
-
import { r as TableBoxRowProps } from "./TableBoxRow-
|
|
4
|
-
import { n as TableBoxCellProps, s as TableBoxProps } from "./TableBoxCell-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-5VknNr1T.mjs";
|
|
2
|
+
import { o as ImplementsFormField } from "./inputFields-BZcm1UV5.mjs";
|
|
3
|
+
import { r as TableBoxRowProps } from "./TableBoxRow-BBTztgTT.mjs";
|
|
4
|
+
import { n as TableBoxCellProps, s as TableBoxProps } from "./TableBoxCell-v_ag22E0.mjs";
|
|
5
5
|
import { MouseEvent, ReactNode } from "react";
|
|
6
6
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
7
|
|
|
@@ -100,4 +100,4 @@ declare const TableBoxField: {
|
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
102
102
|
export { TableBoxFieldActionGroup as a, TableBoxFieldActionEntry as i, TableBoxField as n, TableBoxFieldAction as r, TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL as t };
|
|
103
|
-
//# sourceMappingURL=TableBoxField-
|
|
103
|
+
//# sourceMappingURL=TableBoxField-BTpSGmgW.d.mts.map
|
package/dist/TableBoxField.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TableBoxFieldActionGroup, i as TableBoxFieldActionEntry, n as TableBoxField, r as TableBoxFieldAction, t as TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL } from "./TableBoxField-
|
|
1
|
+
import { a as TableBoxFieldActionGroup, i as TableBoxFieldActionEntry, n as TableBoxField, r as TableBoxFieldAction, t as TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL } from "./TableBoxField-BTpSGmgW.mjs";
|
|
2
2
|
export { TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL, TableBoxFieldAction, TableBoxFieldActionEntry, TableBoxFieldActionGroup, TableBoxField as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-5VknNr1T.mjs";
|
|
2
2
|
import { t as TableRow } from "./TableRow-lCsvG0a-.mjs";
|
|
3
3
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -83,4 +83,4 @@ declare const TableBoxRowOverlay: ({
|
|
|
83
83
|
}) => _$react_jsx_runtime0.JSX.Element;
|
|
84
84
|
//#endregion
|
|
85
85
|
export { TableBoxRowOverlay as n, TableBoxRowProps as r, TableBoxRow as t };
|
|
86
|
-
//# sourceMappingURL=TableBoxRow-
|
|
86
|
+
//# sourceMappingURL=TableBoxRow-BBTztgTT.d.mts.map
|
package/dist/TableBoxRow.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TableBoxRowOverlay, r as TableBoxRowProps, t as TableBoxRow } from "./TableBoxRow-
|
|
1
|
+
import { n as TableBoxRowOverlay, r as TableBoxRowProps, t as TableBoxRow } from "./TableBoxRow-BBTztgTT.mjs";
|
|
2
2
|
export { TableBoxRowOverlay, TableBoxRowProps, TableBoxRow as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as MenuItemProps } from "./Menu-
|
|
1
|
+
import { l as MenuItemProps } from "./Menu-5VknNr1T.mjs";
|
|
2
2
|
import * as _$styled_components0 from "styled-components";
|
|
3
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -54,4 +54,4 @@ declare const RowActions: ({
|
|
|
54
54
|
}: RowActionsProps) => _$react_jsx_runtime0.JSX.Element | null;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { RowActionsContainerWithFadeWidth as i, RowActions as n, RowActionsContainer as r, RowAction as t };
|
|
57
|
-
//# sourceMappingURL=TableBoxRowActions-
|
|
57
|
+
//# sourceMappingURL=TableBoxRowActions-B9QSVySz.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as RowActionsContainerWithFadeWidth, n as RowActions, r as RowActionsContainer, t as RowAction } from "./TableBoxRowActions-
|
|
1
|
+
import { i as RowActionsContainerWithFadeWidth, n as RowActions, r as RowActionsContainer, t as RowAction } from "./TableBoxRowActions-B9QSVySz.mjs";
|
|
2
2
|
export { RowAction, RowActions, RowActionsContainer, RowActionsContainerWithFadeWidth };
|
|
@@ -23,21 +23,21 @@ import { r as InputGroup } from "./Input-Dap055xf.mjs";
|
|
|
23
23
|
import Input_default from "./components/Input/index.mjs";
|
|
24
24
|
import { c as MenuList, s as MenuItem } from "./Menu-Dw6Rcpk6.mjs";
|
|
25
25
|
import { n as DropdownMenu_default } from "./DropdownMenu-CedsmO5h.mjs";
|
|
26
|
-
import { t as Combobox } from "./Combobox-
|
|
26
|
+
import { t as Combobox } from "./Combobox-CBM-oY-e.mjs";
|
|
27
27
|
import { n as Select, r as SelectHeader, t as Option } from "./Select-BJ9ACmRD.mjs";
|
|
28
28
|
import { s as Popover_default } from "./Popover-BcII7usF.mjs";
|
|
29
29
|
import { i as Modal_default } from "./Modal-kjUptzg1.mjs";
|
|
30
30
|
import { r as DateRangePicker, t as DatePicker } from "./DatePicker-D0cvVbzq.mjs";
|
|
31
31
|
import { t as ListBox } from "./ListBox-eoyBHtnJ.mjs";
|
|
32
32
|
import { i as selectedPresetFor, n as parseDateFilterValue, r as resolveDateFilterValue, t as formatDateFilterValue } from "./date-filter-D0ys8s0D.mjs";
|
|
33
|
-
import { m as FormField, o as ComboboxField } from "./FormField-
|
|
33
|
+
import { m as FormField, o as ComboboxField } from "./FormField-C0cd1zVd.mjs";
|
|
34
34
|
import { t as Toggle } from "./Toggle-BsqSNYok.mjs";
|
|
35
35
|
import { BorderRadius, Color, Spacing, Typography } from "@persona/design-tokens";
|
|
36
36
|
import { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
37
37
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
38
38
|
import { DateTime, Settings } from "luxon";
|
|
39
39
|
import { CaretDownIcon, CheckIcon, CircleInfoIcon, CirclePlusIcon, CopyIcon, EyeIcon, EyeOffIcon, FilterIcon, MoreIcon, PlusIcon, RotateCcwIcon, SaveIcon, SearchIcon, SettingsIcon, StarIcon, TrashIcon, XIcon } from "@persona/icons";
|
|
40
|
-
import { CaretDownIcon as CaretDownIcon$1, CircleInfoIcon as CircleInfoIcon$1, LockedIcon as LockedIcon$1, MoreIcon as MoreIcon$1, PlusIcon as PlusIcon$1, SearchIcon as SearchIcon$1, XIcon as XIcon$1 } from "@persona/icons/12px";
|
|
40
|
+
import { CaretDownIcon as CaretDownIcon$1, CircleInfoIcon as CircleInfoIcon$1, LockedIcon as LockedIcon$1, MoreIcon as MoreIcon$1, PlusIcon as PlusIcon$1, SearchIcon as SearchIcon$1, StarFillIcon, XIcon as XIcon$1 } from "@persona/icons/12px";
|
|
41
41
|
import { debounce, isEqual, noop, partition, startCase, union, uniqueId } from "lodash-es";
|
|
42
42
|
import { useId } from "react-aria";
|
|
43
43
|
import { mergeRefs } from "@react-aria/utils";
|
|
@@ -404,7 +404,7 @@ const TabOverflowContainer = styled.div`
|
|
|
404
404
|
position: absolute;
|
|
405
405
|
height: 32px;
|
|
406
406
|
`;
|
|
407
|
-
const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditViews, handleNameChange, onDuplicateView, onRequestDeleteView, onSelectView, onResetCurrentView, onSaveView, onRequestSetDefaultView, onRequestUnsetDefaultView, onViewHiddenChange, onHideView, onKeyboardMove, isHidden = false, isViewDirty, showTabContextMenu, setShowTabContextMenu, className, ...rest }) => {
|
|
407
|
+
const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditViews, handleNameChange, onDuplicateView, onRequestDeleteView, onSelectView, onResetCurrentView, onSaveView, onRequestSetDefaultView, onRequestUnsetDefaultView, onViewHiddenChange, onHideView, onKeyboardMove, isHidden = false, isViewDirty, showTabContextMenu, setShowTabContextMenu, isStarredDefault = false, className, ...rest }) => {
|
|
408
408
|
const strings = usePDSStrings();
|
|
409
409
|
const showMenu = selected && (canEditViews || !!onViewHiddenChange);
|
|
410
410
|
const onRequestDefaultViewChange = view.isDefault ? onRequestUnsetDefaultView : onRequestSetDefaultView;
|
|
@@ -429,7 +429,10 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
429
429
|
}
|
|
430
430
|
} : void 0,
|
|
431
431
|
"aria-keyshortcuts": onKeyboardMove ? "Alt+Shift+ArrowLeft Alt+Shift+ArrowRight" : void 0,
|
|
432
|
+
prefixIcon: isStarredDefault ? /* @__PURE__ */ jsx(StarFillIcon, { "aria-hidden": true }) : void 0,
|
|
432
433
|
suffixIcon: showMenu ? /* @__PURE__ */ jsx(MoreIcon, {}) : void 0,
|
|
434
|
+
"aria-description": isStarredDefault ? strings.defaultView : void 0,
|
|
435
|
+
"data-starred-default": isStarredDefault || void 0,
|
|
433
436
|
className,
|
|
434
437
|
...rest,
|
|
435
438
|
children: view.name
|
|
@@ -531,7 +534,7 @@ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditView
|
|
|
531
534
|
return tab;
|
|
532
535
|
};
|
|
533
536
|
const SavedViewTabSlot = ({ slotRef, slotStyle, slotListeners, ...props }) => {
|
|
534
|
-
const { view, selected, onViewHiddenChange, onHideView } = props;
|
|
537
|
+
const { view, selected, onViewHiddenChange, onHideView, isStarredDefault } = props;
|
|
535
538
|
const strings = usePDSStrings();
|
|
536
539
|
const [slotElement, setSlotElement] = useState(null);
|
|
537
540
|
const mergedSlotRef = useMemo(() => mergeRefs(slotRef, setSlotElement), [slotRef]);
|
|
@@ -547,7 +550,7 @@ const SavedViewTabSlot = ({ slotRef, slotStyle, slotListeners, ...props }) => {
|
|
|
547
550
|
}, [slotElement, selected]);
|
|
548
551
|
return /* @__PURE__ */ jsxs(TabSlot, {
|
|
549
552
|
ref: mergedSlotRef,
|
|
550
|
-
"data-tab-view": true,
|
|
553
|
+
"data-tab-view": isStarredDefault ? void 0 : true,
|
|
551
554
|
"data-tab-slot": true,
|
|
552
555
|
style: slotStyle,
|
|
553
556
|
...slotListeners,
|
|
@@ -579,12 +582,16 @@ const SortableSavedViewTab = (props) => {
|
|
|
579
582
|
/**
|
|
580
583
|
* A tab that is locked and does not support editing or actions.
|
|
581
584
|
*/
|
|
582
|
-
const LockedViewTab = ({ id, selected, onClick, children, ...props }) => {
|
|
585
|
+
const LockedViewTab = ({ id, selected, onClick, icon = "locked", children, ...props }) => {
|
|
586
|
+
const strings = usePDSStrings();
|
|
583
587
|
return /* @__PURE__ */ jsx(LockedTab, {
|
|
584
588
|
id,
|
|
585
589
|
selected,
|
|
586
590
|
onClick: selected ? void 0 : onClick,
|
|
587
|
-
|
|
591
|
+
prefixIcon: icon === "starred" ? /* @__PURE__ */ jsx(StarFillIcon, { "aria-hidden": true }) : void 0,
|
|
592
|
+
suffixIcon: icon === "locked" ? /* @__PURE__ */ jsx(LockedIcon$1, {}) : void 0,
|
|
593
|
+
"data-starred-default": icon === "starred" || void 0,
|
|
594
|
+
"aria-description": icon === "starred" ? strings.defaultView : void 0,
|
|
588
595
|
...props,
|
|
589
596
|
children
|
|
590
597
|
});
|
|
@@ -671,7 +678,7 @@ const ProductTourStyles = createGlobalStyle`
|
|
|
671
678
|
}
|
|
672
679
|
}
|
|
673
680
|
`;
|
|
674
|
-
const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewIds, onAddView, onDuplicateView, onDeleteView, onViewNameChange, onReorderViews, onViewHiddenChange, onSaveView, onSetDefaultView, onUnsetDefaultView, isViewDirty, canEditViews, showFilters, setShowFilters, searchProps, filtersId, propertiesButton, tableActions, isLoading, isFilterPanelLoading, showViews, selectedRows = [], bulkActions, onResetCurrentView, onClearSelection, title, "data-tour-target": dataTourTarget, compact, onError, filterPanel }) => {
|
|
681
|
+
const ControlBar = ({ presetViews, currentView, onSelectView, views, starredDefaultView = false, hiddenViewIds, onAddView, onDuplicateView, onDeleteView, onViewNameChange, onReorderViews, onViewHiddenChange, onSaveView, onSetDefaultView, onUnsetDefaultView, isViewDirty, canEditViews, showFilters, setShowFilters, searchProps, filtersId, propertiesButton, tableActions, isLoading, isFilterPanelLoading, showViews, selectedRows = [], bulkActions, onResetCurrentView, onClearSelection, title, "data-tour-target": dataTourTarget, compact, onError, filterPanel }) => {
|
|
675
682
|
const strings = usePDSStrings();
|
|
676
683
|
const tabListRef = useRef(null);
|
|
677
684
|
const tabOverflowRef = useRef(null);
|
|
@@ -688,21 +695,60 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
688
695
|
const [isAddViewOverflowing, setIsAddViewOverflowing] = useState(false);
|
|
689
696
|
useEffect(() => {
|
|
690
697
|
const previousPendingView = previousPendingViewRef.current;
|
|
691
|
-
if (!pendingViewAction && previousPendingView) (document.getElementById(`${OVERFLOW_TAB_ID_PREFIX}${previousPendingView.id}`) ?? document.getElementById(`${TAB_ID_PREFIX}${previousPendingView.id}`))?.focus({ preventScroll: true });
|
|
698
|
+
if (!pendingViewAction && previousPendingView) (document.getElementById(`${OVERFLOW_TAB_ID_PREFIX}${previousPendingView.id}`) ?? document.getElementById(`${TAB_ID_PREFIX}${previousPendingView.id}`) ?? tabListRef.current?.querySelector("[data-starred-default]"))?.focus({ preventScroll: true });
|
|
692
699
|
previousPendingViewRef.current = pendingViewAction?.view ?? null;
|
|
693
700
|
}, [pendingViewAction]);
|
|
701
|
+
const focusedTabIdRef = useRef(null);
|
|
702
|
+
if (starredDefaultView && typeof document !== "undefined") {
|
|
703
|
+
const focusedId = document.activeElement?.id;
|
|
704
|
+
focusedTabIdRef.current = focusedId?.startsWith(TAB_ID_PREFIX) ? focusedId : null;
|
|
705
|
+
}
|
|
706
|
+
useLayoutEffect(() => {
|
|
707
|
+
const focusedTabId = focusedTabIdRef.current;
|
|
708
|
+
if (!starredDefaultView || !focusedTabId) return;
|
|
709
|
+
const activeElement = document.activeElement;
|
|
710
|
+
if (activeElement && activeElement !== document.body) return;
|
|
711
|
+
(document.getElementById(focusedTabId) ?? tabListRef.current?.querySelector("[data-starred-default]"))?.focus({ preventScroll: true });
|
|
712
|
+
});
|
|
713
|
+
const starredView = useMemo(() => starredDefaultView ? views?.find((view) => view.isDefault) : void 0, [starredDefaultView, views]);
|
|
714
|
+
const showBuiltInTab = !starredView;
|
|
715
|
+
const currentViewId = currentView ?? starredView?.id ?? null;
|
|
716
|
+
const unpinnedViews = useMemo(() => (views ?? []).filter((view) => view !== starredView), [starredView, views]);
|
|
694
717
|
const [shownViews, hiddenViews] = useMemo(() => {
|
|
695
718
|
const hiddenIds = new Set(hiddenViewIds);
|
|
696
|
-
const allViews =
|
|
719
|
+
const allViews = unpinnedViews;
|
|
697
720
|
return [allViews.filter((view) => !hiddenIds.has(view.id)), allViews.filter((view) => hiddenIds.has(view.id))];
|
|
698
|
-
}, [
|
|
721
|
+
}, [unpinnedViews, hiddenViewIds]);
|
|
722
|
+
const shownViewsKey = shownViews.map((view) => view.id).join("\n");
|
|
723
|
+
const [selectedSlot, setSelectedSlot] = useState(null);
|
|
724
|
+
const selectedSlotIndex = selectedSlot != null && selectedSlot.viewId === currentViewId && selectedSlot.shownViewsKey === shownViewsKey ? selectedSlot.index : null;
|
|
725
|
+
const stripViews = useMemo(() => {
|
|
726
|
+
const selectedView = shownViews.find((view) => view.id === currentViewId);
|
|
727
|
+
if (selectedSlotIndex == null || !selectedView) return shownViews;
|
|
728
|
+
const otherViews = shownViews.filter((view) => view !== selectedView);
|
|
729
|
+
return [
|
|
730
|
+
...otherViews.slice(0, selectedSlotIndex),
|
|
731
|
+
selectedView,
|
|
732
|
+
...otherViews.slice(selectedSlotIndex)
|
|
733
|
+
];
|
|
734
|
+
}, [
|
|
735
|
+
shownViews,
|
|
736
|
+
currentViewId,
|
|
737
|
+
selectedSlotIndex
|
|
738
|
+
]);
|
|
699
739
|
const onResize = useCallback(() => {
|
|
700
740
|
if (!tabListRef.current) return;
|
|
701
741
|
const containerRect = tabListRef.current.getBoundingClientRect();
|
|
702
742
|
const tabListContainer = tabListRef.current;
|
|
703
743
|
const firstOverflowIndex = Array.from(tabListContainer.querySelectorAll("[data-tab-view]")).findIndex((el) => !rectContainsRect(containerRect, el.getBoundingClientRect()));
|
|
704
|
-
const nextOverflowViews = firstOverflowIndex === -1 ? [] :
|
|
744
|
+
const nextOverflowViews = firstOverflowIndex === -1 ? [] : stripViews.slice(firstOverflowIndex);
|
|
705
745
|
setOverflowViews((prev) => prev.length === nextOverflowViews.length && prev.every((view, index) => view === nextOverflowViews[index]) ? prev : nextOverflowViews);
|
|
746
|
+
const selectedIndex = stripViews.findIndex((view) => view.id === currentViewId);
|
|
747
|
+
if (onReorderViews && currentViewId && firstOverflowIndex > 0 && selectedIndex >= firstOverflowIndex) setSelectedSlot({
|
|
748
|
+
viewId: currentViewId,
|
|
749
|
+
shownViewsKey,
|
|
750
|
+
index: firstOverflowIndex - 1
|
|
751
|
+
});
|
|
706
752
|
const firstRowElements = Array.from(tabListContainer.children).filter((el) => el instanceof HTMLElement && el !== tabOverflowRef.current && rectContainsRect(containerRect, el.getBoundingClientRect()));
|
|
707
753
|
const anchor = firstRowElements[firstRowElements.length - 1];
|
|
708
754
|
setOverflowLeft(anchor ? anchor.offsetLeft + anchor.offsetWidth + OVERFLOW_GAP : null);
|
|
@@ -710,7 +756,12 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
710
756
|
setIsAddViewOverflowing(addViewButton instanceof HTMLElement && !firstRowElements.includes(addViewButton));
|
|
711
757
|
const tabOverflowWidth = tabOverflowRef.current?.getBoundingClientRect().width;
|
|
712
758
|
if (tabOverflowWidth) setTabOverflowWidth((prev) => prev != null && prev > tabOverflowWidth && prev - tabOverflowWidth < OVERFLOW_WIDTH_SHRINK_THRESHOLD ? prev : tabOverflowWidth);
|
|
713
|
-
}, [
|
|
759
|
+
}, [
|
|
760
|
+
currentViewId,
|
|
761
|
+
onReorderViews,
|
|
762
|
+
shownViewsKey,
|
|
763
|
+
stripViews
|
|
764
|
+
]);
|
|
714
765
|
useLayoutEffect(() => {
|
|
715
766
|
const tabList = tabListRef.current;
|
|
716
767
|
if (!showViews || !tabList) return;
|
|
@@ -735,10 +786,10 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
735
786
|
}, [
|
|
736
787
|
onResize,
|
|
737
788
|
showViews,
|
|
738
|
-
|
|
789
|
+
stripViews
|
|
739
790
|
]);
|
|
740
|
-
const isCurrentViewInOverflow = useMemo(() => !!
|
|
741
|
-
|
|
791
|
+
const isCurrentViewInOverflow = useMemo(() => !!currentViewId && [...overflowViews, ...hiddenViews].some((view) => view.id === currentViewId), [
|
|
792
|
+
currentViewId,
|
|
742
793
|
overflowViews,
|
|
743
794
|
hiddenViews
|
|
744
795
|
]);
|
|
@@ -781,13 +832,22 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
781
832
|
y: 0
|
|
782
833
|
};
|
|
783
834
|
}, []);
|
|
835
|
+
const orderedViewIds = useMemo(() => {
|
|
836
|
+
let shownIndex = 0;
|
|
837
|
+
const hiddenIds = new Set(hiddenViews.map((view) => view.id));
|
|
838
|
+
return unpinnedViews.map((view) => hiddenIds.has(view.id) ? view.id : stripViews[shownIndex++].id);
|
|
839
|
+
}, [
|
|
840
|
+
unpinnedViews,
|
|
841
|
+
hiddenViews,
|
|
842
|
+
stripViews
|
|
843
|
+
]);
|
|
784
844
|
const moveView = (viewId, toIndex) => {
|
|
785
845
|
if (!views || !onReorderViews) return;
|
|
786
|
-
const viewIds =
|
|
846
|
+
const viewIds = orderedViewIds;
|
|
787
847
|
const reordered = moveItemByIndex(viewIds, viewIds.indexOf(viewId), toIndex);
|
|
788
|
-
if (reordered !== viewIds) onReorderViews(reordered);
|
|
848
|
+
if (reordered !== viewIds) onReorderViews(starredView ? [starredView.id, ...reordered] : reordered);
|
|
789
849
|
};
|
|
790
|
-
const indexOfView = (viewId) =>
|
|
850
|
+
const indexOfView = (viewId) => orderedViewIds.indexOf(viewId);
|
|
791
851
|
const openViewFromMenu = (viewId) => {
|
|
792
852
|
if (hiddenViews.some((view) => view.id === viewId)) onViewHiddenChange?.(viewId, false);
|
|
793
853
|
moveView(viewId, 0);
|
|
@@ -798,17 +858,20 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
798
858
|
};
|
|
799
859
|
const hideView = (viewId) => {
|
|
800
860
|
const overflowIds = new Set(overflowViews.map((view) => view.id));
|
|
801
|
-
const visibleViews =
|
|
861
|
+
const visibleViews = stripViews.filter((view) => !overflowIds.has(view.id));
|
|
802
862
|
const index = visibleViews.findIndex((view) => view.id === viewId);
|
|
803
|
-
const isCurrent = viewId ===
|
|
863
|
+
const isCurrent = viewId === currentViewId;
|
|
804
864
|
const focusTarget = isCurrent || index === -1 ? void 0 : visibleViews[index + 1] ?? visibleViews[index - 1];
|
|
865
|
+
const fallbackViewId = starredView?.id ?? null;
|
|
805
866
|
onViewHiddenChange?.(viewId, true);
|
|
806
|
-
if (isCurrent) onSelectView?.(
|
|
807
|
-
document.getElementById(`${TAB_ID_PREFIX}${focusTarget ? focusTarget.id : "default"}`)?.focus({ preventScroll: true });
|
|
867
|
+
if (isCurrent) onSelectView?.(fallbackViewId);
|
|
868
|
+
document.getElementById(`${TAB_ID_PREFIX}${focusTarget ? focusTarget.id : fallbackViewId ?? "default"}`)?.focus({ preventScroll: true });
|
|
808
869
|
};
|
|
809
870
|
const moveViewWithKeyboard = (viewId, direction) => {
|
|
810
|
-
const neighbor =
|
|
871
|
+
const neighbor = stripViews[stripViews.findIndex((view) => view.id === viewId) + direction];
|
|
811
872
|
if (!neighbor) return;
|
|
873
|
+
const swapIds = [viewId, neighbor.id];
|
|
874
|
+
if (currentView != null && swapIds.includes(currentView) && swapIds.some((id) => overflowViews.some((view) => view.id === id))) return;
|
|
812
875
|
moveView(viewId, indexOfView(neighbor.id));
|
|
813
876
|
};
|
|
814
877
|
const handleAddView = async () => {
|
|
@@ -933,22 +996,28 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
933
996
|
}, key);
|
|
934
997
|
});
|
|
935
998
|
const showViewsBar = title || showViews || canEditViews && onSaveView || tableActions || bulkActions;
|
|
999
|
+
const getTabActionProps = (view) => {
|
|
1000
|
+
const isStarred = !!view && view === starredView;
|
|
1001
|
+
return {
|
|
1002
|
+
onKeyboardMove: onReorderViews && !isStarred ? moveViewWithKeyboard : void 0,
|
|
1003
|
+
onHideView: hideView,
|
|
1004
|
+
handleNameChange,
|
|
1005
|
+
onDuplicateView,
|
|
1006
|
+
onRequestDeleteView: isStarred ? void 0 : onRequestDeleteView,
|
|
1007
|
+
onSelectView,
|
|
1008
|
+
onResetCurrentView: isStarred ? void 0 : onResetCurrentView,
|
|
1009
|
+
onSaveView,
|
|
1010
|
+
onRequestSetDefaultView: isStarred ? void 0 : onRequestSetDefaultView,
|
|
1011
|
+
onRequestUnsetDefaultView: isStarred ? void 0 : onRequestUnsetDefaultView,
|
|
1012
|
+
onViewHiddenChange: isStarred ? void 0 : onViewHiddenChange
|
|
1013
|
+
};
|
|
1014
|
+
};
|
|
936
1015
|
const getSavedViewTabProps = (view) => ({
|
|
937
1016
|
view,
|
|
938
|
-
|
|
939
|
-
onHideView: hideView,
|
|
1017
|
+
...getTabActionProps(view),
|
|
940
1018
|
canEditViews: canEditViews ?? false,
|
|
941
|
-
handleNameChange,
|
|
942
|
-
onDuplicateView,
|
|
943
|
-
onRequestDeleteView,
|
|
944
|
-
onSelectView,
|
|
945
|
-
onResetCurrentView,
|
|
946
|
-
onSaveView,
|
|
947
|
-
onRequestSetDefaultView,
|
|
948
|
-
onRequestUnsetDefaultView,
|
|
949
|
-
onViewHiddenChange,
|
|
950
1019
|
isViewDirty: isViewDirty ?? false,
|
|
951
|
-
selected: view.id ===
|
|
1020
|
+
selected: view.id === currentViewId,
|
|
952
1021
|
showTabContextMenu: showTabContextMenu && !isCurrentViewInOverflow,
|
|
953
1022
|
setShowTabContextMenu
|
|
954
1023
|
});
|
|
@@ -979,10 +1048,16 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
979
1048
|
]
|
|
980
1049
|
}),
|
|
981
1050
|
children: showViews && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
982
|
-
/* @__PURE__ */ jsx(
|
|
1051
|
+
starredView && /* @__PURE__ */ jsx(SavedViewTabSlot, {
|
|
1052
|
+
...getSavedViewTabProps(starredView),
|
|
1053
|
+
isStarredDefault: true,
|
|
1054
|
+
"data-tour-target": "saved-views-default-view"
|
|
1055
|
+
}),
|
|
1056
|
+
showBuiltInTab && /* @__PURE__ */ jsx(LockedViewTab, {
|
|
983
1057
|
id: `${TAB_ID_PREFIX}default`,
|
|
984
1058
|
selected: !currentView,
|
|
985
1059
|
onClick: () => onSelectView?.(null),
|
|
1060
|
+
icon: starredDefaultView ? "starred" : "locked",
|
|
986
1061
|
"data-tour-target": "saved-views-default-view",
|
|
987
1062
|
children: strings.defaultView
|
|
988
1063
|
}),
|
|
@@ -996,10 +1071,10 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
996
1071
|
}, view.id);
|
|
997
1072
|
}),
|
|
998
1073
|
onReorderViews ? /* @__PURE__ */ jsx(SortableContext, {
|
|
999
|
-
items:
|
|
1074
|
+
items: stripViews.map((view) => view.id),
|
|
1000
1075
|
strategy: horizontalListSortingStrategy,
|
|
1001
|
-
children:
|
|
1002
|
-
}) :
|
|
1076
|
+
children: stripViews.map((view) => /* @__PURE__ */ jsx(SortableSavedViewTab, { ...getSavedViewTabProps(view) }, view.id))
|
|
1077
|
+
}) : stripViews.map((view) => /* @__PURE__ */ jsx(SavedViewTabSlot, { ...getSavedViewTabProps(view) }, view.id)),
|
|
1003
1078
|
canEditViews && onAddView && /* @__PURE__ */ jsx(AddViewButton, {
|
|
1004
1079
|
id: ADD_VIEW_BUTTON_ID,
|
|
1005
1080
|
size: "md",
|
|
@@ -1012,20 +1087,12 @@ const ControlBar = ({ presetViews, currentView, onSelectView, views, hiddenViewI
|
|
|
1012
1087
|
ref: tabOverflowRef,
|
|
1013
1088
|
overflowViews,
|
|
1014
1089
|
hiddenViews,
|
|
1015
|
-
currentView,
|
|
1016
|
-
onSelectView,
|
|
1090
|
+
currentView: currentViewId,
|
|
1017
1091
|
onOpenView: openViewFromMenu,
|
|
1018
1092
|
canEditViews: canEditViews ?? false,
|
|
1019
1093
|
handleAddView: onAddView && isAddViewOverflowing ? handleAddView : null,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
onRequestDeleteView,
|
|
1023
|
-
onResetCurrentView,
|
|
1024
|
-
onSaveView,
|
|
1025
|
-
onRequestSetDefaultView,
|
|
1026
|
-
onRequestUnsetDefaultView,
|
|
1027
|
-
onViewHiddenChange,
|
|
1028
|
-
onHideView: hideView,
|
|
1094
|
+
...getTabActionProps([...overflowViews, ...hiddenViews].find((view) => view.id === currentViewId)),
|
|
1095
|
+
onKeyboardMove: void 0,
|
|
1029
1096
|
isViewDirty: isViewDirty ?? false,
|
|
1030
1097
|
showTabContextMenu: showTabContextMenu && isCurrentViewInOverflow,
|
|
1031
1098
|
setShowTabContextMenu,
|
|
@@ -1174,7 +1241,7 @@ const FilterCombobox = styled.div`
|
|
|
1174
1241
|
`}
|
|
1175
1242
|
`;
|
|
1176
1243
|
const InputFilter = ({ config, compact, onActiveChange }) => {
|
|
1177
|
-
const [value, setValue] = useState(config.value);
|
|
1244
|
+
const [value, setValue] = useState(config.value ?? "");
|
|
1178
1245
|
const onChangeRef = useRef(config.onChange);
|
|
1179
1246
|
onChangeRef.current = config.onChange;
|
|
1180
1247
|
const onActiveChangeRef = useRef(onActiveChange);
|
|
@@ -1183,13 +1250,13 @@ const InputFilter = ({ config, compact, onActiveChange }) => {
|
|
|
1183
1250
|
onActiveChangeRef.current(nextValue.length > 0);
|
|
1184
1251
|
onChangeRef.current(nextValue);
|
|
1185
1252
|
}, 300), []);
|
|
1186
|
-
useEffect(() => setValue(config.value), [config.value]);
|
|
1253
|
+
useEffect(() => setValue(config.value ?? ""), [config.value]);
|
|
1187
1254
|
useEffect(() => () => debouncedOnChange.cancel(), [debouncedOnChange]);
|
|
1188
1255
|
return /* @__PURE__ */ jsx(Input_default, {
|
|
1189
1256
|
"aria-label": config.name,
|
|
1190
1257
|
placeholder: config.placeholder,
|
|
1191
1258
|
size: compact ? "sm" : void 0,
|
|
1192
|
-
value,
|
|
1259
|
+
value: value ?? "",
|
|
1193
1260
|
onChange: ({ target: { value: nextValue } }) => {
|
|
1194
1261
|
setValue(nextValue);
|
|
1195
1262
|
debouncedOnChange(nextValue);
|
|
@@ -1201,7 +1268,7 @@ const SelectFilter = ({ config, compact, onActiveChange }) => {
|
|
|
1201
1268
|
return /* @__PURE__ */ jsx(Select, {
|
|
1202
1269
|
"aria-label": config.name,
|
|
1203
1270
|
placeholder: config.placeholder ?? strings.selectFilterOption,
|
|
1204
|
-
value: config.value,
|
|
1271
|
+
value: config.value ?? null,
|
|
1205
1272
|
width: "auto",
|
|
1206
1273
|
minWidth: 150,
|
|
1207
1274
|
size: compact ? "sm" : void 0,
|
|
@@ -1382,7 +1449,7 @@ const synchronizeActiveFilters = (filters, activeFilters, filterResolver) => {
|
|
|
1382
1449
|
...activeFromConfig,
|
|
1383
1450
|
...retainedDefaultVisible,
|
|
1384
1451
|
...configuring
|
|
1385
|
-
].sort((first, second) => first.id - second.id);
|
|
1452
|
+
].filter((active, index, all) => all.findIndex((other) => other.id === active.id) === index).sort((first, second) => first.id - second.id);
|
|
1386
1453
|
return next.length === 0 ? [createUnsetFilter(activeFilters)] : next;
|
|
1387
1454
|
};
|
|
1388
1455
|
const Filter = ({ config, compact, hideFilterSelection, filterResolver }) => {
|
|
@@ -1452,7 +1519,7 @@ const FilterSelection = ({ value, disabled, compact, filterResolver }) => {
|
|
|
1452
1519
|
width: "auto",
|
|
1453
1520
|
minWidth: 120,
|
|
1454
1521
|
placeholder: strings.selectFilterType,
|
|
1455
|
-
value,
|
|
1522
|
+
value: value ?? null,
|
|
1456
1523
|
size: compact ? "sm" : void 0,
|
|
1457
1524
|
disabled,
|
|
1458
1525
|
onValueChange: replaceFilter,
|
|
@@ -4290,7 +4357,7 @@ function useFilterStateV2(options) {
|
|
|
4290
4357
|
...prev.all,
|
|
4291
4358
|
topLevelRules: [...prev.all.topLevelRules, added]
|
|
4292
4359
|
},
|
|
4293
|
-
heldIds:
|
|
4360
|
+
heldIds: isHeldOnAdd(added, registry) ? withId(prev.heldIds, id) : prev.heldIds
|
|
4294
4361
|
}));
|
|
4295
4362
|
return id;
|
|
4296
4363
|
}, [registry]),
|
|
@@ -4339,6 +4406,19 @@ function isHeldRule(rule, registry) {
|
|
|
4339
4406
|
if (registry.get(rule.fieldId)?.condition != null) return !hasCompleteValue(rule, registry);
|
|
4340
4407
|
return !isValuelessOperator(rule.operator) && rule.value == null;
|
|
4341
4408
|
}
|
|
4409
|
+
/**
|
|
4410
|
+
* Whether a pill the picker just minted is held. A configurable condition is
|
|
4411
|
+
* held until the user confirms it, so a seeded value (`0`, a default string)
|
|
4412
|
+
* never filters on a guess. A valueless seed (`is true`, `is null`) is the
|
|
4413
|
+
* exception: it has no value left to enter, so holding it would leave a pill
|
|
4414
|
+
* with nothing to do but confirm, and it applies on pick like any complete
|
|
4415
|
+
* valueless rule.
|
|
4416
|
+
*/
|
|
4417
|
+
function isHeldOnAdd(rule, registry) {
|
|
4418
|
+
const field = registry.get(rule.fieldId);
|
|
4419
|
+
if (field?.condition == null) return isHeldRule(rule, registry);
|
|
4420
|
+
return !(isValuelessOperator(rule.operator, field) && hasCompleteValue(rule, registry));
|
|
4421
|
+
}
|
|
4342
4422
|
function heldRulesOf(state) {
|
|
4343
4423
|
return state.heldIds.size === 0 ? [] : state.all.topLevelRules.filter((rule) => state.heldIds.has(rule.id));
|
|
4344
4424
|
}
|
|
@@ -5100,7 +5180,7 @@ const hasNewFilterId = (currentIds, previousIds) => {
|
|
|
5100
5180
|
const previous = new Set(previousIds.split("\0").filter(Boolean));
|
|
5101
5181
|
return currentIds.split("\0").some((id) => id !== "" && !previous.has(id));
|
|
5102
5182
|
};
|
|
5103
|
-
const TableControls = ({ filters = EMPTY_FILTERS, filterResolver, filtersV2, filterPanel, searchProps, defaultShowFilters, showFilters: controlledShowFilters, setShowFilters: controlledSetShowFilters, className, tableActions, propertiesButton, isLoading, isFilterPanelLoading, showViews, canEditViews, onSelectView, views, hiddenViewIds, currentView, onAddView, onViewNameChange, onReorderViews, onViewHiddenChange, onDuplicateView, onDeleteView, onSaveView, onSetDefaultView, onUnsetDefaultView, isViewDirty, selectedRows, bulkActions, onClearSelection, title, presetViews, compact, columnConfigurationProps, showFiltersAlways = false, onError, "data-tour-target": dataTourTarget }) => {
|
|
5183
|
+
const TableControls = ({ filters = EMPTY_FILTERS, filterResolver, filtersV2, filterPanel, searchProps, defaultShowFilters, showFilters: controlledShowFilters, setShowFilters: controlledSetShowFilters, className, tableActions, propertiesButton, isLoading, isFilterPanelLoading, showViews, canEditViews, onSelectView, views, starredDefaultView, hiddenViewIds, currentView, onAddView, onViewNameChange, onReorderViews, onViewHiddenChange, onDuplicateView, onDeleteView, onSaveView, onSetDefaultView, onUnsetDefaultView, isViewDirty, selectedRows, bulkActions, onClearSelection, title, presetViews, compact, columnConfigurationProps, showFiltersAlways = false, onError, "data-tour-target": dataTourTarget }) => {
|
|
5104
5184
|
const filtersId = useId();
|
|
5105
5185
|
const enabledFilters = useMemo(() => filtersV2 != null ? EMPTY_FILTERS : filters.filter((filter) => filter.enabled !== false), [filters, filtersV2]);
|
|
5106
5186
|
const [activeFilters, setActiveFilters] = useState(() => getActiveFilters(enabledFilters, [], true, filterResolver));
|
|
@@ -5164,6 +5244,7 @@ const TableControls = ({ filters = EMPTY_FILTERS, filterResolver, filtersV2, fil
|
|
|
5164
5244
|
children: /* @__PURE__ */ jsx(ControlBar, {
|
|
5165
5245
|
showViews: compact ? false : showViews,
|
|
5166
5246
|
views: compact ? void 0 : views,
|
|
5247
|
+
starredDefaultView: compact ? void 0 : starredDefaultView,
|
|
5167
5248
|
hiddenViewIds: compact ? void 0 : hiddenViewIds,
|
|
5168
5249
|
onSelectView: compact ? void 0 : onSelectView,
|
|
5169
5250
|
currentView: compact ? void 0 : currentView,
|
|
@@ -5504,4 +5585,4 @@ function decodeBase64(input) {
|
|
|
5504
5585
|
//#endregion
|
|
5505
5586
|
export { isNumericComparisonOperator as A, useTableControls as B, useFilterBarSize as C, getOperatorsForField as D, getDefaultOperatorForType as E, getActiveFilters as F, DataTableCompactBar as H, isFilterActive as I, resolveFilterTypeDefinition as L, isValuelessOperator as M, reconcileValueForOperator as N, getOperatorsForType as O, FiltersContainer as P, TableControlsContext as R, FILTER_SIZE_TOKENS as S, emptyValueForRule as T, ControlBar as V, EMPTY_FILTER_STATE as _, encodeFilterStateToUrlParam as a, resolveValueControl as b, FilterBar_default as c, TableViewConfiguration as d, TableViewConfigurationDropdown as f, pruneToRegistry as g, isFilterStateV2 as h, decodeFilterStateFromUrl as i, isRangeOperator as j, isCompleteDateRange as k, resolveDateRangeRuleValue as l, hasCompleteValue as m, applyFilterStateToSearchParams as n, FieldRegistry as o, useFilterStateV2 as p, decodeFilterStateFromString as r, buildFieldRegistry as s, FILTER_STATE_URL_PARAM as t, TableControls as u, isEmptyState as v, NUMERIC_COMPARISON_OPERATORS as w, dateRuleIntent as x, PillShell as y, TableControlsProvider as z };
|
|
5506
5587
|
|
|
5507
|
-
//# sourceMappingURL=TableControls-
|
|
5588
|
+
//# sourceMappingURL=TableControls-qxoq5abn.mjs.map
|