@threekit-tools/treble 0.0.82 → 0.0.85-next-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Treble/Treble.d.ts +15 -6
- package/dist/Treble/Treble.js +58 -20
- package/dist/Treble/index.d.ts +2 -2
- package/dist/Treble/index.js +2 -2
- package/dist/Treble/{Snapshots.d.ts → snapshots.d.ts} +4 -9
- package/dist/Treble/snapshots.js +247 -0
- package/dist/Treble/{Wishlist.d.ts → wishlist.d.ts} +2 -6
- package/dist/Treble/wishlist.js +135 -0
- package/dist/api/catalog.js +6 -6
- package/dist/api/configurations.d.ts +2 -0
- package/dist/api/configurations.js +7 -5
- package/dist/api/datatables.js +5 -5
- package/dist/api/files.d.ts +1 -0
- package/dist/api/files.js +63 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/api/orders.d.ts +5 -7
- package/dist/api/orders.js +12 -12
- package/dist/api/price.js +2 -2
- package/dist/api/products.js +2 -2
- package/dist/components/Accordion/index.js +1 -6
- package/dist/components/AttributeTitle/index.d.ts +0 -9
- package/dist/components/AttributeTitle/index.js +0 -9
- package/dist/components/AttributeValue/index.d.ts +0 -6
- package/dist/components/AttributeValue/index.js +2 -8
- package/dist/components/Button/index.d.ts +0 -27
- package/dist/components/Button/index.js +0 -27
- package/dist/components/Cards/index.d.ts +2 -55
- package/dist/components/Cards/index.js +3 -60
- package/dist/components/Drawer/index.js +0 -13
- package/dist/components/Dropdown/index.d.ts +2 -59
- package/dist/components/Dropdown/index.js +4 -69
- package/dist/components/FlatForm/index.d.ts +0 -21
- package/dist/components/FlatForm/index.js +5 -24
- package/dist/components/Modal/index.js +0 -13
- package/dist/components/Player/index.d.ts +1 -1
- package/dist/components/PortalToElement/index.js +0 -8
- package/dist/components/ProductDescription/index.d.ts +0 -6
- package/dist/components/ProductDescription/index.js +0 -6
- package/dist/components/ProductName/index.d.ts +0 -9
- package/dist/components/ProductName/index.js +0 -9
- package/dist/components/Share/index.d.ts +4 -12
- package/dist/components/Share/index.js +143 -21
- package/dist/components/Share/share.styles.d.ts +9 -0
- package/dist/components/Share/share.styles.js +23 -0
- package/dist/components/Snapshots/index.d.ts +0 -8
- package/dist/components/Snapshots/index.js +0 -8
- package/dist/components/Strips/index.d.ts +2 -55
- package/dist/components/Strips/index.js +3 -60
- package/dist/components/Swatch/index.d.ts +2 -64
- package/dist/components/Swatch/index.js +3 -69
- package/dist/components/Switch/index.d.ts +2 -34
- package/dist/components/Switch/index.js +2 -38
- package/dist/components/TextInput/index.d.ts +2 -1
- package/dist/components/TextInput/index.js +2 -3
- package/dist/components/Tiles/index.d.ts +2 -29
- package/dist/components/Tiles/index.js +3 -33
- package/dist/components/TilesGroup/index.d.ts +2 -26
- package/dist/components/TilesGroup/index.js +3 -30
- package/dist/components/TotalPrice/index.d.ts +0 -6
- package/dist/components/TotalPrice/index.js +0 -6
- package/dist/components/Upload/index.d.ts +2 -1
- package/dist/components/Upload/index.js +7 -8
- package/dist/components/UploadArea/index.d.ts +2 -1
- package/dist/components/UploadArea/index.js +6 -7
- package/dist/components/Wishlist/index.d.ts +1 -4
- package/dist/components/Wishlist/index.js +2 -5
- package/dist/components/Zoom/index.d.ts +1 -18
- package/dist/components/Zoom/index.js +0 -17
- package/dist/components/formComponents.d.ts +12 -0
- package/dist/components/formComponents.js +5 -7
- package/dist/components/message/index.d.ts +0 -9
- package/dist/components/message/index.js +0 -9
- package/dist/connection.js +2 -2
- package/dist/constants.d.ts +0 -49
- package/dist/constants.js +1 -59
- package/dist/hooks/useAttribute/index.js +6 -6
- package/dist/hooks/useConfigurationLoader/index.js +5 -5
- package/dist/hooks/useNestedConfigurator/index.js +2 -2
- package/dist/hooks/useShare/index.js +3 -3
- package/dist/hooks/useSingleAnimation/index.js +20 -25
- package/dist/http/configurations.d.ts +1 -0
- package/dist/http/datatables.js +0 -1
- package/dist/http/files.d.ts +21 -0
- package/dist/http/files.js +26 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.js +2 -0
- package/dist/http/orders.d.ts +6 -8
- package/dist/icons/index.d.ts +0 -41
- package/dist/icons/index.js +0 -42
- package/dist/index.d.ts +42 -3
- package/dist/index.js +84 -30
- package/dist/store/attributes.d.ts +0 -12
- package/dist/store/attributes.js +2 -15
- package/dist/store/price.d.ts +0 -12
- package/dist/store/price.js +2 -16
- package/dist/store/product.d.ts +2 -17
- package/dist/store/product.js +26 -38
- package/dist/store/translations.d.ts +0 -12
- package/dist/store/translations.js +2 -12
- package/dist/store/treble.d.ts +1 -15
- package/dist/store/treble.js +34 -68
- package/dist/store/wishlist.d.ts +0 -12
- package/dist/store/wishlist.js +4 -17
- package/dist/types.d.ts +73 -58
- package/dist/types.js +54 -0
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +8 -16
- package/package.json +20 -4
- package/dist/Treble/Snapshots.js +0 -251
- package/dist/Treble/Wishlist.js +0 -136
|
@@ -42,9 +42,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
exports.fetchAll = exports.fetch = exports.save = void 0;
|
|
43
43
|
var http_1 = __importDefault(require("../http"));
|
|
44
44
|
var save = function (saveConfig) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
-
var assetId, customerId, configuration, metadata, productVersion, attachments, error, fd, attachmentsPrepped_1;
|
|
45
|
+
var assetId, customerId, configuration, metadata, productVersion, attachments, sceneGraphState, error, fd, attachmentsPrepped_1;
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
|
-
assetId = saveConfig.assetId, customerId = saveConfig.customerId, configuration = saveConfig.configuration, metadata = saveConfig.metadata, productVersion = saveConfig.productVersion, attachments = saveConfig.attachments;
|
|
47
|
+
assetId = saveConfig.assetId, customerId = saveConfig.customerId, configuration = saveConfig.configuration, metadata = saveConfig.metadata, productVersion = saveConfig.productVersion, attachments = saveConfig.attachments, sceneGraphState = saveConfig.sceneGraphState;
|
|
48
48
|
if (!assetId)
|
|
49
49
|
error = 'Requires Asset Id';
|
|
50
50
|
if (!configuration)
|
|
@@ -59,6 +59,8 @@ var save = function (saveConfig) { return __awaiter(void 0, void 0, void 0, func
|
|
|
59
59
|
fd.append('metadata', JSON.stringify(metadata));
|
|
60
60
|
if (customerId)
|
|
61
61
|
fd.append('customerId', customerId);
|
|
62
|
+
if (sceneGraphState)
|
|
63
|
+
fd.append('sceneGraphState', sceneGraphState);
|
|
62
64
|
if (attachments && Object.keys(attachments).length) {
|
|
63
65
|
attachmentsPrepped_1 = {};
|
|
64
66
|
Object.entries(attachments).forEach(function (_a) {
|
|
@@ -71,7 +73,7 @@ var save = function (saveConfig) { return __awaiter(void 0, void 0, void 0, func
|
|
|
71
73
|
});
|
|
72
74
|
fd.append('attachments', JSON.stringify(attachmentsPrepped_1));
|
|
73
75
|
}
|
|
74
|
-
return [2
|
|
76
|
+
return [2, http_1.default.configurations.postConfiguration(fd)];
|
|
75
77
|
});
|
|
76
78
|
}); };
|
|
77
79
|
exports.save = save;
|
|
@@ -89,11 +91,11 @@ var fetchAll = function () {
|
|
|
89
91
|
var configurations;
|
|
90
92
|
return __generator(this, function (_a) {
|
|
91
93
|
switch (_a.label) {
|
|
92
|
-
case 0: return [4
|
|
94
|
+
case 0: return [4, http_1.default.configurations.getConfigurations()];
|
|
93
95
|
case 1:
|
|
94
96
|
configurations = _a.sent();
|
|
95
97
|
resolve(configurations.data.configurations);
|
|
96
|
-
return [2
|
|
98
|
+
return [2];
|
|
97
99
|
}
|
|
98
100
|
});
|
|
99
101
|
}); });
|
package/dist/api/datatables.js
CHANGED
|
@@ -51,15 +51,15 @@ var getDatatable = function (datatableId, config) { return __awaiter(void 0, voi
|
|
|
51
51
|
if (!datatableId)
|
|
52
52
|
message = 'Requires a datatable ID';
|
|
53
53
|
if (message)
|
|
54
|
-
return [2
|
|
54
|
+
return [2, Promise.resolve(undefined)];
|
|
55
55
|
format = Object.assign({ format: constants_1.DATATABLE_FORMATS.json }, config).format;
|
|
56
|
-
return [4
|
|
56
|
+
return [4, http_1.default.datatables.getDatatable(datatableId)];
|
|
57
57
|
case 1:
|
|
58
58
|
response = _a.sent();
|
|
59
59
|
if (response.status !== 200)
|
|
60
|
-
return [2
|
|
60
|
+
return [2, Promise.resolve(undefined)];
|
|
61
61
|
if (format.toLowerCase() === constants_1.DATATABLE_FORMATS.csv)
|
|
62
|
-
return [2
|
|
62
|
+
return [2, Promise.resolve(response.data)];
|
|
63
63
|
csvData = response.data
|
|
64
64
|
.replace(/"/g, '')
|
|
65
65
|
.split('\n')
|
|
@@ -81,7 +81,7 @@ var getDatatable = function (datatableId, config) { return __awaiter(void 0, voi
|
|
|
81
81
|
output.push(rowOutput);
|
|
82
82
|
return output;
|
|
83
83
|
}, []);
|
|
84
|
-
return [2
|
|
84
|
+
return [2, Promise.resolve(datatableJson)];
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
}); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const saveFile: (files: BlobPart | Array<BlobPart>) => Promise<import("../http/files").IFileResponse>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.saveFile = void 0;
|
|
43
|
+
var http_1 = __importDefault(require("../http"));
|
|
44
|
+
var connection_1 = __importDefault(require("../connection"));
|
|
45
|
+
var saveFile = function (files) { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var orgId, fd, data;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
orgId = connection_1.default.getConnection().orgId;
|
|
51
|
+
fd = new FormData();
|
|
52
|
+
fd.append('orgId', orgId);
|
|
53
|
+
fd.append("files", new Blob(Array.isArray(files) ? files : [files], {
|
|
54
|
+
type: 'application/json',
|
|
55
|
+
}));
|
|
56
|
+
return [4, http_1.default.files.postFile(fd)];
|
|
57
|
+
case 1:
|
|
58
|
+
data = (_a.sent()).data;
|
|
59
|
+
return [2, data];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); };
|
|
63
|
+
exports.saveFile = saveFile;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as files from './files';
|
|
1
2
|
import * as products from './products';
|
|
2
3
|
import * as configurations from './configurations';
|
|
3
4
|
import * as price from './price';
|
|
@@ -6,6 +7,7 @@ import * as catalog from './catalog';
|
|
|
6
7
|
import * as datatables from './datatables';
|
|
7
8
|
import * as server from './server';
|
|
8
9
|
declare const _default: {
|
|
10
|
+
files: typeof files;
|
|
9
11
|
products: typeof products;
|
|
10
12
|
configurations: typeof configurations;
|
|
11
13
|
price: typeof price;
|
package/dist/api/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var files = __importStar(require("./files"));
|
|
26
27
|
var products = __importStar(require("./products"));
|
|
27
28
|
var configurations = __importStar(require("./configurations"));
|
|
28
29
|
var price = __importStar(require("./price"));
|
|
@@ -31,6 +32,7 @@ var catalog = __importStar(require("./catalog"));
|
|
|
31
32
|
var datatables = __importStar(require("./datatables"));
|
|
32
33
|
var server = __importStar(require("./server"));
|
|
33
34
|
exports.default = {
|
|
35
|
+
files: files,
|
|
34
36
|
products: products,
|
|
35
37
|
configurations: configurations,
|
|
36
38
|
price: price,
|
package/dist/api/orders.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
interface ICreateOrder extends ICart {
|
|
5
|
-
name: string;
|
|
1
|
+
import { ICartItem, STATUSES, IOrderResponse } from '../http/orders';
|
|
2
|
+
export interface ICreateOrder {
|
|
3
|
+
name?: string;
|
|
6
4
|
metadata?: Record<string, string>;
|
|
7
5
|
platform?: Record<string, string>;
|
|
8
6
|
status?: STATUSES;
|
|
7
|
+
cart: Array<ICartItem>;
|
|
9
8
|
}
|
|
10
9
|
export declare const getOrder: (orderId: string) => Promise<IOrderResponse>;
|
|
11
10
|
export declare const fetchOrders: (metadataQuery: Record<string, string>) => Promise<IOrderResponse[]>;
|
|
12
11
|
export declare const createOrder: (order: ICreateOrder) => Promise<IOrderResponse>;
|
|
13
|
-
export declare const editOrder: (orderId: string, data:
|
|
14
|
-
export {};
|
|
12
|
+
export declare const editOrder: (orderId: string, data: Array<ICartItem>) => Promise<IOrderResponse>;
|
package/dist/api/orders.js
CHANGED
|
@@ -44,15 +44,15 @@ var http_1 = __importDefault(require("../http"));
|
|
|
44
44
|
var connection_1 = __importDefault(require("../connection"));
|
|
45
45
|
var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
|
-
return [2
|
|
47
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
48
|
var orders;
|
|
49
49
|
return __generator(this, function (_a) {
|
|
50
50
|
switch (_a.label) {
|
|
51
|
-
case 0: return [4
|
|
51
|
+
case 0: return [4, http_1.default.orders.getOrder(orderId)];
|
|
52
52
|
case 1:
|
|
53
53
|
orders = _a.sent();
|
|
54
54
|
resolve(orders.data);
|
|
55
|
-
return [2
|
|
55
|
+
return [2];
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}); })];
|
|
@@ -61,11 +61,11 @@ var getOrder = function (orderId) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
61
61
|
exports.getOrder = getOrder;
|
|
62
62
|
var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
63
|
return __generator(this, function (_a) {
|
|
64
|
-
return [2
|
|
64
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var orders, output, _a, key_1, value_1;
|
|
66
66
|
return __generator(this, function (_b) {
|
|
67
67
|
switch (_b.label) {
|
|
68
|
-
case 0: return [4
|
|
68
|
+
case 0: return [4, http_1.default.orders.fetchOrders()];
|
|
69
69
|
case 1:
|
|
70
70
|
orders = _b.sent();
|
|
71
71
|
output = orders.data.orders;
|
|
@@ -74,7 +74,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
|
|
|
74
74
|
output = orders.data.orders.filter(function (order) { var _a; return ((_a = order.metadata) === null || _a === void 0 ? void 0 : _a[key_1]) === value_1; });
|
|
75
75
|
}
|
|
76
76
|
resolve(output);
|
|
77
|
-
return [2
|
|
77
|
+
return [2];
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}); })];
|
|
@@ -83,7 +83,7 @@ var fetchOrders = function (metadataQuery) { return __awaiter(void 0, void 0, vo
|
|
|
83
83
|
exports.fetchOrders = fetchOrders;
|
|
84
84
|
var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
85
|
return __generator(this, function (_a) {
|
|
86
|
-
return [2
|
|
86
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
87
|
var orgId, name, cart, metadata, platform, status, data, createOrder;
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
89
|
switch (_a.label) {
|
|
@@ -98,11 +98,11 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
98
98
|
metadata: metadata || {},
|
|
99
99
|
status: status || 'List',
|
|
100
100
|
};
|
|
101
|
-
return [4
|
|
101
|
+
return [4, http_1.default.orders.createOrder(data)];
|
|
102
102
|
case 1:
|
|
103
103
|
createOrder = _a.sent();
|
|
104
104
|
resolve(createOrder.data);
|
|
105
|
-
return [2
|
|
105
|
+
return [2];
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}); })];
|
|
@@ -111,7 +111,7 @@ var createOrder = function (order) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
111
111
|
exports.createOrder = createOrder;
|
|
112
112
|
var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
113
|
return __generator(this, function (_a) {
|
|
114
|
-
return [2
|
|
114
|
+
return [2, new Promise(function (resolve) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
115
|
var cart;
|
|
116
116
|
return __generator(this, function (_a) {
|
|
117
117
|
switch (_a.label) {
|
|
@@ -120,11 +120,11 @@ var editOrder = function (orderId, data) { return __awaiter(void 0, void 0, void
|
|
|
120
120
|
throw new Error('Missing Order ID');
|
|
121
121
|
if (!data)
|
|
122
122
|
throw new Error('Missing New Cart data for Cart Order update.');
|
|
123
|
-
return [4
|
|
123
|
+
return [4, http_1.default.orders.editOrderCart(orderId, data)];
|
|
124
124
|
case 1:
|
|
125
125
|
cart = _a.sent();
|
|
126
126
|
resolve(cart.data);
|
|
127
|
-
return [2
|
|
127
|
+
return [2];
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}); })];
|
package/dist/api/price.js
CHANGED
|
@@ -45,10 +45,10 @@ var getPricebooksList = function () { return __awaiter(void 0, void 0, void 0, f
|
|
|
45
45
|
var response;
|
|
46
46
|
return __generator(this, function (_a) {
|
|
47
47
|
switch (_a.label) {
|
|
48
|
-
case 0: return [4
|
|
48
|
+
case 0: return [4, http_1.default.pricebook.getList()];
|
|
49
49
|
case 1:
|
|
50
50
|
response = _a.sent();
|
|
51
|
-
return [2
|
|
51
|
+
return [2, response.data.pricebooks];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
}); };
|
package/dist/api/products.js
CHANGED
|
@@ -46,7 +46,7 @@ var fetchTranslations = function () {
|
|
|
46
46
|
var translations, csvData, languages, translationMap;
|
|
47
47
|
return __generator(this, function (_a) {
|
|
48
48
|
switch (_a.label) {
|
|
49
|
-
case 0: return [4
|
|
49
|
+
case 0: return [4, http_1.default.products.getTranslations()];
|
|
50
50
|
case 1:
|
|
51
51
|
translations = _a.sent();
|
|
52
52
|
csvData = translations.data
|
|
@@ -68,7 +68,7 @@ var fetchTranslations = function () {
|
|
|
68
68
|
return output;
|
|
69
69
|
}, {});
|
|
70
70
|
resolve(translationMap);
|
|
71
|
-
return [2
|
|
71
|
+
return [2];
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}); });
|
|
@@ -37,12 +37,7 @@ var AccordionItem = function (props) {
|
|
|
37
37
|
react_1.default.createElement("div", null, label),
|
|
38
38
|
react_1.default.createElement("div", null),
|
|
39
39
|
react_1.default.createElement("div", null,
|
|
40
|
-
react_1.default.createElement(CaretDown_1.default
|
|
41
|
-
// style={{
|
|
42
|
-
// transition: `all 0.3s`,
|
|
43
|
-
// transform: selected ? 'rotate(180deg)' : 'rotate(0)',
|
|
44
|
-
// }}
|
|
45
|
-
, null))),
|
|
40
|
+
react_1.default.createElement(CaretDown_1.default, null))),
|
|
46
41
|
react_1.default.createElement("div", null,
|
|
47
42
|
react_1.default.createElement("div", null, children))));
|
|
48
43
|
};
|
|
@@ -8,17 +8,8 @@ interface IAttributeTitle {
|
|
|
8
8
|
export declare const AttributeTitle: {
|
|
9
9
|
(props: IAttributeTitle): JSX.Element | null;
|
|
10
10
|
propTypes: {
|
|
11
|
-
/**
|
|
12
|
-
* The attribute's title/label displayed to the user
|
|
13
|
-
*/
|
|
14
11
|
attribute: PropTypes.Requireable<string>;
|
|
15
|
-
/**
|
|
16
|
-
* An override value to display instead of the attribute title.
|
|
17
|
-
*/
|
|
18
12
|
title: PropTypes.Requireable<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
21
|
-
*/
|
|
22
13
|
className: PropTypes.Requireable<string>;
|
|
23
14
|
};
|
|
24
15
|
defaultProps: {
|
|
@@ -20,17 +20,8 @@ var AttributeTitle = function (props) {
|
|
|
20
20
|
};
|
|
21
21
|
exports.AttributeTitle = AttributeTitle;
|
|
22
22
|
exports.AttributeTitle.propTypes = {
|
|
23
|
-
/**
|
|
24
|
-
* The attribute's title/label displayed to the user
|
|
25
|
-
*/
|
|
26
23
|
attribute: prop_types_1.default.string,
|
|
27
|
-
/**
|
|
28
|
-
* An override value to display instead of the attribute title.
|
|
29
|
-
*/
|
|
30
24
|
title: prop_types_1.default.string,
|
|
31
|
-
/**
|
|
32
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
33
|
-
*/
|
|
34
25
|
className: prop_types_1.default.string,
|
|
35
26
|
};
|
|
36
27
|
exports.AttributeTitle.defaultProps = {
|
|
@@ -7,13 +7,7 @@ interface IAttributeValue {
|
|
|
7
7
|
export declare const AttributeValue: {
|
|
8
8
|
(props: IAttributeValue): JSX.Element | null;
|
|
9
9
|
propTypes: {
|
|
10
|
-
/**
|
|
11
|
-
* The attribute's title/label displayed to the user
|
|
12
|
-
*/
|
|
13
10
|
attribute: PropTypes.Requireable<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
16
|
-
*/
|
|
17
11
|
className: PropTypes.Requireable<string>;
|
|
18
12
|
};
|
|
19
13
|
defaultProps: {
|
|
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
9
9
|
var attributeValue_styles_1 = require("./attributeValue.styles");
|
|
10
10
|
var useAttribute_1 = __importDefault(require("../../hooks/useAttribute"));
|
|
11
|
-
var
|
|
11
|
+
var types_1 = require("../../types");
|
|
12
12
|
var utils_1 = require("../../utils");
|
|
13
13
|
var AttributeValue = function (props) {
|
|
14
14
|
var _a, _b;
|
|
@@ -17,7 +17,7 @@ var AttributeValue = function (props) {
|
|
|
17
17
|
if (!attributeData)
|
|
18
18
|
return null;
|
|
19
19
|
var value;
|
|
20
|
-
if (attributeData.type ===
|
|
20
|
+
if (attributeData.type === types_1.ATTRIBUTE_TYPES.ASSET) {
|
|
21
21
|
var assetAttribute_1 = attributeData;
|
|
22
22
|
if (!((_a = assetAttribute_1.value) === null || _a === void 0 ? void 0 : _a.assetId))
|
|
23
23
|
return null;
|
|
@@ -32,13 +32,7 @@ var AttributeValue = function (props) {
|
|
|
32
32
|
};
|
|
33
33
|
exports.AttributeValue = AttributeValue;
|
|
34
34
|
exports.AttributeValue.propTypes = {
|
|
35
|
-
/**
|
|
36
|
-
* The attribute's title/label displayed to the user
|
|
37
|
-
*/
|
|
38
35
|
attribute: prop_types_1.default.string,
|
|
39
|
-
/**
|
|
40
|
-
* Custom classNames applied to the HTML Element to apply custom CSS styling.
|
|
41
|
-
*/
|
|
42
36
|
className: prop_types_1.default.string,
|
|
43
37
|
};
|
|
44
38
|
exports.AttributeValue.defaultProps = {
|
|
@@ -25,39 +25,12 @@ export declare const SHAPES: {
|
|
|
25
25
|
export declare const Button: {
|
|
26
26
|
(props: IButton): JSX.Element | null;
|
|
27
27
|
propTypes: {
|
|
28
|
-
/**
|
|
29
|
-
* Used to add a title to the input
|
|
30
|
-
*/
|
|
31
28
|
title: PropTypes.Requireable<string>;
|
|
32
|
-
/**
|
|
33
|
-
* Threekit Icon to use as the prefix to the button title
|
|
34
|
-
*/
|
|
35
29
|
icon: PropTypes.Requireable<string>;
|
|
36
|
-
/**
|
|
37
|
-
* The presentational type of the input component. Options
|
|
38
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
39
|
-
*/
|
|
40
30
|
type: PropTypes.Requireable<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Used to set the shape of the Button component. Options
|
|
43
|
-
* include: `square`, `round`
|
|
44
|
-
*/
|
|
45
31
|
shape: PropTypes.Requireable<string>;
|
|
46
|
-
/**
|
|
47
|
-
* NOTE: Input wide hide disabled will be deprecated in favour of option
|
|
48
|
-
* specific control of both 'disabled' and 'visible'.
|
|
49
|
-
*
|
|
50
|
-
* Used to hide the options that have the 'disabled' equal to true.
|
|
51
|
-
*/
|
|
52
32
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
-
/**
|
|
54
|
-
* Allows the Button's width to be set to 100%.
|
|
55
|
-
*/
|
|
56
33
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* Used to add a custom class name to each of the components html elements
|
|
60
|
-
*/
|
|
61
34
|
className: PropTypes.Requireable<string>;
|
|
62
35
|
};
|
|
63
36
|
defaultProps: {
|
|
@@ -39,39 +39,12 @@ var Button = function (props) {
|
|
|
39
39
|
};
|
|
40
40
|
exports.Button = Button;
|
|
41
41
|
exports.Button.propTypes = {
|
|
42
|
-
/**
|
|
43
|
-
* Used to add a title to the input
|
|
44
|
-
*/
|
|
45
42
|
title: prop_types_1.default.string,
|
|
46
|
-
/**
|
|
47
|
-
* Threekit Icon to use as the prefix to the button title
|
|
48
|
-
*/
|
|
49
43
|
icon: prop_types_1.default.string,
|
|
50
|
-
/**
|
|
51
|
-
* The presentational type of the input component. Options
|
|
52
|
-
* include: `hollow`, `standard`, `accent`, `primary`
|
|
53
|
-
*/
|
|
54
44
|
type: prop_types_1.default.string,
|
|
55
|
-
/**
|
|
56
|
-
* Used to set the shape of the Button component. Options
|
|
57
|
-
* include: `square`, `round`
|
|
58
|
-
*/
|
|
59
45
|
shape: prop_types_1.default.string,
|
|
60
|
-
/**
|
|
61
|
-
* NOTE: Input wide hide disabled will be deprecated in favour of option
|
|
62
|
-
* specific control of both 'disabled' and 'visible'.
|
|
63
|
-
*
|
|
64
|
-
* Used to hide the options that have the 'disabled' equal to true.
|
|
65
|
-
*/
|
|
66
46
|
onClick: prop_types_1.default.func,
|
|
67
|
-
/**
|
|
68
|
-
* Allows the Button's width to be set to 100%.
|
|
69
|
-
*/
|
|
70
47
|
fullWidth: prop_types_1.default.bool,
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* Used to add a custom class name to each of the components html elements
|
|
74
|
-
*/
|
|
75
48
|
className: prop_types_1.default.string,
|
|
76
49
|
};
|
|
77
50
|
exports.Button.defaultProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ATTRIBUTE_TYPES } from '../../types';
|
|
3
4
|
import { IFormComponentProps, IOption } from '../containers/formInputContainer';
|
|
4
5
|
export interface ICards extends IFormComponentProps<IOption> {
|
|
5
6
|
showThumbnail?: boolean;
|
|
@@ -9,33 +10,11 @@ export interface ICards extends IFormComponentProps<IOption> {
|
|
|
9
10
|
export declare const Cards: {
|
|
10
11
|
(props: ICards): JSX.Element;
|
|
11
12
|
propTypes: {
|
|
12
|
-
/**
|
|
13
|
-
* Is the attribute name on the initialized asset that we are
|
|
14
|
-
* using this component for. If the attribute prop is used,
|
|
15
|
-
* the component will ignore the props for: `value`, `options`, `onClick`.
|
|
16
|
-
*/
|
|
17
13
|
attribute: PropTypes.Requireable<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Used to add a title to the input
|
|
20
|
-
*/
|
|
21
14
|
title: PropTypes.Requireable<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Used to provide a custom description for the input component
|
|
24
|
-
*/
|
|
25
15
|
description: PropTypes.Requireable<string>;
|
|
26
|
-
/**
|
|
27
|
-
* Selected value from the option set. Should match the 'value' property
|
|
28
|
-
* of one of the items in the options array.
|
|
29
|
-
*/
|
|
30
16
|
value: PropTypes.Requireable<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Handles the user seletion by passing the value of the selected
|
|
33
|
-
* option as the argument into the onClick callback.
|
|
34
|
-
*/
|
|
35
17
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
-
/**
|
|
37
|
-
* The options set to be displayed for the user
|
|
38
|
-
*/
|
|
39
18
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
40
19
|
name: PropTypes.Requireable<string>;
|
|
41
20
|
description: PropTypes.Requireable<string>;
|
|
@@ -45,44 +24,12 @@ export declare const Cards: {
|
|
|
45
24
|
color: PropTypes.Requireable<string>;
|
|
46
25
|
disabled: PropTypes.Requireable<boolean>;
|
|
47
26
|
}> | null | undefined)[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Used to add a custom class name to each of the components html elements
|
|
50
|
-
*/
|
|
51
27
|
className: PropTypes.Requireable<string>;
|
|
52
|
-
/**
|
|
53
|
-
* By default the thumbnail (image/color value) is soruced from the `_thumbnail`
|
|
54
|
-
* metadata key in the option's Catalog Item. This metadata key can be overwritten
|
|
55
|
-
* by passing in the prefered key value to the **thumbnailFromMetadata** prop.
|
|
56
|
-
*/
|
|
57
28
|
metadataKeyThumbnail: PropTypes.Requireable<string>;
|
|
58
|
-
/**
|
|
59
|
-
* By default the description is soruced from the `_description` metadata
|
|
60
|
-
* key in the option's Catalog Item. This metadata key can be overwritten
|
|
61
|
-
* by passing in the prefered key value to the **metadataKeyDescription**
|
|
62
|
-
* prop.
|
|
63
|
-
*/
|
|
64
29
|
metadataKeyDescription: PropTypes.Requireable<string>;
|
|
65
|
-
/**
|
|
66
|
-
* By default the price of an item is soruced from the pricebook entry for
|
|
67
|
-
* the option's Catalog Item. The price can alternatively be soruced from
|
|
68
|
-
* the option's Catalog Item metadata, by specifying the key under which the
|
|
69
|
-
* price can be found as the **metadataKeyPrice** prop.
|
|
70
|
-
*/
|
|
71
30
|
metadataKeyPrice: PropTypes.Requireable<string>;
|
|
72
|
-
/**
|
|
73
|
-
* A boolean to set whether or all the Cards should display thumbnails
|
|
74
|
-
* for the options.
|
|
75
|
-
*/
|
|
76
31
|
showThumbnail: PropTypes.Requireable<boolean>;
|
|
77
|
-
/**
|
|
78
|
-
* A boolean to set whether or all the Cards should display the description
|
|
79
|
-
* for the options.
|
|
80
|
-
*/
|
|
81
32
|
showDescription: PropTypes.Requireable<boolean>;
|
|
82
|
-
/**
|
|
83
|
-
* A boolean to set whether or all the Cards should display the price
|
|
84
|
-
* for the options/
|
|
85
|
-
*/
|
|
86
33
|
showPrice: PropTypes.Requireable<boolean>;
|
|
87
34
|
};
|
|
88
35
|
defaultProps: {
|
|
@@ -101,7 +48,7 @@ export declare const Cards: {
|
|
|
101
48
|
onClick: undefined;
|
|
102
49
|
};
|
|
103
50
|
componentName: string;
|
|
104
|
-
compatibleAttributes: Set<
|
|
51
|
+
compatibleAttributes: Set<ATTRIBUTE_TYPES>;
|
|
105
52
|
};
|
|
106
53
|
declare const _default: (props: ICards) => JSX.Element | null;
|
|
107
54
|
export default _default;
|