@orderingstack/front-components-product-configurator 1.7.0-beta.2 → 1.8.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/components/Counter/Counter.d.ts +0 -1
- package/dist/components/Counter/index.d.ts +0 -1
- package/dist/components/DisplayState/DisplayState.d.ts +0 -1
- package/dist/components/DisplayState/index.d.ts +0 -1
- package/dist/components/GroupStateInfo/GroupStateInfo.d.ts +0 -1
- package/dist/components/GroupStateInfo/index.d.ts +0 -1
- package/dist/components/InfoLine/InfoLine.d.ts +0 -1
- package/dist/components/InfoLine/index.d.ts +0 -1
- package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts +1 -1
- package/dist/components/MenuItemsDispatcher/index.d.ts +0 -1
- package/dist/components/MenuItemsDispatcher/useMenuItemsDispatcher.d.ts +0 -1
- package/dist/components/MenuOptions/MenuOptions.d.ts +0 -1
- package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts +0 -1
- package/dist/components/MenuOptions/index.d.ts +0 -1
- package/dist/components/MenuOptions/useMenuOptions.d.ts +0 -1
- package/dist/components/MenuProduct/MenuProduct.d.ts +2 -3
- package/dist/components/MenuProduct/index.d.ts +0 -1
- package/dist/components/MenuProduct/useMenuProduct.d.ts +2 -3
- package/dist/components/MenuProductRoot/MenuProductRoot.d.ts +3 -2
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts +0 -1
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts +0 -1
- package/dist/components/MenuProductRoot/index.d.ts +0 -1
- package/dist/components/Price/Price.d.ts +0 -1
- package/dist/components/Price/index.d.ts +0 -1
- package/dist/components/ProductConfigurator/ProductConfigurator.d.ts +5 -2
- package/dist/components/ProductConfigurator/index.d.ts +0 -1
- package/dist/components/ProductConfigurator/useProductConfigurator.d.ts +0 -1
- package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts +0 -1
- package/dist/components/SimpleCheckbox/index.d.ts +0 -1
- package/dist/components/SimpleRadio/SimpleRadio.d.ts +0 -1
- package/dist/components/SimpleRadio/index.d.ts +0 -1
- package/dist/components/SubmitRow/SubmitRow.d.ts +0 -1
- package/dist/components/SubmitRow/index.d.ts +0 -1
- package/dist/context/Components.d.ts +0 -1
- package/dist/context/GroupsValidation.d.ts +0 -1
- package/dist/context/ProductData.d.ts +0 -1
- package/dist/hooks/useEmitFilter.d.ts +0 -1
- package/dist/hooks/useExpand.d.ts +0 -1
- package/dist/hooks/useValidate.d.ts +0 -1
- package/dist/hooks/useWindow.d.ts +0 -1
- package/dist/index.cjs.js +5 -6
- package/dist/index.es.js +269 -202
- package/dist/state/expandedItems.d.ts +0 -1
- package/dist/state/filter.d.ts +0 -1
- package/dist/state/index.d.ts +0 -1
- package/dist/state/validate.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/translations/dictionary.d.ts +0 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/cleanSelected.d.ts +0 -1
- package/dist/utils/countPrice.d.ts +0 -1
- package/dist/utils/filter.d.ts +0 -1
- package/dist/utils/formatPrice.d.ts +0 -1
- package/dist/utils/formatValues.d.ts +0 -1
- package/dist/utils/getContext.d.ts +4 -4
- package/dist/utils/getProduct.d.ts +0 -1
- package/dist/utils/getSelCtxCntFromSelectedState.d.ts +0 -1
- package/dist/utils/getValidSelectedState.d.ts +0 -1
- package/dist/utils/groupsValidation.d.ts +0 -1
- package/dist/utils/index.d.ts +2 -3
- package/dist/utils/setSelected.d.ts +0 -1
- package/dist/utils/validate.d.ts +0 -1
- package/dist/utils/validationMessagesToRefactor.d.ts +0 -1
- package/package.json +118 -91
- package/dist/components/Counter/Counter.d.ts.map +0 -1
- package/dist/components/Counter/index.d.ts.map +0 -1
- package/dist/components/DisplayState/DisplayState.d.ts.map +0 -1
- package/dist/components/DisplayState/index.d.ts.map +0 -1
- package/dist/components/GroupStateInfo/GroupStateInfo.d.ts.map +0 -1
- package/dist/components/GroupStateInfo/index.d.ts.map +0 -1
- package/dist/components/InfoLine/InfoLine.d.ts.map +0 -1
- package/dist/components/InfoLine/index.d.ts.map +0 -1
- package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts.map +0 -1
- package/dist/components/MenuItemsDispatcher/index.d.ts.map +0 -1
- package/dist/components/MenuItemsDispatcher/useMenuItemsDispatcher.d.ts.map +0 -1
- package/dist/components/MenuOptions/MenuOptions.d.ts.map +0 -1
- package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts.map +0 -1
- package/dist/components/MenuOptions/index.d.ts.map +0 -1
- package/dist/components/MenuOptions/useMenuOptions.d.ts.map +0 -1
- package/dist/components/MenuProduct/MenuProduct.d.ts.map +0 -1
- package/dist/components/MenuProduct/index.d.ts.map +0 -1
- package/dist/components/MenuProduct/useMenuProduct.d.ts.map +0 -1
- package/dist/components/MenuProductRoot/MenuProductRoot.d.ts.map +0 -1
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts.map +0 -1
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts.map +0 -1
- package/dist/components/MenuProductRoot/index.d.ts.map +0 -1
- package/dist/components/Price/Price.d.ts.map +0 -1
- package/dist/components/Price/index.d.ts.map +0 -1
- package/dist/components/ProductConfigurator/ProductConfigurator.d.ts.map +0 -1
- package/dist/components/ProductConfigurator/index.d.ts.map +0 -1
- package/dist/components/ProductConfigurator/useProductConfigurator.d.ts.map +0 -1
- package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts.map +0 -1
- package/dist/components/SimpleCheckbox/index.d.ts.map +0 -1
- package/dist/components/SimpleRadio/SimpleRadio.d.ts.map +0 -1
- package/dist/components/SimpleRadio/index.d.ts.map +0 -1
- package/dist/components/SubmitRow/SubmitRow.d.ts.map +0 -1
- package/dist/components/SubmitRow/index.d.ts.map +0 -1
- package/dist/context/Components.d.ts.map +0 -1
- package/dist/context/GroupsValidation.d.ts.map +0 -1
- package/dist/context/ProductData.d.ts.map +0 -1
- package/dist/hooks/useEmitFilter.d.ts.map +0 -1
- package/dist/hooks/useExpand.d.ts.map +0 -1
- package/dist/hooks/useValidate.d.ts.map +0 -1
- package/dist/hooks/useWindow.d.ts.map +0 -1
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/dist/state/expandedItems.d.ts.map +0 -1
- package/dist/state/filter.d.ts.map +0 -1
- package/dist/state/index.d.ts.map +0 -1
- package/dist/state/validate.d.ts.map +0 -1
- package/dist/translations/dictionary.d.ts.map +0 -1
- package/dist/translations/i18n.d.ts +0 -2
- package/dist/translations/i18n.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/cleanSelected.d.ts.map +0 -1
- package/dist/utils/countPrice.d.ts.map +0 -1
- package/dist/utils/filter.d.ts.map +0 -1
- package/dist/utils/formatPrice.d.ts.map +0 -1
- package/dist/utils/formatValues.d.ts.map +0 -1
- package/dist/utils/getContext.d.ts.map +0 -1
- package/dist/utils/getProduct.d.ts.map +0 -1
- package/dist/utils/getSelCtxCntFromSelectedState.d.ts.map +0 -1
- package/dist/utils/getValidSelectedState.d.ts.map +0 -1
- package/dist/utils/groupsValidation.d.ts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/setSelected.d.ts.map +0 -1
- package/dist/utils/validate.d.ts.map +0 -1
- package/dist/utils/validationMessagesToRefactor.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -3,146 +3,115 @@ import { useTransition, animated } from "react-spring";
|
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
var tailwind = "";
|
|
5
5
|
var main = "";
|
|
6
|
-
function _typeof$1(
|
|
6
|
+
function _typeof$1(o2) {
|
|
7
7
|
"@babel/helpers - typeof";
|
|
8
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(
|
|
9
|
-
return typeof
|
|
10
|
-
} : function(
|
|
11
|
-
return
|
|
12
|
-
}, _typeof$1(
|
|
13
|
-
}
|
|
14
|
-
function _classCallCheck(
|
|
15
|
-
if (!(
|
|
8
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
9
|
+
return typeof o3;
|
|
10
|
+
} : function(o3) {
|
|
11
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
12
|
+
}, _typeof$1(o2);
|
|
13
|
+
}
|
|
14
|
+
function _classCallCheck(a2, n2) {
|
|
15
|
+
if (!(a2 instanceof n2))
|
|
16
16
|
throw new TypeError("Cannot call a class as a function");
|
|
17
|
-
}
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
if (_typeof$1(
|
|
21
|
-
return
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
24
|
-
var
|
|
25
|
-
if (_typeof$1(
|
|
26
|
-
return
|
|
18
|
+
function toPrimitive(t2, r2) {
|
|
19
|
+
if ("object" != _typeof$1(t2) || !t2)
|
|
20
|
+
return t2;
|
|
21
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
22
|
+
if (void 0 !== e2) {
|
|
23
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
24
|
+
if ("object" != _typeof$1(i2))
|
|
25
|
+
return i2;
|
|
27
26
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
28
27
|
}
|
|
29
|
-
return (
|
|
28
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
var
|
|
33
|
-
return _typeof$1(
|
|
30
|
+
function toPropertyKey(t2) {
|
|
31
|
+
var i2 = toPrimitive(t2, "string");
|
|
32
|
+
return "symbol" == _typeof$1(i2) ? i2 : i2 + "";
|
|
34
33
|
}
|
|
35
|
-
function _defineProperties(
|
|
36
|
-
for (var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
descriptor.configurable = true;
|
|
40
|
-
if ("value" in descriptor)
|
|
41
|
-
descriptor.writable = true;
|
|
42
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
34
|
+
function _defineProperties(e2, r2) {
|
|
35
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
36
|
+
var o2 = r2[t2];
|
|
37
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, toPropertyKey(o2.key), o2);
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
function _createClass(
|
|
46
|
-
|
|
47
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
48
|
-
if (staticProps)
|
|
49
|
-
_defineProperties(Constructor, staticProps);
|
|
50
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
40
|
+
function _createClass(e2, r2, t2) {
|
|
41
|
+
return r2 && _defineProperties(e2.prototype, r2), t2 && _defineProperties(e2, t2), Object.defineProperty(e2, "prototype", {
|
|
51
42
|
writable: false
|
|
52
|
-
});
|
|
53
|
-
return Constructor;
|
|
43
|
+
}), e2;
|
|
54
44
|
}
|
|
55
|
-
function _assertThisInitialized(
|
|
56
|
-
if (
|
|
45
|
+
function _assertThisInitialized(e2) {
|
|
46
|
+
if (void 0 === e2)
|
|
57
47
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
58
|
-
|
|
59
|
-
return self2;
|
|
48
|
+
return e2;
|
|
60
49
|
}
|
|
61
|
-
function _setPrototypeOf(
|
|
62
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
return _setPrototypeOf(o2, p2);
|
|
50
|
+
function _setPrototypeOf(t2, e2) {
|
|
51
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
|
52
|
+
return t3.__proto__ = e3, t3;
|
|
53
|
+
}, _setPrototypeOf(t2, e2);
|
|
67
54
|
}
|
|
68
|
-
function _inherits(
|
|
69
|
-
if (
|
|
55
|
+
function _inherits(t2, e2) {
|
|
56
|
+
if ("function" != typeof e2 && null !== e2)
|
|
70
57
|
throw new TypeError("Super expression must either be null or a function");
|
|
71
|
-
|
|
72
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
58
|
+
t2.prototype = Object.create(e2 && e2.prototype, {
|
|
73
59
|
constructor: {
|
|
74
|
-
value:
|
|
60
|
+
value: t2,
|
|
75
61
|
writable: true,
|
|
76
62
|
configurable: true
|
|
77
63
|
}
|
|
78
|
-
})
|
|
79
|
-
Object.defineProperty(subClass, "prototype", {
|
|
64
|
+
}), Object.defineProperty(t2, "prototype", {
|
|
80
65
|
writable: false
|
|
81
|
-
});
|
|
82
|
-
if (superClass)
|
|
83
|
-
_setPrototypeOf(subClass, superClass);
|
|
66
|
+
}), e2 && _setPrototypeOf(t2, e2);
|
|
84
67
|
}
|
|
85
|
-
function _possibleConstructorReturn(
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
|
|
68
|
+
function _possibleConstructorReturn(t2, e2) {
|
|
69
|
+
if (e2 && ("object" == _typeof$1(e2) || "function" == typeof e2))
|
|
70
|
+
return e2;
|
|
71
|
+
if (void 0 !== e2)
|
|
89
72
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
} else {
|
|
109
|
-
obj[key] = value;
|
|
110
|
-
}
|
|
111
|
-
return obj;
|
|
112
|
-
}
|
|
113
|
-
function _arrayWithHoles$1(arr2) {
|
|
114
|
-
if (Array.isArray(arr2))
|
|
115
|
-
return arr2;
|
|
73
|
+
return _assertThisInitialized(t2);
|
|
74
|
+
}
|
|
75
|
+
function _getPrototypeOf(t2) {
|
|
76
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
|
77
|
+
return t3.__proto__ || Object.getPrototypeOf(t3);
|
|
78
|
+
}, _getPrototypeOf(t2);
|
|
79
|
+
}
|
|
80
|
+
function _defineProperty(e2, r2, t2) {
|
|
81
|
+
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
82
|
+
value: t2,
|
|
83
|
+
enumerable: true,
|
|
84
|
+
configurable: true,
|
|
85
|
+
writable: true
|
|
86
|
+
}) : e2[r2] = t2, e2;
|
|
87
|
+
}
|
|
88
|
+
function _arrayWithHoles$1(r2) {
|
|
89
|
+
if (Array.isArray(r2))
|
|
90
|
+
return r2;
|
|
116
91
|
}
|
|
117
|
-
function _iterableToArray$1(
|
|
118
|
-
if (typeof Symbol
|
|
119
|
-
return Array.from(
|
|
92
|
+
function _iterableToArray$1(r2) {
|
|
93
|
+
if ("undefined" != typeof Symbol && null != r2[Symbol.iterator] || null != r2["@@iterator"])
|
|
94
|
+
return Array.from(r2);
|
|
120
95
|
}
|
|
121
|
-
function _arrayLikeToArray$1(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return arr22;
|
|
96
|
+
function _arrayLikeToArray$1(r2, a2) {
|
|
97
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
98
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++)
|
|
99
|
+
n2[e2] = r2[e2];
|
|
100
|
+
return n2;
|
|
127
101
|
}
|
|
128
|
-
function _unsupportedIterableToArray$1(
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
n2 = o2.constructor.name;
|
|
136
|
-
if (n2 === "Map" || n2 === "Set")
|
|
137
|
-
return Array.from(o2);
|
|
138
|
-
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
139
|
-
return _arrayLikeToArray$1(o2, minLen);
|
|
102
|
+
function _unsupportedIterableToArray$1(r2, a2) {
|
|
103
|
+
if (r2) {
|
|
104
|
+
if ("string" == typeof r2)
|
|
105
|
+
return _arrayLikeToArray$1(r2, a2);
|
|
106
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
107
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r2, a2) : void 0;
|
|
108
|
+
}
|
|
140
109
|
}
|
|
141
110
|
function _nonIterableRest$1() {
|
|
142
111
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
143
112
|
}
|
|
144
|
-
function _toArray$1(
|
|
145
|
-
return _arrayWithHoles$1(
|
|
113
|
+
function _toArray$1(r2) {
|
|
114
|
+
return _arrayWithHoles$1(r2) || _iterableToArray$1(r2) || _unsupportedIterableToArray$1(r2) || _nonIterableRest$1();
|
|
146
115
|
}
|
|
147
116
|
function ownKeys$2(object, enumerableOnly) {
|
|
148
117
|
var keys2 = Object.keys(object);
|
|
@@ -4753,17 +4722,26 @@ var SelMinSelMaxStatus = /* @__PURE__ */ ((SelMinSelMaxStatus2) => {
|
|
|
4753
4722
|
return SelMinSelMaxStatus2;
|
|
4754
4723
|
})(SelMinSelMaxStatus || {});
|
|
4755
4724
|
const getContexts = (contextName, contextType, product) => {
|
|
4725
|
+
var _a, _b;
|
|
4756
4726
|
if (contextName === "selected" || contextName === "filter") {
|
|
4757
4727
|
return [];
|
|
4758
4728
|
}
|
|
4759
4729
|
if (product[contextType] === contextName) {
|
|
4760
4730
|
return [product];
|
|
4761
4731
|
}
|
|
4762
|
-
let contexts = findContextByName(
|
|
4732
|
+
let contexts = findContextByName(
|
|
4733
|
+
contextName,
|
|
4734
|
+
contextType,
|
|
4735
|
+
(_a = product.items) != null ? _a : []
|
|
4736
|
+
);
|
|
4763
4737
|
if (contexts == null ? void 0 : contexts.length) {
|
|
4764
4738
|
return contexts;
|
|
4765
4739
|
}
|
|
4766
|
-
contexts = findContextInNestedLvl(
|
|
4740
|
+
contexts = findContextInNestedLvl(
|
|
4741
|
+
contextName,
|
|
4742
|
+
contextType,
|
|
4743
|
+
(_b = product.items) != null ? _b : []
|
|
4744
|
+
);
|
|
4767
4745
|
if (contexts.length === 0)
|
|
4768
4746
|
;
|
|
4769
4747
|
return contexts;
|
|
@@ -6328,7 +6306,7 @@ const getGroupBucketSecondChildrenValuesInputChange = (group, clickedProductId,
|
|
|
6328
6306
|
secondProduct
|
|
6329
6307
|
};
|
|
6330
6308
|
}
|
|
6331
|
-
const isSecondProductInState = !!((_c = selected == null ? void 0 : selected[secondProduct
|
|
6309
|
+
const isSecondProductInState = !!secondProduct && !!((_c = selected == null ? void 0 : selected[secondProduct.selCtx]) == null ? void 0 : _c[secondProduct.id]) && ((_d = selected == null ? void 0 : selected[secondProduct.selCtx]) == null ? void 0 : _d[secondProduct.id]) !== false;
|
|
6332
6310
|
if (isSecondProductInState) {
|
|
6333
6311
|
return {
|
|
6334
6312
|
clickedProductValue: "1",
|
|
@@ -6748,7 +6726,9 @@ const validateProductFilter = (product, stateFilter) => {
|
|
|
6748
6726
|
const commonFilters = (_a = Object.keys(stateFiltersWithFltCtx)) == null ? void 0 : _a.filter(
|
|
6749
6727
|
(filterName) => {
|
|
6750
6728
|
var _a2;
|
|
6751
|
-
const matchingFilters = (_a2 = Object.keys(
|
|
6729
|
+
const matchingFilters = (_a2 = Object.keys(
|
|
6730
|
+
(productFilters == null ? void 0 : productFilters[filterName]) || {}
|
|
6731
|
+
)) == null ? void 0 : _a2.filter((x2) => {
|
|
6752
6732
|
var _a3;
|
|
6753
6733
|
if (((_a3 = productFilters == null ? void 0 : productFilters[filterName]) == null ? void 0 : _a3[x2]) === (stateFiltersWithFltCtx == null ? void 0 : stateFiltersWithFltCtx[filterName])) {
|
|
6754
6734
|
return true;
|
|
@@ -6956,7 +6936,7 @@ function InfoLine(props) {
|
|
|
6956
6936
|
});
|
|
6957
6937
|
}
|
|
6958
6938
|
const checkMarkSVG = /* @__PURE__ */ jsx("svg", {
|
|
6959
|
-
className: "
|
|
6939
|
+
className: "size-6 text-green-600",
|
|
6960
6940
|
viewBox: "0 0 24 24",
|
|
6961
6941
|
fill: "none",
|
|
6962
6942
|
stroke: "currentColor",
|
|
@@ -6969,7 +6949,7 @@ const checkMarkSVG = /* @__PURE__ */ jsx("svg", {
|
|
|
6969
6949
|
})
|
|
6970
6950
|
});
|
|
6971
6951
|
const exclamationMarkSVG = /* @__PURE__ */ jsx("svg", {
|
|
6972
|
-
className: "
|
|
6952
|
+
className: "size-6 text-red-500",
|
|
6973
6953
|
fill: "none",
|
|
6974
6954
|
viewBox: "0 0 24 24",
|
|
6975
6955
|
stroke: "currentColor",
|
|
@@ -7755,34 +7735,34 @@ function hasLoadedNamespace(ns, i18n) {
|
|
|
7755
7735
|
}
|
|
7756
7736
|
});
|
|
7757
7737
|
}
|
|
7758
|
-
function _iterableToArrayLimit(
|
|
7759
|
-
var
|
|
7760
|
-
if (null !=
|
|
7761
|
-
var
|
|
7738
|
+
function _iterableToArrayLimit(r2, l2) {
|
|
7739
|
+
var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
7740
|
+
if (null != t2) {
|
|
7741
|
+
var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
|
|
7762
7742
|
try {
|
|
7763
|
-
if (
|
|
7764
|
-
if (Object(
|
|
7743
|
+
if (i2 = (t2 = t2.call(r2)).next, 0 === l2) {
|
|
7744
|
+
if (Object(t2) !== t2)
|
|
7765
7745
|
return;
|
|
7766
|
-
|
|
7746
|
+
f2 = false;
|
|
7767
7747
|
} else
|
|
7768
|
-
for (; !(
|
|
7748
|
+
for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true)
|
|
7769
7749
|
;
|
|
7770
|
-
} catch (
|
|
7771
|
-
|
|
7750
|
+
} catch (r3) {
|
|
7751
|
+
o2 = true, n2 = r3;
|
|
7772
7752
|
} finally {
|
|
7773
7753
|
try {
|
|
7774
|
-
if (!
|
|
7754
|
+
if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2))
|
|
7775
7755
|
return;
|
|
7776
7756
|
} finally {
|
|
7777
|
-
if (
|
|
7778
|
-
throw
|
|
7757
|
+
if (o2)
|
|
7758
|
+
throw n2;
|
|
7779
7759
|
}
|
|
7780
7760
|
}
|
|
7781
|
-
return
|
|
7761
|
+
return a2;
|
|
7782
7762
|
}
|
|
7783
7763
|
}
|
|
7784
|
-
function _slicedToArray(
|
|
7785
|
-
return _arrayWithHoles$1(
|
|
7764
|
+
function _slicedToArray(r2, e2) {
|
|
7765
|
+
return _arrayWithHoles$1(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray$1(r2, e2) || _nonIterableRest$1();
|
|
7786
7766
|
}
|
|
7787
7767
|
function ownKeys(object, enumerableOnly) {
|
|
7788
7768
|
var keys2 = Object.keys(object);
|
|
@@ -8473,7 +8453,7 @@ const MenuOptionsDefaultUI = (props) => {
|
|
|
8473
8453
|
price: countPrice(selected, optionsItem)
|
|
8474
8454
|
})
|
|
8475
8455
|
}), /* @__PURE__ */ jsx("svg", {
|
|
8476
|
-
className: `
|
|
8456
|
+
className: `size-8 ml-2 text-black cursor-pointer ${!isExpanded && "rotate-180"}`,
|
|
8477
8457
|
viewBox: "0 0 24 24",
|
|
8478
8458
|
fill: "none",
|
|
8479
8459
|
stroke: "currentColor",
|
|
@@ -8641,7 +8621,7 @@ const SimpleCheckbox = (props) => {
|
|
|
8641
8621
|
}), /* @__PURE__ */ jsx("label", {
|
|
8642
8622
|
htmlFor: inputId,
|
|
8643
8623
|
children: /* @__PURE__ */ jsx(Price, {
|
|
8644
|
-
price: parseFloat(price),
|
|
8624
|
+
price: parseFloat(price || "0"),
|
|
8645
8625
|
addPlusBefore: true,
|
|
8646
8626
|
showIfPriceZero: true,
|
|
8647
8627
|
hiddenIfPriceZero: true
|
|
@@ -8723,14 +8703,14 @@ function Counter(props) {
|
|
|
8723
8703
|
size = "md"
|
|
8724
8704
|
} = props;
|
|
8725
8705
|
return /* @__PURE__ */ jsxs("div", {
|
|
8726
|
-
className: `counter counter-${size} flex flex-row justify-center items-center p-1 border
|
|
8706
|
+
className: `counter counter-${size} flex flex-row justify-center items-center p-1 border rounded-md border-[rgba(229,231,235,255)] product-quantity`,
|
|
8727
8707
|
children: [/* @__PURE__ */ jsx("button", {
|
|
8728
8708
|
type: "button",
|
|
8729
8709
|
className: "quantity-button small",
|
|
8730
8710
|
onClick: subtract,
|
|
8731
8711
|
disabled: disabledSubtract,
|
|
8732
8712
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
8733
|
-
className: "
|
|
8713
|
+
className: "size-4 text-black",
|
|
8734
8714
|
width: "24",
|
|
8735
8715
|
height: "24",
|
|
8736
8716
|
viewBox: "0 0 24 24",
|
|
@@ -8758,7 +8738,7 @@ function Counter(props) {
|
|
|
8758
8738
|
onClick: add,
|
|
8759
8739
|
disabled: disabledAdd,
|
|
8760
8740
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
8761
|
-
className: "
|
|
8741
|
+
className: "size-4 text-green-600 ",
|
|
8762
8742
|
width: "24",
|
|
8763
8743
|
height: "24",
|
|
8764
8744
|
viewBox: "0 0 24 24",
|
|
@@ -8819,12 +8799,14 @@ function useEmitFilter(product, isRadio, nestedLvl) {
|
|
|
8819
8799
|
const groupsCntKeys = getValues(groupsPath);
|
|
8820
8800
|
(_b = Object.keys(emit)) == null ? void 0 : _b.forEach((x2) => {
|
|
8821
8801
|
var _a2;
|
|
8822
|
-
(_a2 = Object.keys(productGroupCntKeys || {})) == null ? void 0 : _a2.forEach(
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8802
|
+
(_a2 = Object.keys(productGroupCntKeys || {})) == null ? void 0 : _a2.forEach(
|
|
8803
|
+
(productGroupCntKey) => {
|
|
8804
|
+
if (!emit[productGroupCntKey]) {
|
|
8805
|
+
unregister(`${fltCtxPath}.${productGroupCntKey}`);
|
|
8806
|
+
unregister(`${groupCntPath}.${productGroupCntKey}`);
|
|
8807
|
+
}
|
|
8826
8808
|
}
|
|
8827
|
-
|
|
8809
|
+
);
|
|
8828
8810
|
Object.keys(groupsCntKeys || {}).forEach((groupSelCtx) => {
|
|
8829
8811
|
if (groupSelCtx !== selCtx && x2 in getValues(groupsPath == null ? void 0 : groupsPath[groupSelCtx])) {
|
|
8830
8812
|
unregister(`${groupsPath}.${groupSelCtx}.${x2}`);
|
|
@@ -8840,7 +8822,10 @@ function useEmitFilter(product, isRadio, nestedLvl) {
|
|
|
8840
8822
|
(_c = Object.keys(emit)) == null ? void 0 : _c.forEach((x2) => {
|
|
8841
8823
|
setValue(`filter.${fltCtx}.${x2}`, emit[x2]);
|
|
8842
8824
|
const groupKeyCnt = getValues(`${groupCntPath}.${x2}.cnt`) || 0;
|
|
8843
|
-
setValue(`${groupCntPath}.${x2}`, {
|
|
8825
|
+
setValue(`${groupCntPath}.${x2}`, {
|
|
8826
|
+
cnt: groupKeyCnt + 1,
|
|
8827
|
+
value: emit[x2]
|
|
8828
|
+
});
|
|
8844
8829
|
});
|
|
8845
8830
|
}
|
|
8846
8831
|
}, [value]);
|
|
@@ -8939,14 +8924,18 @@ const selectUnselectProduct = (setValue, getValues, product, isChecked, unregist
|
|
|
8939
8924
|
} else {
|
|
8940
8925
|
unregister(`${groupCntPath}.${emitKey}`);
|
|
8941
8926
|
const groupKeysObj = getValues(groupsPath) || {};
|
|
8942
|
-
const otherGroupsCntKeys = (_a2 = Object.keys(groupKeysObj)) == null ? void 0 : _a2.filter(
|
|
8927
|
+
const otherGroupsCntKeys = (_a2 = Object.keys(groupKeysObj)) == null ? void 0 : _a2.filter(
|
|
8928
|
+
(x2) => x2 !== selCtx
|
|
8929
|
+
);
|
|
8943
8930
|
if (!otherGroupsCntKeys) {
|
|
8944
8931
|
unregister(`${fltCtxPath}.${emitKey}`);
|
|
8945
8932
|
} else {
|
|
8946
|
-
const sameKeyOtherGroup = otherGroupsCntKeys == null ? void 0 : otherGroupsCntKeys.find(
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8933
|
+
const sameKeyOtherGroup = otherGroupsCntKeys == null ? void 0 : otherGroupsCntKeys.find(
|
|
8934
|
+
(groupSelCtx) => {
|
|
8935
|
+
var _a3;
|
|
8936
|
+
return !!((_a3 = groupKeysObj == null ? void 0 : groupKeysObj[`${groupSelCtx}`]) == null ? void 0 : _a3[`${emitKey}`]);
|
|
8937
|
+
}
|
|
8938
|
+
);
|
|
8950
8939
|
if (!sameKeyOtherGroup) {
|
|
8951
8940
|
unregister(`${fltCtxPath}.${emitKey}`);
|
|
8952
8941
|
} else {
|
|
@@ -8982,7 +8971,7 @@ const findProductInParentProductBySelCtx = (parent, selCtx) => {
|
|
|
8982
8971
|
return null;
|
|
8983
8972
|
};
|
|
8984
8973
|
function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
8985
|
-
var _a, _b;
|
|
8974
|
+
var _a, _b, _c;
|
|
8986
8975
|
const { id, selCtx, emit = {}, fltCtx } = product;
|
|
8987
8976
|
const {
|
|
8988
8977
|
allowMultiple: parentAllowMultiple,
|
|
@@ -9002,8 +8991,8 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9002
8991
|
const isBucketCase = isGroupBucketCase(parentPriduct);
|
|
9003
8992
|
const isCounter = isApiBooleanTrue(parentAllowMultiple);
|
|
9004
8993
|
const isDecrementEnabled = isBucketCase && valueNumber > 0 || valueNumber > (isRadio ? 1 : 0);
|
|
9005
|
-
const isIncrementEnabled = isBucketCase && valueNumber < ((_a = parentPriduct == null ? void 0 : parentPriduct.attrs) == null ? void 0 : _a.qtyMax) || isInputCounterIncrementEnabled2(product, selected) && (isInputEnabled2(product) || valueNumber);
|
|
9006
|
-
const isChecked = Number(((
|
|
8994
|
+
const isIncrementEnabled = isBucketCase && valueNumber < Number((_b = (_a = parentPriduct == null ? void 0 : parentPriduct.attrs) == null ? void 0 : _a.qtyMax) != null ? _b : 0) || isInputCounterIncrementEnabled2(product, selected) && (isInputEnabled2(product) || valueNumber);
|
|
8995
|
+
const isChecked = Number(((_c = selected == null ? void 0 : selected[selCtx]) == null ? void 0 : _c[id]) || 0) > 0;
|
|
9007
8996
|
const isCheckboxEnabled = isBucketCase || isInputEnabled2(product) || valueNumber;
|
|
9008
8997
|
const registerId = `${isRadio ? "radio" : "selected"}.${selCtx}.${id}`;
|
|
9009
8998
|
const registerProps = register(registerId, {
|
|
@@ -9017,14 +9006,27 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9017
9006
|
const isBucketCase2 = isGroupBucketCase(parentPriduct);
|
|
9018
9007
|
if (isBucketCase2) {
|
|
9019
9008
|
const { product: secondProduct, value: secondProductValue } = getGroupBucketSecondChildrenValues(parentPriduct, id, valueNumber + 1);
|
|
9020
|
-
setValue(
|
|
9009
|
+
setValue(
|
|
9010
|
+
`selected.${secondProduct == null ? void 0 : secondProduct.selCtx}.${secondProduct == null ? void 0 : secondProduct.id}`,
|
|
9011
|
+
secondProductValue
|
|
9012
|
+
);
|
|
9021
9013
|
if (secondProductValue === "0" || secondProductValue === false) {
|
|
9022
|
-
selectUnselectProduct(
|
|
9014
|
+
selectUnselectProduct(
|
|
9015
|
+
setValue,
|
|
9016
|
+
getValues,
|
|
9017
|
+
secondProduct,
|
|
9018
|
+
false,
|
|
9019
|
+
unregister,
|
|
9020
|
+
nestedLvl
|
|
9021
|
+
);
|
|
9023
9022
|
}
|
|
9024
9023
|
}
|
|
9025
9024
|
const importantSubProductsInState = (_b2 = (_a2 = Object.keys(selected)) == null ? void 0 : _a2.map((y2) => {
|
|
9026
9025
|
var _a3;
|
|
9027
|
-
return {
|
|
9026
|
+
return {
|
|
9027
|
+
key: y2,
|
|
9028
|
+
subProductId: (_a3 = findProductInParentProductBySelCtx(product, y2)) == null ? void 0 : _a3.id
|
|
9029
|
+
};
|
|
9028
9030
|
})) == null ? void 0 : _b2.filter((x2) => !!x2.subProductId);
|
|
9029
9031
|
if (valueNumber === 0) {
|
|
9030
9032
|
importantSubProductsInState == null ? void 0 : importantSubProductsInState.forEach((x2) => {
|
|
@@ -9033,19 +9035,32 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9033
9035
|
}
|
|
9034
9036
|
};
|
|
9035
9037
|
const handleCounterDecrementQty = () => {
|
|
9036
|
-
var _a2, _b2,
|
|
9038
|
+
var _a2, _b2, _c2, _d;
|
|
9037
9039
|
const decrementedValue = valueNumber - 1;
|
|
9038
9040
|
setValue(`selected.${selCtx}.${id}`, `${decrementedValue}`);
|
|
9039
9041
|
if (isBucketCase) {
|
|
9040
9042
|
const { product: secondProduct, value: secondProductValue } = getGroupBucketSecondChildrenValues(parentPriduct, id, decrementedValue);
|
|
9041
|
-
setValue(
|
|
9043
|
+
setValue(
|
|
9044
|
+
`selected.${secondProduct == null ? void 0 : secondProduct.selCtx}.${secondProduct == null ? void 0 : secondProduct.id}`,
|
|
9045
|
+
secondProductValue
|
|
9046
|
+
);
|
|
9042
9047
|
if (secondProductValue === "1") {
|
|
9043
|
-
selectUnselectProduct(
|
|
9048
|
+
selectUnselectProduct(
|
|
9049
|
+
setValue,
|
|
9050
|
+
getValues,
|
|
9051
|
+
secondProduct,
|
|
9052
|
+
true,
|
|
9053
|
+
unregister,
|
|
9054
|
+
nestedLvl
|
|
9055
|
+
);
|
|
9044
9056
|
}
|
|
9045
9057
|
}
|
|
9046
9058
|
const importantSubProductsInState = (_b2 = (_a2 = Object.keys(selected)) == null ? void 0 : _a2.map((y2) => {
|
|
9047
9059
|
var _a3;
|
|
9048
|
-
return {
|
|
9060
|
+
return {
|
|
9061
|
+
key: y2,
|
|
9062
|
+
subProductId: (_a3 = findProductInParentProductBySelCtx(product, y2)) == null ? void 0 : _a3.id
|
|
9063
|
+
};
|
|
9049
9064
|
})) == null ? void 0 : _b2.filter((x2) => !!x2.subProductId);
|
|
9050
9065
|
if (decrementedValue === 0) {
|
|
9051
9066
|
importantSubProductsInState == null ? void 0 : importantSubProductsInState.forEach((x2) => {
|
|
@@ -9054,7 +9069,7 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9054
9069
|
}
|
|
9055
9070
|
if (isCheckbox && decrementedValue === 0) {
|
|
9056
9071
|
setValue(`selected.${selCtx}.${id}`, false);
|
|
9057
|
-
(
|
|
9072
|
+
(_c2 = Object.keys(emit)) == null ? void 0 : _c2.forEach((x2) => {
|
|
9058
9073
|
const formPath = `filterWithCnt.${fltCtx}.${x2}.${emit[x2]}`;
|
|
9059
9074
|
const cnt = getValues(formPath) || 0;
|
|
9060
9075
|
if (cnt < 2) {
|
|
@@ -9081,7 +9096,7 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9081
9096
|
const groupCntPath = `filterWithCnt.${fltCtx}.${selCtx}`;
|
|
9082
9097
|
const fltCtxPath = `filter.${fltCtx}`;
|
|
9083
9098
|
(_d = Object.keys(emit)) == null ? void 0 : _d.forEach((emitKey) => {
|
|
9084
|
-
var _a3, _b3,
|
|
9099
|
+
var _a3, _b3, _c3;
|
|
9085
9100
|
const groupValue = getValues(`${groupCntPath}.${emitKey}`) || 0;
|
|
9086
9101
|
if (groupValue) {
|
|
9087
9102
|
if (groupValue > 1) {
|
|
@@ -9089,18 +9104,22 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9089
9104
|
} else {
|
|
9090
9105
|
unregister(`${groupCntPath}.${emitKey}`);
|
|
9091
9106
|
const groupKeysObj = getValues(groupsPath) || {};
|
|
9092
|
-
const otherGroupsCntKeys = (_a3 = Object.keys(groupKeysObj)) == null ? void 0 : _a3.filter(
|
|
9107
|
+
const otherGroupsCntKeys = (_a3 = Object.keys(groupKeysObj)) == null ? void 0 : _a3.filter(
|
|
9108
|
+
(x2) => x2 !== selCtx
|
|
9109
|
+
);
|
|
9093
9110
|
if (!otherGroupsCntKeys) {
|
|
9094
9111
|
unregister(`${fltCtxPath}.${emitKey}`);
|
|
9095
9112
|
} else {
|
|
9096
|
-
const sameKeyOtherGroup = otherGroupsCntKeys == null ? void 0 : otherGroupsCntKeys.find(
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9113
|
+
const sameKeyOtherGroup = otherGroupsCntKeys == null ? void 0 : otherGroupsCntKeys.find(
|
|
9114
|
+
(groupSelCtx) => {
|
|
9115
|
+
var _a4;
|
|
9116
|
+
return !!((_a4 = groupKeysObj == null ? void 0 : groupKeysObj[`${groupSelCtx}`]) == null ? void 0 : _a4[`${emitKey}`]);
|
|
9117
|
+
}
|
|
9118
|
+
);
|
|
9100
9119
|
if (!sameKeyOtherGroup) {
|
|
9101
9120
|
unregister(`${fltCtxPath}.${emitKey}`);
|
|
9102
9121
|
} else {
|
|
9103
|
-
const newValue = (
|
|
9122
|
+
const newValue = (_c3 = (_b3 = groupKeysObj == null ? void 0 : groupKeysObj[`${sameKeyOtherGroup}`]) == null ? void 0 : _b3[`${emitKey}`]) == null ? void 0 : _c3.value;
|
|
9104
9123
|
setValue(`${fltCtxPath}.${emitKey}`, newValue);
|
|
9105
9124
|
}
|
|
9106
9125
|
}
|
|
@@ -9116,19 +9135,59 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9116
9135
|
target: { checked, name: selCtx2, defaultValue: productId }
|
|
9117
9136
|
} = e2;
|
|
9118
9137
|
if (isBucketCase) {
|
|
9119
|
-
const { clickedProductValue, secondProductValue, secondProduct } = getGroupBucketSecondChildrenValuesInputChange(
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9138
|
+
const { clickedProductValue, secondProductValue, secondProduct } = getGroupBucketSecondChildrenValuesInputChange(
|
|
9139
|
+
parentPriduct,
|
|
9140
|
+
id,
|
|
9141
|
+
checked,
|
|
9142
|
+
selected
|
|
9143
|
+
);
|
|
9144
|
+
console.log(
|
|
9145
|
+
"handleOnInputChange clickedProductValue",
|
|
9146
|
+
clickedProductValue,
|
|
9147
|
+
secondProductValue
|
|
9148
|
+
);
|
|
9149
|
+
setValue(
|
|
9150
|
+
`selected.${product == null ? void 0 : product.selCtx}.${product == null ? void 0 : product.id}`,
|
|
9151
|
+
clickedProductValue
|
|
9152
|
+
);
|
|
9153
|
+
setValue(
|
|
9154
|
+
`selected.${secondProduct == null ? void 0 : secondProduct.selCtx}.${secondProduct == null ? void 0 : secondProduct.id}`,
|
|
9155
|
+
secondProductValue
|
|
9156
|
+
);
|
|
9157
|
+
selectUnselectProduct(
|
|
9158
|
+
setValue,
|
|
9159
|
+
getValues,
|
|
9160
|
+
product,
|
|
9161
|
+
checked,
|
|
9162
|
+
unregister,
|
|
9163
|
+
nestedLvl
|
|
9164
|
+
);
|
|
9165
|
+
selectUnselectProduct(
|
|
9166
|
+
setValue,
|
|
9167
|
+
getValues,
|
|
9168
|
+
secondProduct,
|
|
9169
|
+
secondProductValue !== false,
|
|
9170
|
+
unregister,
|
|
9171
|
+
nestedLvl
|
|
9172
|
+
);
|
|
9125
9173
|
return;
|
|
9126
9174
|
}
|
|
9127
|
-
selectUnselectProduct(
|
|
9175
|
+
selectUnselectProduct(
|
|
9176
|
+
setValue,
|
|
9177
|
+
getValues,
|
|
9178
|
+
product,
|
|
9179
|
+
checked,
|
|
9180
|
+
unregister,
|
|
9181
|
+
nestedLvl
|
|
9182
|
+
);
|
|
9128
9183
|
if (isRadio) {
|
|
9129
|
-
const otherGroupItems = (_a2 = parentPriduct == null ? void 0 : parentPriduct.items) == null ? void 0 : _a2.filter(
|
|
9184
|
+
const otherGroupItems = (_a2 = parentPriduct == null ? void 0 : parentPriduct.items) == null ? void 0 : _a2.filter(
|
|
9185
|
+
(x2) => x2.id !== product.id
|
|
9186
|
+
);
|
|
9130
9187
|
for (const key of Object.keys(selected || {})) {
|
|
9131
|
-
const isItemToClear = (otherGroupItems == null ? void 0 : otherGroupItems.some(
|
|
9188
|
+
const isItemToClear = (otherGroupItems == null ? void 0 : otherGroupItems.some(
|
|
9189
|
+
(x2) => !!findProductInParentProductBySelCtx(x2, key)
|
|
9190
|
+
)) ? key : false;
|
|
9132
9191
|
if (isItemToClear) {
|
|
9133
9192
|
setValue(`selected.${key}`, false);
|
|
9134
9193
|
}
|
|
@@ -9284,7 +9343,7 @@ const MenuProductDefaultUI = (props) => {
|
|
|
9284
9343
|
});
|
|
9285
9344
|
return /* @__PURE__ */ jsxs("div", {
|
|
9286
9345
|
children: [renderInput(), showProductItems ? transitions((styles, item) => item && /* @__PURE__ */ jsx(animated.div, {
|
|
9287
|
-
className: `border-l-
|
|
9346
|
+
className: `border-l-2 border-gray-300 ${nestedLvl >= 1 && "ml-4 pl-4"}`,
|
|
9288
9347
|
style: styles,
|
|
9289
9348
|
children
|
|
9290
9349
|
}, nestedLvl + 1)) : null]
|
|
@@ -9304,7 +9363,8 @@ function MenuItemsDispatcher(props) {
|
|
|
9304
9363
|
productItems,
|
|
9305
9364
|
nestedLvl = 1,
|
|
9306
9365
|
parentProduct,
|
|
9307
|
-
rootProduct
|
|
9366
|
+
rootProduct,
|
|
9367
|
+
showOutsideAvailabilitySlotItems
|
|
9308
9368
|
} = props;
|
|
9309
9369
|
const {
|
|
9310
9370
|
attrs: parentAttrs = {},
|
|
@@ -9320,7 +9380,7 @@ function MenuItemsDispatcher(props) {
|
|
|
9320
9380
|
} = useComponents();
|
|
9321
9381
|
const renderMenuItem = (productItem) => {
|
|
9322
9382
|
var _a;
|
|
9323
|
-
if (isAnyGroupOptionKind(productItem.kind) && !((_a = productItem == null ? void 0 : productItem.items) == null ? void 0 : _a.find((x2) => {
|
|
9383
|
+
if (showOutsideAvailabilitySlotItems !== true && (productItem == null ? void 0 : productItem.outsideAvailabilitySlot) === true || isAnyGroupOptionKind(productItem.kind) && !((_a = productItem == null ? void 0 : productItem.items) == null ? void 0 : _a.find((x2) => {
|
|
9324
9384
|
var _a2, _b;
|
|
9325
9385
|
return ((_a2 = x2 == null ? void 0 : x2.attrs) == null ? void 0 : _a2.hidden) !== true && ((_b = x2 == null ? void 0 : x2._) == null ? void 0 : _b.hidden) !== "true";
|
|
9326
9386
|
}))) {
|
|
@@ -9398,7 +9458,7 @@ const showMoreLessButton = (text, handleClick, isShowMore) => {
|
|
|
9398
9458
|
className: "flex px-2 text-lg font-semibold text-black",
|
|
9399
9459
|
onClick: handleClick,
|
|
9400
9460
|
children: [text, /* @__PURE__ */ jsxs("svg", {
|
|
9401
|
-
className: `-mr-2
|
|
9461
|
+
className: `-mr-2 size-7 ${!isShowMore && "rotate-180"}`,
|
|
9402
9462
|
width: "24",
|
|
9403
9463
|
height: "24",
|
|
9404
9464
|
viewBox: "0 0 24 24",
|
|
@@ -9472,7 +9532,7 @@ function SubmitRow(props) {
|
|
|
9472
9532
|
className: "inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",
|
|
9473
9533
|
onClick: handleGoBack,
|
|
9474
9534
|
children: [/* @__PURE__ */ jsxs("svg", {
|
|
9475
|
-
className: "
|
|
9535
|
+
className: "size-5 text-red-600",
|
|
9476
9536
|
width: "24",
|
|
9477
9537
|
height: "24",
|
|
9478
9538
|
viewBox: "0 0 24 24",
|
|
@@ -9522,7 +9582,7 @@ function SubmitRow(props) {
|
|
|
9522
9582
|
disabled: displayPriceFrom,
|
|
9523
9583
|
onClick: handleOnSubmit,
|
|
9524
9584
|
children: [/* @__PURE__ */ jsxs("svg", {
|
|
9525
|
-
className: "
|
|
9585
|
+
className: "size-5 mr-2 text-white",
|
|
9526
9586
|
viewBox: "0 0 24 24",
|
|
9527
9587
|
fill: "none",
|
|
9528
9588
|
stroke: "currentColor",
|
|
@@ -10554,13 +10614,13 @@ function Modal(props) {
|
|
|
10554
10614
|
leaveTo: "opacity-0 scale-95",
|
|
10555
10615
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10556
10616
|
id: "modal-content",
|
|
10557
|
-
className: `inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-
|
|
10617
|
+
className: `inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-screen sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]`,
|
|
10558
10618
|
children: [/* @__PURE__ */ jsx("div", {
|
|
10559
10619
|
className: "sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",
|
|
10560
10620
|
children: /* @__PURE__ */ jsx("div", {
|
|
10561
10621
|
className: "",
|
|
10562
10622
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
10563
|
-
className: "
|
|
10623
|
+
className: "size-8 text-black cursor-pointer",
|
|
10564
10624
|
width: "24",
|
|
10565
10625
|
height: "24",
|
|
10566
10626
|
viewBox: "0 0 24 24",
|
|
@@ -10606,7 +10666,7 @@ function Modal(props) {
|
|
|
10606
10666
|
});
|
|
10607
10667
|
}
|
|
10608
10668
|
function MenuProductRootDefaultUI(props) {
|
|
10609
|
-
var _a, _b, _c, _d;
|
|
10669
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j;
|
|
10610
10670
|
const {
|
|
10611
10671
|
product,
|
|
10612
10672
|
isOpen,
|
|
@@ -10639,8 +10699,8 @@ function MenuProductRootDefaultUI(props) {
|
|
|
10639
10699
|
displayPriceFrom,
|
|
10640
10700
|
formattedEndPrice
|
|
10641
10701
|
} = formatPriceWithMinPrice(countedProductPrice, minPrice, productQuantity);
|
|
10642
|
-
const formContentRef1 = useRef();
|
|
10643
|
-
const formContentRef2 = useRef();
|
|
10702
|
+
const formContentRef1 = useRef(null);
|
|
10703
|
+
const formContentRef2 = useRef(null);
|
|
10644
10704
|
const {
|
|
10645
10705
|
isSm,
|
|
10646
10706
|
isMobile,
|
|
@@ -10652,10 +10712,10 @@ function MenuProductRootDefaultUI(props) {
|
|
|
10652
10712
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
10653
10713
|
className: clsx("px-4 w-full", isSm && "sm:sticky sm:top-0 sm:w-2/5"),
|
|
10654
10714
|
ref: formContentRef1,
|
|
10655
|
-
children: [product.details.media && product.details.media[0].url && /* @__PURE__ */ jsx("img", {
|
|
10715
|
+
children: [((_a = product.details) == null ? void 0 : _a.media) && product.details.media[0].url && /* @__PURE__ */ jsx("img", {
|
|
10656
10716
|
className: clsx("mx-auto mt-2 mb-6 max-h-[250px]", isSm && "max-h-[450px]"),
|
|
10657
|
-
alt: product.details.literals.name,
|
|
10658
|
-
src: (
|
|
10717
|
+
alt: (_c = (_b = product.details) == null ? void 0 : _b.literals) == null ? void 0 : _c.name,
|
|
10718
|
+
src: (_d = product.details) == null ? void 0 : _d.media[0].url
|
|
10659
10719
|
}), /* @__PURE__ */ jsx("div", {
|
|
10660
10720
|
className: clsx(!showDebugState && "hidden"),
|
|
10661
10721
|
children: /* @__PURE__ */ jsx(DisplayState, {})
|
|
@@ -10669,14 +10729,14 @@ function MenuProductRootDefaultUI(props) {
|
|
|
10669
10729
|
className: "flex justify-between w-full mb-4 text-2xl font-semibold",
|
|
10670
10730
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
10671
10731
|
className: "",
|
|
10672
|
-
children: [product.details.literals.name, " "]
|
|
10732
|
+
children: [(_f = (_e2 = product.details) == null ? void 0 : _e2.literals) == null ? void 0 : _f.name, " "]
|
|
10673
10733
|
}), /* @__PURE__ */ jsx(Price, {
|
|
10674
10734
|
price: props.countedProductPrice,
|
|
10675
10735
|
minPrice
|
|
10676
10736
|
})]
|
|
10677
10737
|
}), /* @__PURE__ */ jsx("span", {
|
|
10678
10738
|
className: "text-gray-600",
|
|
10679
|
-
children: (
|
|
10739
|
+
children: (_h = (_g = product.details) == null ? void 0 : _g.literals) == null ? void 0 : _h.description
|
|
10680
10740
|
})]
|
|
10681
10741
|
}), /* @__PURE__ */ jsxs("div", {
|
|
10682
10742
|
className: `items-center justify-center w-full px-4 product-configuration ${(product == null ? void 0 : product.items) && "py-2 bg-gray-100"}`,
|
|
@@ -10689,14 +10749,18 @@ function MenuProductRootDefaultUI(props) {
|
|
|
10689
10749
|
finalPrice: formattedEndPrice,
|
|
10690
10750
|
isBackIcon: false,
|
|
10691
10751
|
handleGoBack,
|
|
10692
|
-
displayPriceFrom
|
|
10752
|
+
displayPriceFrom,
|
|
10753
|
+
productQuantity,
|
|
10754
|
+
increaseProductQuantity,
|
|
10755
|
+
decreaseProductQuantity,
|
|
10756
|
+
handleOnSubmit
|
|
10693
10757
|
})
|
|
10694
10758
|
})]
|
|
10695
10759
|
})]
|
|
10696
10760
|
});
|
|
10697
|
-
const height = (
|
|
10698
|
-
const height2 = (
|
|
10699
|
-
const modalContentHeight = height + height2;
|
|
10761
|
+
const height = (_i = formContentRef1 == null ? void 0 : formContentRef1.current) == null ? void 0 : _i.clientHeight;
|
|
10762
|
+
const height2 = (_j = formContentRef2 == null ? void 0 : formContentRef2.current) == null ? void 0 : _j.clientHeight;
|
|
10763
|
+
const modalContentHeight = Number(height) + Number(height2);
|
|
10700
10764
|
if (modalContentHeight > window.innerHeight * 0.8 || isNaN(modalContentHeight)) {
|
|
10701
10765
|
if (formBodyHeight !== "80vh") {
|
|
10702
10766
|
setFormBodyHeight("80vh");
|
|
@@ -10716,7 +10780,7 @@ function MenuProductRootDefaultUI(props) {
|
|
|
10716
10780
|
handleClose: handleGoBack,
|
|
10717
10781
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10718
10782
|
id: "product-configurator-view",
|
|
10719
|
-
className: "
|
|
10783
|
+
className: "size-full",
|
|
10720
10784
|
style: {
|
|
10721
10785
|
overflow: "hidden",
|
|
10722
10786
|
textAlign: "left"
|
|
@@ -10822,7 +10886,8 @@ function useGroupsValidation(product) {
|
|
|
10822
10886
|
}
|
|
10823
10887
|
const MenuProductRoot = (props) => {
|
|
10824
10888
|
const {
|
|
10825
|
-
product
|
|
10889
|
+
product,
|
|
10890
|
+
showOutsideAvailabilitySlotItems
|
|
10826
10891
|
} = props;
|
|
10827
10892
|
const {
|
|
10828
10893
|
MenuProductRootUI
|
|
@@ -10833,7 +10898,8 @@ const MenuProductRoot = (props) => {
|
|
|
10833
10898
|
const MenuItemsDispatcherWrapper = !isEmpty(product.items) ? /* @__PURE__ */ jsx(MenuItemsDispatcher, {
|
|
10834
10899
|
productItems: product.items,
|
|
10835
10900
|
parentProduct: product,
|
|
10836
|
-
rootProduct: product
|
|
10901
|
+
rootProduct: product,
|
|
10902
|
+
showOutsideAvailabilitySlotItems
|
|
10837
10903
|
}) : /* @__PURE__ */ jsx(Fragment, {});
|
|
10838
10904
|
if (MenuProductRootUI) {
|
|
10839
10905
|
return /* @__PURE__ */ jsx(MenuProductRootUI, {
|
|
@@ -10877,7 +10943,8 @@ function ProductConfigurator(props) {
|
|
|
10877
10943
|
isOpen,
|
|
10878
10944
|
handleClose,
|
|
10879
10945
|
currency,
|
|
10880
|
-
showDebugState = false
|
|
10946
|
+
showDebugState = false,
|
|
10947
|
+
showOutsideAvailabilitySlotItems
|
|
10881
10948
|
} = props;
|
|
10882
10949
|
const {
|
|
10883
10950
|
price
|
|
@@ -10966,7 +11033,8 @@ function ProductConfigurator(props) {
|
|
|
10966
11033
|
countedProductTotalPrice: countedProductPrice * productQuantity,
|
|
10967
11034
|
increaseProductQuantity,
|
|
10968
11035
|
decreaseProductQuantity,
|
|
10969
|
-
currency
|
|
11036
|
+
currency,
|
|
11037
|
+
showOutsideAvailabilitySlotItems
|
|
10970
11038
|
})
|
|
10971
11039
|
})]
|
|
10972
11040
|
})
|
|
@@ -10976,4 +11044,3 @@ function ProductConfigurator(props) {
|
|
|
10976
11044
|
});
|
|
10977
11045
|
}
|
|
10978
11046
|
export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, getProductToChangeInForm, index_esm as hookForm, selectProductsInForm, unselectProductsInForm, useMenuOptions, useProductData, useStore, validateProductFilter };
|
|
10979
|
-
//# sourceMappingURL=index.es.js.map
|