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.
- package/dist/assets/_mixins.scss +72 -72
- package/dist/assets/icons/arrow-narrow-down.svg +3 -3
- package/dist/assets/style.css +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.mjs +40 -40
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
- package/dist/components/Button/Button.cjs +12 -12
- package/dist/components/Button/Button.config.cjs +1 -1
- package/dist/components/Button/Button.config.mjs +3 -1
- package/dist/components/Button/Button.mjs +24 -24
- package/dist/components/Button/style.module.scss.cjs +1 -1
- package/dist/components/Button/style.module.scss.mjs +57 -55
- package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -12
- package/dist/components/ButtonIcon/ButtonIcon.mjs +20 -20
- package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
- package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.mjs +98 -100
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +41 -42
- package/dist/components/Calendar/CalendarRange.cjs +1 -1
- package/dist/components/Calendar/CalendarRange.mjs +59 -61
- package/dist/components/Calendar/CalendarYear.cjs +3 -3
- package/dist/components/Calendar/CalendarYear.mjs +39 -40
- package/dist/components/Chart/DoughnutChart.cjs +1 -1
- package/dist/components/Chart/DoughnutChart.mjs +93 -96
- package/dist/components/Chart/GradientBarChart.cjs +1 -1
- package/dist/components/Chart/GradientBarChart.mjs +80 -81
- package/dist/components/Chart/GradientLineChart.cjs +1 -1
- package/dist/components/Chart/GradientLineChart.mjs +50 -51
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.mjs +23 -23
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.mjs +45 -48
- package/dist/components/Collapse/Collapse.cjs +1 -1
- package/dist/components/Collapse/Collapse.mjs +23 -24
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +86 -89
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +107 -110
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
- package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
- package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
- package/dist/components/Input/InputFloatingInner.cjs +5 -5
- package/dist/components/Input/InputFloatingInner.mjs +24 -25
- package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
- package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
- package/dist/components/Pagination/Pagination.cjs +2 -2
- package/dist/components/Pagination/Pagination.mjs +76 -80
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
- package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
- package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.mjs +65 -68
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.mjs +61 -0
- package/dist/components/Slider/style.module.scss.cjs +1 -0
- package/dist/components/Slider/style.module.scss.mjs +14 -0
- package/dist/components/Step/Step.cjs +5 -5
- package/dist/components/Step/Step.mjs +52 -52
- package/dist/components/Table/Table.cjs +3 -3
- package/dist/components/Table/Table.mjs +275 -298
- package/dist/components/Table/TableSubMobile.cjs +1 -1
- package/dist/components/Table/TableSubMobile.mjs +32 -35
- package/dist/components/Tabs/Tabs.cjs +8 -8
- package/dist/components/Tabs/Tabs.mjs +66 -70
- package/dist/components/Textarea/Textarea.cjs +7 -7
- package/dist/components/Textarea/Textarea.mjs +47 -50
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
- package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
- package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
- package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
- package/dist/components/TimeRange/TimeRange.cjs +1 -1
- package/dist/components/TimeRange/TimeRange.mjs +88 -91
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +44 -46
- package/dist/components/Upload/UploadFile.cjs +1 -1
- package/dist/components/Upload/UploadFile.mjs +50 -54
- package/dist/components/Upload/UploadImage.cjs +12 -12
- package/dist/components/Upload/UploadImage.mjs +73 -79
- package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
- package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
- package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
- package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
- package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
- package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
- package/dist/config/components/tinymce.cjs +2 -2
- package/dist/config/components/tinymce.mjs +3 -3
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.mjs +15 -15
- package/dist/hooks/useDebounce.cjs +1 -1
- package/dist/hooks/useDebounce.mjs +19 -19
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +48 -46
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +129 -128
- package/dist/package.json.mjs +1 -1
- package/dist/src/components/Button/Button.config.d.ts +2 -0
- package/dist/src/components/Slider/Slider.d.ts +3 -0
- package/dist/src/components/Slider/Slider.stories.d.ts +6 -0
- package/dist/src/components/index.d.ts +4 -2
- package/dist/src/interfaces/components/Button/index.d.ts +1 -1
- package/dist/src/interfaces/components/Slider/index.d.ts +51 -0
- package/dist/types-external/table.d.ts +15 -15
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +128 -128
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("react"),
|
|
2
|
-
16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629
|
|
3
|
-
3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861
|
|
4
|
-
18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514
|
|
5
|
-
18.4934 22.3961C20.4357 21.2764 22.0171 19.64 23.0698 17.6815C23.4381 16.9963 23.0758 16.1731
|
|
6
|
-
22.3522 15.8876C21.6286 15.6021 20.8195 15.9647 20.4268 16.6361C19.6248 18.0072 18.4764 19.1543
|
|
7
|
-
17.0864 19.9556C15.2874 20.9927 13.19 21.3895 11.1365 21.0812C9.08296 20.7728 7.19456 19.7776
|
|
8
|
-
5.77946 18.2579C4.36436 16.7382 3.50612 14.7837 3.34479 12.7134C3.18346 10.6431 3.72858
|
|
9
|
-
8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607
|
|
10
|
-
2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049
|
|
11
|
-
6.79445 20.9604 7.02733 21.6311 6.63315Z`,fill:"currentColor"})}),
|
|
12
|
-
${n?
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("react"),s=require("./style.module.scss.cjs"),t=require("./ButtonIcon.config.cjs"),b=({className:o=""})=>e.jsx("svg",{className:`${s.default["icon-loading"]} ${o??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:e.jsx("path",{d:`M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063
|
|
2
|
+
16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629
|
|
3
|
+
3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861
|
|
4
|
+
18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514
|
|
5
|
+
18.4934 22.3961C20.4357 21.2764 22.0171 19.64 23.0698 17.6815C23.4381 16.9963 23.0758 16.1731
|
|
6
|
+
22.3522 15.8876C21.6286 15.6021 20.8195 15.9647 20.4268 16.6361C19.6248 18.0072 18.4764 19.1543
|
|
7
|
+
17.0864 19.9556C15.2874 20.9927 13.19 21.3895 11.1365 21.0812C9.08296 20.7728 7.19456 19.7776
|
|
8
|
+
5.77946 18.2579C4.36436 16.7382 3.50612 14.7837 3.34479 12.7134C3.18346 10.6431 3.72858
|
|
9
|
+
8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607
|
|
10
|
+
2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049
|
|
11
|
+
6.79445 20.9604 7.02733 21.6311 6.63315Z`,fill:"currentColor"})}),a=h.forwardRef((o,l)=>{const{size:i="reguler",variants:r="primary-laba-blue-10",children:c,className:u,classNameIconLoading:d,loading:n,onClick:C,type:g="button",disabled:f,...m}=o;return e.jsxs("button",{onClick:n?void 0:C,ref:l,className:`${t.configButton.size[i]} ${t.configButton.variants[r]}
|
|
12
|
+
${n?s.default.loading:""} ${u??""}`,type:g,disabled:f??n,...m,children:[n&&e.jsx(b,{className:`${t.configButton.loadingSize[i]} ${d}`}),c]})});a.displayName="ButtonIcon";exports.default=a;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsxs as u, jsx as
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { configButton as
|
|
5
|
-
const h = ({ className: o = "" }) => /* @__PURE__ */
|
|
3
|
+
import r from "./style.module.scss.mjs";
|
|
4
|
+
import { configButton as i } from "./ButtonIcon.config.mjs";
|
|
5
|
+
const h = ({ className: o = "" }) => /* @__PURE__ */ t(
|
|
6
6
|
"svg",
|
|
7
7
|
{
|
|
8
|
-
className: `${
|
|
8
|
+
className: `${r["icon-loading"]} ${o ?? ""}`,
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
width: "25",
|
|
11
11
|
height: "24",
|
|
12
12
|
viewBox: "0 0 25 24",
|
|
13
13
|
fill: "none",
|
|
14
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ t(
|
|
15
15
|
"path",
|
|
16
16
|
{
|
|
17
|
-
d: `M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063
|
|
18
|
-
16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629
|
|
19
|
-
3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861
|
|
20
|
-
18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514
|
|
21
|
-
18.4934 22.3961C20.4357 21.2764 22.0171 19.64 23.0698 17.6815C23.4381 16.9963 23.0758 16.1731
|
|
22
|
-
22.3522 15.8876C21.6286 15.6021 20.8195 15.9647 20.4268 16.6361C19.6248 18.0072 18.4764 19.1543
|
|
23
|
-
17.0864 19.9556C15.2874 20.9927 13.19 21.3895 11.1365 21.0812C9.08296 20.7728 7.19456 19.7776
|
|
24
|
-
5.77946 18.2579C4.36436 16.7382 3.50612 14.7837 3.34479 12.7134C3.18346 10.6431 3.72858
|
|
25
|
-
8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607
|
|
26
|
-
2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049
|
|
17
|
+
d: `M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063
|
|
18
|
+
16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629
|
|
19
|
+
3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861
|
|
20
|
+
18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514
|
|
21
|
+
18.4934 22.3961C20.4357 21.2764 22.0171 19.64 23.0698 17.6815C23.4381 16.9963 23.0758 16.1731
|
|
22
|
+
22.3522 15.8876C21.6286 15.6021 20.8195 15.9647 20.4268 16.6361C19.6248 18.0072 18.4764 19.1543
|
|
23
|
+
17.0864 19.9556C15.2874 20.9927 13.19 21.3895 11.1365 21.0812C9.08296 20.7728 7.19456 19.7776
|
|
24
|
+
5.77946 18.2579C4.36436 16.7382 3.50612 14.7837 3.34479 12.7134C3.18346 10.6431 3.72858
|
|
25
|
+
8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607
|
|
26
|
+
2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049
|
|
27
27
|
6.79445 20.9604 7.02733 21.6311 6.63315Z`,
|
|
28
28
|
fill: "currentColor"
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ const h = ({ className: o = "" }) => /* @__PURE__ */ i(
|
|
|
31
31
|
}
|
|
32
32
|
), $ = f((o, e) => {
|
|
33
33
|
const {
|
|
34
|
-
size:
|
|
34
|
+
size: a = "reguler",
|
|
35
35
|
variants: s = "primary-laba-blue-10",
|
|
36
36
|
children: l,
|
|
37
37
|
className: C,
|
|
@@ -47,13 +47,13 @@ const h = ({ className: o = "" }) => /* @__PURE__ */ i(
|
|
|
47
47
|
{
|
|
48
48
|
onClick: n ? void 0 : d,
|
|
49
49
|
ref: e,
|
|
50
|
-
className: `${
|
|
51
|
-
${n ?
|
|
50
|
+
className: `${i.size[a]} ${i.variants[s]}
|
|
51
|
+
${n ? r.loading : ""} ${C ?? ""}`,
|
|
52
52
|
type: m,
|
|
53
53
|
disabled: g ?? n,
|
|
54
54
|
...p,
|
|
55
55
|
children: [
|
|
56
|
-
n && /* @__PURE__ */
|
|
56
|
+
n && /* @__PURE__ */ t(h, { className: `${i.loadingSize[a]} ${c}` }),
|
|
57
57
|
l
|
|
58
58
|
]
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),t=require("react"),F=require("../Popover/Popover.cjs"),M=require("../Button/Button.cjs"),c=require("./style.module.scss.cjs"),m=t.forwardRef((v,w)=>{const{children:S,id:I="1ru-button-popover",text:x="",startIcon:P,endIcon:j,startIconShow:N,endIconShow:R,classNameButton:g="",classNameButtonShow:$="",className:q="",placement:y="top-end",popoverProps:B,zIndexPopover:b=1,offset:C=5,idPopover:_="1ru-popover-button-popover",onClick:u,onClose:i,...k}=v,s=t.useRef(null),z=t.useRef(null),[n,r]=t.useState(!1),d=(e,p,h)=>{let a=o.jsx(o.Fragment,{});return e&&t.isValidElement(p)?a=p:t.isValidElement(h)&&(a=o.jsx("div",{className:`${c.default.icon} ${e?c.default.show:""}`,children:h})),a},E=e=>{s.current?.setShow(e),r(e)},f=e=>{s.current?.handlerShow(e),r(!0)},l=()=>{r(!1),s.current?.setShow(!1),typeof i=="function"&&i()};return t.useImperativeHandle(w,()=>({show:n,setShow:E,handlerClose:l,handlerShow:f}),[n]),o.jsxs(o.Fragment,{children:[o.jsx(M.default,{ref:z,id:I,className:`${g} ${n?$:""}`,onClick:e=>{n?l():typeof u=="function"?u(e):f(e)},startIcon:d(n,N,P),endIcon:d(n,R,j),...k,children:x}),o.jsx(F.default,{ref:s,id:_,offset:C,floatingOptions:{placement:y},zIndex:b,onClose:l,className:`${c.default["container-popover"]} ${q}`,...B,children:S})]})});m.displayName="ButtonPopover";exports.default=m;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as F, Fragment as h, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as F, Fragment as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
3
|
import H from "../Popover/Popover.mjs";
|
|
4
4
|
import O from "../Button/Button.mjs";
|
|
5
|
-
import
|
|
6
|
-
const q =
|
|
5
|
+
import c from "./style.module.scss.mjs";
|
|
6
|
+
const q = o.forwardRef((w, v) => {
|
|
7
7
|
const {
|
|
8
8
|
children: I,
|
|
9
9
|
id: S = "1ru-button-popover",
|
|
@@ -20,58 +20,55 @@ const q = t.forwardRef((w, v) => {
|
|
|
20
20
|
zIndexPopover: j = 1,
|
|
21
21
|
offset: k = 5,
|
|
22
22
|
idPopover: z = "1ru-popover-button-popover",
|
|
23
|
-
onClick:
|
|
24
|
-
onClose:
|
|
23
|
+
onClick: p,
|
|
24
|
+
onClose: i,
|
|
25
25
|
...E
|
|
26
|
-
} = w,
|
|
27
|
-
let
|
|
28
|
-
return e &&
|
|
26
|
+
} = w, n = o.useRef(null), V = o.useRef(null), [t, s] = o.useState(!1), f = (e, u, m) => {
|
|
27
|
+
let a = /* @__PURE__ */ r(h, {});
|
|
28
|
+
return e && o.isValidElement(u) ? a = u : o.isValidElement(m) && (a = /* @__PURE__ */ r("div", { className: `${c.icon} ${e ? c.show : ""}`, children: m })), a;
|
|
29
29
|
}, D = (e) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
}, a = () => {
|
|
36
|
-
var e;
|
|
37
|
-
l(!1), (e = r.current) == null || e.setShow(!1), typeof f == "function" && f();
|
|
30
|
+
n.current?.setShow(e), s(e);
|
|
31
|
+
}, d = (e) => {
|
|
32
|
+
n.current?.handlerShow(e), s(!0);
|
|
33
|
+
}, l = () => {
|
|
34
|
+
s(!1), n.current?.setShow(!1), typeof i == "function" && i();
|
|
38
35
|
};
|
|
39
|
-
return
|
|
36
|
+
return o.useImperativeHandle(
|
|
40
37
|
v,
|
|
41
38
|
() => ({
|
|
42
|
-
show:
|
|
39
|
+
show: t,
|
|
43
40
|
setShow: D,
|
|
44
|
-
handlerClose:
|
|
45
|
-
handlerShow:
|
|
41
|
+
handlerClose: l,
|
|
42
|
+
handlerShow: d
|
|
46
43
|
}),
|
|
47
44
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
[
|
|
45
|
+
[t]
|
|
49
46
|
), /* @__PURE__ */ F(h, { children: [
|
|
50
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ r(
|
|
51
48
|
O,
|
|
52
49
|
{
|
|
53
50
|
ref: V,
|
|
54
51
|
id: S,
|
|
55
|
-
className: `${B} ${
|
|
52
|
+
className: `${B} ${t ? y : ""}`,
|
|
56
53
|
onClick: (e) => {
|
|
57
|
-
|
|
54
|
+
t ? l() : typeof p == "function" ? p(e) : d(e);
|
|
58
55
|
},
|
|
59
|
-
startIcon:
|
|
60
|
-
endIcon:
|
|
56
|
+
startIcon: f(t, R, P),
|
|
57
|
+
endIcon: f(t, $, x),
|
|
61
58
|
...E,
|
|
62
59
|
children: N
|
|
63
60
|
}
|
|
64
61
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ r(
|
|
66
63
|
H,
|
|
67
64
|
{
|
|
68
|
-
ref:
|
|
65
|
+
ref: n,
|
|
69
66
|
id: z,
|
|
70
67
|
offset: k,
|
|
71
68
|
floatingOptions: { placement: g },
|
|
72
69
|
zIndex: j,
|
|
73
|
-
onClose:
|
|
74
|
-
className: `${
|
|
70
|
+
onClose: l,
|
|
71
|
+
className: `${c["container-popover"]} ${C}`,
|
|
75
72
|
...b,
|
|
76
73
|
children: I
|
|
77
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),x=require("react"),D=require("@internationalized/date"),k=require("react-aria"),B=require("react-stately"),i=require("./style.module.scss.cjs"),M=require("../Button/Button.cjs"),V=require("./CalendarCell.cjs"),w=require("./CalendarButton.cjs"),L=require("./CalendarMonth.cjs"),N=require("./CalendarYear.cjs"),Y=require("../../hooks/useDeepCompareEffect.cjs"),J=e=>{const g=D.getWeeksInMonth(e.state.visibleRange.start,e.locale),{gridProps:n,headerProps:l,weekDays:C}=k.useCalendarGrid({},e.state),{prevButtonProps:h,nextButtonProps:f,title:r}=k.useCalendar(e,e.state),u=c=>{let s="";switch(c){case 0:s="Min";break;case 1:s="Sen";break;case 2:s="Sel";break;case 3:s="Rab";break;case 4:s="Kam";break;case 5:s="Jum";break;case 6:s="Sab";break}return s};return t.jsxs("div",{children:[!e.hiddenHeader&&t.jsxs("div",{className:i.default["header-calendar"],children:[t.jsx(w.default,{...h,children:typeof e?.prevIcon=="function"||x.isValidElement(e?.prevIcon)?x.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():t.jsx(N.ChevronDownIcon,{className:"iru-rotate-90"})}),t.jsx("div",{className:i.default["header-button-calendar"],onClick:()=>e.setActiveTypeCalendar("month"),children:r}),t.jsx(w.default,{...f,children:typeof e?.nextIcon=="function"||x.isValidElement(e?.nextIcon)?x.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():t.jsx(N.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),t.jsxs("table",{...n,children:[t.jsx("thead",{...l,children:t.jsx("tr",{children:C.map((c,s)=>t.jsx("th",{className:i.default["days-calendar"],children:u(s)},s))})}),t.jsx("tbody",{children:[...new Array(g).keys()].map(c=>t.jsx("tr",{children:e.state.getDatesInWeek(c).map((s,j)=>s?t.jsx(V.default,{state:e.state,date:s},j):t.jsx("td",{},j))},c))})]})]})},q=({minDate:e,maxDate:g,value:n,time:l,hiddenHeader:C,handlerChangeTime:h,timeLabel:f,type:r})=>{const u=e?new Date(e):null,c=g?new Date(g):null,s=u?.getHours(),j=c?.getHours(),o=u?.getMinutes(),T=c?.getMinutes(),[E,R]=x.useState(!0),S=(a,m,d)=>Array.from({length:(m-a)/d+1},(y,v)=>a+v*d),I=(a,m)=>{typeof h=="function"&&h({hour:a,minut:m,second:l?.second})},H=()=>{const a=document.getElementById(`calendar-hour-${l?.hour}-${r}`),m=document.getElementById(`calendar-minut-${l?.minut}-${r}`),d=document.getElementById(`wrapper-calendar-hour-${r}`),y=document.getElementById(`wrapper-calendar-minut-${r}`);a&&d&&d.scrollTo({behavior:"instant",top:a.offsetTop-78}),m&&y&&y.scrollTo({behavior:"instant",top:m.offsetTop-78})},b=(a,m)=>{let d=!0;if(u&&n){const y=n.year===u.getFullYear(),v=n.month===u.getMonth()+1;n.day===u.getDate()&&v&&y?(m==="hour"&&a<(s??0)||m==="minut"&&(l?.hour??0)<=u.getHours()&&a<(o??0))&&(d=!1):n.toDate(D.getLocalTimeZone()).getTime()<u.getTime()&&(d=!1)}if(c&&n){const y=n.year===c.getFullYear(),v=n.month===c.getMonth()+1;n.day===c.getDate()&&v&&y?(m==="hour"&&a>(j??0)||m==="minut"&&(l?.hour??0)>=c.getHours()&&a>(T??0))&&(d=!1):n.toDate(D.getLocalTimeZone()).getTime()>c.getTime()&&(d=!1)}return d};return x.useEffect(()=>{E&&H(),l&&R(!1)},[JSON.stringify(n),JSON.stringify(l)]),t.jsxs("div",{className:i.default["custom-time-calendar"],children:[!C&&t.jsx("div",{className:i.default["header-time"],children:f||"Atur Waktu"}),t.jsxs("div",{className:i.default["type-time"],children:[t.jsx("div",{children:"Jam"}),t.jsx("div",{children:"Menit"})]}),t.jsxs("div",{className:"iru-flex iru-justify-around",children:[t.jsx("div",{id:`wrapper-calendar-hour-${r}`,className:i.default["container-cell-time"],children:S(0,23,1).map(a=>t.jsx("div",{id:`calendar-hour-${a}-${r}`,className:`${i.default["cell-time"]} ${l?.hour===a?b(a,"hour")?i.default.selected:i.default.error:""} ${b(a,"hour")&&l?.hour!=a?i.default.valid:i.default.invalid}`,onClick:()=>{b(a,"hour")&&I(a,l?.minut)},children:a<10?`0${a}`:a},a))}),t.jsx("div",{id:`wrapper-calendar-minut-${r}`,className:i.default["container-cell-time"],children:S(0,59,1).map(a=>t.jsx("div",{id:`calendar-minut-${a}-${r}`,className:`${i.default["cell-time"]} ${l?.minut===a?b(a,"minut")?i.default.selected:i.default.error:""} ${b(a,"minut")&&l?.minut!=a?i.default.valid:i.default.invalid}`,onClick:()=>{b(a,"minut")&&I(l?.hour,a)},children:a<10?`0${a}`:a},a))})]})]})},P=e=>{const g=e.typeTime??"SINGLE",n=B.useCalendarState({...e,locale:e.locale,createCalendar:D.createCalendar}),{title:l}=k.useCalendar(e,n),[C,h]=x.useState(e?.activeType??"date"),[f,r]=x.useState({start:void 0,end:void 0}),u=f.start?.hour?.toString()&&f?.start?.minut?.toString()&&e.value?.toDate(D.getLocalTimeZone()).setHours(f.start?.hour,f.start?.minut)||e.minDate,c=e.maxDate,s=(o,T)=>{const E={...f,[T]:o};r(E),typeof e?.handlerChangeTime=="function"&&e.handlerChangeTime(E)},j=o=>{n.setValue(o)};return Y.useDeepCompareEffect(()=>{e?.activeType&&h(e.activeType)},[e?.activeType]),x.useEffect(()=>{if(e.time?.start&&e.time?.end){const o=e.time.start,T=e.time.end;r({start:o,end:T})}},[JSON.stringify(e.time)]),t.jsxs("div",{className:"iru-text-laba-base-sr",children:[C==="date"&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:i.default["container-calendar"],children:[t.jsxs("div",{className:"iru-flex iru-gap-2",children:[t.jsx(J,{state:n,setActiveTypeCalendar:h,...e}),e?.isCustomTime&&t.jsxs("div",{className:"iru-flex",children:[t.jsx(q,{minDate:e.minDate,maxDate:e.maxDate,time:e.time?.start,value:e.value,timeLabel:g==="RANGE"?"Awal":"Atur Waktu",type:"start",handlerChangeTime:o=>s(o,"start")}),g==="RANGE"&&t.jsx(q,{minDate:u,maxDate:c,time:e.time?.end,value:e.value,timeLabel:"Akhir",type:"end",handlerChangeTime:o=>s(o,"end")})]})]}),(e?.withConfirm??e?.isCustomTime)&&t.jsxs("div",{className:`${i.default["footer-calendar"]}`,children:[typeof e?.buttonReset=="function"?t.jsx("div",{onClick:()=>e.handlerReset(n),children:e.buttonReset()}):t.jsx(M.default,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(n),children:"Reset"}),typeof e?.buttonSubmit=="function"?t.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):t.jsx(M.default,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})}),C==="month"&&t.jsx(L.default,{state:n,setActiveTypeCalendar:h,type:e.type,onChangeMonth:j,hiddenHeader:e.hiddenHeader}),C==="year"&&t.jsx(N.default,{state:n,type:e.type,setActiveTypeCalendar:h,title:l,onChangeYear:j,hiddenHeader:e.hiddenHeader})]})};exports.CustomTimeCalendar=q;exports.default=P;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createCalendar as P, getLocalTimeZone as
|
|
4
|
-
import { useCalendar as
|
|
1
|
+
import { jsxs as h, jsx as n, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import $, { useEffect as L, isValidElement as N } from "react";
|
|
3
|
+
import { createCalendar as P, getLocalTimeZone as I, getWeeksInMonth as V } from "@internationalized/date";
|
|
4
|
+
import { useCalendar as q, useCalendarGrid as W } from "react-aria";
|
|
5
5
|
import { useCalendarState as j } from "react-stately";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import i from "./style.module.scss.mjs";
|
|
7
|
+
import M from "../Button/Button.mjs";
|
|
8
8
|
import F from "./CalendarCell.mjs";
|
|
9
|
-
import
|
|
9
|
+
import w from "./CalendarButton.mjs";
|
|
10
10
|
import O from "./CalendarMonth.mjs";
|
|
11
|
-
import z, { ChevronDownIcon as
|
|
11
|
+
import z, { ChevronDownIcon as H } from "./CalendarYear.mjs";
|
|
12
12
|
import { useDeepCompareEffect as _ } from "../../hooks/useDeepCompareEffect.mjs";
|
|
13
13
|
const K = (e) => {
|
|
14
|
-
const
|
|
14
|
+
const y = V(e.state.visibleRange.start, e.locale), { gridProps: a, headerProps: c, weekDays: C } = W({}, e.state), { prevButtonProps: f, nextButtonProps: g, title: d } = q(e, e.state), o = (l) => {
|
|
15
15
|
let r = "";
|
|
16
16
|
switch (l) {
|
|
17
17
|
case 0:
|
|
@@ -38,72 +38,72 @@ const K = (e) => {
|
|
|
38
38
|
}
|
|
39
39
|
return r;
|
|
40
40
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
!e.hiddenHeader && /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ h("div", { children: [
|
|
42
|
+
!e.hiddenHeader && /* @__PURE__ */ h("div", { className: i["header-calendar"], children: [
|
|
43
|
+
/* @__PURE__ */ n(w, { ...f, children: typeof e?.prevIcon == "function" || N(e?.prevIcon) ? N(e.prevIcon) ? e.prevIcon : e.prevIcon() : /* @__PURE__ */ n(H, { className: "iru-rotate-90" }) }),
|
|
44
|
+
/* @__PURE__ */ n("div", { className: i["header-button-calendar"], onClick: () => e.setActiveTypeCalendar("month"), children: d }),
|
|
45
|
+
/* @__PURE__ */ n(w, { ...g, children: typeof e?.nextIcon == "function" || N(e?.nextIcon) ? N(e.nextIcon) ? e.nextIcon : e.nextIcon() : /* @__PURE__ */ n(H, { className: "-iru-rotate-90" }) })
|
|
46
46
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ h("table", { ...a, children: [
|
|
48
|
+
/* @__PURE__ */ n("thead", { ...c, children: /* @__PURE__ */ n("tr", { children: C.map((l, r) => /* @__PURE__ */ n("th", { className: i["days-calendar"], children: o(r) }, r)) }) }),
|
|
49
|
+
/* @__PURE__ */ n("tbody", { children: [...new Array(y).keys()].map((l) => /* @__PURE__ */ n("tr", { children: e.state.getDatesInWeek(l).map((r, b) => r ? /* @__PURE__ */ n(F, { state: e.state, date: r }, b) : /* @__PURE__ */ n("td", {}, b)) }, l)) })
|
|
50
50
|
] })
|
|
51
51
|
] });
|
|
52
|
-
},
|
|
52
|
+
}, R = ({
|
|
53
53
|
minDate: e,
|
|
54
|
-
maxDate:
|
|
55
|
-
value:
|
|
56
|
-
time:
|
|
57
|
-
hiddenHeader:
|
|
58
|
-
handlerChangeTime:
|
|
59
|
-
timeLabel:
|
|
60
|
-
type:
|
|
54
|
+
maxDate: y,
|
|
55
|
+
value: a,
|
|
56
|
+
time: c,
|
|
57
|
+
hiddenHeader: C,
|
|
58
|
+
handlerChangeTime: f,
|
|
59
|
+
timeLabel: g,
|
|
60
|
+
type: d
|
|
61
61
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
typeof
|
|
64
|
-
},
|
|
65
|
-
const t = document.getElementById(`calendar-hour-${
|
|
66
|
-
t &&
|
|
67
|
-
},
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
|
|
62
|
+
const o = e ? new Date(e) : null, l = y ? new Date(y) : null, r = o?.getHours(), b = l?.getHours(), m = o?.getMinutes(), D = l?.getMinutes(), [E, A] = $.useState(!0), S = (t, u, s) => Array.from({ length: (u - t) / s + 1 }, (v, k) => t + k * s), x = (t, u) => {
|
|
63
|
+
typeof f == "function" && f({ hour: t, minut: u, second: c?.second });
|
|
64
|
+
}, B = () => {
|
|
65
|
+
const t = document.getElementById(`calendar-hour-${c?.hour}-${d}`), u = document.getElementById(`calendar-minut-${c?.minut}-${d}`), s = document.getElementById(`wrapper-calendar-hour-${d}`), v = document.getElementById(`wrapper-calendar-minut-${d}`);
|
|
66
|
+
t && s && s.scrollTo({ behavior: "instant", top: t.offsetTop - 78 }), u && v && v.scrollTo({ behavior: "instant", top: u.offsetTop - 78 });
|
|
67
|
+
}, T = (t, u) => {
|
|
68
|
+
let s = !0;
|
|
69
|
+
if (o && a) {
|
|
70
|
+
const v = a.year === o.getFullYear(), k = a.month === o.getMonth() + 1;
|
|
71
|
+
a.day === o.getDate() && k && v ? (u === "hour" && t < (r ?? 0) || u === "minut" && (c?.hour ?? 0) <= o.getHours() && t < (m ?? 0)) && (s = !1) : a.toDate(I()).getTime() < o.getTime() && (s = !1);
|
|
72
72
|
}
|
|
73
|
-
if (l &&
|
|
74
|
-
const
|
|
75
|
-
|
|
73
|
+
if (l && a) {
|
|
74
|
+
const v = a.year === l.getFullYear(), k = a.month === l.getMonth() + 1;
|
|
75
|
+
a.day === l.getDate() && k && v ? (u === "hour" && t > (b ?? 0) || u === "minut" && (c?.hour ?? 0) >= l.getHours() && t > (D ?? 0)) && (s = !1) : a.toDate(I()).getTime() > l.getTime() && (s = !1);
|
|
76
76
|
}
|
|
77
|
-
return
|
|
77
|
+
return s;
|
|
78
78
|
};
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
}, [JSON.stringify(
|
|
82
|
-
!
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
79
|
+
return $.useEffect(() => {
|
|
80
|
+
E && B(), c && A(!1);
|
|
81
|
+
}, [JSON.stringify(a), JSON.stringify(c)]), /* @__PURE__ */ h("div", { className: i["custom-time-calendar"], children: [
|
|
82
|
+
!C && /* @__PURE__ */ n("div", { className: i["header-time"], children: g || "Atur Waktu" }),
|
|
83
|
+
/* @__PURE__ */ h("div", { className: i["type-time"], children: [
|
|
84
|
+
/* @__PURE__ */ n("div", { children: "Jam" }),
|
|
85
|
+
/* @__PURE__ */ n("div", { children: "Menit" })
|
|
86
86
|
] }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ h("div", { className: "iru-flex iru-justify-around", children: [
|
|
88
|
+
/* @__PURE__ */ n("div", { id: `wrapper-calendar-hour-${d}`, className: i["container-cell-time"], children: S(0, 23, 1).map((t) => /* @__PURE__ */ n(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
|
-
id: `calendar-hour-${t}-${
|
|
92
|
-
className: `${
|
|
91
|
+
id: `calendar-hour-${t}-${d}`,
|
|
92
|
+
className: `${i["cell-time"]} ${c?.hour === t ? T(t, "hour") ? i.selected : i.error : ""} ${T(t, "hour") && c?.hour != t ? i.valid : i.invalid}`,
|
|
93
93
|
onClick: () => {
|
|
94
|
-
|
|
94
|
+
T(t, "hour") && x(t, c?.minut);
|
|
95
95
|
},
|
|
96
96
|
children: t < 10 ? `0${t}` : t
|
|
97
97
|
},
|
|
98
98
|
t
|
|
99
99
|
)) }),
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ n("div", { id: `wrapper-calendar-minut-${d}`, className: i["container-cell-time"], children: S(0, 59, 1).map((t) => /* @__PURE__ */ n(
|
|
101
101
|
"div",
|
|
102
102
|
{
|
|
103
|
-
id: `calendar-minut-${t}-${
|
|
104
|
-
className: `${
|
|
103
|
+
id: `calendar-minut-${t}-${d}`,
|
|
104
|
+
className: `${i["cell-time"]} ${c?.minut === t ? T(t, "minut") ? i.selected : i.error : ""} ${T(t, "minut") && c?.minut != t ? i.valid : i.invalid}`,
|
|
105
105
|
onClick: () => {
|
|
106
|
-
|
|
106
|
+
T(t, "minut") && x(c?.hour, t);
|
|
107
107
|
},
|
|
108
108
|
children: t < 10 ? `0${t}` : t
|
|
109
109
|
},
|
|
@@ -111,89 +111,87 @@ const K = (e) => {
|
|
|
111
111
|
)) })
|
|
112
112
|
] })
|
|
113
113
|
] });
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
const C = e.typeTime ?? "SINGLE", i = j({
|
|
114
|
+
}, le = (e) => {
|
|
115
|
+
const y = e.typeTime ?? "SINGLE", a = j({
|
|
117
116
|
...e,
|
|
118
117
|
locale: e.locale,
|
|
119
118
|
createCalendar: P
|
|
120
|
-
}), { title:
|
|
121
|
-
const
|
|
122
|
-
...
|
|
123
|
-
[
|
|
119
|
+
}), { title: c } = q(e, a), [C, f] = $.useState(e?.activeType ?? "date"), [g, d] = $.useState({ start: void 0, end: void 0 }), o = g.start?.hour?.toString() && g?.start?.minut?.toString() && e.value?.toDate(I()).setHours(g.start?.hour, g.start?.minut) || e.minDate, l = e.maxDate, r = (m, D) => {
|
|
120
|
+
const E = {
|
|
121
|
+
...g,
|
|
122
|
+
[D]: m
|
|
124
123
|
};
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
124
|
+
d(E), typeof e?.handlerChangeTime == "function" && e.handlerChangeTime(E);
|
|
125
|
+
}, b = (m) => {
|
|
126
|
+
a.setValue(m);
|
|
128
127
|
};
|
|
129
128
|
return _(() => {
|
|
130
|
-
e
|
|
131
|
-
}, [e
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
s({ start: o, end: T });
|
|
129
|
+
e?.activeType && f(e.activeType);
|
|
130
|
+
}, [e?.activeType]), L(() => {
|
|
131
|
+
if (e.time?.start && e.time?.end) {
|
|
132
|
+
const m = e.time.start, D = e.time.end;
|
|
133
|
+
d({ start: m, end: D });
|
|
136
134
|
}
|
|
137
|
-
}, [JSON.stringify(e.time)]), /* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
135
|
+
}, [JSON.stringify(e.time)]), /* @__PURE__ */ h("div", { className: "iru-text-laba-base-sr", children: [
|
|
136
|
+
C === "date" && /* @__PURE__ */ n(G, { children: /* @__PURE__ */ h("div", { className: i["container-calendar"], children: [
|
|
137
|
+
/* @__PURE__ */ h("div", { className: "iru-flex iru-gap-2", children: [
|
|
138
|
+
/* @__PURE__ */ n(K, { state: a, setActiveTypeCalendar: f, ...e }),
|
|
139
|
+
e?.isCustomTime && /* @__PURE__ */ h("div", { className: "iru-flex", children: [
|
|
140
|
+
/* @__PURE__ */ n(
|
|
141
|
+
R,
|
|
144
142
|
{
|
|
145
143
|
minDate: e.minDate,
|
|
146
144
|
maxDate: e.maxDate,
|
|
147
|
-
time:
|
|
145
|
+
time: e.time?.start,
|
|
148
146
|
value: e.value,
|
|
149
|
-
timeLabel:
|
|
147
|
+
timeLabel: y === "RANGE" ? "Awal" : "Atur Waktu",
|
|
150
148
|
type: "start",
|
|
151
|
-
handlerChangeTime: (
|
|
149
|
+
handlerChangeTime: (m) => r(m, "start")
|
|
152
150
|
}
|
|
153
151
|
),
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
y === "RANGE" && /* @__PURE__ */ n(
|
|
153
|
+
R,
|
|
156
154
|
{
|
|
157
|
-
minDate:
|
|
155
|
+
minDate: o,
|
|
158
156
|
maxDate: l,
|
|
159
|
-
time:
|
|
157
|
+
time: e.time?.end,
|
|
160
158
|
value: e.value,
|
|
161
159
|
timeLabel: "Akhir",
|
|
162
160
|
type: "end",
|
|
163
|
-
handlerChangeTime: (
|
|
161
|
+
handlerChangeTime: (m) => r(m, "end")
|
|
164
162
|
}
|
|
165
163
|
)
|
|
166
164
|
] })
|
|
167
165
|
] }),
|
|
168
|
-
(
|
|
169
|
-
typeof
|
|
170
|
-
typeof
|
|
166
|
+
(e?.withConfirm ?? e?.isCustomTime) && /* @__PURE__ */ h("div", { className: `${i["footer-calendar"]}`, children: [
|
|
167
|
+
typeof e?.buttonReset == "function" ? /* @__PURE__ */ n("div", { onClick: () => e.handlerReset(a), children: e.buttonReset() }) : /* @__PURE__ */ n(M, { variants: "nude-laba-blue-10", size: "small", onClick: () => e.handlerReset(a), children: "Reset" }),
|
|
168
|
+
typeof e?.buttonSubmit == "function" ? /* @__PURE__ */ n("div", { onClick: e.handlerSubmit, children: e.buttonSubmit() }) : /* @__PURE__ */ n(M, { size: "small", onClick: e.handlerSubmit, children: "Terapkan" })
|
|
171
169
|
] })
|
|
172
170
|
] }) }),
|
|
173
|
-
|
|
171
|
+
C === "month" && /* @__PURE__ */ n(
|
|
174
172
|
O,
|
|
175
173
|
{
|
|
176
|
-
state:
|
|
177
|
-
setActiveTypeCalendar:
|
|
174
|
+
state: a,
|
|
175
|
+
setActiveTypeCalendar: f,
|
|
178
176
|
type: e.type,
|
|
179
|
-
onChangeMonth:
|
|
177
|
+
onChangeMonth: b,
|
|
180
178
|
hiddenHeader: e.hiddenHeader
|
|
181
179
|
}
|
|
182
180
|
),
|
|
183
|
-
|
|
181
|
+
C === "year" && /* @__PURE__ */ n(
|
|
184
182
|
z,
|
|
185
183
|
{
|
|
186
|
-
state:
|
|
184
|
+
state: a,
|
|
187
185
|
type: e.type,
|
|
188
|
-
setActiveTypeCalendar:
|
|
189
|
-
title:
|
|
190
|
-
onChangeYear:
|
|
186
|
+
setActiveTypeCalendar: f,
|
|
187
|
+
title: c,
|
|
188
|
+
onChangeYear: b,
|
|
191
189
|
hiddenHeader: e.hiddenHeader
|
|
192
190
|
}
|
|
193
191
|
)
|
|
194
192
|
] });
|
|
195
193
|
};
|
|
196
194
|
export {
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
R as CustomTimeCalendar,
|
|
196
|
+
le as default
|
|
199
197
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),$=require("react-aria"),n=require("./style.module.scss.cjs"),h=require("./CalendarButton.cjs"),i=require("react"),y=require("./CalendarYear.cjs"),q=({prevIcon:l,nextIcon:s,state:e,setActiveTypeCalendar:c,onChangeMonth:m,type:t,hiddenHeader:D})=>{const V=new Date().getFullYear(),x=e.focusedDate.calendar.getMonthsInYear(e.focusedDate),j=$.useDateFormatter({month:"short",timeZone:e.timeZone}),b=(o,a)=>{const d=e.focusedDate.set({month:o});a?(c("date"),e.setFocusedDate(d)):!a&&typeof m=="function"&&m(d)},f=o=>{const a=e.focusedDate.set({year:o});e.setFocusedDate(a)};return r.jsxs("div",{className:`iru-w-[296px] ${n.default["container-calendar"]}`,children:[!D&&r.jsxs("div",{className:n.default["header-calendar"],children:[r.jsx(h.default,{isDisabled:e?.minValue?e.focusedDate.year<=e.minValue.year:!1,onPress:()=>f(e.focusedDate.year-1),children:typeof l=="function"||i.isValidElement(l)?i.isValidElement(l)?l:l():r.jsx(y.ChevronDownIcon,{className:"iru-rotate-90"})}),r.jsx("div",{className:`${n.default["header-button-calendar"]} ${t.includes("year")?"":n.default.disabled}`,onClick:()=>{t.includes("year")&&c("year")},children:e.focusedDate.year}),r.jsx(h.default,{isDisabled:e?.maxValue?e.focusedDate.year>=e.maxValue.year:!1,onPress:()=>f(e.focusedDate.year+1),children:typeof s=="function"||i.isValidElement(s)?i.isValidElement(s)?s:s():r.jsx(y.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),r.jsx("div",{className:n.default["month-calendar"],children:[...Array(x).keys()].map(o=>{const a=e.focusedDate.set({month:o+1}),d=j.format(a.toDate(e.timeZone)),g=e.value?.year||e.value?.start?.year||V,C=e?.minValue?a.month<e?.minValue?.month&&a.year<=e.minValue.year:!1,N=e?.maxValue?a.month>e.maxValue.month&&a.year>=e.maxValue.year:!1,u=C||N;return r.jsx("div",{onClick:()=>{u||b(a.month,t.includes("date"))},className:`${n.default["cell-month"]} ${e.focusedDate.month===a.month&&!u&&a.year===g?n.default.selected:""} ${e.focusedDate.month!==a.month&&!u?"hover:iru-bg-laba-blue-01":""} ${u?"iru-text-gray-400":"iru-cursor-pointer"}`,children:d},o)})})]})};exports.default=q;
|