alif-ui 2.0.0-alpha.13 → 2.0.0-alpha.14
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.
|
@@ -16,6 +16,23 @@ var _ = ({ value: _, isRange: v, withTime: y, onChange: b, onBlur: x, onClear: S
|
|
|
16
16
|
B(i(e.target.value, V));
|
|
17
17
|
}, W = () => {
|
|
18
18
|
B(""), b(null), S?.();
|
|
19
|
+
}, G = (e) => {
|
|
20
|
+
let t = d(e.target.value, v), n = (e) => T?.some((t) => r.isSameDay(t, e)) ?? !1, i = (e) => r.isOutOfRange(e, C, w) || n(e);
|
|
21
|
+
if (!t) {
|
|
22
|
+
W(), x?.(e);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (v && Array.isArray(t)) {
|
|
26
|
+
let [n, r] = t;
|
|
27
|
+
i(n) || i(r) ? W() : (b(t), H(t)), x?.(e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!v && t instanceof Date) if (i(t)) W();
|
|
31
|
+
else {
|
|
32
|
+
let e = y ? u(t, E, D, O, k) : t;
|
|
33
|
+
b(e), H(e);
|
|
34
|
+
}
|
|
35
|
+
x?.(e);
|
|
19
36
|
};
|
|
20
37
|
return p(() => {
|
|
21
38
|
H(_);
|
|
@@ -25,24 +42,6 @@ var _ = ({ value: _, isRange: v, withTime: y, onChange: b, onBlur: x, onClear: S
|
|
|
25
42
|
onClose: () => R(!1),
|
|
26
43
|
position: "bottom-start",
|
|
27
44
|
children: [/* @__PURE__ */ h(n.Trigger, {
|
|
28
|
-
onBlur: (e) => {
|
|
29
|
-
let t = d(e.target.value, v), n = (e) => T?.some((t) => r.isSameDay(t, e)) ?? !1, i = (e) => r.isOutOfRange(e, C, w) || n(e);
|
|
30
|
-
if (!t) {
|
|
31
|
-
W(), x?.(e);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (v && Array.isArray(t)) {
|
|
35
|
-
let [n, r] = t;
|
|
36
|
-
i(n) || i(r) ? W() : (b(t), H(t)), x?.(e);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (!v && t instanceof Date) if (i(t)) W();
|
|
40
|
-
else {
|
|
41
|
-
let e = y ? u(t, E, D, O, k) : t;
|
|
42
|
-
b(e), H(e);
|
|
43
|
-
}
|
|
44
|
-
x?.(e);
|
|
45
|
-
},
|
|
46
45
|
className: M,
|
|
47
46
|
style: {
|
|
48
47
|
width: "100%",
|
|
@@ -53,6 +52,7 @@ var _ = ({ value: _, isRange: v, withTime: y, onChange: b, onBlur: x, onClear: S
|
|
|
53
52
|
value: z,
|
|
54
53
|
mask: V,
|
|
55
54
|
onChange: U,
|
|
55
|
+
onBlur: G,
|
|
56
56
|
onClear: S ? W : void 0,
|
|
57
57
|
onFieldClick: () => R((e) => !e),
|
|
58
58
|
rightIcon: P
|
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
1
|
+
import { resolveTypography as e } from "../../../utils/typography.js";
|
|
2
|
+
import { classNames as t } from "../../../utils/class-names.js";
|
|
3
|
+
import { syncRefs as n } from "../../../utils/sync-refs.js";
|
|
4
|
+
import { useComponentId as r } from "../../../hooks/useComponentId/useComponentId.js";
|
|
5
|
+
import { InputBaseWrapper as i } from "../../Field/InputBaseWrapper/InputBaseWrapper.js";
|
|
6
|
+
import { InputBase as a } from "../../Field/InputBase/InputBase.js";
|
|
7
|
+
import o from "../../../lib/components/Dates/PickerInput/PickerInput.module.js";
|
|
8
|
+
import { useRef as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
10
|
//#region src/lib/components/Dates/PickerInput/PickerInput.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
label:
|
|
13
|
-
onClear:
|
|
14
|
-
leftIcon:
|
|
15
|
-
rightIcon:
|
|
16
|
-
id:
|
|
17
|
-
size:
|
|
11
|
+
var u = ({ id: u, label: d, onClear: f, leftIcon: p, rightIcon: m, hasError: h, value: g, className: _, disabled: v, style: y, fullWidth: b = !0, size: x = "m", onFieldClick: S, ref: C, hintLeftSection: w, hintRightSection: T, mask: E, ...D }) => {
|
|
12
|
+
let O = s(null), k = r(u), A = (e, t) => e.length >= t.length ? e : e + t?.slice(e.length);
|
|
13
|
+
return /* @__PURE__ */ c(i, {
|
|
14
|
+
label: d,
|
|
15
|
+
onClear: f,
|
|
16
|
+
leftIcon: p,
|
|
17
|
+
rightIcon: m,
|
|
18
|
+
id: k,
|
|
19
|
+
size: x,
|
|
18
20
|
keepLabel: !0,
|
|
19
21
|
bordered: !0,
|
|
20
|
-
inputRef:
|
|
21
|
-
hasError:
|
|
22
|
-
disabled:
|
|
23
|
-
value:
|
|
24
|
-
fullWidth:
|
|
25
|
-
className:
|
|
26
|
-
style:
|
|
27
|
-
onClick:
|
|
28
|
-
hintLeftSection:
|
|
29
|
-
hintRightSection:
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
className:
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
-
id:
|
|
34
|
-
ref:
|
|
35
|
-
value:
|
|
36
|
-
disabled:
|
|
37
|
-
...
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
inputRef: O,
|
|
23
|
+
hasError: h,
|
|
24
|
+
disabled: v,
|
|
25
|
+
value: g,
|
|
26
|
+
fullWidth: b,
|
|
27
|
+
className: _,
|
|
28
|
+
style: y,
|
|
29
|
+
onClick: S,
|
|
30
|
+
hintLeftSection: w,
|
|
31
|
+
hintRightSection: T,
|
|
32
|
+
children: /* @__PURE__ */ l("div", {
|
|
33
|
+
className: o.wrapper,
|
|
34
|
+
children: [/* @__PURE__ */ c(a, {
|
|
35
|
+
id: k,
|
|
36
|
+
ref: n(O, C),
|
|
37
|
+
value: g,
|
|
38
|
+
disabled: v,
|
|
39
|
+
...D
|
|
40
|
+
}), E && /* @__PURE__ */ c("span", {
|
|
41
|
+
style: e("body", "m"),
|
|
42
|
+
className: t(o.mask, "uiFont"),
|
|
43
|
+
children: A(g, E)
|
|
41
44
|
})]
|
|
42
45
|
})
|
|
43
46
|
});
|
|
44
47
|
};
|
|
45
48
|
//#endregion
|
|
46
|
-
export {
|
|
49
|
+
export { u as PickerInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerInput.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/Dates/PickerInput/PickerInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKvD,eAAO,MAAM,WAAW,GAAI,iLAmBzB,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"PickerInput.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/Dates/PickerInput/PickerInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKvD,eAAO,MAAM,WAAW,GAAI,iLAmBzB,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,4CAkDtC,CAAC"}
|