@yoobic/yobi 8.7.1 → 8.7.3
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/cjs/yoo-form-catalog.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-number-picker.cjs.entry.js +9 -17
- package/dist/cjs/yoo-photo-editor.cjs.entry.js +1 -1
- package/dist/collection/components/3.organisms/photo-editor/photo-editor.js +2 -2
- package/dist/collection/components/form/form-catalog/form-catalog.js +1 -1
- package/dist/collection/components/form/form-number-picker/form-number-picker.js +10 -16
- package/dist/design-system/yoo-form-catalog.entry.js +1 -1
- package/dist/design-system/yoo-form-number-picker.entry.js +9 -17
- package/dist/design-system/yoo-photo-editor.entry.js +2 -2
- package/dist/esm/yoo-form-catalog.entry.js +1 -1
- package/dist/esm/yoo-form-number-picker.entry.js +9 -17
- package/dist/esm/yoo-photo-editor.entry.js +2 -2
- package/dist/types/components/form/form-number-picker/form-number-picker.d.ts +1 -1
- package/package.json +1 -1
@@ -319,7 +319,7 @@ const YooFormCatalogComponent = class {
|
|
319
319
|
const price = product.price * quantity;
|
320
320
|
return [
|
321
321
|
index.h("div", { class: "entity" }, index.h("yoo-entity", { onClick: () => this.onOpenCatalogDialog(product), class: "catalog-display no-border", isHistory: this.isHistory, displayType: "card-list", entityType: "products", item: product }), !readonly && (index.h("div", { class: "remove", onClick: () => this.clearProduct(product) }, index.h("yoo-icon", { name: "cross" })))),
|
322
|
-
!this.isPresence && (index.h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, index.h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? index$1.translate('QUANTITYABBREVATION') : index$1.translate('QUANTITY'), ": "), readonly ? (quantity) : (index.h("yoo-form-number-picker", { key: ref, min: 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
322
|
+
!this.isPresence && (index.h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, index.h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? index$1.translate('QUANTITYABBREVATION') : index$1.translate('QUANTITY'), ": "), readonly ? (quantity) : (index.h("yoo-form-number-picker", { key: ref, min: product.step || 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
323
323
|
ev.stopPropagation();
|
324
324
|
if (lodash.isNumber(ev.detail)) {
|
325
325
|
this.setProduct(product, ev.detail);
|
@@ -34,6 +34,7 @@ const YooFormNumberPickerComponent = class {
|
|
34
34
|
this.forceShowValidation = false;
|
35
35
|
}
|
36
36
|
onValueChanged() {
|
37
|
+
this.value && this.stepAmount && !this.min && (this.min = this.value);
|
37
38
|
this.inputChanged.emit(this.value);
|
38
39
|
this.updateValidity();
|
39
40
|
}
|
@@ -43,6 +44,9 @@ const YooFormNumberPickerComponent = class {
|
|
43
44
|
onMaxUpdated() {
|
44
45
|
this.updateValidity();
|
45
46
|
}
|
47
|
+
onUseButtonsUpdated() {
|
48
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
49
|
+
}
|
46
50
|
async setValue(value) {
|
47
51
|
this.value = value;
|
48
52
|
this.selection = value;
|
@@ -62,9 +66,8 @@ const YooFormNumberPickerComponent = class {
|
|
62
66
|
}
|
63
67
|
}
|
64
68
|
componentWillLoad() {
|
65
|
-
(lodash.isFinite(this.stepAmount) && this.stepAmount > 0) && this.updateMinMaxWithStep();
|
66
69
|
this.value && this.setValue(this.value);
|
67
|
-
!this.value && this.useButtons && (this.value = this.min);
|
70
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
68
71
|
}
|
69
72
|
componentDidLoad() {
|
70
73
|
this.setCaretColor();
|
@@ -72,18 +75,6 @@ const YooFormNumberPickerComponent = class {
|
|
72
75
|
get isSecondary() {
|
73
76
|
return this.type === 'secondary';
|
74
77
|
}
|
75
|
-
updateMinMaxWithStep() {
|
76
|
-
const step = this.stepAmount || 1;
|
77
|
-
for (const bound of ['min', 'max']) {
|
78
|
-
if ((!lodash.isFinite(this[bound]) || this[bound] < step) && bound === 'min') {
|
79
|
-
this[bound] = step;
|
80
|
-
}
|
81
|
-
else if (this[bound] % step !== 0) {
|
82
|
-
const diff = this[bound] % step;
|
83
|
-
this[bound] += (diff / step) >= 0.5 ? step - diff : diff * -1;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
}
|
87
78
|
setCaretColor() {
|
88
79
|
if (this.formInputElement && !this.disabled) {
|
89
80
|
const caretColor = this.isSecondary ? 'dark' : 'light';
|
@@ -113,7 +104,7 @@ const YooFormNumberPickerComponent = class {
|
|
113
104
|
validity = this.value <= this.max;
|
114
105
|
}
|
115
106
|
if (validity && lodash.isFinite(this.stepAmount)) {
|
116
|
-
validity = !(this.value % this.stepAmount);
|
107
|
+
validity = !((this.value - (this.min || 0)) % this.stepAmount);
|
117
108
|
}
|
118
109
|
if (this.validity !== validity) {
|
119
110
|
this.validity = validity;
|
@@ -147,6 +138,7 @@ const YooFormNumberPickerComponent = class {
|
|
147
138
|
if (ret && !ret.overlayDismiss) {
|
148
139
|
this.setValue(ret.data);
|
149
140
|
}
|
141
|
+
this.updateValidity();
|
150
142
|
this.dialog = null;
|
151
143
|
});
|
152
144
|
}
|
@@ -157,7 +149,6 @@ const YooFormNumberPickerComponent = class {
|
|
157
149
|
onInputFocused(ev) {
|
158
150
|
ev.stopPropagation();
|
159
151
|
ev.preventDefault();
|
160
|
-
this.updateValidity();
|
161
152
|
this.showContainerDialog();
|
162
153
|
}
|
163
154
|
onInputBlurred() {
|
@@ -218,7 +209,8 @@ const YooFormNumberPickerComponent = class {
|
|
218
209
|
static get watchers() { return {
|
219
210
|
"value": ["onValueChanged"],
|
220
211
|
"min": ["onMinUpdated"],
|
221
|
-
"max": ["onMaxUpdated"]
|
212
|
+
"max": ["onMaxUpdated"],
|
213
|
+
"useButtons": ["onUseButtonsUpdated"]
|
222
214
|
}; }
|
223
215
|
};
|
224
216
|
YooFormNumberPickerComponent.style = formNumberPickerCss;
|
@@ -15,7 +15,7 @@
|
|
15
15
|
* https://zpl.io/25yLEEj
|
16
16
|
*/
|
17
17
|
import { ScreenOrientation } from '@awesome-cordova-plugins/screen-orientation';
|
18
|
-
import { cleanupWKWebViewFilePath, closeModal, Draggable, enableKeyboardResize, getAsyncExtraData, getContrastColor, getCssColor, getImageScaleFactor, getImageSize, getMaxViewPortImage, getResizedImageSize, gsapFrom, gsapSet, gsapTo, isBase64, isIOS, isOffline, isWeb, scaleUpAnimation, setStatusBarDarkMode, showActionSheet, showAlert, showContextMenu, translate } from '@shared/utils';
|
18
|
+
import { cleanupWKWebViewFilePath, closeModal, Draggable, enableKeyboardResize, getAsyncExtraData, getContrastColor, getCssColor, getImageScaleFactor, getImageSize, getMaxViewPortImage, getResizedImageSize, gsapFrom, gsapSet, gsapTo, isBase64, isIOS, isIpad, isOffline, isWeb, scaleUpAnimation, setStatusBarDarkMode, showActionSheet, showAlert, showContextMenu, translate } from '@shared/utils';
|
19
19
|
import { forceUpdate, h, Host } from '@stencil/core';
|
20
20
|
import { createBaseAnnotation, getElement, isAnnotationDeleted, isAnnotationEmpty, isAnnotationFocused, isAnnotationValid, isElementInsideContainer } from '@yobi/utils/helpers/annotations-helpers';
|
21
21
|
import { cloudinary, getAppContext, getPointerCoordinates, getTransformInfos } from '@yobi/utils/helpers/common-helpers';
|
@@ -345,7 +345,7 @@ export class YooPhotoEditorComponent {
|
|
345
345
|
};
|
346
346
|
}
|
347
347
|
get maxImageSize() {
|
348
|
-
const COEFF_RESIZE = 3;
|
348
|
+
const COEFF_RESIZE = isIpad() ? 2 : 3;
|
349
349
|
const { width, height } = this.maxViewport;
|
350
350
|
return {
|
351
351
|
width: COEFF_RESIZE * width,
|
@@ -299,7 +299,7 @@ export class YooFormCatalogComponent {
|
|
299
299
|
const price = product.price * quantity;
|
300
300
|
return [
|
301
301
|
h("div", { class: "entity" }, h("yoo-entity", { onClick: () => this.onOpenCatalogDialog(product), class: "catalog-display no-border", isHistory: this.isHistory, displayType: "card-list", entityType: "products", item: product }), !readonly && (h("div", { class: "remove", onClick: () => this.clearProduct(product) }, h("yoo-icon", { name: "cross" })))),
|
302
|
-
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
302
|
+
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: product.step || 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
303
303
|
ev.stopPropagation();
|
304
304
|
if (isNumber(ev.detail)) {
|
305
305
|
this.setProduct(product, ev.detail);
|
@@ -21,6 +21,7 @@ export class YooFormNumberPickerComponent {
|
|
21
21
|
this.forceShowValidation = false;
|
22
22
|
}
|
23
23
|
onValueChanged() {
|
24
|
+
this.value && this.stepAmount && !this.min && (this.min = this.value);
|
24
25
|
this.inputChanged.emit(this.value);
|
25
26
|
this.updateValidity();
|
26
27
|
}
|
@@ -30,6 +31,9 @@ export class YooFormNumberPickerComponent {
|
|
30
31
|
onMaxUpdated() {
|
31
32
|
this.updateValidity();
|
32
33
|
}
|
34
|
+
onUseButtonsUpdated() {
|
35
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
36
|
+
}
|
33
37
|
async setValue(value) {
|
34
38
|
this.value = value;
|
35
39
|
this.selection = value;
|
@@ -49,9 +53,8 @@ export class YooFormNumberPickerComponent {
|
|
49
53
|
}
|
50
54
|
}
|
51
55
|
componentWillLoad() {
|
52
|
-
(isFinite(this.stepAmount) && this.stepAmount > 0) && this.updateMinMaxWithStep();
|
53
56
|
this.value && this.setValue(this.value);
|
54
|
-
!this.value && this.useButtons && (this.value = this.min);
|
57
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
55
58
|
}
|
56
59
|
componentDidLoad() {
|
57
60
|
this.setCaretColor();
|
@@ -59,18 +62,6 @@ export class YooFormNumberPickerComponent {
|
|
59
62
|
get isSecondary() {
|
60
63
|
return this.type === 'secondary';
|
61
64
|
}
|
62
|
-
updateMinMaxWithStep() {
|
63
|
-
const step = this.stepAmount || 1;
|
64
|
-
for (const bound of ['min', 'max']) {
|
65
|
-
if ((!isFinite(this[bound]) || this[bound] < step) && bound === 'min') {
|
66
|
-
this[bound] = step;
|
67
|
-
}
|
68
|
-
else if (this[bound] % step !== 0) {
|
69
|
-
const diff = this[bound] % step;
|
70
|
-
this[bound] += (diff / step) >= 0.5 ? step - diff : diff * -1;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
65
|
setCaretColor() {
|
75
66
|
if (this.formInputElement && !this.disabled) {
|
76
67
|
const caretColor = this.isSecondary ? 'dark' : 'light';
|
@@ -100,7 +91,7 @@ export class YooFormNumberPickerComponent {
|
|
100
91
|
validity = this.value <= this.max;
|
101
92
|
}
|
102
93
|
if (validity && isFinite(this.stepAmount)) {
|
103
|
-
validity = !(this.value % this.stepAmount);
|
94
|
+
validity = !((this.value - (this.min || 0)) % this.stepAmount);
|
104
95
|
}
|
105
96
|
if (this.validity !== validity) {
|
106
97
|
this.validity = validity;
|
@@ -134,6 +125,7 @@ export class YooFormNumberPickerComponent {
|
|
134
125
|
if (ret && !ret.overlayDismiss) {
|
135
126
|
this.setValue(ret.data);
|
136
127
|
}
|
128
|
+
this.updateValidity();
|
137
129
|
this.dialog = null;
|
138
130
|
});
|
139
131
|
}
|
@@ -144,7 +136,6 @@ export class YooFormNumberPickerComponent {
|
|
144
136
|
onInputFocused(ev) {
|
145
137
|
ev.stopPropagation();
|
146
138
|
ev.preventDefault();
|
147
|
-
this.updateValidity();
|
148
139
|
this.showContainerDialog();
|
149
140
|
}
|
150
141
|
onInputBlurred() {
|
@@ -553,6 +544,9 @@ export class YooFormNumberPickerComponent {
|
|
553
544
|
}, {
|
554
545
|
"propName": "max",
|
555
546
|
"methodName": "onMaxUpdated"
|
547
|
+
}, {
|
548
|
+
"propName": "useButtons",
|
549
|
+
"methodName": "onUseButtonsUpdated"
|
556
550
|
}];
|
557
551
|
}
|
558
552
|
}
|
@@ -315,7 +315,7 @@ const YooFormCatalogComponent = class {
|
|
315
315
|
const price = product.price * quantity;
|
316
316
|
return [
|
317
317
|
h("div", { class: "entity" }, h("yoo-entity", { onClick: () => this.onOpenCatalogDialog(product), class: "catalog-display no-border", isHistory: this.isHistory, displayType: "card-list", entityType: "products", item: product }), !readonly && (h("div", { class: "remove", onClick: () => this.clearProduct(product) }, h("yoo-icon", { name: "cross" })))),
|
318
|
-
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
318
|
+
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: product.step || 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
319
319
|
ev.stopPropagation();
|
320
320
|
if (isNumber(ev.detail)) {
|
321
321
|
this.setProduct(product, ev.detail);
|
@@ -30,6 +30,7 @@ const YooFormNumberPickerComponent = class {
|
|
30
30
|
this.forceShowValidation = false;
|
31
31
|
}
|
32
32
|
onValueChanged() {
|
33
|
+
this.value && this.stepAmount && !this.min && (this.min = this.value);
|
33
34
|
this.inputChanged.emit(this.value);
|
34
35
|
this.updateValidity();
|
35
36
|
}
|
@@ -39,6 +40,9 @@ const YooFormNumberPickerComponent = class {
|
|
39
40
|
onMaxUpdated() {
|
40
41
|
this.updateValidity();
|
41
42
|
}
|
43
|
+
onUseButtonsUpdated() {
|
44
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
45
|
+
}
|
42
46
|
async setValue(value) {
|
43
47
|
this.value = value;
|
44
48
|
this.selection = value;
|
@@ -58,9 +62,8 @@ const YooFormNumberPickerComponent = class {
|
|
58
62
|
}
|
59
63
|
}
|
60
64
|
componentWillLoad() {
|
61
|
-
(isFinite(this.stepAmount) && this.stepAmount > 0) && this.updateMinMaxWithStep();
|
62
65
|
this.value && this.setValue(this.value);
|
63
|
-
!this.value && this.useButtons && (this.value = this.min);
|
66
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
64
67
|
}
|
65
68
|
componentDidLoad() {
|
66
69
|
this.setCaretColor();
|
@@ -68,18 +71,6 @@ const YooFormNumberPickerComponent = class {
|
|
68
71
|
get isSecondary() {
|
69
72
|
return this.type === 'secondary';
|
70
73
|
}
|
71
|
-
updateMinMaxWithStep() {
|
72
|
-
const step = this.stepAmount || 1;
|
73
|
-
for (const bound of ['min', 'max']) {
|
74
|
-
if ((!isFinite(this[bound]) || this[bound] < step) && bound === 'min') {
|
75
|
-
this[bound] = step;
|
76
|
-
}
|
77
|
-
else if (this[bound] % step !== 0) {
|
78
|
-
const diff = this[bound] % step;
|
79
|
-
this[bound] += (diff / step) >= 0.5 ? step - diff : diff * -1;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
}
|
83
74
|
setCaretColor() {
|
84
75
|
if (this.formInputElement && !this.disabled) {
|
85
76
|
const caretColor = this.isSecondary ? 'dark' : 'light';
|
@@ -109,7 +100,7 @@ const YooFormNumberPickerComponent = class {
|
|
109
100
|
validity = this.value <= this.max;
|
110
101
|
}
|
111
102
|
if (validity && isFinite(this.stepAmount)) {
|
112
|
-
validity = !(this.value % this.stepAmount);
|
103
|
+
validity = !((this.value - (this.min || 0)) % this.stepAmount);
|
113
104
|
}
|
114
105
|
if (this.validity !== validity) {
|
115
106
|
this.validity = validity;
|
@@ -143,6 +134,7 @@ const YooFormNumberPickerComponent = class {
|
|
143
134
|
if (ret && !ret.overlayDismiss) {
|
144
135
|
this.setValue(ret.data);
|
145
136
|
}
|
137
|
+
this.updateValidity();
|
146
138
|
this.dialog = null;
|
147
139
|
});
|
148
140
|
}
|
@@ -153,7 +145,6 @@ const YooFormNumberPickerComponent = class {
|
|
153
145
|
onInputFocused(ev) {
|
154
146
|
ev.stopPropagation();
|
155
147
|
ev.preventDefault();
|
156
|
-
this.updateValidity();
|
157
148
|
this.showContainerDialog();
|
158
149
|
}
|
159
150
|
onInputBlurred() {
|
@@ -214,7 +205,8 @@ const YooFormNumberPickerComponent = class {
|
|
214
205
|
static get watchers() { return {
|
215
206
|
"value": ["onValueChanged"],
|
216
207
|
"min": ["onMinUpdated"],
|
217
|
-
"max": ["onMaxUpdated"]
|
208
|
+
"max": ["onMaxUpdated"],
|
209
|
+
"useButtons": ["onUseButtonsUpdated"]
|
218
210
|
}; }
|
219
211
|
};
|
220
212
|
YooFormNumberPickerComponent.style = formNumberPickerCss;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { h, r as registerInstance, i as createEvent, f as forceUpdate, e as Host, g as getElement$1 } from './index-23b437f1.js';
|
2
|
-
import { eO as getContrastColorName, P as getCssColor, t as translate, cn as isBase64, fJ as getMaxViewPortImage, w as closeModal, cK as setStatusBarDarkMode, D as cleanupWKWebViewFilePath, H as isWeb, fK as getImageSize, bF as getResizedImageSize, fL as getImageScaleFactor, S as ScreenOrientation, bG as isOffline, V as getAsyncExtraData, at as showAlert, bc as Draggable, ba as gsapTo, c_ as gsapFrom, M as isIOS, ap as enableKeyboardResize, bI as scaleUpAnimation, b9 as gsapSet, bf as getContrastColor, aR as showContextMenu, cp as showActionSheet } from './index-4680b731.js';
|
2
|
+
import { eO as getContrastColorName, P as getCssColor, t as translate, cn as isBase64, fJ as getMaxViewPortImage, o as isIpad, w as closeModal, cK as setStatusBarDarkMode, D as cleanupWKWebViewFilePath, H as isWeb, fK as getImageSize, bF as getResizedImageSize, fL as getImageScaleFactor, S as ScreenOrientation, bG as isOffline, V as getAsyncExtraData, at as showAlert, bc as Draggable, ba as gsapTo, c_ as gsapFrom, M as isIOS, ap as enableKeyboardResize, bI as scaleUpAnimation, b9 as gsapSet, bf as getContrastColor, aR as showContextMenu, cp as showActionSheet } from './index-4680b731.js';
|
3
3
|
import './index-4db360f2.js';
|
4
4
|
import { b as isAnnotationValid, a as getPercentPositionStyle, e as isAnnotationDeleted, c as getElement, m as isAnnotationFocused, i as isAnnotationEmpty, f as createBaseAnnotation, d as isElementInsideContainer } from './annotations-helpers-2f9599f4.js';
|
5
5
|
import { e as getTransformInfos, f as getPointerCoordinates, y as cloudinary, g as getAppContext } from './common-helpers-57151af2.js';
|
@@ -473,7 +473,7 @@ const YooPhotoEditorComponent = class {
|
|
473
473
|
};
|
474
474
|
}
|
475
475
|
get maxImageSize() {
|
476
|
-
const COEFF_RESIZE = 3;
|
476
|
+
const COEFF_RESIZE = isIpad() ? 2 : 3;
|
477
477
|
const { width, height } = this.maxViewport;
|
478
478
|
return {
|
479
479
|
width: COEFF_RESIZE * width,
|
@@ -315,7 +315,7 @@ const YooFormCatalogComponent = class {
|
|
315
315
|
const price = product.price * quantity;
|
316
316
|
return [
|
317
317
|
h("div", { class: "entity" }, h("yoo-entity", { onClick: () => this.onOpenCatalogDialog(product), class: "catalog-display no-border", isHistory: this.isHistory, displayType: "card-list", entityType: "products", item: product }), !readonly && (h("div", { class: "remove", onClick: () => this.clearProduct(product) }, h("yoo-icon", { name: "cross" })))),
|
318
|
-
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
318
|
+
!this.isPresence && (h("div", { class: { toolbar: true, history: this.isHistory, wrap: ((_a = this.host) === null || _a === void 0 ? void 0 : _a.offsetWidth) < 305 && !readonly } }, h("div", { class: "title" }, ((_b = this.host) === null || _b === void 0 ? void 0 : _b.offsetWidth) < 350 && ((_c = this.host) === null || _c === void 0 ? void 0 : _c.offsetWidth) > 305 && !readonly ? translate('QUANTITYABBREVATION') : translate('QUANTITY'), ": "), readonly ? (quantity) : (h("yoo-form-number-picker", { key: ref, min: product.step || 1, stepAmount: product.step, value: quantity, required: true, clearable: false, useButtons: true, invalidMessage: product.step ? 'MIN_AND_STEP_VALUES' : null, onInputChanged: (ev) => {
|
319
319
|
ev.stopPropagation();
|
320
320
|
if (isNumber(ev.detail)) {
|
321
321
|
this.setProduct(product, ev.detail);
|
@@ -30,6 +30,7 @@ const YooFormNumberPickerComponent = class {
|
|
30
30
|
this.forceShowValidation = false;
|
31
31
|
}
|
32
32
|
onValueChanged() {
|
33
|
+
this.value && this.stepAmount && !this.min && (this.min = this.value);
|
33
34
|
this.inputChanged.emit(this.value);
|
34
35
|
this.updateValidity();
|
35
36
|
}
|
@@ -39,6 +40,9 @@ const YooFormNumberPickerComponent = class {
|
|
39
40
|
onMaxUpdated() {
|
40
41
|
this.updateValidity();
|
41
42
|
}
|
43
|
+
onUseButtonsUpdated() {
|
44
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
45
|
+
}
|
42
46
|
async setValue(value) {
|
43
47
|
this.value = value;
|
44
48
|
this.selection = value;
|
@@ -58,9 +62,8 @@ const YooFormNumberPickerComponent = class {
|
|
58
62
|
}
|
59
63
|
}
|
60
64
|
componentWillLoad() {
|
61
|
-
(isFinite(this.stepAmount) && this.stepAmount > 0) && this.updateMinMaxWithStep();
|
62
65
|
this.value && this.setValue(this.value);
|
63
|
-
!this.value && this.useButtons && (this.value = this.min);
|
66
|
+
!this.value && this.useButtons && (this.value = this.min || 0);
|
64
67
|
}
|
65
68
|
componentDidLoad() {
|
66
69
|
this.setCaretColor();
|
@@ -68,18 +71,6 @@ const YooFormNumberPickerComponent = class {
|
|
68
71
|
get isSecondary() {
|
69
72
|
return this.type === 'secondary';
|
70
73
|
}
|
71
|
-
updateMinMaxWithStep() {
|
72
|
-
const step = this.stepAmount || 1;
|
73
|
-
for (const bound of ['min', 'max']) {
|
74
|
-
if ((!isFinite(this[bound]) || this[bound] < step) && bound === 'min') {
|
75
|
-
this[bound] = step;
|
76
|
-
}
|
77
|
-
else if (this[bound] % step !== 0) {
|
78
|
-
const diff = this[bound] % step;
|
79
|
-
this[bound] += (diff / step) >= 0.5 ? step - diff : diff * -1;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
}
|
83
74
|
setCaretColor() {
|
84
75
|
if (this.formInputElement && !this.disabled) {
|
85
76
|
const caretColor = this.isSecondary ? 'dark' : 'light';
|
@@ -109,7 +100,7 @@ const YooFormNumberPickerComponent = class {
|
|
109
100
|
validity = this.value <= this.max;
|
110
101
|
}
|
111
102
|
if (validity && isFinite(this.stepAmount)) {
|
112
|
-
validity = !(this.value % this.stepAmount);
|
103
|
+
validity = !((this.value - (this.min || 0)) % this.stepAmount);
|
113
104
|
}
|
114
105
|
if (this.validity !== validity) {
|
115
106
|
this.validity = validity;
|
@@ -143,6 +134,7 @@ const YooFormNumberPickerComponent = class {
|
|
143
134
|
if (ret && !ret.overlayDismiss) {
|
144
135
|
this.setValue(ret.data);
|
145
136
|
}
|
137
|
+
this.updateValidity();
|
146
138
|
this.dialog = null;
|
147
139
|
});
|
148
140
|
}
|
@@ -153,7 +145,6 @@ const YooFormNumberPickerComponent = class {
|
|
153
145
|
onInputFocused(ev) {
|
154
146
|
ev.stopPropagation();
|
155
147
|
ev.preventDefault();
|
156
|
-
this.updateValidity();
|
157
148
|
this.showContainerDialog();
|
158
149
|
}
|
159
150
|
onInputBlurred() {
|
@@ -214,7 +205,8 @@ const YooFormNumberPickerComponent = class {
|
|
214
205
|
static get watchers() { return {
|
215
206
|
"value": ["onValueChanged"],
|
216
207
|
"min": ["onMinUpdated"],
|
217
|
-
"max": ["onMaxUpdated"]
|
208
|
+
"max": ["onMaxUpdated"],
|
209
|
+
"useButtons": ["onUseButtonsUpdated"]
|
218
210
|
}; }
|
219
211
|
};
|
220
212
|
YooFormNumberPickerComponent.style = formNumberPickerCss;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { h, r as registerInstance, i as createEvent, f as forceUpdate, e as Host, g as getElement$1 } from './index-23b437f1.js';
|
2
|
-
import { eO as getContrastColorName, P as getCssColor, t as translate, cn as isBase64, fJ as getMaxViewPortImage, w as closeModal, cK as setStatusBarDarkMode, D as cleanupWKWebViewFilePath, H as isWeb, fK as getImageSize, bF as getResizedImageSize, fL as getImageScaleFactor, S as ScreenOrientation, bG as isOffline, V as getAsyncExtraData, at as showAlert, bc as Draggable, ba as gsapTo, c_ as gsapFrom, M as isIOS, ap as enableKeyboardResize, bI as scaleUpAnimation, b9 as gsapSet, bf as getContrastColor, aR as showContextMenu, cp as showActionSheet } from './index-4680b731.js';
|
2
|
+
import { eO as getContrastColorName, P as getCssColor, t as translate, cn as isBase64, fJ as getMaxViewPortImage, o as isIpad, w as closeModal, cK as setStatusBarDarkMode, D as cleanupWKWebViewFilePath, H as isWeb, fK as getImageSize, bF as getResizedImageSize, fL as getImageScaleFactor, S as ScreenOrientation, bG as isOffline, V as getAsyncExtraData, at as showAlert, bc as Draggable, ba as gsapTo, c_ as gsapFrom, M as isIOS, ap as enableKeyboardResize, bI as scaleUpAnimation, b9 as gsapSet, bf as getContrastColor, aR as showContextMenu, cp as showActionSheet } from './index-4680b731.js';
|
3
3
|
import './index-4db360f2.js';
|
4
4
|
import { b as isAnnotationValid, a as getPercentPositionStyle, e as isAnnotationDeleted, c as getElement, m as isAnnotationFocused, i as isAnnotationEmpty, f as createBaseAnnotation, d as isElementInsideContainer } from './annotations-helpers-2f9599f4.js';
|
5
5
|
import { e as getTransformInfos, f as getPointerCoordinates, y as cloudinary, g as getAppContext } from './common-helpers-57151af2.js';
|
@@ -473,7 +473,7 @@ const YooPhotoEditorComponent = class {
|
|
473
473
|
};
|
474
474
|
}
|
475
475
|
get maxImageSize() {
|
476
|
-
const COEFF_RESIZE = 3;
|
476
|
+
const COEFF_RESIZE = isIpad() ? 2 : 3;
|
477
477
|
const { width, height } = this.maxViewport;
|
478
478
|
return {
|
479
479
|
width: COEFF_RESIZE * width,
|
@@ -66,13 +66,13 @@ export declare class YooFormNumberPickerComponent {
|
|
66
66
|
onValueChanged(): void;
|
67
67
|
onMinUpdated(): void;
|
68
68
|
onMaxUpdated(): void;
|
69
|
+
onUseButtonsUpdated(): void;
|
69
70
|
setValue(value: any): Promise<void>;
|
70
71
|
stepDown(): Promise<void>;
|
71
72
|
stepUp(): Promise<void>;
|
72
73
|
componentWillLoad(): void;
|
73
74
|
componentDidLoad(): void;
|
74
75
|
get isSecondary(): boolean;
|
75
|
-
updateMinMaxWithStep(): void;
|
76
76
|
setCaretColor(): void;
|
77
77
|
onSideButtonClicked(ev: Event, side: 'right' | 'left'): void;
|
78
78
|
onInputChanged(ev: CustomEvent): void;
|