@threekit-tools/treble 0.0.82 → 0.0.85
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/Treble/Treble.d.ts +9 -3
- package/dist/Treble/Treble.js +40 -11
- package/dist/Treble/index.d.ts +2 -2
- package/dist/Treble/index.js +2 -2
- package/dist/Treble/{Snapshots.d.ts → snapshots.d.ts} +4 -9
- package/dist/Treble/snapshots.js +247 -0
- package/dist/Treble/{Wishlist.d.ts → wishlist.d.ts} +2 -6
- package/dist/Treble/wishlist.js +135 -0
- package/dist/api/catalog.js +6 -6
- package/dist/api/configurations.js +3 -3
- package/dist/api/datatables.js +5 -5
- package/dist/api/orders.d.ts +5 -7
- package/dist/api/orders.js +12 -12
- package/dist/api/price.js +2 -2
- package/dist/api/products.js +2 -2
- package/dist/components/Accordion/index.js +1 -6
- package/dist/components/AttributeTitle/index.d.ts +0 -9
- package/dist/components/AttributeTitle/index.js +0 -9
- package/dist/components/AttributeValue/index.d.ts +0 -6
- package/dist/components/AttributeValue/index.js +2 -8
- package/dist/components/Button/index.d.ts +0 -27
- package/dist/components/Button/index.js +0 -27
- package/dist/components/Cards/index.d.ts +2 -55
- package/dist/components/Cards/index.js +3 -60
- package/dist/components/Drawer/index.js +0 -13
- package/dist/components/Dropdown/index.d.ts +2 -59
- package/dist/components/Dropdown/index.js +4 -69
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +5 -24
- package/dist/components/Modal/index.js +0 -13
- package/dist/components/Player/index.d.ts +1 -1
- package/dist/components/PortalToElement/index.js +0 -8
- package/dist/components/ProductDescription/index.d.ts +0 -6
- package/dist/components/ProductDescription/index.js +0 -6
- package/dist/components/ProductName/index.d.ts +0 -9
- package/dist/components/ProductName/index.js +0 -9
- package/dist/components/Share/index.d.ts +2 -12
- package/dist/components/Share/index.js +139 -21
- package/dist/components/Share/share.styles.d.ts +9 -0
- package/dist/components/Share/share.styles.js +23 -0
- package/dist/components/Snapshots/index.d.ts +0 -8
- package/dist/components/Snapshots/index.js +0 -8
- package/dist/components/Strips/index.d.ts +2 -55
- package/dist/components/Strips/index.js +3 -60
- package/dist/components/Swatch/index.d.ts +2 -64
- package/dist/components/Swatch/index.js +3 -69
- package/dist/components/Switch/index.d.ts +2 -34
- package/dist/components/Switch/index.js +2 -38
- package/dist/components/TextInput/index.d.ts +2 -1
- package/dist/components/TextInput/index.js +2 -3
- package/dist/components/Tiles/index.d.ts +2 -29
- package/dist/components/Tiles/index.js +3 -33
- package/dist/components/TilesGroup/index.d.ts +2 -26
- package/dist/components/TilesGroup/index.js +3 -30
- package/dist/components/TotalPrice/index.d.ts +0 -6
- package/dist/components/TotalPrice/index.js +0 -6
- package/dist/components/Upload/index.d.ts +2 -1
- package/dist/components/Upload/index.js +7 -8
- package/dist/components/UploadArea/index.d.ts +2 -1
- package/dist/components/UploadArea/index.js +6 -7
- package/dist/components/Wishlist/index.d.ts +1 -4
- package/dist/components/Wishlist/index.js +2 -5
- package/dist/components/Zoom/index.d.ts +1 -18
- package/dist/components/Zoom/index.js +0 -17
- package/dist/components/formComponents.d.ts +12 -0
- package/dist/components/formComponents.js +5 -7
- package/dist/components/message/index.d.ts +0 -9
- package/dist/components/message/index.js +0 -9
- package/dist/connection.js +2 -2
- package/dist/constants.d.ts +0 -49
- package/dist/constants.js +1 -59
- package/dist/hooks/useAttribute/index.js +6 -6
- package/dist/hooks/useConfigurationLoader/index.js +5 -5
- package/dist/hooks/useNestedConfigurator/index.js +2 -2
- package/dist/hooks/useShare/index.js +3 -3
- package/dist/hooks/useSingleAnimation/index.js +20 -25
- package/dist/http/datatables.js +0 -1
- package/dist/http/orders.d.ts +6 -8
- package/dist/icons/index.d.ts +0 -41
- package/dist/icons/index.js +0 -42
- package/dist/index.d.ts +42 -3
- package/dist/index.js +84 -30
- package/dist/store/attributes.d.ts +0 -12
- package/dist/store/attributes.js +2 -15
- package/dist/store/price.d.ts +0 -12
- package/dist/store/price.js +2 -16
- package/dist/store/product.d.ts +2 -17
- package/dist/store/product.js +26 -38
- package/dist/store/translations.d.ts +0 -12
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +0 -15
- package/dist/store/treble.js +31 -66
- package/dist/store/wishlist.d.ts +0 -12
- package/dist/store/wishlist.js +4 -17
- package/dist/types.d.ts +71 -58
- package/dist/types.js +54 -0
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +8 -16
- package/package.json +18 -4
- package/dist/Treble/Snapshots.js +0 -251
- package/dist/Treble/Wishlist.js +0 -136
package/dist/api/orders.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
interface ICreateOrder extends ICart {
|
|
5
|
-
name: string;
|
|
1
|
+
import { ICartItem, STATUSES, IOrderResponse } from '../http/orders';
|
|
2
|
+
export interface ICreateOrder {
|
|
3
|
+
name?: string;
|
|
6
4
|
metadata?: Record<string, string>;
|
|
7
5
|
platform?: Record<string, string>;
|
|
8
6
|
status?: STATUSES;
|
|
7
|
+
cart: Array<ICartItem>;
|
|
9
8
|
}
|
|
10
9
|
export declare const getOrder: (orderId: string) => Promise<IOrderResponse>;
|
|
11
10
|
export declare const fetchOrders: (metadataQuery: Record<string, string>) => Promise<IOrderResponse[]>;
|
|
12
11
|
export declare const createOrder: (order: ICreateOrder) => Promise<IOrderResponse>;
|
|
13
|
-
export declare const editOrder: (orderId: string, data:
|
|
14
|
-
export {};
|
|
12
|
+
export declare const editOrder: (orderId: string, data: Array<ICartItem>) => Promise<IOrderResponse>;
|
package/dist/api/orders.js
CHANGED
|
@@ -44,15 +44,15 @@ var http_1 = __importDefault(require("../http"));
|
|
|
44
44
|
var connection_1 = __importDefault(require("../connection"));
|
|
45
45
|
var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
|
-
return [2
|
|
47
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
48
|
var orders;
|
|
49
49
|
return __generator(this, function (_a) {
|
|
50
50
|
switch (_a.label) {
|
|
51
|
-
case 0: return [4
|
|
51
|
+
case 0: return [4, http_1.default.orders.getOrder(orderId)];
|
|
52
52
|
case 1:
|
|
53
53
|
orders = _a.sent();
|
|
54
54
|
resolve(orders.data);
|
|
55
|
-
return [2
|
|
55
|
+
return [2];
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}); })];
|
|
@@ -61,11 +61,11 @@ var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
61
61
|
exports.getOrder = getOrder;
|
|
62
62
|
var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
63
|
return __generator(this, function (_a) {
|
|
64
|
-
return [2
|
|
64
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var orders, output, _a, key_1, value_1;
|
|
66
66
|
return __generator(this, function (_b) {
|
|
67
67
|
switch (_b.label) {
|
|
68
|
-
case 0: return [4
|
|
68
|
+
case 0: return [4, http_1.default.orders.fetchOrders()];
|
|
69
69
|
case 1:
|
|
70
70
|
orders = _b.sent();
|
|
71
71
|
output = orders.data.orders;
|
|
@@ -74,7 +74,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
|
|
|
74
74
|
output = orders.data.orders.filter(function (order) { var _a; return ((_a = order.metadata) === null || _a === void 0 ? void 0 : _a[key_1]) === value_1; });
|
|
75
75
|
}
|
|
76
76
|
resolve(output);
|
|
77
|
-
return [2
|
|
77
|
+
return [2];
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}); })];
|
|
@@ -83,7 +83,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
|
|
|
83
83
|
exports.fetchOrders = fetchOrders;
|
|
84
84
|
var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
85
|
return __generator(this, function (_a) {
|
|
86
|
-
return [2
|
|
86
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
87
|
var orgId, name, cart, metadata, platform, status, data, createOrder;
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
89
|
switch (_a.label) {
|
|
@@ -98,11 +98,11 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
98
98
|
metadata: metadata || {},
|
|
99
99
|
status: status || 'List',
|
|
100
100
|
};
|
|
101
|
-
return [4
|
|
101
|
+
return [4, http_1.default.orders.createOrder(data)];
|
|
102
102
|
case 1:
|
|
103
103
|
createOrder = _a.sent();
|
|
104
104
|
resolve(createOrder.data);
|
|
105
|
-
return [2
|
|
105
|
+
return [2];
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}); })];
|
|
@@ -111,7 +111,7 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
111
111
|
exports.createOrder = createOrder;
|
|
112
112
|
var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
113
|
return __generator(this, function (_a) {
|
|
114
|
-
return [2
|
|
114
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
115
|
var cart;
|
|
116
116
|
return __generator(this, function (_a) {
|
|
117
117
|
switch (_a.label) {
|
|
@@ -120,11 +120,11 @@ var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void
|
|
|
120
120
|
throw new Error('Missing Order ID');
|
|
121
121
|
if (!data)
|
|
122
122
|
throw new Error('Missing New Cart data for Cart Order update.');
|
|
123
|
-
return [4
|
|
123
|
+
return [4, http_1.default.orders.editOrderCart(orderId, data)];
|
|
124
124
|
case 1:
|
|
125
125
|
cart = _a.sent();
|
|
126
126
|
resolve(cart.data);
|
|
127
|
-
return [2
|
|
127
|
+
return [2];
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}); })];
|
package/dist/api/price.js
CHANGED
|
@@ -45,10 +45,10 @@ var getPricebooksList = function () { return __awaiter(void 0, void 0, void 0, f
|
|
|
45
45
|
var response;
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
47
|
switch (_a.label) {
|
|
48
|
-
case 0: return [4
|
|
48
|
+
case 0: return [4, http_1.default.pricebook.getList()];
|
|
49
49
|
case 1:
|
|
50
50
|
response = _a.sent();
|
|
51
|
-
return [2
|
|
51
|
+
return [2, response.data.pricebooks];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
}); };
|
package/dist/api/products.js
CHANGED
|
@@ -46,7 +46,7 @@ var fetchTranslations = function () {
|
|
|
46
46
|
var translations, csvData, languages, translationMap;
|
|
47
47
|
return __generator(this, function (_a) {
|
|
48
48
|
switch (_a.label) {
|
|
49
|
-
case 0: return [4
|
|
49
|
+
case 0: return [4, http_1.default.products.getTranslations()];
|
|
50
50
|
case 1:
|
|
51
51
|
translations = _a.sent();
|
|
52
52
|
csvData = translations.data
|
|
@@ -68,7 +68,7 @@ var fetchTranslations = function () {
|
|
|
68
68
|
return output;
|
|
69
69
|
}, {});
|
|
70
70
|
resolve(translationMap);
|
|
71
|
-
return [2
|
|
71
|
+
return [2];
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}); });
|
|
@@ -37,12 +37,7 @@ var AccordionItem = function (props) {
|
|
|
37
37
|
react_1.default.createElement("div", null, label),
|
|
38
38
|
react_1.default.createElement("div", null),
|
|
39
39
|
react_1.default.createElement("div", null,
|
|
40
|
-
react_1.default.createElement(CaretDown_1.default
|
|
41
|
-
// style={{
|
|
42
|
-
// transition: `all 0.3s`,
|
|
43
|
-
// transform: selected ? 'rotate(180deg)' : 'rotate(0)',
|
|
44
|
-
// }}
|
|
45
|
-
, null))),
|
|
40
|
+
react_1.default.createElement(CaretDown_1.default, null))),
|
|
46
41
|
react_1.default.createElement("div", null,
|
|
47
42
|
react_1.default.createElement("div", null, children))));
|
|
48
43
|
};
|
|
@@ -8,17 +8,8 @@ interface IAttributeTitle {
|
|
|
8
8
|
export declare const AttributeTitle: {
|
|
9
9
|
(props: IAttributeTitle): JSX.Element | null;
|
|
10
10
|
propTypes: {
|
|
11
|
-
/**
|
|
12
|
-
* The attribute's title/label displayed to the user
|
|
13
|
-
*/
|
|
14
11
|
attribute: PropTypes.Requireable<string>;
|
|
15
|
-
/**
|
|
16
|
-
* An override value to display instead of the attribute title.
|
|
17
|
-
*/
|
|
18
12
|
title: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
21
|
-
*/
|
|
22
13
|
className: PropTypes.Requireable<string>;
|
|
23
14
|
};
|
|
24
15
|
defaultProps: {
|
|
@@ -20,17 +20,8 @@ var AttributeTitle = function (props) {
|
|
|
20
20
|
};
|
|
21
21
|
exports.AttributeTitle = AttributeTitle;
|
|
22
22
|
exports.AttributeTitle.propTypes = {
|
|
23
|
-
/**
|
|
24
|
-
* The attribute's title/label displayed to the user
|
|
25
|
-
*/
|
|
26
23
|
attribute: prop_types_1.default.string,
|
|
27
|
-
/**
|
|
28
|
-
* An override value to display instead of the attribute title.
|
|
29
|
-
*/
|
|
30
24
|
title: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
33
|
-
*/
|
|
34
25
|
className: prop_types_1.default.string,
|
|
35
26
|
};
|
|
36
27
|
exports.AttributeTitle.defaultProps = {
|
|
@@ -7,13 +7,7 @@ interface IAttributeValue {
|
|
|
7
7
|
export declare const AttributeValue: {
|
|
8
8
|
(props: IAttributeValue): JSX.Element | null;
|
|
9
9
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* The attribute's title/label displayed to the user
|
|
12
|
-
*/
|
|
13
10
|
attribute: PropTypes.Requireable<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
16
|
-
*/
|
|
17
11
|
className: PropTypes.Requireable<string>;
|
|
18
12
|
};
|
|
19
13
|
defaultProps: {
|
|
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var attributeValue_styles_1 = require("./attributeValue.styles");
|
|
10
10
|
var useAttribute_1 = __importDefault(require("../../hooks/useAttribute"));
|
|
11
|
-
var
|
|
11
|
+
var types_1 = require("../../types");
|
|
12
12
|
var utils_1 = require("../../utils");
|
|
13
13
|
var AttributeValue = function (props) {
|
|
14
14
|
var _a, _b;
|
|
@@ -17,7 +17,7 @@ var AttributeValue = function (props) {
|
|
|
17
17
|
if (!attributeData)
|
|
18
18
|
return null;
|
|
19
19
|
var value;
|
|
20
|
-
if (attributeData.type ===
|
|
20
|
+
if (attributeData.type === types_1.ATTRIBUTE_TYPES.ASSET) {
|
|
21
21
|
var assetAttribute_1 = attributeData;
|
|
22
22
|
if (!((_a = assetAttribute_1.value) === null || _a === void 0 ? void 0 : _a.assetId))
|
|
23
23
|
return null;
|
|
@@ -32,13 +32,7 @@ var AttributeValue = function (props) {
|
|
|
32
32
|
};
|
|
33
33
|
exports.AttributeValue = AttributeValue;
|
|
34
34
|
exports.AttributeValue.propTypes = {
|
|
35
|
-
/**
|
|
36
|
-
* The attribute's title/label displayed to the user
|
|
37
|
-
*/
|
|
38
35
|
attribute: prop_types_1.default.string,
|
|
39
|
-
/**
|
|
40
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
41
|
-
*/
|
|
42
36
|
className: prop_types_1.default.string,
|
|
43
37
|
};
|
|
44
38
|
exports.AttributeValue.defaultProps = {
|
|
@@ -25,39 +25,12 @@ export declare const SHAPES: {
|
|
|
25
25
|
export declare const Button: {
|
|
26
26
|
(props: IButton): JSX.Element | null;
|
|
27
27
|
propTypes: {
|
|
28
|
-
/**
|
|
29
|
-
* Used to add a title to the input
|
|
30
|
-
*/
|
|
31
28
|
title: PropTypes.Requireable<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Threekit Icon to use as the prefix to the button title
|
|
34
|
-
*/
|
|
35
29
|
icon: PropTypes.Requireable<string>;
|
|
36
|
-
/**
|
|
37
|
-
* The presentational type of the input component. Options
|
|
38
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
39
|
-
*/
|
|
40
30
|
type: PropTypes.Requireable<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Used to set the shape of the Button component. Options
|
|
43
|
-
* include: `square`, `round`
|
|
44
|
-
*/
|
|
45
31
|
shape: PropTypes.Requireable<string>;
|
|
46
|
-
/**
|
|
47
|
-
* NOTE: Input wide hide disabled will be deprecated in favour of option
|
|
48
|
-
* specific control of both 'disabled' and 'visible'.
|
|
49
|
-
*
|
|
50
|
-
* Used to hide the options that have the 'disabled' equal to true.
|
|
51
|
-
*/
|
|
52
32
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
-
/**
|
|
54
|
-
* Allows the Button's width to be set to 100%.
|
|
55
|
-
*/
|
|
56
33
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* Used to add a custom class name to each of the components html elements
|
|
60
|
-
*/
|
|
61
34
|
className: PropTypes.Requireable<string>;
|
|
62
35
|
};
|
|
63
36
|
defaultProps: {
|
|
@@ -39,39 +39,12 @@ var Button = function (props) {
|
|
|
39
39
|
};
|
|
40
40
|
exports.Button = Button;
|
|
41
41
|
exports.Button.propTypes = {
|
|
42
|
-
/**
|
|
43
|
-
* Used to add a title to the input
|
|
44
|
-
*/
|
|
45
42
|
title: prop_types_1.default.string,
|
|
46
|
-
/**
|
|
47
|
-
* Threekit Icon to use as the prefix to the button title
|
|
48
|
-
*/
|
|
49
43
|
icon: prop_types_1.default.string,
|
|
50
|
-
/**
|
|
51
|
-
* The presentational type of the input component. Options
|
|
52
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
53
|
-
*/
|
|
54
44
|
type: prop_types_1.default.string,
|
|
55
|
-
/**
|
|
56
|
-
* Used to set the shape of the Button component. Options
|
|
57
|
-
* include: `square`, `round`
|
|
58
|
-
*/
|
|
59
45
|
shape: prop_types_1.default.string,
|
|
60
|
-
/**
|
|
61
|
-
* NOTE: Input wide hide disabled will be deprecated in favour of option
|
|
62
|
-
* specific control of both 'disabled' and 'visible'.
|
|
63
|
-
*
|
|
64
|
-
* Used to hide the options that have the 'disabled' equal to true.
|
|
65
|
-
*/
|
|
66
46
|
onClick: prop_types_1.default.func,
|
|
67
|
-
/**
|
|
68
|
-
* Allows the Button's width to be set to 100%.
|
|
69
|
-
*/
|
|
70
47
|
fullWidth: prop_types_1.default.bool,
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* Used to add a custom class name to each of the components html elements
|
|
74
|
-
*/
|
|
75
48
|
className: prop_types_1.default.string,
|
|
76
49
|
};
|
|
77
50
|
exports.Button.defaultProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
4
|
import { IFormComponentProps, IOption } from '../containers/formInputContainer';
|
|
4
5
|
export interface ICards extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -9,33 +10,11 @@ export interface ICards extends IFormComponentProps<IOption> {
|
|
|
9
10
|
export declare const Cards: {
|
|
10
11
|
(props: ICards): JSX.Element;
|
|
11
12
|
propTypes: {
|
|
12
|
-
/**
|
|
13
|
-
* Is the attribute name on the initialized asset that we are
|
|
14
|
-
* using this component for. If the attribute prop is used,
|
|
15
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
16
|
-
*/
|
|
17
13
|
attribute: PropTypes.Requireable<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Used to add a title to the input
|
|
20
|
-
*/
|
|
21
14
|
title: PropTypes.Requireable<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Used to provide a custom description for the input component
|
|
24
|
-
*/
|
|
25
15
|
description: PropTypes.Requireable<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Selected value from the option set. Should match the 'value' property
|
|
28
|
-
* of one of the items in the options array.
|
|
29
|
-
*/
|
|
30
16
|
value: PropTypes.Requireable<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Handles the user seletion by passing the value of the selected
|
|
33
|
-
* option as the argument into the onClick callback.
|
|
34
|
-
*/
|
|
35
17
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
-
/**
|
|
37
|
-
* The options set to be displayed for the user
|
|
38
|
-
*/
|
|
39
18
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
40
19
|
name: PropTypes.Requireable<string>;
|
|
41
20
|
description: PropTypes.Requireable<string>;
|
|
@@ -45,44 +24,12 @@ export declare const Cards: {
|
|
|
45
24
|
color: PropTypes.Requireable<string>;
|
|
46
25
|
disabled: PropTypes.Requireable<boolean>;
|
|
47
26
|
}> | null | undefined)[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Used to add a custom class name to each of the components html elements
|
|
50
|
-
*/
|
|
51
27
|
className: PropTypes.Requireable<string>;
|
|
52
|
-
/**
|
|
53
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
54
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
55
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
56
|
-
*/
|
|
57
28
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
58
|
-
/**
|
|
59
|
-
* By default the description is soruced from the `_description` metadata
|
|
60
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
61
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
62
|
-
* prop.
|
|
63
|
-
*/
|
|
64
29
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
65
|
-
/**
|
|
66
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
67
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
68
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
69
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
70
|
-
*/
|
|
71
30
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
72
|
-
/**
|
|
73
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
74
|
-
* for the options.
|
|
75
|
-
*/
|
|
76
31
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
77
|
-
/**
|
|
78
|
-
* A boolean to set whether or all the Cards should display the description
|
|
79
|
-
* for the options.
|
|
80
|
-
*/
|
|
81
32
|
showDescription: PropTypes.Requireable<boolean>;
|
|
82
|
-
/**
|
|
83
|
-
* A boolean to set whether or all the Cards should display the price
|
|
84
|
-
* for the options/
|
|
85
|
-
*/
|
|
86
33
|
showPrice: PropTypes.Requireable<boolean>;
|
|
87
34
|
};
|
|
88
35
|
defaultProps: {
|
|
@@ -101,7 +48,7 @@ export declare const Cards: {
|
|
|
101
48
|
onClick: undefined;
|
|
102
49
|
};
|
|
103
50
|
componentName: string;
|
|
104
|
-
compatibleAttributes: Set<
|
|
51
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
105
52
|
};
|
|
106
53
|
declare const _default: (props: ICards) => JSX.Element | null;
|
|
107
54
|
export default _default;
|
|
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
|
|
|
11
11
|
var shared_styles_1 = require("../shared.styles");
|
|
12
12
|
var cards_styles_1 = require("./cards.styles");
|
|
13
13
|
var utils_1 = require("../../utils");
|
|
14
|
-
var
|
|
14
|
+
var types_1 = require("../../types");
|
|
15
15
|
var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
|
|
16
16
|
var Thumbnail = function (props) {
|
|
17
17
|
var imageUrl = props.imageUrl, color = props.color, name = props.name, className = props.className;
|
|
@@ -62,33 +62,11 @@ var Cards = function (props) {
|
|
|
62
62
|
};
|
|
63
63
|
exports.Cards = Cards;
|
|
64
64
|
exports.Cards.propTypes = {
|
|
65
|
-
/**
|
|
66
|
-
* Is the attribute name on the initialized asset that we are
|
|
67
|
-
* using this component for. If the attribute prop is used,
|
|
68
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
69
|
-
*/
|
|
70
65
|
attribute: prop_types_1.default.string,
|
|
71
|
-
/**
|
|
72
|
-
* Used to add a title to the input
|
|
73
|
-
*/
|
|
74
66
|
title: prop_types_1.default.string,
|
|
75
|
-
/**
|
|
76
|
-
* Used to provide a custom description for the input component
|
|
77
|
-
*/
|
|
78
67
|
description: prop_types_1.default.string,
|
|
79
|
-
/**
|
|
80
|
-
* Selected value from the option set. Should match the 'value' property
|
|
81
|
-
* of one of the items in the options array.
|
|
82
|
-
*/
|
|
83
68
|
value: prop_types_1.default.string,
|
|
84
|
-
/**
|
|
85
|
-
* Handles the user seletion by passing the value of the selected
|
|
86
|
-
* option as the argument into the onClick callback.
|
|
87
|
-
*/
|
|
88
69
|
onClick: prop_types_1.default.func,
|
|
89
|
-
/**
|
|
90
|
-
* The options set to be displayed for the user
|
|
91
|
-
*/
|
|
92
70
|
options: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
93
71
|
name: prop_types_1.default.string,
|
|
94
72
|
description: prop_types_1.default.string,
|
|
@@ -98,59 +76,24 @@ exports.Cards.propTypes = {
|
|
|
98
76
|
color: prop_types_1.default.string,
|
|
99
77
|
disabled: prop_types_1.default.bool,
|
|
100
78
|
})),
|
|
101
|
-
/**
|
|
102
|
-
* Used to add a custom class name to each of the components html elements
|
|
103
|
-
*/
|
|
104
79
|
className: prop_types_1.default.string,
|
|
105
|
-
/**
|
|
106
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
107
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
108
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
109
|
-
*/
|
|
110
80
|
metadataKeyThumbnail: prop_types_1.default.string,
|
|
111
|
-
/**
|
|
112
|
-
* By default the description is soruced from the `_description` metadata
|
|
113
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
114
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
115
|
-
* prop.
|
|
116
|
-
*/
|
|
117
81
|
metadataKeyDescription: prop_types_1.default.string,
|
|
118
|
-
/**
|
|
119
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
120
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
121
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
122
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
123
|
-
*/
|
|
124
82
|
metadataKeyPrice: prop_types_1.default.string,
|
|
125
|
-
/**
|
|
126
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
127
|
-
* for the options.
|
|
128
|
-
*/
|
|
129
83
|
showThumbnail: prop_types_1.default.bool,
|
|
130
|
-
/**
|
|
131
|
-
* A boolean to set whether or all the Cards should display the description
|
|
132
|
-
* for the options.
|
|
133
|
-
*/
|
|
134
84
|
showDescription: prop_types_1.default.bool,
|
|
135
|
-
/**
|
|
136
|
-
* A boolean to set whether or all the Cards should display the price
|
|
137
|
-
* for the options/
|
|
138
|
-
*/
|
|
139
85
|
showPrice: prop_types_1.default.bool,
|
|
140
86
|
};
|
|
141
87
|
exports.Cards.defaultProps = {
|
|
142
88
|
description: undefined,
|
|
143
89
|
className: undefined,
|
|
144
|
-
// Default use
|
|
145
90
|
attribute: undefined,
|
|
146
|
-
// Default user overrides
|
|
147
91
|
metadataKeyThumbnail: undefined,
|
|
148
92
|
metadataKeyDescription: undefined,
|
|
149
93
|
metadataKeyPrice: undefined,
|
|
150
94
|
showThumbnail: true,
|
|
151
95
|
showPrice: true,
|
|
152
96
|
showDescription: true,
|
|
153
|
-
// Custom use
|
|
154
97
|
title: undefined,
|
|
155
98
|
value: undefined,
|
|
156
99
|
options: undefined,
|
|
@@ -158,7 +101,7 @@ exports.Cards.defaultProps = {
|
|
|
158
101
|
};
|
|
159
102
|
exports.Cards.componentName = 'cards';
|
|
160
103
|
exports.Cards.compatibleAttributes = new Set([
|
|
161
|
-
|
|
162
|
-
|
|
104
|
+
types_1.ATTRIBUTE_TYPES.ASSET,
|
|
105
|
+
types_1.ATTRIBUTE_TYPES.STRING,
|
|
163
106
|
]);
|
|
164
107
|
exports.default = (0, formInputContainer_1.default)(exports.Cards);
|
|
@@ -72,22 +72,9 @@ var Drawer = function (props) {
|
|
|
72
72
|
};
|
|
73
73
|
exports.Drawer = Drawer;
|
|
74
74
|
exports.Drawer.propTypes = {
|
|
75
|
-
/**
|
|
76
|
-
* The title to be shown in the Drawer header
|
|
77
|
-
*/
|
|
78
75
|
title: prop_types_1.default.string,
|
|
79
|
-
/**
|
|
80
|
-
* Callback function to close the Drawer. Can be used with custom UI
|
|
81
|
-
* components in the Drawer
|
|
82
|
-
*/
|
|
83
76
|
handleClose: prop_types_1.default.func,
|
|
84
|
-
/**
|
|
85
|
-
* Whether or not to render the default Drawer header
|
|
86
|
-
*/
|
|
87
77
|
showHeader: prop_types_1.default.bool,
|
|
88
|
-
/**
|
|
89
|
-
* Used to add a custom class name to each of the components html elements
|
|
90
|
-
*/
|
|
91
78
|
className: prop_types_1.default.string,
|
|
92
79
|
};
|
|
93
80
|
exports.Drawer.defaultProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
4
|
import { IFormComponentProps, IOption } from '../containers/formInputContainer';
|
|
4
5
|
export interface IDropdown extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -10,33 +11,11 @@ export interface IDropdown extends IFormComponentProps<IOption> {
|
|
|
10
11
|
export declare const Dropdown: {
|
|
11
12
|
(props: IDropdown): JSX.Element;
|
|
12
13
|
propTypes: {
|
|
13
|
-
/**
|
|
14
|
-
* Is the attribute name on the initialized asset that we are
|
|
15
|
-
* using this component for. If the attribute prop is used,
|
|
16
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
17
|
-
*/
|
|
18
14
|
attribute: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Used to add a title to the input
|
|
21
|
-
*/
|
|
22
15
|
title: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to provide a custom description for the input component
|
|
25
|
-
*/
|
|
26
16
|
description: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Selected value from the option set. Should match the 'value' property
|
|
29
|
-
* of one of the items in the options array.
|
|
30
|
-
*/
|
|
31
17
|
value: PropTypes.Requireable<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Handles the user seletion by passing the value of the selected
|
|
34
|
-
* option as the argument into the onClick callback.
|
|
35
|
-
*/
|
|
36
18
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
-
/**
|
|
38
|
-
* The options set to be displayed for the user
|
|
39
|
-
*/
|
|
40
19
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
41
20
|
name: PropTypes.Requireable<string>;
|
|
42
21
|
description: PropTypes.Requireable<string>;
|
|
@@ -46,49 +25,13 @@ export declare const Dropdown: {
|
|
|
46
25
|
color: PropTypes.Requireable<string>;
|
|
47
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
48
27
|
}> | null | undefined)[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Used to add a custom class name to each of the components html elements
|
|
51
|
-
*/
|
|
52
28
|
className: PropTypes.Requireable<string>;
|
|
53
|
-
/**
|
|
54
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
55
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
56
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
57
|
-
*/
|
|
58
29
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
59
|
-
/**
|
|
60
|
-
* By default the description is soruced from the `_description` metadata
|
|
61
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
62
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
63
|
-
* prop.
|
|
64
|
-
*/
|
|
65
30
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
66
|
-
/**
|
|
67
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
68
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
69
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
70
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
71
|
-
*/
|
|
72
31
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
73
|
-
/**
|
|
74
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
75
|
-
* for the options.
|
|
76
|
-
*/
|
|
77
32
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* A boolean to set whether or all the Cards should display the description
|
|
80
|
-
* for the options.
|
|
81
|
-
*/
|
|
82
33
|
showDescription: PropTypes.Requireable<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* A boolean to set whether or all the Cards should display the price
|
|
85
|
-
* for the options.
|
|
86
|
-
*/
|
|
87
34
|
showPrice: PropTypes.Requireable<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* The maximum height the dropdown area should extend to before scrolling
|
|
90
|
-
* is introduced
|
|
91
|
-
*/
|
|
92
35
|
dropdownMaxHeight: PropTypes.Requireable<string>;
|
|
93
36
|
};
|
|
94
37
|
defaultProps: {
|
|
@@ -107,7 +50,7 @@ export declare const Dropdown: {
|
|
|
107
50
|
dropdownMaxHeight: string;
|
|
108
51
|
};
|
|
109
52
|
componentName: string;
|
|
110
|
-
compatibleAttributes: Set<
|
|
53
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
111
54
|
};
|
|
112
55
|
declare const _default: (props: IDropdown) => JSX.Element | null;
|
|
113
56
|
export default _default;
|