@planningcenter/tapestry 4.11.0 → 4.12.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DataTable/DataTable.d.ts +47 -13
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +29 -23
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.d.ts +14 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.d.ts.map +1 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.js +10 -0
- package/dist/components/DataTable/DeleteSavedViewAlertDialog.js.map +1 -0
- package/dist/components/DataTable/ManageSavedViewsButton.d.ts +4 -1
- package/dist/components/DataTable/ManageSavedViewsButton.d.ts.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsButton.js +3 -7
- package/dist/components/DataTable/ManageSavedViewsButton.js.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.d.ts +8 -1
- package/dist/components/DataTable/ManageSavedViewsModal.d.ts.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.js +116 -5
- package/dist/components/DataTable/ManageSavedViewsModal.js.map +1 -1
- package/dist/components/DataTable/ManageSavedViewsModal.module.css.js +4 -0
- package/dist/components/DataTable/ManageSavedViewsModal.module.css.js.map +1 -0
- package/dist/components/DataTable/NewSavedViewModal.d.ts +4 -1
- package/dist/components/DataTable/NewSavedViewModal.d.ts.map +1 -1
- package/dist/components/DataTable/NewSavedViewModal.js.map +1 -1
- package/dist/components/DataTable/ResultsCount.d.ts +9 -0
- package/dist/components/DataTable/ResultsCount.d.ts.map +1 -1
- package/dist/components/DataTable/ResultsCount.js +1 -1
- package/dist/components/DataTable/ResultsCount.js.map +1 -1
- package/dist/components/DataTable/SavedViewsBar.d.ts +14 -6
- package/dist/components/DataTable/SavedViewsBar.d.ts.map +1 -1
- package/dist/components/DataTable/SavedViewsBar.js +162 -45
- package/dist/components/DataTable/SavedViewsBar.js.map +1 -1
- package/dist/components/DataTable/TableActions.d.ts.map +1 -1
- package/dist/components/DataTable/TableActions.js +4 -6
- package/dist/components/DataTable/TableActions.js.map +1 -1
- package/dist/components/DataTable/ViewSettingsToggle.d.ts.map +1 -1
- package/dist/components/DataTable/ViewSettingsToggle.js +2 -4
- package/dist/components/DataTable/ViewSettingsToggle.js.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/savedViews.d.ts +16 -15
- package/dist/components/DataTable/savedViews.d.ts.map +1 -1
- package/dist/components/DataTable/savedViews.js +28 -6
- package/dist/components/DataTable/savedViews.js.map +1 -1
- package/dist/components/DataTable/useActiveSavedView.d.ts +1 -1
- package/dist/components/DataTable/useActiveSavedView.d.ts.map +1 -1
- package/dist/components/DataTable/useActiveSavedView.js +9 -3
- package/dist/components/DataTable/useActiveSavedView.js.map +1 -1
- package/dist/components/DataTable/useFilterAnnouncement.d.ts +24 -0
- package/dist/components/DataTable/useFilterAnnouncement.d.ts.map +1 -0
- package/dist/components/DataTable/useFilterAnnouncement.js +49 -0
- package/dist/components/DataTable/useFilterAnnouncement.js.map +1 -0
- package/dist/components/DataTable/useUpdateSavedViewName.d.ts +7 -0
- package/dist/components/DataTable/useUpdateSavedViewName.d.ts.map +1 -0
- package/dist/components/DataTable/useUpdateSavedViewName.js +12 -0
- package/dist/components/DataTable/useUpdateSavedViewName.js.map +1 -0
- package/dist/components/button/ActionsDropdownIconButton.d.ts +17 -9
- package/dist/components/button/ActionsDropdownIconButton.d.ts.map +1 -1
- package/dist/components/button/ActionsDropdownIconButton.js +5 -2
- package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
- package/dist/components/button/DropdownIconButton.d.ts +4 -5
- package/dist/components/button/DropdownIconButton.d.ts.map +1 -1
- package/dist/components/button/DropdownIconButton.js +2 -1
- package/dist/components/button/DropdownIconButton.js.map +1 -1
- package/dist/components/button/IconButton.d.ts +33 -10
- package/dist/components/button/IconButton.d.ts.map +1 -1
- package/dist/components/button/IconButton.js +8 -2
- package/dist/components/button/IconButton.js.map +1 -1
- package/dist/components/button/ToggleIconButton.d.ts +2 -2
- package/dist/components/button/ToggleIconButton.d.ts.map +1 -1
- package/dist/components/button/ToggleIconButton.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.d.ts +6 -0
- package/dist/components/combo-box/ComboBox.d.ts.map +1 -1
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/internal/alert-dialog/AlertDialog.d.ts +56 -0
- package/dist/components/internal/alert-dialog/AlertDialog.d.ts.map +1 -0
- package/dist/components/internal/alert-dialog/AlertDialog.js +68 -0
- package/dist/components/internal/alert-dialog/AlertDialog.js.map +1 -0
- package/dist/components/internal/alert-dialog/index.d.ts +5 -0
- package/dist/components/internal/alert-dialog/index.d.ts.map +1 -0
- package/dist/components/internal/tooltip/Tooltip.d.ts +9 -3
- package/dist/components/internal/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/internal/tooltip/Tooltip.js +63 -8
- package/dist/components/internal/tooltip/Tooltip.js.map +1 -1
- package/dist/components/pane/PaneDivider.d.ts +5 -2
- package/dist/components/pane/PaneDivider.d.ts.map +1 -1
- package/dist/components/pane/PaneDivider.js +2 -2
- package/dist/components/pane/PaneDivider.js.map +1 -1
- package/dist/index.css +27 -27
- package/dist/index.css.map +1 -1
- package/dist/reactRender.css +1301 -1189
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1301 -1189
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/tapestryMount.css +1301 -1189
- package/dist/tapestryMount.css.map +1 -1
- package/dist/tapestryMountLegacy.css +1301 -1189
- package/dist/tapestryMountLegacy.css.map +1 -1
- package/dist/unstable.css +112 -0
- package/dist/unstable.css.map +1 -1
- package/dist/utilities/useAnnounce.d.ts +15 -0
- package/dist/utilities/useAnnounce.d.ts.map +1 -0
- package/dist/utilities/useAnnounce.js +27 -0
- package/dist/utilities/useAnnounce.js.map +1 -0
- package/package.json +3 -4
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { SavedView, StaticView } from "./savedViews";
|
|
2
3
|
export interface ManageSavedViewsModalProps {
|
|
3
4
|
onClose: () => void;
|
|
5
|
+
/** Called once the user confirms. Omit to leave out the delete buttons. */
|
|
6
|
+
onDelete?: (savedView: SavedView) => void;
|
|
7
|
+
onUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView;
|
|
4
8
|
open: boolean;
|
|
9
|
+
savedViews: SavedView[];
|
|
10
|
+
/** Listed by name before `savedViews`, since they can't be renamed. */
|
|
11
|
+
staticViews: StaticView[];
|
|
5
12
|
}
|
|
6
|
-
export declare function ManageSavedViewsModal({ onClose, open, }: ManageSavedViewsModalProps): React.JSX.Element;
|
|
13
|
+
export declare function ManageSavedViewsModal({ onClose, onDelete, onUpdate, open, savedViews, staticViews, }: ManageSavedViewsModalProps): React.JSX.Element;
|
|
7
14
|
export declare namespace ManageSavedViewsModal {
|
|
8
15
|
var displayName: string;
|
|
9
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageSavedViewsModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/ManageSavedViewsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageSavedViewsModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/ManageSavedViewsModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAI1D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAA;IACzC,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IACnE,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,uEAAuE;IACvE,WAAW,EAAE,UAAU,EAAE,CAAA;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,WAAW,GACZ,EAAE,0BAA0B,qBA0E5B;yBAjFe,qBAAqB"}
|
|
@@ -2,23 +2,134 @@ import '../button/ActionsDropdownIconButton.js';
|
|
|
2
2
|
import { Button } from '../button/Button.js';
|
|
3
3
|
import '../button/DropdownButton.js';
|
|
4
4
|
import '../button/DropdownIconButton.js';
|
|
5
|
-
import '../button/IconButton.js';
|
|
5
|
+
import { IconButton } from '../button/IconButton.js';
|
|
6
6
|
import '../button/LoadingButton.js';
|
|
7
7
|
import '../button/PageHeaderActionsDropdownButton.js';
|
|
8
|
+
import { Input } from '../input/Input.js';
|
|
8
9
|
import { Modal } from '../modal/Modal.js';
|
|
9
10
|
import { ModalBody } from '../modal/ModalBody.js';
|
|
10
11
|
import { ModalFooter } from '../modal/ModalFooter.js';
|
|
11
12
|
import { ModalHeader } from '../modal/ModalHeader.js';
|
|
12
|
-
import
|
|
13
|
+
import Icon from '../../utilities/Icon.js';
|
|
14
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
15
|
+
import { DeleteSavedViewAlertDialog } from './DeleteSavedViewAlertDialog.js';
|
|
16
|
+
import styles from './ManageSavedViewsModal.module.css.js';
|
|
17
|
+
import { useUpdateSavedViewName } from './useUpdateSavedViewName.js';
|
|
13
18
|
|
|
14
|
-
function ManageSavedViewsModal({ onClose, open, }) {
|
|
19
|
+
function ManageSavedViewsModal({ onClose, onDelete, onUpdate, open, savedViews, staticViews, }) {
|
|
20
|
+
const updateSavedViewName = useUpdateSavedViewName(onUpdate);
|
|
21
|
+
// Kept after the alert closes, so its text holds during the exit animation.
|
|
22
|
+
const [viewToDelete, setViewToDelete] = useState(null);
|
|
23
|
+
const [isDeleteAlertOpen, setIsDeleteAlertOpen] = useState(false);
|
|
24
|
+
// Without this, focus would go to the modal's close button, since the
|
|
25
|
+
// alert returns it to the delete button, which is gone with its row.
|
|
26
|
+
const { doneButtonRef, focusAfterDelete, listRef } = useFocusAfterDelete(savedViews, isDeleteAlertOpen);
|
|
27
|
+
const requestDelete = (view) => {
|
|
28
|
+
setViewToDelete(view);
|
|
29
|
+
setIsDeleteAlertOpen(true);
|
|
30
|
+
};
|
|
31
|
+
const confirmDelete = () => {
|
|
32
|
+
if (viewToDelete) {
|
|
33
|
+
focusAfterDelete(viewToDelete);
|
|
34
|
+
onDelete?.(viewToDelete);
|
|
35
|
+
}
|
|
36
|
+
setIsDeleteAlertOpen(false);
|
|
37
|
+
};
|
|
15
38
|
return (React__default.createElement(Modal, { dismissible: true, open: open, onClose: onClose },
|
|
16
39
|
React__default.createElement(ModalHeader, { title: "Manage views" }),
|
|
17
|
-
React__default.createElement(ModalBody, null,
|
|
40
|
+
React__default.createElement(ModalBody, null,
|
|
41
|
+
React__default.createElement("ul", { ref: listRef, className: styles["views-list"] },
|
|
42
|
+
staticViews.map((view) => (React__default.createElement("li", { key: view.id, className: styles["views-list-item--static"] }, view.name))),
|
|
43
|
+
savedViews.map((view, index) => (React__default.createElement("li", { key: view.id ?? `unsaved-view-${index}`, className: styles["views-list-item"] },
|
|
44
|
+
React__default.createElement(SavedViewRow
|
|
45
|
+
// Updates and deletes are matched by id, so an unsaved view
|
|
46
|
+
// can't be renamed or deleted.
|
|
47
|
+
, {
|
|
48
|
+
// Updates and deletes are matched by id, so an unsaved view
|
|
49
|
+
// can't be renamed or deleted.
|
|
50
|
+
readOnly: !onUpdate || view.id === undefined, view: view, onDelete: onDelete && view.id !== undefined
|
|
51
|
+
? (name) => requestDelete({ ...view, name })
|
|
52
|
+
: undefined, onRename: (name) => updateSavedViewName(view, name) })))))),
|
|
18
53
|
React__default.createElement(ModalFooter, null,
|
|
19
|
-
React__default.createElement(Button, { kind: "primary", label: "Done", onClick: onClose }))
|
|
54
|
+
React__default.createElement(Button, { ref: doneButtonRef, kind: "primary", label: "Done", onClick: onClose })),
|
|
55
|
+
onDelete && (React__default.createElement(DeleteSavedViewAlertDialog, { open: isDeleteAlertOpen, view: viewToDelete, onCancel: () => setIsDeleteAlertOpen(false), onConfirm: confirmDelete }))));
|
|
20
56
|
}
|
|
21
57
|
ManageSavedViewsModal.displayName = "ManageSavedViewsModal";
|
|
58
|
+
/**
|
|
59
|
+
* Moves focus off a deleted view's row in two steps: `focusAfterDelete` picks
|
|
60
|
+
* the target while the row is still there, and focus moves to it once the
|
|
61
|
+
* alert starts closing.
|
|
62
|
+
*/
|
|
63
|
+
function useFocusAfterDelete(savedViews, isDeleteAlertOpen) {
|
|
64
|
+
const listRef = useRef(null);
|
|
65
|
+
const doneButtonRef = useRef(null);
|
|
66
|
+
const focusTargetRef = useRef(null);
|
|
67
|
+
// Step 1: the next view's row, or the previous one's if the deleted view is
|
|
68
|
+
// last, or Done if it's the only one.
|
|
69
|
+
const focusAfterDelete = (view) => {
|
|
70
|
+
const rows = listRef.current?.querySelectorAll(`.${styles["views-list-item"]}`) ?? [];
|
|
71
|
+
const index = savedViews.findIndex(({ id }) => id === view.id);
|
|
72
|
+
const row = rows[index + 1] ?? rows[index - 1];
|
|
73
|
+
focusTargetRef.current =
|
|
74
|
+
row?.querySelector("button") ??
|
|
75
|
+
row?.querySelector("input") ??
|
|
76
|
+
doneButtonRef.current;
|
|
77
|
+
};
|
|
78
|
+
// Step 2: a closing alert no longer holds focus, and doesn't take it back
|
|
79
|
+
// once focus is outside it.
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (isDeleteAlertOpen)
|
|
82
|
+
return;
|
|
83
|
+
focusTargetRef.current?.focus();
|
|
84
|
+
focusTargetRef.current = null;
|
|
85
|
+
}, [isDeleteAlertOpen]);
|
|
86
|
+
return { doneButtonRef, focusAfterDelete, listRef };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A saved view's name field and delete button. Renames on blur or Enter. An
|
|
90
|
+
* empty name reverts to the current one. Tracks the last name it sent, so
|
|
91
|
+
* Enter followed by blur renames once. Deleting sends a pending rename first,
|
|
92
|
+
* then passes along the name, so the alert shows what the field does.
|
|
93
|
+
*/
|
|
94
|
+
function SavedViewRow({ onDelete, onRename, readOnly, view, }) {
|
|
95
|
+
const [name, setName] = useState(view.name);
|
|
96
|
+
const committedName = useRef(view.name);
|
|
97
|
+
// Picks up names changed outside this field, including once a rename saves,
|
|
98
|
+
// unless the field has newer edits, which its next blur or Enter sends.
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const previousName = committedName.current;
|
|
101
|
+
committedName.current = view.name;
|
|
102
|
+
setName((currentName) => currentName === previousName ? view.name : currentName);
|
|
103
|
+
}, [view.name]);
|
|
104
|
+
const commit = () => {
|
|
105
|
+
const trimmedName = name.trim();
|
|
106
|
+
if (!trimmedName) {
|
|
107
|
+
setName(committedName.current);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
setName(trimmedName);
|
|
111
|
+
if (trimmedName === committedName.current)
|
|
112
|
+
return;
|
|
113
|
+
committedName.current = trimmedName;
|
|
114
|
+
onRename(trimmedName);
|
|
115
|
+
};
|
|
116
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
117
|
+
React__default.createElement(Input, { autoComplete: "off", className: styles["view-list-item-input"], hideLabel: true, label: `Name for ${view.name}`, readOnly: readOnly, required: !readOnly, value: name, onBlur: readOnly ? undefined : commit, onChange: (event) => setName(event.target.value), onKeyDown: (event) => {
|
|
118
|
+
if (!readOnly &&
|
|
119
|
+
event.key === "Enter" &&
|
|
120
|
+
!event.repeat &&
|
|
121
|
+
!event.nativeEvent.isComposing) {
|
|
122
|
+
commit();
|
|
123
|
+
}
|
|
124
|
+
} }),
|
|
125
|
+
onDelete && (React__default.createElement(IconButton, { "aria-label": `Delete ${view.name}`, icon: React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#trash" }), kind: "ghost", tooltip: "Delete", onClick: (event) => {
|
|
126
|
+
// Safari doesn't focus a button on click, and the alert returns
|
|
127
|
+
// focus to whatever had it when it opened. Focusing also blurs
|
|
128
|
+
// the field, which sends a pending rename.
|
|
129
|
+
event.currentTarget.focus();
|
|
130
|
+
onDelete(committedName.current);
|
|
131
|
+
} }))));
|
|
132
|
+
}
|
|
22
133
|
|
|
23
134
|
export { ManageSavedViewsModal };
|
|
24
135
|
//# sourceMappingURL=ManageSavedViewsModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageSavedViewsModal.js","sources":["../../../src/components/DataTable/ManageSavedViewsModal.tsx"],"sourcesContent":["import { Button } from \"@components/button\"\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from \"@components/modal\"\nimport React from \"react\"\n\nexport interface ManageSavedViewsModalProps {\n onClose: () => void\n open: boolean\n}\n\nexport function ManageSavedViewsModal({\n onClose,\n open,\n}: ManageSavedViewsModalProps) {\n return (\n <Modal dismissible open={open} onClose={onClose}>\n <ModalHeader title=\"Manage views\" />\n <ModalBody>{null}</ModalBody>\n <ModalFooter>\n <Button kind=\"primary\" label=\"Done\" onClick={onClose} />\n </ModalFooter>\n </Modal>\n )\n}\n\nManageSavedViewsModal.displayName = \"ManageSavedViewsModal\"\n"],"names":["React"],"mappings":";;;;;;;;;;;;;SASgB,qBAAqB,CAAC,EACpC,OAAO,EACP,IAAI,GACuB,EAAA;AAC3B,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,WAAW,EAAA,IAAA,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAA;AAC7C,QAAAA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EAAC,KAAK,EAAC,cAAc,EAAA,CAAG;QACpCA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,IAAA,EAAE,IAAI,CAAa;AAC7B,QAAAA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,IAAA;AACV,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,CAC5C,CACR;AAEZ;AAEA,qBAAqB,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
1
|
+
{"version":3,"file":"ManageSavedViewsModal.js","sources":["../../../src/components/DataTable/ManageSavedViewsModal.tsx"],"sourcesContent":["import { Button, IconButton } from \"@components/button\"\nimport { Input } from \"@components/input\"\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from \"@components/modal\"\nimport Icon from \"@utilities/Icon\"\nimport React, { useEffect, useRef, useState } from \"react\"\n\nimport { DeleteSavedViewAlertDialog } from \"./DeleteSavedViewAlertDialog\"\nimport styles from \"./ManageSavedViewsModal.module.css\"\nimport type { SavedView, StaticView } from \"./savedViews\"\nimport { useUpdateSavedViewName } from \"./useUpdateSavedViewName\"\n\nexport interface ManageSavedViewsModalProps {\n onClose: () => void\n /** Called once the user confirms. Omit to leave out the delete buttons. */\n onDelete?: (savedView: SavedView) => void\n onUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView\n open: boolean\n savedViews: SavedView[]\n /** Listed by name before `savedViews`, since they can't be renamed. */\n staticViews: StaticView[]\n}\n\nexport function ManageSavedViewsModal({\n onClose,\n onDelete,\n onUpdate,\n open,\n savedViews,\n staticViews,\n}: ManageSavedViewsModalProps) {\n const updateSavedViewName = useUpdateSavedViewName(onUpdate)\n // Kept after the alert closes, so its text holds during the exit animation.\n const [viewToDelete, setViewToDelete] = useState<SavedView | null>(null)\n const [isDeleteAlertOpen, setIsDeleteAlertOpen] = useState(false)\n // Without this, focus would go to the modal's close button, since the\n // alert returns it to the delete button, which is gone with its row.\n const { doneButtonRef, focusAfterDelete, listRef } = useFocusAfterDelete(\n savedViews,\n isDeleteAlertOpen\n )\n\n const requestDelete = (view: SavedView) => {\n setViewToDelete(view)\n setIsDeleteAlertOpen(true)\n }\n\n const confirmDelete = () => {\n if (viewToDelete) {\n focusAfterDelete(viewToDelete)\n onDelete?.(viewToDelete)\n }\n setIsDeleteAlertOpen(false)\n }\n\n return (\n <Modal dismissible open={open} onClose={onClose}>\n <ModalHeader title=\"Manage views\" />\n <ModalBody>\n <ul ref={listRef} className={styles[\"views-list\"]}>\n {staticViews.map((view) => (\n <li key={view.id} className={styles[\"views-list-item--static\"]}>\n {view.name}\n </li>\n ))}\n {savedViews.map((view, index) => (\n <li\n key={view.id ?? `unsaved-view-${index}`}\n className={styles[\"views-list-item\"]}\n >\n <SavedViewRow\n // Updates and deletes are matched by id, so an unsaved view\n // can't be renamed or deleted.\n readOnly={!onUpdate || view.id === undefined}\n view={view}\n onDelete={\n onDelete && view.id !== undefined\n ? (name) => requestDelete({ ...view, name })\n : undefined\n }\n onRename={(name) => updateSavedViewName(view, name)}\n />\n </li>\n ))}\n </ul>\n </ModalBody>\n <ModalFooter>\n <Button\n ref={doneButtonRef}\n kind=\"primary\"\n label=\"Done\"\n onClick={onClose}\n />\n </ModalFooter>\n {onDelete && (\n <DeleteSavedViewAlertDialog\n open={isDeleteAlertOpen}\n view={viewToDelete}\n onCancel={() => setIsDeleteAlertOpen(false)}\n onConfirm={confirmDelete}\n />\n )}\n </Modal>\n )\n}\n\nManageSavedViewsModal.displayName = \"ManageSavedViewsModal\"\n\n/**\n * Moves focus off a deleted view's row in two steps: `focusAfterDelete` picks\n * the target while the row is still there, and focus moves to it once the\n * alert starts closing.\n */\nfunction useFocusAfterDelete(\n savedViews: SavedView[],\n isDeleteAlertOpen: boolean\n) {\n const listRef = useRef<HTMLUListElement>(null)\n const doneButtonRef = useRef<HTMLButtonElement>(null)\n const focusTargetRef = useRef<HTMLElement | null>(null)\n\n // Step 1: the next view's row, or the previous one's if the deleted view is\n // last, or Done if it's the only one.\n const focusAfterDelete = (view: SavedView) => {\n const rows =\n listRef.current?.querySelectorAll(`.${styles[\"views-list-item\"]}`) ?? []\n const index = savedViews.findIndex(({ id }) => id === view.id)\n const row = rows[index + 1] ?? rows[index - 1]\n focusTargetRef.current =\n row?.querySelector(\"button\") ??\n row?.querySelector(\"input\") ??\n doneButtonRef.current\n }\n\n // Step 2: a closing alert no longer holds focus, and doesn't take it back\n // once focus is outside it.\n useEffect(() => {\n if (isDeleteAlertOpen) return\n focusTargetRef.current?.focus()\n focusTargetRef.current = null\n }, [isDeleteAlertOpen])\n\n return { doneButtonRef, focusAfterDelete, listRef }\n}\n\n/**\n * A saved view's name field and delete button. Renames on blur or Enter. An\n * empty name reverts to the current one. Tracks the last name it sent, so\n * Enter followed by blur renames once. Deleting sends a pending rename first,\n * then passes along the name, so the alert shows what the field does.\n */\nfunction SavedViewRow({\n onDelete,\n onRename,\n readOnly,\n view,\n}: {\n onDelete?: (name: string) => void\n onRename: (name: string) => void\n readOnly: boolean\n view: SavedView\n}) {\n const [name, setName] = useState(view.name)\n const committedName = useRef(view.name)\n\n // Picks up names changed outside this field, including once a rename saves,\n // unless the field has newer edits, which its next blur or Enter sends.\n useEffect(() => {\n const previousName = committedName.current\n committedName.current = view.name\n setName((currentName) =>\n currentName === previousName ? view.name : currentName\n )\n }, [view.name])\n\n const commit = () => {\n const trimmedName = name.trim()\n if (!trimmedName) {\n setName(committedName.current)\n return\n }\n setName(trimmedName)\n if (trimmedName === committedName.current) return\n committedName.current = trimmedName\n onRename(trimmedName)\n }\n\n return (\n <>\n <Input\n autoComplete=\"off\"\n className={styles[\"view-list-item-input\"]}\n hideLabel\n label={`Name for ${view.name}`}\n readOnly={readOnly}\n required={!readOnly}\n value={name}\n onBlur={readOnly ? undefined : commit}\n onChange={(event) => setName(event.target.value)}\n onKeyDown={(event) => {\n if (\n !readOnly &&\n event.key === \"Enter\" &&\n !event.repeat &&\n !event.nativeEvent.isComposing\n ) {\n commit()\n }\n }}\n />\n {onDelete && (\n <IconButton\n aria-label={`Delete ${view.name}`}\n icon={<Icon aria-hidden symbol=\"general#trash\" />}\n kind=\"ghost\"\n tooltip=\"Delete\"\n onClick={(event) => {\n // Safari doesn't focus a button on click, and the alert returns\n // focus to whatever had it when it opened. Focusing also blurs\n // the field, which sends a pending rename.\n event.currentTarget.focus()\n onDelete(committedName.current)\n }}\n />\n )}\n </>\n )\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAsBM,SAAU,qBAAqB,CAAC,EACpC,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,WAAW,GACgB,EAAA;AAC3B,IAAA,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,QAAQ,CAAC;;IAE5D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC;IACxE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;;;AAGjE,IAAA,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,mBAAmB,CACtE,UAAU,EACV,iBAAiB,CAClB;AAED,IAAA,MAAM,aAAa,GAAG,CAAC,IAAe,KAAI;QACxC,eAAe,CAAC,IAAI,CAAC;QACrB,oBAAoB,CAAC,IAAI,CAAC;AAC5B,IAAA,CAAC;IAED,MAAM,aAAa,GAAG,MAAK;QACzB,IAAI,YAAY,EAAE;YAChB,gBAAgB,CAAC,YAAY,CAAC;AAC9B,YAAA,QAAQ,GAAG,YAAY,CAAC;QAC1B;QACA,oBAAoB,CAAC,KAAK,CAAC;AAC7B,IAAA,CAAC;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,WAAW,EAAA,IAAA,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAA;AAC7C,QAAAA,cAAA,CAAA,aAAA,CAAC,W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sBAAsB,CAAC,EACzC,SAAS,EAAA,IAAA,EACT,KAAK,EAAE,CAAA,SAAA,EAAY,IAAI,CAAC,IAAI,CAAA,CAAE,EAC9B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,QAAQ,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,EACrC,QAAQ,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAChD,SAAS,EAAE,CAAC,KAAK,KAAI;AACnB,gBAAA,IACE,CAAC,QAAQ;oBACT,KAAK,CAAC,GAAG,KAAK,OAAO;oBACrB,CAAC,KAAK,CAAC,MAAM;AACb,oBAAA,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAC9B;AACA,oBAAA,MAAM,EAAE;gBACV;AACF,YAAA,CAAC,EAAA,CACD;AACD,QAAA,QAAQ,KACPA,cAAA,CAAA,aAAA,CAAC,UAAU,kBACG,CAAA,OAAA,EAAU,IAAI,CAAC,IAAI,EAAE,EACjC,IAAI,EAAEA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,aAAA,EAAA,IAAA,EAAa,MAAM,EAAC,eAAe,EAAA,CAAG,EACjD,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,CAAC,KAAK,KAAI;;;;AAIjB,gBAAA,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAC3B,gBAAA,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACjC,YAAA,CAAC,EAAA,CACD,CACH,CACA;AAEP;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var styles = {"views-list":"views-list-3AMVI","views-list-item":"views-list-item-cWGsC","view-list-item-input":"view-list-item-input-dowHY","views-list-item--static":"views-list-item--static-9zGpJ"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
4
|
+
//# sourceMappingURL=ManageSavedViewsModal.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManageSavedViewsModal.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface NewSavedViewModalProps {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Prefills the name field, e.g. with "Active copy" when duplicating or the
|
|
5
|
+
* current name when renaming.
|
|
6
|
+
*/
|
|
4
7
|
defaultName?: string;
|
|
5
8
|
onClose: () => void;
|
|
6
9
|
onSave: (name: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewSavedViewModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/NewSavedViewModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACrC
|
|
1
|
+
{"version":3,"file":"NewSavedViewModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/NewSavedViewModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAgB,EAChB,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAkB,GACnB,EAAE,sBAAsB,qBAWxB;yBAjBe,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewSavedViewModal.js","sources":["../../../src/components/DataTable/NewSavedViewModal.tsx"],"sourcesContent":["import { Button } from \"@components/button\"\nimport { Input } from \"@components/input\"\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from \"@components/modal\"\nimport { useId } from \"@utilities/useId\"\nimport React, { useEffect, useRef, useState } from \"react\"\n\nexport interface NewSavedViewModalProps {\n
|
|
1
|
+
{"version":3,"file":"NewSavedViewModal.js","sources":["../../../src/components/DataTable/NewSavedViewModal.tsx"],"sourcesContent":["import { Button } from \"@components/button\"\nimport { Input } from \"@components/input\"\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from \"@components/modal\"\nimport { useId } from \"@utilities/useId\"\nimport React, { useEffect, useRef, useState } from \"react\"\n\nexport interface NewSavedViewModalProps {\n /**\n * Prefills the name field, e.g. with \"Active copy\" when duplicating or the\n * current name when renaming.\n */\n defaultName?: string\n onClose: () => void\n onSave: (name: string) => void\n open: boolean\n /** Default `\"New view\"`. */\n title?: string\n}\n\nexport function NewSavedViewModal({\n defaultName = \"\",\n onClose,\n onSave,\n open,\n title = \"New view\",\n}: NewSavedViewModalProps) {\n return (\n <Modal dismissible open={open} size=\"sm\" onClose={onClose}>\n <ModalHeader title={title} />\n <NewSavedViewForm\n defaultName={defaultName}\n onClose={onClose}\n onSave={onSave}\n />\n </Modal>\n )\n}\n\nNewSavedViewModal.displayName = \"NewSavedViewModal\"\n\n/**\n * Holds the field's state below the modal, which unmounts its contents when\n * closed, so each open starts over from `defaultName`.\n */\nfunction NewSavedViewForm({\n defaultName,\n onClose,\n onSave,\n}: Required<Omit<NewSavedViewModalProps, \"open\" | \"title\">>) {\n const formId = `tds-data-table-new-saved-view-${useId()}`\n const [name, setName] = useState(defaultName)\n const [invalid, setInvalid] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n\n // Focuses in an effect rather than with `autoFocus`, which runs before a\n // closing context menu releases focus and so gets pulled back into it.\n useEffect(() => {\n inputRef.current?.focus()\n }, [])\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n const trimmedName = name.trim()\n if (!trimmedName) {\n setInvalid(true)\n return\n }\n onSave(trimmedName)\n onClose()\n }\n\n return (\n <>\n <ModalBody>\n <form id={formId} noValidate onSubmit={handleSubmit}>\n <Input\n ref={inputRef}\n autoComplete=\"off\"\n description={invalid ? \"Enter a name for this view.\" : undefined}\n invalid={invalid}\n label=\"Name\"\n required\n selectTextOnFocus\n value={name}\n onChange={(event) => {\n setName(event.target.value)\n setInvalid(false)\n }}\n />\n </form>\n </ModalBody>\n <ModalFooter>\n <Button kind=\"ghost\" label=\"Cancel\" onClick={onClose} />\n <Button form={formId} kind=\"primary\" label=\"Save\" type=\"submit\" />\n </ModalFooter>\n </>\n )\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;SAmBgB,iBAAiB,CAAC,EAChC,WAAW,GAAG,EAAE,EAChB,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,GAAG,UAAU,GACK,EAAA;AACvB,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,WAAW,QAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,OAAO,EAAA;AACvD,QAAAA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,CAAI;AAC7B,QAAAA,cAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,EACf,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EAAA,CACd,CACI;AAEZ;AAEA,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;AAEnD;;;AAGG;AACH,SAAS,gBAAgB,CAAC,EACxB,WAAW,EACX,OAAO,EACP,MAAM,GACmD,EAAA;AACzD,IAAA,MAAM,MAAM,GAAG,CAAA,8BAAA,EAAiC,KAAK,EAAE,EAAE;IACzD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;IAC7C,MAAM,C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,YAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,EAAA,CAAI;YACxDA,cAAA,CAAA,aAAA,CAAC,MAAM,IAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,QAAQ,EAAA,CAAG,CACtD,CACb;AAEP;;;;"}
|
|
@@ -56,6 +56,15 @@ export declare const ResultsCount: {
|
|
|
56
56
|
* rendered above the table groups digits the same way.
|
|
57
57
|
*/
|
|
58
58
|
export declare function formatCount(count: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* Builds the results-count label, e.g. `"1 result"`, `"1,234 results"`, or
|
|
61
|
+
* `"2 people"`. The count is formatted with `Intl.NumberFormat` and the
|
|
62
|
+
* singular noun is used only when the count is 1, every other count uses the
|
|
63
|
+
* plural. `resultNoun` may be a string (the plural appends `"s"`), a
|
|
64
|
+
* `[singular, plural]` tuple (the plural is supplied explicitly), or `true`
|
|
65
|
+
* (the noun defaults to `"result"`).
|
|
66
|
+
*/
|
|
67
|
+
export declare function getResultsCountLabel(count: number, resultNoun: Exclude<ResultNoun, false>): string;
|
|
59
68
|
/**
|
|
60
69
|
* Picks the singular or plural noun for `count` (singular only when `count` is
|
|
61
70
|
* 1, matching English pluralization).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultsCount.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/ResultsCount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE9E,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAE3E;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;iEAMtB,iBAAiB;;CAuBnB,CAAA;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;
|
|
1
|
+
{"version":3,"file":"ResultsCount.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/ResultsCount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE9E,MAAM,WAAW,iBAAiB;IAChC,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAE3E;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;iEAMtB,iBAAiB;;CAuBnB,CAAA;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,GACrC,MAAM,CAIR;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,GACrC,MAAM,CAOR"}
|
|
@@ -90,5 +90,5 @@ function resolveNoun(count, resultNoun) {
|
|
|
90
90
|
return count === 1 ? singular : plural;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
export { ResultsCount, formatCount, hasResultsCount, resolveNoun, resolveResultNounLabel };
|
|
93
|
+
export { ResultsCount, formatCount, getResultsCountLabel, hasResultsCount, resolveNoun, resolveResultNounLabel };
|
|
94
94
|
//# sourceMappingURL=ResultsCount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultsCount.js","sources":["../../../src/components/DataTable/ResultsCount.tsx"],"sourcesContent":["import React from \"react\"\n\n/**\n * A noun for the results count. A string uses it as the singular and appends\n * `\"s\"` for the plural; a `[singular, plural]` tuple supplies an irregular\n * plural; `true` defaults the noun to `\"result\"`; `false` renders no count.\n */\nexport type ResultNoun = boolean | string | [singular: string, plural: string]\n\nexport interface ResultsCountProps {\n /** An `id` for the rendered element so the table can link it via `aria-describedby`. */\n id: string\n /**\n * The noun (and whether to render a count at all). See {@link ResultNoun}.\n * When `false` or omitted, nothing renders.\n */\n resultNoun?: ResultNoun\n /** Whether the table is selectable. */\n selectable?: boolean\n /** The number of currently selected rows. */\n selectedCount?: number\n /**\n * The total number of results: the caller's explicit `resultCount` when\n * supplied, otherwise `data.length`.\n */\n totalCount: number\n}\n\n/**\n * Whether a {@link ResultsCount} will render anything for the given\n * `resultNoun`. A count is shown only when a noun is supplied, so callers can\n * use this to decide whether to link the count via `aria-describedby`.\n */\nexport function hasResultsCount(resultNoun: ResultNoun | undefined): boolean {\n return Boolean(resultNoun)\n}\n\n/**\n * Resolves a {@link ResultNoun} to a plain string usable as the table's\n * `aria-label`, e.g. `\"people\"` or `\"items\"`. Uses the plural form — appending\n * `\"s\"` to a string noun and taking the second element of a `[singular,\n * plural]` tuple — to match the count label. Returns `undefined` when no\n * meaningful noun is supplied — including the `true` default, which carries no\n * caller-provided label — so callers can fall back to their own `aria-label`.\n */\nexport function resolveResultNounLabel(\n resultNoun: ResultNoun | undefined\n): string | undefined {\n if (!resultNoun || resultNoun === true) return undefined\n // A count other than 1 selects the plural form.\n return resolveNoun(2, resultNoun)\n}\n\n/**\n * Renders the results count displayed above the table, e.g. `\"1 result\"`,\n * `\"1,234 results\"`, or `\"2 people\"`. When the table is `selectable` and rows\n * are selected, the count reflects the selection as `\"{selected} of {total}\"`,\n * e.g. `\"2 of 100\"`. That terse visible form is ambiguous on its own, so a\n * visually-hidden suffix names what the numbers refer to for assistive tech —\n * `\"2 of 100 people selected\"`. Renders nothing when `resultNoun` is `false` or\n * omitted.\n */\nexport const ResultsCount = ({\n id,\n resultNoun,\n selectable,\n selectedCount = 0,\n totalCount,\n}: ResultsCountProps) => {\n if (!resultNoun) return null\n\n // When the table is selectable and rows are selected, the count reflects the\n // selection as `\"{selected} of {total}\"` (e.g. `\"2 of 100\"`) rather than the\n // total row count.\n const hasSelection = Boolean(selectable && selectedCount)\n const label = hasSelection\n ? `${formatCount(selectedCount)} of ${formatCount(totalCount)}`\n : getResultsCountLabel(totalCount, resultNoun)\n\n return (\n <p id={id} className=\"tds-data-table-results-count\">\n {label}\n {hasSelection && (\n // The noun agrees with the total rather than the selected count, so a\n // single selection out of many still reads `\"1 of 57 people selected\"`.\n <span className=\"tds-data-table-results-count-label--hidden\">\n {`${resolveNoun(totalCount, resultNoun)} selected`}\n </span>\n )}\n </p>\n )\n}\n\nResultsCount.displayName = \"ResultsCount\"\n\nconst numberFormatter = new Intl.NumberFormat()\n\n/**\n * Formats a count for display, e.g. `1234` as `\"1,234\"`. Shared so every count\n * rendered above the table groups digits the same way.\n */\nexport function formatCount(count: number): string {\n return numberFormatter.format(count)\n}\n\n/**\n * Builds the results-count label, e.g. `\"1 result\"`, `\"1,234 results\"`, or\n * `\"2 people\"`. The count is formatted with `Intl.NumberFormat` and the\n * singular noun is used only when the count is 1, every other count uses the\n * plural. `resultNoun` may be a string (the plural appends `\"s\"`), a\n * `[singular, plural]` tuple (the plural is supplied explicitly), or `true`\n * (the noun defaults to `\"result\"`).\n */\
|
|
1
|
+
{"version":3,"file":"ResultsCount.js","sources":["../../../src/components/DataTable/ResultsCount.tsx"],"sourcesContent":["import React from \"react\"\n\n/**\n * A noun for the results count. A string uses it as the singular and appends\n * `\"s\"` for the plural; a `[singular, plural]` tuple supplies an irregular\n * plural; `true` defaults the noun to `\"result\"`; `false` renders no count.\n */\nexport type ResultNoun = boolean | string | [singular: string, plural: string]\n\nexport interface ResultsCountProps {\n /** An `id` for the rendered element so the table can link it via `aria-describedby`. */\n id: string\n /**\n * The noun (and whether to render a count at all). See {@link ResultNoun}.\n * When `false` or omitted, nothing renders.\n */\n resultNoun?: ResultNoun\n /** Whether the table is selectable. */\n selectable?: boolean\n /** The number of currently selected rows. */\n selectedCount?: number\n /**\n * The total number of results: the caller's explicit `resultCount` when\n * supplied, otherwise `data.length`.\n */\n totalCount: number\n}\n\n/**\n * Whether a {@link ResultsCount} will render anything for the given\n * `resultNoun`. A count is shown only when a noun is supplied, so callers can\n * use this to decide whether to link the count via `aria-describedby`.\n */\nexport function hasResultsCount(resultNoun: ResultNoun | undefined): boolean {\n return Boolean(resultNoun)\n}\n\n/**\n * Resolves a {@link ResultNoun} to a plain string usable as the table's\n * `aria-label`, e.g. `\"people\"` or `\"items\"`. Uses the plural form — appending\n * `\"s\"` to a string noun and taking the second element of a `[singular,\n * plural]` tuple — to match the count label. Returns `undefined` when no\n * meaningful noun is supplied — including the `true` default, which carries no\n * caller-provided label — so callers can fall back to their own `aria-label`.\n */\nexport function resolveResultNounLabel(\n resultNoun: ResultNoun | undefined\n): string | undefined {\n if (!resultNoun || resultNoun === true) return undefined\n // A count other than 1 selects the plural form.\n return resolveNoun(2, resultNoun)\n}\n\n/**\n * Renders the results count displayed above the table, e.g. `\"1 result\"`,\n * `\"1,234 results\"`, or `\"2 people\"`. When the table is `selectable` and rows\n * are selected, the count reflects the selection as `\"{selected} of {total}\"`,\n * e.g. `\"2 of 100\"`. That terse visible form is ambiguous on its own, so a\n * visually-hidden suffix names what the numbers refer to for assistive tech —\n * `\"2 of 100 people selected\"`. Renders nothing when `resultNoun` is `false` or\n * omitted.\n */\nexport const ResultsCount = ({\n id,\n resultNoun,\n selectable,\n selectedCount = 0,\n totalCount,\n}: ResultsCountProps) => {\n if (!resultNoun) return null\n\n // When the table is selectable and rows are selected, the count reflects the\n // selection as `\"{selected} of {total}\"` (e.g. `\"2 of 100\"`) rather than the\n // total row count.\n const hasSelection = Boolean(selectable && selectedCount)\n const label = hasSelection\n ? `${formatCount(selectedCount)} of ${formatCount(totalCount)}`\n : getResultsCountLabel(totalCount, resultNoun)\n\n return (\n <p id={id} className=\"tds-data-table-results-count\">\n {label}\n {hasSelection && (\n // The noun agrees with the total rather than the selected count, so a\n // single selection out of many still reads `\"1 of 57 people selected\"`.\n <span className=\"tds-data-table-results-count-label--hidden\">\n {`${resolveNoun(totalCount, resultNoun)} selected`}\n </span>\n )}\n </p>\n )\n}\n\nResultsCount.displayName = \"ResultsCount\"\n\nconst numberFormatter = new Intl.NumberFormat()\n\n/**\n * Formats a count for display, e.g. `1234` as `\"1,234\"`. Shared so every count\n * rendered above the table groups digits the same way.\n */\nexport function formatCount(count: number): string {\n return numberFormatter.format(count)\n}\n\n/**\n * Builds the results-count label, e.g. `\"1 result\"`, `\"1,234 results\"`, or\n * `\"2 people\"`. The count is formatted with `Intl.NumberFormat` and the\n * singular noun is used only when the count is 1, every other count uses the\n * plural. `resultNoun` may be a string (the plural appends `\"s\"`), a\n * `[singular, plural]` tuple (the plural is supplied explicitly), or `true`\n * (the noun defaults to `\"result\"`).\n */\nexport function getResultsCountLabel(\n count: number,\n resultNoun: Exclude<ResultNoun, false>\n): string {\n const noun = resolveNoun(count, resultNoun)\n const formattedCount = formatCount(count)\n return `${formattedCount} ${noun}`\n}\n\n/**\n * Picks the singular or plural noun for `count` (singular only when `count` is\n * 1, matching English pluralization).\n * `resultNoun` may be a string (the plural appends `\"s\"`), a\n * `[singular, plural]` tuple, or `true` (the noun defaults to `\"result\"`).\n *\n * Shared with the table actions' `aria-label` suffix so every count rendered\n * above the table pluralizes identically.\n */\nexport function resolveNoun(\n count: number,\n resultNoun: Exclude<ResultNoun, false>\n): string {\n const [singular, plural] = Array.isArray(resultNoun)\n ? resultNoun\n : resultNoun === true\n ? [\"result\", \"results\"]\n : [resultNoun, `${resultNoun}s`]\n return count === 1 ? singular : plural\n}\n"],"names":["React"],"mappings":";;AA4BA;;;;AAIG;AACG,SAAU,eAAe,CAAC,UAAkC,EAAA;AAChE,IAAA,OAAO,OAAO,CAAC,UAAU,CAAC;AAC5B;AAEA;;;;;;;AAOG;AACG,SAAU,sBAAsB,CACpC,UAAkC,EAAA;AAElC,IAAA,IAAI,CAAC,UAAU,IAAI,UAAU,KAAK,IAAI;AAAE,QAAA,OAAO,SAAS;;AAExD,IAAA,OAAO,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC;AACnC;AAEA;;;;;;;;AAQG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,EAAE,EACF,UAAU,EACV,UAAU,EACV,aAAa,GAAG,CAAC,EACjB,UAAU,GACQ,KAAI;AACtB,IAAA,IAAI,CAAC,UAAU;AAAE,QAAA,OAAO,IAAI;;;;IAK5B,MAAM,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AK,KAAK,CAAC,GAAG,QAAQ,GAAG,MAAM;AACxC;;;;"}
|
|
@@ -2,22 +2,30 @@ import React from "react";
|
|
|
2
2
|
import type { Sort } from "./DataTable";
|
|
3
3
|
import type { DataTableColumn } from "./DataTableColumn";
|
|
4
4
|
import type { ActiveFilter } from "./FilterTypes";
|
|
5
|
-
import { type SavedView, type
|
|
5
|
+
import { type SavedView, type StaticView } from "./savedViews";
|
|
6
6
|
export interface SavedViewsBarProps {
|
|
7
7
|
activeFilters: ActiveFilter[];
|
|
8
|
+
defaultViewId: NonNullable<SavedView["id"]>;
|
|
8
9
|
hideableColumns: DataTableColumn[];
|
|
9
10
|
isColumnVisible: (column: DataTableColumn) => boolean;
|
|
10
11
|
onApply: (savedView: SavedView) => void;
|
|
11
12
|
/**
|
|
12
|
-
* Returns the
|
|
13
|
-
*
|
|
13
|
+
* Returns the saved view with its new id. Omit to hide the new view button
|
|
14
|
+
* and the Duplicate action.
|
|
14
15
|
*/
|
|
15
|
-
onCreate?: (savedView: Omit<SavedView, "id">) => Promise<SavedView
|
|
16
|
+
onCreate?: (savedView: Omit<SavedView, "id">) => Promise<SavedView> | SavedView;
|
|
17
|
+
/** Called once the user confirms. Omit to leave out the Delete action. */
|
|
18
|
+
onDelete?: (savedView: SavedView) => void;
|
|
19
|
+
/** Omit to leave out the Set as default action. */
|
|
20
|
+
onSetDefault?: (id: NonNullable<SavedView["id"]>) => void;
|
|
21
|
+
/** Omit to leave out the Rename action. */
|
|
22
|
+
onUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView;
|
|
16
23
|
savedViews: SavedView[];
|
|
17
|
-
savedViewsOptions?: SavedViewsOptions;
|
|
18
24
|
sortBy: Sort | undefined;
|
|
25
|
+
/** Listed before `savedViews` and can't be edited. */
|
|
26
|
+
staticViews: StaticView[];
|
|
19
27
|
}
|
|
20
|
-
export declare function SavedViewsBar({ onApply, onCreate, savedViews, activeFilters, hideableColumns, isColumnVisible, sortBy, }: SavedViewsBarProps): React.JSX.Element;
|
|
28
|
+
export declare function SavedViewsBar({ defaultViewId, onApply, onCreate, onDelete, onSetDefault, onUpdate, savedViews, staticViews, activeFilters, hideableColumns, isColumnVisible, sortBy, }: SavedViewsBarProps): React.JSX.Element;
|
|
21
29
|
export declare namespace SavedViewsBar {
|
|
22
30
|
var displayName: string;
|
|
23
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavedViewsBar.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/SavedViewsBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SavedViewsBar.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/SavedViewsBar.tsx"],"names":[],"mappings":"AAUA,OAAO,KAaN,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAKjD,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,cAAc,CAAA;AAUrB,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,aAAa,EAAE,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3C,eAAe,EAAE,eAAe,EAAE,CAAA;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAA;IACrD,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAA;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CACT,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAC7B,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAA;IACzC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