@gomusdev/web-components 4.16.1 → 4.17.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/README.md +12 -0
- package/dist-js/gomus-webcomponents.iife.js +20 -10
- package/dist-js/gomus-webcomponents.js +20 -10
- package/dist-js/gomus-webcomponents.min.iife.js +14 -14
- package/dist-js/gomus-webcomponents.min.js +788 -780
- package/dist-js/src/config/configStore.svelte.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.17.1 (2026-08-14)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **forms:** stop coercing text-field values to numbers in formData
|
|
8
|
+
|
|
9
|
+
## 4.17.0 (2026-08-12)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **cart:** add quantityStepperAtMinimum config to disable − at the line minimum
|
|
14
|
+
|
|
3
15
|
## 4.16.1 (2026-08-12)
|
|
4
16
|
|
|
5
17
|
### Bug Fixes
|
|
@@ -14278,7 +14278,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14278
14278
|
},
|
|
14279
14279
|
forms: {},
|
|
14280
14280
|
fields: {},
|
|
14281
|
-
quantityStepper: true
|
|
14281
|
+
quantityStepper: true,
|
|
14282
|
+
quantityStepperAtMinimum: "remove"
|
|
14282
14283
|
};
|
|
14283
14284
|
var ConfigStoreSvelte = class {
|
|
14284
14285
|
defaultConfig = assign(defaultConfig, window.customOptions);
|
|
@@ -14962,14 +14963,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14962
14963
|
set(this.#successMessage, value, true);
|
|
14963
14964
|
}
|
|
14964
14965
|
get formData() {
|
|
14965
|
-
|
|
14966
|
+
const numericTypes = [
|
|
14967
|
+
"select",
|
|
14968
|
+
"radio",
|
|
14969
|
+
"number",
|
|
14970
|
+
"paymentMode"
|
|
14971
|
+
];
|
|
14972
|
+
function coerce(f) {
|
|
14973
|
+
const x = f.value;
|
|
14966
14974
|
if (isNumber(x) || isBoolean(x)) return x;
|
|
14967
14975
|
if (x === "true" || x === "false") return x === "true";
|
|
14968
|
-
if (!Number.isNaN(+x) && x.trim() !== "") return +x;
|
|
14976
|
+
if (numericTypes.includes(f.type) && !Number.isNaN(+x) && x.trim() !== "") return +x;
|
|
14969
14977
|
return x;
|
|
14970
14978
|
}
|
|
14971
14979
|
const validFields = this.fields.filter((f) => f !== void 0).filter((f) => f.type !== "file").filter((f) => f.value !== "");
|
|
14972
|
-
return Object.fromEntries(validFields.map((f) => [f.apiKey, coerce(f
|
|
14980
|
+
return Object.fromEntries(validFields.map((f) => [f.apiKey, coerce(f)]));
|
|
14973
14981
|
}
|
|
14974
14982
|
fieldValue(key) {
|
|
14975
14983
|
return this.fields.find((f) => f.key === key)?.value;
|
|
@@ -16031,6 +16039,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16031
16039
|
/** Emits the next committed quantity. The control never mutates anything itself. */
|
|
16032
16040
|
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), onChange = prop($$props, "onChange", 7);
|
|
16033
16041
|
const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
|
|
16042
|
+
const disabledAtMinimum = /* @__PURE__ */ user_derived(() => onDecrementBelowMin() != null && configStore.config.quantityStepperAtMinimum === "disable");
|
|
16034
16043
|
var $$exports = {
|
|
16035
16044
|
get value() {
|
|
16036
16045
|
return value();
|
|
@@ -16093,11 +16102,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16093
16102
|
var node = first_child(fragment);
|
|
16094
16103
|
var consequent = ($$anchor) => {
|
|
16095
16104
|
{
|
|
16096
|
-
let $0 = /* @__PURE__ */ user_derived(() => deselectable() ? 0 : min());
|
|
16105
|
+
let $0 = /* @__PURE__ */ user_derived(() => get$2(disabledAtMinimum) ? Math.max(min(), 1) : deselectable() ? 0 : min());
|
|
16097
16106
|
let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
|
|
16098
16107
|
let $2 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
|
|
16099
|
-
let $3 = /* @__PURE__ */ user_derived(() =>
|
|
16100
|
-
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove
|
|
16108
|
+
let $3 = /* @__PURE__ */ user_derived(() => get$2(disabledAtMinimum) ? void 0 : onDecrementBelowMin());
|
|
16109
|
+
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove"));
|
|
16110
|
+
let $5 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove.label"));
|
|
16101
16111
|
QuantityStepper($$anchor, {
|
|
16102
16112
|
get value() {
|
|
16103
16113
|
return value();
|
|
@@ -16121,13 +16131,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16121
16131
|
return get$2($2);
|
|
16122
16132
|
},
|
|
16123
16133
|
get onDecrementBelowMin() {
|
|
16124
|
-
return
|
|
16134
|
+
return get$2($3);
|
|
16125
16135
|
},
|
|
16126
16136
|
get removeAriaLabel() {
|
|
16127
|
-
return get$2($
|
|
16137
|
+
return get$2($4);
|
|
16128
16138
|
},
|
|
16129
16139
|
get removeLabel() {
|
|
16130
|
-
return get$2($
|
|
16140
|
+
return get$2($5);
|
|
16131
16141
|
},
|
|
16132
16142
|
get onChange() {
|
|
16133
16143
|
return onChange();
|
|
@@ -14277,7 +14277,8 @@ var defaultConfig = {
|
|
|
14277
14277
|
},
|
|
14278
14278
|
forms: {},
|
|
14279
14279
|
fields: {},
|
|
14280
|
-
quantityStepper: true
|
|
14280
|
+
quantityStepper: true,
|
|
14281
|
+
quantityStepperAtMinimum: "remove"
|
|
14281
14282
|
};
|
|
14282
14283
|
var ConfigStoreSvelte = class {
|
|
14283
14284
|
defaultConfig = assign(defaultConfig, window.customOptions);
|
|
@@ -14961,14 +14962,21 @@ var FormDetails = class {
|
|
|
14961
14962
|
set(this.#successMessage, value, true);
|
|
14962
14963
|
}
|
|
14963
14964
|
get formData() {
|
|
14964
|
-
|
|
14965
|
+
const numericTypes = [
|
|
14966
|
+
"select",
|
|
14967
|
+
"radio",
|
|
14968
|
+
"number",
|
|
14969
|
+
"paymentMode"
|
|
14970
|
+
];
|
|
14971
|
+
function coerce(f) {
|
|
14972
|
+
const x = f.value;
|
|
14965
14973
|
if (isNumber(x) || isBoolean(x)) return x;
|
|
14966
14974
|
if (x === "true" || x === "false") return x === "true";
|
|
14967
|
-
if (!Number.isNaN(+x) && x.trim() !== "") return +x;
|
|
14975
|
+
if (numericTypes.includes(f.type) && !Number.isNaN(+x) && x.trim() !== "") return +x;
|
|
14968
14976
|
return x;
|
|
14969
14977
|
}
|
|
14970
14978
|
const validFields = this.fields.filter((f) => f !== void 0).filter((f) => f.type !== "file").filter((f) => f.value !== "");
|
|
14971
|
-
return Object.fromEntries(validFields.map((f) => [f.apiKey, coerce(f
|
|
14979
|
+
return Object.fromEntries(validFields.map((f) => [f.apiKey, coerce(f)]));
|
|
14972
14980
|
}
|
|
14973
14981
|
fieldValue(key) {
|
|
14974
14982
|
return this.fields.find((f) => f.key === key)?.value;
|
|
@@ -16030,6 +16038,7 @@ function QuantityControl($$anchor, $$props) {
|
|
|
16030
16038
|
/** Emits the next committed quantity. The control never mutates anything itself. */
|
|
16031
16039
|
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), onChange = prop($$props, "onChange", 7);
|
|
16032
16040
|
const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
|
|
16041
|
+
const disabledAtMinimum = /* @__PURE__ */ user_derived(() => onDecrementBelowMin() != null && configStore.config.quantityStepperAtMinimum === "disable");
|
|
16033
16042
|
var $$exports = {
|
|
16034
16043
|
get value() {
|
|
16035
16044
|
return value();
|
|
@@ -16092,11 +16101,12 @@ function QuantityControl($$anchor, $$props) {
|
|
|
16092
16101
|
var node = first_child(fragment);
|
|
16093
16102
|
var consequent = ($$anchor) => {
|
|
16094
16103
|
{
|
|
16095
|
-
let $0 = /* @__PURE__ */ user_derived(() => deselectable() ? 0 : min());
|
|
16104
|
+
let $0 = /* @__PURE__ */ user_derived(() => get$2(disabledAtMinimum) ? Math.max(min(), 1) : deselectable() ? 0 : min());
|
|
16096
16105
|
let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
|
|
16097
16106
|
let $2 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
|
|
16098
|
-
let $3 = /* @__PURE__ */ user_derived(() =>
|
|
16099
|
-
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove
|
|
16107
|
+
let $3 = /* @__PURE__ */ user_derived(() => get$2(disabledAtMinimum) ? void 0 : onDecrementBelowMin());
|
|
16108
|
+
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove"));
|
|
16109
|
+
let $5 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove.label"));
|
|
16100
16110
|
QuantityStepper($$anchor, {
|
|
16101
16111
|
get value() {
|
|
16102
16112
|
return value();
|
|
@@ -16120,13 +16130,13 @@ function QuantityControl($$anchor, $$props) {
|
|
|
16120
16130
|
return get$2($2);
|
|
16121
16131
|
},
|
|
16122
16132
|
get onDecrementBelowMin() {
|
|
16123
|
-
return
|
|
16133
|
+
return get$2($3);
|
|
16124
16134
|
},
|
|
16125
16135
|
get removeAriaLabel() {
|
|
16126
|
-
return get$2($
|
|
16136
|
+
return get$2($4);
|
|
16127
16137
|
},
|
|
16128
16138
|
get removeLabel() {
|
|
16129
|
-
return get$2($
|
|
16139
|
+
return get$2($5);
|
|
16130
16140
|
},
|
|
16131
16141
|
get onChange() {
|
|
16132
16142
|
return onChange();
|