@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,14 +20,14 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
20
20
|
var react_dom_1 = __importDefault(require("react-dom"));
|
|
21
21
|
var modal_styles_1 = require("./modal.styles");
|
|
22
22
|
var utils_1 = require("../../utils");
|
|
23
|
-
var
|
|
23
|
+
var Remove_1 = __importDefault(require("../../icons/Remove"));
|
|
24
24
|
var ModalComponent = function (props) {
|
|
25
25
|
var title = props.title, children = props.children, handleClose = props.handleClose, showHeader = props.showHeader, className = props.className;
|
|
26
26
|
return (react_1.default.createElement(modal_styles_1.Wrapper, { onClick: function (e) { return e.stopPropagation(); }, className: "".concat(className, " modal-main") },
|
|
27
27
|
showHeader ? (react_1.default.createElement(modal_styles_1.Header, { className: "".concat(className, " modal-header") },
|
|
28
28
|
react_1.default.createElement("div", { className: "".concat(className, " modal-title") }, title),
|
|
29
29
|
react_1.default.createElement("div", { onClick: handleClose },
|
|
30
|
-
react_1.default.createElement(
|
|
30
|
+
react_1.default.createElement(Remove_1.default, null)))) : null,
|
|
31
31
|
react_1.default.createElement(modal_styles_1.Content, { className: "".concat(className, " modal-content") }, children)));
|
|
32
32
|
};
|
|
33
33
|
exports.ModalComponent = ModalComponent;
|
|
@@ -39,22 +39,9 @@ var Modal = function (props) {
|
|
|
39
39
|
};
|
|
40
40
|
exports.Modal = Modal;
|
|
41
41
|
exports.ModalComponent.propTypes = {
|
|
42
|
-
/**
|
|
43
|
-
* The title to be shown in the Modal header
|
|
44
|
-
*/
|
|
45
42
|
title: prop_types_1.default.string,
|
|
46
|
-
/**
|
|
47
|
-
* Callback function to close the modal. Can be used with custom UI
|
|
48
|
-
* components in the Modal
|
|
49
|
-
*/
|
|
50
43
|
handleClose: prop_types_1.default.func,
|
|
51
|
-
/**
|
|
52
|
-
* Whether or not to render the default Modal header
|
|
53
|
-
*/
|
|
54
44
|
showHeader: prop_types_1.default.bool,
|
|
55
|
-
/**
|
|
56
|
-
* Used to add a custom class name to each of the components html elements
|
|
57
|
-
*/
|
|
58
45
|
className: prop_types_1.default.string,
|
|
59
46
|
};
|
|
60
47
|
exports.ModalComponent.defaultProps = {
|
|
@@ -1,33 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
4
|
};
|
|
24
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
|
|
26
|
-
var react_1 = __importStar(require("react"));
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
27
7
|
var player_styles_1 = require("./player.styles");
|
|
28
8
|
var constants_1 = require("../../constants");
|
|
29
|
-
var
|
|
30
|
-
exports.PLAYER_DIV_ID = 'tk-player-component';
|
|
9
|
+
var usePlayer_1 = __importDefault(require("../../hooks/usePlayer"));
|
|
31
10
|
var className = "".concat(constants_1.DEFAULT_CLASS_NAME, " ").concat(constants_1.CLASS_NAME_PREFIX, "-player");
|
|
32
11
|
var Player = function (props) {
|
|
33
12
|
var _a = Object.assign({
|
|
@@ -35,22 +14,9 @@ var Player = function (props) {
|
|
|
35
14
|
minHeight: '600px',
|
|
36
15
|
width: '100%',
|
|
37
16
|
}, props), height = _a.height, width = _a.width, minHeight = _a.minHeight, children = _a.children;
|
|
38
|
-
var
|
|
39
|
-
var hasMoved = (0, react_1.useRef)(false);
|
|
40
|
-
(0, react_1.useEffect)(function () {
|
|
41
|
-
if (portalPlayerTo && !hasMoved.current) {
|
|
42
|
-
portalPlayerTo(exports.PLAYER_DIV_ID);
|
|
43
|
-
hasMoved.current = true;
|
|
44
|
-
}
|
|
45
|
-
return function () {
|
|
46
|
-
if (portalBack) {
|
|
47
|
-
portalBack();
|
|
48
|
-
hasMoved.current = false;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}, [portalPlayerTo]);
|
|
17
|
+
var playerRef = (0, usePlayer_1.default)()[0];
|
|
52
18
|
return (react_1.default.createElement(player_styles_1.Wrapper, { height: height, width: width, minHeight: minHeight, className: className },
|
|
53
|
-
react_1.default.createElement("div", {
|
|
19
|
+
react_1.default.createElement("div", { ref: playerRef }),
|
|
54
20
|
children));
|
|
55
21
|
};
|
|
56
22
|
Player.TopLeftWidgets = function (props) {
|
|
@@ -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];
|
|
@@ -24,15 +24,7 @@ var PortalToElement = function (props) {
|
|
|
24
24
|
};
|
|
25
25
|
exports.PortalToElement = PortalToElement;
|
|
26
26
|
exports.PortalToElement.propTypes = {
|
|
27
|
-
/**
|
|
28
|
-
* The id of the HTML element you want the content to be rendered in
|
|
29
|
-
*/
|
|
30
27
|
to: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Defines the behaviour if the HTML element is not found. If strict is
|
|
33
|
-
* set to `true` the content will not render, if set to `false` the
|
|
34
|
-
* content will render out in its defualt flow.
|
|
35
|
-
*/
|
|
36
28
|
strict: prop_types_1.default.bool,
|
|
37
29
|
};
|
|
38
30
|
exports.PortalToElement.defaultProps = {};
|
|
@@ -7,13 +7,7 @@ interface IProductDescription {
|
|
|
7
7
|
export declare const ProductDescriptionComponent: {
|
|
8
8
|
(props: IProductDescription): JSX.Element;
|
|
9
9
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* The description displayed to the user
|
|
12
|
-
*/
|
|
13
10
|
description: 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: {
|
|
@@ -28,13 +28,7 @@ var ProductDescription = function (props) {
|
|
|
28
28
|
return (react_1.default.createElement(exports.ProductDescriptionComponent, { className: className, description: ((_a = metadata === null || metadata === void 0 ? void 0 : metadata._description) === null || _a === void 0 ? void 0 : _a.toString()) || description }));
|
|
29
29
|
};
|
|
30
30
|
exports.ProductDescriptionComponent.propTypes = {
|
|
31
|
-
/**
|
|
32
|
-
* The description displayed to the user
|
|
33
|
-
*/
|
|
34
31
|
description: prop_types_1.default.string,
|
|
35
|
-
/**
|
|
36
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
37
|
-
*/
|
|
38
32
|
className: prop_types_1.default.string,
|
|
39
33
|
};
|
|
40
34
|
exports.ProductDescriptionComponent.defaultProps = {
|
|
@@ -8,17 +8,8 @@ interface ITitle {
|
|
|
8
8
|
export declare const ProductNameComponent: {
|
|
9
9
|
(props: ITitle): JSX.Element;
|
|
10
10
|
propTypes: {
|
|
11
|
-
/**
|
|
12
|
-
* The title displayed to the user
|
|
13
|
-
*/
|
|
14
11
|
title: PropTypes.Requireable<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
17
|
-
*/
|
|
18
12
|
className: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* The CSS Text alignment property. Options: 'left' | 'center' | 'right'
|
|
21
|
-
*/
|
|
22
13
|
align: PropTypes.Requireable<string>;
|
|
23
14
|
};
|
|
24
15
|
defaultProps: {
|
|
@@ -24,17 +24,8 @@ var ProductName = function (props) {
|
|
|
24
24
|
};
|
|
25
25
|
exports.ProductName = ProductName;
|
|
26
26
|
exports.ProductNameComponent.propTypes = {
|
|
27
|
-
/**
|
|
28
|
-
* The title displayed to the user
|
|
29
|
-
*/
|
|
30
27
|
title: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
33
|
-
*/
|
|
34
28
|
className: prop_types_1.default.string,
|
|
35
|
-
/**
|
|
36
|
-
* The CSS Text alignment property. Options: 'left' | 'center' | 'right'
|
|
37
|
-
*/
|
|
38
29
|
align: prop_types_1.default.string,
|
|
39
30
|
};
|
|
40
31
|
exports.ProductNameComponent.defaultProps = {
|
|
@@ -11,20 +11,8 @@ export declare const Share: {
|
|
|
11
11
|
(props: ShareProps): JSX.Element | null;
|
|
12
12
|
propTypes: {
|
|
13
13
|
className: PropTypes.Requireable<string>;
|
|
14
|
-
/**
|
|
15
|
-
* The presentational type of the input component. Options
|
|
16
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
17
|
-
*/
|
|
18
14
|
type: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Used to set the shape of the Widget button. Options
|
|
21
|
-
* include: `square`, `round`
|
|
22
|
-
*/
|
|
23
15
|
shape: PropTypes.Requireable<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Used to set an overwrite of the message presented to the user
|
|
26
|
-
* when the share URL has been successfully copied.
|
|
27
|
-
*/
|
|
28
16
|
message: PropTypes.Requireable<string>;
|
|
29
17
|
};
|
|
30
18
|
defaultProps: {
|
|
@@ -7,7 +7,7 @@ exports.Share = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var Button_1 = __importDefault(require("../Button"));
|
|
10
|
-
var
|
|
10
|
+
var Share_1 = __importDefault(require("../../icons/Share"));
|
|
11
11
|
var useThreekitInitStatus_1 = __importDefault(require("../../hooks/useThreekitInitStatus"));
|
|
12
12
|
var useShare_1 = __importDefault(require("../../hooks/useShare"));
|
|
13
13
|
var utils_1 = require("../../utils");
|
|
@@ -21,25 +21,13 @@ var Share = function (props) {
|
|
|
21
21
|
var handleClick = function () {
|
|
22
22
|
handleShare(message);
|
|
23
23
|
};
|
|
24
|
-
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon:
|
|
24
|
+
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon: Share_1.default.iconName, onClick: handleClick }));
|
|
25
25
|
};
|
|
26
26
|
exports.Share = Share;
|
|
27
27
|
exports.Share.propTypes = {
|
|
28
28
|
className: prop_types_1.default.string,
|
|
29
|
-
/**
|
|
30
|
-
* The presentational type of the input component. Options
|
|
31
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
32
|
-
*/
|
|
33
29
|
type: prop_types_1.default.string,
|
|
34
|
-
/**
|
|
35
|
-
* Used to set the shape of the Widget button. Options
|
|
36
|
-
* include: `square`, `round`
|
|
37
|
-
*/
|
|
38
30
|
shape: prop_types_1.default.string,
|
|
39
|
-
/**
|
|
40
|
-
* Used to set an overwrite of the message presented to the user
|
|
41
|
-
* when the share URL has been successfully copied.
|
|
42
|
-
*/
|
|
43
31
|
message: prop_types_1.default.string,
|
|
44
32
|
};
|
|
45
33
|
exports.Share.defaultProps = {
|
|
@@ -13,15 +13,7 @@ export declare const Snapshots: {
|
|
|
13
13
|
(props: SnapshotProps): JSX.Element | null;
|
|
14
14
|
propTypes: {
|
|
15
15
|
className: PropTypes.Requireable<string>;
|
|
16
|
-
/**
|
|
17
|
-
* The presentational type of the input component. Options
|
|
18
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
19
|
-
*/
|
|
20
16
|
type: PropTypes.Requireable<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Used to set the shape of the Widget button. Options
|
|
23
|
-
* include: `square`, `round`
|
|
24
|
-
*/
|
|
25
17
|
shape: PropTypes.Requireable<string>;
|
|
26
18
|
};
|
|
27
19
|
defaultProps: {
|
|
@@ -7,7 +7,7 @@ exports.Snapshots = void 0;
|
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var Button_1 = __importDefault(require("../Button"));
|
|
10
|
-
var
|
|
10
|
+
var Download_1 = __importDefault(require("../../icons/Download"));
|
|
11
11
|
var useThreekitInitStatus_1 = __importDefault(require("../../hooks/useThreekitInitStatus"));
|
|
12
12
|
var useSnapshot_1 = __importDefault(require("../../hooks/useSnapshot"));
|
|
13
13
|
var utils_1 = require("../../utils");
|
|
@@ -19,20 +19,12 @@ var Snapshots = function (props) {
|
|
|
19
19
|
if (!hasLoaded)
|
|
20
20
|
return null;
|
|
21
21
|
var cls = (0, utils_1.generateWidgetClassName)('snapshots', className);
|
|
22
|
-
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon:
|
|
22
|
+
return (react_1.default.createElement(Button_1.default, { className: cls, shape: shape, type: type, icon: Download_1.default.iconName, onClick: takeSnapshot }));
|
|
23
23
|
};
|
|
24
24
|
exports.Snapshots = Snapshots;
|
|
25
25
|
exports.Snapshots.propTypes = {
|
|
26
26
|
className: prop_types_1.default.string,
|
|
27
|
-
/**
|
|
28
|
-
* The presentational type of the input component. Options
|
|
29
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
30
|
-
*/
|
|
31
27
|
type: prop_types_1.default.string,
|
|
32
|
-
/**
|
|
33
|
-
* Used to set the shape of the Widget button. Options
|
|
34
|
-
* include: `square`, `round`
|
|
35
|
-
*/
|
|
36
28
|
shape: prop_types_1.default.string,
|
|
37
29
|
};
|
|
38
30
|
exports.Snapshots.defaultProps = {
|
|
@@ -9,33 +9,11 @@ export interface IStrips extends IFormComponentProps<IOption> {
|
|
|
9
9
|
export declare const Strips: {
|
|
10
10
|
(props: IStrips): 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>;
|
|
@@ -44,44 +22,12 @@ export declare const Strips: {
|
|
|
44
22
|
color: PropTypes.Requireable<string>;
|
|
45
23
|
disabled: PropTypes.Requireable<boolean>;
|
|
46
24
|
}> | null | undefined)[]>;
|
|
47
|
-
/**
|
|
48
|
-
* Used to add a custom class name to each of the components html elements
|
|
49
|
-
*/
|
|
50
25
|
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
26
|
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
27
|
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
28
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
71
|
-
/**
|
|
72
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
73
|
-
* for the options.
|
|
74
|
-
*/
|
|
75
29
|
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
30
|
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
31
|
showPrice: PropTypes.Requireable<boolean>;
|
|
86
32
|
};
|
|
87
33
|
defaultProps: {
|
|
@@ -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,
|
|
@@ -10,44 +10,13 @@ export interface ISwatch extends IFormComponentProps<IOption> {
|
|
|
10
10
|
export declare const Swatch: {
|
|
11
11
|
(props: ISwatch): 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 set the shape of the Swatch Option component. Options
|
|
21
|
-
* include: `square`, `round`
|
|
22
|
-
*/
|
|
23
14
|
shape: PropTypes.Requireable<string>;
|
|
24
|
-
/**
|
|
25
|
-
* Used to add a title to the input
|
|
26
|
-
*/
|
|
27
15
|
title: PropTypes.Requireable<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Used to provide a custom description for the input component
|
|
30
|
-
*/
|
|
31
16
|
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
17
|
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
18
|
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
19
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
/**
|
|
49
|
-
* The options set to be displayed for the user
|
|
50
|
-
*/
|
|
51
20
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
52
21
|
name: PropTypes.Requireable<string>;
|
|
53
22
|
description: PropTypes.Requireable<string>;
|
|
@@ -57,44 +26,12 @@ export declare const Swatch: {
|
|
|
57
26
|
color: PropTypes.Requireable<string>;
|
|
58
27
|
disabled: PropTypes.Requireable<boolean>;
|
|
59
28
|
}> | null | undefined)[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Used to add a custom class name to each of the components html elements
|
|
62
|
-
*/
|
|
63
29
|
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
30
|
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
31
|
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
32
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
84
|
-
/**
|
|
85
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
86
|
-
* for the options.
|
|
87
|
-
*/
|
|
88
33
|
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
34
|
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
35
|
showPrice: PropTypes.Requireable<boolean>;
|
|
99
36
|
};
|
|
100
37
|
defaultProps: {
|