@lime-bundles/widget 4.4.0 → 4.5.0
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/index.cjs +10 -0
- package/dist/index.js +10 -0
- package/dist/lime-bundle.global.js +4 -4
- package/dist/lime-bundle.global.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3694,6 +3694,12 @@ function createWizard(deps) {
|
|
|
3694
3694
|
for (const r of rows) r.refresh();
|
|
3695
3695
|
updateModalMeta();
|
|
3696
3696
|
}
|
|
3697
|
+
function maybeAutoAdvance() {
|
|
3698
|
+
if (!deps.autoAdvance) return;
|
|
3699
|
+
if (stepIndex >= steps.length - 1) return;
|
|
3700
|
+
if (stepHeadroom(selections, steps, stepIndex) !== 0) return;
|
|
3701
|
+
goToStep(stepIndex + 1);
|
|
3702
|
+
}
|
|
3697
3703
|
function buildProductList(forStep) {
|
|
3698
3704
|
if (!modalList) return;
|
|
3699
3705
|
deps.dropdown?.unbindAll(modalList);
|
|
@@ -3710,6 +3716,7 @@ function createWizard(deps) {
|
|
|
3710
3716
|
onCommittedQtyChanged: () => {
|
|
3711
3717
|
deps.onSelectionChanged();
|
|
3712
3718
|
refresh();
|
|
3719
|
+
maybeAutoAdvance();
|
|
3713
3720
|
}
|
|
3714
3721
|
});
|
|
3715
3722
|
rows.push(row);
|
|
@@ -3789,6 +3796,7 @@ function createWizard(deps) {
|
|
|
3789
3796
|
selections[stepIndex].push(newItem);
|
|
3790
3797
|
deps.onSelectionChanged();
|
|
3791
3798
|
refresh();
|
|
3799
|
+
maybeAutoAdvance();
|
|
3792
3800
|
}
|
|
3793
3801
|
if (modalList) modalList.addEventListener("click", onListClick);
|
|
3794
3802
|
function buildFilters(forStep) {
|
|
@@ -4172,6 +4180,8 @@ function renderMultiStepBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
4172
4180
|
rulesMap,
|
|
4173
4181
|
showQtySelector: wc.mixMatchShowQuantitySelector !== false,
|
|
4174
4182
|
showTypeFilters: wc.mixMatchShowTypeFilters !== false,
|
|
4183
|
+
// Off by default: a stored config predating the key must not advance.
|
|
4184
|
+
autoAdvance: wc.multiStepAutoAdvance === true,
|
|
4175
4185
|
formatMoney,
|
|
4176
4186
|
dropdown: void 0,
|
|
4177
4187
|
portalTarget: null,
|
package/dist/index.js
CHANGED
|
@@ -3702,6 +3702,12 @@ function createWizard(deps) {
|
|
|
3702
3702
|
for (const r of rows) r.refresh();
|
|
3703
3703
|
updateModalMeta();
|
|
3704
3704
|
}
|
|
3705
|
+
function maybeAutoAdvance() {
|
|
3706
|
+
if (!deps.autoAdvance) return;
|
|
3707
|
+
if (stepIndex >= steps.length - 1) return;
|
|
3708
|
+
if (stepHeadroom(selections, steps, stepIndex) !== 0) return;
|
|
3709
|
+
goToStep(stepIndex + 1);
|
|
3710
|
+
}
|
|
3705
3711
|
function buildProductList(forStep) {
|
|
3706
3712
|
if (!modalList) return;
|
|
3707
3713
|
deps.dropdown?.unbindAll(modalList);
|
|
@@ -3718,6 +3724,7 @@ function createWizard(deps) {
|
|
|
3718
3724
|
onCommittedQtyChanged: () => {
|
|
3719
3725
|
deps.onSelectionChanged();
|
|
3720
3726
|
refresh();
|
|
3727
|
+
maybeAutoAdvance();
|
|
3721
3728
|
}
|
|
3722
3729
|
});
|
|
3723
3730
|
rows.push(row);
|
|
@@ -3797,6 +3804,7 @@ function createWizard(deps) {
|
|
|
3797
3804
|
selections[stepIndex].push(newItem);
|
|
3798
3805
|
deps.onSelectionChanged();
|
|
3799
3806
|
refresh();
|
|
3807
|
+
maybeAutoAdvance();
|
|
3800
3808
|
}
|
|
3801
3809
|
if (modalList) modalList.addEventListener("click", onListClick);
|
|
3802
3810
|
function buildFilters(forStep) {
|
|
@@ -4180,6 +4188,8 @@ function renderMultiStepBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
4180
4188
|
rulesMap,
|
|
4181
4189
|
showQtySelector: wc.mixMatchShowQuantitySelector !== false,
|
|
4182
4190
|
showTypeFilters: wc.mixMatchShowTypeFilters !== false,
|
|
4191
|
+
// Off by default: a stored config predating the key must not advance.
|
|
4192
|
+
autoAdvance: wc.multiStepAutoAdvance === true,
|
|
4183
4193
|
formatMoney,
|
|
4184
4194
|
dropdown: void 0,
|
|
4185
4195
|
portalTarget: null,
|