@merchi/sdk 1.42.11 → 1.42.12
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.
|
@@ -14,4 +14,5 @@ export var FieldType;
|
|
|
14
14
|
FieldType[FieldType["TURNAROUND_TIME"] = 12] = "TURNAROUND_TIME";
|
|
15
15
|
FieldType[FieldType["COLOUR_EXTRACT"] = 13] = "COLOUR_EXTRACT";
|
|
16
16
|
FieldType[FieldType["AREA"] = 14] = "AREA";
|
|
17
|
+
FieldType[FieldType["PANTONE_COLOUR_SELECT"] = 15] = "PANTONE_COLOUR_SELECT";
|
|
17
18
|
})(FieldType || (FieldType = {}));
|
|
@@ -47,6 +47,9 @@ var VariationField = /** @class */ (function (_super) {
|
|
|
47
47
|
if (_this.fieldType === undefined) {
|
|
48
48
|
throw new Error('fieldType is undefined, did you forget to embed it?');
|
|
49
49
|
}
|
|
50
|
+
if (_this.fieldType === FieldType.PANTONE_COLOUR_SELECT) {
|
|
51
|
+
return !_this.allowAllPantones;
|
|
52
|
+
}
|
|
50
53
|
var selectable = new Set([FieldType.SELECT,
|
|
51
54
|
FieldType.CHECKBOX,
|
|
52
55
|
FieldType.RADIO,
|
|
@@ -74,6 +77,11 @@ var VariationField = /** @class */ (function (_super) {
|
|
|
74
77
|
result.onceOffCost = 0;
|
|
75
78
|
result.variationFiles = [];
|
|
76
79
|
}
|
|
80
|
+
else if (_this.fieldType === FieldType.PANTONE_COLOUR_SELECT &&
|
|
81
|
+
_this.allowAllPantones) {
|
|
82
|
+
result.value = _this.defaultValue;
|
|
83
|
+
result.onceOffCost = _this.variationCost;
|
|
84
|
+
}
|
|
77
85
|
else if (_this.fieldType === FieldType.AREA) {
|
|
78
86
|
result.value = _this.defaultValue;
|
|
79
87
|
result.onceOffCost = 0;
|
|
@@ -213,6 +221,10 @@ var VariationField = /** @class */ (function (_super) {
|
|
|
213
221
|
VariationField.property(),
|
|
214
222
|
__metadata("design:type", Boolean)
|
|
215
223
|
], VariationField.prototype, "allowDecimal", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
VariationField.property(),
|
|
226
|
+
__metadata("design:type", Boolean)
|
|
227
|
+
], VariationField.prototype, "allowAllPantones", void 0);
|
|
216
228
|
__decorate([
|
|
217
229
|
VariationField.property(),
|
|
218
230
|
__metadata("design:type", Boolean)
|
package/package.json
CHANGED
|
@@ -80,6 +80,9 @@ export class VariationField extends Entity {
|
|
|
80
80
|
@VariationField.property()
|
|
81
81
|
public allowDecimal?: boolean;
|
|
82
82
|
|
|
83
|
+
@VariationField.property()
|
|
84
|
+
public allowAllPantones?: boolean;
|
|
85
|
+
|
|
83
86
|
@VariationField.property()
|
|
84
87
|
public isHtml?: boolean;
|
|
85
88
|
|
|
@@ -207,6 +210,9 @@ export class VariationField extends Entity {
|
|
|
207
210
|
if (this.fieldType === undefined) {
|
|
208
211
|
throw new Error('fieldType is undefined, did you forget to embed it?');
|
|
209
212
|
}
|
|
213
|
+
if (this.fieldType === FieldType.PANTONE_COLOUR_SELECT) {
|
|
214
|
+
return !this.allowAllPantones;
|
|
215
|
+
}
|
|
210
216
|
const selectable = new Set([FieldType.SELECT,
|
|
211
217
|
FieldType.CHECKBOX,
|
|
212
218
|
FieldType.RADIO,
|
|
@@ -233,6 +239,12 @@ export class VariationField extends Entity {
|
|
|
233
239
|
result.value = this.defaultValue;
|
|
234
240
|
result.onceOffCost = 0;
|
|
235
241
|
result.variationFiles = [];
|
|
242
|
+
} else if (
|
|
243
|
+
this.fieldType === FieldType.PANTONE_COLOUR_SELECT &&
|
|
244
|
+
this.allowAllPantones
|
|
245
|
+
) {
|
|
246
|
+
result.value = this.defaultValue;
|
|
247
|
+
result.onceOffCost = this.variationCost;
|
|
236
248
|
} else if (this.fieldType === FieldType.AREA) {
|
|
237
249
|
result.value = this.defaultValue;
|
|
238
250
|
result.onceOffCost = 0;
|