@jobber/components 6.26.0 → 6.26.2
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/AnimatedPresence-es.js +4 -4
- package/dist/AnimatedSwitcher-es.js +4 -4
- package/dist/AtlantisThemeContext-es.js +6 -6
- package/dist/Autocomplete-es.js +27 -27
- package/dist/Avatar-es.js +4 -4
- package/dist/Banner-es.js +13 -13
- package/dist/BannerIcon-es.js +3 -3
- package/dist/Body-es.js +12 -12
- package/dist/Box-es.js +2 -2
- package/dist/Button-es.js +13 -13
- package/dist/ButtonDismiss-es.js +2 -2
- package/dist/Card-es.js +15 -15
- package/dist/Checkbox/index.mjs +24 -24
- package/dist/Chip-es.js +17 -17
- package/dist/ChipDismissible-es.js +7 -7
- package/dist/Chips/index.mjs +3 -3
- package/dist/Chips-es.js +13 -13
- package/dist/Combobox/components/ComboboxContent/index.cjs +0 -2
- package/dist/Combobox/components/ComboboxContent/index.mjs +0 -2
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +3 -8
- package/dist/Combobox/index.cjs +1 -2
- package/dist/Combobox/index.mjs +1 -2
- package/dist/Combobox-es.js +6 -6
- package/dist/ComboboxAction-es.js +4 -4
- package/dist/ComboboxActivator-es.js +3 -3
- package/dist/ComboboxContent-cjs.js +3745 -39
- package/dist/ComboboxContent-es.js +3715 -27
- package/dist/ComboboxContentHeader-es.js +4 -4
- package/dist/ComboboxContentList-es.js +13 -13
- package/dist/ComboboxContentSearch-es.js +5 -5
- package/dist/ComboboxLoadMore-es.js +2 -2
- package/dist/ComboboxOption-es.js +6 -6
- package/dist/ComboboxProvider-es.js +3 -3
- package/dist/ComboboxTrigger-es.js +4 -4
- package/dist/ConfirmationModal-es.js +4 -4
- package/dist/Countdown-es.js +3 -3
- package/dist/DataDump-es.js +7 -7
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +1 -2
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +1 -2
- package/dist/DataList/components/DataListFilters/index.cjs +2 -2
- package/dist/DataList/components/DataListFilters/index.mjs +2 -2
- package/dist/DataList-es.js +21 -21
- package/dist/DataList.utils-es.js +7 -7
- package/dist/DataListAction-es.js +9 -9
- package/dist/DataListActions-es.js +6 -6
- package/dist/DataListActionsMenu-es.js +4 -4
- package/dist/DataListBulkActions-es.js +3 -3
- package/dist/DataListContext-es.js +6 -6
- package/dist/DataListEmptyState-es.js +3 -3
- package/dist/DataListFilters-es.js +3 -3
- package/dist/DataListHeader-es.js +12 -12
- package/dist/DataListHeaderTile-es.js +9 -9
- package/dist/DataListItem-es.js +10 -10
- package/dist/DataListItemActions-es.js +3 -3
- package/dist/DataListItemActionsOverflow-es.js +5 -5
- package/dist/DataListItemClickable-es.js +8 -8
- package/dist/DataListItems-es.js +3 -3
- package/dist/DataListLayout-es.js +2 -2
- package/dist/DataListLayoutActions-es.js +6 -6
- package/dist/DataListLoadMore-es.js +8 -8
- package/dist/DataListLoadingState-es.js +4 -4
- package/dist/DataListOverflowFade-es.js +6 -6
- package/dist/DataListSearch-es.js +6 -6
- package/dist/DataListSort-es.js +6 -6
- package/dist/DataListSortingOptions-es.js +3 -3
- package/dist/DataListStatusBar-es.js +2 -2
- package/dist/DataListStickyHeader-es.js +2 -2
- package/dist/DataListTags-es.js +7 -7
- package/dist/DataListTotalCount-es.js +6 -6
- package/dist/DataTable-es.js +45 -45
- package/dist/DatePicker-es.js +12 -12
- package/dist/DayOfMonthSelect-es.js +18 -18
- package/dist/DescriptionList-es.js +4 -4
- package/dist/Disclosure-es.js +10 -10
- package/dist/Divider-es.js +2 -2
- package/dist/DrawerGrid-es.js +11 -11
- package/dist/Emphasis-es.js +2 -2
- package/dist/FeatureSwitch-es.js +17 -17
- package/dist/Flex-es.js +2 -2
- package/dist/Form-es.js +3 -3
- package/dist/FormField/FormFieldTypes.d.ts +6 -0
- package/dist/FormField/hooks/useAtlantisFormField.d.ts +2 -2
- package/dist/FormField-cjs.js +12 -4
- package/dist/FormField-es.js +50 -42
- package/dist/FormatDate-es.js +2 -2
- package/dist/FormatEmail-es.js +2 -2
- package/dist/FormatFile-es.js +23 -23
- package/dist/FormatRelativeDateTime-es.js +6 -6
- package/dist/FormatTime-es.js +2 -2
- package/dist/Gallery-es.js +8 -8
- package/dist/Glimmer-es.js +11 -11
- package/dist/Grid-es.js +2 -2
- package/dist/GridCell-es.js +2 -2
- package/dist/Heading-es.js +2 -2
- package/dist/Icon-es.js +9 -9
- package/dist/InlineLabel-es.js +3 -3
- package/dist/InputAvatar-es.js +11 -11
- package/dist/InputDate/index.cjs +1 -1
- package/dist/InputDate/index.mjs +10 -10
- package/dist/InputEmail-cjs.js +1 -1
- package/dist/InputEmail-es.js +3 -3
- package/dist/InputFile-es.js +20 -20
- package/dist/InputGroup-es.js +4 -4
- package/dist/InputNumber-cjs.js +1 -1
- package/dist/InputNumber-es.js +3 -3
- package/dist/InputPassword-cjs.js +1 -1
- package/dist/InputPassword-es.js +3 -3
- package/dist/InputPhoneNumber-cjs.js +2 -2
- package/dist/InputPhoneNumber-es.js +7 -7
- package/dist/InputText/index.cjs +1 -1
- package/dist/InputText/index.mjs +13 -13
- package/dist/InputTime-cjs.js +1 -1
- package/dist/InputTime-es.js +3 -3
- package/dist/InputValidation-es.js +5 -5
- package/dist/InternalChipDismissible-es.js +19 -19
- package/dist/LightBox-es.js +31 -31
- package/dist/Link-es.js +2 -2
- package/dist/List-es.js +29 -29
- package/dist/Markdown-es.js +15 -15
- package/dist/Menu-es.js +21 -21
- package/dist/Modal-es.js +18 -18
- package/dist/MultiSelect-es.js +9 -9
- package/dist/Option-cjs.js +1 -1
- package/dist/Option-es.js +4 -4
- package/dist/Page-es.js +23 -23
- package/dist/Popover-es.js +7 -7
- package/dist/ProgressBar-es.js +5 -5
- package/dist/RadioGroup-es.js +9 -9
- package/dist/RecurringSelect-es.js +19 -19
- package/dist/SegmentedControl-es.js +9 -9
- package/dist/Select/Select.d.ts +1 -1
- package/dist/SideDrawer-es.js +22 -22
- package/dist/Spinner-es.js +2 -2
- package/dist/StatusIndicator-es.js +2 -2
- package/dist/StatusLabel-es.js +5 -5
- package/dist/Switch-es.js +10 -10
- package/dist/Tabs-es.js +14 -14
- package/dist/Text-es.js +2 -2
- package/dist/Tooltip-es.js +9 -9
- package/dist/Typography-es.js +2 -2
- package/dist/showToast-es.js +11 -11
- package/dist/styles.css +5 -2
- package/dist/useChildComponent-es.js +2 -2
- package/dist/useFocusTrap-es.js +2 -2
- package/dist/useInView-es.js +2 -2
- package/dist/useIsMounted-es.js +2 -2
- package/dist/useOnKeyDown-es.js +2 -2
- package/dist/useRefocusOnActivator-es.js +2 -2
- package/dist/useResizeObserver-es.js +3 -3
- package/dist/useSafeLayoutEffect-es.js +2 -2
- package/dist/useScrollToActive-es.js +3 -3
- package/package.json +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { T as Typography } from './Typography-es.js';
|
|
3
3
|
import { B as Button } from './Button-es.js';
|
|
4
4
|
import 'classnames';
|
|
@@ -11,9 +11,9 @@ function ComboboxContentHeader(props) {
|
|
|
11
11
|
const label = getLabel(hasSelected, props.selectedCount, props.subjectNoun);
|
|
12
12
|
const handleSelectAll = hasSelected ? props.onClearAll : props.onSelectAll;
|
|
13
13
|
const showAction = hasSelected || props.hasOptionsVisible;
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
showAction && (
|
|
14
|
+
return (React__default.createElement("div", { className: styles.header, "data-testid": "ATL-Combobox-Header" },
|
|
15
|
+
React__default.createElement(Typography, { textColor: "heading", fontWeight: "semiBold" }, label),
|
|
16
|
+
showAction && (React__default.createElement(Button, { size: "small", label: actionLabel, type: "tertiary", onClick: handleSelectAll }))));
|
|
17
17
|
}
|
|
18
18
|
function getLabel(hasSelected, count, subjectNoun) {
|
|
19
19
|
if (hasSelected) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { T as Text } from './Text-es.js';
|
|
4
4
|
import { G as Glimmer } from './Glimmer-es.js';
|
|
@@ -13,22 +13,22 @@ function ComboboxContentList(props) {
|
|
|
13
13
|
const optionsExist = props.options.length > 0;
|
|
14
14
|
const hasSearchTerm = props.searchValue.length > 0;
|
|
15
15
|
const { listScrollState } = useScrollState(props.optionsListRef, props.options);
|
|
16
|
-
return (
|
|
17
|
-
optionsExist && (
|
|
16
|
+
return (React__default.createElement("div", { className: classnames(styles.container, styles[listScrollState]) },
|
|
17
|
+
optionsExist && (React__default.createElement("ul", { className: styles.optionsList, role: "listbox", "aria-multiselectable": props.multiselect, ref: props.optionsListRef },
|
|
18
18
|
props.options.map(option => {
|
|
19
|
-
return (
|
|
19
|
+
return (React__default.createElement(ComboboxOption, { key: option.id, id: option.id, label: option.label, prefix: option.prefix, customRender: option.customRender }));
|
|
20
20
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props.onLoadMore && (
|
|
24
|
-
props.loading && !optionsExist && (
|
|
25
|
-
|
|
26
|
-
hasSearchTerm && !props.loading && !optionsExist && (
|
|
27
|
-
|
|
21
|
+
React__default.createElement("div", { className: classnames([styles.loadingContainer, styles.hasOptions]) },
|
|
22
|
+
React__default.createElement(AnimatedPresence, { transition: "fromBottom" }, Boolean(props.loading && optionsExist) && (React__default.createElement(Spinner, { size: "small" })))),
|
|
23
|
+
props.onLoadMore && (React__default.createElement(ComboboxLoadMore, { onLoadMore: props.onLoadMore })))),
|
|
24
|
+
props.loading && !optionsExist && (React__default.createElement(React__default.Fragment, null, Array.from({ length: 5 }).map((_, index) => (React__default.createElement("div", { className: styles.loadingContainer, key: index },
|
|
25
|
+
React__default.createElement(Glimmer, { shape: "rectangle", size: "small" })))))),
|
|
26
|
+
hasSearchTerm && !props.loading && !optionsExist && (React__default.createElement("div", { className: styles.filterMessage },
|
|
27
|
+
React__default.createElement(Text, { variation: "subdued" },
|
|
28
28
|
"No results for ",
|
|
29
29
|
`“${props.searchValue}”`))),
|
|
30
|
-
!hasSearchTerm && !props.loading && !optionsExist && (
|
|
31
|
-
|
|
30
|
+
!hasSearchTerm && !props.loading && !optionsExist && (React__default.createElement("div", { className: styles.emptyStateMessage },
|
|
31
|
+
React__default.createElement(Text, { variation: "subdued" }, getZeroIndexStateText(props.subjectNoun))))));
|
|
32
32
|
}
|
|
33
33
|
function getZeroIndexStateText(subjectNoun) {
|
|
34
34
|
if (subjectNoun) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useRef, useEffect } from 'react';
|
|
2
2
|
import { I as Icon } from './Icon-es.js';
|
|
3
3
|
|
|
4
4
|
var styles = {"search":"c4B0WFX6K0o-","searchInput":"AH9-zRHXfpo-","clearSearch":"mymN3p8sKRw-","spinning":"hMjmTEgj6WU-"};
|
|
@@ -13,10 +13,10 @@ function ComboboxContentSearch(props) {
|
|
|
13
13
|
}, 0);
|
|
14
14
|
}
|
|
15
15
|
}, [props.open]);
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
props.searchValue && (
|
|
19
|
-
|
|
16
|
+
return (React__default.createElement("div", { className: styles.search },
|
|
17
|
+
React__default.createElement("input", { type: "search", ref: searchRef, className: styles.searchInput, placeholder: props.placeholder ? `Search ${props.placeholder}` : "Search", onChange: (event) => handleSearch(event), value: props.searchValue }),
|
|
18
|
+
props.searchValue && (React__default.createElement("button", { className: styles.clearSearch, onClick: clearSearch, type: "button", "data-testid": "ATL-Combobox-Content-Search-Clear", "aria-label": "Clear search" },
|
|
19
|
+
React__default.createElement(Icon, { name: "remove", size: "small" })))));
|
|
20
20
|
function clearSearch() {
|
|
21
21
|
var _a;
|
|
22
22
|
props.setSearchValue("");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useEffect } from 'react';
|
|
2
2
|
import { u as useInView_2 } from './useInView-es.js';
|
|
3
3
|
|
|
4
4
|
var styles = {"trigger":"jPB--ZCYNNI-","spinning":"aW61BrnGmcw-"};
|
|
@@ -8,7 +8,7 @@ function ComboboxLoadMore({ onLoadMore }) {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
isInView && onLoadMore();
|
|
10
10
|
}, [isInView]);
|
|
11
|
-
return (
|
|
11
|
+
return (React__default.createElement("div", { "data-testid": "ATL-Combobox-Loadmore-Trigger", ref: inViewRef, className: styles.trigger }));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export { ComboboxLoadMore as C };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
5
5
|
import { F as Flex } from './Flex-es.js';
|
|
@@ -11,15 +11,15 @@ function ComboboxOption(props) {
|
|
|
11
11
|
const { customRender } = props, contentProps = __rest(props, ["customRender"]);
|
|
12
12
|
const { selected, selectionHandler } = useContext(ComboboxContext);
|
|
13
13
|
const isSelected = selected.some(selection => selection.id.toString() === props.id.toString());
|
|
14
|
-
return (
|
|
15
|
-
selectionHandler({ id: props.id, label: props.label }), className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected }))) : (
|
|
14
|
+
return (React__default.createElement("li", { key: props.id, tabIndex: -1, "data-selected": isSelected, role: "option", "aria-selected": isSelected, onClick: () => selectionHandler &&
|
|
15
|
+
selectionHandler({ id: props.id, label: props.label }), className: classnames(styles.option) }, customRender ? (customRender(Object.assign(Object.assign({}, contentProps), { isSelected }))) : (React__default.createElement(InternalDefaultContent, Object.assign({}, contentProps, { isSelected: isSelected })))));
|
|
16
16
|
}
|
|
17
17
|
function InternalDefaultContent(props) {
|
|
18
|
-
return (
|
|
19
|
-
|
|
18
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
19
|
+
React__default.createElement(Flex, { template: props.prefix ? ["shrink", "grow"] : ["grow"] },
|
|
20
20
|
props.prefix,
|
|
21
21
|
props.label),
|
|
22
|
-
|
|
22
|
+
React__default.createElement("div", null, props.isSelected && (React__default.createElement(Icon, { name: "checkmark", color: "interactiveSubtle" })))));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { ComboboxOption as C };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
|
-
const ComboboxContext =
|
|
4
|
+
const ComboboxContext = React__default.createContext({});
|
|
5
5
|
function ComboboxContextProvider(_a) {
|
|
6
6
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
7
|
-
return (
|
|
7
|
+
return (React__default.createElement(ComboboxContext.Provider, { value: props }, children));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export { ComboboxContextProvider as C, ComboboxContext as a };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { C as Chip } from './Chip-es.js';
|
|
3
3
|
import './tslib.es6-es.js';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
5
5
|
import { a as ComboboxContext } from './ComboboxProvider-es.js';
|
|
6
6
|
|
|
7
7
|
function ComboboxTrigger({ label = "Select", selected, }) {
|
|
8
|
-
const { handleOpen } =
|
|
8
|
+
const { handleOpen } = React__default.useContext(ComboboxContext);
|
|
9
9
|
const hasSelection = selected.length;
|
|
10
10
|
const selectedLabel = selected.map(option => option.label).join(", ");
|
|
11
|
-
return (
|
|
12
|
-
|
|
11
|
+
return (React__default.createElement(Chip, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox" }, !hasSelection && (React__default.createElement(Chip.Suffix, null,
|
|
12
|
+
React__default.createElement(Icon, { name: "add", size: "small" })))));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { ComboboxTrigger as C };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { forwardRef, useReducer, useImperativeHandle, useEffect } from 'react';
|
|
2
2
|
import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
|
|
3
3
|
import { M as Modal } from './Modal-es.js';
|
|
4
4
|
import { C as Content } from './Content-es.js';
|
|
@@ -52,15 +52,15 @@ const ConfirmationModal = forwardRef(function ConfirmationModalInternal({ title,
|
|
|
52
52
|
});
|
|
53
53
|
}, [title, message, confirmLabel, cancelLabel, onConfirm, onCancel]);
|
|
54
54
|
useOnKeyDown_2(handleKeyboardShortcut, ["Escape", "Enter"]);
|
|
55
|
-
return (
|
|
55
|
+
return (React__default.createElement(Modal, { title: state.title, open: open || state.open, size: size, dismissible: false, primaryAction: {
|
|
56
56
|
label: state.confirmLabel,
|
|
57
57
|
onClick: handleAction("confirm"),
|
|
58
58
|
variation: variation === "destructive" ? "destructive" : "work",
|
|
59
59
|
}, secondaryAction: {
|
|
60
60
|
label: state.cancelLabel,
|
|
61
61
|
onClick: handleAction("cancel"),
|
|
62
|
-
} }, state.message ? (
|
|
63
|
-
|
|
62
|
+
} }, state.message ? (React__default.createElement(Content, null,
|
|
63
|
+
React__default.createElement(Markdown, { content: state.message }))) : (children)));
|
|
64
64
|
function handleAction(type) {
|
|
65
65
|
return () => {
|
|
66
66
|
var _a, _b;
|
package/dist/Countdown-es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { cloneElement, Component, createRef, createElement, useMemo } from 'react';
|
|
2
2
|
import { p as propTypesExports } from './index-es.js';
|
|
3
3
|
|
|
4
4
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -604,11 +604,11 @@ function Countdown({ date: inputDate, onComplete, showUnits, granularity = "dhms
|
|
|
604
604
|
const initDate = new Date(inputDate);
|
|
605
605
|
return initDate;
|
|
606
606
|
}, [inputDate]);
|
|
607
|
-
return (
|
|
607
|
+
return (React__default.createElement(Countdown$1$1, { date: date, zeroPadTime: 2, renderer: (props) => (React__default.createElement(RenderedCountdown, Object.assign({}, props, { granularity: granularity, showUnits: showUnits }))), onComplete: onComplete }));
|
|
608
608
|
}
|
|
609
609
|
function RenderedCountdown({ formatted, granularity = "dhms", showUnits, }) {
|
|
610
610
|
const { days, hours, minutes, seconds } = formatted;
|
|
611
|
-
return
|
|
611
|
+
return React__default.createElement(React__default.Fragment, null, buildTime());
|
|
612
612
|
function buildTime() {
|
|
613
613
|
const totalHours = 24 * Number(days) + Number(hours);
|
|
614
614
|
const totalMinutes = 60 * totalHours + Number(minutes);
|
package/dist/DataDump-es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { C as Card } from './Card-es.js';
|
|
3
3
|
import { C as Content } from './Content-es.js';
|
|
4
4
|
import { E as Emphasis } from './Emphasis-es.js';
|
|
5
5
|
|
|
6
6
|
function DataDump({ label = "Raw Data", defaultOpen = false, data, }) {
|
|
7
|
-
return (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
return (React__default.createElement(Card, { accent: "yellow" },
|
|
8
|
+
React__default.createElement(Content, null,
|
|
9
|
+
React__default.createElement("details", { open: defaultOpen },
|
|
10
|
+
React__default.createElement("summary", null,
|
|
11
|
+
React__default.createElement(Emphasis, { variation: "bold" }, label)),
|
|
12
|
+
React__default.createElement("pre", null, JSON.stringify(data, undefined, 2))))));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { DataDump as D };
|
|
@@ -31,8 +31,6 @@ require('../../../../../Button-cjs.js');
|
|
|
31
31
|
require('react-router-dom');
|
|
32
32
|
require('../../../../../useRefocusOnActivator-cjs.js');
|
|
33
33
|
require('../../../../../useFocusTrap-cjs.js');
|
|
34
|
-
require('react-popper');
|
|
35
|
-
require('../../../../../useOnKeyDown-cjs.js');
|
|
36
34
|
require('../../../../../constants-cjs.js');
|
|
37
35
|
require('../../../../../ComboboxAction-cjs.js');
|
|
38
36
|
require('../../../../../ComboboxTrigger-cjs.js');
|
|
@@ -43,6 +41,7 @@ require('../../../../../useChildComponent-cjs.js');
|
|
|
43
41
|
require('../../../../../Tooltip-cjs.js');
|
|
44
42
|
require('../../../../../useSafeLayoutEffect-cjs.js');
|
|
45
43
|
require('../../../../../useIsMounted-cjs.js');
|
|
44
|
+
require('react-popper');
|
|
46
45
|
require('../../../../../debounce-cjs.js');
|
|
47
46
|
require('../../../../../isObjectLike-cjs.js');
|
|
48
47
|
require('../../../../../isSymbol-cjs.js');
|
|
@@ -29,8 +29,6 @@ import '../../../../../Button-es.js';
|
|
|
29
29
|
import 'react-router-dom';
|
|
30
30
|
import '../../../../../useRefocusOnActivator-es.js';
|
|
31
31
|
import '../../../../../useFocusTrap-es.js';
|
|
32
|
-
import 'react-popper';
|
|
33
|
-
import '../../../../../useOnKeyDown-es.js';
|
|
34
32
|
import '../../../../../constants-es.js';
|
|
35
33
|
import '../../../../../ComboboxAction-es.js';
|
|
36
34
|
import '../../../../../ComboboxTrigger-es.js';
|
|
@@ -41,6 +39,7 @@ import '../../../../../useChildComponent-es.js';
|
|
|
41
39
|
import '../../../../../Tooltip-es.js';
|
|
42
40
|
import '../../../../../useSafeLayoutEffect-es.js';
|
|
43
41
|
import '../../../../../useIsMounted-es.js';
|
|
42
|
+
import 'react-popper';
|
|
44
43
|
import '../../../../../debounce-es.js';
|
|
45
44
|
import '../../../../../isObjectLike-es.js';
|
|
46
45
|
import '../../../../../isSymbol-es.js';
|
|
@@ -32,8 +32,6 @@ require('../../../Button-cjs.js');
|
|
|
32
32
|
require('react-router-dom');
|
|
33
33
|
require('../../../useRefocusOnActivator-cjs.js');
|
|
34
34
|
require('../../../useFocusTrap-cjs.js');
|
|
35
|
-
require('react-popper');
|
|
36
|
-
require('../../../useOnKeyDown-cjs.js');
|
|
37
35
|
require('../../../constants-cjs.js');
|
|
38
36
|
require('../../../ComboboxAction-cjs.js');
|
|
39
37
|
require('../../../ComboboxTrigger-cjs.js');
|
|
@@ -44,6 +42,7 @@ require('../../../useChildComponent-cjs.js');
|
|
|
44
42
|
require('../../../Tooltip-cjs.js');
|
|
45
43
|
require('../../../useSafeLayoutEffect-cjs.js');
|
|
46
44
|
require('../../../useIsMounted-cjs.js');
|
|
45
|
+
require('react-popper');
|
|
47
46
|
require('../../../debounce-cjs.js');
|
|
48
47
|
require('../../../isObjectLike-cjs.js');
|
|
49
48
|
require('../../../isSymbol-cjs.js');
|
|
@@ -59,6 +58,7 @@ require('../../../DataListTags-cjs.js');
|
|
|
59
58
|
require('../../../InlineLabel-cjs.js');
|
|
60
59
|
require('../../../DataListHeaderTile-cjs.js');
|
|
61
60
|
require('../../../DataListSortingOptions-cjs.js');
|
|
61
|
+
require('../../../useOnKeyDown-cjs.js');
|
|
62
62
|
require('../../../FormatDate-cjs.js');
|
|
63
63
|
require('../../../Heading-cjs.js');
|
|
64
64
|
require('../../../useResponsiveSizing-cjs.js');
|
|
@@ -30,8 +30,6 @@ import '../../../Button-es.js';
|
|
|
30
30
|
import 'react-router-dom';
|
|
31
31
|
import '../../../useRefocusOnActivator-es.js';
|
|
32
32
|
import '../../../useFocusTrap-es.js';
|
|
33
|
-
import 'react-popper';
|
|
34
|
-
import '../../../useOnKeyDown-es.js';
|
|
35
33
|
import '../../../constants-es.js';
|
|
36
34
|
import '../../../ComboboxAction-es.js';
|
|
37
35
|
import '../../../ComboboxTrigger-es.js';
|
|
@@ -42,6 +40,7 @@ import '../../../useChildComponent-es.js';
|
|
|
42
40
|
import '../../../Tooltip-es.js';
|
|
43
41
|
import '../../../useSafeLayoutEffect-es.js';
|
|
44
42
|
import '../../../useIsMounted-es.js';
|
|
43
|
+
import 'react-popper';
|
|
45
44
|
import '../../../debounce-es.js';
|
|
46
45
|
import '../../../isObjectLike-es.js';
|
|
47
46
|
import '../../../isSymbol-es.js';
|
|
@@ -57,6 +56,7 @@ import '../../../DataListTags-es.js';
|
|
|
57
56
|
import '../../../InlineLabel-es.js';
|
|
58
57
|
import '../../../DataListHeaderTile-es.js';
|
|
59
58
|
import '../../../DataListSortingOptions-es.js';
|
|
59
|
+
import '../../../useOnKeyDown-es.js';
|
|
60
60
|
import '../../../FormatDate-es.js';
|
|
61
61
|
import '../../../Heading-es.js';
|
|
62
62
|
import '../../../useResponsiveSizing-es.js';
|
package/dist/DataList-es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useState, useMemo, useRef } from 'react';
|
|
3
3
|
import { s as styles } from './DataList.module-es.js';
|
|
4
4
|
import { a as DataListTotalCount } from './DataListTotalCount-es.js';
|
|
5
5
|
import { a as DataListLoadingState } from './DataListLoadingState-es.js';
|
|
@@ -33,7 +33,7 @@ function DataList(_a) {
|
|
|
33
33
|
const bulkActionsComponent = getCompoundComponent(props.children, DataListBulkActions);
|
|
34
34
|
const headerCount = Object.keys(props.headers).length;
|
|
35
35
|
const shouldRenderStickyHeader = !!filterComponent || !!searchComponent || headerCount > 0;
|
|
36
|
-
return (
|
|
36
|
+
return (React__default.createElement(DataListContext.Provider, { value: Object.assign(Object.assign({ searchComponent,
|
|
37
37
|
filterComponent,
|
|
38
38
|
layoutComponents,
|
|
39
39
|
emptyStateComponents,
|
|
@@ -44,7 +44,7 @@ function DataList(_a) {
|
|
|
44
44
|
registerLayout }, props), { selected,
|
|
45
45
|
// T !== DataListObject
|
|
46
46
|
sorting: sorting }) },
|
|
47
|
-
|
|
47
|
+
React__default.createElement(InternalDataList, { shouldRenderStickyHeader: shouldRenderStickyHeader })));
|
|
48
48
|
function registerLayout(size, children) {
|
|
49
49
|
setLayouts(prev => (Object.assign(Object.assign({}, prev), { [size]: children })));
|
|
50
50
|
}
|
|
@@ -56,24 +56,24 @@ function InternalDataList({ shouldRenderStickyHeader, }) {
|
|
|
56
56
|
const showEmptyState = !initialLoading && data.length === 0;
|
|
57
57
|
const shouldRenderLoadMoreTrigger = !initialLoading && !showEmptyState;
|
|
58
58
|
const shouldRenderTitleContainer = initialLoading || title !== undefined || totalCount !== undefined;
|
|
59
|
-
return (
|
|
60
|
-
shouldRenderTitleContainer && (
|
|
61
|
-
title &&
|
|
62
|
-
totalCount !== undefined && (
|
|
63
|
-
|
|
64
|
-
shouldRenderStickyHeader && (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
initialLoading &&
|
|
71
|
-
showEmptyState &&
|
|
59
|
+
return (React__default.createElement("div", { className: styles.wrapper },
|
|
60
|
+
shouldRenderTitleContainer && (React__default.createElement("div", { className: styles.titleContainer, "data-testid": DATA_LIST_TITLE_CONTAINER_TEST_ID },
|
|
61
|
+
title && React__default.createElement(Heading, { level: 3 }, title),
|
|
62
|
+
totalCount !== undefined && (React__default.createElement(DataListTotalCount, { totalCount: totalCount, loading: initialLoading })))),
|
|
63
|
+
React__default.createElement("div", { ref: backToTopRef }),
|
|
64
|
+
shouldRenderStickyHeader && (React__default.createElement(DataListStickyHeader, null,
|
|
65
|
+
React__default.createElement("div", { className: styles.headerFilters },
|
|
66
|
+
React__default.createElement(InternalDataListFilters, null),
|
|
67
|
+
React__default.createElement(InternalDataListSearch, null)),
|
|
68
|
+
React__default.createElement(InternalDataListStatusBar, null),
|
|
69
|
+
React__default.createElement(DataListHeader, null))),
|
|
70
|
+
initialLoading && React__default.createElement(DataListLoadingState, null),
|
|
71
|
+
showEmptyState && React__default.createElement(InternalDataListEmptyState, null),
|
|
72
72
|
layoutComponents,
|
|
73
|
-
loadingState === "filtering" && (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
shouldRenderLoadMoreTrigger && (
|
|
73
|
+
loadingState === "filtering" && (React__default.createElement("div", { "data-testid": DATA_LIST_FILTERING_SPINNER_TEST_ID, className: styles.filtering },
|
|
74
|
+
React__default.createElement("div", { className: styles.filteringSpinner },
|
|
75
|
+
React__default.createElement(Spinner, { size: "small" })))),
|
|
76
|
+
shouldRenderLoadMoreTrigger && (React__default.createElement(DataListLoadMore, { onBackToTop: handleBackToTop }))));
|
|
77
77
|
function handleBackToTop() {
|
|
78
78
|
var _a;
|
|
79
79
|
// For testing purposes since jest doesn't know scrollIntoView.
|
|
@@ -130,7 +130,7 @@ DataList.BatchActions = DataListBulkActions;
|
|
|
130
130
|
* DataListBatchActions component.
|
|
131
131
|
*/
|
|
132
132
|
DataList.BatchAction = function DataListBatchAction(props) {
|
|
133
|
-
return
|
|
133
|
+
return React__default.createElement(DataListAction, Object.assign({}, props));
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
136
|
* Defines a status bar that is rendered between the filters and the header.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { Children, isValidElement } from 'react';
|
|
2
2
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
3
3
|
import { _ as _baseKeys, a as _getTag } from './_getTag-es.js';
|
|
4
4
|
import { i as isArguments_1, a as isArray_1, b as isArrayLike_1, c as isBufferExports, _ as _isPrototype, d as isTypedArray_1 } from './isTypedArray-es.js';
|
|
@@ -116,20 +116,20 @@ function generateListItemElement(item) {
|
|
|
116
116
|
return acc;
|
|
117
117
|
}
|
|
118
118
|
if (key === "tags" && Array.isArray(currentItem)) {
|
|
119
|
-
acc[key] =
|
|
119
|
+
acc[key] = React__default.createElement(DataListTags, { items: currentItem });
|
|
120
120
|
}
|
|
121
121
|
else if (key === "label" && typeof currentItem === "string") {
|
|
122
|
-
acc[key] =
|
|
122
|
+
acc[key] = React__default.createElement(Heading, { level: 5 }, currentItem);
|
|
123
123
|
}
|
|
124
124
|
else if (isValidElement(currentItem)) {
|
|
125
125
|
acc[key] = currentItem;
|
|
126
126
|
}
|
|
127
127
|
else if (currentItem instanceof Date) {
|
|
128
|
-
acc[key] = (
|
|
129
|
-
|
|
128
|
+
acc[key] = (React__default.createElement(Text, null,
|
|
129
|
+
React__default.createElement(FormatDate, { date: currentItem })));
|
|
130
130
|
}
|
|
131
131
|
else {
|
|
132
|
-
acc[key] =
|
|
132
|
+
acc[key] = React__default.createElement(Text, null, currentItem);
|
|
133
133
|
}
|
|
134
134
|
return acc;
|
|
135
135
|
}, {});
|
|
@@ -138,7 +138,7 @@ function generateListItemElement(item) {
|
|
|
138
138
|
* Generate the header elements with the default styling
|
|
139
139
|
*/
|
|
140
140
|
function generateHeaderElements(headers) {
|
|
141
|
-
const headerElements = Object.keys(headers).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]:
|
|
141
|
+
const headerElements = Object.keys(headers).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: React__default.createElement(DataListHeaderTile, { headers: headers, headerKey: key }) })), {});
|
|
142
142
|
return isEmpty$1(headerElements) ? undefined : headerElements;
|
|
143
143
|
}
|
|
144
144
|
function sortBreakpoints(sizeProp) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { T as Typography } from './Typography-es.js';
|
|
3
3
|
import { I as Icon } from './Icon-es.js';
|
|
4
4
|
import { u as useDataListLayoutActionsContext } from './DataListLayoutContext-es2.js';
|
|
@@ -21,15 +21,15 @@ function DataListAction({ label, icon, destructive, visible = () => true, onClic
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
if (actionUrl) {
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
icon &&
|
|
24
|
+
return (React__default.createElement("a", { href: actionUrl, rel: "noopener noreferrer", className: `${styles.action} ${styles.actionUrl}`, onClick: handleClick },
|
|
25
|
+
React__default.createElement(Typography, { textColor: color },
|
|
26
|
+
React__default.createElement("span", { className: styles.label }, getActionLabel())),
|
|
27
|
+
icon && React__default.createElement(Icon, { name: icon, color: color })));
|
|
28
28
|
}
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
icon &&
|
|
29
|
+
return (React__default.createElement("button", { type: "button", className: styles.action, onClick: handleClick },
|
|
30
|
+
React__default.createElement(Typography, { textColor: color },
|
|
31
|
+
React__default.createElement("span", { className: styles.label }, getActionLabel())),
|
|
32
|
+
icon && React__default.createElement(Icon, { name: icon, color: color })));
|
|
33
33
|
function handleClick() {
|
|
34
34
|
if (activeItem) {
|
|
35
35
|
onClick === null || onClick === void 0 ? void 0 : onClick(activeItem);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { Children, isValidElement } from 'react';
|
|
2
2
|
import { T as Tooltip } from './Tooltip-es.js';
|
|
3
3
|
import { B as Button } from './Button-es.js';
|
|
4
4
|
import 'classnames';
|
|
@@ -11,7 +11,7 @@ function DataListActions({ children, itemsToExpose = 2, }) {
|
|
|
11
11
|
const childrenArray = Children.toArray(children).filter(isValidElement);
|
|
12
12
|
const exposedActions = getExposedActions(childrenArray, itemsToExpose);
|
|
13
13
|
childrenArray.splice(0, exposedActions.length);
|
|
14
|
-
return (
|
|
14
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
15
15
|
exposedActions.map(({ props }) => {
|
|
16
16
|
const isVisible = props.visible ? props.visible(activeItem) : true;
|
|
17
17
|
const hasIconOrAlwaysVisible = props.icon || props.alwaysVisible;
|
|
@@ -29,13 +29,13 @@ function DataListActions({ children, itemsToExpose = 2, }) {
|
|
|
29
29
|
const actionLabel = getActionLabel();
|
|
30
30
|
// If the action is always visible, we don't want a tooltip.
|
|
31
31
|
if (props.alwaysVisible) {
|
|
32
|
-
return (
|
|
32
|
+
return (React__default.createElement(Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
|
|
33
33
|
var _a;
|
|
34
34
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
35
35
|
}, type: "secondary", variation: "subtle" }));
|
|
36
36
|
}
|
|
37
|
-
return (
|
|
38
|
-
|
|
37
|
+
return (React__default.createElement(Tooltip, { key: actionLabel, message: actionLabel },
|
|
38
|
+
React__default.createElement(Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
if (activeItem) {
|
|
41
41
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
@@ -45,7 +45,7 @@ function DataListActions({ children, itemsToExpose = 2, }) {
|
|
|
45
45
|
}
|
|
46
46
|
}, type: "tertiary", variation: "subtle" })));
|
|
47
47
|
}),
|
|
48
|
-
|
|
48
|
+
React__default.createElement(DataListItemActionsOverflow, { actions: childrenArray })));
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export { DataListActions as D };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState } from 'react';
|
|
2
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
3
|
import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
|
|
4
4
|
import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
|
|
@@ -20,9 +20,9 @@ function DataListActionsMenu({ visible = false, position, onRequestClose, childr
|
|
|
20
20
|
useRefocusOnActivator_2(visible);
|
|
21
21
|
const focusTrapRef = useFocusTrap_2(visible);
|
|
22
22
|
useOnKeyDown_2(onRequestClose, "Escape");
|
|
23
|
-
const actionsMenu = (
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const actionsMenu = (React__default.createElement(AnimatePresence, null, visible && (React__default.createElement("div", { ref: focusTrapRef, onClick: handleClick },
|
|
24
|
+
React__default.createElement(motion.div, { role: "menu", "data-elevation": "elevated", ref: setRef, variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: TRANSITION_DELAY_IN_SECONDS }, className: styles.menu, style: getPositionCssVars(), onClick: onRequestClose }, children),
|
|
25
|
+
React__default.createElement("button", { type: "button", className: styles.overlay, onClick: onRequestClose, "aria-label": "Close menu" })))));
|
|
26
26
|
return mounted.current
|
|
27
27
|
? createPortal(actionsMenu, document.body)
|
|
28
28
|
: actionsMenu;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import { u as useDataListContext } from './DataListContext-es.js';
|
|
3
3
|
import { D as DataListActions } from './DataListActions-es.js';
|
|
4
4
|
import { u as useResponsiveSizing } from './useResponsiveSizing-es.js';
|
|
@@ -21,8 +21,8 @@ function InternalDataListBulkActions() {
|
|
|
21
21
|
const { sm } = useResponsiveSizing();
|
|
22
22
|
// Collapse all actions under "More actions" when breakpoint is smaller than sm
|
|
23
23
|
const itemsToExpose = sm ? 3 : 0;
|
|
24
|
-
return (
|
|
25
|
-
|
|
24
|
+
return (React__default.createElement("div", { "data-testid": BULK_ACTIONS_CONTAINER_TEST_ID, className: styles.bulkActions },
|
|
25
|
+
React__default.createElement(DataListActions, { itemsToExpose: itemsToExpose }, children)));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { DataListBulkActions as D, InternalDataListBulkActions as I };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { createContext, useContext } from 'react';
|
|
2
2
|
import { n as noop } from './noop-es.js';
|
|
3
3
|
|
|
4
4
|
const defaultValues = {
|
|
@@ -9,11 +9,11 @@ const defaultValues = {
|
|
|
9
9
|
selected: [],
|
|
10
10
|
layoutBreakpoints: [],
|
|
11
11
|
layouts: {
|
|
12
|
-
xs: children =>
|
|
13
|
-
sm: children =>
|
|
14
|
-
md: children =>
|
|
15
|
-
lg: children =>
|
|
16
|
-
xl: children =>
|
|
12
|
+
xs: children => React__default.createElement(React__default.Fragment, null, children),
|
|
13
|
+
sm: children => React__default.createElement(React__default.Fragment, null, children),
|
|
14
|
+
md: children => React__default.createElement(React__default.Fragment, null, children),
|
|
15
|
+
lg: children => React__default.createElement(React__default.Fragment, null, children),
|
|
16
|
+
xl: children => React__default.createElement(React__default.Fragment, null, children),
|
|
17
17
|
},
|
|
18
18
|
registerLayout: noop,
|
|
19
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __rest } from './tslib.es6-es.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useContext, cloneElement } from 'react';
|
|
3
3
|
import { D as DataListContext } from './DataListContext-es.js';
|
|
4
4
|
import { T as Text } from './Text-es.js';
|
|
5
5
|
import { B as Button } from './Button-es.js';
|
|
@@ -15,8 +15,8 @@ function DataListEmptyState(_) {
|
|
|
15
15
|
function InternalDataListEmptyState() {
|
|
16
16
|
const { emptyStateComponents: components, filtered } = useContext(DataListContext);
|
|
17
17
|
const _a = getEmptyStateContent(), { customRender } = _a, contentProps = __rest(_a, ["customRender"]);
|
|
18
|
-
return (
|
|
19
|
-
|
|
18
|
+
return (React__default.createElement("div", { className: styles.emptyStateWrapper }, customRender ? (customRender(Object.assign({}, contentProps))) : (React__default.createElement(React__default.Fragment, null,
|
|
19
|
+
React__default.createElement(Text, { align: "center" }, contentProps.message),
|
|
20
20
|
renderButton(contentProps.action)))));
|
|
21
21
|
function getEmptyStateContent() {
|
|
22
22
|
const { defaultEmptyState, filteredEmptyState } = getEmptyStates(components);
|