@oliasoft-open-source/react-ui-library 8.0.0-beta-9 → 8.0.0-beta-11
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/menu/trigger/component.d.ts.map +1 -1
- package/dist/components/unit-slider/unit-slider.d.ts +2 -1
- package/dist/components/unit-slider/unit-slider.d.ts.map +1 -1
- package/dist/components/unit-slider/unit-slider.test-case.stories.d.ts +1 -1
- package/dist/global.css +1 -1
- package/dist/index.js +98 -92
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -844,39 +844,34 @@ var _a = {
|
|
|
844
844
|
let { sections: t } = e;
|
|
845
845
|
return !s(t) && (!Array.isArray(t) || t.every((e) => cn(e)));
|
|
846
846
|
}, J = {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
menuPopover: "_menuPopover_uahkz_211",
|
|
876
|
-
menuPopoverNested: "_menuPopoverNested_uahkz_233",
|
|
877
|
-
modalContainer: "_modalContainer_uahkz_236",
|
|
878
|
-
menuItem: "_menuItem_uahkz_239",
|
|
879
|
-
customSections: "_customSections_uahkz_254"
|
|
847
|
+
layer: "_layer_v9hv9_1",
|
|
848
|
+
nested: "_nested_v9hv9_14",
|
|
849
|
+
fileInput: "_fileInput_v9hv9_17",
|
|
850
|
+
trigger: "_trigger_v9hv9_23",
|
|
851
|
+
heading: "_heading_v9hv9_32",
|
|
852
|
+
headingIcon: "_headingIcon_v9hv9_38",
|
|
853
|
+
clickable: "_clickable_v9hv9_45",
|
|
854
|
+
option: "_option_v9hv9_49",
|
|
855
|
+
active: "_active_v9hv9_68",
|
|
856
|
+
disabled: "_disabled_v9hv9_73",
|
|
857
|
+
selected: "_selected_v9hv9_76",
|
|
858
|
+
optionContent: "_optionContent_v9hv9_83",
|
|
859
|
+
inline: "_inline_v9hv9_87",
|
|
860
|
+
icon: "_icon_v9hv9_92",
|
|
861
|
+
check: "_check_v9hv9_93",
|
|
862
|
+
label: "_label_v9hv9_119",
|
|
863
|
+
description: "_description_v9hv9_131",
|
|
864
|
+
arrow: "_arrow_v9hv9_135",
|
|
865
|
+
divider: "_divider_v9hv9_139",
|
|
866
|
+
buttonLabel: "_buttonLabel_v9hv9_147",
|
|
867
|
+
component: "_component_v9hv9_154",
|
|
868
|
+
right: "_right_v9hv9_160",
|
|
869
|
+
actions: "_actions_v9hv9_165",
|
|
870
|
+
menuPopover: "_menuPopover_v9hv9_172",
|
|
871
|
+
menuPopoverNested: "_menuPopoverNested_v9hv9_194",
|
|
872
|
+
modalContainer: "_modalContainer_v9hv9_197",
|
|
873
|
+
menuItem: "_menuItem_v9hv9_200",
|
|
874
|
+
customSections: "_customSections_v9hv9_215"
|
|
880
875
|
}, Pa = ({ children: e, placement: t = "bottom-start", triggerRef: n, portalTriggerRef: r, isNested: i = !1, className: a, offset: o = 0 }) => {
|
|
881
876
|
let s = i ? void 0 : xa((r == null ? n : r).current);
|
|
882
877
|
return /* @__PURE__ */ x(On, {
|
|
@@ -1194,15 +1189,12 @@ var _a = {
|
|
|
1194
1189
|
if (s(e) && Ea(e)) {
|
|
1195
1190
|
var c;
|
|
1196
1191
|
let s = e, l = (c = s.props["data-testid"]) == null ? s.props.testId : c, u = typeof s.type == "string", d = s.ref;
|
|
1197
|
-
return
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
...u ? null : { active: !!(s.props.active || n) },
|
|
1204
|
-
...l ? null : u ? { "data-testid": i } : { testId: i }
|
|
1205
|
-
})
|
|
1192
|
+
return r(s, {
|
|
1193
|
+
...a,
|
|
1194
|
+
ref: Za(o, d),
|
|
1195
|
+
disabled: t || s.props.disabled,
|
|
1196
|
+
...u ? null : { active: !!(s.props.active || n) },
|
|
1197
|
+
...l ? null : u ? { "data-testid": i } : { testId: i }
|
|
1206
1198
|
});
|
|
1207
1199
|
}
|
|
1208
1200
|
return /* @__PURE__ */ x("div", {
|
|
@@ -7062,82 +7054,96 @@ var So = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Co =
|
|
|
7062
7054
|
}, yf = (e, t) => ({ target: {
|
|
7063
7055
|
name: e,
|
|
7064
7056
|
value: t
|
|
7065
|
-
} }), bf = (e) => `Value cannot be less than ${e}`, xf = (e) => `Value cannot be greater than ${e}`, Sf = ({ name: e = "", value: t, min: n, max: r, label: i, step: a = .01, onChange: o, onChangeComplete: s, preferredUnit: c = "m",
|
|
7066
|
-
let
|
|
7057
|
+
} }), bf = (e) => `Value cannot be less than ${e}`, xf = (e) => `Value cannot be greater than ${e}`, Sf = ({ name: e = "", value: t, min: n, max: r, label: i, step: a = .01, onChange: o, onChangeComplete: s, preferredUnit: c = "m", onSwitchUnit: l, enableEditUnitInput: u = !1, disabled: f = !1, showUnitInput: p = !0, showArrows: m = !0, unitkey: h = "length", testId: g, noConversion: v = !1, small: b = !1, marks: C, minErrorMessage: w = bf, maxErrorMessage: T = xf }) => {
|
|
7058
|
+
let E = Er(t, c), [D, O] = _(E), [k, A] = _(!1), [j, M] = _(c);
|
|
7067
7059
|
d(() => {
|
|
7068
|
-
|
|
7069
|
-
}, [
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7060
|
+
k || O(E);
|
|
7061
|
+
}, [k, E]), d(() => {
|
|
7062
|
+
M(c);
|
|
7063
|
+
}, [c]);
|
|
7064
|
+
let [N = "", P = c] = yr(D), F = xr(N), I = null;
|
|
7065
|
+
if (N.trim() !== "" && Number.isFinite(F)) try {
|
|
7066
|
+
I = v ? F : ir(F, c, P);
|
|
7073
7067
|
} catch {
|
|
7074
|
-
|
|
7075
|
-
}
|
|
7076
|
-
let
|
|
7077
|
-
!
|
|
7078
|
-
},
|
|
7079
|
-
|
|
7080
|
-
},
|
|
7081
|
-
|
|
7082
|
-
},
|
|
7083
|
-
e
|
|
7084
|
-
},
|
|
7068
|
+
I = null;
|
|
7069
|
+
}
|
|
7070
|
+
let L = I === null ? "Must be a numerical value" : I < n ? w(n) : I > r ? T(r) : "", R = () => {
|
|
7071
|
+
!u || f || (O(E), A(!0));
|
|
7072
|
+
}, z = () => {
|
|
7073
|
+
O(E), A(!1);
|
|
7074
|
+
}, B = () => {
|
|
7075
|
+
L || I === null || (o(yf(e, I)), s == null || s(yf(e, I)), A(!1));
|
|
7076
|
+
}, ee = (e) => {
|
|
7077
|
+
M(e), l == null || l(e);
|
|
7078
|
+
}, te = (e) => {
|
|
7079
|
+
let t = Array.isArray(e) ? e[0] : e;
|
|
7080
|
+
if (v || j === c) return Tr(hr(Er(t, j)));
|
|
7081
|
+
try {
|
|
7082
|
+
let e = ir(t, j, c);
|
|
7083
|
+
return Tr(hr(Er(e, j)));
|
|
7084
|
+
} catch {
|
|
7085
|
+
return Tr(hr(E));
|
|
7086
|
+
}
|
|
7087
|
+
}, ne = (e) => {
|
|
7088
|
+
e.key === "Enter" && B(), e.key === "Escape" && z();
|
|
7089
|
+
}, V = f || k, re = /* @__PURE__ */ S("div", {
|
|
7085
7090
|
className: Qd.actions,
|
|
7086
7091
|
children: [/* @__PURE__ */ x(q, {
|
|
7087
7092
|
icon: "close",
|
|
7088
7093
|
small: !0,
|
|
7089
|
-
onClick:
|
|
7090
|
-
testId:
|
|
7094
|
+
onClick: z,
|
|
7095
|
+
testId: g && `${g}-cancel`
|
|
7091
7096
|
}), /* @__PURE__ */ x(q, {
|
|
7092
7097
|
icon: "checkmark",
|
|
7093
7098
|
small: !0,
|
|
7094
|
-
disabled: !!
|
|
7095
|
-
onClick:
|
|
7096
|
-
testId:
|
|
7099
|
+
disabled: !!L,
|
|
7100
|
+
onClick: B,
|
|
7101
|
+
testId: g && `${g}-confirm`
|
|
7097
7102
|
})]
|
|
7098
7103
|
});
|
|
7099
7104
|
return /* @__PURE__ */ S("div", {
|
|
7100
7105
|
className: Qd.wrapper,
|
|
7101
|
-
"data-testid":
|
|
7106
|
+
"data-testid": g && `${g}-wrapper`,
|
|
7102
7107
|
children: [
|
|
7103
7108
|
i && /* @__PURE__ */ x("span", {
|
|
7104
7109
|
className: Qd.label,
|
|
7105
7110
|
children: /* @__PURE__ */ x(Ho, {
|
|
7106
|
-
small:
|
|
7111
|
+
small: b,
|
|
7107
7112
|
children: i
|
|
7108
7113
|
})
|
|
7109
7114
|
}),
|
|
7110
|
-
|
|
7111
|
-
className: y(Qd.input,
|
|
7115
|
+
p && /* @__PURE__ */ x("div", {
|
|
7116
|
+
className: y(Qd.input, b && Qd.inputSmall, u && !f && Qd.editable),
|
|
7112
7117
|
children: /* @__PURE__ */ x(ho, {
|
|
7113
|
-
content:
|
|
7114
|
-
isOpen:
|
|
7118
|
+
content: re,
|
|
7119
|
+
isOpen: k,
|
|
7115
7120
|
isNonModal: !0,
|
|
7116
7121
|
closeOnOutsideClick: !1,
|
|
7117
7122
|
restoreTriggerFocusOnClose: !1,
|
|
7118
7123
|
onToggle: (e) => {
|
|
7119
|
-
e ||
|
|
7124
|
+
e || z();
|
|
7120
7125
|
},
|
|
7121
7126
|
placement: "bottom-start",
|
|
7122
|
-
testId:
|
|
7127
|
+
testId: g && `${g}-edit-popover`,
|
|
7123
7128
|
toggleOnTriggerClick: !1,
|
|
7124
7129
|
children: /* @__PURE__ */ x("div", {
|
|
7125
7130
|
className: Qd.inputControl,
|
|
7126
|
-
"data-testid":
|
|
7127
|
-
onClick:
|
|
7128
|
-
onKeyDown:
|
|
7131
|
+
"data-testid": g && `${g}-edit-trigger`,
|
|
7132
|
+
onClick: R,
|
|
7133
|
+
onKeyDown: ne,
|
|
7129
7134
|
children: /* @__PURE__ */ x(vf, {
|
|
7130
7135
|
name: e,
|
|
7131
|
-
value:
|
|
7132
|
-
unitkey:
|
|
7136
|
+
value: k ? D : E,
|
|
7137
|
+
unitkey: h,
|
|
7133
7138
|
initUnit: c,
|
|
7134
|
-
noConversion:
|
|
7135
|
-
onChange: (e) =>
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7139
|
+
noConversion: v,
|
|
7140
|
+
onChange: (e) => O(e.target.value),
|
|
7141
|
+
onSwitchUnit: ee,
|
|
7142
|
+
onFocus: R,
|
|
7143
|
+
disabled: f,
|
|
7144
|
+
error: k ? L : null,
|
|
7145
|
+
small: b,
|
|
7146
|
+
testId: g && `${g}-unit-input`
|
|
7141
7147
|
})
|
|
7142
7148
|
})
|
|
7143
7149
|
})
|
|
@@ -7150,13 +7156,13 @@ var So = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Co =
|
|
|
7150
7156
|
step: a,
|
|
7151
7157
|
onChange: o,
|
|
7152
7158
|
onChangeComplete: s,
|
|
7153
|
-
showArrows:
|
|
7154
|
-
showTooltip: !
|
|
7155
|
-
tooltipFormatter:
|
|
7156
|
-
disabled:
|
|
7157
|
-
small:
|
|
7158
|
-
marks:
|
|
7159
|
-
testId:
|
|
7159
|
+
showArrows: m,
|
|
7160
|
+
showTooltip: !V,
|
|
7161
|
+
tooltipFormatter: te,
|
|
7162
|
+
disabled: V,
|
|
7163
|
+
small: b,
|
|
7164
|
+
marks: C,
|
|
7165
|
+
testId: g && `${g}-slider`
|
|
7160
7166
|
})
|
|
7161
7167
|
]
|
|
7162
7168
|
});
|
package/package.json
CHANGED