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 { syncRefs as e } from "../../../utils/sync-refs.js";
2
- import { useComponentId as t } from "../../../hooks/useComponentId/useComponentId.js";
3
- import { InputBaseWrapper as n } from "../../Field/InputBaseWrapper/InputBaseWrapper.js";
4
- import { InputBase as r } from "../../Field/InputBase/InputBase.js";
5
- import i from "../../../lib/components/Dates/PickerInput/PickerInput.module.js";
6
- import { useRef as a } from "react";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
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 c = ({ id: c, label: l, onClear: u, leftIcon: d, rightIcon: f, hasError: p, value: m, className: h, disabled: g, style: _, fullWidth: v = !0, size: y = "m", onFieldClick: b, ref: x, hintLeftSection: S, hintRightSection: C, mask: w, ...T }) => {
10
- let E = a(null), D = t(c), O = (e, t) => e.length >= t.length ? e : e + t?.slice(e.length);
11
- return /* @__PURE__ */ o(n, {
12
- label: l,
13
- onClear: u,
14
- leftIcon: d,
15
- rightIcon: f,
16
- id: D,
17
- size: y,
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: E,
21
- hasError: p,
22
- disabled: g,
23
- value: m,
24
- fullWidth: v,
25
- className: h,
26
- style: _,
27
- onClick: b,
28
- hintLeftSection: S,
29
- hintRightSection: C,
30
- children: /* @__PURE__ */ s("div", {
31
- className: i.wrapper,
32
- children: [/* @__PURE__ */ o(r, {
33
- id: D,
34
- ref: e(E, x),
35
- value: m,
36
- disabled: g,
37
- ...T
38
- }), w && /* @__PURE__ */ o("span", {
39
- className: i.mask,
40
- children: O(m, w)
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 { c as PickerInput };
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,4CA+CtC,CAAC"}
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"}
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "license": "ISC",
23
23
  "private": false,
24
- "version": "2.0.0-alpha.13",
24
+ "version": "2.0.0-alpha.14",
25
25
  "type": "module",
26
26
  "files": [
27
27
  "dist"