@threekit-tools/treble 0.0.80 → 0.0.83
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/Snapshots.d.ts +2 -2
- package/dist/Treble/Snapshots.js +31 -32
- package/dist/Treble/Treble.d.ts +2 -2
- package/dist/Treble/Treble.js +4 -5
- package/dist/Treble/Wishlist.d.ts +2 -2
- package/dist/Treble/Wishlist.js +19 -21
- package/dist/Treble/index.js +5 -1
- package/dist/api/catalog.js +6 -6
- package/dist/api/configurations.js +3 -3
- package/dist/api/datatables.js +5 -5
- package/dist/api/index.js +5 -1
- 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 +6 -7
- 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 +0 -6
- package/dist/components/Button/index.d.ts +0 -27
- package/dist/components/Button/index.js +0 -27
- package/dist/components/Cards/index.d.ts +0 -54
- package/dist/components/Cards/index.js +0 -57
- package/dist/components/Drawer/index.js +7 -16
- package/dist/components/Dropdown/index.d.ts +0 -58
- package/dist/components/Dropdown/index.js +8 -69
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +5 -22
- package/dist/components/Modal/index.js +2 -15
- package/dist/components/Player/index.d.ts +0 -1
- package/dist/components/Player/index.js +4 -38
- package/dist/components/PortalToArOverlay/index.js +5 -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 +0 -12
- package/dist/components/Share/index.js +2 -14
- package/dist/components/Snapshots/index.d.ts +0 -8
- package/dist/components/Snapshots/index.js +2 -10
- package/dist/components/Strips/index.d.ts +0 -54
- package/dist/components/Strips/index.js +0 -57
- package/dist/components/Swatch/index.d.ts +0 -63
- package/dist/components/Swatch/index.js +0 -66
- package/dist/components/Switch/index.d.ts +0 -33
- package/dist/components/Switch/index.js +0 -36
- package/dist/components/Tabs/index.js +5 -1
- package/dist/components/TextInput/index.js +0 -1
- package/dist/components/ThreekitProvider/index.js +7 -2
- package/dist/components/Tiles/index.d.ts +0 -28
- package/dist/components/Tiles/index.js +0 -30
- package/dist/components/TilesGroup/index.d.ts +0 -25
- package/dist/components/TilesGroup/index.js +0 -27
- package/dist/components/TotalPrice/index.d.ts +0 -6
- package/dist/components/TotalPrice/index.js +0 -6
- package/dist/components/TrebleApp/index.js +5 -1
- package/dist/components/Upload/index.js +19 -15
- package/dist/components/UploadArea/index.js +16 -13
- package/dist/components/Wishlist/index.d.ts +0 -3
- package/dist/components/Wishlist/index.js +12 -10
- package/dist/components/Zoom/index.d.ts +0 -17
- package/dist/components/Zoom/index.js +5 -21
- package/dist/components/formComponents.js +5 -3
- package/dist/components/message/index.d.ts +0 -9
- package/dist/components/message/index.js +4 -31
- package/dist/connection.js +2 -2
- package/dist/constants.d.ts +0 -27
- package/dist/constants.js +0 -36
- package/dist/hooks/useAttribute/index.d.ts +1 -1
- package/dist/hooks/useAttribute/index.js +6 -6
- package/dist/hooks/useConfigurationLoader/index.js +5 -5
- package/dist/hooks/useLoadingProgress/index.d.ts +2 -0
- package/dist/hooks/useLoadingProgress/index.js +9 -0
- package/dist/hooks/useNestedConfigurator/index.js +2 -2
- package/dist/hooks/usePlayer/index.d.ts +3 -0
- package/dist/hooks/usePlayer/index.js +38 -0
- package/dist/hooks/useShare/index.js +3 -3
- package/dist/hooks/useSingleAnimation/index.js +5 -11
- package/dist/hooks/useSnapshot/index.d.ts +1 -1
- package/dist/hooks/useWishlist/index.d.ts +1 -1
- package/dist/http/datatables.js +0 -1
- package/dist/http/index.js +5 -1
- package/dist/icons/Spinner.js +5 -1
- package/dist/icons/index.d.ts +0 -41
- package/dist/icons/index.js +0 -42
- package/dist/index.d.ts +44 -3
- package/dist/index.js +88 -26
- package/dist/store/attributes.d.ts +0 -12
- package/dist/store/attributes.js +2 -15
- package/dist/store/index.d.ts +1 -1
- package/dist/store/price.d.ts +0 -12
- package/dist/store/price.js +2 -16
- package/dist/store/product.d.ts +6 -21
- package/dist/store/product.js +23 -37
- package/dist/store/translations.d.ts +1 -13
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +4 -16
- package/dist/store/treble.js +47 -66
- package/dist/store/wishlist.d.ts +1 -13
- package/dist/store/wishlist.js +4 -17
- package/dist/types.d.ts +47 -41
- package/dist/utils.d.ts +8 -8
- package/dist/utils.js +3 -12
- package/package.json +16 -4
|
@@ -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: {
|
|
@@ -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 = {
|
|
@@ -9,33 +9,11 @@ export interface ICards extends IFormComponentProps<IOption> {
|
|
|
9
9
|
export declare const Cards: {
|
|
10
10
|
(props: ICards): JSX.Element;
|
|
11
11
|
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
12
|
attribute: PropTypes.Requireable<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Used to add a title to the input
|
|
20
|
-
*/
|
|
21
13
|
title: PropTypes.Requireable<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Used to provide a custom description for the input component
|
|
24
|
-
*/
|
|
25
14
|
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
15
|
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
16
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
-
/**
|
|
37
|
-
* The options set to be displayed for the user
|
|
38
|
-
*/
|
|
39
17
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
40
18
|
name: PropTypes.Requireable<string>;
|
|
41
19
|
description: PropTypes.Requireable<string>;
|
|
@@ -45,44 +23,12 @@ export declare const Cards: {
|
|
|
45
23
|
color: PropTypes.Requireable<string>;
|
|
46
24
|
disabled: PropTypes.Requireable<boolean>;
|
|
47
25
|
}> | null | undefined)[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Used to add a custom class name to each of the components html elements
|
|
50
|
-
*/
|
|
51
26
|
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
27
|
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
28
|
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
29
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
72
|
-
/**
|
|
73
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
74
|
-
* for the options.
|
|
75
|
-
*/
|
|
76
30
|
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
31
|
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
32
|
showPrice: PropTypes.Requireable<boolean>;
|
|
87
33
|
};
|
|
88
34
|
defaultProps: {
|
|
@@ -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,
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -39,7 +43,7 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
39
43
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
40
44
|
var drawer_styles_1 = require("./drawer.styles");
|
|
41
45
|
var utils_1 = require("../../utils");
|
|
42
|
-
var
|
|
46
|
+
var Remove_1 = __importDefault(require("../../icons/Remove"));
|
|
43
47
|
var TRANSITION_DURATION = 0.2;
|
|
44
48
|
var Drawer = function (props) {
|
|
45
49
|
var title = props.title, children = props.children, handleClose = props.handleClose, showHeader = props.showHeader, className = props.className;
|
|
@@ -63,27 +67,14 @@ var Drawer = function (props) {
|
|
|
63
67
|
showHeader ? (react_1.default.createElement(drawer_styles_1.Header, { className: "".concat(cls, " drawer-header") },
|
|
64
68
|
react_1.default.createElement("div", { className: "".concat(cls, " drawer-title") }, title),
|
|
65
69
|
react_1.default.createElement("div", { onClick: handleClickClose },
|
|
66
|
-
react_1.default.createElement(
|
|
70
|
+
react_1.default.createElement(Remove_1.default, null)))) : null,
|
|
67
71
|
react_1.default.createElement(drawer_styles_1.Content, { className: "".concat(cls, " drawer-content") }, children))));
|
|
68
72
|
};
|
|
69
73
|
exports.Drawer = Drawer;
|
|
70
74
|
exports.Drawer.propTypes = {
|
|
71
|
-
/**
|
|
72
|
-
* The title to be shown in the Drawer header
|
|
73
|
-
*/
|
|
74
75
|
title: prop_types_1.default.string,
|
|
75
|
-
/**
|
|
76
|
-
* Callback function to close the Drawer. Can be used with custom UI
|
|
77
|
-
* components in the Drawer
|
|
78
|
-
*/
|
|
79
76
|
handleClose: prop_types_1.default.func,
|
|
80
|
-
/**
|
|
81
|
-
* Whether or not to render the default Drawer header
|
|
82
|
-
*/
|
|
83
77
|
showHeader: prop_types_1.default.bool,
|
|
84
|
-
/**
|
|
85
|
-
* Used to add a custom class name to each of the components html elements
|
|
86
|
-
*/
|
|
87
78
|
className: prop_types_1.default.string,
|
|
88
79
|
};
|
|
89
80
|
exports.Drawer.defaultProps = {
|
|
@@ -10,33 +10,11 @@ export interface IDropdown extends IFormComponentProps<IOption> {
|
|
|
10
10
|
export declare const Dropdown: {
|
|
11
11
|
(props: IDropdown): JSX.Element;
|
|
12
12
|
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
13
|
attribute: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Used to add a title to the input
|
|
21
|
-
*/
|
|
22
14
|
title: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to provide a custom description for the input component
|
|
25
|
-
*/
|
|
26
15
|
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
16
|
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
17
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
-
/**
|
|
38
|
-
* The options set to be displayed for the user
|
|
39
|
-
*/
|
|
40
18
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
41
19
|
name: PropTypes.Requireable<string>;
|
|
42
20
|
description: PropTypes.Requireable<string>;
|
|
@@ -46,49 +24,13 @@ export declare const Dropdown: {
|
|
|
46
24
|
color: PropTypes.Requireable<string>;
|
|
47
25
|
disabled: PropTypes.Requireable<boolean>;
|
|
48
26
|
}> | null | undefined)[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Used to add a custom class name to each of the components html elements
|
|
51
|
-
*/
|
|
52
27
|
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
28
|
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
29
|
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
30
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
73
|
-
/**
|
|
74
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
75
|
-
* for the options.
|
|
76
|
-
*/
|
|
77
31
|
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
32
|
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
33
|
showPrice: PropTypes.Requireable<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* The maximum height the dropdown area should extend to before scrolling
|
|
90
|
-
* is introduced
|
|
91
|
-
*/
|
|
92
34
|
dropdownMaxHeight: PropTypes.Requireable<string>;
|
|
93
35
|
};
|
|
94
36
|
defaultProps: {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -28,7 +32,7 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
28
32
|
var FormComponentTitle_1 = __importDefault(require("../FormComponentTitle"));
|
|
29
33
|
var FormComponentDescription_1 = __importDefault(require("../FormComponentDescription"));
|
|
30
34
|
var dropdown_styles_1 = require("./dropdown.styles");
|
|
31
|
-
var
|
|
35
|
+
var CaretDown_1 = __importDefault(require("../../icons/CaretDown"));
|
|
32
36
|
var utils_1 = require("../../utils");
|
|
33
37
|
var constants_1 = require("../../constants");
|
|
34
38
|
var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
|
|
@@ -78,11 +82,7 @@ var Dropdown = function (props) {
|
|
|
78
82
|
return (react_1.default.createElement("div", { className: cls },
|
|
79
83
|
react_1.default.createElement(FormComponentTitle_1.default, { title: title, className: cls }),
|
|
80
84
|
react_1.default.createElement(FormComponentDescription_1.default, { description: description, className: cls }),
|
|
81
|
-
react_1.default.createElement(dropdown_styles_1.DropdownWrapper
|
|
82
|
-
// active={!hide}
|
|
83
|
-
, {
|
|
84
|
-
// active={!hide}
|
|
85
|
-
ref: ref, className: "".concat(cls, " dropdown") },
|
|
85
|
+
react_1.default.createElement(dropdown_styles_1.DropdownWrapper, { ref: ref, className: "".concat(cls, " dropdown") },
|
|
86
86
|
react_1.default.createElement(dropdown_styles_1.DropdownMain, { active: !hide, className: "".concat(cls, " selected"), onClick: function () { return setHide(!hide); }, hasPlaceholder: !value },
|
|
87
87
|
react_1.default.createElement(Thumbnail, { imageUrl: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.imageUrl, color: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.color, name: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.name, className: "".concat(cls, " selected") }),
|
|
88
88
|
react_1.default.createElement("div", null,
|
|
@@ -90,7 +90,7 @@ var Dropdown = function (props) {
|
|
|
90
90
|
react_1.default.createElement(Description, { description: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.description, className: "".concat(cls, " selected") })),
|
|
91
91
|
react_1.default.createElement(Price, { price: selectedOpt === null || selectedOpt === void 0 ? void 0 : selectedOpt.price, className: cls }),
|
|
92
92
|
react_1.default.createElement(dropdown_styles_1.IconWrapper, null,
|
|
93
|
-
react_1.default.createElement(
|
|
93
|
+
react_1.default.createElement(CaretDown_1.default, null))),
|
|
94
94
|
react_1.default.createElement(dropdown_styles_1.DropdownOptions, { hide: hide, dropdownMaxHeight: dropdownMaxHeight },
|
|
95
95
|
react_1.default.createElement("div", null, options === null || options === void 0 ? void 0 : options.map(function (el, i) {
|
|
96
96
|
var _a = Object.assign({}, el, {
|
|
@@ -114,33 +114,11 @@ var Dropdown = function (props) {
|
|
|
114
114
|
};
|
|
115
115
|
exports.Dropdown = Dropdown;
|
|
116
116
|
exports.Dropdown.propTypes = {
|
|
117
|
-
/**
|
|
118
|
-
* Is the attribute name on the initialized asset that we are
|
|
119
|
-
* using this component for. If the attribute prop is used,
|
|
120
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
121
|
-
*/
|
|
122
117
|
attribute: prop_types_1.default.string,
|
|
123
|
-
/**
|
|
124
|
-
* Used to add a title to the input
|
|
125
|
-
*/
|
|
126
118
|
title: prop_types_1.default.string,
|
|
127
|
-
/**
|
|
128
|
-
* Used to provide a custom description for the input component
|
|
129
|
-
*/
|
|
130
119
|
description: prop_types_1.default.string,
|
|
131
|
-
/**
|
|
132
|
-
* Selected value from the option set. Should match the 'value' property
|
|
133
|
-
* of one of the items in the options array.
|
|
134
|
-
*/
|
|
135
120
|
value: prop_types_1.default.string,
|
|
136
|
-
/**
|
|
137
|
-
* Handles the user seletion by passing the value of the selected
|
|
138
|
-
* option as the argument into the onClick callback.
|
|
139
|
-
*/
|
|
140
121
|
onClick: prop_types_1.default.func,
|
|
141
|
-
/**
|
|
142
|
-
* The options set to be displayed for the user
|
|
143
|
-
*/
|
|
144
122
|
options: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
145
123
|
name: prop_types_1.default.string,
|
|
146
124
|
description: prop_types_1.default.string,
|
|
@@ -150,64 +128,25 @@ exports.Dropdown.propTypes = {
|
|
|
150
128
|
color: prop_types_1.default.string,
|
|
151
129
|
disabled: prop_types_1.default.bool,
|
|
152
130
|
})),
|
|
153
|
-
/**
|
|
154
|
-
* Used to add a custom class name to each of the components html elements
|
|
155
|
-
*/
|
|
156
131
|
className: prop_types_1.default.string,
|
|
157
|
-
/**
|
|
158
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
159
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
160
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
161
|
-
*/
|
|
162
132
|
metadataKeyThumbnail: prop_types_1.default.string,
|
|
163
|
-
/**
|
|
164
|
-
* By default the description is soruced from the `_description` metadata
|
|
165
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
166
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
167
|
-
* prop.
|
|
168
|
-
*/
|
|
169
133
|
metadataKeyDescription: prop_types_1.default.string,
|
|
170
|
-
/**
|
|
171
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
172
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
173
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
174
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
175
|
-
*/
|
|
176
134
|
metadataKeyPrice: prop_types_1.default.string,
|
|
177
|
-
/**
|
|
178
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
179
|
-
* for the options.
|
|
180
|
-
*/
|
|
181
135
|
showThumbnail: prop_types_1.default.bool,
|
|
182
|
-
/**
|
|
183
|
-
* A boolean to set whether or all the Cards should display the description
|
|
184
|
-
* for the options.
|
|
185
|
-
*/
|
|
186
136
|
showDescription: prop_types_1.default.bool,
|
|
187
|
-
/**
|
|
188
|
-
* A boolean to set whether or all the Cards should display the price
|
|
189
|
-
* for the options.
|
|
190
|
-
*/
|
|
191
137
|
showPrice: prop_types_1.default.bool,
|
|
192
|
-
/**
|
|
193
|
-
* The maximum height the dropdown area should extend to before scrolling
|
|
194
|
-
* is introduced
|
|
195
|
-
*/
|
|
196
138
|
dropdownMaxHeight: prop_types_1.default.string,
|
|
197
139
|
};
|
|
198
140
|
exports.Dropdown.defaultProps = {
|
|
199
141
|
description: undefined,
|
|
200
142
|
className: undefined,
|
|
201
|
-
// Default use
|
|
202
143
|
attribute: undefined,
|
|
203
|
-
// Default user overrides
|
|
204
144
|
metadataKeyThumbnail: '_thumbnail',
|
|
205
145
|
metadataKeyDescription: undefined,
|
|
206
146
|
metadataKeyPrice: undefined,
|
|
207
147
|
showThumbnail: true,
|
|
208
148
|
showPrice: true,
|
|
209
149
|
showDescription: true,
|
|
210
|
-
// Custom use
|
|
211
150
|
value: undefined,
|
|
212
151
|
options: undefined,
|
|
213
152
|
onClick: undefined,
|
|
@@ -12,36 +12,15 @@ interface FlatFormProps {
|
|
|
12
12
|
export declare const FlatForm: {
|
|
13
13
|
(props: FlatFormProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
|
-
/**
|
|
16
|
-
* Used to add a title to Form (defaults to the intialized Catalog Item's name)
|
|
17
|
-
*/
|
|
18
15
|
title: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Alignement for the title. Options include `left`, `center` or `right`
|
|
21
|
-
*/
|
|
22
16
|
alignTitle: PropTypes.Requireable<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Used to add a description to Form
|
|
25
|
-
*/
|
|
26
17
|
description: PropTypes.Requireable<string>;
|
|
27
|
-
/**
|
|
28
|
-
* The attributes prop allows us to specify which components to use for
|
|
29
|
-
* our attributes and what props we want to pass into their components.
|
|
30
|
-
*
|
|
31
|
-
* The attributes prop takes and object with the keys matching the name
|
|
32
|
-
* of the attribute you wish to target and value as an object includeing
|
|
33
|
-
* the component to use and props to pass in.
|
|
34
|
-
*/
|
|
35
18
|
attributes: PropTypes.Requireable<{
|
|
36
19
|
[x: string]: PropTypes.InferProps<{
|
|
37
20
|
component: PropTypes.Requireable<string>;
|
|
38
21
|
props: PropTypes.Requireable<object>;
|
|
39
22
|
}> | null | undefined;
|
|
40
23
|
}>;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* Used to add a custom class name to each of the components html elements
|
|
44
|
-
*/
|
|
45
24
|
className: PropTypes.Requireable<string>;
|
|
46
25
|
};
|
|
47
26
|
defaultProps: {
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -89,34 +93,13 @@ var FlatForm = function (props) {
|
|
|
89
93
|
};
|
|
90
94
|
exports.FlatForm = FlatForm;
|
|
91
95
|
exports.FlatForm.propTypes = {
|
|
92
|
-
/**
|
|
93
|
-
* Used to add a title to Form (defaults to the intialized Catalog Item's name)
|
|
94
|
-
*/
|
|
95
96
|
title: prop_types_1.default.string,
|
|
96
|
-
/**
|
|
97
|
-
* Alignement for the title. Options include `left`, `center` or `right`
|
|
98
|
-
*/
|
|
99
97
|
alignTitle: prop_types_1.default.string,
|
|
100
|
-
/**
|
|
101
|
-
* Used to add a description to Form
|
|
102
|
-
*/
|
|
103
98
|
description: prop_types_1.default.string,
|
|
104
|
-
/**
|
|
105
|
-
* The attributes prop allows us to specify which components to use for
|
|
106
|
-
* our attributes and what props we want to pass into their components.
|
|
107
|
-
*
|
|
108
|
-
* The attributes prop takes and object with the keys matching the name
|
|
109
|
-
* of the attribute you wish to target and value as an object includeing
|
|
110
|
-
* the component to use and props to pass in.
|
|
111
|
-
*/
|
|
112
99
|
attributes: prop_types_1.default.objectOf(prop_types_1.default.shape({
|
|
113
100
|
component: prop_types_1.default.string,
|
|
114
101
|
props: prop_types_1.default.object,
|
|
115
102
|
})),
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* Used to add a custom class name to each of the components html elements
|
|
119
|
-
*/
|
|
120
103
|
className: prop_types_1.default.string,
|
|
121
104
|
};
|
|
122
105
|
exports.FlatForm.defaultProps = {
|