@fctc/sme-widget-ui 1.8.5 → 1.8.6

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.js CHANGED
@@ -17186,7 +17186,7 @@ var baseStyle = {
17186
17186
  height: "fit-content"
17187
17187
  };
17188
17188
  var ButtonBadgeField = (props) => {
17189
- const { defaultValue, selection, value, formValues, domainHelper } = props;
17189
+ const { defaultValue, selection, value, formValues, domainHelper, type } = props;
17190
17190
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
17191
17191
  const decorationInfo = props["decoration-info"] && domainHelper.checkDomain(formValues, props["decoration-info"]);
17192
17192
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
@@ -17200,13 +17200,13 @@ var ButtonBadgeField = (props) => {
17200
17200
  };
17201
17201
  const getLabel = (value2) => {
17202
17202
  if (!value2) return "";
17203
- const item = selection?.find(
17203
+ const item = type === "selection" ? selection?.find(
17204
17204
  (item2) => Array.isArray(item2) && item2[0] === value2
17205
- );
17206
- return item ? item[1] : "";
17205
+ ) : value2;
17206
+ return item && type === "selection" && Array.isArray(item) ? item[1] : item;
17207
17207
  };
17208
17208
  const label = getLabel(defaultValue ?? value);
17209
- return label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
17209
+ return label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { style: { ...baseStyle, ...getType() }, children: label }) : null;
17210
17210
  };
17211
17211
 
17212
17212
  // src/widgets/basic/button-field/button.tsx
package/dist/index.mjs CHANGED
@@ -17064,7 +17064,7 @@ var baseStyle = {
17064
17064
  height: "fit-content"
17065
17065
  };
17066
17066
  var ButtonBadgeField = (props) => {
17067
- const { defaultValue, selection, value, formValues, domainHelper } = props;
17067
+ const { defaultValue, selection, value, formValues, domainHelper, type } = props;
17068
17068
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
17069
17069
  const decorationInfo = props["decoration-info"] && domainHelper.checkDomain(formValues, props["decoration-info"]);
17070
17070
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
@@ -17078,13 +17078,13 @@ var ButtonBadgeField = (props) => {
17078
17078
  };
17079
17079
  const getLabel = (value2) => {
17080
17080
  if (!value2) return "";
17081
- const item = selection?.find(
17081
+ const item = type === "selection" ? selection?.find(
17082
17082
  (item2) => Array.isArray(item2) && item2[0] === value2
17083
- );
17084
- return item ? item[1] : "";
17083
+ ) : value2;
17084
+ return item && type === "selection" && Array.isArray(item) ? item[1] : item;
17085
17085
  };
17086
17086
  const label = getLabel(defaultValue ?? value);
17087
- return label ? /* @__PURE__ */ jsx72("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
17087
+ return label ? /* @__PURE__ */ jsx72("div", { style: { ...baseStyle, ...getType() }, children: label }) : null;
17088
17088
  };
17089
17089
 
17090
17090
  // src/widgets/basic/button-field/button.tsx
package/dist/widgets.js CHANGED
@@ -16592,7 +16592,7 @@ var baseStyle = {
16592
16592
  height: "fit-content"
16593
16593
  };
16594
16594
  var ButtonBadgeField = (props) => {
16595
- const { defaultValue, selection, value, formValues, domainHelper } = props;
16595
+ const { defaultValue, selection, value, formValues, domainHelper, type } = props;
16596
16596
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
16597
16597
  const decorationInfo = props["decoration-info"] && domainHelper.checkDomain(formValues, props["decoration-info"]);
16598
16598
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
@@ -16606,13 +16606,13 @@ var ButtonBadgeField = (props) => {
16606
16606
  };
16607
16607
  const getLabel = (value2) => {
16608
16608
  if (!value2) return "";
16609
- const item = selection?.find(
16609
+ const item = type === "selection" ? selection?.find(
16610
16610
  (item2) => Array.isArray(item2) && item2[0] === value2
16611
- );
16612
- return item ? item[1] : "";
16611
+ ) : value2;
16612
+ return item && type === "selection" && Array.isArray(item) ? item[1] : item;
16613
16613
  };
16614
16614
  const label = getLabel(defaultValue ?? value);
16615
- return label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
16615
+ return label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { style: { ...baseStyle, ...getType() }, children: label }) : null;
16616
16616
  };
16617
16617
 
16618
16618
  // src/widgets/basic/button-field/button.tsx
package/dist/widgets.mjs CHANGED
@@ -16529,7 +16529,7 @@ var baseStyle = {
16529
16529
  height: "fit-content"
16530
16530
  };
16531
16531
  var ButtonBadgeField = (props) => {
16532
- const { defaultValue, selection, value, formValues, domainHelper } = props;
16532
+ const { defaultValue, selection, value, formValues, domainHelper, type } = props;
16533
16533
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
16534
16534
  const decorationInfo = props["decoration-info"] && domainHelper.checkDomain(formValues, props["decoration-info"]);
16535
16535
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
@@ -16543,13 +16543,13 @@ var ButtonBadgeField = (props) => {
16543
16543
  };
16544
16544
  const getLabel = (value2) => {
16545
16545
  if (!value2) return "";
16546
- const item = selection?.find(
16546
+ const item = type === "selection" ? selection?.find(
16547
16547
  (item2) => Array.isArray(item2) && item2[0] === value2
16548
- );
16549
- return item ? item[1] : "";
16548
+ ) : value2;
16549
+ return item && type === "selection" && Array.isArray(item) ? item[1] : item;
16550
16550
  };
16551
16551
  const label = getLabel(defaultValue ?? value);
16552
- return label ? /* @__PURE__ */ jsx72("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
16552
+ return label ? /* @__PURE__ */ jsx72("div", { style: { ...baseStyle, ...getType() }, children: label }) : null;
16553
16553
  };
16554
16554
 
16555
16555
  // src/widgets/basic/button-field/button.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",