@orderingstack/front-components-product-configurator 1.0.2 → 1.0.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/components/MenuProduct/useMenuProduct.d.ts.map +1 -1
- package/dist/components/MenuProductRoot/{MenuProductRootDefaultShitUI.d.ts → MenuProductRootDefaultUI.d.ts} +2 -2
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts.map +1 -0
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts +8 -0
- package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts.map +1 -0
- package/dist/components/ProductConfigurator/{ProductConfiguratorNew.d.ts → ProductConfigurator.d.ts} +1 -1
- package/dist/components/ProductConfigurator/ProductConfigurator.d.ts.map +1 -0
- package/dist/components/ProductConfigurator/index.d.ts +3 -0
- package/dist/components/ProductConfigurator/index.d.ts.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +10 -8
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +86 -86
- package/dist/components/MenuProductRoot/MenuProductRootDefaultShitUI.d.ts.map +0 -1
- package/dist/components/ProductConfigurator/ProductConfiguratorNew.d.ts.map +0 -1
- package/dist/views/Modal/Modal.d.ts +0 -8
- package/dist/views/Modal/Modal.d.ts.map +0 -1
- package/dist/views/Modal/index.d.ts +0 -3
- package/dist/views/Modal/index.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -7958,7 +7958,7 @@ function useMenuProduct(product, parentAttrs) {
|
|
|
7958
7958
|
const isRadio = parentSelMin === "1" && parentSelMax === "1";
|
|
7959
7959
|
const isCheckbox = !isRadio;
|
|
7960
7960
|
const isCounter = isApiBooleanTrue(parentAllowMultiple);
|
|
7961
|
-
const isDecrementEnabled = valueNumber > 1;
|
|
7961
|
+
const isDecrementEnabled = valueNumber > (isRadio ? 1 : 0);
|
|
7962
7962
|
const isIncrementEnabled = isInputCounterIncrementEnabled2(product, selected) && (isInputEnabled2(product) || valueNumber);
|
|
7963
7963
|
const isChecked = Number(((_a = selected == null ? void 0 : selected[selCtx]) == null ? void 0 : _a[id]) || 0) > 0;
|
|
7964
7964
|
const isCheckboxEnabled = isInputEnabled2(product) || valueNumber;
|
|
@@ -7974,6 +7974,9 @@ function useMenuProduct(product, parentAttrs) {
|
|
|
7974
7974
|
const handleCounterDecrementQty = () => {
|
|
7975
7975
|
const decrementedValue = valueNumber - 1;
|
|
7976
7976
|
setValue(`selected.${selCtx}.${id}`, `${decrementedValue}`);
|
|
7977
|
+
if (isCheckbox && decrementedValue === 0) {
|
|
7978
|
+
setValue(`selected.${selCtx}.${id}`, false);
|
|
7979
|
+
}
|
|
7977
7980
|
};
|
|
7978
7981
|
const handleOnInputChange = (e2) => {
|
|
7979
7982
|
const {
|
|
@@ -9330,7 +9333,7 @@ let Pe = "div", ie = S$1.RenderStrategy, oe = C$1(function(e$12, s2) {
|
|
|
9330
9333
|
let n2 = useContext(A) !== null, m2 = s$3() !== null;
|
|
9331
9334
|
return React.createElement(React.Fragment, null, !n2 && m2 ? React.createElement(J, { ref: s2, ...e2 }) : React.createElement(oe, { ref: s2, ...e2 }));
|
|
9332
9335
|
}), Je = Object.assign(J, { Child: ye, Root: J });
|
|
9333
|
-
function
|
|
9336
|
+
function Modal(props) {
|
|
9334
9337
|
const {
|
|
9335
9338
|
children,
|
|
9336
9339
|
isOpen,
|
|
@@ -9348,7 +9351,7 @@ function ModalView(props) {
|
|
|
9348
9351
|
as: Fragment$1,
|
|
9349
9352
|
children: /* @__PURE__ */ jsx(mt, {
|
|
9350
9353
|
as: "div",
|
|
9351
|
-
className: "
|
|
9354
|
+
className: "fixed inset-0 z-10 overflow-y-auto",
|
|
9352
9355
|
style: {
|
|
9353
9356
|
backgroundColor: "rgba(0,0,0,.75)"
|
|
9354
9357
|
},
|
|
@@ -9382,7 +9385,7 @@ function ModalView(props) {
|
|
|
9382
9385
|
id: "modal-content",
|
|
9383
9386
|
className: `inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]`,
|
|
9384
9387
|
children: [/* @__PURE__ */ jsx("div", {
|
|
9385
|
-
className: "
|
|
9388
|
+
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",
|
|
9386
9389
|
children: /* @__PURE__ */ jsx("div", {
|
|
9387
9390
|
className: "",
|
|
9388
9391
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
@@ -9431,7 +9434,7 @@ function ModalView(props) {
|
|
|
9431
9434
|
})
|
|
9432
9435
|
});
|
|
9433
9436
|
}
|
|
9434
|
-
function
|
|
9437
|
+
function MenuProductRootDefaultUI(props) {
|
|
9435
9438
|
var _a, _b, _c, _d;
|
|
9436
9439
|
const {
|
|
9437
9440
|
product,
|
|
@@ -9537,7 +9540,7 @@ function MenuProductRootDefaultShitUI(props) {
|
|
|
9537
9540
|
const style2 = {
|
|
9538
9541
|
"--mobile-submit-row-top": `${windowHeight - 64 - 80}px`
|
|
9539
9542
|
};
|
|
9540
|
-
return /* @__PURE__ */ jsx(
|
|
9543
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
9541
9544
|
isOpen: Boolean(isOpen),
|
|
9542
9545
|
handleClose: handleGoBack,
|
|
9543
9546
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -9588,7 +9591,7 @@ const MenuProductRoot = (props) => {
|
|
|
9588
9591
|
children: MenuItemsDispatcherWrapper
|
|
9589
9592
|
});
|
|
9590
9593
|
}
|
|
9591
|
-
return /* @__PURE__ */ jsx(
|
|
9594
|
+
return /* @__PURE__ */ jsx(MenuProductRootDefaultUI, {
|
|
9592
9595
|
...props,
|
|
9593
9596
|
children: MenuItemsDispatcherWrapper
|
|
9594
9597
|
});
|
|
@@ -9671,7 +9674,6 @@ function ProductConfigurator(props) {
|
|
|
9671
9674
|
children: /* @__PURE__ */ jsx(FormProvider, {
|
|
9672
9675
|
...methods,
|
|
9673
9676
|
children: /* @__PURE__ */ jsxs("form", {
|
|
9674
|
-
onSubmit: handleSubmit(onSubmit),
|
|
9675
9677
|
children: [showDebugState && /* @__PURE__ */ jsx("div", {
|
|
9676
9678
|
className: "hidden",
|
|
9677
9679
|
children: /* @__PURE__ */ jsx(DisplayState, {})
|