@jobber/components 4.45.1 → 4.45.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/DataList/DataList.types.d.ts +12 -0
- package/dist/DataList/components/DataListActions/DataListActions.d.ts +3 -0
- package/dist/DataList/components/DataListActions/index.d.ts +1 -0
- package/dist/DataList/components/DataListItemActions/DataListItemActions.d.ts +1 -5
- package/dist/DataList/components/DataListItemActions/index.d.ts +0 -1
- package/dist/DataList/components/{DataListItemActions → DataListItemActionsOverflow}/DataListItemActionsOverflow.d.ts +1 -1
- package/dist/DataList/components/DataListItemActionsOverflow/index.d.ts +1 -0
- package/dist/DataList/index.js +142 -135
- package/package.json +2 -2
|
@@ -215,6 +215,18 @@ export interface DataListActionProps<T extends DataListObject> {
|
|
|
215
215
|
*/
|
|
216
216
|
readonly onClick?: (data: T) => void;
|
|
217
217
|
}
|
|
218
|
+
export interface DataListActionsProps<T extends DataListObject> {
|
|
219
|
+
/**
|
|
220
|
+
* The actions to render for each item in the DataList. This only accepts the
|
|
221
|
+
* DataList.Action component.
|
|
222
|
+
*/
|
|
223
|
+
readonly children?: Fragment<ReactElement<DataListActionProps<T>>>;
|
|
224
|
+
/**
|
|
225
|
+
* The number of items to expose before the "More" button is shown.
|
|
226
|
+
* @default 2
|
|
227
|
+
*/
|
|
228
|
+
readonly itemsToExpose?: number;
|
|
229
|
+
}
|
|
218
230
|
export interface DataListBulkActionProps extends DataListActionProps<DataListObject> {
|
|
219
231
|
/**
|
|
220
232
|
* The callback function when the action is clicked.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DataListActions";
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DataListItemActionsProps, DataListObject } from "../../DataList.types";
|
|
3
3
|
export declare function DataListItemActions<T extends DataListObject>(_: DataListItemActionsProps<T>): null;
|
|
4
|
-
|
|
5
|
-
readonly item: T;
|
|
6
|
-
}
|
|
7
|
-
export declare function InternalDataListItemActions<T extends DataListObject>({ item, }: InternalDataListItemActionsProps<T>): JSX.Element | null;
|
|
8
|
-
export {};
|
|
4
|
+
export declare function InternalDataListItemActions(): JSX.Element | null;
|
|
@@ -3,5 +3,5 @@ import { DataListActionProps, DataListObject } from "../../DataList.types";
|
|
|
3
3
|
interface DataListItemActionsOverflowProps<T extends DataListObject> {
|
|
4
4
|
readonly actions: ReactElement<DataListActionProps<T>>[];
|
|
5
5
|
}
|
|
6
|
-
export declare function DataListItemActionsOverflow<T extends DataListObject>({ actions, }: DataListItemActionsOverflowProps<T>): JSX.Element;
|
|
6
|
+
export declare function DataListItemActionsOverflow<T extends DataListObject>({ actions, }: DataListItemActionsOverflowProps<T>): JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DataListItemActionsOverflow";
|
package/dist/DataList/index.js
CHANGED
|
@@ -10,27 +10,26 @@ var Glimmer = require('../Glimmer-cfa92a88.js');
|
|
|
10
10
|
var framerMotion = require('framer-motion');
|
|
11
11
|
var classnames = require('classnames');
|
|
12
12
|
var noop = require('lodash/noop');
|
|
13
|
-
var reactRouterDom = require('react-router-dom');
|
|
14
|
-
var Button = require('../Button-d89f2271.js');
|
|
15
13
|
var design = require('@jobber/design');
|
|
16
|
-
var Typography = require('../Typography-9bff9c91.js');
|
|
17
14
|
var ReactDOM = require('react-dom');
|
|
18
15
|
var Tooltip = require('../Tooltip-59dbab5b.js');
|
|
19
16
|
require('react-popper');
|
|
17
|
+
var Typography = require('../Typography-9bff9c91.js');
|
|
18
|
+
var reactRouterDom = require('react-router-dom');
|
|
19
|
+
var Button = require('../Button-d89f2271.js');
|
|
20
|
+
var useInView = require('@jobber/hooks/useInView');
|
|
21
|
+
var isEmpty = require('lodash/isEmpty');
|
|
22
|
+
var InlineLabel = require('../InlineLabel-3d461632.js');
|
|
20
23
|
var useFocusTrap = require('@jobber/hooks/useFocusTrap');
|
|
21
24
|
var useRefocusOnActivator = require('@jobber/hooks/useRefocusOnActivator');
|
|
22
25
|
var useOnKeyDown = require('@jobber/hooks/useOnKeyDown');
|
|
23
26
|
var foundation = require('@jobber/design/foundation');
|
|
24
|
-
var isEmpty = require('lodash/isEmpty');
|
|
25
|
-
var InlineLabel = require('../InlineLabel-3d461632.js');
|
|
26
|
-
var styles$f = require('@jobber/components/DataList/DataList.css');
|
|
27
27
|
require('uuid');
|
|
28
28
|
require('react-hook-form');
|
|
29
29
|
var Checkbox = require('../Checkbox-eac63b7f.js');
|
|
30
30
|
var FormatDate = require('../FormatDate-70ea5b43.js');
|
|
31
31
|
var Heading = require('../Heading-4562900a.js');
|
|
32
32
|
var AnimatedSwitcher = require('../AnimatedSwitcher-d1e1ddcf.js');
|
|
33
|
-
var useInView = require('@jobber/hooks/useInView');
|
|
34
33
|
var Popover = require('../Popover-d401fb54.js');
|
|
35
34
|
var Content = require('../Content-2ca1ffe1.js');
|
|
36
35
|
var Chip = require('../Chip-4d8e6370.js');
|
|
@@ -53,11 +52,10 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
53
52
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
54
53
|
var noop__default = /*#__PURE__*/_interopDefaultLegacy(noop);
|
|
55
54
|
var isEmpty__default = /*#__PURE__*/_interopDefaultLegacy(isEmpty);
|
|
56
|
-
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles$f);
|
|
57
55
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
58
56
|
|
|
59
|
-
var css_248z$e = ".TkdrExYnvcY-,\n.TkdrExYnvcY- * {\n box-sizing: border-box;\n}\n\n.TkdrExYnvcY- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n position: relative;\n z-index: 0;\n z-index: var(--elevation-default);\n -ms-flex: 1;\n flex: 1;\n}\n\n/*\n * Header\n */\n\n.IcAlZHoB4LI- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n z-index: 1;\n z-index: var(--elevation-base);\n margin-bottom: calc(16px / 2);\n margin-bottom: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.TFO76ysivmg- {\n display: grid;\n padding: calc(16px / 2) 0;\n padding: var(--space-small) 0;\n gap: calc(16px / 2);\n grid-gap: calc(16px / 2);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n grid-template-columns: auto -webkit-max-content;\n grid-template-columns: auto max-content;\n}\n\n.jGHZZYZm1ZY- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n -ms-flex-pack: center;\n justify-content: center;\n min-height: calc(16px * 3);\n min-height: var(--space-largest);\n padding: calc(16px / 2);\n padding: var(--space-small);\n border-bottom: calc(16px / 8) solid rgb(225, 225, 225);\n border-bottom: var(--border-thick) solid var(--color-border);\n}\n\n.jMSVGIAr5tk- > p {\n font-weight: 500;\n white-space: nowrap;\n}\n\n.jMSVGIAr5tk- {\n display: -ms-flexbox;\n display: flex;\n
|
|
60
|
-
var styles$e = {"wrapper":"TkdrExYnvcY-","titleContainer":"IcAlZHoB4LI-","headerFilters":"TFO76ysivmg-","headerTitles":"jGHZZYZm1ZY-","headerBatchSelect":"jMSVGIAr5tk-","listItem":"ise8kHCfhCY-","active":"Pc0JGX6jCD4-","listItemClickable":"Tq6e0BGwcSM-","selectable":"d-79rkMqufg-","selectAllCheckbox":"qm-SSuWTXkI-","visible":"VA9RnQp6nbI-","selected":"_4L7iXXzLr5k-","filtering":"Kkp-IYmwq-s-","filteringSpinner":"m-eCShL7TU4-","srOnly":"esUiRgWabYw-"};
|
|
57
|
+
var css_248z$e = ".TkdrExYnvcY-,\n.TkdrExYnvcY- * {\n box-sizing: border-box;\n}\n\n.TkdrExYnvcY- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n position: relative;\n z-index: 0;\n z-index: var(--elevation-default);\n -ms-flex: 1;\n flex: 1;\n}\n\n/*\n * Header\n */\n\n.IcAlZHoB4LI- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n z-index: 1;\n z-index: var(--elevation-base);\n margin-bottom: calc(16px / 2);\n margin-bottom: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.TFO76ysivmg- {\n display: grid;\n padding: calc(16px / 2) 0;\n padding: var(--space-small) 0;\n gap: calc(16px / 2);\n grid-gap: calc(16px / 2);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n grid-template-columns: auto -webkit-max-content;\n grid-template-columns: auto max-content;\n}\n\n.jGHZZYZm1ZY- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n -ms-flex-pack: center;\n justify-content: center;\n min-height: calc(16px * 3);\n min-height: var(--space-largest);\n padding: calc(16px / 2);\n padding: var(--space-small);\n border-bottom: calc(16px / 8) solid rgb(225, 225, 225);\n border-bottom: var(--border-thick) solid var(--color-border);\n}\n\n.GiD7MjZJbcw- {\n display: -ms-flexbox;\n display: flex;\n}\n\n@media (max-width: 489.98px) {\n\n.GiD7MjZJbcw- {\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n}\n }\n\n@media (--small-screens-and-below) {\n\n.GiD7MjZJbcw- {\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n}\n }\n\n.jMSVGIAr5tk- > p {\n font-weight: 500;\n white-space: nowrap;\n}\n\n.jMSVGIAr5tk- {\n display: -ms-flexbox;\n display: flex;\n margin: calc((16px / 2) * -1) 0;\n margin: calc(calc(16px / 2) * -1) 0;\n margin: calc(var(--space-small) * -1) 0;\n -ms-flex-align: center;\n align-items: center;\n gap: calc(16px / 4);\n gap: var(--space-smaller);\n}\n\n/*\n * List Item\n */\n\n.ise8kHCfhCY- {\n position: relative;\n padding: calc(16px / 2);\n padding: var(--space-small);\n border-bottom: calc(16px / 16) solid rgb(225, 225, 225);\n border-bottom: var(--border-base) solid var(--color-border);\n transition: all 200ms;\n transition: all var(--timing-base);\n}\n\n.ise8kHCfhCY-.Pc0JGX6jCD4-,\n.ise8kHCfhCY-:hover,\n.ise8kHCfhCY-:focus-within {\n --data-list-item-active-color: var(--color-surface--background);\n background-color: rgb(244, 244, 244);\n background-color: var(--data-list-item-active-color);\n}\n\n.Tq6e0BGwcSM- {\n display: block;\n margin: calc((16px / 2) * -1) 0;\n margin: calc(calc(16px / 2) * -1) 0;\n margin: calc(var(--space-small) * -1) 0;\n padding: calc(16px / 2) 0;\n padding: var(--space-small) 0;\n border: none;\n text-align: left;\n -webkit-text-decoration: none;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer;\n}\n\n/**\n * Enable a better hover and focus experience when :has() is supported.\n * This is a workaround for Firefox where the :has() selector is not supported.\n */\n\n@supports selector(*:has(*)) {\n .ise8kHCfhCY-:hover,\n .ise8kHCfhCY-:focus-within {\n background-color: transparent;\n }\n\n .ise8kHCfhCY-:has(.Tq6e0BGwcSM-:hover, .Tq6e0BGwcSM-:focus) {\n background-color: var(--data-list-item-active-color);\n }\n}\n\n/*\n * List Item Selection\n */\n\n.d-79rkMqufg- {\n display: grid;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n@media (min-width: 768px) {\n\n.d-79rkMqufg- {\n -ms-flex-align: center;\n align-items: center;\n}\n }\n\n@media (--medium-screens-and-up) {\n\n.d-79rkMqufg- {\n -ms-flex-align: center;\n align-items: center;\n}\n }\n\n.d-79rkMqufg-,\n.jGHZZYZm1ZY- .d-79rkMqufg- {\n grid-template-columns: -webkit-max-content minmax(0px, auto);\n grid-template-columns: max-content minmax(0px, auto);\n -webkit-column-gap: calc(16px / 2);\n -webkit-column-gap: var(--space-small);\n -moz-column-gap: calc(16px / 2);\n -moz-column-gap: var(--space-small);\n column-gap: calc(16px / 2);\n column-gap: var(--space-small);\n}\n\n.jGHZZYZm1ZY- .d-79rkMqufg- {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.qm-SSuWTXkI- {\n display: -ms-flexbox;\n display: flex;\n visibility: hidden;\n\n /* To compensate the Checkbox's label margin that we are using for screen-readers */\n margin-right: calc((16px * 1) * -1);\n margin-right: calc(calc(16px * 1) * -1);\n margin-right: calc(var(--space-base) * -1);\n}\n\n.qm-SSuWTXkI-.VA9RnQp6nbI- {\n visibility: visible;\n}\n\n.ise8kHCfhCY- .d-79rkMqufg- > :first-child {\n -ms-flex-order: 2;\n order: 2;\n}\n\n.ise8kHCfhCY- .d-79rkMqufg- > :last-child {\n -ms-flex-order: 1;\n order: 1;\n padding-top: calc(16px / 4);\n padding-top: var(--space-smaller);\n opacity: 1;\n transition: opacity 100ms ease-in-out;\n transition: opacity var(--transition-properties);\n --transition-properties: var(--timing-quick) ease-in-out;\n}\n\n@media (min-width: 768px) {\n\n.ise8kHCfhCY- .d-79rkMqufg- > :last-child {\n padding-top: 0;\n opacity: 0;\n}\n }\n\n@media (--medium-screens-and-up) {\n\n.ise8kHCfhCY- .d-79rkMqufg- > :last-child {\n padding-top: 0;\n opacity: 0;\n}\n }\n\n.ise8kHCfhCY-:hover .d-79rkMqufg- > :last-child,\n.ise8kHCfhCY-:focus-within .d-79rkMqufg- > :last-child,\n.ise8kHCfhCY- .d-79rkMqufg-._4L7iXXzLr5k- > :last-child {\n opacity: 1;\n}\n\n/*\n * Filters\n */\n\n.Kkp-IYmwq-s- {\n display: -ms-flexbox;\n display: flex;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(255, 255, 255, 0.6);\n background-color: var(--color-overlay--dimmed);\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.m-eCShL7TU4- {\n position: sticky;\n top: 50vh;\n}\n\n/* This hides the text from the UI but not from the screen readers */\n\n.esUiRgWabYw- {\n position: absolute;\n top: auto;\n left: -10000px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n text-indent: -10000px;\n}\n";
|
|
58
|
+
var styles$e = {"wrapper":"TkdrExYnvcY-","titleContainer":"IcAlZHoB4LI-","headerFilters":"TFO76ysivmg-","headerTitles":"jGHZZYZm1ZY-","batchSelectContainer":"GiD7MjZJbcw-","headerBatchSelect":"jMSVGIAr5tk-","listItem":"ise8kHCfhCY-","active":"Pc0JGX6jCD4-","listItemClickable":"Tq6e0BGwcSM-","selectable":"d-79rkMqufg-","selectAllCheckbox":"qm-SSuWTXkI-","visible":"VA9RnQp6nbI-","selected":"_4L7iXXzLr5k-","filtering":"Kkp-IYmwq-s-","filteringSpinner":"m-eCShL7TU4-","srOnly":"esUiRgWabYw-"};
|
|
61
59
|
styleInject_es.styleInject(css_248z$e);
|
|
62
60
|
|
|
63
61
|
var css_248z$d = ".F56prQsXm3A- {\n min-width: 80px;\n margin-left: calc(16px / 2);\n margin-left: var(--space-small);\n}\n";
|
|
@@ -111,10 +109,6 @@ var css_248z$b = ".jHcHGQ-HDbk- {\n display: -ms-flexbox;\n display: flex;\n
|
|
|
111
109
|
var styles$b = {"menu":"jHcHGQ-HDbk-"};
|
|
112
110
|
styleInject_es.styleInject(css_248z$b);
|
|
113
111
|
|
|
114
|
-
var css_248z$a = ".aokwZU8jbWU- {\n position: fixed;\n top: 0;\n top: var(--actions-menu-y, 0);\n left: 0;\n left: var(--actions-menu-x, 0);\n z-index: 6;\n z-index: var(--elevation-menu);\n min-width: 150px;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(225, 225, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 2);\n border-radius: var(--radius-larger);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.XtVRP97TVSE- {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(6 - 1);\n z-index: calc(var(--elevation-menu) - 1);\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: transparent;\n}\n";
|
|
115
|
-
var styles$a = {"menu":"aokwZU8jbWU-","overlay":"XtVRP97TVSE-"};
|
|
116
|
-
styleInject_es.styleInject(css_248z$a);
|
|
117
|
-
|
|
118
112
|
const EMPTY_RESULTS_MESSAGE = "List is looking empty";
|
|
119
113
|
const EMPTY_FILTER_RESULTS_MESSAGE = "No results for selected filters";
|
|
120
114
|
const EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR = "DataListEmptyState action prop must be a Button component";
|
|
@@ -136,56 +130,23 @@ const DATA_LOAD_MORE_TEST_ID = "ATL-DataList-LoadMore-trigger";
|
|
|
136
130
|
const TRANSITION_DURATION_IN_SECONDS = design.tokens["timing-base"] / 1000;
|
|
137
131
|
const TRANSITION_DELAY_IN_SECONDS = design.tokens["timing-quick"] / 1000;
|
|
138
132
|
|
|
139
|
-
const
|
|
140
|
-
hidden: { opacity: 0, y: -10 },
|
|
141
|
-
visible: { opacity: 1, y: 0 },
|
|
142
|
-
};
|
|
143
|
-
function DataListActionsMenu({ visible = false, position, onRequestClose, children, }) {
|
|
144
|
-
const [ref, setRef] = React.useState();
|
|
145
|
-
useRefocusOnActivator.useRefocusOnActivator(visible);
|
|
146
|
-
const focusTrapRef = useFocusTrap.useFocusTrap(visible);
|
|
147
|
-
useOnKeyDown.useOnKeyDown(onRequestClose, "Escape");
|
|
148
|
-
return ReactDOM.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, visible && (React__default["default"].createElement("div", { ref: focusTrapRef },
|
|
149
|
-
React__default["default"].createElement(framerMotion.motion.div, { role: "menu", ref: setRef, variants: variants$1, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: TRANSITION_DELAY_IN_SECONDS }, className: styles$a.menu, style: getPositionCssVars(), onClick: onRequestClose }, children),
|
|
150
|
-
React__default["default"].createElement("button", { className: styles$a.overlay, onClick: onRequestClose, "aria-label": "Close menu" })))), document.body);
|
|
151
|
-
function getPositionCssVars() {
|
|
152
|
-
const { posX, posY } = getPosition();
|
|
153
|
-
return {
|
|
154
|
-
"--actions-menu-x": `${posX}px`,
|
|
155
|
-
"--actions-menu-y": `${posY}px`,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function getPosition() {
|
|
159
|
-
const rect = ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect();
|
|
160
|
-
const { width = 0, height = 0 } = rect || {};
|
|
161
|
-
const { x, y } = position;
|
|
162
|
-
const xIsOffScreen = x + width > window.innerWidth;
|
|
163
|
-
const yIsOffScreen = y + height > window.innerHeight;
|
|
164
|
-
const xOffSet = x + width - window.innerWidth + foundation.tokens["space-base"];
|
|
165
|
-
const yOffSet = y + height - window.innerHeight;
|
|
166
|
-
const newPosX = Math.floor(xIsOffScreen ? x - xOffSet : x);
|
|
167
|
-
const newPosY = Math.floor(yIsOffScreen ? y - yOffSet : y);
|
|
168
|
-
return { posX: newPosX, posY: newPosY };
|
|
169
|
-
}
|
|
170
|
-
}
|
|
133
|
+
const CONTAINER_TEST_ID = "ATL-DataListFilters-Container";
|
|
171
134
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
setShowMenu(false);
|
|
188
|
-
}
|
|
135
|
+
var css_248z$a = ".jbBRoxlZlNI- {\n -ms-flex-item-align: center;\n align-self: center;\n position: relative;\n min-width: 0;\n}\n\n.MnN8qbS4hw4- {\n display: grid;\n overflow-x: auto;\n grid-auto-flow: column;\n grid-auto-columns: -webkit-max-content;\n grid-auto-columns: max-content;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.MnN8qbS4hw4- > :nth-child(n + 3):not(:last-child) {\n margin-left: calc(16px / 2);\n margin-left: var(--space-small);\n}\n\n.b-5P7Z8eGO8- {\n visibility: hidden;\n}\n\n.xzaCS4slLpI-::before,\n.Jf227kC8Nu0-::after {\n content: \"\";\n position: absolute;\n top: 0;\n width: calc(16px * 1.5);\n width: var(--space-large);\n height: 100%;\n background-image: linear-gradient(\n to right,\n rgba(255, 255, 255, 1) 0%,\n rgba(255, 255, 255, 0) 100%\n );\n background-image: linear-gradient(\n var(--data-list-overflow-shadow-angle, to right),\n var(--color-surface) 0%,\n rgba(var(--color-white--rgb), 0) 100%\n );\n pointer-events: none;\n}\n\n.xzaCS4slLpI-::before {\n left: 0;\n}\n\n.Jf227kC8Nu0-::after {\n --data-list-overflow-shadow-angle: to left;\n right: 0;\n}\n";
|
|
136
|
+
var styles$a = {"fadeContainer":"jbBRoxlZlNI-","overflowGrid":"MnN8qbS4hw4-","overflowTrigger":"b-5P7Z8eGO8-","overflowLeft":"xzaCS4slLpI-","overflowRight":"Jf227kC8Nu0-"};
|
|
137
|
+
styleInject_es.styleInject(css_248z$a);
|
|
138
|
+
|
|
139
|
+
function DataListOverflowFade({ children }) {
|
|
140
|
+
const [leftRef, isLeftVisible] = useInView.useInView();
|
|
141
|
+
const [rightRef, isRightVisible] = useInView.useInView();
|
|
142
|
+
return (React__default["default"].createElement("div", { "data-testid": CONTAINER_TEST_ID, className: classnames__default["default"](styles$a.fadeContainer, {
|
|
143
|
+
[styles$a.overflowLeft]: !isLeftVisible,
|
|
144
|
+
[styles$a.overflowRight]: !isRightVisible,
|
|
145
|
+
}) },
|
|
146
|
+
React__default["default"].createElement("div", { className: styles$a.overflowGrid },
|
|
147
|
+
React__default["default"].createElement("span", { ref: leftRef, className: styles$a.overflowTrigger }),
|
|
148
|
+
children,
|
|
149
|
+
React__default["default"].createElement("span", { ref: rightRef, className: styles$a.overflowTrigger }))));
|
|
189
150
|
}
|
|
190
151
|
|
|
191
152
|
var css_248z$9 = ".WRV-UmQmPzo- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n z-index: 0;\n z-index: var(--elevation-default);\n overflow: hidden;\n gap: calc(16px / 2);\n gap: var(--space-small);\n}\n\n.liQeWCMenD0- {\n --overflow-bg: var(--data-list-item-active-color, var(--color-surface));\n\n display: -ms-flexbox;\n\n display: flex;\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n padding-left: calc(16px * 1);\n padding-left: var(--space-base);\n background-image: linear-gradient(\n 90deg,\n transparent 0,\n rgba(255, 255, 255, 1) calc(16px * 1),\n rgba(255, 255, 255, 1) 100%\n );\n background-image: linear-gradient(\n 90deg,\n transparent 0,\n var(--overflow-bg) var(--space-base),\n var(--overflow-bg) 100%\n );\n -ms-flex-align: center;\n align-items: center;\n transition: all 200ms;\n transition: all var(--timing-base);\n}\n";
|
|
@@ -358,6 +319,92 @@ function getExposedActions(childrenArray, childCount = 2) {
|
|
|
358
319
|
}, []);
|
|
359
320
|
}
|
|
360
321
|
|
|
322
|
+
const DataListLayoutActionsContext = React.createContext({ activeItem: undefined });
|
|
323
|
+
function useDataListLayoutActionsContext() {
|
|
324
|
+
return React.useContext(DataListLayoutActionsContext);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
var css_248z$6 = ".aokwZU8jbWU- {\n position: fixed;\n top: 0;\n top: var(--actions-menu-y, 0);\n left: 0;\n left: var(--actions-menu-x, 0);\n z-index: 6;\n z-index: var(--elevation-menu);\n min-width: 150px;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(225, 225, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 2);\n border-radius: var(--radius-larger);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.XtVRP97TVSE- {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(6 - 1);\n z-index: calc(var(--elevation-menu) - 1);\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: transparent;\n}\n";
|
|
328
|
+
var styles$6 = {"menu":"aokwZU8jbWU-","overlay":"XtVRP97TVSE-"};
|
|
329
|
+
styleInject_es.styleInject(css_248z$6);
|
|
330
|
+
|
|
331
|
+
const variants$1 = {
|
|
332
|
+
hidden: { opacity: 0, y: -10 },
|
|
333
|
+
visible: { opacity: 1, y: 0 },
|
|
334
|
+
};
|
|
335
|
+
function DataListActionsMenu({ visible = false, position, onRequestClose, children, }) {
|
|
336
|
+
const [ref, setRef] = React.useState();
|
|
337
|
+
useRefocusOnActivator.useRefocusOnActivator(visible);
|
|
338
|
+
const focusTrapRef = useFocusTrap.useFocusTrap(visible);
|
|
339
|
+
useOnKeyDown.useOnKeyDown(onRequestClose, "Escape");
|
|
340
|
+
return ReactDOM.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, visible && (React__default["default"].createElement("div", { ref: focusTrapRef },
|
|
341
|
+
React__default["default"].createElement(framerMotion.motion.div, { role: "menu", ref: setRef, variants: variants$1, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: TRANSITION_DELAY_IN_SECONDS }, className: styles$6.menu, style: getPositionCssVars(), onClick: onRequestClose }, children),
|
|
342
|
+
React__default["default"].createElement("button", { className: styles$6.overlay, onClick: onRequestClose, "aria-label": "Close menu" })))), document.body);
|
|
343
|
+
function getPositionCssVars() {
|
|
344
|
+
const { posX, posY } = getPosition();
|
|
345
|
+
return {
|
|
346
|
+
"--actions-menu-x": `${posX}px`,
|
|
347
|
+
"--actions-menu-y": `${posY}px`,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function getPosition() {
|
|
351
|
+
const rect = ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect();
|
|
352
|
+
const { width = 0, height = 0 } = rect || {};
|
|
353
|
+
const { x, y } = position;
|
|
354
|
+
const xIsOffScreen = x + width > window.innerWidth;
|
|
355
|
+
const yIsOffScreen = y + height > window.innerHeight;
|
|
356
|
+
const xOffSet = x + width - window.innerWidth + foundation.tokens["space-base"];
|
|
357
|
+
const yOffSet = y + height - window.innerHeight;
|
|
358
|
+
const newPosX = Math.floor(xIsOffScreen ? x - xOffSet : x);
|
|
359
|
+
const newPosY = Math.floor(yIsOffScreen ? y - yOffSet : y);
|
|
360
|
+
return { posX: newPosX, posY: newPosY };
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function DataListItemActionsOverflow({ actions, }) {
|
|
365
|
+
const [menuPosition, setMenuPosition] = React.useState({ x: 0, y: 0 });
|
|
366
|
+
const [showMenu, setShowMenu] = React.useState(false);
|
|
367
|
+
if (actions.length === 0)
|
|
368
|
+
return null;
|
|
369
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
370
|
+
React__default["default"].createElement(Tooltip.Tooltip, { message: "More actions" },
|
|
371
|
+
React__default["default"].createElement(Button.Button, { icon: "more", ariaLabel: "More actions", type: "secondary", variation: "subtle", onClick: handleMoreClick })),
|
|
372
|
+
React__default["default"].createElement(DataListActionsMenu, { visible: showMenu, position: menuPosition, onRequestClose: handleClose }, actions)));
|
|
373
|
+
function handleMoreClick(event) {
|
|
374
|
+
setShowMenu(true);
|
|
375
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
376
|
+
const posX = rect.x;
|
|
377
|
+
const posY = rect.y + rect.height;
|
|
378
|
+
setMenuPosition({ x: posX, y: posY });
|
|
379
|
+
}
|
|
380
|
+
function handleClose() {
|
|
381
|
+
setShowMenu(false);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function DataListActions({ children, itemsToExpose = 2, }) {
|
|
386
|
+
const { activeItem } = useDataListLayoutActionsContext();
|
|
387
|
+
const childrenArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
388
|
+
const exposedActions = getExposedActions(childrenArray, itemsToExpose);
|
|
389
|
+
childrenArray.splice(0, exposedActions.length);
|
|
390
|
+
return (React__default["default"].createElement(DataListOverflowFade, null,
|
|
391
|
+
exposedActions.map(({ props }) => {
|
|
392
|
+
if (!props.icon)
|
|
393
|
+
return null;
|
|
394
|
+
return (React__default["default"].createElement(Tooltip.Tooltip, { key: props.label, message: props.label },
|
|
395
|
+
React__default["default"].createElement(Button.Button, { icon: props.icon, ariaLabel: props.label, onClick: () => {
|
|
396
|
+
var _a, _b;
|
|
397
|
+
if (activeItem) {
|
|
398
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
(_b = props.onClick) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
402
|
+
}
|
|
403
|
+
}, type: "secondary", variation: "subtle" })));
|
|
404
|
+
}),
|
|
405
|
+
React__default["default"].createElement(DataListItemActionsOverflow, { actions: childrenArray })));
|
|
406
|
+
}
|
|
407
|
+
|
|
361
408
|
// This component is meant to capture the props of the DataList.ItemActions
|
|
362
409
|
function DataListItemActions(
|
|
363
410
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -368,40 +415,26 @@ const variants = {
|
|
|
368
415
|
hidden: { opacity: 0, y: 10 },
|
|
369
416
|
visible: { opacity: 1, y: 0 },
|
|
370
417
|
};
|
|
371
|
-
function InternalDataListItemActions(
|
|
418
|
+
function InternalDataListItemActions() {
|
|
372
419
|
const { itemActionComponent } = useDataListContext();
|
|
373
420
|
if (!itemActionComponent)
|
|
374
421
|
return null;
|
|
375
422
|
const { children } = itemActionComponent.props;
|
|
376
|
-
const childrenArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
377
|
-
const exposedActions = getExposedActions(childrenArray);
|
|
378
|
-
childrenArray.splice(0, exposedActions.length);
|
|
379
423
|
return (React__default["default"].createElement(framerMotion.motion.div, { variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: {
|
|
380
424
|
duration: TRANSITION_DURATION_IN_SECONDS,
|
|
381
425
|
delay: TRANSITION_DELAY_IN_SECONDS,
|
|
382
426
|
}, className: styles$b.menu, onContextMenu: handleContextMenu },
|
|
383
|
-
|
|
384
|
-
if (!props.icon)
|
|
385
|
-
return null;
|
|
386
|
-
return (React__default["default"].createElement(Tooltip.Tooltip, { key: props.label, message: props.label },
|
|
387
|
-
React__default["default"].createElement(Button.Button, { icon: props.icon, ariaLabel: props.label, onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, item); }, type: "secondary", variation: "subtle" })));
|
|
388
|
-
}),
|
|
389
|
-
Boolean(childrenArray.length) && (React__default["default"].createElement(DataListItemActionsOverflow, { actions: childrenArray }))));
|
|
427
|
+
React__default["default"].createElement(DataListActions, null, children)));
|
|
390
428
|
}
|
|
391
429
|
function handleContextMenu(event) {
|
|
392
430
|
event.stopPropagation();
|
|
393
431
|
}
|
|
394
432
|
|
|
395
|
-
const DataListLayoutActionsContext = React.createContext({ activeItem: undefined });
|
|
396
|
-
function useDataListLayoutActionsContext() {
|
|
397
|
-
return React.useContext(DataListLayoutActionsContext);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
433
|
function DataListItemInternal({ children, item, }) {
|
|
401
434
|
const { selected, onSelect } = useDataListContext();
|
|
402
435
|
if (selected !== undefined && onSelect) {
|
|
403
|
-
return (React__default["default"].createElement("div", { className: classnames__default["default"](
|
|
404
|
-
[
|
|
436
|
+
return (React__default["default"].createElement("div", { className: classnames__default["default"](styles$e.selectable, {
|
|
437
|
+
[styles$e.selected]: selected === null || selected === void 0 ? void 0 : selected.length,
|
|
405
438
|
}) },
|
|
406
439
|
children,
|
|
407
440
|
React__default["default"].createElement(Checkbox.Checkbox, { checked: selected === null || selected === void 0 ? void 0 : selected.includes(item.id), onChange: handleChange })));
|
|
@@ -423,14 +456,14 @@ function DataListItemClickableInternal({ onClick, url, to, children, }) {
|
|
|
423
456
|
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
424
457
|
if (to) {
|
|
425
458
|
const computedTo = typeof to === "string" ? to : to(activeItem);
|
|
426
|
-
return (React__default["default"].createElement(reactRouterDom.Link, { className:
|
|
459
|
+
return (React__default["default"].createElement(reactRouterDom.Link, { className: styles$e.listItemClickable, to: computedTo, onClick: handleClick }, children));
|
|
427
460
|
}
|
|
428
461
|
if (url) {
|
|
429
462
|
const href = typeof url === "string" ? url : url(activeItem);
|
|
430
|
-
return (React__default["default"].createElement("a", { className:
|
|
463
|
+
return (React__default["default"].createElement("a", { className: styles$e.listItemClickable, href: href, onClick: handleClick }, children));
|
|
431
464
|
}
|
|
432
465
|
if (onClick) {
|
|
433
|
-
return (React__default["default"].createElement("button", { className:
|
|
466
|
+
return (React__default["default"].createElement("button", { className: styles$e.listItemClickable, onClick: handleClick }, children));
|
|
434
467
|
}
|
|
435
468
|
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
436
469
|
function handleClick() {
|
|
@@ -457,13 +490,13 @@ function DataListItem({ item, layout, }) {
|
|
|
457
490
|
const isContextMenuVisible = Boolean(contextPosition);
|
|
458
491
|
const shouldShowContextMenu = showMenu && isContextMenuVisible && Boolean(contextMenuActions);
|
|
459
492
|
return (React__default["default"].createElement(DataListLayoutActionsContext.Provider, { value: { activeItem: item } },
|
|
460
|
-
React__default["default"].createElement("div", { onMouseEnter: handleShowMenu, onMouseLeave: handleHideMenu, onFocus: handleShowMenu, onBlur: handleHideMenu, onContextMenu: handleContextMenu, className: classnames__default["default"](
|
|
461
|
-
[
|
|
493
|
+
React__default["default"].createElement("div", { onMouseEnter: handleShowMenu, onMouseLeave: handleHideMenu, onFocus: handleShowMenu, onBlur: handleHideMenu, onContextMenu: handleContextMenu, className: classnames__default["default"](styles$e.listItem, {
|
|
494
|
+
[styles$e.active]: showMenu && isContextMenuVisible,
|
|
462
495
|
}), key: item.id },
|
|
463
496
|
React__default["default"].createElement(DataListItemInternal, { item: item },
|
|
464
497
|
React__default["default"].createElement(DataListItemClickable, null, layout.props.children(generatedItem))),
|
|
465
498
|
React__default["default"].createElement(framerMotion.AnimatePresence, null,
|
|
466
|
-
showMenu && !hasInLayoutActions &&
|
|
499
|
+
showMenu && !hasInLayoutActions && React__default["default"].createElement(InternalDataListItemActions, null),
|
|
467
500
|
React__default["default"].createElement(DataListActionsMenu, { key: item.id, visible: shouldShowContextMenu, position: contextPosition || { x: 0, y: 0 }, onRequestClose: () => setContextPosition(undefined) }, contextMenuActions)))));
|
|
468
501
|
function handleShowMenu() {
|
|
469
502
|
setShowMenu(true);
|
|
@@ -524,49 +557,6 @@ function DataListItems({ layouts, mediaMatches, data, }) {
|
|
|
524
557
|
React__default["default"].createElement(DataListLayoutInternal, { layouts: layouts, mediaMatches: mediaMatches, renderLayout: layout => (React__default["default"].createElement(React__default["default"].Fragment, null, data.map((child, i) => (React__default["default"].createElement(DataListItem, { key: data[i].id, index: i, item: child, layout: layout }))))) })));
|
|
525
558
|
}
|
|
526
559
|
|
|
527
|
-
const CONTAINER_TEST_ID = "ATL-DataListFilters-Container";
|
|
528
|
-
|
|
529
|
-
var css_248z$6 = ".jbBRoxlZlNI- {\n -ms-flex-item-align: center;\n align-self: center;\n position: relative;\n min-width: 0;\n}\n\n.MnN8qbS4hw4- {\n display: grid;\n overflow-x: auto;\n grid-auto-flow: column;\n grid-auto-columns: -webkit-max-content;\n grid-auto-columns: max-content;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.MnN8qbS4hw4- > :nth-child(n + 3):not(:last-child) {\n margin-left: calc(16px / 2);\n margin-left: var(--space-small);\n}\n\n.b-5P7Z8eGO8- {\n visibility: hidden;\n}\n\n.xzaCS4slLpI-::before,\n.Jf227kC8Nu0-::after {\n content: \"\";\n position: absolute;\n top: 0;\n width: calc(16px * 1.5);\n width: var(--space-large);\n height: 100%;\n background-image: linear-gradient(\n to right,\n rgba(255, 255, 255, 1) 0%,\n rgba(255, 255, 255, 0) 100%\n );\n background-image: linear-gradient(\n var(--data-list-overflow-shadow-angle, to right),\n var(--color-surface) 0%,\n rgba(var(--color-white--rgb), 0) 100%\n );\n pointer-events: none;\n}\n\n.xzaCS4slLpI-::before {\n left: 0;\n}\n\n.Jf227kC8Nu0-::after {\n --data-list-overflow-shadow-angle: to left;\n right: 0;\n}\n";
|
|
530
|
-
var styles$6 = {"fadeContainer":"jbBRoxlZlNI-","overflowGrid":"MnN8qbS4hw4-","overflowTrigger":"b-5P7Z8eGO8-","overflowLeft":"xzaCS4slLpI-","overflowRight":"Jf227kC8Nu0-"};
|
|
531
|
-
styleInject_es.styleInject(css_248z$6);
|
|
532
|
-
|
|
533
|
-
function DataListOverflowFade({ children }) {
|
|
534
|
-
const [leftRef, isLeftVisible] = useInView.useInView();
|
|
535
|
-
const [rightRef, isRightVisible] = useInView.useInView();
|
|
536
|
-
return (React__default["default"].createElement("div", { "data-testid": CONTAINER_TEST_ID, className: classnames__default["default"](styles$6.fadeContainer, {
|
|
537
|
-
[styles$6.overflowLeft]: !isLeftVisible,
|
|
538
|
-
[styles$6.overflowRight]: !isRightVisible,
|
|
539
|
-
}) },
|
|
540
|
-
React__default["default"].createElement("div", { className: styles$6.overflowGrid },
|
|
541
|
-
React__default["default"].createElement("span", { ref: leftRef, className: styles$6.overflowTrigger }),
|
|
542
|
-
children,
|
|
543
|
-
React__default["default"].createElement("span", { ref: rightRef, className: styles$6.overflowTrigger }))));
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// This component is meant to capture the props of the DataList.BulkActions
|
|
547
|
-
function DataListBulkActions(
|
|
548
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
549
|
-
_) {
|
|
550
|
-
return null;
|
|
551
|
-
}
|
|
552
|
-
function InternalDataListBulkActions() {
|
|
553
|
-
const { bulkActionsComponent } = useDataListContext();
|
|
554
|
-
if (!bulkActionsComponent)
|
|
555
|
-
return null;
|
|
556
|
-
const { children } = bulkActionsComponent.props;
|
|
557
|
-
const childrenArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
558
|
-
const exposedActions = getExposedActions(childrenArray, 3);
|
|
559
|
-
childrenArray.splice(0, exposedActions.length);
|
|
560
|
-
return (React__default["default"].createElement(DataListOverflowFade, null,
|
|
561
|
-
exposedActions.map(({ props }) => {
|
|
562
|
-
if (!props.icon)
|
|
563
|
-
return null;
|
|
564
|
-
return (React__default["default"].createElement(Tooltip.Tooltip, { key: props.label, message: props.label },
|
|
565
|
-
React__default["default"].createElement(Button.Button, { icon: props.icon, ariaLabel: props.label, onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props); }, type: "secondary", variation: "subtle" })));
|
|
566
|
-
}),
|
|
567
|
-
React__default["default"].createElement(DataListItemActionsOverflow, { actions: childrenArray })));
|
|
568
|
-
}
|
|
569
|
-
|
|
570
560
|
function useMediaQuery(CSSMediaQuery) {
|
|
571
561
|
const [matches, setMatches] = React.useState(window.matchMedia(CSSMediaQuery).matches);
|
|
572
562
|
React.useEffect(() => {
|
|
@@ -590,6 +580,23 @@ function useResponsiveSizing() {
|
|
|
590
580
|
return { xs, sm, md, lg, xl };
|
|
591
581
|
}
|
|
592
582
|
|
|
583
|
+
// This component is meant to capture the props of the DataList.BulkActions
|
|
584
|
+
function DataListBulkActions(
|
|
585
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
586
|
+
_) {
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
function InternalDataListBulkActions() {
|
|
590
|
+
const { bulkActionsComponent } = useDataListContext();
|
|
591
|
+
if (!bulkActionsComponent)
|
|
592
|
+
return null;
|
|
593
|
+
const { children } = bulkActionsComponent.props;
|
|
594
|
+
const { sm } = useResponsiveSizing();
|
|
595
|
+
// Collapse all actions under "More actions" when breakpoint is smaller than sm
|
|
596
|
+
const itemsToExpose = sm ? 3 : 0;
|
|
597
|
+
return (React__default["default"].createElement(DataListActions, { itemsToExpose: itemsToExpose }, children));
|
|
598
|
+
}
|
|
599
|
+
|
|
593
600
|
function DataListHeaderCheckbox({ children }) {
|
|
594
601
|
const { data, totalCount, selected = [], onSelectAll, onSelect, } = useDataListContext();
|
|
595
602
|
if (!onSelectAll && !onSelect)
|
|
@@ -604,12 +611,12 @@ function DataListHeaderCheckbox({ children }) {
|
|
|
604
611
|
}) },
|
|
605
612
|
React__default["default"].createElement(Checkbox.Checkbox, { checked: isAllSelected(), indeterminate: selected.length > 0 && !isAllSelected(), onChange: onSelectAll },
|
|
606
613
|
React__default["default"].createElement("div", { className: styles$e.srOnly }, selectedLabel))),
|
|
607
|
-
React__default["default"].createElement(AnimatedSwitcher.AnimatedSwitcher, { switched: Boolean(selected.length), initialChild: children, switchTo: React__default["default"].createElement("div", { className: styles$e.
|
|
608
|
-
React__default["default"].createElement(
|
|
609
|
-
React__default["default"].createElement(
|
|
614
|
+
React__default["default"].createElement(AnimatedSwitcher.AnimatedSwitcher, { switched: Boolean(selected.length), initialChild: children, switchTo: React__default["default"].createElement("div", { className: styles$e.batchSelectContainer },
|
|
615
|
+
React__default["default"].createElement("div", { className: styles$e.headerBatchSelect },
|
|
616
|
+
React__default["default"].createElement(Text.Text, null,
|
|
610
617
|
selected.length,
|
|
611
|
-
" selected")
|
|
612
|
-
|
|
618
|
+
" selected"),
|
|
619
|
+
React__default["default"].createElement(Button.Button, { label: deselectText, onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect([]), type: "tertiary" })),
|
|
613
620
|
React__default["default"].createElement(InternalDataListBulkActions, null)) })));
|
|
614
621
|
function isAllSelected() {
|
|
615
622
|
// If there's a totalCount, we can use that to accurately determine if the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "52699bf3dddbab1cb9f56e9399952ee5f6c389b3"
|
|
88
88
|
}
|