@jobber/components 6.4.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataList/DataList.types.d.ts +7 -0
- package/dist/DataList/components/DataListEmptyState/index.cjs +1 -0
- package/dist/DataList/components/DataListEmptyState/index.mjs +1 -0
- package/dist/DataList/index.d.ts +1 -1
- package/dist/DataListEmptyState-cjs.js +8 -5
- package/dist/DataListEmptyState-es.js +8 -5
- package/dist/styles.css +12 -14
- package/package.json +2 -2
|
@@ -192,6 +192,13 @@ export interface DataListEmptyStateProps {
|
|
|
192
192
|
* to the DataList component.
|
|
193
193
|
*/
|
|
194
194
|
readonly type?: "filtered" | "empty";
|
|
195
|
+
/**
|
|
196
|
+
* Custom render function for the empty state.
|
|
197
|
+
*
|
|
198
|
+
* If provided, this function will be used to render the empty state instead
|
|
199
|
+
* of the default rendering logic.
|
|
200
|
+
*/
|
|
201
|
+
readonly customRender?: (emptyState: Omit<DataListEmptyStateProps, "customRender">) => ReactNode;
|
|
195
202
|
}
|
|
196
203
|
export interface DataListContextProps<T extends DataListObject> extends DataListProps<T> {
|
|
197
204
|
readonly filterComponent?: ReactElement<DataListFiltersProps>;
|
package/dist/DataList/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./DataList";
|
|
2
|
-
export { DataListItemType, DataListObject, DataListSorting, DataListSortable, DataListSelectedType, DataListSelectedAllType, } from "./DataList.types";
|
|
2
|
+
export { DataListItemType, DataListObject, DataListSorting, DataListSortable, DataListSelectedType, DataListSelectedAllType, DataListEmptyStateProps, } from "./DataList.types";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var DataListContext = require('./DataListContext-cjs.js');
|
|
5
6
|
var Text = require('./Text-cjs.js');
|
|
@@ -14,21 +15,23 @@ function DataListEmptyState(_) {
|
|
|
14
15
|
}
|
|
15
16
|
function InternalDataListEmptyState() {
|
|
16
17
|
const { emptyStateComponents: components, filtered } = React.useContext(DataListContext.DataListContext);
|
|
17
|
-
const
|
|
18
|
-
return (React.createElement("div", { className: styles.emptyStateWrapper },
|
|
19
|
-
React.createElement(Text.Text, { align: "center" }, message),
|
|
20
|
-
renderButton(action)));
|
|
21
|
-
function
|
|
18
|
+
const _a = getEmptyStateContent(), { customRender } = _a, contentProps = tslib_es6.__rest(_a, ["customRender"]);
|
|
19
|
+
return (React.createElement("div", { className: styles.emptyStateWrapper }, customRender ? (customRender(Object.assign({}, contentProps))) : (React.createElement(React.Fragment, null,
|
|
20
|
+
React.createElement(Text.Text, { align: "center" }, contentProps.message),
|
|
21
|
+
renderButton(contentProps.action)))));
|
|
22
|
+
function getEmptyStateContent() {
|
|
22
23
|
const { defaultEmptyState, filteredEmptyState } = getEmptyStates(components);
|
|
23
24
|
if (filtered) {
|
|
24
25
|
return {
|
|
25
26
|
message: (filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.message) || DataList_const.EMPTY_FILTER_RESULTS_MESSAGE,
|
|
26
27
|
action: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.action,
|
|
28
|
+
customRender: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.customRender,
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
return {
|
|
30
32
|
message: (defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.message) || DataList_const.EMPTY_RESULTS_MESSAGE,
|
|
31
33
|
action: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.action,
|
|
34
|
+
customRender: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.customRender,
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as __rest } from './tslib.es6-es.js';
|
|
1
2
|
import React, { useContext, cloneElement } from 'react';
|
|
2
3
|
import { D as DataListContext } from './DataListContext-es.js';
|
|
3
4
|
import { T as Text } from './Text-es.js';
|
|
@@ -12,21 +13,23 @@ function DataListEmptyState(_) {
|
|
|
12
13
|
}
|
|
13
14
|
function InternalDataListEmptyState() {
|
|
14
15
|
const { emptyStateComponents: components, filtered } = useContext(DataListContext);
|
|
15
|
-
const
|
|
16
|
-
return (React.createElement("div", { className: styles.emptyStateWrapper },
|
|
17
|
-
React.createElement(Text, { align: "center" }, message),
|
|
18
|
-
renderButton(action)));
|
|
19
|
-
function
|
|
16
|
+
const _a = getEmptyStateContent(), { customRender } = _a, contentProps = __rest(_a, ["customRender"]);
|
|
17
|
+
return (React.createElement("div", { className: styles.emptyStateWrapper }, customRender ? (customRender(Object.assign({}, contentProps))) : (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(Text, { align: "center" }, contentProps.message),
|
|
19
|
+
renderButton(contentProps.action)))));
|
|
20
|
+
function getEmptyStateContent() {
|
|
20
21
|
const { defaultEmptyState, filteredEmptyState } = getEmptyStates(components);
|
|
21
22
|
if (filtered) {
|
|
22
23
|
return {
|
|
23
24
|
message: (filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.message) || EMPTY_FILTER_RESULTS_MESSAGE,
|
|
24
25
|
action: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.action,
|
|
26
|
+
customRender: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.customRender,
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
return {
|
|
28
30
|
message: (defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.message) || EMPTY_RESULTS_MESSAGE,
|
|
29
31
|
action: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.action,
|
|
32
|
+
customRender: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.customRender,
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
}
|
package/dist/styles.css
CHANGED
|
@@ -8991,18 +8991,26 @@ ul.LfIIg9bwrhQ- {
|
|
|
8991
8991
|
padding: 4px 8px;
|
|
8992
8992
|
padding: var(--space-smaller) var(--space-small);
|
|
8993
8993
|
border: none;
|
|
8994
|
+
border-radius: 8px 8px 0 0;
|
|
8995
|
+
border-radius: var(--radius-base) var(--radius-base) 0 0;
|
|
8994
8996
|
outline: none;
|
|
8995
8997
|
color: hsl(197, 15%, 45%);
|
|
8996
8998
|
color: var(--color-text--secondary);
|
|
8997
|
-
background: rgba(255, 255, 255, 1);
|
|
8998
|
-
background: var(--color-surface);
|
|
8999
|
+
background-color: rgba(255, 255, 255, 1);
|
|
9000
|
+
background-color: var(--color-surface);
|
|
8999
9001
|
cursor: pointer;
|
|
9000
|
-
transition: all 200ms;
|
|
9001
|
-
transition: all var(--timing-base);
|
|
9002
|
+
transition: all 200ms ease;
|
|
9003
|
+
transition: all var(--timing-base) ease;
|
|
9002
9004
|
-ms-flex: 0 0 auto;
|
|
9003
9005
|
flex: 0 0 auto;
|
|
9004
9006
|
}
|
|
9005
9007
|
|
|
9008
|
+
.DEdzikxlAkw-:focus-visible {
|
|
9009
|
+
outline: transparent;
|
|
9010
|
+
background-color: hsl(53, 21%, 93%);
|
|
9011
|
+
background-color: var(--color-surface--hover);
|
|
9012
|
+
}
|
|
9013
|
+
|
|
9006
9014
|
.DEdzikxlAkw-.VDB94VYoyB0-,
|
|
9007
9015
|
.DEdzikxlAkw-:not(.VDB94VYoyB0-):hover,
|
|
9008
9016
|
.DEdzikxlAkw-:not(.VDB94VYoyB0-):focus {
|
|
@@ -9010,12 +9018,6 @@ ul.LfIIg9bwrhQ- {
|
|
|
9010
9018
|
color: var(--color-heading);
|
|
9011
9019
|
}
|
|
9012
9020
|
|
|
9013
|
-
.DEdzikxlAkw-:not(.VDB94VYoyB0-):focus-within {
|
|
9014
|
-
outline: none;
|
|
9015
|
-
background: hsl(53, 21%, 93%);
|
|
9016
|
-
background: var(--color-surface--hover);
|
|
9017
|
-
}
|
|
9018
|
-
|
|
9019
9021
|
.VDB94VYoyB0-::after {
|
|
9020
9022
|
content: " ";
|
|
9021
9023
|
display: block;
|
|
@@ -9029,10 +9031,6 @@ ul.LfIIg9bwrhQ- {
|
|
|
9029
9031
|
background-color: var(--color-interactive);
|
|
9030
9032
|
}
|
|
9031
9033
|
|
|
9032
|
-
.VDB94VYoyB0-:focus {
|
|
9033
|
-
background-color: transparent;
|
|
9034
|
-
}
|
|
9035
|
-
|
|
9036
9034
|
.htdKg6As4bY- {
|
|
9037
9035
|
padding-top: var(--tab--vertical-inset);
|
|
9038
9036
|
padding-bottom: var(--tab--vertical-inset);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -487,5 +487,5 @@
|
|
|
487
487
|
"> 1%",
|
|
488
488
|
"IE 10"
|
|
489
489
|
],
|
|
490
|
-
"gitHead": "
|
|
490
|
+
"gitHead": "33aaa4d714b638f6272b2dcf4a2cfe2525b595e6"
|
|
491
491
|
}
|