mimir-ui-kit 1.43.17 → 1.43.19

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.
@@ -1 +1 @@
1
- ._drawer_13ua6_2{--drawer-width: 808px;--drawer-z-index: 10000;position:fixed;z-index:10000;z-index:var(--drawer-z-index);display:flex;flex-direction:column;width:808px;width:var(--drawer-width);height:100%;overflow:auto;background-color:var(--black-5);transition:all .3s ease;pointer-events:none}._drawer_13ua6_2::-webkit-scrollbar{width:3px}._drawer_13ua6_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_13ua6_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_13ua6_2 ._content_13ua6_26{position:relative;display:flex;flex:1;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-4xl) var(--mimir-space-4xl);transition:all .3s ease}@media (max-width: 600px){._drawer_13ua6_2 ._content_13ua6_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_13ua6_2 ._content_13ua6_26._is-loading_13ua6_40{align-items:center;justify-content:center}._drawer_13ua6_2 ._header_13ua6_44{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_13ua6_2 ._header_13ua6_44:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_13ua6_2 ._header_13ua6_44._sticky-header_13ua6_52{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_13ua6_2 ._header_13ua6_44 ._title_13ua6_58{flex:1;align-self:flex-end;font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-xl3);line-height:var(--mimir-line-height-text-s1);letter-spacing:.7px}@media (max-width: 600px){._drawer_13ua6_2 ._header_13ua6_44 ._title_13ua6_58{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_13ua6_2 ._header_13ua6_44 ._space_13ua6_72{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_13ua6_2 ._header_13ua6_44{min-height:55px}._drawer_13ua6_2 ._header_13ua6_44:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_13ua6_2 ._inner_13ua6_83{flex:1}._drawer_13ua6_2 ._button_13ua6_86{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_13ua6_2 ._footer_13ua6_91{display:block;padding-top:var(--mimir-space-4xl)}@media (max-width: 600px){._drawer_13ua6_2 ._footer_13ua6_91{padding-top:var(--mimir-space-m)}}._drawer_13ua6_2 ._footer-button_13ua6_100{display:block;margin-left:auto}._drawer_13ua6_2._left_13ua6_104{top:0;left:-100%}._drawer_13ua6_2._right_13ua6_108{top:0;right:-100%}._drawer_13ua6_2._full_13ua6_112{top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;transform:scale(.95);opacity:0;transition:transform .3s ease-in-out,opacity .3s ease-in-out}._drawer_13ua6_2._bottom_13ua6_122{--drawer-width: calc(100% - var(--mimir-space-m));right:50%;bottom:-100%;left:50%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:calc(100% - var(--mimir-space-xs));border-top-left-radius:var(--mimir-control-radius);border-top-right-radius:var(--mimir-control-radius);transform:translate(-50%)}._drawer_13ua6_2._bottom_13ua6_122._full-bottom-height_13ua6_133{height:calc(100% - var(--mimir-space-xs))}._drawer_13ua6_2._bottom_13ua6_122._is-loading_13ua6_40{height:50vh}._drawer_13ua6_2._opened_13ua6_139{transition:all .3s ease;pointer-events:auto}._drawer_13ua6_2._opened_13ua6_139._left_13ua6_104{left:0%;transition:left .3s ease}._drawer_13ua6_2._opened_13ua6_139._right_13ua6_108{right:0%;transition:right .3s ease}._drawer_13ua6_2._opened_13ua6_139._bottom_13ua6_122{bottom:0%}._drawer_13ua6_2._opened_13ua6_139._full_13ua6_112{transform:scale(1);opacity:1}._drawer_13ua6_2._is-closing_13ua6_158._left_13ua6_104{left:-100%}._drawer_13ua6_2._is-closing_13ua6_158._right_13ua6_108{right:-100%}._drawer_13ua6_2._is-closing_13ua6_158._bottom_13ua6_122{bottom:-100%}._drawer_13ua6_2._is-closing_13ua6_158._full_13ua6_112{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_13ua6_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_13ua6_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_13ua6_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_13ua6_2{--drawer-width: 100%}._drawer_13ua6_2._bottom_13ua6_122{--drawer-width: calc(100% - var(--mimir-space-xs))}}._overlay_13ua6_195{--overlay-z-index: 9990;position:fixed;top:0;left:0;z-index:9990;z-index:var(--overlay-z-index);width:100%;height:100%;background-color:#0009;opacity:0;transition:all .3s ease}._overlay_13ua6_195._opened_13ua6_139{opacity:1;transition:all .3s ease}._overlay_13ua6_195._opened_13ua6_139._unmount_13ua6_211{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_13ua6_195._is-closing_13ua6_158{opacity:0;transition:all .3s ease}._overlay_13ua6_195._unmount_13ua6_211{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
1
+ ._drawer_14uzm_2{--drawer-width: 808px;--drawer-z-index: 10000;position:fixed;z-index:10000;z-index:var(--drawer-z-index);display:flex;flex-direction:column;width:808px;width:var(--drawer-width);height:100%;overflow:auto;background-color:var(--black-5);transition:all .3s ease;pointer-events:none}._drawer_14uzm_2::-webkit-scrollbar{width:3px}._drawer_14uzm_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_14uzm_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_14uzm_2 ._content_14uzm_26{position:relative;display:flex;flex:1;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-xs) var(--mimir-space-3xs) var(--mimir-space-4xl);overflow:hidden;transition:all .3s ease}@media (max-width: 600px){._drawer_14uzm_2 ._content_14uzm_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_14uzm_2 ._content_14uzm_26._is-loading_14uzm_41{align-items:center;justify-content:center}._drawer_14uzm_2 ._header_14uzm_45{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_14uzm_2 ._header_14uzm_45:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_14uzm_2 ._header_14uzm_45._sticky-header_14uzm_53{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_14uzm_2 ._header_14uzm_45 ._title_14uzm_59{flex:1;align-self:flex-end;font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-xl3);line-height:var(--mimir-space-2xxl);letter-spacing:.7px}@media (max-width: 600px){._drawer_14uzm_2 ._header_14uzm_45 ._title_14uzm_59{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_14uzm_2 ._header_14uzm_45 ._space_14uzm_73{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_14uzm_2 ._header_14uzm_45{min-height:55px}._drawer_14uzm_2 ._header_14uzm_45:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_14uzm_2 ._inner_14uzm_84{flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_14uzm_2 ._inner_14uzm_84._is-loading_14uzm_41{display:flex;flex-direction:column;align-items:center;justify-content:center}._drawer_14uzm_2 ._button_14uzm_95{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_14uzm_2 ._footer_14uzm_100{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_14uzm_2 ._footer_14uzm_100{padding:var(--mimir-space-m)}}._drawer_14uzm_2 ._footer_14uzm_100._has-scroll_14uzm_109{box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_14uzm_2 ._footer-button_14uzm_112{display:block;margin-left:auto}._drawer_14uzm_2._left_14uzm_116{top:0;left:-100%}._drawer_14uzm_2._right_14uzm_120{top:0;right:-100%}._drawer_14uzm_2._full_14uzm_124{top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;transform:scale(.95);opacity:0;transition:transform .3s ease-in-out,opacity .3s ease-in-out}._drawer_14uzm_2._bottom_14uzm_134{--drawer-width: calc(100% - var(--mimir-space-m));right:50%;bottom:-100%;left:50%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:calc(100% - var(--mimir-space-xs));border-top-left-radius:var(--mimir-control-radius);border-top-right-radius:var(--mimir-control-radius);transform:translate(-50%)}._drawer_14uzm_2._bottom_14uzm_134._full-bottom-height_14uzm_145{height:calc(100% - var(--mimir-space-xs))}._drawer_14uzm_2._bottom_14uzm_134._is-loading_14uzm_41{height:50vh}._drawer_14uzm_2._opened_14uzm_151{transition:all .3s ease;pointer-events:auto}._drawer_14uzm_2._opened_14uzm_151._left_14uzm_116{left:0%;transition:left .3s ease}._drawer_14uzm_2._opened_14uzm_151._right_14uzm_120{right:0%;transition:right .3s ease}._drawer_14uzm_2._opened_14uzm_151._bottom_14uzm_134{bottom:0%}._drawer_14uzm_2._opened_14uzm_151._full_14uzm_124{transform:scale(1);opacity:1}._drawer_14uzm_2._is-closing_14uzm_170._left_14uzm_116{left:-100%}._drawer_14uzm_2._is-closing_14uzm_170._right_14uzm_120{right:-100%}._drawer_14uzm_2._is-closing_14uzm_170._bottom_14uzm_134{bottom:-100%}._drawer_14uzm_2._is-closing_14uzm_170._full_14uzm_124{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_14uzm_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_14uzm_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_14uzm_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_14uzm_2{--drawer-width: 100%}._drawer_14uzm_2._bottom_14uzm_134{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_14uzm_207{--overlay-z-index: 9990;position:fixed;top:0;left:0;z-index:9990;z-index:var(--overlay-z-index);width:100%;height:100%;background-color:#0009;opacity:0;transition:all .3s ease}._overlay_14uzm_207._opened_14uzm_151{opacity:1;transition:all .3s ease}._overlay_14uzm_207._opened_14uzm_151._unmount_14uzm_223{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_14uzm_207._is-closing_14uzm_170{opacity:0;transition:all .3s ease}._overlay_14uzm_207._unmount_14uzm_223{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
@@ -0,0 +1 @@
1
+ ._scroll-container_7yixd_2{height:100%;padding-right:4px;overflow-y:auto}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar{width:8px;height:8px}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar-track{background:var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar-thumb{background:var(--black-80);border:2px solid var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar{width:8px;height:8px}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-track{background:var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-thumb{background:var(--black-80);border:2px solid var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar{width:4px;height:4px}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-track{border-radius:var(--mimir-control-radius-xs2)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-thumb{border:1px solid var(--white);border-radius:var(--mimir-control-radius-xs2)}
@@ -25,6 +25,10 @@ export type TProps = {
25
25
  * Значение типа модального окна календаря
26
26
  */
27
27
  type?: 'days' | 'months' | 'years';
28
+ /**
29
+ * Формат отображения даты в инпуте
30
+ */
31
+ dateFormat?: 'full' | 'month' | 'year';
28
32
  /**
29
33
  * Флаг отключения компонента
30
34
  */
@@ -99,6 +103,10 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
99
103
  * Значение типа модального окна календаря
100
104
  */
101
105
  type?: "days" | "months" | "years";
106
+ /**
107
+ * Формат отображения даты в инпуте
108
+ */
109
+ dateFormat?: "full" | "month" | "year";
102
110
  /**
103
111
  * Флаг отключения компонента
104
112
  */
@@ -1,242 +1,353 @@
1
- import { jsxs as Q, jsx as d } from "react/jsx-runtime";
2
- import { c as X } from "../../index-DIxK0V-G.js";
3
- import { memo as pt, forwardRef as dt, useState as I, useEffect as $ } from "react";
4
- import { MAX_DAY as yt, MAX_MONTH as wt, DATE_LENGTH as lt } from "./constants.js";
5
- import { DatePickerModal as Nt } from "./DatePickerModal.js";
6
- import { MonthPickerModal as Tt } from "./MonthPickerModal.js";
7
- import { c as n } from "../../styles.module-Cuqm31CO.js";
8
- import { formatDatePart as Z } from "./utils.js";
1
+ import { jsxs as Z, jsx as D } from "react/jsx-runtime";
2
+ import { c as G } from "../../index-DIxK0V-G.js";
3
+ import { memo as dt, forwardRef as Dt, useState as b, useEffect as H } from "react";
4
+ import { months as $, MAX_DAY as wt, MAX_MONTH as kt, DATE_LENGTH as Nt } from "./constants.js";
5
+ import { DatePickerModal as ut } from "./DatePickerModal.js";
6
+ import { MonthPickerModal as ht } from "./MonthPickerModal.js";
7
+ import { c as y } from "../../styles.module-Cuqm31CO.js";
8
+ import { formatDatePart as z } from "./utils.js";
9
9
  import { YearPickerModal as Mt } from "./YearPickerModal.js";
10
- import { useClickOutside as kt } from "../../hooks/useClickOutside/useClickOutside.js";
11
- import { Icon as z } from "../../icons/Icon.js";
12
- import { formating as w } from "../../utils/index.js";
13
- import { I as At } from "../../Input-BU_6U1CW.js";
14
- import { EInputStatus as It, EInputSize as b } from "../Input/constants.js";
15
- const Pt = pt(
16
- dt(
10
+ import { useClickOutside as gt } from "../../hooks/useClickOutside/useClickOutside.js";
11
+ import { Icon as C } from "../../icons/Icon.js";
12
+ import { formating as p } from "../../utils/index.js";
13
+ import { I as Tt } from "../../Input-BU_6U1CW.js";
14
+ import { EInputStatus as bt, EInputSize as R } from "../Input/constants.js";
15
+ const $t = dt(
16
+ Dt(
17
17
  ({
18
- size: g,
19
- value: l,
20
- onChangeValue: s,
21
- name: y,
22
- before: N,
23
- type: a = "days",
24
- error: j,
25
- onError: T,
26
- onBlur: o,
27
- validateImmediately: G,
28
- variant: C,
29
- disabled: v = !1,
30
- editable: x = !1,
31
- openOnInput: L = !0,
32
- sendIntermediateValues: R = !1,
33
- disableFuture: W = !1,
34
- disablePast: q = !1,
35
- disabledDate: _,
36
- validRange: c,
37
- ...u
38
- }, B) => {
39
- const [h, D] = I(!1), [F, m] = I(a), [p, M] = I(
40
- () => l && !isNaN(new Date(l).getTime()) ? new Date(l) : void 0
41
- ), [S, O] = I(j), [V, H] = I(""), [tt, k] = I();
42
- u.status = !!S && It.Error || u.status, $(() => {
43
- O(j);
44
- }, [j]), $(() => {
45
- M(
46
- l && !isNaN(new Date(l).getTime()) ? new Date(l) : void 0
18
+ size: j,
19
+ value: k,
20
+ onChangeValue: a,
21
+ name: w,
22
+ before: h,
23
+ type: n = "days",
24
+ dateFormat: N = "full",
25
+ error: v,
26
+ onError: M,
27
+ onBlur: m,
28
+ validateImmediately: L,
29
+ variant: B,
30
+ disabled: _ = !1,
31
+ editable: A = !1,
32
+ openOnInput: W = !0,
33
+ sendIntermediateValues: V = !1,
34
+ disableFuture: q = !1,
35
+ disablePast: E = !1,
36
+ disabledDate: O,
37
+ validRange: o,
38
+ ...S
39
+ }, tt) => {
40
+ const [Y, d] = b(!1), [U, l] = b(n), [f, g] = b(
41
+ () => k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
42
+ ), [I, X] = b(v), [et, P] = b(""), [st, T] = b();
43
+ S.status = !!I && bt.Error || S.status, H(() => {
44
+ X(v);
45
+ }, [v]), H(() => {
46
+ g(
47
+ k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
47
48
  );
48
- }, [l]), $(() => {
49
- p && typeof p != "string" && !isNaN(p == null ? void 0 : p.getTime()) ? H(w.Date(p, "dd/mm/yyyy")) : H("");
50
- }, [p]);
51
- const E = l && new Date(l).getTime;
52
- $(() => {
53
- G && (E ? (O(!1), T == null || T({ name: y, active: !1 })) : (O(!0), T == null || T({ name: y, active: !0 })));
54
- }, [G, y, E]), kt({
55
- isActive: h,
49
+ }, [k]), H(() => {
50
+ if (f && typeof f != "string" && !isNaN(f == null ? void 0 : f.getTime())) {
51
+ let t = "";
52
+ switch (N) {
53
+ case "year": {
54
+ t = f.getFullYear().toString();
55
+ break;
56
+ }
57
+ case "month": {
58
+ const s = $[f.getMonth()], e = f.getFullYear();
59
+ t = `${s} ${e}`;
60
+ break;
61
+ }
62
+ case "full": {
63
+ t = p.Date(f, "dd/mm/yyyy");
64
+ break;
65
+ }
66
+ default: {
67
+ t = p.Date(f, "dd/mm/yyyy");
68
+ break;
69
+ }
70
+ }
71
+ P(t);
72
+ } else
73
+ P("");
74
+ }, [f, N]);
75
+ const J = k && new Date(k).getTime;
76
+ H(() => {
77
+ L && (J ? (X(!1), M == null || M({ name: w, active: !1 })) : (X(!0), M == null || M({ name: w, active: !0 })));
78
+ }, [L, w, J]), gt({
79
+ isActive: Y,
56
80
  setActive: (t) => {
57
- D(t), m(a), t || k(void 0);
81
+ d(t), l(n), t || T(void 0);
58
82
  },
59
- className: n["calendar-block"]
83
+ className: y["calendar-block"]
60
84
  });
61
- const et = () => {
62
- !v && (L || !x) && D(!0);
63
- }, J = (t) => {
64
- const r = t.getTime();
65
- if (t.setHours(0, 0, 0, 0), N && (typeof N == "string" ? new Date(N) : N).getTime() > r)
85
+ const rt = () => {
86
+ !_ && (W || !A) && d(!0);
87
+ }, K = (t) => {
88
+ const s = t.getTime();
89
+ if (t.setHours(0, 0, 0, 0), h && (typeof h == "string" ? new Date(h) : h).getTime() > s)
66
90
  return !1;
67
- if (W) {
68
- const i = /* @__PURE__ */ new Date();
69
- if (i.setHours(0, 0, 0, 0), t.getTime() > i.getTime()) return !1;
70
- }
71
91
  if (q) {
72
- const i = /* @__PURE__ */ new Date();
73
- if (i.setHours(0, 0, 0, 0), r < i.getTime()) return !1;
92
+ const e = /* @__PURE__ */ new Date();
93
+ if (e.setHours(0, 0, 0, 0), t.getTime() > e.getTime()) return !1;
94
+ }
95
+ if (E) {
96
+ const e = /* @__PURE__ */ new Date();
97
+ if (e.setHours(0, 0, 0, 0), s < e.getTime()) return !1;
74
98
  }
75
- if (_ && _(t)) return !1;
76
- if (c) {
77
- let i;
78
- typeof c[0] == "string" ? i = [
79
- new Date(c[0]),
80
- typeof c[1] == "string" ? new Date(c[1]) : c[1]
81
- ] : i = [
82
- c[0],
83
- typeof c[1] == "string" ? new Date(c[1]) : c[1]
99
+ if (O && O(t)) return !1;
100
+ if (o) {
101
+ let e;
102
+ typeof o[0] == "string" ? e = [
103
+ new Date(o[0]),
104
+ typeof o[1] == "string" ? new Date(o[1]) : o[1]
105
+ ] : e = [
106
+ o[0],
107
+ typeof o[1] == "string" ? new Date(o[1]) : o[1]
84
108
  ];
85
- const [f, e] = i, P = new Date(f), A = new Date(e);
86
- if (P.setHours(0, 0, 0, 0), A.setHours(23, 59, 59, 999), t < P || t > A) return !1;
109
+ const [i, r] = e, c = new Date(i), u = new Date(r);
110
+ if (c.setHours(0, 0, 0, 0), u.setHours(23, 59, 59, 999), t < c || t > u) return !1;
87
111
  }
88
112
  return !0;
89
- }, st = (t) => {
90
- isNaN(t.getTime()) || (M(t), k(void 0), s == null || s({
91
- value: w.Date(t, "yyyy-mm-dd"),
92
- name: y
93
- })), F === "years" && (a === "years" ? (D(!1), m(a)) : m("months")), F === "months" && (a === "months" ? (D(!1), m(a)) : m("days")), M(t), s == null || s({
94
- value: w.Date(t, "yyyy-mm-dd"),
95
- name: y
96
- }), o == null || o(w.Date(t, "yyyy-mm-dd"));
97
- }, it = (t) => {
98
- const r = p || /* @__PURE__ */ new Date(), i = r.getDate(), f = r.getMonth() + 1, e = new Date(t, f - 1, i);
99
- if (e.getFullYear() === t && e.getMonth() === f - 1 && e.getDate() === i && J(e)) {
100
- if (M(e), k(void 0), s == null || s({
101
- value: w.Date(e, "yyyy-mm-dd"),
102
- name: y
103
- }), o == null || o(w.Date(e, "yyyy-mm-dd")), a === "years") {
104
- D(!1), m(a);
113
+ }, at = (t) => {
114
+ if (!isNaN(t.getTime())) {
115
+ g(t), T(void 0);
116
+ let e = "";
117
+ switch (N) {
118
+ case "year": {
119
+ e = t.getFullYear().toString();
120
+ break;
121
+ }
122
+ case "month": {
123
+ const i = $[t.getMonth()], r = t.getFullYear();
124
+ e = `${i} ${r}`;
125
+ break;
126
+ }
127
+ case "full": {
128
+ e = p.Date(t, "yyyy-mm-dd");
129
+ break;
130
+ }
131
+ default: {
132
+ e = p.Date(t, "yyyy-mm-dd");
133
+ break;
134
+ }
135
+ }
136
+ a == null || a({
137
+ value: e,
138
+ name: w
139
+ });
140
+ }
141
+ U === "years" && (n === "years" ? (d(!1), l(n)) : l("months")), U === "months" && (n === "months" ? (d(!1), l(n)) : l("days")), g(t);
142
+ let s = "";
143
+ switch (N) {
144
+ case "year": {
145
+ s = t.getFullYear().toString();
146
+ break;
147
+ }
148
+ case "month": {
149
+ const e = $[t.getMonth()], i = t.getFullYear();
150
+ s = `${e} ${i}`;
151
+ break;
152
+ }
153
+ case "full": {
154
+ s = p.Date(t, "yyyy-mm-dd");
155
+ break;
156
+ }
157
+ default: {
158
+ s = p.Date(t, "yyyy-mm-dd");
159
+ break;
160
+ }
161
+ }
162
+ a == null || a({
163
+ value: s,
164
+ name: w
165
+ }), m == null || m(s);
166
+ }, ct = (t) => {
167
+ const s = f || /* @__PURE__ */ new Date(), e = s.getDate(), i = s.getMonth() + 1, r = new Date(t, i - 1, e);
168
+ if (r.getFullYear() === t && r.getMonth() === i - 1 && r.getDate() === e && K(r)) {
169
+ g(r), T(void 0);
170
+ let c = "";
171
+ switch (N) {
172
+ case "year": {
173
+ c = t.toString();
174
+ break;
175
+ }
176
+ case "month": {
177
+ c = `${$[i - 1]} ${t}`;
178
+ break;
179
+ }
180
+ case "full": {
181
+ c = p.Date(r, "yyyy-mm-dd");
182
+ break;
183
+ }
184
+ default: {
185
+ c = p.Date(r, "yyyy-mm-dd");
186
+ break;
187
+ }
188
+ }
189
+ if (a == null || a({
190
+ value: c,
191
+ name: w
192
+ }), m == null || m(c), n === "years") {
193
+ d(!1), l(n);
105
194
  return;
106
195
  }
107
196
  } else
108
- k(new Date(t, f - 1, 1));
109
- a === "years" ? (D(!1), m(a)) : m("months");
110
- }, rt = (t, r) => {
111
- const f = (p || /* @__PURE__ */ new Date()).getDate(), e = new Date(t, r - 1, f);
112
- if (e.getFullYear() === t && e.getMonth() === r - 1 && e.getDate() === f && J(e)) {
113
- if (M(e), k(void 0), s == null || s({
114
- value: w.Date(e, "yyyy-mm-dd"),
115
- name: y
116
- }), o == null || o(w.Date(e, "yyyy-mm-dd")), a === "months") {
117
- D(!1), m(a);
197
+ T(new Date(t, i - 1, 1));
198
+ n === "years" ? (d(!1), l(n)) : l("months");
199
+ }, it = (t, s) => {
200
+ const i = (f || /* @__PURE__ */ new Date()).getDate(), r = new Date(t, s - 1, i);
201
+ if (r.getFullYear() === t && r.getMonth() === s - 1 && r.getDate() === i && K(r)) {
202
+ g(r), T(void 0);
203
+ let c = "";
204
+ switch (N) {
205
+ case "year": {
206
+ c = t.toString();
207
+ break;
208
+ }
209
+ case "month": {
210
+ c = `${$[s - 1]} ${t}`;
211
+ break;
212
+ }
213
+ case "full": {
214
+ c = p.Date(r, "yyyy-mm-dd");
215
+ break;
216
+ }
217
+ default: {
218
+ c = p.Date(r, "yyyy-mm-dd");
219
+ break;
220
+ }
221
+ }
222
+ if (a == null || a({
223
+ value: c,
224
+ name: w
225
+ }), m == null || m(c), n === "months") {
226
+ d(!1), l(n);
118
227
  return;
119
228
  }
120
229
  } else
121
- k(new Date(t, r - 1, 1));
122
- a === "months" ? (D(!1), m(a)) : m("days");
123
- }, ct = (t) => {
124
- if (x) {
125
- const r = t.target.value.replace(/[^\d]/g, "");
126
- if (r.length === 0)
127
- H(""), s == null || s({ value: "", name: y }), o == null || o("");
230
+ T(new Date(t, s - 1, 1));
231
+ n === "months" ? (d(!1), l(n)) : l("days");
232
+ }, ot = (t) => {
233
+ if (A) {
234
+ const s = t.target.value.replace(/[^\d]/g, "");
235
+ if (s.length === 0)
236
+ P(""), a == null || a({ value: "", name: w }), m == null || m("");
128
237
  else {
129
- const [i, f, e] = [
130
- Z(r.substring(0, 2), yt),
131
- Z(r.substring(2, 4), wt),
132
- r.substring(4, 8)
133
- ], P = [i, f, e].filter(Boolean).join("/");
134
- if (H(P), R) {
135
- const A = e ? `${e}-${f || "00"}-${i || "00"}` : [i, f, e].filter(Boolean).join("-");
136
- s == null || s({
137
- value: A,
138
- name: y
238
+ const [e, i, r] = [
239
+ z(s.substring(0, 2), wt),
240
+ z(s.substring(2, 4), kt),
241
+ s.substring(4, 8)
242
+ ], c = [e, i, r].filter(Boolean).join("/");
243
+ if (P(c), V) {
244
+ const u = r ? `${r}-${i || "00"}-${e || "00"}` : [e, i, r].filter(Boolean).join("-");
245
+ a == null || a({
246
+ value: u,
247
+ name: w
139
248
  });
140
249
  }
141
- if (P.length === lt) {
142
- const A = parseInt(e), Y = /* @__PURE__ */ new Date(
143
- `${A}-${f.padStart(2, "0")}-${i.padStart(2, "0")}`
250
+ if (c.length === Nt) {
251
+ const u = parseInt(r), x = /* @__PURE__ */ new Date(
252
+ `${u}-${i.padStart(2, "0")}-${e.padStart(2, "0")}`
144
253
  );
145
- isNaN(Y.getTime()) || (M(Y), s == null || s({
146
- value: w.Date(Y, "yyyy-mm-dd"),
147
- name: y
148
- }), o == null || o(w.Date(Y, "yyyy-mm-dd")));
254
+ isNaN(x.getTime()) || (g(x), a == null || a({
255
+ value: p.Date(x, "yyyy-mm-dd"),
256
+ name: w
257
+ }), m == null || m(p.Date(x, "yyyy-mm-dd")));
149
258
  }
150
259
  }
151
260
  }
152
- }, ot = X(n.wrapper, h && n.active), at = X(n.input, n.inputBorderControl);
153
- let K;
154
- if (c) {
155
- let t, r;
156
- typeof c[0] == "string" ? t = new Date(c[0]) : t = c[0], typeof c[1] == "string" ? r = new Date(c[1]) : r = c[1], K = [t, r];
261
+ }, mt = G(y.wrapper, Y && y.active), ft = G(y.input, y.inputBorderControl);
262
+ let Q;
263
+ if (o) {
264
+ let t, s;
265
+ typeof o[0] == "string" ? t = new Date(o[0]) : t = o[0], typeof o[1] == "string" ? s = new Date(o[1]) : s = o[1], Q = [t, s];
157
266
  }
158
- const U = {
159
- onChangeValue: st,
160
- date: tt || p || /* @__PURE__ */ new Date(),
161
- selectedDate: p,
162
- before: typeof N == "string" ? new Date(N) : N,
163
- onChangeType: m,
164
- setIsActive: D,
165
- disableFuture: W,
166
- disablePast: q,
167
- disabledDate: _,
168
- validRange: K
169
- }, ft = {
170
- ...U,
171
- onChangeMonth: rt
172
- }, mt = {
173
- ...U,
174
- onChangeYear: it
175
- }, nt = (() => {
176
- switch (F) {
267
+ const F = {
268
+ onChangeValue: at,
269
+ date: st || f || /* @__PURE__ */ new Date(),
270
+ selectedDate: f,
271
+ before: typeof h == "string" ? new Date(h) : h,
272
+ onChangeType: l,
273
+ setIsActive: d,
274
+ disableFuture: q,
275
+ disablePast: E,
276
+ disabledDate: O,
277
+ validRange: Q,
278
+ dateFormat: N
279
+ }, nt = {
280
+ ...F,
281
+ onChangeMonth: it,
282
+ dateFormat: N
283
+ }, lt = {
284
+ ...F,
285
+ onChangeYear: ct
286
+ }, yt = (() => {
287
+ switch (U) {
177
288
  case "months":
178
- return () => /* @__PURE__ */ d(Tt, { ...ft });
289
+ return () => /* @__PURE__ */ D(ht, { ...nt });
179
290
  case "years":
180
- return () => /* @__PURE__ */ d(Mt, { ...mt });
291
+ return () => /* @__PURE__ */ D(Mt, { ...lt });
181
292
  default:
182
- return () => /* @__PURE__ */ d(Nt, { ...U });
293
+ return () => /* @__PURE__ */ D(ut, { ...F });
183
294
  }
184
- })(), Dt = ({ isActive: t }) => /* @__PURE__ */ d("button", { onClick: (i) => {
185
- i.stopPropagation(), v || D(!t);
186
- }, className: n["icon-button"], children: t ? /* @__PURE__ */ d(
187
- z,
295
+ })(), pt = ({ isActive: t }) => /* @__PURE__ */ D("button", { onClick: (e) => {
296
+ e.stopPropagation(), _ || d(!t);
297
+ }, className: y["icon-button"], children: t ? /* @__PURE__ */ D(
298
+ C,
188
299
  {
189
- iconName: g === b.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
300
+ iconName: j === R.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
190
301
  }
191
- ) : /* @__PURE__ */ d(
192
- z,
302
+ ) : /* @__PURE__ */ D(
303
+ C,
193
304
  {
194
- iconName: g === b.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
305
+ iconName: j === R.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
195
306
  }
196
307
  ) });
197
- return /* @__PURE__ */ Q("div", { className: n["input-field-group-datePicker"], children: [
198
- /* @__PURE__ */ Q("div", { className: ot, "data-disabled": v, children: [
199
- /* @__PURE__ */ d(
308
+ return /* @__PURE__ */ Z("div", { className: y["input-field-group-datePicker"], children: [
309
+ /* @__PURE__ */ Z("div", { className: mt, "data-disabled": _, children: [
310
+ /* @__PURE__ */ D(
200
311
  "div",
201
312
  {
202
313
  role: "button",
203
- "data-status": u.status,
204
- className: X(n["date-wrapper"], {
205
- [n.editable]: x
314
+ "data-status": S.status,
315
+ className: G(y["date-wrapper"], {
316
+ [y.editable]: A
206
317
  }),
207
- onClick: et,
208
- children: /* @__PURE__ */ d(
209
- At,
318
+ onClick: rt,
319
+ children: /* @__PURE__ */ D(
320
+ Tt,
210
321
  {
211
- ref: B,
212
- className: at,
213
- wrapperClassName: n["input-wrapper"],
214
- size: g,
322
+ ref: tt,
323
+ className: ft,
324
+ wrapperClassName: y["input-wrapper"],
325
+ size: j,
215
326
  type: "text",
216
- variant: C,
217
- value: V,
218
- onChange: ct,
327
+ variant: B,
328
+ value: et,
329
+ onChange: ot,
219
330
  rightAddon: {
220
331
  addonType: "react-node",
221
- addonContent: /* @__PURE__ */ d(Dt, { isActive: h })
332
+ addonContent: /* @__PURE__ */ D(pt, { isActive: Y })
222
333
  },
223
- rightSlotClassName: n["right-slot"],
334
+ rightSlotClassName: y["right-slot"],
224
335
  onFocus: () => {
225
- L && !x && D(!0);
336
+ W && !A && d(!0);
226
337
  },
227
- ...u
338
+ ...S
228
339
  }
229
340
  )
230
341
  }
231
342
  ),
232
- h && /* @__PURE__ */ d(nt, {})
343
+ Y && /* @__PURE__ */ D(yt, {})
233
344
  ] }),
234
- S && typeof S == "string" && /* @__PURE__ */ d("div", { className: n.textError, children: S })
345
+ I && typeof I == "string" && /* @__PURE__ */ D("div", { className: y.textError, children: I })
235
346
  ] });
236
347
  }
237
348
  )
238
349
  );
239
- Pt.displayName = "DatePicker";
350
+ $t.displayName = "DatePicker";
240
351
  export {
241
- Pt as DatePicker
352
+ $t as DatePicker
242
353
  };
@@ -9,6 +9,7 @@ type TProps = {
9
9
  disablePast?: boolean;
10
10
  disabledDate?: (date: Date) => boolean;
11
11
  validRange?: [Date, Date];
12
+ dateFormat?: 'full' | 'month' | 'year';
12
13
  };
13
- export declare const DatePickerModal: ({ date, selectedDate, onChangeValue, setIsActive, before, onChangeType, disableFuture, disablePast, disabledDate, validRange }: TProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const DatePickerModal: ({ date, selectedDate, onChangeValue, setIsActive, before, onChangeType, disableFuture, disablePast, disabledDate, validRange, dateFormat }: TProps) => import("react/jsx-runtime").JSX.Element;
14
15
  export {};