1mpacto-react-ui 2.0.20 → 2.0.22

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.
Files changed (114) hide show
  1. package/dist/assets/_mixins.scss +72 -72
  2. package/dist/assets/icons/arrow-narrow-down.svg +3 -3
  3. package/dist/assets/style.css +1 -1
  4. package/dist/components/Alert/index.cjs +1 -1
  5. package/dist/components/Alert/index.mjs +40 -40
  6. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
  7. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
  8. package/dist/components/Button/Button.cjs +12 -12
  9. package/dist/components/Button/Button.config.cjs +1 -1
  10. package/dist/components/Button/Button.config.mjs +3 -1
  11. package/dist/components/Button/Button.mjs +24 -24
  12. package/dist/components/Button/style.module.scss.cjs +1 -1
  13. package/dist/components/Button/style.module.scss.mjs +57 -55
  14. package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -12
  15. package/dist/components/ButtonIcon/ButtonIcon.mjs +20 -20
  16. package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
  17. package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
  18. package/dist/components/Calendar/Calendar.cjs +1 -1
  19. package/dist/components/Calendar/Calendar.mjs +98 -100
  20. package/dist/components/Calendar/CalendarMonth.cjs +1 -1
  21. package/dist/components/Calendar/CalendarMonth.mjs +41 -42
  22. package/dist/components/Calendar/CalendarRange.cjs +1 -1
  23. package/dist/components/Calendar/CalendarRange.mjs +59 -61
  24. package/dist/components/Calendar/CalendarYear.cjs +3 -3
  25. package/dist/components/Calendar/CalendarYear.mjs +39 -40
  26. package/dist/components/Chart/DoughnutChart.cjs +1 -1
  27. package/dist/components/Chart/DoughnutChart.mjs +93 -96
  28. package/dist/components/Chart/GradientBarChart.cjs +1 -1
  29. package/dist/components/Chart/GradientBarChart.mjs +80 -81
  30. package/dist/components/Chart/GradientLineChart.cjs +1 -1
  31. package/dist/components/Chart/GradientLineChart.mjs +50 -51
  32. package/dist/components/Chart/LineChart.cjs +1 -1
  33. package/dist/components/Chart/LineChart.mjs +23 -23
  34. package/dist/components/Chart/PieChart.cjs +1 -1
  35. package/dist/components/Chart/PieChart.mjs +45 -48
  36. package/dist/components/Collapse/Collapse.cjs +1 -1
  37. package/dist/components/Collapse/Collapse.mjs +23 -24
  38. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  39. package/dist/components/DatePicker/DatePicker.mjs +86 -89
  40. package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
  41. package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
  42. package/dist/components/DatePicker/FilterDate.cjs +1 -1
  43. package/dist/components/DatePicker/FilterDate.mjs +107 -110
  44. package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
  45. package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
  46. package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
  47. package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
  48. package/dist/components/Input/InputFloatingInner.cjs +5 -5
  49. package/dist/components/Input/InputFloatingInner.mjs +24 -25
  50. package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
  51. package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
  52. package/dist/components/Pagination/Pagination.cjs +2 -2
  53. package/dist/components/Pagination/Pagination.mjs +76 -80
  54. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
  55. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
  56. package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
  57. package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
  58. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  59. package/dist/components/Sidebar/Sidebar.mjs +65 -68
  60. package/dist/components/Slider/Slider.cjs +1 -0
  61. package/dist/components/Slider/Slider.mjs +61 -0
  62. package/dist/components/Slider/style.module.scss.cjs +1 -0
  63. package/dist/components/Slider/style.module.scss.mjs +14 -0
  64. package/dist/components/Step/Step.cjs +5 -5
  65. package/dist/components/Step/Step.mjs +52 -52
  66. package/dist/components/Table/Table.cjs +3 -3
  67. package/dist/components/Table/Table.mjs +275 -298
  68. package/dist/components/Table/TableSubMobile.cjs +1 -1
  69. package/dist/components/Table/TableSubMobile.mjs +32 -35
  70. package/dist/components/Tabs/Tabs.cjs +8 -8
  71. package/dist/components/Tabs/Tabs.mjs +66 -70
  72. package/dist/components/Textarea/Textarea.cjs +7 -7
  73. package/dist/components/Textarea/Textarea.mjs +47 -50
  74. package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
  75. package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
  76. package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
  77. package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
  78. package/dist/components/TimeRange/TimeRange.cjs +1 -1
  79. package/dist/components/TimeRange/TimeRange.mjs +88 -91
  80. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  81. package/dist/components/Tooltip/Tooltip.mjs +44 -46
  82. package/dist/components/Upload/UploadFile.cjs +1 -1
  83. package/dist/components/Upload/UploadFile.mjs +50 -54
  84. package/dist/components/Upload/UploadImage.cjs +12 -12
  85. package/dist/components/Upload/UploadImage.mjs +73 -79
  86. package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
  87. package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
  88. package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
  89. package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
  90. package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
  91. package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
  92. package/dist/config/components/tinymce.cjs +2 -2
  93. package/dist/config/components/tinymce.mjs +3 -3
  94. package/dist/hooks/useCountdown.cjs +1 -1
  95. package/dist/hooks/useCountdown.mjs +15 -15
  96. package/dist/hooks/useDebounce.cjs +1 -1
  97. package/dist/hooks/useDebounce.mjs +19 -19
  98. package/dist/hooks/useOtpInput.cjs +1 -1
  99. package/dist/hooks/useOtpInput.mjs +47 -51
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.mjs +48 -46
  102. package/dist/package.json.cjs +1 -1
  103. package/dist/package.json.d.ts +129 -128
  104. package/dist/package.json.mjs +1 -1
  105. package/dist/src/components/Button/Button.config.d.ts +2 -0
  106. package/dist/src/components/Slider/Slider.d.ts +3 -0
  107. package/dist/src/components/Slider/Slider.stories.d.ts +6 -0
  108. package/dist/src/components/index.d.ts +4 -2
  109. package/dist/src/interfaces/components/Button/index.d.ts +1 -1
  110. package/dist/src/interfaces/components/Slider/index.d.ts +51 -0
  111. package/dist/types-external/table.d.ts +15 -15
  112. package/dist/utils/common.cjs +1 -1
  113. package/dist/utils/common.mjs +172 -173
  114. package/package.json +128 -128
