@threekit-tools/treble 0.0.81 → 0.0.84
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 +11 -5
- package/dist/Treble/Treble.js +41 -12
- package/dist/Treble/index.d.ts +2 -2
- package/dist/Treble/index.js +7 -3
- 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/index.js +5 -1
- 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 +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 +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 +7 -16
- package/dist/components/Dropdown/index.d.ts +2 -59
- package/dist/components/Dropdown/index.js +11 -72
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +10 -25
- package/dist/components/Modal/index.js +2 -15
- package/dist/components/Player/index.d.ts +1 -1
- 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 +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/Tabs/index.js +5 -1
- package/dist/components/TextInput/index.d.ts +2 -1
- package/dist/components/TextInput/index.js +2 -3
- package/dist/components/ThreekitProvider/index.js +5 -1
- 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/TrebleApp/index.js +5 -1
- package/dist/components/Upload/index.d.ts +2 -1
- package/dist/components/Upload/index.js +21 -17
- package/dist/components/UploadArea/index.d.ts +2 -1
- package/dist/components/UploadArea/index.js +18 -15
- 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.d.ts +12 -0
- package/dist/components/formComponents.js +10 -8
- 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 -49
- package/dist/constants.js +1 -59
- 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/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/index.js +5 -1
- package/dist/http/orders.d.ts +6 -8
- 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 +42 -3
- package/dist/index.js +84 -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 +26 -38
- package/dist/store/translations.d.ts +1 -13
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +1 -16
- 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 +118 -65
- package/dist/types.js +54 -0
- package/dist/utils.d.ts +10 -10
- package/dist/utils.js +8 -16
- package/package.json +16 -4
- package/dist/Treble/Snapshots.js +0 -251
- package/dist/Treble/Wishlist.js +0 -136
- package/dist/hooks/useImageEditor/index.d.ts +0 -14
- package/dist/hooks/useImageEditor/index.js +0 -320
|
@@ -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 IStrips extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -9,33 +10,11 @@ export interface IStrips extends IFormComponentProps<IOption> {
|
|
|
9
10
|
export declare const Strips: {
|
|
10
11
|
(props: IStrips): 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>;
|
|
@@ -44,44 +23,12 @@ export declare const Strips: {
|
|
|
44
23
|
color: PropTypes.Requireable<string>;
|
|
45
24
|
disabled: PropTypes.Requireable<boolean>;
|
|
46
25
|
}> | null | undefined)[]>;
|
|
47
|
-
/**
|
|
48
|
-
* Used to add a custom class name to each of the components html elements
|
|
49
|
-
*/
|
|
50
26
|
className: PropTypes.Requireable<string>;
|
|
51
|
-
/**
|
|
52
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
53
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
54
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
55
|
-
*/
|
|
56
27
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
57
|
-
/**
|
|
58
|
-
* By default the description is soruced from the `_description` metadata
|
|
59
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
60
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
61
|
-
* prop.
|
|
62
|
-
*/
|
|
63
28
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
64
|
-
/**
|
|
65
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
66
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
67
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
68
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
69
|
-
*/
|
|
70
29
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
71
|
-
/**
|
|
72
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
73
|
-
* for the options.
|
|
74
|
-
*/
|
|
75
30
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* A boolean to set whether or all the Cards should display the description
|
|
78
|
-
* for the options.
|
|
79
|
-
*/
|
|
80
31
|
showDescription: PropTypes.Requireable<boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* A boolean to set whether or all the Cards should display the price
|
|
83
|
-
* for the options/
|
|
84
|
-
*/
|
|
85
32
|
showPrice: PropTypes.Requireable<boolean>;
|
|
86
33
|
};
|
|
87
34
|
defaultProps: {
|
|
@@ -100,7 +47,7 @@ export declare const Strips: {
|
|
|
100
47
|
onClick: undefined;
|
|
101
48
|
};
|
|
102
49
|
componentName: string;
|
|
103
|
-
compatibleAttributes: Set<
|
|
50
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
104
51
|
};
|
|
105
52
|
declare const _default: (props: IStrips) => JSX.Element | null;
|
|
106
53
|
export default _default;
|
|
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
|
|
|
11
11
|
var strips_styles_1 = require("./strips.styles");
|
|
12
12
|
var shared_styles_1 = require("../shared.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 Strips = function (props) {
|
|
|
62
62
|
};
|
|
63
63
|
exports.Strips = Strips;
|
|
64
64
|
exports.Strips.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,
|
|
@@ -97,59 +75,24 @@ exports.Strips.propTypes = {
|
|
|
97
75
|
color: prop_types_1.default.string,
|
|
98
76
|
disabled: prop_types_1.default.bool,
|
|
99
77
|
})),
|
|
100
|
-
/**
|
|
101
|
-
* Used to add a custom class name to each of the components html elements
|
|
102
|
-
*/
|
|
103
78
|
className: prop_types_1.default.string,
|
|
104
|
-
/**
|
|
105
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
106
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
107
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
108
|
-
*/
|
|
109
79
|
metadataKeyThumbnail: prop_types_1.default.string,
|
|
110
|
-
/**
|
|
111
|
-
* By default the description is soruced from the `_description` metadata
|
|
112
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
113
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
114
|
-
* prop.
|
|
115
|
-
*/
|
|
116
80
|
metadataKeyDescription: prop_types_1.default.string,
|
|
117
|
-
/**
|
|
118
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
119
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
120
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
121
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
122
|
-
*/
|
|
123
81
|
metadataKeyPrice: prop_types_1.default.string,
|
|
124
|
-
/**
|
|
125
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
126
|
-
* for the options.
|
|
127
|
-
*/
|
|
128
82
|
showThumbnail: prop_types_1.default.bool,
|
|
129
|
-
/**
|
|
130
|
-
* A boolean to set whether or all the Cards should display the description
|
|
131
|
-
* for the options.
|
|
132
|
-
*/
|
|
133
83
|
showDescription: prop_types_1.default.bool,
|
|
134
|
-
/**
|
|
135
|
-
* A boolean to set whether or all the Cards should display the price
|
|
136
|
-
* for the options/
|
|
137
|
-
*/
|
|
138
84
|
showPrice: prop_types_1.default.bool,
|
|
139
85
|
};
|
|
140
86
|
exports.Strips.defaultProps = {
|
|
141
87
|
description: undefined,
|
|
142
88
|
className: undefined,
|
|
143
|
-
// Default use
|
|
144
89
|
attribute: undefined,
|
|
145
|
-
// Default user overrides
|
|
146
90
|
metadataKeyThumbnail: undefined,
|
|
147
91
|
metadataKeyDescription: undefined,
|
|
148
92
|
metadataKeyPrice: undefined,
|
|
149
93
|
showThumbnail: true,
|
|
150
94
|
showPrice: true,
|
|
151
95
|
showDescription: true,
|
|
152
|
-
// Custom use
|
|
153
96
|
title: undefined,
|
|
154
97
|
value: undefined,
|
|
155
98
|
options: undefined,
|
|
@@ -157,7 +100,7 @@ exports.Strips.defaultProps = {
|
|
|
157
100
|
};
|
|
158
101
|
exports.Strips.componentName = 'strips';
|
|
159
102
|
exports.Strips.compatibleAttributes = new Set([
|
|
160
|
-
|
|
161
|
-
|
|
103
|
+
types_1.ATTRIBUTE_TYPES.ASSET,
|
|
104
|
+
types_1.ATTRIBUTE_TYPES.STRING,
|
|
162
105
|
]);
|
|
163
106
|
exports.default = (0, formInputContainer_1.default)(exports.Strips);
|
|
@@ -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 ISwatch extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -10,44 +11,13 @@ export interface ISwatch extends IFormComponentProps<IOption> {
|
|
|
10
11
|
export declare const Swatch: {
|
|
11
12
|
(props: ISwatch): 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 set the shape of the Swatch Option component. Options
|
|
21
|
-
* include: `square`, `round`
|
|
22
|
-
*/
|
|
23
15
|
shape: PropTypes.Requireable<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Used to add a title to the input
|
|
26
|
-
*/
|
|
27
16
|
title: PropTypes.Requireable<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Used to provide a custom description for the input component
|
|
30
|
-
*/
|
|
31
17
|
description: PropTypes.Requireable<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Selected value from the option set. Should match the 'value' property
|
|
34
|
-
* of one of the items in the options array.
|
|
35
|
-
*/
|
|
36
18
|
value: PropTypes.Requireable<string>;
|
|
37
|
-
/**
|
|
38
|
-
* Handles the user seletion by passing the value of the selected
|
|
39
|
-
* option as the argument into the onClick callback.
|
|
40
|
-
*/
|
|
41
19
|
size: PropTypes.Requireable<string>;
|
|
42
|
-
/**
|
|
43
|
-
* The size of the for a swatch option. The size should be a valid CSS
|
|
44
|
-
* height/width property.
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
20
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
/**
|
|
49
|
-
* The options set to be displayed for the user
|
|
50
|
-
*/
|
|
51
21
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
22
|
name: PropTypes.Requireable<string>;
|
|
53
23
|
description: PropTypes.Requireable<string>;
|
|
@@ -57,44 +27,12 @@ export declare const Swatch: {
|
|
|
57
27
|
color: PropTypes.Requireable<string>;
|
|
58
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
59
29
|
}> | null | undefined)[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Used to add a custom class name to each of the components html elements
|
|
62
|
-
*/
|
|
63
30
|
className: PropTypes.Requireable<string>;
|
|
64
|
-
/**
|
|
65
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
66
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
67
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
68
|
-
*/
|
|
69
31
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
70
|
-
/**
|
|
71
|
-
* By default the description is soruced from the `_description` metadata
|
|
72
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
73
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
74
|
-
* prop.
|
|
75
|
-
*/
|
|
76
32
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
77
|
-
/**
|
|
78
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
79
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
80
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
81
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
82
|
-
*/
|
|
83
33
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
84
|
-
/**
|
|
85
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
86
|
-
* for the options.
|
|
87
|
-
*/
|
|
88
34
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* A boolean to set whether or all the Cards should display the description
|
|
91
|
-
* for the options.
|
|
92
|
-
*/
|
|
93
35
|
showDescription: PropTypes.Requireable<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* A boolean to set whether or all the Cards should display the price
|
|
96
|
-
* for the options/
|
|
97
|
-
*/
|
|
98
36
|
showPrice: PropTypes.Requireable<boolean>;
|
|
99
37
|
};
|
|
100
38
|
defaultProps: {
|
|
@@ -114,7 +52,7 @@ export declare const Swatch: {
|
|
|
114
52
|
onClick: undefined;
|
|
115
53
|
};
|
|
116
54
|
componentName: string;
|
|
117
|
-
compatibleAttributes: Set<
|
|
55
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
118
56
|
};
|
|
119
57
|
declare const _default: (props: ISwatch) => JSX.Element | null;
|
|
120
58
|
export default _default;
|
|
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
|
|
|
11
11
|
var swatch_styles_1 = require("./swatch.styles");
|
|
12
12
|
var shared_styles_1 = require("../shared.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 SwatchInfo = function (props) {
|
|
17
17
|
var title = props.title, price = props.price, description = props.description;
|
|
@@ -52,44 +52,13 @@ var Swatch = function (props) {
|
|
|
52
52
|
};
|
|
53
53
|
exports.Swatch = Swatch;
|
|
54
54
|
exports.Swatch.propTypes = {
|
|
55
|
-
/**
|
|
56
|
-
* Is the attribute name on the initialized asset that we are
|
|
57
|
-
* using this component for. If the attribute prop is used,
|
|
58
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
59
|
-
*/
|
|
60
55
|
attribute: prop_types_1.default.string,
|
|
61
|
-
/**
|
|
62
|
-
* Used to set the shape of the Swatch Option component. Options
|
|
63
|
-
* include: `square`, `round`
|
|
64
|
-
*/
|
|
65
56
|
shape: prop_types_1.default.string,
|
|
66
|
-
/**
|
|
67
|
-
* Used to add a title to the input
|
|
68
|
-
*/
|
|
69
57
|
title: prop_types_1.default.string,
|
|
70
|
-
/**
|
|
71
|
-
* Used to provide a custom description for the input component
|
|
72
|
-
*/
|
|
73
58
|
description: prop_types_1.default.string,
|
|
74
|
-
/**
|
|
75
|
-
* Selected value from the option set. Should match the 'value' property
|
|
76
|
-
* of one of the items in the options array.
|
|
77
|
-
*/
|
|
78
59
|
value: prop_types_1.default.string,
|
|
79
|
-
/**
|
|
80
|
-
* Handles the user seletion by passing the value of the selected
|
|
81
|
-
* option as the argument into the onClick callback.
|
|
82
|
-
*/
|
|
83
60
|
size: prop_types_1.default.string,
|
|
84
|
-
/**
|
|
85
|
-
* The size of the for a swatch option. The size should be a valid CSS
|
|
86
|
-
* height/width property.
|
|
87
|
-
*
|
|
88
|
-
*/
|
|
89
61
|
onClick: prop_types_1.default.func,
|
|
90
|
-
/**
|
|
91
|
-
* The options set to be displayed for the user
|
|
92
|
-
*/
|
|
93
62
|
options: prop_types_1.default.arrayOf(prop_types_1.default.shape({
|
|
94
63
|
name: prop_types_1.default.string,
|
|
95
64
|
description: prop_types_1.default.string,
|
|
@@ -99,60 +68,25 @@ exports.Swatch.propTypes = {
|
|
|
99
68
|
color: prop_types_1.default.string,
|
|
100
69
|
disabled: prop_types_1.default.bool,
|
|
101
70
|
})),
|
|
102
|
-
/**
|
|
103
|
-
* Used to add a custom class name to each of the components html elements
|
|
104
|
-
*/
|
|
105
71
|
className: prop_types_1.default.string,
|
|
106
|
-
/**
|
|
107
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
108
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
109
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
110
|
-
*/
|
|
111
72
|
metadataKeyThumbnail: prop_types_1.default.string,
|
|
112
|
-
/**
|
|
113
|
-
* By default the description is soruced from the `_description` metadata
|
|
114
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
115
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
116
|
-
* prop.
|
|
117
|
-
*/
|
|
118
73
|
metadataKeyDescription: prop_types_1.default.string,
|
|
119
|
-
/**
|
|
120
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
121
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
122
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
123
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
124
|
-
*/
|
|
125
74
|
metadataKeyPrice: prop_types_1.default.string,
|
|
126
|
-
/**
|
|
127
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
128
|
-
* for the options.
|
|
129
|
-
*/
|
|
130
75
|
showThumbnail: prop_types_1.default.bool,
|
|
131
|
-
/**
|
|
132
|
-
* A boolean to set whether or all the Cards should display the description
|
|
133
|
-
* for the options.
|
|
134
|
-
*/
|
|
135
76
|
showDescription: prop_types_1.default.bool,
|
|
136
|
-
/**
|
|
137
|
-
* A boolean to set whether or all the Cards should display the price
|
|
138
|
-
* for the options/
|
|
139
|
-
*/
|
|
140
77
|
showPrice: prop_types_1.default.bool,
|
|
141
78
|
};
|
|
142
79
|
exports.Swatch.defaultProps = {
|
|
143
80
|
shape: 'round',
|
|
144
81
|
description: undefined,
|
|
145
82
|
className: undefined,
|
|
146
|
-
// Default use
|
|
147
83
|
attribute: undefined,
|
|
148
|
-
// Default user overrides
|
|
149
84
|
metadataKeyThumbnail: undefined,
|
|
150
85
|
metadataKeyDescription: undefined,
|
|
151
86
|
metadataKeyPrice: undefined,
|
|
152
87
|
showThumbnail: true,
|
|
153
88
|
showPrice: true,
|
|
154
89
|
showDescription: true,
|
|
155
|
-
// Custom use
|
|
156
90
|
title: undefined,
|
|
157
91
|
value: undefined,
|
|
158
92
|
options: undefined,
|
|
@@ -160,7 +94,7 @@ exports.Swatch.defaultProps = {
|
|
|
160
94
|
};
|
|
161
95
|
exports.Swatch.componentName = 'swatch';
|
|
162
96
|
exports.Swatch.compatibleAttributes = new Set([
|
|
163
|
-
|
|
164
|
-
|
|
97
|
+
types_1.ATTRIBUTE_TYPES.ASSET,
|
|
98
|
+
types_1.ATTRIBUTE_TYPES.STRING,
|
|
165
99
|
]);
|
|
166
100
|
exports.default = (0, formInputContainer_1.default)(exports.Swatch);
|
|
@@ -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 ISwitch extends IFormComponentProps<IOption> {
|
|
5
6
|
showDescription?: boolean;
|
|
@@ -7,46 +8,13 @@ export interface ISwitch extends IFormComponentProps<IOption> {
|
|
|
7
8
|
export declare const Switch: {
|
|
8
9
|
(props: ISwitch): JSX.Element;
|
|
9
10
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* Is the attribute name on the initialized asset that we are
|
|
12
|
-
* using this component for. If the attribute prop is used,
|
|
13
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
14
|
-
*/
|
|
15
11
|
attribute: PropTypes.Requireable<string>;
|
|
16
|
-
/**
|
|
17
|
-
* Used to add a title to the input
|
|
18
|
-
*/
|
|
19
12
|
title: PropTypes.Requireable<string>;
|
|
20
|
-
/**
|
|
21
|
-
* Used to provide a custom description for the input component
|
|
22
|
-
*/
|
|
23
13
|
description: PropTypes.Requireable<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Selected value from the option set. Should match the 'value' property
|
|
26
|
-
* of one of the items in the options array.
|
|
27
|
-
*/
|
|
28
14
|
value: PropTypes.Requireable<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* The size of the for a Switch option. The size should be a valid CSS
|
|
31
|
-
* height/width property.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
15
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
-
/**
|
|
36
|
-
* Used to add a custom class name to each of the components html elements
|
|
37
|
-
*/
|
|
38
16
|
className: PropTypes.Requireable<string>;
|
|
39
|
-
/**
|
|
40
|
-
* By default the description is soruced from the `_description` metadata
|
|
41
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
42
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
43
|
-
* prop.
|
|
44
|
-
*/
|
|
45
17
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
46
|
-
/**
|
|
47
|
-
* A boolean to set whether or all the Cards should display the description
|
|
48
|
-
* for the options.
|
|
49
|
-
*/
|
|
50
18
|
showDescription: PropTypes.Requireable<boolean>;
|
|
51
19
|
};
|
|
52
20
|
defaultProps: {
|
|
@@ -60,7 +28,7 @@ export declare const Switch: {
|
|
|
60
28
|
onClick: undefined;
|
|
61
29
|
};
|
|
62
30
|
componentName: string;
|
|
63
|
-
compatibleAttributes: Set<
|
|
31
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
64
32
|
};
|
|
65
33
|
declare const _default: (props: ISwitch) => JSX.Element | null;
|
|
66
34
|
export default _default;
|
|
@@ -11,7 +11,7 @@ var FormComponentDescription_1 = __importDefault(require("../FormComponentDescri
|
|
|
11
11
|
var switch_styles_1 = require("./switch.styles");
|
|
12
12
|
var shared_styles_1 = require("../shared.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 Switch = function (props) {
|
|
17
17
|
var title = props.title, value = props.value, onChange = props.onChange, description = props.description, customClassName = props.className, showDescription = props.showDescription;
|
|
@@ -26,61 +26,25 @@ var Switch = function (props) {
|
|
|
26
26
|
};
|
|
27
27
|
exports.Switch = Switch;
|
|
28
28
|
exports.Switch.propTypes = {
|
|
29
|
-
/**
|
|
30
|
-
* Is the attribute name on the initialized asset that we are
|
|
31
|
-
* using this component for. If the attribute prop is used,
|
|
32
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
33
|
-
*/
|
|
34
29
|
attribute: prop_types_1.default.string,
|
|
35
|
-
/**
|
|
36
|
-
* Used to add a title to the input
|
|
37
|
-
*/
|
|
38
30
|
title: prop_types_1.default.string,
|
|
39
|
-
/**
|
|
40
|
-
* Used to provide a custom description for the input component
|
|
41
|
-
*/
|
|
42
31
|
description: prop_types_1.default.string,
|
|
43
|
-
/**
|
|
44
|
-
* Selected value from the option set. Should match the 'value' property
|
|
45
|
-
* of one of the items in the options array.
|
|
46
|
-
*/
|
|
47
32
|
value: prop_types_1.default.bool,
|
|
48
|
-
/**
|
|
49
|
-
* The size of the for a Switch option. The size should be a valid CSS
|
|
50
|
-
* height/width property.
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
33
|
onClick: prop_types_1.default.func,
|
|
54
|
-
/**
|
|
55
|
-
* Used to add a custom class name to each of the components html elements
|
|
56
|
-
*/
|
|
57
34
|
className: prop_types_1.default.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
35
|
metadataKeyDescription: prop_types_1.default.string,
|
|
65
|
-
/**
|
|
66
|
-
* A boolean to set whether or all the Cards should display the description
|
|
67
|
-
* for the options.
|
|
68
|
-
*/
|
|
69
36
|
showDescription: prop_types_1.default.bool,
|
|
70
37
|
};
|
|
71
38
|
exports.Switch.defaultProps = {
|
|
72
39
|
description: undefined,
|
|
73
40
|
className: undefined,
|
|
74
|
-
// Default use
|
|
75
41
|
attribute: undefined,
|
|
76
|
-
// Default user overrides
|
|
77
42
|
metadataKeyDescription: undefined,
|
|
78
43
|
showDescription: true,
|
|
79
|
-
// Custom use
|
|
80
44
|
title: undefined,
|
|
81
45
|
value: undefined,
|
|
82
46
|
onClick: undefined,
|
|
83
47
|
};
|
|
84
48
|
exports.Switch.componentName = 'Switch';
|
|
85
|
-
exports.Switch.compatibleAttributes = new Set([
|
|
49
|
+
exports.Switch.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.BOOLEAN]);
|
|
86
50
|
exports.default = (0, formInputContainer_1.default)(exports.Switch);
|
|
@@ -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];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ATTRIBUTE_TYPES } from '../../types';
|
|
2
3
|
import { IFormComponentProps } from '../containers/formInputContainer';
|
|
3
4
|
export interface ITextInput extends IFormComponentProps<undefined> {
|
|
4
5
|
maxLength?: number;
|
|
@@ -6,7 +7,7 @@ export interface ITextInput extends IFormComponentProps<undefined> {
|
|
|
6
7
|
export declare const TextInput: {
|
|
7
8
|
(props: ITextInput): JSX.Element;
|
|
8
9
|
componentName: string;
|
|
9
|
-
compatibleAttributes: Set<
|
|
10
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
10
11
|
};
|
|
11
12
|
declare const _default: (props: ITextInput) => JSX.Element | null;
|
|
12
13
|
export default _default;
|
|
@@ -5,13 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TextInput = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
// import PropTypes from 'prop-types';
|
|
9
8
|
var FormComponentTitle_1 = __importDefault(require("../FormComponentTitle"));
|
|
10
9
|
var FormComponentDescription_1 = __importDefault(require("../FormComponentDescription"));
|
|
11
10
|
var textInput_styles_1 = require("./textInput.styles");
|
|
12
11
|
var shared_styles_1 = require("../shared.styles");
|
|
13
12
|
var utils_1 = require("../../utils");
|
|
14
|
-
var
|
|
13
|
+
var types_1 = require("../../types");
|
|
15
14
|
var formInputContainer_1 = __importDefault(require("../containers/formInputContainer"));
|
|
16
15
|
var TextInput = function (props) {
|
|
17
16
|
var title = props.title, description = props.description, value = props.value, onChange = props.onChange, maxLength = props.maxLength, customClassName = props.className;
|
|
@@ -25,5 +24,5 @@ var TextInput = function (props) {
|
|
|
25
24
|
};
|
|
26
25
|
exports.TextInput = TextInput;
|
|
27
26
|
exports.TextInput.componentName = 'text-input';
|
|
28
|
-
exports.TextInput.compatibleAttributes = new Set([
|
|
27
|
+
exports.TextInput.compatibleAttributes = new Set([types_1.ATTRIBUTE_TYPES.STRING]);
|
|
29
28
|
exports.default = (0, formInputContainer_1.default)(exports.TextInput);
|
|
@@ -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];
|