@esic-lab/data-core-ui 0.0.29 → 0.0.31
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/{STO-logo-ADYYAPS3.svg → STO-logo-KFQUNTJ3.svg} +92 -92
- package/dist/assets/STO-logo.svg +92 -92
- package/dist/index.css +72 -7
- package/dist/index.d.mts +158 -514
- package/dist/index.d.ts +158 -514
- package/dist/index.js +917 -528
- package/dist/index.mjs +906 -523
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -330,6 +330,28 @@ var require_th = __commonJS({
|
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
332
|
|
|
333
|
+
// node_modules/dayjs/plugin/buddhistEra.js
|
|
334
|
+
var require_buddhistEra = __commonJS({
|
|
335
|
+
"node_modules/dayjs/plugin/buddhistEra.js"(exports2, module2) {
|
|
336
|
+
"use strict";
|
|
337
|
+
!(function(t, e) {
|
|
338
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_buddhistEra = e();
|
|
339
|
+
})(exports2, (function() {
|
|
340
|
+
"use strict";
|
|
341
|
+
return function(t, e) {
|
|
342
|
+
var n = e.prototype, i = n.format;
|
|
343
|
+
n.format = function(t2) {
|
|
344
|
+
var e2 = this, n2 = (t2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g, (function(t3, n3) {
|
|
345
|
+
var i2, o = String(e2.$y + 543), f = "BB" === t3 ? [o.slice(-2), 2] : [o, 4];
|
|
346
|
+
return n3 || (i2 = e2.$utils()).s.apply(i2, f.concat(["0"]));
|
|
347
|
+
}));
|
|
348
|
+
return i.bind(this)(n2);
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
|
|
333
355
|
// node_modules/dayjs/plugin/customParseFormat.js
|
|
334
356
|
var require_customParseFormat = __commonJS({
|
|
335
357
|
"node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) {
|
|
@@ -461,6 +483,7 @@ var require_customParseFormat = __commonJS({
|
|
|
461
483
|
// src/index.ts
|
|
462
484
|
var index_exports = {};
|
|
463
485
|
__export(index_exports, {
|
|
486
|
+
AntDModal: () => AntDModal,
|
|
464
487
|
AntDataTable: () => AntDataTable,
|
|
465
488
|
Breadcrumbs: () => Breadcrumbs,
|
|
466
489
|
Calendar: () => Calendar,
|
|
@@ -472,9 +495,12 @@ __export(index_exports, {
|
|
|
472
495
|
DatePickerBasic: () => DatePickerBasic,
|
|
473
496
|
DatePickerRangePicker: () => DatePickerRangePicker,
|
|
474
497
|
FileUploader: () => FileUploader,
|
|
498
|
+
FilterPopUp: () => FilterPopUp,
|
|
475
499
|
GhostButton: () => GhostButton,
|
|
476
500
|
HeadingPage: () => HeadingPage,
|
|
501
|
+
Indicator: () => Indicator,
|
|
477
502
|
InputField: () => InputField,
|
|
503
|
+
InputFieldNumber: () => InputFieldNumber,
|
|
478
504
|
KpiSection: () => KpiSection,
|
|
479
505
|
Loader: () => Loader,
|
|
480
506
|
MenuNavBar: () => MenuNavBar,
|
|
@@ -492,6 +518,8 @@ __export(index_exports, {
|
|
|
492
518
|
Sidebar: () => Sidebar,
|
|
493
519
|
SortFilter: () => SortFilter,
|
|
494
520
|
Switch: () => Switch,
|
|
521
|
+
SwitchSelect: () => SwitchSelect,
|
|
522
|
+
TabSelectionButton: () => TabSelectionButton,
|
|
495
523
|
TextAreaInput: () => TextAreaInput,
|
|
496
524
|
TextInput: () => TextInput,
|
|
497
525
|
TimePickerBasic: () => TimePickerBasic,
|
|
@@ -571,10 +599,26 @@ function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
|
571
599
|
);
|
|
572
600
|
}
|
|
573
601
|
|
|
574
|
-
// src/
|
|
602
|
+
// src/Button/TabSelectionButton/TabSelectionButton.tsx
|
|
575
603
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
604
|
+
var TabSelectionButton = ({ title, now, onClickGoto }) => {
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex subtitle-2", children: [
|
|
606
|
+
title.map((text) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
607
|
+
"button",
|
|
608
|
+
{
|
|
609
|
+
onClick: () => onClickGoto(text.path),
|
|
610
|
+
className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-700 text-primary-700 border-b-2" : "border-b-gray-200 border-b-2"}`,
|
|
611
|
+
children: text.name
|
|
612
|
+
}
|
|
613
|
+
)),
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-b-gray-200 border-b-2 w-full" })
|
|
615
|
+
] });
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/Loader/Loader/Loader.tsx
|
|
619
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
576
620
|
function Loader({ size = 25, color = "#000000" }) {
|
|
577
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
578
622
|
"div",
|
|
579
623
|
{
|
|
580
624
|
style: {
|
|
@@ -592,14 +636,14 @@ function Loader({ size = 25, color = "#000000" }) {
|
|
|
592
636
|
|
|
593
637
|
// src/Checkbox/Checkbox/Checkbox.tsx
|
|
594
638
|
var import_icons_react = require("@tabler/icons-react");
|
|
595
|
-
var
|
|
639
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
596
640
|
function Checkbox({ label, checked, onChange, disabled }) {
|
|
597
641
|
const handleClick = () => {
|
|
598
642
|
if (!disabled) {
|
|
599
643
|
onChange(!checked);
|
|
600
644
|
}
|
|
601
645
|
};
|
|
602
|
-
return /* @__PURE__ */ (0,
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
603
647
|
"div",
|
|
604
648
|
{
|
|
605
649
|
className: `flex gap-[10px] items-center
|
|
@@ -607,32 +651,32 @@ function Checkbox({ label, checked, onChange, disabled }) {
|
|
|
607
651
|
"aria-disabled": disabled,
|
|
608
652
|
onClick: handleClick,
|
|
609
653
|
children: [
|
|
610
|
-
/* @__PURE__ */ (0,
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
611
655
|
"div",
|
|
612
656
|
{
|
|
613
657
|
className: `flex justify-center items-center border-[1px] border-black w-[24px] h-[24px] rounded-[8px] transition-colors duration-100
|
|
614
658
|
${checked ? "bg-black text-white" : "bg-white text-black"}
|
|
615
659
|
${disabled ? "pointer-events-none" : ""}`,
|
|
616
|
-
children: /* @__PURE__ */ (0,
|
|
660
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
617
661
|
"span",
|
|
618
662
|
{
|
|
619
663
|
className: `flex justify-center items-center transition-transform duration-150
|
|
620
664
|
${checked ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
621
|
-
children: /* @__PURE__ */ (0,
|
|
665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons_react.IconCheck, { size: 20 })
|
|
622
666
|
}
|
|
623
667
|
)
|
|
624
668
|
}
|
|
625
669
|
),
|
|
626
|
-
label && /* @__PURE__ */ (0,
|
|
670
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "body-1 select-none", children: label })
|
|
627
671
|
]
|
|
628
672
|
}
|
|
629
673
|
);
|
|
630
674
|
}
|
|
631
675
|
|
|
632
676
|
// src/Checkbox/CheckboxGroup/CheckboxGroup.tsx
|
|
633
|
-
var
|
|
677
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
634
678
|
function CheckboxGroup({ options, onChange, alignment = "vertical" }) {
|
|
635
|
-
return /* @__PURE__ */ (0,
|
|
679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `flex gap-4 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
636
680
|
Checkbox,
|
|
637
681
|
{
|
|
638
682
|
checked: opt.checked,
|
|
@@ -645,14 +689,14 @@ function CheckboxGroup({ options, onChange, alignment = "vertical" }) {
|
|
|
645
689
|
}
|
|
646
690
|
|
|
647
691
|
// src/Radio/Radio/Radio.tsx
|
|
648
|
-
var
|
|
692
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
649
693
|
function Radio({ selected, onChange, disabled }) {
|
|
650
694
|
const handleClick = () => {
|
|
651
695
|
if (!disabled) {
|
|
652
696
|
onChange(!selected);
|
|
653
697
|
}
|
|
654
698
|
};
|
|
655
|
-
return /* @__PURE__ */ (0,
|
|
699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
656
700
|
"div",
|
|
657
701
|
{
|
|
658
702
|
className: `
|
|
@@ -661,31 +705,31 @@ function Radio({ selected, onChange, disabled }) {
|
|
|
661
705
|
`,
|
|
662
706
|
onClick: handleClick,
|
|
663
707
|
"aria-disabled": disabled,
|
|
664
|
-
children: selected && /* @__PURE__ */ (0,
|
|
708
|
+
children: selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `bg-black w-[10px] h-[10px] rounded-full transition-all duration-300` })
|
|
665
709
|
}
|
|
666
710
|
);
|
|
667
711
|
}
|
|
668
712
|
|
|
669
713
|
// src/Radio/RadioGroup/RadioGroup.tsx
|
|
670
|
-
var
|
|
714
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
671
715
|
function RadioGroup({ options, value, onChange, alignment = "horizontal" }) {
|
|
672
|
-
return /* @__PURE__ */ (0,
|
|
673
|
-
/* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex gap-2 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Radio, { selected: value === opt.value, onChange: () => onChange(opt.value), disabled: opt.disabled }),
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `body-1 ${opt.disabled ? "text-gray-400 cursor-not-allowed" : ""}`, children: opt.label })
|
|
675
719
|
] }, opt.value)) });
|
|
676
720
|
}
|
|
677
721
|
|
|
678
722
|
// src/Switch/Switch/Switch.tsx
|
|
679
|
-
var
|
|
723
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
680
724
|
function Switch({ label, checked, onChange, disabled }) {
|
|
681
725
|
const handleClick = () => {
|
|
682
726
|
if (!disabled) {
|
|
683
727
|
onChange(!checked);
|
|
684
728
|
}
|
|
685
729
|
};
|
|
686
|
-
return /* @__PURE__ */ (0,
|
|
687
|
-
label && /* @__PURE__ */ (0,
|
|
688
|
-
/* @__PURE__ */ (0,
|
|
730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-[10px]", children: [
|
|
731
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: `body-1 ${disabled ? "opacity-50 select-none" : ""}`, children: label }),
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
689
733
|
"button",
|
|
690
734
|
{
|
|
691
735
|
type: "button",
|
|
@@ -697,7 +741,7 @@ function Switch({ label, checked, onChange, disabled }) {
|
|
|
697
741
|
${checked ? "bg-blue-500" : "bg-gray-300"}
|
|
698
742
|
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
699
743
|
`,
|
|
700
|
-
children: /* @__PURE__ */ (0,
|
|
744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
701
745
|
"div",
|
|
702
746
|
{
|
|
703
747
|
className: `bg-white w-5 h-5 rounded-full shadow-md transform transition-transform duration-300
|
|
@@ -709,23 +753,55 @@ function Switch({ label, checked, onChange, disabled }) {
|
|
|
709
753
|
] });
|
|
710
754
|
}
|
|
711
755
|
|
|
756
|
+
// src/Switch/SwitchSelect/SwitchSelect.tsx
|
|
757
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
758
|
+
function SwitchSelect({
|
|
759
|
+
option,
|
|
760
|
+
onClick,
|
|
761
|
+
value,
|
|
762
|
+
label,
|
|
763
|
+
required,
|
|
764
|
+
color
|
|
765
|
+
}) {
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col container-input", children: [
|
|
767
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: `body-1`, children: [
|
|
768
|
+
label,
|
|
769
|
+
" ",
|
|
770
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-red-500", children: "*" })
|
|
771
|
+
] }),
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex", children: option.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
onClick: () => onClick(item.value),
|
|
776
|
+
className: `
|
|
777
|
+
body-1 border-y-1 border-primary-500 cursor-pointer h-[32px] px-2
|
|
778
|
+
${item.value === value ? `${color ? `bg-[${color}]` : `bg-primary-500`} text-white` : "bg-white text-primary-500"}
|
|
779
|
+
${index === 0 ? "border-l-1 rounded-l-lg" : index === option.length - 1 ? "border-r-1 rounded-r-lg" : "border-x-1"}
|
|
780
|
+
`,
|
|
781
|
+
children: item.label
|
|
782
|
+
},
|
|
783
|
+
item.value
|
|
784
|
+
)) })
|
|
785
|
+
] });
|
|
786
|
+
}
|
|
787
|
+
|
|
712
788
|
// src/NavBar/MenuNavBar/MenuNavBar.tsx
|
|
713
|
-
var
|
|
789
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
714
790
|
function MenuNavBar({ menus, onClick }) {
|
|
715
|
-
return /* @__PURE__ */ (0,
|
|
716
|
-
/* @__PURE__ */ (0,
|
|
717
|
-
menu?.subMenus.map((subMenu) => /* @__PURE__ */ (0,
|
|
791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`, children: [
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
|
|
793
|
+
menu?.subMenus.map((subMenu) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
718
794
|
"div",
|
|
719
795
|
{
|
|
720
796
|
className: "group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer hover:bg-red-100 active:bg-primary-500 hover:text-white active:text-white",
|
|
721
797
|
onClick: () => onClick(subMenu.path),
|
|
722
798
|
children: [
|
|
723
|
-
/* @__PURE__ */ (0,
|
|
724
|
-
subMenu.icon && /* @__PURE__ */ (0,
|
|
725
|
-
subMenu.iconActive && /* @__PURE__ */ (0,
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: [
|
|
800
|
+
subMenu.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `block ${subMenu.iconActive ? "group-active:hidden" : ""}`, children: subMenu.icon }),
|
|
801
|
+
subMenu.iconActive && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "hidden group-active:block", children: subMenu.iconActive })
|
|
726
802
|
] }),
|
|
727
803
|
subMenu.title,
|
|
728
|
-
/* @__PURE__ */ (0,
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
|
|
729
805
|
]
|
|
730
806
|
},
|
|
731
807
|
`sub_${subMenu.title}`
|
|
@@ -736,39 +812,39 @@ function MenuNavBar({ menus, onClick }) {
|
|
|
736
812
|
// src/NavBar/MenuNavBar/Sidebar.tsx
|
|
737
813
|
var import_icons_react2 = require("@tabler/icons-react");
|
|
738
814
|
var import_react = require("react");
|
|
739
|
-
var
|
|
815
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
740
816
|
var SidebarContext = (0, import_react.createContext)({ expanded: false });
|
|
741
817
|
function Sidebar({ children, logo }) {
|
|
742
818
|
const [expanded, setExpanded] = (0, import_react.useState)(true);
|
|
743
|
-
return /* @__PURE__ */ (0,
|
|
744
|
-
/* @__PURE__ */ (0,
|
|
745
|
-
expanded && logo && /* @__PURE__ */ (0,
|
|
746
|
-
/* @__PURE__ */ (0,
|
|
819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("aside", { className: "h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
|
|
821
|
+
expanded && logo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { src: logo, width: 120, className: "ml-auto" }),
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
747
823
|
"button",
|
|
748
824
|
{
|
|
749
825
|
className: "p-1.5 rounded-lg bg-gray-50 hover:bg-gray-100 cursor-pointer ml-auto",
|
|
750
826
|
onClick: () => setExpanded((curr) => !curr),
|
|
751
|
-
children: expanded ? /* @__PURE__ */ (0,
|
|
827
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react2.IconChevronLeftPipe, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react2.IconChevronRightPipe, {})
|
|
752
828
|
}
|
|
753
829
|
)
|
|
754
830
|
] }),
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex-1 px-3", children }) })
|
|
756
832
|
] }) });
|
|
757
833
|
}
|
|
758
834
|
|
|
759
835
|
// src/NavBar/TopNavBar/TopNavBar.tsx
|
|
760
836
|
var import_icons_react3 = require("@tabler/icons-react");
|
|
761
|
-
var
|
|
837
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
762
838
|
function TopNavBar({ onClickNoti, logo }) {
|
|
763
|
-
return /* @__PURE__ */ (0,
|
|
764
|
-
/* @__PURE__ */ (0,
|
|
839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-full h-full flex", children: [
|
|
840
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-[20px] p-[10px]", children: [
|
|
765
841
|
logo,
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "subtitle-1", children: "Project Management" })
|
|
767
843
|
] }),
|
|
768
|
-
/* @__PURE__ */ (0,
|
|
769
|
-
/* @__PURE__ */ (0,
|
|
770
|
-
/* @__PURE__ */ (0,
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center ml-auto gap-[20px] p-[10px]", children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "Search" }),
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react3.IconBellRinging, { onClick: onClickNoti, className: "cursor-pointer" }) }),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w-[40px] h-[40px] bg-gray-400 rounded-full cursor-pointer" })
|
|
772
848
|
] })
|
|
773
849
|
] });
|
|
774
850
|
}
|
|
@@ -780,7 +856,7 @@ var import_react3 = require("react");
|
|
|
780
856
|
// src/Table/Pagination/Pagination.tsx
|
|
781
857
|
var import_icons_react4 = require("@tabler/icons-react");
|
|
782
858
|
var import_react2 = require("react");
|
|
783
|
-
var
|
|
859
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
784
860
|
function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
785
861
|
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
786
862
|
const getPages = (0, import_react2.useMemo)(() => {
|
|
@@ -804,21 +880,21 @@ function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
|
804
880
|
return pages;
|
|
805
881
|
}, [totalPages, currentPage]);
|
|
806
882
|
if (totalPages <= 1) return null;
|
|
807
|
-
return /* @__PURE__ */ (0,
|
|
808
|
-
/* @__PURE__ */ (0,
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-center gap-2 mt-4 body-1", children: [
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
809
885
|
"button",
|
|
810
886
|
{
|
|
811
887
|
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
812
888
|
disabled: currentPage === 1,
|
|
813
889
|
onClick: () => onPageChange(currentPage - 1),
|
|
814
890
|
children: [
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react4.IconArrowLeft, {}),
|
|
816
892
|
"\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A"
|
|
817
893
|
]
|
|
818
894
|
}
|
|
819
895
|
),
|
|
820
896
|
getPages.map(
|
|
821
|
-
(page, i) => typeof page === "string" ? /* @__PURE__ */ (0,
|
|
897
|
+
(page, i) => typeof page === "string" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "px-2", children: page }, i) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
822
898
|
"button",
|
|
823
899
|
{
|
|
824
900
|
className: `w-[32px] h-[32px] rounded-[8px] px-3 py-1 cursor-pointer
|
|
@@ -829,7 +905,7 @@ function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
|
829
905
|
i
|
|
830
906
|
)
|
|
831
907
|
),
|
|
832
|
-
/* @__PURE__ */ (0,
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
833
909
|
"button",
|
|
834
910
|
{
|
|
835
911
|
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
@@ -837,7 +913,7 @@ function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
|
837
913
|
onClick: () => onPageChange(currentPage + 1),
|
|
838
914
|
children: [
|
|
839
915
|
"\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
840
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react4.IconArrowRight, {})
|
|
841
917
|
]
|
|
842
918
|
}
|
|
843
919
|
)
|
|
@@ -845,7 +921,7 @@ function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
|
845
921
|
}
|
|
846
922
|
|
|
847
923
|
// src/Table/DataTable/DataTable.tsx
|
|
848
|
-
var
|
|
924
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
849
925
|
function DataTable({ columns, data, onSort, isLoading }) {
|
|
850
926
|
const cols = Math.max(1, columns.length);
|
|
851
927
|
const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
|
|
@@ -857,14 +933,14 @@ function DataTable({ columns, data, onSort, isLoading }) {
|
|
|
857
933
|
onSort();
|
|
858
934
|
}
|
|
859
935
|
};
|
|
860
|
-
return /* @__PURE__ */ (0,
|
|
861
|
-
/* @__PURE__ */ (0,
|
|
936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border rounded-md w-full h-full", children: [
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${gridClass} font-semibold border-b border-gray-200`, style: { ["--cols"]: cols }, children: columns.map((col, i) => {
|
|
862
938
|
const isActive = sortConfig?.key === col.accessor;
|
|
863
939
|
const direction = isActive ? sortConfig?.direction : null;
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-[8px] py-[8px] px-[16px] body-4 truncate", children: [
|
|
865
941
|
col.header,
|
|
866
|
-
col.sortable && /* @__PURE__ */ (0,
|
|
867
|
-
direction === null && /* @__PURE__ */ (0,
|
|
942
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
943
|
+
direction === null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
868
944
|
import_icons_react5.IconSelector,
|
|
869
945
|
{
|
|
870
946
|
size: 15,
|
|
@@ -872,7 +948,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
|
|
|
872
948
|
onClick: () => onSorting({ key: col.accessor, direction: "asc" })
|
|
873
949
|
}
|
|
874
950
|
),
|
|
875
|
-
direction === "asc" && /* @__PURE__ */ (0,
|
|
951
|
+
direction === "asc" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
876
952
|
import_icons_react5.IconSortAscending,
|
|
877
953
|
{
|
|
878
954
|
size: 15,
|
|
@@ -880,7 +956,7 @@ function DataTable({ columns, data, onSort, isLoading }) {
|
|
|
880
956
|
onClick: () => onSorting({ key: col.accessor, direction: "desc" })
|
|
881
957
|
}
|
|
882
958
|
),
|
|
883
|
-
direction === "desc" && /* @__PURE__ */ (0,
|
|
959
|
+
direction === "desc" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
884
960
|
import_icons_react5.IconSortDescending,
|
|
885
961
|
{
|
|
886
962
|
size: 15,
|
|
@@ -891,29 +967,32 @@ function DataTable({ columns, data, onSort, isLoading }) {
|
|
|
891
967
|
] })
|
|
892
968
|
] }, i);
|
|
893
969
|
}) }),
|
|
894
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
970
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Loader, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
895
971
|
"div",
|
|
896
972
|
{
|
|
897
973
|
className: `${gridClass} ${data.length - 1 !== i ? "border-b border-gray-200" : ""} items-center`,
|
|
898
974
|
style: { ["--cols"]: cols },
|
|
899
|
-
children: columns.map((col, c) => /* @__PURE__ */ (0,
|
|
975
|
+
children: columns.map((col, c) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "py-[8px] px-[16px] body-3 truncate", children: typeof col.accessor === "function" ? col.accessor(row) : String(row[col.accessor]) }, c))
|
|
900
976
|
},
|
|
901
977
|
i
|
|
902
978
|
)) }),
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pagination, { currentPage: page, itemsPerPage: 5, totalItems: 10, onPageChange: setPage }) })
|
|
904
980
|
] });
|
|
905
981
|
}
|
|
906
982
|
|
|
907
983
|
// src/Table/DataTable/AntDataTable.tsx
|
|
908
984
|
var import_antd = require("antd");
|
|
909
985
|
var import_react4 = require("react");
|
|
910
|
-
var
|
|
986
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
911
987
|
function AntDataTable({
|
|
912
988
|
dataSource,
|
|
913
989
|
columns,
|
|
914
990
|
pageSize = 10,
|
|
915
991
|
rowCheckbox,
|
|
916
992
|
onRowSelect,
|
|
993
|
+
// onFilteredDataChange,
|
|
994
|
+
onFilter,
|
|
995
|
+
onChange,
|
|
917
996
|
width,
|
|
918
997
|
height,
|
|
919
998
|
pagination
|
|
@@ -926,7 +1005,11 @@ function AntDataTable({
|
|
|
926
1005
|
onRowSelect && onRowSelect(newSelectedRowKeys);
|
|
927
1006
|
}
|
|
928
1007
|
};
|
|
929
|
-
|
|
1008
|
+
const handleChange = (paginationArgs, filters, sorter, extra) => {
|
|
1009
|
+
onChange?.(paginationArgs, filters, sorter, extra);
|
|
1010
|
+
onFilter(filters);
|
|
1011
|
+
};
|
|
1012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
930
1013
|
import_antd.ConfigProvider,
|
|
931
1014
|
{
|
|
932
1015
|
theme: {
|
|
@@ -936,12 +1019,13 @@ function AntDataTable({
|
|
|
936
1019
|
fontSize: 14
|
|
937
1020
|
}
|
|
938
1021
|
},
|
|
939
|
-
children: /* @__PURE__ */ (0,
|
|
1022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
940
1023
|
import_antd.Table,
|
|
941
1024
|
{
|
|
942
1025
|
dataSource,
|
|
943
1026
|
columns,
|
|
944
1027
|
rowSelection: rowCheckbox ? rowSelection : void 0,
|
|
1028
|
+
onChange: handleChange,
|
|
945
1029
|
pagination: pagination ? { position: ["bottomCenter"], pageSize } : false,
|
|
946
1030
|
style: { width },
|
|
947
1031
|
scroll: { y: height }
|
|
@@ -959,7 +1043,7 @@ var import_timegrid = __toESM(require("@fullcalendar/timegrid"));
|
|
|
959
1043
|
var import_interaction = __toESM(require("@fullcalendar/interaction"));
|
|
960
1044
|
var import_th = __toESM(require("@fullcalendar/core/locales/th"));
|
|
961
1045
|
var import_icons_react6 = require("@tabler/icons-react");
|
|
962
|
-
var
|
|
1046
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
963
1047
|
function Calendar({ events }) {
|
|
964
1048
|
const calendarRef = (0, import_react5.useRef)(null);
|
|
965
1049
|
const [monthTitle, setMonthTitle] = (0, import_react5.useState)("");
|
|
@@ -978,11 +1062,11 @@ function Calendar({ events }) {
|
|
|
978
1062
|
(0, import_react5.useEffect)(() => {
|
|
979
1063
|
updateTitle();
|
|
980
1064
|
}, []);
|
|
981
|
-
return /* @__PURE__ */ (0,
|
|
982
|
-
/* @__PURE__ */ (0,
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
984
|
-
/* @__PURE__ */ (0,
|
|
985
|
-
/* @__PURE__ */ (0,
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "fc w-full h-full relative z-10", children: [
|
|
1066
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex mb-[8px]", children: [
|
|
1067
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "headline-5", children: monthTitle }),
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-[10px] ml-auto", children: [
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
986
1070
|
"p",
|
|
987
1071
|
{
|
|
988
1072
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -993,7 +1077,7 @@ function Calendar({ events }) {
|
|
|
993
1077
|
children: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49"
|
|
994
1078
|
}
|
|
995
1079
|
),
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
997
1081
|
"p",
|
|
998
1082
|
{
|
|
999
1083
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -1004,7 +1088,7 @@ function Calendar({ events }) {
|
|
|
1004
1088
|
children: "Month"
|
|
1005
1089
|
}
|
|
1006
1090
|
),
|
|
1007
|
-
/* @__PURE__ */ (0,
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1008
1092
|
"p",
|
|
1009
1093
|
{
|
|
1010
1094
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -1015,7 +1099,7 @@ function Calendar({ events }) {
|
|
|
1015
1099
|
children: "Week"
|
|
1016
1100
|
}
|
|
1017
1101
|
),
|
|
1018
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1019
1103
|
"p",
|
|
1020
1104
|
{
|
|
1021
1105
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -1026,7 +1110,7 @@ function Calendar({ events }) {
|
|
|
1026
1110
|
children: "Day"
|
|
1027
1111
|
}
|
|
1028
1112
|
),
|
|
1029
|
-
/* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1030
1114
|
"button",
|
|
1031
1115
|
{
|
|
1032
1116
|
className: "cursor-pointer",
|
|
@@ -1034,10 +1118,10 @@ function Calendar({ events }) {
|
|
|
1034
1118
|
calendarRef.current?.getApi().prev();
|
|
1035
1119
|
updateTitle();
|
|
1036
1120
|
},
|
|
1037
|
-
children: /* @__PURE__ */ (0,
|
|
1121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconChevronLeft, {})
|
|
1038
1122
|
}
|
|
1039
1123
|
),
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1041
1125
|
"button",
|
|
1042
1126
|
{
|
|
1043
1127
|
className: "cursor-pointer",
|
|
@@ -1045,12 +1129,12 @@ function Calendar({ events }) {
|
|
|
1045
1129
|
calendarRef.current?.getApi().next();
|
|
1046
1130
|
updateTitle();
|
|
1047
1131
|
},
|
|
1048
|
-
children: /* @__PURE__ */ (0,
|
|
1132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconChevronRight, {})
|
|
1049
1133
|
}
|
|
1050
1134
|
)
|
|
1051
1135
|
] })
|
|
1052
1136
|
] }),
|
|
1053
|
-
/* @__PURE__ */ (0,
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1054
1138
|
import_react6.default,
|
|
1055
1139
|
{
|
|
1056
1140
|
ref: calendarRef,
|
|
@@ -1079,28 +1163,28 @@ function Calendar({ events }) {
|
|
|
1079
1163
|
});
|
|
1080
1164
|
},
|
|
1081
1165
|
eventContent: (arg) => {
|
|
1082
|
-
return /* @__PURE__ */ (0,
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center h-[28px] p-[4px] border-green-500 border-l-[10px] bg-red-400 rounded text-left text-white caption-1", children: arg.event.title }) });
|
|
1083
1167
|
},
|
|
1084
1168
|
moreLinkContent: (arg) => `+${arg.num} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23`
|
|
1085
1169
|
}
|
|
1086
1170
|
) }),
|
|
1087
|
-
openPopup && /* @__PURE__ */ (0,
|
|
1171
|
+
openPopup && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 flex justify-center items-center bg-black/50 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EventPopUp, { event: selectedEvent, onClose: () => setOpenPopup(false) }) })
|
|
1088
1172
|
] });
|
|
1089
1173
|
}
|
|
1090
1174
|
function EventPopUp({ event, onClose }) {
|
|
1091
|
-
return /* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1094
|
-
/* @__PURE__ */ (0,
|
|
1095
|
-
/* @__PURE__ */ (0,
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w-[500px] h-auto rounded-2xl bg-white relative z-50 shadow-2xl overflow-hidden", children: [
|
|
1176
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { className: "absolute top-3 right-3 rounded-full p-1 hover:bg-gray-200 transition", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconX, { className: "w-6 h-6 text-gray-600" }) }),
|
|
1177
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "bg-red-400 text-left text-white px-6 py-4 headline-5", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "text-lg font-semibold", children: event.title }) }),
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col w-full p-6 gap-3 text-gray-700 body-3", children: [
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { children: [
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium", children: "\u0E40\u0E23\u0E34\u0E48\u0E21: " }),
|
|
1097
1181
|
event?.start?.toLocaleString?.() || String(event?.start)
|
|
1098
1182
|
] }),
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { children: [
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium", children: "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14: " }),
|
|
1101
1185
|
event?.end?.toLocaleString?.() || String(event?.end)
|
|
1102
1186
|
] }),
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-sm font-semibold text-gray-500 uppercase mb-2 hover:underline cursor-pointer", children: "\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21" })
|
|
1104
1188
|
] })
|
|
1105
1189
|
] });
|
|
1106
1190
|
}
|
|
@@ -1108,7 +1192,7 @@ function EventPopUp({ event, onClose }) {
|
|
|
1108
1192
|
// src/Input/TextInput/TextInput.tsx
|
|
1109
1193
|
var import_icons_react7 = require("@tabler/icons-react");
|
|
1110
1194
|
var import_react7 = require("react");
|
|
1111
|
-
var
|
|
1195
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1112
1196
|
function TextInput({
|
|
1113
1197
|
label,
|
|
1114
1198
|
placeholder,
|
|
@@ -1125,18 +1209,18 @@ function TextInput({
|
|
|
1125
1209
|
setShowPassword(!showPassword);
|
|
1126
1210
|
};
|
|
1127
1211
|
const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
|
|
1128
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
-
label && /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
1213
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "body-1 mb-[8px]", children: [
|
|
1130
1214
|
label,
|
|
1131
|
-
required && /* @__PURE__ */ (0,
|
|
1215
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-red-500", children: "\xA0*" })
|
|
1132
1216
|
] }),
|
|
1133
|
-
/* @__PURE__ */ (0,
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1134
1218
|
"div",
|
|
1135
1219
|
{
|
|
1136
1220
|
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1137
|
-
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-
|
|
1221
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
|
|
1138
1222
|
children: [
|
|
1139
|
-
/* @__PURE__ */ (0,
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1140
1224
|
"input",
|
|
1141
1225
|
{
|
|
1142
1226
|
className: `w-full h-full px-[16px] ${disabled ? "cursor-not-allowed" : ""}`,
|
|
@@ -1149,75 +1233,18 @@ function TextInput({
|
|
|
1149
1233
|
disabled
|
|
1150
1234
|
}
|
|
1151
1235
|
),
|
|
1152
|
-
type === "password" && (showPassword ? /* @__PURE__ */ (0,
|
|
1236
|
+
type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react7.IconEye, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react7.IconEyeOff, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }))
|
|
1153
1237
|
]
|
|
1154
1238
|
}
|
|
1155
1239
|
),
|
|
1156
|
-
error && /* @__PURE__ */ (0,
|
|
1240
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 body-1", children: error })
|
|
1157
1241
|
] });
|
|
1158
1242
|
}
|
|
1159
1243
|
|
|
1160
|
-
// src/InputField/InputField.tsx
|
|
1161
|
-
var import_antd2 = require("antd");
|
|
1162
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1163
|
-
function InputField({
|
|
1164
|
-
value,
|
|
1165
|
-
onChange,
|
|
1166
|
-
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1167
|
-
title,
|
|
1168
|
-
required,
|
|
1169
|
-
bottomText,
|
|
1170
|
-
disabled,
|
|
1171
|
-
error,
|
|
1172
|
-
addonBefore,
|
|
1173
|
-
addonAfter,
|
|
1174
|
-
defaultValue,
|
|
1175
|
-
className,
|
|
1176
|
-
onClear
|
|
1177
|
-
}) {
|
|
1178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1179
|
-
import_antd2.ConfigProvider,
|
|
1180
|
-
{
|
|
1181
|
-
theme: {
|
|
1182
|
-
token: {
|
|
1183
|
-
fontFamily: "Kanit"
|
|
1184
|
-
}
|
|
1185
|
-
},
|
|
1186
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "container-input", children: [
|
|
1187
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1188
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "body-1", children: title }),
|
|
1189
|
-
" ",
|
|
1190
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1191
|
-
] }),
|
|
1192
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1193
|
-
import_antd2.Input,
|
|
1194
|
-
{
|
|
1195
|
-
value,
|
|
1196
|
-
placeholder,
|
|
1197
|
-
disabled,
|
|
1198
|
-
className: `body-1 w-full ${className ?? ""}`,
|
|
1199
|
-
onChange: (e) => onChange(e.target.value || void 0),
|
|
1200
|
-
allowClear: true,
|
|
1201
|
-
addonBefore,
|
|
1202
|
-
addonAfter,
|
|
1203
|
-
defaultValue,
|
|
1204
|
-
onClear
|
|
1205
|
-
}
|
|
1206
|
-
),
|
|
1207
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1208
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1209
|
-
" ",
|
|
1210
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1211
|
-
] })
|
|
1212
|
-
] })
|
|
1213
|
-
}
|
|
1214
|
-
);
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
1244
|
// src/Input/TextArea/TextArea.tsx
|
|
1218
|
-
var
|
|
1219
|
-
var
|
|
1220
|
-
var { TextArea } =
|
|
1245
|
+
var import_antd2 = require("antd");
|
|
1246
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1247
|
+
var { TextArea } = import_antd2.Input;
|
|
1221
1248
|
function TextAreaInput({
|
|
1222
1249
|
label,
|
|
1223
1250
|
height = 4,
|
|
@@ -1231,8 +1258,8 @@ function TextAreaInput({
|
|
|
1231
1258
|
error,
|
|
1232
1259
|
disabled
|
|
1233
1260
|
}) {
|
|
1234
|
-
return /* @__PURE__ */ (0,
|
|
1235
|
-
|
|
1261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1262
|
+
import_antd2.ConfigProvider,
|
|
1236
1263
|
{
|
|
1237
1264
|
theme: {
|
|
1238
1265
|
components: {},
|
|
@@ -1241,13 +1268,13 @@ function TextAreaInput({
|
|
|
1241
1268
|
fontSize: 16
|
|
1242
1269
|
}
|
|
1243
1270
|
},
|
|
1244
|
-
children: /* @__PURE__ */ (0,
|
|
1245
|
-
label && /* @__PURE__ */ (0,
|
|
1271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
1272
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1 mb-[8px]", children: [
|
|
1246
1273
|
label,
|
|
1247
1274
|
" ",
|
|
1248
|
-
required && /* @__PURE__ */ (0,
|
|
1275
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "\xA0*" })
|
|
1249
1276
|
] }),
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1251
1278
|
TextArea,
|
|
1252
1279
|
{
|
|
1253
1280
|
value,
|
|
@@ -1263,71 +1290,126 @@ function TextAreaInput({
|
|
|
1263
1290
|
disabled
|
|
1264
1291
|
}
|
|
1265
1292
|
),
|
|
1266
|
-
error && /* @__PURE__ */ (0,
|
|
1293
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 body-1", children: error })
|
|
1267
1294
|
] })
|
|
1268
1295
|
}
|
|
1269
1296
|
) });
|
|
1270
1297
|
}
|
|
1271
1298
|
|
|
1272
|
-
// src/
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1275
|
-
function
|
|
1299
|
+
// src/Input/InputField/InputField.tsx
|
|
1300
|
+
var import_antd3 = require("antd");
|
|
1301
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1302
|
+
function InputField({
|
|
1276
1303
|
value,
|
|
1277
1304
|
onChange,
|
|
1305
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1306
|
+
label,
|
|
1278
1307
|
required,
|
|
1279
|
-
|
|
1280
|
-
bottomText,
|
|
1308
|
+
disabled,
|
|
1281
1309
|
error,
|
|
1310
|
+
addonBefore,
|
|
1311
|
+
addonAfter,
|
|
1312
|
+
defaultValue,
|
|
1313
|
+
className,
|
|
1314
|
+
onClear,
|
|
1315
|
+
statickey
|
|
1316
|
+
}) {
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1318
|
+
import_antd3.ConfigProvider,
|
|
1319
|
+
{
|
|
1320
|
+
theme: {
|
|
1321
|
+
token: {
|
|
1322
|
+
fontFamily: "Kanit"
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children: label }),
|
|
1328
|
+
" ",
|
|
1329
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1330
|
+
] }),
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_antd3.Space.Compact, { children: [
|
|
1332
|
+
statickey && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "items-center flex px-2 bg-gray-300 rounded-l-md body-1", children: statickey }),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1334
|
+
import_antd3.Input,
|
|
1335
|
+
{
|
|
1336
|
+
value,
|
|
1337
|
+
placeholder,
|
|
1338
|
+
disabled,
|
|
1339
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1340
|
+
onChange: (e) => onChange(e.target.value || void 0),
|
|
1341
|
+
allowClear: true,
|
|
1342
|
+
addonBefore,
|
|
1343
|
+
addonAfter,
|
|
1344
|
+
defaultValue,
|
|
1345
|
+
onClear
|
|
1346
|
+
}
|
|
1347
|
+
)
|
|
1348
|
+
] }),
|
|
1349
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1350
|
+
] })
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// src/Input/InputFieldNumber/InputFieldNumber.tsx
|
|
1356
|
+
var import_antd4 = require("antd");
|
|
1357
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1358
|
+
function InputFieldNumber({
|
|
1359
|
+
value,
|
|
1360
|
+
onChange,
|
|
1361
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1362
|
+
label,
|
|
1363
|
+
required,
|
|
1282
1364
|
disabled,
|
|
1283
|
-
|
|
1284
|
-
|
|
1365
|
+
error,
|
|
1366
|
+
addonBefore,
|
|
1367
|
+
addonAfter,
|
|
1368
|
+
defaultValue,
|
|
1285
1369
|
className,
|
|
1286
|
-
|
|
1370
|
+
max,
|
|
1371
|
+
min,
|
|
1372
|
+
controls,
|
|
1373
|
+
size,
|
|
1374
|
+
changeOnWheel,
|
|
1375
|
+
formatter,
|
|
1376
|
+
parser
|
|
1287
1377
|
}) {
|
|
1288
|
-
return /* @__PURE__ */ (0,
|
|
1378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1289
1379
|
import_antd4.ConfigProvider,
|
|
1290
1380
|
{
|
|
1291
1381
|
theme: {
|
|
1292
1382
|
token: {
|
|
1293
|
-
fontFamily: "Kanit"
|
|
1294
|
-
fontSize: 16
|
|
1383
|
+
fontFamily: "Kanit"
|
|
1295
1384
|
}
|
|
1296
1385
|
},
|
|
1297
|
-
children: /* @__PURE__ */ (0,
|
|
1298
|
-
/* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "container-input", children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "body-1", children: label }),
|
|
1300
1389
|
" ",
|
|
1301
|
-
required && /* @__PURE__ */ (0,
|
|
1390
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1302
1391
|
] }),
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1304
|
-
import_antd4.
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1393
|
+
import_antd4.InputNumber,
|
|
1305
1394
|
{
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
] });
|
|
1322
|
-
},
|
|
1323
|
-
disabled
|
|
1395
|
+
value: value ?? void 0,
|
|
1396
|
+
onChange: (val) => onChange(val),
|
|
1397
|
+
placeholder,
|
|
1398
|
+
disabled,
|
|
1399
|
+
className: `body-1 !w-full ${className ?? ""}`,
|
|
1400
|
+
addonBefore,
|
|
1401
|
+
addonAfter,
|
|
1402
|
+
defaultValue,
|
|
1403
|
+
max,
|
|
1404
|
+
min,
|
|
1405
|
+
controls,
|
|
1406
|
+
size,
|
|
1407
|
+
changeOnWheel,
|
|
1408
|
+
formatter,
|
|
1409
|
+
parser
|
|
1324
1410
|
}
|
|
1325
1411
|
),
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1328
|
-
" ",
|
|
1329
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1330
|
-
] })
|
|
1412
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1331
1413
|
] })
|
|
1332
1414
|
}
|
|
1333
1415
|
);
|
|
@@ -1336,15 +1418,19 @@ function ColorPickerBasic({
|
|
|
1336
1418
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1337
1419
|
var import_antd5 = require("antd");
|
|
1338
1420
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1339
|
-
var import_th_TH = __toESM(require("antd/locale/th_TH"));
|
|
1421
|
+
var import_th_TH = __toESM(require("antd/es/date-picker/locale/th_TH"));
|
|
1422
|
+
var import_th_TH2 = __toESM(require("antd/locale/th_TH"));
|
|
1340
1423
|
var import_th2 = __toESM(require_th());
|
|
1341
|
-
var
|
|
1424
|
+
var import_locale = require("date-fns/locale");
|
|
1425
|
+
var import_date_fns = require("date-fns");
|
|
1426
|
+
var import_buddhistEra = __toESM(require_buddhistEra());
|
|
1427
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1428
|
+
import_dayjs.default.extend(import_buddhistEra.default);
|
|
1342
1429
|
function DatePickerBasic({
|
|
1343
1430
|
value,
|
|
1344
1431
|
onChange,
|
|
1345
1432
|
required,
|
|
1346
|
-
|
|
1347
|
-
bottomText,
|
|
1433
|
+
label,
|
|
1348
1434
|
error,
|
|
1349
1435
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1350
1436
|
disabled,
|
|
@@ -1357,23 +1443,33 @@ function DatePickerBasic({
|
|
|
1357
1443
|
}) {
|
|
1358
1444
|
const dateFormat = "DD/MM/YYYY";
|
|
1359
1445
|
import_dayjs.default.locale("th_TH");
|
|
1360
|
-
|
|
1446
|
+
const buddhistLocale = {
|
|
1447
|
+
...import_th_TH.default,
|
|
1448
|
+
lang: {
|
|
1449
|
+
...import_th_TH.default.lang,
|
|
1450
|
+
fieldDateFormat: "BBBB-MM-DD",
|
|
1451
|
+
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
1452
|
+
yearFormat: "BBBB",
|
|
1453
|
+
cellYearFormat: "BBBB"
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1361
1457
|
import_antd5.ConfigProvider,
|
|
1362
1458
|
{
|
|
1363
|
-
locale:
|
|
1459
|
+
locale: import_th_TH2.default,
|
|
1364
1460
|
theme: {
|
|
1365
1461
|
token: {
|
|
1366
1462
|
fontFamily: "Kanit",
|
|
1367
1463
|
fontSize: 16
|
|
1368
1464
|
}
|
|
1369
1465
|
},
|
|
1370
|
-
children: /* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "container-input", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children: label }),
|
|
1373
1469
|
" ",
|
|
1374
|
-
required && /* @__PURE__ */ (0,
|
|
1470
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1375
1471
|
] }),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1377
1473
|
import_antd5.DatePicker,
|
|
1378
1474
|
{
|
|
1379
1475
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -1382,19 +1478,19 @@ function DatePickerBasic({
|
|
|
1382
1478
|
onChange,
|
|
1383
1479
|
allowClear: true,
|
|
1384
1480
|
disabled,
|
|
1385
|
-
format:
|
|
1481
|
+
format: (date) => date ? (0, import_date_fns.format)(date.toDate(), "dd/MM/yyyy", { locale: import_locale.th }).replace(
|
|
1482
|
+
/\d{4}$/,
|
|
1483
|
+
(y) => String(parseInt(y) + 543)
|
|
1484
|
+
) : "",
|
|
1386
1485
|
defaultValue,
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
size
|
|
1486
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
1487
|
+
minDate: minDate ? (0, import_dayjs.default)(minDate) : void 0,
|
|
1488
|
+
maxDate: maxDate ? (0, import_dayjs.default)(maxDate) : void 0,
|
|
1489
|
+
size,
|
|
1490
|
+
locale: buddhistLocale
|
|
1391
1491
|
}
|
|
1392
1492
|
),
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1395
|
-
" ",
|
|
1396
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1397
|
-
] })
|
|
1493
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1398
1494
|
] })
|
|
1399
1495
|
}
|
|
1400
1496
|
);
|
|
@@ -1402,19 +1498,21 @@ function DatePickerBasic({
|
|
|
1402
1498
|
|
|
1403
1499
|
// src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
|
|
1404
1500
|
var import_antd6 = require("antd");
|
|
1405
|
-
var
|
|
1501
|
+
var import_th_TH3 = __toESM(require("antd/locale/th_TH"));
|
|
1406
1502
|
var import_th3 = __toESM(require_th());
|
|
1503
|
+
var import_th_TH4 = __toESM(require("antd/es/date-picker/locale/th_TH"));
|
|
1407
1504
|
var import_customParseFormat = __toESM(require_customParseFormat());
|
|
1408
1505
|
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1409
|
-
var
|
|
1506
|
+
var import_date_fns2 = require("date-fns");
|
|
1507
|
+
var import_locale2 = require("date-fns/locale");
|
|
1508
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1410
1509
|
import_dayjs2.default.extend(import_customParseFormat.default);
|
|
1411
1510
|
function DatePickerRangePicker({
|
|
1412
1511
|
value,
|
|
1413
1512
|
onChange,
|
|
1414
1513
|
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1415
|
-
|
|
1514
|
+
label,
|
|
1416
1515
|
required,
|
|
1417
|
-
bottomText,
|
|
1418
1516
|
error,
|
|
1419
1517
|
disabled,
|
|
1420
1518
|
minDate,
|
|
@@ -1427,45 +1525,71 @@ function DatePickerRangePicker({
|
|
|
1427
1525
|
}) {
|
|
1428
1526
|
const dateFormat = "DD/MM/YYYY";
|
|
1429
1527
|
import_dayjs2.default.locale("th_TH");
|
|
1430
|
-
|
|
1528
|
+
const buddhistLocale = {
|
|
1529
|
+
...import_th_TH4.default,
|
|
1530
|
+
lang: {
|
|
1531
|
+
...import_th_TH4.default.lang,
|
|
1532
|
+
fieldDateFormat: "BBBB-MM-DD",
|
|
1533
|
+
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
1534
|
+
yearFormat: "BBBB",
|
|
1535
|
+
cellYearFormat: "BBBB"
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1431
1539
|
import_antd6.ConfigProvider,
|
|
1432
1540
|
{
|
|
1433
|
-
locale:
|
|
1541
|
+
locale: import_th_TH3.default,
|
|
1434
1542
|
theme: {
|
|
1435
1543
|
token: {
|
|
1436
1544
|
fontFamily: "Kanit",
|
|
1437
1545
|
fontSize: 16
|
|
1438
1546
|
}
|
|
1439
1547
|
},
|
|
1440
|
-
children: /* @__PURE__ */ (0,
|
|
1441
|
-
/* @__PURE__ */ (0,
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "container-input", children: [
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children: label }),
|
|
1443
1551
|
" ",
|
|
1444
|
-
required && /* @__PURE__ */ (0,
|
|
1552
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1445
1553
|
] }),
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1447
1555
|
import_antd6.DatePicker.RangePicker,
|
|
1448
1556
|
{
|
|
1449
|
-
format:
|
|
1450
|
-
|
|
1557
|
+
format: (date) => date ? (0, import_date_fns2.format)(date.toDate(), "dd/MM/yyyy", { locale: import_locale2.th }).replace(
|
|
1558
|
+
/\d{4}$/,
|
|
1559
|
+
(y) => String(parseInt(y) + 543)
|
|
1560
|
+
) : "",
|
|
1561
|
+
value: value ? [value[0] ? (0, import_dayjs2.default)(value[0]) : null, value[1] ? (0, import_dayjs2.default)(value[1]) : null] : null,
|
|
1451
1562
|
placeholder,
|
|
1452
1563
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1453
|
-
onChange,
|
|
1564
|
+
onChange: (dates, dateStrings) => {
|
|
1565
|
+
if (!dates) {
|
|
1566
|
+
onChange(null);
|
|
1567
|
+
} else {
|
|
1568
|
+
onChange([dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null]);
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1454
1571
|
allowClear: true,
|
|
1455
1572
|
disabled,
|
|
1456
|
-
minDate,
|
|
1457
|
-
maxDate,
|
|
1458
|
-
disabledDate,
|
|
1573
|
+
minDate: minDate ? (0, import_dayjs2.default)(minDate) : void 0,
|
|
1574
|
+
maxDate: maxDate ? (0, import_dayjs2.default)(maxDate) : void 0,
|
|
1575
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
1459
1576
|
size,
|
|
1460
1577
|
onOpenChange,
|
|
1461
|
-
onCalendarChange
|
|
1578
|
+
onCalendarChange: (dates, dateStrings, info) => {
|
|
1579
|
+
if (!dates) {
|
|
1580
|
+
onCalendarChange?.([null, null], dateStrings, info);
|
|
1581
|
+
} else {
|
|
1582
|
+
onCalendarChange?.(
|
|
1583
|
+
[dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null],
|
|
1584
|
+
dateStrings,
|
|
1585
|
+
info
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
locale: buddhistLocale
|
|
1462
1590
|
}
|
|
1463
1591
|
),
|
|
1464
|
-
/* @__PURE__ */ (0,
|
|
1465
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1466
|
-
" ",
|
|
1467
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1468
|
-
] })
|
|
1592
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1469
1593
|
] })
|
|
1470
1594
|
}
|
|
1471
1595
|
);
|
|
@@ -1473,49 +1597,49 @@ function DatePickerRangePicker({
|
|
|
1473
1597
|
|
|
1474
1598
|
// src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
|
|
1475
1599
|
var import_antd7 = require("antd");
|
|
1476
|
-
var
|
|
1600
|
+
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
1601
|
+
var import_th_TH5 = __toESM(require("antd/locale/th_TH"));
|
|
1602
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1477
1603
|
function TimePickerBasic({
|
|
1478
1604
|
value,
|
|
1479
1605
|
onChange,
|
|
1480
1606
|
required,
|
|
1481
|
-
|
|
1482
|
-
bottomText,
|
|
1607
|
+
label,
|
|
1483
1608
|
error,
|
|
1484
1609
|
placeholder,
|
|
1485
1610
|
disabled,
|
|
1486
1611
|
className
|
|
1487
1612
|
}) {
|
|
1488
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1489
1614
|
import_antd7.ConfigProvider,
|
|
1490
1615
|
{
|
|
1616
|
+
locale: import_th_TH5.default,
|
|
1491
1617
|
theme: {
|
|
1492
1618
|
token: {
|
|
1493
1619
|
fontFamily: "Kanit"
|
|
1494
1620
|
}
|
|
1495
1621
|
},
|
|
1496
|
-
children: /* @__PURE__ */ (0,
|
|
1497
|
-
/* @__PURE__ */ (0,
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "container-input", children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "body-1", children: label }),
|
|
1499
1625
|
" ",
|
|
1500
|
-
required && /* @__PURE__ */ (0,
|
|
1626
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1501
1627
|
] }),
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1503
1629
|
import_antd7.TimePicker,
|
|
1504
1630
|
{
|
|
1505
1631
|
format: "HH:mm",
|
|
1506
1632
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1507
|
-
value,
|
|
1633
|
+
value: value ? (0, import_dayjs3.default)(value) : null,
|
|
1508
1634
|
placeholder,
|
|
1509
|
-
onChange
|
|
1635
|
+
onChange: (time) => {
|
|
1636
|
+
onChange(time ? time.toDate() : null);
|
|
1637
|
+
},
|
|
1510
1638
|
allowClear: true,
|
|
1511
1639
|
disabled
|
|
1512
1640
|
}
|
|
1513
1641
|
),
|
|
1514
|
-
/* @__PURE__ */ (0,
|
|
1515
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1516
|
-
" ",
|
|
1517
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1518
|
-
] })
|
|
1642
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1519
1643
|
] })
|
|
1520
1644
|
}
|
|
1521
1645
|
);
|
|
@@ -1523,56 +1647,120 @@ function TimePickerBasic({
|
|
|
1523
1647
|
|
|
1524
1648
|
// src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
|
|
1525
1649
|
var import_antd8 = require("antd");
|
|
1526
|
-
var
|
|
1650
|
+
var import_dayjs4 = __toESM(require_dayjs_min());
|
|
1651
|
+
var import_th_TH6 = __toESM(require("antd/locale/th_TH"));
|
|
1652
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1527
1653
|
function TimePickerRangePicker({
|
|
1528
1654
|
value,
|
|
1529
1655
|
onChange,
|
|
1530
1656
|
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1531
|
-
|
|
1657
|
+
label,
|
|
1532
1658
|
required,
|
|
1533
|
-
bottomText,
|
|
1534
1659
|
error,
|
|
1535
1660
|
disabled,
|
|
1536
1661
|
className
|
|
1537
1662
|
}) {
|
|
1538
|
-
return /* @__PURE__ */ (0,
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1539
1664
|
import_antd8.ConfigProvider,
|
|
1540
1665
|
{
|
|
1666
|
+
locale: import_th_TH6.default,
|
|
1541
1667
|
theme: {
|
|
1542
1668
|
token: {
|
|
1543
1669
|
fontFamily: "Kanit"
|
|
1544
1670
|
}
|
|
1545
1671
|
},
|
|
1546
|
-
children: /* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "container-input", children: [
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "body-1", children: label }),
|
|
1549
1675
|
" ",
|
|
1550
|
-
required && /* @__PURE__ */ (0,
|
|
1676
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1551
1677
|
] }),
|
|
1552
|
-
/* @__PURE__ */ (0,
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1553
1679
|
import_antd8.TimePicker.RangePicker,
|
|
1554
1680
|
{
|
|
1555
1681
|
format: "HH:mm",
|
|
1556
|
-
value,
|
|
1682
|
+
value: value ? [value[0] ? (0, import_dayjs4.default)(value[0]) : null, value[1] ? (0, import_dayjs4.default)(value[1]) : null] : null,
|
|
1557
1683
|
placeholder,
|
|
1558
1684
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1685
|
+
onChange: (dates, dateStrings) => {
|
|
1686
|
+
if (!dates) {
|
|
1687
|
+
onChange(null);
|
|
1688
|
+
} else {
|
|
1689
|
+
onChange([dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null]);
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
allowClear: true,
|
|
1693
|
+
disabled,
|
|
1694
|
+
showNow: true
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1698
|
+
] })
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
|
|
1704
|
+
var import_antd9 = require("antd");
|
|
1705
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1706
|
+
function ColorPickerBasic({
|
|
1707
|
+
value,
|
|
1708
|
+
onChange,
|
|
1709
|
+
required,
|
|
1710
|
+
label,
|
|
1711
|
+
error,
|
|
1712
|
+
disabled,
|
|
1713
|
+
allowClear,
|
|
1714
|
+
defaultFormat,
|
|
1715
|
+
className,
|
|
1716
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1717
|
+
}) {
|
|
1718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1719
|
+
import_antd9.ConfigProvider,
|
|
1720
|
+
{
|
|
1721
|
+
theme: {
|
|
1722
|
+
token: {
|
|
1723
|
+
fontFamily: "Kanit",
|
|
1724
|
+
fontSize: 16
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "container-input", children: [
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "body-1", children: label }),
|
|
1730
|
+
" ",
|
|
1731
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1732
|
+
] }),
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1734
|
+
import_antd9.ColorPicker,
|
|
1735
|
+
{
|
|
1736
|
+
defaultFormat,
|
|
1737
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1738
|
+
value,
|
|
1739
|
+
defaultValue: "#ffff",
|
|
1559
1740
|
onChange,
|
|
1560
|
-
allowClear
|
|
1741
|
+
allowClear,
|
|
1742
|
+
showText: (color) => {
|
|
1743
|
+
const hex = color.toHexString();
|
|
1744
|
+
if (!value) {
|
|
1745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: placeholder });
|
|
1746
|
+
}
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
|
|
1748
|
+
"(",
|
|
1749
|
+
hex,
|
|
1750
|
+
")"
|
|
1751
|
+
] });
|
|
1752
|
+
},
|
|
1561
1753
|
disabled
|
|
1562
1754
|
}
|
|
1563
1755
|
),
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1565
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1566
|
-
" ",
|
|
1567
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
1568
|
-
] })
|
|
1756
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1569
1757
|
] })
|
|
1570
1758
|
}
|
|
1571
1759
|
);
|
|
1572
1760
|
}
|
|
1573
1761
|
|
|
1574
|
-
// src/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
1575
|
-
var
|
|
1762
|
+
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
1763
|
+
var import_antd10 = require("antd");
|
|
1576
1764
|
|
|
1577
1765
|
// node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
1578
1766
|
function _typeof(o) {
|
|
@@ -2273,8 +2461,8 @@ magentaDark.primary = magentaDark[5];
|
|
|
2273
2461
|
var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
|
|
2274
2462
|
greyDark.primary = greyDark[5];
|
|
2275
2463
|
|
|
2276
|
-
// src/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2277
|
-
var
|
|
2464
|
+
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2465
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2278
2466
|
function genPresets(presets = presetPalettes) {
|
|
2279
2467
|
return Object.entries(presets).map(([label, colors]) => ({
|
|
2280
2468
|
label,
|
|
@@ -2286,8 +2474,7 @@ function ColorPalettePickerBasic({
|
|
|
2286
2474
|
value,
|
|
2287
2475
|
onChange,
|
|
2288
2476
|
required,
|
|
2289
|
-
|
|
2290
|
-
bottomText,
|
|
2477
|
+
label,
|
|
2291
2478
|
error,
|
|
2292
2479
|
disabled,
|
|
2293
2480
|
allowClear,
|
|
@@ -2296,14 +2483,14 @@ function ColorPalettePickerBasic({
|
|
|
2296
2483
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35",
|
|
2297
2484
|
onClear
|
|
2298
2485
|
}) {
|
|
2299
|
-
const { token } =
|
|
2486
|
+
const { token } = import_antd10.theme.useToken();
|
|
2300
2487
|
const presets = genPresets({
|
|
2301
2488
|
primary: generate(token.colorPrimary),
|
|
2302
2489
|
red,
|
|
2303
2490
|
green
|
|
2304
2491
|
});
|
|
2305
|
-
return /* @__PURE__ */ (0,
|
|
2306
|
-
|
|
2492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2493
|
+
import_antd10.ConfigProvider,
|
|
2307
2494
|
{
|
|
2308
2495
|
theme: {
|
|
2309
2496
|
token: {
|
|
@@ -2311,14 +2498,14 @@ function ColorPalettePickerBasic({
|
|
|
2311
2498
|
fontSize: 16
|
|
2312
2499
|
}
|
|
2313
2500
|
},
|
|
2314
|
-
children: /* @__PURE__ */ (0,
|
|
2315
|
-
/* @__PURE__ */ (0,
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "container-input", children: [
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "body-1", children: label }),
|
|
2317
2504
|
" ",
|
|
2318
|
-
required && /* @__PURE__ */ (0,
|
|
2505
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2319
2506
|
] }),
|
|
2320
|
-
/* @__PURE__ */ (0,
|
|
2321
|
-
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2508
|
+
import_antd10.ColorPicker,
|
|
2322
2509
|
{
|
|
2323
2510
|
defaultFormat,
|
|
2324
2511
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -2330,9 +2517,9 @@ function ColorPalettePickerBasic({
|
|
|
2330
2517
|
showText: (color) => {
|
|
2331
2518
|
const hex = color.toHexString();
|
|
2332
2519
|
if (!value) {
|
|
2333
|
-
return /* @__PURE__ */ (0,
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: placeholder });
|
|
2334
2521
|
}
|
|
2335
|
-
return /* @__PURE__ */ (0,
|
|
2522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
|
|
2336
2523
|
"(",
|
|
2337
2524
|
hex,
|
|
2338
2525
|
")"
|
|
@@ -2342,26 +2529,21 @@ function ColorPalettePickerBasic({
|
|
|
2342
2529
|
onClear
|
|
2343
2530
|
}
|
|
2344
2531
|
),
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2346
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2347
|
-
" ",
|
|
2348
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2349
|
-
] })
|
|
2532
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2350
2533
|
] })
|
|
2351
2534
|
}
|
|
2352
2535
|
);
|
|
2353
2536
|
}
|
|
2354
2537
|
|
|
2355
2538
|
// src/Select/SelectField/SelectField.tsx
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2539
|
+
var import_antd11 = require("antd");
|
|
2540
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2358
2541
|
function SelectField({
|
|
2359
2542
|
value,
|
|
2360
2543
|
onChange,
|
|
2361
2544
|
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2362
|
-
|
|
2545
|
+
label,
|
|
2363
2546
|
required,
|
|
2364
|
-
bottomText,
|
|
2365
2547
|
error,
|
|
2366
2548
|
disabled,
|
|
2367
2549
|
defaultValue,
|
|
@@ -2373,8 +2555,8 @@ function SelectField({
|
|
|
2373
2555
|
className,
|
|
2374
2556
|
onClear
|
|
2375
2557
|
}) {
|
|
2376
|
-
return /* @__PURE__ */ (0,
|
|
2377
|
-
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2559
|
+
import_antd11.ConfigProvider,
|
|
2378
2560
|
{
|
|
2379
2561
|
theme: {
|
|
2380
2562
|
token: {
|
|
@@ -2382,14 +2564,14 @@ function SelectField({
|
|
|
2382
2564
|
fontSize: 16
|
|
2383
2565
|
}
|
|
2384
2566
|
},
|
|
2385
|
-
children: /* @__PURE__ */ (0,
|
|
2386
|
-
/* @__PURE__ */ (0,
|
|
2387
|
-
/* @__PURE__ */ (0,
|
|
2567
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "container-input", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "body-1", children: label }),
|
|
2388
2570
|
" ",
|
|
2389
|
-
required && /* @__PURE__ */ (0,
|
|
2571
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2390
2572
|
] }),
|
|
2391
|
-
/* @__PURE__ */ (0,
|
|
2392
|
-
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2574
|
+
import_antd11.Select,
|
|
2393
2575
|
{
|
|
2394
2576
|
showSearch: true,
|
|
2395
2577
|
value,
|
|
@@ -2403,7 +2585,7 @@ function SelectField({
|
|
|
2403
2585
|
options,
|
|
2404
2586
|
mode,
|
|
2405
2587
|
onSearch: handleSearch,
|
|
2406
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2588
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2407
2589
|
"span",
|
|
2408
2590
|
{
|
|
2409
2591
|
style: {
|
|
@@ -2420,26 +2602,21 @@ function SelectField({
|
|
|
2420
2602
|
onClear
|
|
2421
2603
|
}
|
|
2422
2604
|
),
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2425
|
-
" ",
|
|
2426
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2427
|
-
] })
|
|
2605
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2428
2606
|
] })
|
|
2429
2607
|
}
|
|
2430
2608
|
);
|
|
2431
2609
|
}
|
|
2432
2610
|
|
|
2433
2611
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2434
|
-
var
|
|
2435
|
-
var
|
|
2612
|
+
var import_antd12 = require("antd");
|
|
2613
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2436
2614
|
function SelectFieldGroup({
|
|
2437
2615
|
value,
|
|
2438
2616
|
onChange,
|
|
2439
2617
|
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2440
|
-
|
|
2618
|
+
label,
|
|
2441
2619
|
required,
|
|
2442
|
-
bottomText,
|
|
2443
2620
|
error,
|
|
2444
2621
|
disabled,
|
|
2445
2622
|
defaultValue,
|
|
@@ -2450,22 +2627,22 @@ function SelectFieldGroup({
|
|
|
2450
2627
|
handleSearch,
|
|
2451
2628
|
className
|
|
2452
2629
|
}) {
|
|
2453
|
-
return /* @__PURE__ */ (0,
|
|
2454
|
-
|
|
2630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2631
|
+
import_antd12.ConfigProvider,
|
|
2455
2632
|
{
|
|
2456
2633
|
theme: {
|
|
2457
2634
|
token: {
|
|
2458
2635
|
fontFamily: "Kanit"
|
|
2459
2636
|
}
|
|
2460
2637
|
},
|
|
2461
|
-
children: /* @__PURE__ */ (0,
|
|
2462
|
-
/* @__PURE__ */ (0,
|
|
2463
|
-
/* @__PURE__ */ (0,
|
|
2638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "container-input", children: [
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
2640
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "body-1", children: label }),
|
|
2464
2641
|
" ",
|
|
2465
|
-
required && /* @__PURE__ */ (0,
|
|
2642
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2466
2643
|
] }),
|
|
2467
|
-
/* @__PURE__ */ (0,
|
|
2468
|
-
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2645
|
+
import_antd12.Select,
|
|
2469
2646
|
{
|
|
2470
2647
|
showSearch: true,
|
|
2471
2648
|
value,
|
|
@@ -2479,7 +2656,7 @@ function SelectFieldGroup({
|
|
|
2479
2656
|
options,
|
|
2480
2657
|
mode,
|
|
2481
2658
|
onSearch: handleSearch,
|
|
2482
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
2659
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2483
2660
|
"span",
|
|
2484
2661
|
{
|
|
2485
2662
|
style: {
|
|
@@ -2495,18 +2672,14 @@ function SelectFieldGroup({
|
|
|
2495
2672
|
allowClear: true
|
|
2496
2673
|
}
|
|
2497
2674
|
),
|
|
2498
|
-
/* @__PURE__ */ (0,
|
|
2499
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2500
|
-
" ",
|
|
2501
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2502
|
-
] })
|
|
2675
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2503
2676
|
] })
|
|
2504
2677
|
}
|
|
2505
2678
|
);
|
|
2506
2679
|
}
|
|
2507
2680
|
|
|
2508
2681
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2509
|
-
var
|
|
2682
|
+
var import_antd13 = require("antd");
|
|
2510
2683
|
|
|
2511
2684
|
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
2512
2685
|
var status = [
|
|
@@ -2519,22 +2692,21 @@ var status = [
|
|
|
2519
2692
|
|
|
2520
2693
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2521
2694
|
var import_icons = require("@ant-design/icons");
|
|
2522
|
-
var
|
|
2695
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2523
2696
|
function SelectFieldStatus({
|
|
2524
2697
|
value,
|
|
2525
2698
|
onChange,
|
|
2526
2699
|
placeholder,
|
|
2527
|
-
|
|
2700
|
+
label,
|
|
2528
2701
|
required,
|
|
2529
|
-
bottomText,
|
|
2530
2702
|
disabled,
|
|
2531
2703
|
error,
|
|
2532
2704
|
options,
|
|
2533
2705
|
className
|
|
2534
2706
|
}) {
|
|
2535
2707
|
const selectedItem = status.find((s) => s.value === value);
|
|
2536
|
-
return /* @__PURE__ */ (0,
|
|
2537
|
-
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2709
|
+
import_antd13.ConfigProvider,
|
|
2538
2710
|
{
|
|
2539
2711
|
theme: {
|
|
2540
2712
|
components: {
|
|
@@ -2549,17 +2721,17 @@ function SelectFieldStatus({
|
|
|
2549
2721
|
fontFamily: "Kanit"
|
|
2550
2722
|
}
|
|
2551
2723
|
},
|
|
2552
|
-
children: /* @__PURE__ */ (0,
|
|
2553
|
-
/* @__PURE__ */ (0,
|
|
2554
|
-
/* @__PURE__ */ (0,
|
|
2724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container-input", children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "body-1", children: label }),
|
|
2555
2727
|
" ",
|
|
2556
|
-
required && /* @__PURE__ */ (0,
|
|
2728
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2557
2729
|
] }),
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2559
|
-
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2731
|
+
import_antd13.Select,
|
|
2560
2732
|
{
|
|
2561
2733
|
disabled,
|
|
2562
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2734
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2563
2735
|
value,
|
|
2564
2736
|
onChange,
|
|
2565
2737
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2570,18 +2742,14 @@ function SelectFieldStatus({
|
|
|
2570
2742
|
showSearch: true
|
|
2571
2743
|
}
|
|
2572
2744
|
),
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2575
|
-
" ",
|
|
2576
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2577
|
-
] })
|
|
2745
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2578
2746
|
] })
|
|
2579
2747
|
}
|
|
2580
2748
|
);
|
|
2581
2749
|
}
|
|
2582
2750
|
|
|
2583
2751
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2584
|
-
var
|
|
2752
|
+
var import_antd14 = require("antd");
|
|
2585
2753
|
|
|
2586
2754
|
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
2587
2755
|
var status2 = [
|
|
@@ -2591,22 +2759,21 @@ var status2 = [
|
|
|
2591
2759
|
|
|
2592
2760
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2593
2761
|
var import_icons2 = require("@ant-design/icons");
|
|
2594
|
-
var
|
|
2762
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2595
2763
|
function SelectFieldStatusReport({
|
|
2596
2764
|
value,
|
|
2597
2765
|
onChange,
|
|
2598
2766
|
placeholder,
|
|
2599
|
-
|
|
2767
|
+
label,
|
|
2600
2768
|
required,
|
|
2601
|
-
bottomText,
|
|
2602
2769
|
disabled,
|
|
2603
2770
|
error,
|
|
2604
2771
|
className,
|
|
2605
2772
|
options
|
|
2606
2773
|
}) {
|
|
2607
2774
|
const selectedItem = status2.find((s) => s.value === value);
|
|
2608
|
-
return /* @__PURE__ */ (0,
|
|
2609
|
-
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2776
|
+
import_antd14.ConfigProvider,
|
|
2610
2777
|
{
|
|
2611
2778
|
theme: {
|
|
2612
2779
|
components: {
|
|
@@ -2621,17 +2788,17 @@ function SelectFieldStatusReport({
|
|
|
2621
2788
|
fontFamily: "Kanit"
|
|
2622
2789
|
}
|
|
2623
2790
|
},
|
|
2624
|
-
children: /* @__PURE__ */ (0,
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "container-input", children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "body-1", children: label }),
|
|
2627
2794
|
" ",
|
|
2628
|
-
required && /* @__PURE__ */ (0,
|
|
2795
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2629
2796
|
] }),
|
|
2630
|
-
/* @__PURE__ */ (0,
|
|
2631
|
-
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2798
|
+
import_antd14.Select,
|
|
2632
2799
|
{
|
|
2633
2800
|
disabled,
|
|
2634
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
2801
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2635
2802
|
value,
|
|
2636
2803
|
onChange,
|
|
2637
2804
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2642,24 +2809,19 @@ function SelectFieldStatusReport({
|
|
|
2642
2809
|
showSearch: true
|
|
2643
2810
|
}
|
|
2644
2811
|
),
|
|
2645
|
-
/* @__PURE__ */ (0,
|
|
2646
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2647
|
-
" ",
|
|
2648
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2649
|
-
] })
|
|
2812
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2650
2813
|
] })
|
|
2651
2814
|
}
|
|
2652
2815
|
);
|
|
2653
2816
|
}
|
|
2654
2817
|
|
|
2655
2818
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2656
|
-
var
|
|
2819
|
+
var import_antd15 = require("antd");
|
|
2657
2820
|
var import_react8 = require("react");
|
|
2658
|
-
var
|
|
2821
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2659
2822
|
function SelectFieldTag({
|
|
2660
|
-
|
|
2823
|
+
label,
|
|
2661
2824
|
required,
|
|
2662
|
-
bottomText,
|
|
2663
2825
|
placeholder,
|
|
2664
2826
|
options,
|
|
2665
2827
|
error,
|
|
@@ -2689,22 +2851,22 @@ function SelectFieldTag({
|
|
|
2689
2851
|
}
|
|
2690
2852
|
onChange?.([]);
|
|
2691
2853
|
};
|
|
2692
|
-
return /* @__PURE__ */ (0,
|
|
2693
|
-
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2855
|
+
import_antd15.ConfigProvider,
|
|
2694
2856
|
{
|
|
2695
2857
|
theme: {
|
|
2696
2858
|
token: {
|
|
2697
2859
|
fontFamily: "Kanit"
|
|
2698
2860
|
}
|
|
2699
2861
|
},
|
|
2700
|
-
children: /* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2702
|
-
/* @__PURE__ */ (0,
|
|
2862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "container-input", children: [
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "body-1", children: label }),
|
|
2703
2865
|
" ",
|
|
2704
|
-
required && /* @__PURE__ */ (0,
|
|
2866
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2705
2867
|
] }),
|
|
2706
|
-
/* @__PURE__ */ (0,
|
|
2707
|
-
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2869
|
+
import_antd15.Select,
|
|
2708
2870
|
{
|
|
2709
2871
|
mode: "tags",
|
|
2710
2872
|
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2722,11 +2884,7 @@ function SelectFieldTag({
|
|
|
2722
2884
|
onClear
|
|
2723
2885
|
}
|
|
2724
2886
|
),
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
2727
|
-
" ",
|
|
2728
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-red-500 ", children: error })
|
|
2729
|
-
] })
|
|
2887
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2730
2888
|
] })
|
|
2731
2889
|
}
|
|
2732
2890
|
);
|
|
@@ -2734,16 +2892,15 @@ function SelectFieldTag({
|
|
|
2734
2892
|
|
|
2735
2893
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2736
2894
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
2737
|
-
var
|
|
2895
|
+
var import_antd16 = require("antd");
|
|
2738
2896
|
var import_react9 = require("react");
|
|
2739
|
-
var
|
|
2897
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2740
2898
|
function SelectCustom({
|
|
2741
|
-
|
|
2899
|
+
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
2742
2900
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
2743
2901
|
options,
|
|
2744
2902
|
required = false,
|
|
2745
2903
|
onChange,
|
|
2746
|
-
bottomText,
|
|
2747
2904
|
error,
|
|
2748
2905
|
onClear
|
|
2749
2906
|
}) {
|
|
@@ -2766,8 +2923,8 @@ function SelectCustom({
|
|
|
2766
2923
|
});
|
|
2767
2924
|
};
|
|
2768
2925
|
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2769
|
-
return /* @__PURE__ */ (0,
|
|
2770
|
-
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2927
|
+
import_antd16.ConfigProvider,
|
|
2771
2928
|
{
|
|
2772
2929
|
theme: {
|
|
2773
2930
|
token: {
|
|
@@ -2775,14 +2932,14 @@ function SelectCustom({
|
|
|
2775
2932
|
fontSize: 16
|
|
2776
2933
|
}
|
|
2777
2934
|
},
|
|
2778
|
-
children: /* @__PURE__ */ (0,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "container-input", children: [
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "body-1", children: label }),
|
|
2781
2938
|
" ",
|
|
2782
|
-
required && /* @__PURE__ */ (0,
|
|
2939
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2783
2940
|
] }),
|
|
2784
|
-
/* @__PURE__ */ (0,
|
|
2785
|
-
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2942
|
+
import_antd16.Select,
|
|
2786
2943
|
{
|
|
2787
2944
|
value,
|
|
2788
2945
|
onChange: handleChange,
|
|
@@ -2792,20 +2949,16 @@ function SelectCustom({
|
|
|
2792
2949
|
onClear
|
|
2793
2950
|
}
|
|
2794
2951
|
),
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
|
|
2797
|
-
" ",
|
|
2798
|
-
|
|
2799
|
-
] }),
|
|
2800
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
|
|
2801
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-row gap-[8px]", children: [
|
|
2802
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("p", { children: [
|
|
2952
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-red-500 caption-1", children: error }),
|
|
2953
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-row gap-[8px]", children: [
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { children: [
|
|
2803
2956
|
index + 1,
|
|
2804
2957
|
"."
|
|
2805
2958
|
] }),
|
|
2806
|
-
/* @__PURE__ */ (0,
|
|
2959
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: v })
|
|
2807
2960
|
] }),
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react8.IconTrash, { className: "cursor-pointer", onClick: () => handleDelete(v) })
|
|
2809
2962
|
] }, index)) })
|
|
2810
2963
|
] })
|
|
2811
2964
|
}
|
|
@@ -2813,7 +2966,7 @@ function SelectCustom({
|
|
|
2813
2966
|
}
|
|
2814
2967
|
|
|
2815
2968
|
// src/SortFilter/SortFilter.tsx
|
|
2816
|
-
var
|
|
2969
|
+
var import_antd17 = require("antd");
|
|
2817
2970
|
var import_icons3 = require("@ant-design/icons");
|
|
2818
2971
|
|
|
2819
2972
|
// src/SortFilter/DataMockSortFilter.ts
|
|
@@ -2846,7 +2999,7 @@ var quarters = [
|
|
|
2846
2999
|
// src/SortFilter/SortFilter.tsx
|
|
2847
3000
|
var import_react10 = require("react");
|
|
2848
3001
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
2849
|
-
var
|
|
3002
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2850
3003
|
function SortFilter({
|
|
2851
3004
|
showYear = true,
|
|
2852
3005
|
showQuarter = true,
|
|
@@ -2857,20 +3010,20 @@ function SortFilter({
|
|
|
2857
3010
|
const [yearValue, setYearValue] = (0, import_react10.useState)();
|
|
2858
3011
|
const [monthValue, setMonthValue] = (0, import_react10.useState)();
|
|
2859
3012
|
const [quarterValue, setQuartersValue] = (0, import_react10.useState)();
|
|
2860
|
-
return /* @__PURE__ */ (0,
|
|
2861
|
-
|
|
3013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3014
|
+
import_antd17.ConfigProvider,
|
|
2862
3015
|
{
|
|
2863
3016
|
theme: {
|
|
2864
3017
|
token: {
|
|
2865
3018
|
fontFamily: "Kanit"
|
|
2866
3019
|
}
|
|
2867
3020
|
},
|
|
2868
|
-
children: /* @__PURE__ */ (0,
|
|
2869
|
-
/* @__PURE__ */ (0,
|
|
2870
|
-
showYear && /* @__PURE__ */ (0,
|
|
3021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full flex gap-[10px]", children: [
|
|
3023
|
+
showYear && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2871
3024
|
SelectField,
|
|
2872
3025
|
{
|
|
2873
|
-
prefix: /* @__PURE__ */ (0,
|
|
3026
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2874
3027
|
onChange: setYearValue,
|
|
2875
3028
|
options: years.map((s) => ({
|
|
2876
3029
|
value: s.value,
|
|
@@ -2880,10 +3033,10 @@ function SortFilter({
|
|
|
2880
3033
|
value: yearValue
|
|
2881
3034
|
}
|
|
2882
3035
|
) }),
|
|
2883
|
-
showMonth && /* @__PURE__ */ (0,
|
|
3036
|
+
showMonth && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2884
3037
|
SelectField,
|
|
2885
3038
|
{
|
|
2886
|
-
prefix: /* @__PURE__ */ (0,
|
|
3039
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2887
3040
|
onChange: setMonthValue,
|
|
2888
3041
|
options: months.map((s) => ({
|
|
2889
3042
|
value: s.value,
|
|
@@ -2893,10 +3046,10 @@ function SortFilter({
|
|
|
2893
3046
|
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2894
3047
|
}
|
|
2895
3048
|
) }),
|
|
2896
|
-
showQuarter && /* @__PURE__ */ (0,
|
|
3049
|
+
showQuarter && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2897
3050
|
SelectField,
|
|
2898
3051
|
{
|
|
2899
|
-
prefix: /* @__PURE__ */ (0,
|
|
3052
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2900
3053
|
onChange: setQuartersValue,
|
|
2901
3054
|
options: quarters.map((s) => ({
|
|
2902
3055
|
value: s.value,
|
|
@@ -2907,8 +3060,8 @@ function SortFilter({
|
|
|
2907
3060
|
}
|
|
2908
3061
|
) })
|
|
2909
3062
|
] }),
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2912
3065
|
import_icons_react9.IconSortDescending,
|
|
2913
3066
|
{
|
|
2914
3067
|
size: 24,
|
|
@@ -2916,7 +3069,7 @@ function SortFilter({
|
|
|
2916
3069
|
onClick: onSortClick
|
|
2917
3070
|
}
|
|
2918
3071
|
),
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2920
3073
|
import_icons_react9.IconFilter,
|
|
2921
3074
|
{
|
|
2922
3075
|
size: 24,
|
|
@@ -2933,7 +3086,7 @@ function SortFilter({
|
|
|
2933
3086
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2934
3087
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
2935
3088
|
var import_react11 = require("react");
|
|
2936
|
-
var
|
|
3089
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2937
3090
|
function FileUploader({
|
|
2938
3091
|
onUpload,
|
|
2939
3092
|
onError,
|
|
@@ -2966,7 +3119,7 @@ function FileUploader({
|
|
|
2966
3119
|
const handleRemoveFile = async (index) => {
|
|
2967
3120
|
try {
|
|
2968
3121
|
if (onRemove) {
|
|
2969
|
-
await onRemove();
|
|
3122
|
+
await onRemove(index);
|
|
2970
3123
|
}
|
|
2971
3124
|
const updatedList = [...fileList];
|
|
2972
3125
|
updatedList.splice(index, 1);
|
|
@@ -3004,10 +3157,10 @@ function FileUploader({
|
|
|
3004
3157
|
}
|
|
3005
3158
|
if (inputRef.current) inputRef.current.value = "";
|
|
3006
3159
|
};
|
|
3007
|
-
return /* @__PURE__ */ (0,
|
|
3008
|
-
label && /* @__PURE__ */ (0,
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3010
|
-
mode === "upload" ? /* @__PURE__ */ (0,
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "w-full", children: [
|
|
3161
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "body-1", children: label }),
|
|
3162
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
3163
|
+
mode === "upload" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3011
3164
|
"button",
|
|
3012
3165
|
{
|
|
3013
3166
|
type: "button",
|
|
@@ -3015,15 +3168,15 @@ function FileUploader({
|
|
|
3015
3168
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
3016
3169
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
3017
3170
|
disabled: disabled ? disabled : uploading,
|
|
3018
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
3019
|
-
/* @__PURE__ */ (0,
|
|
3171
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { size: 15 }),
|
|
3020
3173
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
3021
|
-
] }) : /* @__PURE__ */ (0,
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
3174
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
|
|
3023
3176
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
3024
3177
|
] })
|
|
3025
3178
|
}
|
|
3026
|
-
) : /* @__PURE__ */ (0,
|
|
3179
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3027
3180
|
"div",
|
|
3028
3181
|
{
|
|
3029
3182
|
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
@@ -3037,17 +3190,17 @@ function FileUploader({
|
|
|
3037
3190
|
},
|
|
3038
3191
|
onDragLeave: () => setDragActive(false),
|
|
3039
3192
|
onDrop: handleDrop,
|
|
3040
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3193
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex justify-center items-center gap-2", children: [
|
|
3194
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { size: 15 }),
|
|
3042
3195
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
3043
|
-
] }) : /* @__PURE__ */ (0,
|
|
3044
|
-
/* @__PURE__ */ (0,
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3196
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3197
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconUpload, { size: 20 }),
|
|
3198
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "body-1", children: "\u0E04\u0E25\u0E34\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E1A\u0E23\u0E34\u0E40\u0E27\u0E13\u0E19\u0E35\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14" }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-gray-400 body-3", children: "\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E1A\u0E1A\u0E40\u0E14\u0E35\u0E48\u0E22\u0E27\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E25\u0E32\u0E22\u0E44\u0E1F\u0E25\u0E4C" })
|
|
3047
3200
|
] })
|
|
3048
3201
|
}
|
|
3049
3202
|
),
|
|
3050
|
-
/* @__PURE__ */ (0,
|
|
3203
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3051
3204
|
"input",
|
|
3052
3205
|
{
|
|
3053
3206
|
type: "file",
|
|
@@ -3060,13 +3213,13 @@ function FileUploader({
|
|
|
3060
3213
|
}
|
|
3061
3214
|
)
|
|
3062
3215
|
] }),
|
|
3063
|
-
description && /* @__PURE__ */ (0,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3216
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-gray-400 body-4", children: description }),
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconPaperclip, { size: 15 }) }),
|
|
3220
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate", children: file.name })
|
|
3068
3221
|
] }),
|
|
3069
|
-
/* @__PURE__ */ (0,
|
|
3222
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3070
3223
|
import_icons_react10.IconTrash,
|
|
3071
3224
|
{
|
|
3072
3225
|
size: 20,
|
|
@@ -3100,9 +3253,9 @@ function messageLoading(content, duration) {
|
|
|
3100
3253
|
}
|
|
3101
3254
|
|
|
3102
3255
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
3103
|
-
var import_antd17 = require("antd");
|
|
3104
3256
|
var import_antd18 = require("antd");
|
|
3105
|
-
var
|
|
3257
|
+
var import_antd19 = require("antd");
|
|
3258
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3106
3259
|
function Breadcrumbs({
|
|
3107
3260
|
items,
|
|
3108
3261
|
separator,
|
|
@@ -3110,16 +3263,16 @@ function Breadcrumbs({
|
|
|
3110
3263
|
classname,
|
|
3111
3264
|
params
|
|
3112
3265
|
}) {
|
|
3113
|
-
return /* @__PURE__ */ (0,
|
|
3114
|
-
|
|
3266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3267
|
+
import_antd18.ConfigProvider,
|
|
3115
3268
|
{
|
|
3116
3269
|
theme: {
|
|
3117
3270
|
token: {
|
|
3118
3271
|
fontFamily: "Kanit"
|
|
3119
3272
|
}
|
|
3120
3273
|
},
|
|
3121
|
-
children: /* @__PURE__ */ (0,
|
|
3122
|
-
|
|
3274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3275
|
+
import_antd19.Breadcrumb,
|
|
3123
3276
|
{
|
|
3124
3277
|
items,
|
|
3125
3278
|
separator,
|
|
@@ -3133,8 +3286,8 @@ function Breadcrumbs({
|
|
|
3133
3286
|
}
|
|
3134
3287
|
|
|
3135
3288
|
// src/HeadingPage/HeadingPage.tsx
|
|
3136
|
-
var
|
|
3137
|
-
var
|
|
3289
|
+
var import_antd20 = require("antd");
|
|
3290
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3138
3291
|
function HeadingPage({ Heading }) {
|
|
3139
3292
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
3140
3293
|
weekday: "long",
|
|
@@ -3142,17 +3295,17 @@ function HeadingPage({ Heading }) {
|
|
|
3142
3295
|
month: "long",
|
|
3143
3296
|
year: "numeric"
|
|
3144
3297
|
});
|
|
3145
|
-
return /* @__PURE__ */ (0,
|
|
3146
|
-
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3299
|
+
import_antd20.ConfigProvider,
|
|
3147
3300
|
{
|
|
3148
3301
|
theme: {
|
|
3149
3302
|
token: {
|
|
3150
3303
|
fontFamily: "Kanit"
|
|
3151
3304
|
}
|
|
3152
3305
|
},
|
|
3153
|
-
children: /* @__PURE__ */ (0,
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "headline-5", children: Heading }),
|
|
3308
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "body-1", children: [
|
|
3156
3309
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
3157
3310
|
today
|
|
3158
3311
|
] })
|
|
@@ -3162,9 +3315,9 @@ function HeadingPage({ Heading }) {
|
|
|
3162
3315
|
}
|
|
3163
3316
|
|
|
3164
3317
|
// src/Progress/ProgressBar.tsx
|
|
3165
|
-
var
|
|
3318
|
+
var import_antd21 = require("antd");
|
|
3166
3319
|
var import_react12 = require("react");
|
|
3167
|
-
var
|
|
3320
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3168
3321
|
function ProgressBar({
|
|
3169
3322
|
percent = 0,
|
|
3170
3323
|
size = "default",
|
|
@@ -3187,9 +3340,7 @@ function ProgressBar({
|
|
|
3187
3340
|
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
3188
3341
|
}
|
|
3189
3342
|
(0, import_react12.useEffect)(() => {
|
|
3190
|
-
const inner = progressRef.current?.querySelector(
|
|
3191
|
-
".ant-progress-inner"
|
|
3192
|
-
);
|
|
3343
|
+
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
3193
3344
|
if (!inner) return;
|
|
3194
3345
|
const observer = new ResizeObserver(() => {
|
|
3195
3346
|
setBarWidth(inner.offsetWidth);
|
|
@@ -3197,17 +3348,17 @@ function ProgressBar({
|
|
|
3197
3348
|
observer.observe(inner);
|
|
3198
3349
|
return () => observer.disconnect();
|
|
3199
3350
|
}, []);
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3201
|
-
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3352
|
+
import_antd21.ConfigProvider,
|
|
3202
3353
|
{
|
|
3203
3354
|
theme: {
|
|
3204
3355
|
token: {
|
|
3205
3356
|
fontFamily: "Kanit"
|
|
3206
3357
|
}
|
|
3207
3358
|
},
|
|
3208
|
-
children: /* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3210
|
-
|
|
3359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3360
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3361
|
+
import_antd21.Progress,
|
|
3211
3362
|
{
|
|
3212
3363
|
className: "w-full",
|
|
3213
3364
|
percent,
|
|
@@ -3222,7 +3373,7 @@ function ProgressBar({
|
|
|
3222
3373
|
strokeColor
|
|
3223
3374
|
}
|
|
3224
3375
|
),
|
|
3225
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0,
|
|
3376
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3226
3377
|
"div",
|
|
3227
3378
|
{
|
|
3228
3379
|
className: "checkpoint absolute top-0",
|
|
@@ -3244,7 +3395,7 @@ function ProgressBar({
|
|
|
3244
3395
|
}
|
|
3245
3396
|
|
|
3246
3397
|
// src/KpiSection/KpiSection.tsx
|
|
3247
|
-
var
|
|
3398
|
+
var import_antd22 = require("antd");
|
|
3248
3399
|
var import_react14 = require("react");
|
|
3249
3400
|
|
|
3250
3401
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
@@ -3395,7 +3546,7 @@ function useGetKpiSection() {
|
|
|
3395
3546
|
|
|
3396
3547
|
// src/KpiSection/KpiSection.tsx
|
|
3397
3548
|
var import_icons_react11 = require("@tabler/icons-react");
|
|
3398
|
-
var
|
|
3549
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3399
3550
|
function KpiSection({ type, onChangeKpiList }) {
|
|
3400
3551
|
const {
|
|
3401
3552
|
handleAddKpi,
|
|
@@ -3415,7 +3566,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3415
3566
|
itemErrors,
|
|
3416
3567
|
setItemErrors
|
|
3417
3568
|
} = useGetKpiSection();
|
|
3418
|
-
const [messageApi2, messageContainer] =
|
|
3569
|
+
const [messageApi2, messageContainer] = import_antd22.message.useMessage();
|
|
3419
3570
|
const [hasShownError, setHasShownError] = (0, import_react14.useState)(false);
|
|
3420
3571
|
(0, import_react14.useEffect)(() => {
|
|
3421
3572
|
setMessageApi(messageApi2);
|
|
@@ -3425,8 +3576,8 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3425
3576
|
onChangeKpiList(kpiList);
|
|
3426
3577
|
}
|
|
3427
3578
|
}, [kpiList]);
|
|
3428
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
-
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3580
|
+
import_antd22.ConfigProvider,
|
|
3430
3581
|
{
|
|
3431
3582
|
theme: {
|
|
3432
3583
|
token: {
|
|
@@ -3434,15 +3585,15 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3434
3585
|
fontSize: 16
|
|
3435
3586
|
}
|
|
3436
3587
|
},
|
|
3437
|
-
children: /* @__PURE__ */ (0,
|
|
3588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "container-input", children: [
|
|
3438
3589
|
messageContainer,
|
|
3439
|
-
type === "number" && /* @__PURE__ */ (0,
|
|
3440
|
-
/* @__PURE__ */ (0,
|
|
3441
|
-
/* @__PURE__ */ (0,
|
|
3590
|
+
type === "number" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-4", children: [
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3442
3593
|
InputField,
|
|
3443
3594
|
{
|
|
3444
3595
|
value: nameKpi,
|
|
3445
|
-
|
|
3596
|
+
label: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3446
3597
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3447
3598
|
required: true,
|
|
3448
3599
|
onChange: (value) => setNameKpi(value ?? ""),
|
|
@@ -3450,11 +3601,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3450
3601
|
error: errors.nameKpi
|
|
3451
3602
|
}
|
|
3452
3603
|
),
|
|
3453
|
-
/* @__PURE__ */ (0,
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3454
3605
|
InputField,
|
|
3455
3606
|
{
|
|
3456
3607
|
value: kpiValue,
|
|
3457
|
-
|
|
3608
|
+
label: "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3458
3609
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3459
3610
|
required: true,
|
|
3460
3611
|
onChange: (value) => {
|
|
@@ -3474,11 +3625,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3474
3625
|
error: errors.kpiValue
|
|
3475
3626
|
}
|
|
3476
3627
|
),
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3478
3629
|
InputField,
|
|
3479
3630
|
{
|
|
3480
3631
|
value: unitValue,
|
|
3481
|
-
|
|
3632
|
+
label: "\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3482
3633
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3483
3634
|
required: true,
|
|
3484
3635
|
onChange: (value) => setUnitValue(value ?? ""),
|
|
@@ -3486,7 +3637,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3486
3637
|
error: errors.unitValue
|
|
3487
3638
|
}
|
|
3488
3639
|
),
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3490
3641
|
import_icons_react11.IconCirclePlus,
|
|
3491
3642
|
{
|
|
3492
3643
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3495,17 +3646,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3495
3646
|
}
|
|
3496
3647
|
) })
|
|
3497
3648
|
] }),
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3499
3650
|
"div",
|
|
3500
3651
|
{
|
|
3501
3652
|
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3502
3653
|
children: [
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3504
3655
|
index + 1,
|
|
3505
3656
|
"."
|
|
3506
3657
|
] }),
|
|
3507
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3658
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3659
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3509
3660
|
InputField,
|
|
3510
3661
|
{
|
|
3511
3662
|
value: kpi.name,
|
|
@@ -3515,7 +3666,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3515
3666
|
error: itemErrors[kpi.id]?.name
|
|
3516
3667
|
}
|
|
3517
3668
|
),
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3519
3670
|
InputField,
|
|
3520
3671
|
{
|
|
3521
3672
|
value: kpi.value?.toString(),
|
|
@@ -3540,7 +3691,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3540
3691
|
error: itemErrors[kpi.id]?.value
|
|
3541
3692
|
}
|
|
3542
3693
|
),
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3694
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3544
3695
|
InputField,
|
|
3545
3696
|
{
|
|
3546
3697
|
value: kpi.unit,
|
|
@@ -3550,29 +3701,29 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3550
3701
|
error: itemErrors[kpi.id]?.unit
|
|
3551
3702
|
}
|
|
3552
3703
|
),
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3554
3705
|
"div",
|
|
3555
3706
|
{
|
|
3556
3707
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3557
3708
|
children: [
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3559
3710
|
import_icons_react11.IconCheck,
|
|
3560
3711
|
{
|
|
3561
3712
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3562
3713
|
onClick: () => handleSave(kpi.id, type)
|
|
3563
3714
|
}
|
|
3564
3715
|
),
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3566
3717
|
]
|
|
3567
3718
|
}
|
|
3568
3719
|
)
|
|
3569
|
-
] }) : /* @__PURE__ */ (0,
|
|
3570
|
-
/* @__PURE__ */ (0,
|
|
3571
|
-
/* @__PURE__ */ (0,
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3574
|
-
/* @__PURE__ */ (0,
|
|
3575
|
-
/* @__PURE__ */ (0,
|
|
3720
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3721
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3722
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.value }),
|
|
3723
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.unit }),
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3725
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3576
3727
|
] })
|
|
3577
3728
|
] })
|
|
3578
3729
|
]
|
|
@@ -3580,13 +3731,13 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3580
3731
|
kpi.id
|
|
3581
3732
|
)) })
|
|
3582
3733
|
] }),
|
|
3583
|
-
type === "text" && /* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
3734
|
+
type === "text" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-4", children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3586
3737
|
InputField,
|
|
3587
3738
|
{
|
|
3588
3739
|
value: nameKpi,
|
|
3589
|
-
|
|
3740
|
+
label: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3590
3741
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3591
3742
|
required: true,
|
|
3592
3743
|
onChange: (value) => setNameKpi(value ?? ""),
|
|
@@ -3594,7 +3745,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3594
3745
|
error: errors.nameKpi
|
|
3595
3746
|
}
|
|
3596
3747
|
),
|
|
3597
|
-
/* @__PURE__ */ (0,
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3598
3749
|
import_icons_react11.IconCirclePlus,
|
|
3599
3750
|
{
|
|
3600
3751
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3603,13 +3754,13 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3603
3754
|
}
|
|
3604
3755
|
) })
|
|
3605
3756
|
] }),
|
|
3606
|
-
/* @__PURE__ */ (0,
|
|
3607
|
-
/* @__PURE__ */ (0,
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]", children: [
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3608
3759
|
index + 1,
|
|
3609
3760
|
"."
|
|
3610
3761
|
] }),
|
|
3611
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3612
|
-
/* @__PURE__ */ (0,
|
|
3762
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3613
3764
|
InputField,
|
|
3614
3765
|
{
|
|
3615
3766
|
value: kpi.name,
|
|
@@ -3619,27 +3770,27 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3619
3770
|
error: itemErrors[kpi.id]?.name
|
|
3620
3771
|
}
|
|
3621
3772
|
),
|
|
3622
|
-
/* @__PURE__ */ (0,
|
|
3773
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3623
3774
|
"div",
|
|
3624
3775
|
{
|
|
3625
3776
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3626
3777
|
children: [
|
|
3627
|
-
/* @__PURE__ */ (0,
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3628
3779
|
import_icons_react11.IconCheck,
|
|
3629
3780
|
{
|
|
3630
3781
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3631
3782
|
onClick: () => handleSave(kpi.id, type)
|
|
3632
3783
|
}
|
|
3633
3784
|
),
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3635
3786
|
]
|
|
3636
3787
|
}
|
|
3637
3788
|
)
|
|
3638
|
-
] }) : /* @__PURE__ */ (0,
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
3641
|
-
/* @__PURE__ */ (0,
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3789
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3643
3794
|
] })
|
|
3644
3795
|
] })
|
|
3645
3796
|
] }, kpi.id)) })
|
|
@@ -3648,8 +3799,241 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3648
3799
|
}
|
|
3649
3800
|
);
|
|
3650
3801
|
}
|
|
3802
|
+
|
|
3803
|
+
// src/Modal/Modal/Modal.tsx
|
|
3804
|
+
var import_antd23 = require("antd");
|
|
3805
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3806
|
+
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_antd23.Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children }) }) });
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
// src/Indicator/Indicator/Indicator.tsx
|
|
3811
|
+
var import_icons_react12 = require("@tabler/icons-react");
|
|
3812
|
+
var import_react15 = require("react");
|
|
3813
|
+
var import_antd24 = require("antd");
|
|
3814
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3815
|
+
function Indicator({
|
|
3816
|
+
option = [
|
|
3817
|
+
{ value: "TEXT", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3818
|
+
{ value: "NUMBER", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
3819
|
+
],
|
|
3820
|
+
type,
|
|
3821
|
+
arrayData,
|
|
3822
|
+
setArrayData
|
|
3823
|
+
}) {
|
|
3824
|
+
const [valueSwitch, setValueSwitch] = (0, import_react15.useState)("TEXT");
|
|
3825
|
+
const [cacheData, setCacheData] = (0, import_react15.useState)({
|
|
3826
|
+
indicatorType: type,
|
|
3827
|
+
inputType: valueSwitch,
|
|
3828
|
+
textValue: "",
|
|
3829
|
+
numberValue: "",
|
|
3830
|
+
unit: ""
|
|
3831
|
+
});
|
|
3832
|
+
const [cacheEditData, setCacheEditData] = (0, import_react15.useState)({
|
|
3833
|
+
indicatorType: type,
|
|
3834
|
+
inputType: valueSwitch,
|
|
3835
|
+
textValue: "",
|
|
3836
|
+
numberValue: "",
|
|
3837
|
+
unit: ""
|
|
3838
|
+
});
|
|
3839
|
+
const [editIndex, setEditIndex] = (0, import_react15.useState)(null);
|
|
3840
|
+
const handleAddIndicator = () => {
|
|
3841
|
+
if (cacheData.textValue.trim() === "") return;
|
|
3842
|
+
setArrayData([
|
|
3843
|
+
...arrayData,
|
|
3844
|
+
valueSwitch === "TEXT" ? {
|
|
3845
|
+
indicatorType: type,
|
|
3846
|
+
inputType: "TEXT",
|
|
3847
|
+
textValue: cacheData.textValue
|
|
3848
|
+
} : cacheData
|
|
3849
|
+
]);
|
|
3850
|
+
setCacheData({
|
|
3851
|
+
indicatorType: type,
|
|
3852
|
+
inputType: valueSwitch,
|
|
3853
|
+
textValue: "",
|
|
3854
|
+
numberValue: "",
|
|
3855
|
+
unit: ""
|
|
3856
|
+
});
|
|
3857
|
+
};
|
|
3858
|
+
const handleChangeCashData = (key, value) => {
|
|
3859
|
+
setCacheData((prev) => ({
|
|
3860
|
+
...prev,
|
|
3861
|
+
[key]: value
|
|
3862
|
+
}));
|
|
3863
|
+
console.log(cacheData);
|
|
3864
|
+
};
|
|
3865
|
+
const handleClick = (active) => {
|
|
3866
|
+
handleChangeCashData("inputType", active);
|
|
3867
|
+
setValueSwitch(active);
|
|
3868
|
+
};
|
|
3869
|
+
const handleDeleteIndicator = (index) => {
|
|
3870
|
+
const newData = arrayData.filter((_, i) => i !== index);
|
|
3871
|
+
setArrayData(newData);
|
|
3872
|
+
setEditIndex(null);
|
|
3873
|
+
};
|
|
3874
|
+
const handleEditIndicator = (index) => {
|
|
3875
|
+
setCacheEditData(arrayData[index]);
|
|
3876
|
+
setEditIndex(index);
|
|
3877
|
+
};
|
|
3878
|
+
const handleCancelEditIndicator = () => {
|
|
3879
|
+
setEditIndex(null);
|
|
3880
|
+
};
|
|
3881
|
+
const handleConfirmEditIndicator = (index) => {
|
|
3882
|
+
if (cacheEditData.textValue.trim() === "") return;
|
|
3883
|
+
const newData = [...arrayData];
|
|
3884
|
+
newData[index] = cacheEditData;
|
|
3885
|
+
setArrayData(newData);
|
|
3886
|
+
setEditIndex(null);
|
|
3887
|
+
};
|
|
3888
|
+
const handleChangeEditCashData = (e) => {
|
|
3889
|
+
const { name, value } = e.target;
|
|
3890
|
+
setCacheEditData((prev) => ({
|
|
3891
|
+
...prev,
|
|
3892
|
+
[name]: value
|
|
3893
|
+
}));
|
|
3894
|
+
console.log(cacheEditData);
|
|
3895
|
+
};
|
|
3896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "w-full", children: [
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3898
|
+
"div",
|
|
3899
|
+
{
|
|
3900
|
+
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3901
|
+
children: [
|
|
3902
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SwitchSelect, { option, onClick: handleClick, value: valueSwitch, label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17", required: true }),
|
|
3903
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3904
|
+
InputField,
|
|
3905
|
+
{
|
|
3906
|
+
label: `\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3907
|
+
value: cacheData.textValue,
|
|
3908
|
+
className: "h-[32px]",
|
|
3909
|
+
onChange: (e) => handleChangeCashData("textValue", String(e)),
|
|
3910
|
+
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3911
|
+
required: true
|
|
3912
|
+
}
|
|
3913
|
+
),
|
|
3914
|
+
valueSwitch === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3916
|
+
InputFieldNumber,
|
|
3917
|
+
{
|
|
3918
|
+
label: `\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3919
|
+
value: cacheData.numberValue ?? "",
|
|
3920
|
+
className: "h-[32px]",
|
|
3921
|
+
onChange: (e) => handleChangeCashData("numberValue", String(e)),
|
|
3922
|
+
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3923
|
+
required: true
|
|
3924
|
+
}
|
|
3925
|
+
),
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3927
|
+
InputField,
|
|
3928
|
+
{
|
|
3929
|
+
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
3930
|
+
value: cacheData.unit ?? "",
|
|
3931
|
+
className: "h-[32px]",
|
|
3932
|
+
onChange: (e) => handleChangeCashData("unit", String(e)),
|
|
3933
|
+
placeholder: "\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3934
|
+
required: true
|
|
3935
|
+
}
|
|
3936
|
+
)
|
|
3937
|
+
] }),
|
|
3938
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconCirclePlus, { onClick: handleAddIndicator, className: "mt-7 cursor-pointer", size: 32 })
|
|
3939
|
+
]
|
|
3940
|
+
}
|
|
3941
|
+
),
|
|
3942
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: arrayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3943
|
+
"div",
|
|
3944
|
+
{
|
|
3945
|
+
className: `space-y-4 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3946
|
+
children: [
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3948
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3949
|
+
import_antd24.Input,
|
|
3950
|
+
{
|
|
3951
|
+
className: "body-1 mt-2",
|
|
3952
|
+
variant: "underlined",
|
|
3953
|
+
value: cacheEditData.textValue,
|
|
3954
|
+
name: "textValue",
|
|
3955
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3956
|
+
}
|
|
3957
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3958
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
3959
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3960
|
+
import_antd24.Input,
|
|
3961
|
+
{
|
|
3962
|
+
className: "body-1 mt-2",
|
|
3963
|
+
variant: "underlined",
|
|
3964
|
+
value: cacheEditData.numberValue,
|
|
3965
|
+
name: "numberValue",
|
|
3966
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3967
|
+
}
|
|
3968
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3969
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3970
|
+
import_antd24.Input,
|
|
3971
|
+
{
|
|
3972
|
+
className: "body-1 mt-2",
|
|
3973
|
+
variant: "underlined",
|
|
3974
|
+
value: cacheEditData.unit,
|
|
3975
|
+
name: "unit",
|
|
3976
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3977
|
+
}
|
|
3978
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.unit })
|
|
3979
|
+
] }),
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex", children: [
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3982
|
+
import_icons_react12.IconCheck,
|
|
3983
|
+
{
|
|
3984
|
+
className: "cursor-pointer text-green-600",
|
|
3985
|
+
onClick: () => handleConfirmEditIndicator(index)
|
|
3986
|
+
}
|
|
3987
|
+
),
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconX, { className: "cursor-pointer text-red-600", onClick: handleCancelEditIndicator })
|
|
3989
|
+
] }) : void 0 : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconPencil, { className: "cursor-pointer", onClick: () => handleEditIndicator(index) }) }),
|
|
3990
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconTrash, { onClick: () => handleDeleteIndicator(index) }) })
|
|
3991
|
+
]
|
|
3992
|
+
}
|
|
3993
|
+
)) })
|
|
3994
|
+
] });
|
|
3995
|
+
}
|
|
3996
|
+
|
|
3997
|
+
// src/FilterPopUp/FilterPopUp.tsx
|
|
3998
|
+
var import_icons_react13 = require("@tabler/icons-react");
|
|
3999
|
+
var import_react16 = require("react");
|
|
4000
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4001
|
+
var FilterPopUp = (filter) => {
|
|
4002
|
+
const [isAction, setIsAction] = (0, import_react16.useState)(true);
|
|
4003
|
+
const [filterArray, setFilterArray] = (0, import_react16.useState)([""]);
|
|
4004
|
+
const handleClearFilter = () => {
|
|
4005
|
+
setFilterArray([]);
|
|
4006
|
+
};
|
|
4007
|
+
const handleSubmitFilter = () => {
|
|
4008
|
+
filter.handleSearch(filterArray);
|
|
4009
|
+
};
|
|
4010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative", children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", { className: "flex px-2 py-1 rounded-lg border-1", onClick: () => setIsAction(!isAction), children: [
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconFilter, {}),
|
|
4013
|
+
"filter"
|
|
4014
|
+
] }),
|
|
4015
|
+
isAction ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "absolute bg-white p-5 rounded-lg shadow-2xl w-[600px]", children: [
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-end", children: [
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-end text-nowrap gap-2", children: [
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(GhostButton, { title: "\u0E43\u0E0A\u0E49\u0E1F\u0E34\u0E25\u0E40\u0E15\u0E2D\u0E23\u0E4C", onClick: handleSubmitFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconCheck, {}) }),
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(GhostButton, { title: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", onClick: handleClearFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconTrash, {}) })
|
|
4020
|
+
] }),
|
|
4021
|
+
""
|
|
4022
|
+
] }),
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4024
|
+
SelectCustom,
|
|
4025
|
+
{
|
|
4026
|
+
options: filter.selectionFilter,
|
|
4027
|
+
onChange: (list) => setFilterArray(list),
|
|
4028
|
+
label: "\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01"
|
|
4029
|
+
}
|
|
4030
|
+
)
|
|
4031
|
+
] }) : void 0
|
|
4032
|
+
] });
|
|
4033
|
+
};
|
|
3651
4034
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3652
4035
|
0 && (module.exports = {
|
|
4036
|
+
AntDModal,
|
|
3653
4037
|
AntDataTable,
|
|
3654
4038
|
Breadcrumbs,
|
|
3655
4039
|
Calendar,
|
|
@@ -3661,9 +4045,12 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3661
4045
|
DatePickerBasic,
|
|
3662
4046
|
DatePickerRangePicker,
|
|
3663
4047
|
FileUploader,
|
|
4048
|
+
FilterPopUp,
|
|
3664
4049
|
GhostButton,
|
|
3665
4050
|
HeadingPage,
|
|
4051
|
+
Indicator,
|
|
3666
4052
|
InputField,
|
|
4053
|
+
InputFieldNumber,
|
|
3667
4054
|
KpiSection,
|
|
3668
4055
|
Loader,
|
|
3669
4056
|
MenuNavBar,
|
|
@@ -3681,6 +4068,8 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3681
4068
|
Sidebar,
|
|
3682
4069
|
SortFilter,
|
|
3683
4070
|
Switch,
|
|
4071
|
+
SwitchSelect,
|
|
4072
|
+
TabSelectionButton,
|
|
3684
4073
|
TextAreaInput,
|
|
3685
4074
|
TextInput,
|
|
3686
4075
|
TimePickerBasic,
|