@@ -1,119 +1,116 @@
1
- import { jsxs as A, Fragment as J, jsx as u } from "react/jsx-runtime";
1
+ import { jsxs as q, Fragment as A, jsx as c } from "react/jsx-runtime";
2
2
  import p from "react";
3
- import { createCalendar as K, parseDate as Q, getLocalTimeZone as U } from "@internationalized/date";
4
- import W from "../Calendar/Calendar.mjs";
5
- import { useDateFormatter as X, useLocale as Y, I18nProvider as _ } from "react-aria";
6
- import $ from "../Popover/Popover.mjs";
7
- const m = (l) => {
8
- let a;
9
- const i = new Date(l ?? /* @__PURE__ */ new Date());
10
- return l && (a = Q(new Date(i.setHours(i.getHours() + 7)).toISOString().slice(0, 10))), a;
11
- }, ae = (l) => {
3
+ import { createCalendar as J, parseDate as K, getLocalTimeZone as Q } from "@internationalized/date";
4
+ import U from "../Calendar/Calendar.mjs";
5
+ import { useDateFormatter as W, useLocale as X, I18nProvider as Y } from "react-aria";
6
+ import _ from "../Popover/Popover.mjs";
7
+ const g = (u) => {
8
+ let s;
9
+ const r = new Date(u ?? /* @__PURE__ */ new Date());
10
+ return u && (s = K(new Date(r.setHours(r.getHours() + 7)).toISOString().slice(0, 10))), s;
11
+ }, se = (u) => {
12
12
  const {
13
- minDate: a,
14
- maxDate: i,
15
- value: c,
16
- defaultValue: P,
13
+ minDate: s,
14
+ maxDate: r,
15
+ value: i,
16
+ defaultValue: v,
17
17
  withConfirm: h = !1,
18
18
  isCustomTime: D = !1,
19
- className: T,
20
- classNameButton: b,
19
+ className: x,
20
+ classNameButton: I,
21
21
  buttonClick: w,
22
- buttonReset: y,
23
- buttonSubmit: M,
24
- prevIcon: k,
25
- nextIcon: x,
26
- onChange: d,
27
- id: N = "date-picker",
28
- idPopover: R = "date-picker-popover",
29
- floatingOptions: V = {},
30
- offsetPopover: L = 5,
31
- zIndexPopper: O = 1,
32
- hiddenHeader: j
33
- } = l, f = X(), { locale: z } = Y(), F = m(a), B = m(i), g = p.useRef(null), [S, H] = p.useState(), [r, C] = p.useState(), E = (s) => {
34
- var I;
35
- const n = /* @__PURE__ */ new Date();
36
- let e = s.toDate(U());
37
- e.setHours(n.getHours(), n.getMinutes(), n.getSeconds());
38
- const t = a ? new Date(a) : null, o = i ? new Date(i) : null;
22
+ buttonReset: P,
23
+ buttonSubmit: b,
24
+ prevIcon: y,
25
+ nextIcon: M,
26
+ onChange: m,
27
+ id: k = "date-picker",
28
+ idPopover: N = "date-picker-popover",
29
+ floatingOptions: R = {},
30
+ offsetPopover: V = 5,
31
+ zIndexPopper: L = 1,
32
+ hiddenHeader: O
33
+ } = u, l = W(), { locale: j } = X(), z = g(s), F = g(r), d = p.useRef(null), [S, T] = p.useState(), [f, H] = p.useState(), B = (a) => {
34
+ const o = /* @__PURE__ */ new Date();
35
+ let e = a.toDate(Q());
36
+ e.setHours(o.getHours(), o.getMinutes(), o.getSeconds());
37
+ const t = s ? new Date(s) : null, n = r ? new Date(r) : null;
39
38
  if (D) {
40
- if (e = new Date(new Date(e).setHours((r == null ? void 0 : r.hour) ?? 0, r == null ? void 0 : r.minut, r == null ? void 0 : r.second)), t && (t == null ? void 0 : t.toDateString()) === new Date(e).toDateString() && (t == null ? void 0 : t.toTimeString()) >= (e == null ? void 0 : e.toTimeString())) {
39
+ if (e = new Date(new Date(e).setHours(f?.hour ?? 0, f?.minut, f?.second)), t && t?.toDateString() === new Date(e).toDateString() && t?.toTimeString() >= e?.toTimeString()) {
41
40
  if (t && (t.getHours() > e.getHours() || t.getHours() === e.getHours() && t.getMinutes() > e.getMinutes()))
42
41
  return;
43
42
  e = new Date(t.setSeconds(t.getSeconds() + 1));
44
43
  }
45
- if (o && (o == null ? void 0 : o.toDateString()) === new Date(e).toDateString() && (o == null ? void 0 : o.toTimeString()) < (e == null ? void 0 : e.toTimeString())) {
46
- if (o && (o.getHours() < e.getHours() || o.getHours() === e.getHours() && o.getMinutes() < e.getMinutes()))
44
+ if (n && n?.toDateString() === new Date(e).toDateString() && n?.toTimeString() < e?.toTimeString()) {
45
+ if (n && (n.getHours() < e.getHours() || n.getHours() === e.getHours() && n.getMinutes() < e.getMinutes()))
47
46
  return;
48
- e = new Date(o.setSeconds(o.getSeconds() - 1));
47
+ e = new Date(n.setSeconds(n.getSeconds() - 1));
49
48
  }
50
49
  } else
51
- t && f.format(e) === f.format(t) && t.getTime() >= e.getTime() ? e = new Date(t.setSeconds(t.getSeconds() + 1)) : o && f.format(e) === f.format(o) && o.getTime() <= e.getTime() && (e = new Date(o.setSeconds(o.getSeconds() - 1)));
52
- typeof d == "function" && (d(e), (I = g.current) == null || I.setShow(!1));
53
- }, v = (s, n) => {
54
- H(s), (n ?? (!h && !D)) && E(s);
55
- }, G = (s) => {
56
- const { start: n } = s;
57
- C(n);
58
- }, Z = (s) => {
59
- const n = new Date(c ?? /* @__PURE__ */ new Date());
60
- C({
61
- hour: n.getHours(),
62
- minut: n.getMinutes(),
63
- second: n.getSeconds()
64
- }), H(m(c));
65
- }, q = () => {
66
- S && v(S, !0);
50
+ t && l.format(e) === l.format(t) && t.getTime() >= e.getTime() ? e = new Date(t.setSeconds(t.getSeconds() + 1)) : n && l.format(e) === l.format(n) && n.getTime() <= e.getTime() && (e = new Date(n.setSeconds(n.getSeconds() - 1)));
51
+ typeof m == "function" && (m(e), d.current?.setShow(!1));
52
+ }, C = (a, o) => {
53
+ T(a), (o ?? (!h && !D)) && B(a);
54
+ }, E = (a) => {
55
+ const { start: o } = a;
56
+ H(o);
57
+ }, G = (a) => {
58
+ const o = new Date(i ?? /* @__PURE__ */ new Date());
59
+ H({
60
+ hour: o.getHours(),
61
+ minut: o.getMinutes(),
62
+ second: o.getSeconds()
63
+ }), T(g(i));
64
+ }, Z = () => {
65
+ S && C(S, !0);
67
66
  };
68
- return /* @__PURE__ */ A(J, { children: [
69
- /* @__PURE__ */ u(
67
+ return /* @__PURE__ */ q(A, { children: [
68
+ /* @__PURE__ */ c(
70
69
  "div",
71
70
  {
72
- id: N,
73
- onClick: (s) => {
74
- var n;
75
- (n = g.current) == null || n.handlerShow(s), Z();
71
+ id: k,
72
+ onClick: (a) => {
73
+ d.current?.handlerShow(a), G();
76
74
  },
77
- className: b,
78
- children: typeof w == "function" ? w(c) : c ? new Date(c).toDateString() : "Pilih Tanggal"
75
+ className: I,
76
+ children: typeof w == "function" ? w(i) : i ? new Date(i).toDateString() : "Pilih Tanggal"
79
77
  }
80
78
  ),
81
- /* @__PURE__ */ u(
82
- $,
79
+ /* @__PURE__ */ c(
80
+ _,
83
81
  {
84
- zIndex: O,
85
- ref: g,
86
- offset: L,
87
- id: R,
88
- floatingOptions: { placement: "bottom-end", ...V },
89
- children: /* @__PURE__ */ u("div", { className: T ?? "", children: /* @__PURE__ */ u(_, { locale: "id-ID", children: /* @__PURE__ */ u(
90
- W,
82
+ zIndex: L,
83
+ ref: d,
84
+ offset: V,
85
+ id: N,
86
+ floatingOptions: { placement: "bottom-end", ...R },
87
+ children: /* @__PURE__ */ c("div", { className: x ?? "", children: /* @__PURE__ */ c(Y, { locale: "id-ID", children: /* @__PURE__ */ c(
88
+ U,
91
89
  {
92
- minValue: F,
93
- maxValue: B,
94
- minDate: a,
95
- maxDate: i,
96
- time: { start: r },
97
- locale: z,
90
+ minValue: z,
91
+ maxValue: F,
92
+ minDate: s,
93
+ maxDate: r,
94
+ time: { start: f },
95
+ locale: j,
98
96
  value: S,
99
97
  typeTime: "SINGLE",
100
- buttonReset: y,
101
- buttonSubmit: M,
102
- prevIcon: k,
103
- nextIcon: x,
104
- createCalendar: K,
105
- defaultValue: m(c),
106
- onChange: v,
98
+ buttonReset: P,
99
+ buttonSubmit: b,
100
+ prevIcon: y,
101
+ nextIcon: M,
102
+ createCalendar: J,
103
+ defaultValue: g(i),
104
+ onChange: C,
107
105
  handlerReset: () => {
108
- var s;
109
- typeof d == "function" && (d(P), (s = g.current) == null || s.setShow(!1));
106
+ typeof m == "function" && (m(v), d.current?.setShow(!1));
110
107
  },
111
- handlerSubmit: q,
112
- handlerChangeTime: G,
108
+ handlerSubmit: Z,
109
+ handlerChangeTime: E,
113
110
  withConfirm: h,
114
111
  isCustomTime: D,
115
112
  type: ["date", "month", "year"],
116
- hiddenHeader: j
113
+ hiddenHeader: O
117
114
  }
118
115
  ) }) })
119
116
  }
@@ -121,5 +118,5 @@ const m = (l) => {
121
118
  ] });
122
119
  };
123
120
  export {
124
- ae as default
121
+ se as default
125
122
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("react/jsx-runtime"),y=require("react"),Y=require("react-aria"),B=require("../Calendar/CalendarRange.cjs"),n=require("@internationalized/date"),K=require("../Calendar/Calendar.cjs"),H=a=>{let o;const r=new Date(a??new Date);return a&&(o=n.parseDate(new Date(r.setHours(r.getHours()+7)).toISOString().slice(0,10))),o},k=a=>{const o=new Date((a==null?void 0:a.startDate)??new Date),r=new Date((a==null?void 0:a.endDate)??new Date),i=new n.CalendarDate(o.getFullYear(),o.getMonth()+1,o.getDate()),D=new n.CalendarDate(r.getFullYear(),r.getMonth()+1,r.getDate());return a?{start:i,end:D}:void 0},Q=a=>{const{minDate:o,maxDate:r,defaultValue:i,withConfirm:D,prevIcon:M,nextIcon:p,buttonReset:L,buttonSubmit:b,typePicker:j="RANGE",onChange:q,value:c,onReset:E,isCustomTime:w}=a,{locale:_}=Y.useLocale(),I=H(o),N=H(r),[e,C]=y.useState(),[S,T]=y.useState({start:void 0,end:void 0}),Z=t=>{typeof q=="function"&&q(t)},R=(t,s)=>{const d=t.start.toDate(n.getLocalTimeZone()),u=t.end.toDate(n.getLocalTimeZone());C(t),T({start:{hour:0,minut:0,second:0},end:{hour:23,minut:59,second:59}}),(s??!D)&&Z({startDate:d,endDate:new Date(u.setHours(23,59,59))})},x=(t,s)=>{var d,u,g,m,l,f,G,P;if(e!=null&&e.start&&(e!=null&&e.end)&&(T(t),(u=(d=t.start)==null?void 0:d.hour)!=null&&u.toString()&&((m=(g=t.start)==null?void 0:g.minut)!=null&&m.toString())&&((f=(l=t.end)==null?void 0:l.hour)!=null&&f.toString())&&((P=(G=t.end)==null?void 0:G.minut)!=null&&P.toString())&&(s??!D))){const J=e.start.toDate(n.getLocalTimeZone()),z=e.end.toDate(n.getLocalTimeZone()),O=new Date(J.setHours(t.start.hour,t.start.minut)),V=new Date(z.setHours(t.end.hour,t.end.minut,59));O.getTime()<V.getTime()&&Z({startDate:O,endDate:V})}},A=t=>{if(typeof E=="function")E();else if(i&&t){const s=new Date(i.endDate??new Date),d=t.focusedDate.set({month:s.getMonth()+1,year:s.getFullYear()});t.setFocusedDate(d)}C(k(i))},F=()=>{e&&(w?x(S,!0):R(e,!0))};return y.useEffect(()=>{if(c!=null&&c.endDate&&(c!=null&&c.startDate)){const t=new Date(c.startDate),s=new Date(c.endDate),d=t.getHours(),u=t.getMinutes(),g=s.getHours(),m=s.getMinutes(),l=n.toCalendarDate(n.fromDate(t,n.getLocalTimeZone())),f=n.toCalendarDate(n.fromDate(s,n.getLocalTimeZone()));C({start:l,end:f}),T({start:{hour:d,minut:u},end:{hour:g,minut:m}})}},[JSON.stringify(c)]),h.jsx("div",{className:"iru-flex iru-flex-col",children:h.jsxs(Y.I18nProvider,{locale:"id-ID",children:[j==="RANGE"&&h.jsx(B.default,{defaultValue:k(i),value:e,minValue:I,maxValue:N,withConfirm:D,prevIcon:M,nextIcon:p,buttonReset:L,buttonSubmit:b,onChange:t=>R(t),isCustomTime:w,handlerReset:A,handlerSubmit:F,time:S,minDate:o,maxDate:r,handlerChangeTimeRange:x}),j==="SINGLE"&&h.jsx(K.default,{defaultValue:H(i==null?void 0:i.endDate),value:e==null?void 0:e.end,minValue:I,maxValue:N,minDate:o,maxDate:r,withConfirm:D,prevIcon:M,nextIcon:p,buttonReset:L,buttonSubmit:b,locale:_,time:S,typeTime:"RANGE",handlerChangeTime:x,isCustomTime:w,createCalendar:n.createCalendar,onChange:t=>R({start:t,end:t}),handlerReset:A,handlerSubmit:F,type:["date","month","year"]})]})})};exports.default=Q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("react/jsx-runtime"),R=require("react"),V=require("react-aria"),O=require("../Calendar/CalendarRange.cjs"),t=require("@internationalized/date"),Y=require("../Calendar/Calendar.cjs"),x=r=>{let n;const a=new Date(r??new Date);return r&&(n=t.parseDate(new Date(a.setHours(a.getHours()+7)).toISOString().slice(0,10))),n},A=r=>{const n=new Date(r?.startDate??new Date),a=new Date(r?.endDate??new Date),i=new t.CalendarDate(n.getFullYear(),n.getMonth()+1,n.getDate()),d=new t.CalendarDate(a.getFullYear(),a.getMonth()+1,a.getDate());return r?{start:i,end:d}:void 0},k=r=>{const{minDate:n,maxDate:a,defaultValue:i,withConfirm:d,prevIcon:y,nextIcon:H,buttonReset:M,buttonSubmit:p,typePicker:L="RANGE",onChange:b,value:u,onReset:j,isCustomTime:f}=r,{locale:F}=V.useLocale(),q=x(n),E=x(a),[s,h]=R.useState(),[w,C]=R.useState({start:void 0,end:void 0}),I=e=>{typeof b=="function"&&b(e)},S=(e,o)=>{const c=e.start.toDate(t.getLocalTimeZone()),D=e.end.toDate(t.getLocalTimeZone());h(e),C({start:{hour:0,minut:0,second:0},end:{hour:23,minut:59,second:59}}),(o??!d)&&I({startDate:c,endDate:new Date(D.setHours(23,59,59))})},T=(e,o)=>{if(s?.start&&s?.end&&(C(e),e.start?.hour?.toString()&&e.start?.minut?.toString()&&e.end?.hour?.toString()&&e.end?.minut?.toString()&&(o??!d))){const c=s.start.toDate(t.getLocalTimeZone()),D=s.end.toDate(t.getLocalTimeZone()),l=new Date(c.setHours(e.start.hour,e.start.minut)),g=new Date(D.setHours(e.end.hour,e.end.minut,59));l.getTime()<g.getTime()&&I({startDate:l,endDate:g})}},N=e=>{if(typeof j=="function")j();else if(i&&e){const o=new Date(i.endDate??new Date),c=e.focusedDate.set({month:o.getMonth()+1,year:o.getFullYear()});e.setFocusedDate(c)}h(A(i))},Z=()=>{s&&(f?T(w,!0):S(s,!0))};return R.useEffect(()=>{if(u?.endDate&&u?.startDate){const e=new Date(u.startDate),o=new Date(u.endDate),c=e.getHours(),D=e.getMinutes(),l=o.getHours(),g=o.getMinutes(),G=t.toCalendarDate(t.fromDate(e,t.getLocalTimeZone())),P=t.toCalendarDate(t.fromDate(o,t.getLocalTimeZone()));h({start:G,end:P}),C({start:{hour:c,minut:D},end:{hour:l,minut:g}})}},[JSON.stringify(u)]),m.jsx("div",{className:"iru-flex iru-flex-col",children:m.jsxs(V.I18nProvider,{locale:"id-ID",children:[L==="RANGE"&&m.jsx(O.default,{defaultValue:A(i),value:s,minValue:q,maxValue:E,withConfirm:d,prevIcon:y,nextIcon:H,buttonReset:M,buttonSubmit:p,onChange:e=>S(e),isCustomTime:f,handlerReset:N,handlerSubmit:Z,time:w,minDate:n,maxDate:a,handlerChangeTimeRange:T}),L==="SINGLE"&&m.jsx(Y.default,{defaultValue:x(i?.endDate),value:s?.end,minValue:q,maxValue:E,minDate:n,maxDate:a,withConfirm:d,prevIcon:y,nextIcon:H,buttonReset:M,buttonSubmit:p,locale:F,time:w,typeTime:"RANGE",handlerChangeTime:T,isCustomTime:f,createCalendar:t.createCalendar,onChange:e=>S({start:e,end:e}),handlerReset:N,handlerSubmit:Z,type:["date","month","year"]})]})})};exports.default=k;
@@ -1,112 +1,111 @@
1
- import { jsx as H, jsxs as U } from "react/jsx-runtime";
2
- import O, { useEffect as W } from "react";
3
- import { useLocale as X, I18nProvider as _ } from "react-aria";
4
- import $ from "../Calendar/CalendarRange.mjs";
5
- import { toCalendarDate as J, fromDate as Z, getLocalTimeZone as m, createCalendar as v, parseDate as tt, CalendarDate as q } from "@internationalized/date";
6
- import et from "../Calendar/Calendar.mjs";
7
- const x = (n) => {
8
- let o;
9
- const a = new Date(n ?? /* @__PURE__ */ new Date());
10
- return n && (o = tt(new Date(a.setHours(a.getHours() + 7)).toISOString().slice(0, 10))), o;
11
- }, z = (n) => {
12
- const o = new Date((n == null ? void 0 : n.startDate) ?? /* @__PURE__ */ new Date()), a = new Date((n == null ? void 0 : n.endDate) ?? /* @__PURE__ */ new Date()), s = new q(o.getFullYear(), o.getMonth() + 1, o.getDate()), D = new q(a.getFullYear(), a.getMonth() + 1, a.getDate());
13
- return n ? { start: s, end: D } : void 0;
14
- }, ct = (n) => {
1
+ import { jsx as S, jsxs as Z } from "react/jsx-runtime";
2
+ import A, { useEffect as q } from "react";
3
+ import { useLocale as z, I18nProvider as B } from "react-aria";
4
+ import K from "../Calendar/CalendarRange.mjs";
5
+ import { toCalendarDate as L, fromDate as P, getLocalTimeZone as c, createCalendar as Q, parseDate as U, CalendarDate as Y } from "@internationalized/date";
6
+ import W from "../Calendar/Calendar.mjs";
7
+ const R = (o) => {
8
+ let e;
9
+ const n = new Date(o ?? /* @__PURE__ */ new Date());
10
+ return o && (e = U(new Date(n.setHours(n.getHours() + 7)).toISOString().slice(0, 10))), e;
11
+ }, j = (o) => {
12
+ const e = new Date(o?.startDate ?? /* @__PURE__ */ new Date()), n = new Date(o?.endDate ?? /* @__PURE__ */ new Date()), s = new Y(e.getFullYear(), e.getMonth() + 1, e.getDate()), d = new Y(n.getFullYear(), n.getMonth() + 1, n.getDate());
13
+ return o ? { start: s, end: d } : void 0;
14
+ }, nt = (o) => {
15
15
  const {
16
- minDate: o,
17
- maxDate: a,
16
+ minDate: e,
17
+ maxDate: n,
18
18
  defaultValue: s,
19
- withConfirm: D,
20
- prevIcon: y,
21
- nextIcon: T,
22
- buttonReset: M,
23
- buttonSubmit: E,
24
- typePicker: I = "RANGE",
25
- onChange: N,
26
- value: i,
27
- onReset: b,
28
- isCustomTime: w
29
- } = n, { locale: B } = X(), F = x(o), G = x(a), [e, l] = O.useState(), [p, C] = O.useState({ start: void 0, end: void 0 }), A = (t) => {
30
- typeof N == "function" && N(t);
31
- }, S = (t, r) => {
32
- const c = t.start.toDate(m()), d = t.end.toDate(m());
33
- l(t), C({ start: { hour: 0, minut: 0, second: 0 }, end: { hour: 23, minut: 59, second: 59 } }), (r ?? !D) && A({ startDate: c, endDate: new Date(d.setHours(23, 59, 59)) });
34
- }, R = (t, r) => {
35
- var c, d, u, f, g, h, V, Y;
36
- if (e != null && e.start && (e != null && e.end) && (C(t), (d = (c = t.start) == null ? void 0 : c.hour) != null && d.toString() && ((f = (u = t.start) == null ? void 0 : u.minut) != null && f.toString()) && ((h = (g = t.end) == null ? void 0 : g.hour) != null && h.toString()) && ((Y = (V = t.end) == null ? void 0 : V.minut) != null && Y.toString()) && (r ?? !D))) {
37
- const K = e.start.toDate(m()), Q = e.end.toDate(m()), j = new Date(K.setHours(t.start.hour, t.start.minut)), k = new Date(Q.setHours(t.end.hour, t.end.minut, 59));
38
- j.getTime() < k.getTime() && A({ startDate: j, endDate: k });
19
+ withConfirm: d,
20
+ prevIcon: H,
21
+ nextIcon: x,
22
+ buttonReset: y,
23
+ buttonSubmit: T,
24
+ typePicker: M = "RANGE",
25
+ onChange: E,
26
+ value: D,
27
+ onReset: I,
28
+ isCustomTime: l
29
+ } = o, { locale: k } = z(), N = R(e), V = R(n), [r, g] = A.useState(), [h, w] = A.useState({ start: void 0, end: void 0 }), b = (t) => {
30
+ typeof E == "function" && E(t);
31
+ }, p = (t, a) => {
32
+ const i = t.start.toDate(c()), u = t.end.toDate(c());
33
+ g(t), w({ start: { hour: 0, minut: 0, second: 0 }, end: { hour: 23, minut: 59, second: 59 } }), (a ?? !d) && b({ startDate: i, endDate: new Date(u.setHours(23, 59, 59)) });
34
+ }, C = (t, a) => {
35
+ if (r?.start && r?.end && (w(t), t.start?.hour?.toString() && t.start?.minut?.toString() && t.end?.hour?.toString() && t.end?.minut?.toString() && (a ?? !d))) {
36
+ const i = r.start.toDate(c()), u = r.end.toDate(c()), m = new Date(i.setHours(t.start.hour, t.start.minut)), f = new Date(u.setHours(t.end.hour, t.end.minut, 59));
37
+ m.getTime() < f.getTime() && b({ startDate: m, endDate: f });
39
38
  }
40
- }, L = (t) => {
41
- if (typeof b == "function")
42
- b();
39
+ }, F = (t) => {
40
+ if (typeof I == "function")
41
+ I();
43
42
  else if (s && t) {
44
- const r = new Date(s.endDate ?? /* @__PURE__ */ new Date()), c = t.focusedDate.set({
45
- month: r.getMonth() + 1,
46
- year: r.getFullYear()
43
+ const a = new Date(s.endDate ?? /* @__PURE__ */ new Date()), i = t.focusedDate.set({
44
+ month: a.getMonth() + 1,
45
+ year: a.getFullYear()
47
46
  });
48
- t.setFocusedDate(c);
47
+ t.setFocusedDate(i);
49
48
  }
50
- l(z(s));
51
- }, P = () => {
52
- e && (w ? R(p, !0) : S(e, !0));
49
+ g(j(s));
50
+ }, G = () => {
51
+ r && (l ? C(h, !0) : p(r, !0));
53
52
  };
54
- return W(() => {
55
- if (i != null && i.endDate && (i != null && i.startDate)) {
56
- const t = new Date(i.startDate), r = new Date(i.endDate), c = t.getHours(), d = t.getMinutes(), u = r.getHours(), f = r.getMinutes(), g = J(Z(t, m())), h = J(Z(r, m()));
57
- l({ start: g, end: h }), C({ start: { hour: c, minut: d }, end: { hour: u, minut: f } });
53
+ return q(() => {
54
+ if (D?.endDate && D?.startDate) {
55
+ const t = new Date(D.startDate), a = new Date(D.endDate), i = t.getHours(), u = t.getMinutes(), m = a.getHours(), f = a.getMinutes(), O = L(P(t, c())), J = L(P(a, c()));
56
+ g({ start: O, end: J }), w({ start: { hour: i, minut: u }, end: { hour: m, minut: f } });
58
57
  }
59
- }, [JSON.stringify(i)]), /* @__PURE__ */ H("div", { className: "iru-flex iru-flex-col", children: /* @__PURE__ */ U(_, { locale: "id-ID", children: [
60
- I === "RANGE" && /* @__PURE__ */ H(
61
- $,
58
+ }, [JSON.stringify(D)]), /* @__PURE__ */ S("div", { className: "iru-flex iru-flex-col", children: /* @__PURE__ */ Z(B, { locale: "id-ID", children: [
59
+ M === "RANGE" && /* @__PURE__ */ S(
60
+ K,
62
61
  {
63
- defaultValue: z(s),
64
- value: e,
65
- minValue: F,
66
- maxValue: G,
67
- withConfirm: D,
68
- prevIcon: y,
69
- nextIcon: T,
70
- buttonReset: M,
71
- buttonSubmit: E,
72
- onChange: (t) => S(t),
73
- isCustomTime: w,
74
- handlerReset: L,
75
- handlerSubmit: P,
76
- time: p,
77
- minDate: o,
78
- maxDate: a,
79
- handlerChangeTimeRange: R
62
+ defaultValue: j(s),
63
+ value: r,
64
+ minValue: N,
65
+ maxValue: V,
66
+ withConfirm: d,
67
+ prevIcon: H,
68
+ nextIcon: x,
69
+ buttonReset: y,
70
+ buttonSubmit: T,
71
+ onChange: (t) => p(t),
72
+ isCustomTime: l,
73
+ handlerReset: F,
74
+ handlerSubmit: G,
75
+ time: h,
76
+ minDate: e,
77
+ maxDate: n,
78
+ handlerChangeTimeRange: C
80
79
  }
81
80
  ),
82
- I === "SINGLE" && /* @__PURE__ */ H(
83
- et,
81
+ M === "SINGLE" && /* @__PURE__ */ S(
82
+ W,
84
83
  {
85
- defaultValue: x(s == null ? void 0 : s.endDate),
86
- value: e == null ? void 0 : e.end,
87
- minValue: F,
88
- maxValue: G,
89
- minDate: o,
90
- maxDate: a,
91
- withConfirm: D,
92
- prevIcon: y,
93
- nextIcon: T,
94
- buttonReset: M,
95
- buttonSubmit: E,
96
- locale: B,
97
- time: p,
84
+ defaultValue: R(s?.endDate),
85
+ value: r?.end,
86
+ minValue: N,
87
+ maxValue: V,
88
+ minDate: e,
89
+ maxDate: n,
90
+ withConfirm: d,
91
+ prevIcon: H,
92
+ nextIcon: x,
93
+ buttonReset: y,
94
+ buttonSubmit: T,
95
+ locale: k,
96
+ time: h,
98
97
  typeTime: "RANGE",
99
- handlerChangeTime: R,
100
- isCustomTime: w,
101
- createCalendar: v,
102
- onChange: (t) => S({ start: t, end: t }),
103
- handlerReset: L,
104
- handlerSubmit: P,
98
+ handlerChangeTime: C,
99
+ isCustomTime: l,
100
+ createCalendar: Q,
101
+ onChange: (t) => p({ start: t, end: t }),
102
+ handlerReset: F,
103
+ handlerSubmit: G,
105
104
  type: ["date", "month", "year"]
106
105
  }
107
106
  )
108
107
  ] }) });
109
108
  };
110
109
  export {
111
- ct as default
110
+ nt as default
112
111
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),r=require("react"),Q=require("./DateRangePicker.cjs"),U=require("../Popover/Popover.cjs"),m=require("../Calendar/style.module.scss.cjs"),k=require("../../utils/common.cjs"),X=require("../Button/Button.cjs"),Z=({value:o,prevIcon:T,nextIcon:K,buttonReset:g,buttonSubmit:q,className:H,classNameButton:N,buttonClick:c,buttonList:w,typePicker:R="RANGE",onChange:Y,idPopover:W="filter-date-popover",id:P="filter-date",floatingOptions:B={},offsetPopover:E=5,zIndexPopper:O=0,defaultValueLabel:l,isCustomTime:$=!1,mountedExecuteChange:_=!0,formatingDate:D})=>{const S=[{key:"thisDay",value:"Hari ini"},{key:"thisWeek",value:"Minggu ini"},{key:"thisMonth",value:"Bulan ini"},{key:"thisYear",value:"Tahun ini"},{key:"yesterday",value:"Kemarin"},{key:"lastWeek",value:"Minggu lalu"},{key:"lastMonth",value:"Bulan lalu"},{key:"lastYear",value:"Tahun lalu"},{key:"custom",value:"Kustom"}],b=r.useRef(null),[n,M]=r.useState(),[z,i]=r.useState(),[x,p]=r.useState(),d=(e,t)=>{const a=new Date(e??new Date);return t==="start"?new Date(a.setHours(0,0,0)):new Date(a.setHours(23,59,59))},V=()=>{const e=new Date;return{startDate:e,endDate:e}},v=()=>{const e=new Date;e.setDate(e.getDate()-e.getDay());const t=new Date;return t.setDate(t.getDate()+(6-t.getDay())),{startDate:e,endDate:t}},A=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return{startDate:t,endDate:a}},G=()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear(),11,31);return{startDate:e,endDate:t}},I=()=>{const e=new Date(new Date().setDate(new Date().getDate()-1));return{startDate:e,endDate:e}},J=()=>{const e=new Date;e.setDate(e.getDate()-(7+e.getDay()));const t=new Date;return t.setDate(t.getDate()-(t.getDay()+1)),{startDate:e,endDate:t}},C=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return{startDate:t,endDate:a}},L=()=>{const e=new Date(new Date().getFullYear()-1,0,1),t=new Date(new Date().getFullYear()-1,11,31);return{startDate:e,endDate:t}},u=(e,t,a)=>{var h;if(p(e),typeof Y=="function"){let j=e;D==="string"&&e?j={startDate:k.formatDate(e.startDate,D),endDate:k.formatDate(e.endDate,D)}:typeof D=="boolean"&&e&&(j={startDate:k.formatDate(e.startDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),endDate:k.formatDate(e.endDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}),(h=b.current)==null||h.setShow(!1),Y(j,t??"",a)}},f=(e,t)=>{M(e);let a;if((e==null?void 0:e.key)!=="custom"){switch(i(e),e==null?void 0:e.key){case"thisDay":a=V();break;case"thisWeek":a=v();break;case"thisMonth":a=A();break;case"thisYear":a=G();break;case"yesterday":a=I();break;case"lastWeek":a=J();break;case"lastMonth":a=C();break;case"lastYear":a=L();break}a&&t&&u({startDate:d(a.startDate,"start"),endDate:d(a.endDate,"end")},e==null?void 0:e.value,e)}},y=(e,t)=>{const a=(w??S).find(h=>h.key===e);!e&&!a?(t&&u(),f(void 0,t),i(void 0)):typeof e=="object"?(t&&u({startDate:d(e.startDate,"start"),endDate:d(e.endDate,"end")},"Kustom",{key:"custom",value:"Kustom"}),f({key:"custom",value:"Kustom"},t),i({key:"custom",value:"Kustom"})):(f(a,t),i(a))},F=()=>{var e;if(o){p(o);const t=(e=w??S)==null?void 0:e.find(a=>a.key===o.label||a.value===o.label);Object.keys(t||{}).length>0&&M(t)}else M(void 0),i(void 0)};return r.useEffect(()=>{F()},[JSON.stringify(o)]),r.useEffect(()=>{y(l??o,_)},[]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:e=>{var t;(t=b.current)==null||t.handlerShow(e),F()},className:N,id:P,children:[r.isValidElement(c)&&c,typeof c=="function"?c(x,z):"Pilih Filter"]}),s.jsx(U.default,{zIndex:O,ref:b,offset:E,id:W,floatingOptions:{placement:"bottom-end",...B},children:s.jsxs("div",{className:`${m.default["container-filter-date"]} ${H}`,children:[s.jsxs("div",{children:[(w??S).map((e,t)=>s.jsx("div",{className:`${m.default["button-filter-date"]} hover:iru-bg-laba-blue-01 ${(n==null?void 0:n.key)===e.key?"iru-text-laba-blue-10":""}`,onClick:()=>f(e,!0),children:e.value},t)),(n==null?void 0:n.key)!=="custom"&&s.jsx(s.Fragment,{children:typeof g=="function"?s.jsx("div",{className:m.default["button-filter-date-custome"],onClick:()=>y(l,!0),children:g()}):s.jsx(X.default,{className:m.default["button-reset-filter-date"],variants:"nude-laba-blue-10",size:"small",onClick:()=>y(l,!0),children:"Reset"})})]}),(n==null?void 0:n.key)==="custom"&&s.jsx("div",{children:s.jsx(Q.default,{defaultValue:x,value:x,prevIcon:T,nextIcon:K,buttonReset:g,buttonSubmit:q,isCustomTime:$,onChange:e=>{u(e,"Kustom",{key:"custom",value:"Kustom"}),i({key:"custom",value:"Kustom"})},onReset:()=>{y(l,!0)},typePicker:R,withConfirm:!0})})]})})]})};exports.default=Z;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),n=require("react"),L=require("./DateRangePicker.cjs"),Q=require("../Popover/Popover.cjs"),h=require("../Calendar/style.module.scss.cjs"),m=require("../../utils/common.cjs"),U=require("../Button/Button.cjs"),X=({value:r,prevIcon:v,nextIcon:F,buttonReset:k,buttonSubmit:T,className:K,classNameButton:q,buttonClick:i,buttonList:g,typePicker:H="RANGE",onChange:j,idPopover:N="filter-date-popover",id:R="filter-date",floatingOptions:W={},offsetPopover:P=5,zIndexPopper:B=0,defaultValueLabel:c,isCustomTime:E=!1,mountedExecuteChange:O=!0,formatingDate:u})=>{const w=[{key:"thisDay",value:"Hari ini"},{key:"thisWeek",value:"Minggu ini"},{key:"thisMonth",value:"Bulan ini"},{key:"thisYear",value:"Tahun ini"},{key:"yesterday",value:"Kemarin"},{key:"lastWeek",value:"Minggu lalu"},{key:"lastMonth",value:"Bulan lalu"},{key:"lastYear",value:"Tahun lalu"},{key:"custom",value:"Kustom"}],S=n.useRef(null),[b,M]=n.useState(),[$,o]=n.useState(),[x,Y]=n.useState(),D=(e,t)=>{const a=new Date(e??new Date);return t==="start"?new Date(a.setHours(0,0,0)):new Date(a.setHours(23,59,59))},_=()=>{const e=new Date;return{startDate:e,endDate:e}},z=()=>{const e=new Date;e.setDate(e.getDate()-e.getDay());const t=new Date;return t.setDate(t.getDate()+(6-t.getDay())),{startDate:e,endDate:t}},V=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return{startDate:t,endDate:a}},A=()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear(),11,31);return{startDate:e,endDate:t}},G=()=>{const e=new Date(new Date().setDate(new Date().getDate()-1));return{startDate:e,endDate:e}},I=()=>{const e=new Date;e.setDate(e.getDate()-(7+e.getDay()));const t=new Date;return t.setDate(t.getDate()-(t.getDay()+1)),{startDate:e,endDate:t}},J=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return{startDate:t,endDate:a}},C=()=>{const e=new Date(new Date().getFullYear()-1,0,1),t=new Date(new Date().getFullYear()-1,11,31);return{startDate:e,endDate:t}},d=(e,t,a)=>{if(Y(e),typeof j=="function"){let l=e;u==="string"&&e?l={startDate:m.formatDate(e.startDate,u),endDate:m.formatDate(e.endDate,u)}:typeof u=="boolean"&&e&&(l={startDate:m.formatDate(e.startDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),endDate:m.formatDate(e.endDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}),S.current?.setShow(!1),j(l,t??"",a)}},f=(e,t)=>{M(e);let a;if(e?.key!=="custom"){switch(o(e),e?.key){case"thisDay":a=_();break;case"thisWeek":a=z();break;case"thisMonth":a=V();break;case"thisYear":a=A();break;case"yesterday":a=G();break;case"lastWeek":a=I();break;case"lastMonth":a=J();break;case"lastYear":a=C();break}a&&t&&d({startDate:D(a.startDate,"start"),endDate:D(a.endDate,"end")},e?.value,e)}},y=(e,t)=>{const a=(g??w).find(l=>l.key===e);!e&&!a?(t&&d(),f(void 0,t),o(void 0)):typeof e=="object"?(t&&d({startDate:D(e.startDate,"start"),endDate:D(e.endDate,"end")},"Kustom",{key:"custom",value:"Kustom"}),f({key:"custom",value:"Kustom"},t),o({key:"custom",value:"Kustom"})):(f(a,t),o(a))},p=()=>{if(r){Y(r);const e=(g??w)?.find(t=>t.key===r.label||t.value===r.label);Object.keys(e||{}).length>0&&M(e)}else M(void 0),o(void 0)};return n.useEffect(()=>{p()},[JSON.stringify(r)]),n.useEffect(()=>{y(c??r,O)},[]),s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:e=>{S.current?.handlerShow(e),p()},className:q,id:R,children:[n.isValidElement(i)&&i,typeof i=="function"?i(x,$):"Pilih Filter"]}),s.jsx(Q.default,{zIndex:B,ref:S,offset:P,id:N,floatingOptions:{placement:"bottom-end",...W},children:s.jsxs("div",{className:`${h.default["container-filter-date"]} ${K}`,children:[s.jsxs("div",{children:[(g??w).map((e,t)=>s.jsx("div",{className:`${h.default["button-filter-date"]} hover:iru-bg-laba-blue-01 ${b?.key===e.key?"iru-text-laba-blue-10":""}`,onClick:()=>f(e,!0),children:e.value},t)),b?.key!=="custom"&&s.jsx(s.Fragment,{children:typeof k=="function"?s.jsx("div",{className:h.default["button-filter-date-custome"],onClick:()=>y(c,!0),children:k()}):s.jsx(U.default,{className:h.default["button-reset-filter-date"],variants:"nude-laba-blue-10",size:"small",onClick:()=>y(c,!0),children:"Reset"})})]}),b?.key==="custom"&&s.jsx("div",{children:s.jsx(L.default,{defaultValue:x,value:x,prevIcon:v,nextIcon:F,buttonReset:k,buttonSubmit:T,isCustomTime:E,onChange:e=>{d(e,"Kustom",{key:"custom",value:"Kustom"}),o({key:"custom",value:"Kustom"})},onReset:()=>{y(c,!0)},typePicker:H,withConfirm:!0})})]})})]})};exports.default=X;