@jobber/components 6.4.1 → 6.5.1
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/List-cjs.js +1 -1
- package/dist/List-es.js +1 -1
- package/dist/styles.css +1 -46
- 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/List-cjs.js
CHANGED
|
@@ -161,7 +161,7 @@ function Description({ content }) {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
var sectionStyles = {"sectionHeader":"htH4y2JBFNQ-","
|
|
164
|
+
var sectionStyles = {"sectionHeader":"htH4y2JBFNQ-","spinning":"Y3FXizLWanA-"};
|
|
165
165
|
|
|
166
166
|
var styles = {"list":"sFlecO8-wnY-","item":"dbZy6dviEis-","section":"vz43PAcPYt0-","spinning":"gv8zs1Wo4EY-"};
|
|
167
167
|
|
package/dist/List-es.js
CHANGED
|
@@ -159,7 +159,7 @@ function Description({ content }) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
var sectionStyles = {"sectionHeader":"htH4y2JBFNQ-","
|
|
162
|
+
var sectionStyles = {"sectionHeader":"htH4y2JBFNQ-","spinning":"Y3FXizLWanA-"};
|
|
163
163
|
|
|
164
164
|
var styles = {"list":"sFlecO8-wnY-","item":"dbZy6dviEis-","section":"vz43PAcPYt0-","spinning":"gv8zs1Wo4EY-"};
|
|
165
165
|
|
package/dist/styles.css
CHANGED
|
@@ -7667,52 +7667,7 @@ html.atlantisLightBoxActive {
|
|
|
7667
7667
|
padding: 8px 16px;
|
|
7668
7668
|
padding: var(--space-small) var(--space-base);
|
|
7669
7669
|
border-bottom: 1px solid hsl(197, 90%, 12%);
|
|
7670
|
-
border-bottom:
|
|
7671
|
-
background-color: rgba(255, 255, 255, 1);
|
|
7672
|
-
background-color: var(--color-surface);
|
|
7673
|
-
}
|
|
7674
|
-
|
|
7675
|
-
.aQCYb4q1Y2g- {
|
|
7676
|
-
border-bottom-color: hsl(198, 12%, 57%);
|
|
7677
|
-
border-bottom-color: var(--color-greyBlue--light);
|
|
7678
|
-
color: hsl(198, 12%, 57%);
|
|
7679
|
-
color: var(--color-greyBlue--light);
|
|
7680
|
-
}
|
|
7681
|
-
|
|
7682
|
-
._0S6pN7pW1zg- {
|
|
7683
|
-
border-bottom-color: hsl(107, 58%, 33%);
|
|
7684
|
-
border-bottom-color: var(--color-green);
|
|
7685
|
-
color: hsl(107, 58%, 33%);
|
|
7686
|
-
color: var(--color-green);
|
|
7687
|
-
}
|
|
7688
|
-
|
|
7689
|
-
.daLL9qGMRGU-,
|
|
7690
|
-
.hFsn3u9jLu4- {
|
|
7691
|
-
border-bottom-color: hsl(197, 90%, 12%);
|
|
7692
|
-
border-bottom-color: var(--color-blue);
|
|
7693
|
-
color: hsl(197, 90%, 12%);
|
|
7694
|
-
color: var(--color-blue);
|
|
7695
|
-
}
|
|
7696
|
-
|
|
7697
|
-
.tXU2VmBjsDE- {
|
|
7698
|
-
border-bottom-color: hsl(31, 80%, 48%);
|
|
7699
|
-
border-bottom-color: var(--color-orange);
|
|
7700
|
-
color: hsl(31, 80%, 48%);
|
|
7701
|
-
color: var(--color-orange);
|
|
7702
|
-
}
|
|
7703
|
-
|
|
7704
|
-
.c1bF77gUkXI- {
|
|
7705
|
-
border-bottom-color: hsl(6, 64%, 51%);
|
|
7706
|
-
border-bottom-color: var(--color-red);
|
|
7707
|
-
color: hsl(6, 64%, 51%);
|
|
7708
|
-
color: var(--color-red);
|
|
7709
|
-
}
|
|
7710
|
-
|
|
7711
|
-
.bi34KW-Aa0I- {
|
|
7712
|
-
border-bottom-color: hsl(190, 80%, 42%);
|
|
7713
|
-
border-bottom-color: var(--color-teal);
|
|
7714
|
-
color: hsl(190, 80%, 42%);
|
|
7715
|
-
color: var(--color-teal);
|
|
7670
|
+
border-bottom: var(--border-base) solid var(--color-border--section);
|
|
7716
7671
|
}
|
|
7717
7672
|
|
|
7718
7673
|
.sFlecO8-wnY- {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.1",
|
|
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": "38ffa0cbeec13e12e9ec0fd0587c780d678ea54f"
|
|
491
491
|
}
|