nexaas-ui-components 1.0.35 → 1.0.37

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React4 = require('react');
3
+ var React5 = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var clsx9 = require('clsx');
6
6
  var datetime2 = require('@blueprintjs/datetime2');
@@ -42,7 +42,7 @@ function _interopNamespace(e) {
42
42
  return Object.freeze(n);
43
43
  }
44
44
 
45
- var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
45
+ var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
46
46
  var clsx9__default = /*#__PURE__*/_interopDefault(clsx9);
47
47
  var IntlCurrencyInputRaw__default = /*#__PURE__*/_interopDefault(IntlCurrencyInputRaw);
48
48
  var lodashNamespace__namespace = /*#__PURE__*/_interopNamespace(lodashNamespace);
@@ -169,7 +169,7 @@ var Button = ({
169
169
  const appliedSize = sizes[size];
170
170
  const appliedPadding = props.icon ? paddingConfig[size].icon : paddingConfig[size].normal;
171
171
  const gapText = applyGap ? "gap-[6px]" : "gap-0";
172
- React4.useEffect(() => {
172
+ React5.useEffect(() => {
173
173
  if (!hotkey || !props.onClick) return;
174
174
  const handleKeyDown = (event) => {
175
175
  var _a;
@@ -229,7 +229,13 @@ var Button = ({
229
229
  "div",
230
230
  {
231
231
  className: `flex items-center justify-center ${appliedSize.icon}`,
232
- children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, { className: "animate-spin w-4 h-4" })
232
+ children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsxRuntime.jsx(
233
+ SpinnerIcon,
234
+ {
235
+ className: "animate-spin w-4 h-4",
236
+ fill: "currentColor"
237
+ }
238
+ )
233
239
  }
234
240
  ),
235
241
  props.children,
@@ -314,7 +320,7 @@ var variants2 = {
314
320
  text: "shadow-button rounded-3xl border border-blue-700 text-blue-500 bg-blue-100 shadow-button hover:bg-blue-700 hover:text-white active:text-white active:bg-blue-900 active:border-blue-900 focus:text-white focus:bg-blue-900 focus:border-blue-900"
315
321
  }
316
322
  };
317
- var ButtonLink = React4.forwardRef(
323
+ var ButtonLink = React5.forwardRef(
318
324
  ({
319
325
  size = "md",
320
326
  icon,
@@ -332,7 +338,7 @@ var ButtonLink = React4.forwardRef(
332
338
  }, ref) => {
333
339
  var _a;
334
340
  const applyGap = icon;
335
- React4.useEffect(() => {
341
+ React5.useEffect(() => {
336
342
  if (!hotkey) return;
337
343
  const handleKeyDown = (event) => {
338
344
  var _a2;
@@ -440,13 +446,14 @@ var Input = ({
440
446
  }) => {
441
447
  const fieldValidationMessages = [error == null ? void 0 : error.message];
442
448
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
449
+ const [showPassword, setShowPassword] = React5__namespace.default.useState(false);
443
450
  const styles = {
444
451
  input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
445
452
  ${!hasError ? "border-neutral-300" : ""}`,
446
453
  icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${hasError ? "text-dangerous-500" : "text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,
447
454
  rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
448
455
  label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",
449
- clear: "absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]",
456
+ clear: "absolute top-[8.3px] cursor-pointer text-label text-[22px]",
450
457
  error: "border-dangerous-500 text-dangerous-500"
451
458
  };
452
459
  const inlineStyles = {
@@ -460,7 +467,7 @@ var Input = ({
460
467
  "input",
461
468
  {
462
469
  id: name,
463
- type,
470
+ type: type === "password" ? showPassword ? "text" : "password" : type,
464
471
  name,
465
472
  value,
466
473
  defaultValue,
@@ -518,15 +525,26 @@ var Input = ({
518
525
  ]
519
526
  }
520
527
  ),
521
- clearField && value && value !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
528
+ type === "password" && /* @__PURE__ */ jsxRuntime.jsx(
522
529
  "i",
523
530
  {
531
+ onClick: () => setShowPassword(!showPassword),
524
532
  className: clsx9__default.default(
533
+ " text-label cursor-pointer text-[20px] absolute right-2 top-[11px]",
525
534
  {
526
- [styles.clear]: true
527
- },
528
- "uil uil-times clear-icon"
529
- ),
535
+ "uil-eye-slash": showPassword,
536
+ "uil-eye": !showPassword
537
+ }
538
+ )
539
+ }
540
+ ),
541
+ clearField && value && value !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
542
+ "i",
543
+ {
544
+ className: clsx9__default.default(styles.clear, "uil uil-times clear-icon", {
545
+ "right-9": type === "password",
546
+ "right-2": type !== "password"
547
+ }),
530
548
  onClick: () => {
531
549
  if (input) {
532
550
  input == null ? void 0 : input.focus();
@@ -647,7 +665,7 @@ var useFieldErrorsStore = zustand.create(
647
665
  }))
648
666
  })
649
667
  );
650
- var DatePickerInput = React4.forwardRef(
668
+ var DatePickerInput = React5.forwardRef(
651
669
  ({
652
670
  icon,
653
671
  label,
@@ -668,12 +686,12 @@ var DatePickerInput = React4.forwardRef(
668
686
  popoverOffset
669
687
  }, ref) => {
670
688
  var _a;
671
- const [invalidDate, setInvalidDate] = React4.useState(false);
672
- const [showCalendar, setShowCalendar] = React4.useState(false);
673
- const [inputWidth, setInputWidth] = React4.useState(0);
674
- const inputContainerRef = React4.useRef(null);
689
+ const [invalidDate, setInvalidDate] = React5.useState(false);
690
+ const [showCalendar, setShowCalendar] = React5.useState(false);
691
+ const [inputWidth, setInputWidth] = React5.useState(0);
692
+ const inputContainerRef = React5.useRef(null);
675
693
  const dateFnsFormat = "dd/MM/yyyy";
676
- React4.useEffect(() => {
694
+ React5.useEffect(() => {
677
695
  const updateWidth = () => {
678
696
  if (inputContainerRef.current) {
679
697
  setInputWidth(inputContainerRef.current.offsetWidth + 10);
@@ -1154,8 +1172,8 @@ var FilterCalendar = ({
1154
1172
  filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
1155
1173
  filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
1156
1174
  };
1157
- const [currentValue, setCurrentValue] = React4.useState([]);
1158
- const [calendarLabel, setCalendarLabel] = React4.useState("");
1175
+ const [currentValue, setCurrentValue] = React5.useState([]);
1176
+ const [calendarLabel, setCalendarLabel] = React5.useState("");
1159
1177
  const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
1160
1178
  const shorcuts = [
1161
1179
  {
@@ -1316,7 +1334,7 @@ var FilterCalendar = ({
1316
1334
  ]
1317
1335
  }
1318
1336
  ];
1319
- const [selectedShortcut, setSelectedShortcut] = React4.useState(
1337
+ const [selectedShortcut, setSelectedShortcut] = React5.useState(
1320
1338
  defaultShortcut || shorcuts[0]
1321
1339
  );
1322
1340
  const calendar = /* @__PURE__ */ jsxRuntime.jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -1455,7 +1473,7 @@ var FilterCalendar = ({
1455
1473
  setCurrentValue(field.value);
1456
1474
  close();
1457
1475
  };
1458
- React4.useEffect(() => {
1476
+ React5.useEffect(() => {
1459
1477
  setCurrentValue(field.value);
1460
1478
  }, [open]);
1461
1479
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -1531,7 +1549,7 @@ function InputSmall({
1531
1549
  onClear,
1532
1550
  collapsed
1533
1551
  }) {
1534
- const inputRef = React4.useRef(null);
1552
+ const inputRef = React5.useRef(null);
1535
1553
  const styles = {
1536
1554
  input: `text-p-md text-paragraph w-full outline-none placeholder:text-label`,
1537
1555
  icon: "text-label group-focus-within:text-neutral-600 m-[10px]",
@@ -1614,13 +1632,13 @@ var FilterOptions = ({
1614
1632
  filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
1615
1633
  filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
1616
1634
  };
1617
- const [currentValue, setCurrentValue] = React4.useState(isMulti ? [] : {});
1618
- const [data, setData] = React4.useState(() => options);
1619
- const [filter, setFilter] = React4.useState("");
1620
- const [subFilter, setSubFilter] = React4.useState(
1635
+ const [currentValue, setCurrentValue] = React5.useState(isMulti ? [] : {});
1636
+ const [data, setData] = React5.useState(() => options);
1637
+ const [filter, setFilter] = React5.useState("");
1638
+ const [subFilter, setSubFilter] = React5.useState(
1621
1639
  (subFilters == null ? void 0 : subFilters.length) > 0 ? subFilters[0].id : null
1622
1640
  );
1623
- const [loading, setLoading] = React4.useState(false);
1641
+ const [loading, setLoading] = React5.useState(false);
1624
1642
  const search = async () => {
1625
1643
  if ((filter == null ? void 0 : filter.length) > 0 || (options == null ? void 0 : options.length) > 0) {
1626
1644
  if (fetch) {
@@ -1643,7 +1661,7 @@ var FilterOptions = ({
1643
1661
  }
1644
1662
  setLoading(false);
1645
1663
  };
1646
- React4.useEffect(() => {
1664
+ React5.useEffect(() => {
1647
1665
  setLoading(true);
1648
1666
  const timeout = setTimeout(() => {
1649
1667
  search();
@@ -1656,7 +1674,7 @@ var FilterOptions = ({
1656
1674
  {
1657
1675
  disabled: option.disabled,
1658
1676
  value: option,
1659
- as: React4.Fragment,
1677
+ as: React5.Fragment,
1660
1678
  children: /* @__PURE__ */ jsxRuntime.jsxs(
1661
1679
  "div",
1662
1680
  {
@@ -1787,7 +1805,7 @@ var FilterOptions = ({
1787
1805
  setCurrentValue(field.value);
1788
1806
  close();
1789
1807
  };
1790
- React4.useEffect(() => {
1808
+ React5.useEffect(() => {
1791
1809
  setCurrentValue(field.value);
1792
1810
  }, [open]);
1793
1811
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -2120,13 +2138,13 @@ function InputNumber({
2120
2138
  buttonsWrapper: "absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",
2121
2139
  button: "border-[0.5px] border-neutral-300 rounded shadow-input h-4 w-4 flex items-center justify-center"
2122
2140
  };
2123
- const [debouncedCount, setDebouncedCount] = React4.useState(0);
2141
+ const [debouncedCount, setDebouncedCount] = React5.useState(0);
2124
2142
  const save = () => {
2125
2143
  if (onBlur) {
2126
2144
  onBlur(value);
2127
2145
  }
2128
2146
  };
2129
- const updateCount = React4.useMemo(() => {
2147
+ const updateCount = React5.useMemo(() => {
2130
2148
  return debounce_default(() => {
2131
2149
  save();
2132
2150
  }, 1e3);
@@ -2431,7 +2449,7 @@ var MaskedInput = ({
2431
2449
  defaultValue,
2432
2450
  disabled
2433
2451
  }) => {
2434
- const ref = React4.useRef(null);
2452
+ const ref = React5.useRef(null);
2435
2453
  return /* @__PURE__ */ jsxRuntime.jsx(
2436
2454
  reactHookForm.Controller,
2437
2455
  {
@@ -2546,7 +2564,7 @@ var ModalDialog = ({
2546
2564
  zIndex: 9999
2547
2565
  }
2548
2566
  };
2549
- const trigger = triggerButton ? React4.cloneElement(triggerButton, {
2567
+ const trigger = triggerButton ? React5.cloneElement(triggerButton, {
2550
2568
  onClick: () => {
2551
2569
  onOpen();
2552
2570
  }
@@ -2776,13 +2794,13 @@ var SelectField = ({
2776
2794
  }) => {
2777
2795
  var _a;
2778
2796
  const { Option, DropdownIndicator, ClearIndicator, SingleValue } = Select.components;
2779
- const selectRef = React4.useRef(null);
2780
- const [inputValue, setInputValue] = React4.useState("");
2781
- const [loading, setLoading] = React4.useState(false);
2782
- const [options, setOptions] = React4.useState(() => optionsList || []);
2783
- const [availableHeight, setAvailableHeight] = React4.useState(300);
2784
- const [isFocused, setIsFocused] = React4.useState(false);
2785
- React4.useEffect(() => {
2797
+ const selectRef = React5.useRef(null);
2798
+ const [inputValue, setInputValue] = React5.useState("");
2799
+ const [loading, setLoading] = React5.useState(false);
2800
+ const [options, setOptions] = React5.useState(() => optionsList || []);
2801
+ const [availableHeight, setAvailableHeight] = React5.useState(300);
2802
+ const [isFocused, setIsFocused] = React5.useState(false);
2803
+ React5.useEffect(() => {
2786
2804
  const updateAvailableHeight = () => {
2787
2805
  var _a2, _b;
2788
2806
  if ((_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.getBoundingClientRect) {
@@ -2830,7 +2848,7 @@ var SelectField = ({
2830
2848
  const hasIcon = {
2831
2849
  hasIcon: icon
2832
2850
  };
2833
- React4.useEffect(() => {
2851
+ React5.useEffect(() => {
2834
2852
  setOptions(() => optionsList);
2835
2853
  }, [optionsList]);
2836
2854
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3137,7 +3155,7 @@ var customStyles2 = {
3137
3155
  margin: "none"
3138
3156
  })
3139
3157
  };
3140
- var SelectFieldBip = React4.forwardRef(({
3158
+ var SelectFieldBip = React5.forwardRef(({
3141
3159
  name,
3142
3160
  label,
3143
3161
  error,
@@ -3164,11 +3182,11 @@ var SelectFieldBip = React4.forwardRef(({
3164
3182
  }, ref) => {
3165
3183
  var _a;
3166
3184
  const { Option, SingleValue } = Select.components;
3167
- const selectRef = React4.useRef(null);
3168
- const [inputValue, setInputValue] = React4.useState("");
3169
- const [loading, setLoading] = React4.useState(false);
3170
- const [cachedOptions, setCachedOptions] = React4.useState([]);
3171
- React4.useImperativeHandle(ref, () => ({
3185
+ const selectRef = React5.useRef(null);
3186
+ const [inputValue, setInputValue] = React5.useState("");
3187
+ const [loading, setLoading] = React5.useState(false);
3188
+ const [cachedOptions, setCachedOptions] = React5.useState([]);
3189
+ React5.useImperativeHandle(ref, () => ({
3172
3190
  focus: () => {
3173
3191
  var _a2;
3174
3192
  return (_a2 = selectRef.current) == null ? void 0 : _a2.focus();
@@ -3210,12 +3228,12 @@ var SelectFieldBip = React4.forwardRef(({
3210
3228
  hasIcon: icon
3211
3229
  };
3212
3230
  const iconStyle = `z-[70] absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] rounded-l-lg flex justify-center items-center w-[38px] text-[22px] ${hasError.hasError ? "text-dangerous-500" : "text-label"}`;
3213
- const debouncedFetchOptions = React4.useMemo(() => {
3231
+ const debouncedFetchOptions = React5.useMemo(() => {
3214
3232
  return debounce_default((value, callback) => {
3215
3233
  fetchOptions(value).then(callback);
3216
3234
  }, 300);
3217
3235
  }, [filterOptions]);
3218
- React4.useEffect(() => {
3236
+ React5.useEffect(() => {
3219
3237
  return () => {
3220
3238
  debouncedFetchOptions.cancel();
3221
3239
  };
@@ -3539,22 +3557,22 @@ function PaginationSelect({
3539
3557
  id: index,
3540
3558
  name: index
3541
3559
  }));
3542
- const [pageSizeSelected, setPageSizeSelected] = React4.useState({
3560
+ const [pageSizeSelected, setPageSizeSelected] = React5.useState({
3543
3561
  id: ((_a = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a.id) || 20,
3544
3562
  name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
3545
3563
  });
3546
- const [pageSelected, setPageSelected] = React4.useState({
3564
+ const [pageSelected, setPageSelected] = React5.useState({
3547
3565
  id: ((_d = (_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageIndex) || 0,
3548
3566
  name: ((_f = (_e = table == null ? void 0 : table.getState()) == null ? void 0 : _e.pagination) == null ? void 0 : _f.pageIndex) || 0
3549
3567
  });
3550
- const [pagesOptions, setPagesOptions] = React4.useState(() => options);
3551
- const [pageSizesOptions, setPagesSizesOptions] = React4.useState(
3568
+ const [pagesOptions, setPagesOptions] = React5.useState(() => options);
3569
+ const [pageSizesOptions, setPagesSizesOptions] = React5.useState(
3552
3570
  pageSizeOptions == null ? void 0 : pageSizeOptions.map((item) => ({
3553
3571
  id: item,
3554
3572
  name: item
3555
3573
  }))
3556
3574
  );
3557
- const [query, setQuery] = React4.useState("");
3575
+ const [query, setQuery] = React5.useState("");
3558
3576
  const filter = () => {
3559
3577
  let copy = [...options];
3560
3578
  setPagesOptions(
@@ -3566,10 +3584,10 @@ function PaginationSelect({
3566
3584
  const saveSessionStorage = (key, values) => {
3567
3585
  sessionStorage.setItem(key, JSON.stringify(values));
3568
3586
  };
3569
- React4.useEffect(() => {
3587
+ React5.useEffect(() => {
3570
3588
  filter();
3571
3589
  }, [query]);
3572
- React4.useEffect(() => {
3590
+ React5.useEffect(() => {
3573
3591
  saveSessionStorage("pageSize", pageSizeSelected);
3574
3592
  table.setPageSize(pageSizeSelected == null ? void 0 : pageSizeSelected.id);
3575
3593
  table.setPageIndex(0);
@@ -3578,7 +3596,7 @@ function PaginationSelect({
3578
3596
  name: 0
3579
3597
  });
3580
3598
  }, [pageSizeSelected]);
3581
- React4.useEffect(() => {
3599
+ React5.useEffect(() => {
3582
3600
  setPagesOptions(
3583
3601
  pageCount ? [...Array(pageCount)].map((item, index) => ({
3584
3602
  id: index,
@@ -3586,7 +3604,7 @@ function PaginationSelect({
3586
3604
  })) : []
3587
3605
  );
3588
3606
  }, [table == null ? void 0 : table.getPageCount()]);
3589
- React4.useEffect(() => {
3607
+ React5.useEffect(() => {
3590
3608
  var _a2, _b2, _c2, _d2, _e2, _f2;
3591
3609
  if (((_b2 = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
3592
3610
  setPageSelected({
@@ -3711,7 +3729,7 @@ function PaginationSelect({
3711
3729
  ] })
3712
3730
  ] });
3713
3731
  }
3714
- var Table = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3732
+ var Table = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3715
3733
  "table",
3716
3734
  {
3717
3735
  ref,
@@ -3724,7 +3742,7 @@ var Table = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @_
3724
3742
  }
3725
3743
  ));
3726
3744
  Table.displayName = "Table";
3727
- var TableHeader = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3745
+ var TableHeader = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3728
3746
  "thead",
3729
3747
  {
3730
3748
  ref,
@@ -3733,9 +3751,9 @@ var TableHeader = React4__namespace.forwardRef(({ className, ...props }, ref) =>
3733
3751
  }
3734
3752
  ));
3735
3753
  TableHeader.displayName = "TableHeader";
3736
- var TableBody = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx9.clsx(className), ...props }));
3754
+ var TableBody = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx9.clsx(className), ...props }));
3737
3755
  TableBody.displayName = "TableBody";
3738
- var TableFooter = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3756
+ var TableFooter = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3739
3757
  "div",
3740
3758
  {
3741
3759
  ref,
@@ -3747,9 +3765,9 @@ var TableFooter = React4__namespace.forwardRef(({ className, ...props }, ref) =>
3747
3765
  }
3748
3766
  ));
3749
3767
  TableFooter.displayName = "TableFooter";
3750
- var TableRow = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx9.clsx(className), ...props }));
3768
+ var TableRow = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx9.clsx(className), ...props }));
3751
3769
  TableRow.displayName = "TableRow";
3752
- var TableHead = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3770
+ var TableHead = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3753
3771
  "th",
3754
3772
  {
3755
3773
  ref,
@@ -3764,7 +3782,7 @@ var TableHead = React4__namespace.forwardRef(({ className, ...props }, ref) => /
3764
3782
  }
3765
3783
  ));
3766
3784
  TableHead.displayName = "TableHead";
3767
- var TableCell = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3785
+ var TableCell = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3768
3786
  "td",
3769
3787
  {
3770
3788
  ref,
@@ -3776,7 +3794,7 @@ var TableCell = React4__namespace.forwardRef(({ className, ...props }, ref) => /
3776
3794
  }
3777
3795
  ));
3778
3796
  TableCell.displayName = "TableCell";
3779
- var TableCaption = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3797
+ var TableCaption = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
3780
3798
  "caption",
3781
3799
  {
3782
3800
  ref,
@@ -3889,7 +3907,7 @@ function DataTablePagination({
3889
3907
  pagesArray.map((elem, index) => {
3890
3908
  const checkPageIndexLimit = index <= limitPagePositive && index >= limitPageNegative;
3891
3909
  const isSelectedPage = index === selectedPage;
3892
- return /* @__PURE__ */ jsxRuntime.jsx(React4.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
3910
+ return /* @__PURE__ */ jsxRuntime.jsx(React5.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
3893
3911
  Button,
3894
3912
  {
3895
3913
  onClick: () => table.setPageIndex(index),
@@ -3999,22 +4017,22 @@ function DataTable({
3999
4017
  onFinishFetch
4000
4018
  }) {
4001
4019
  var _a, _b, _c, _d, _e, _f;
4002
- const tableRef = React4.useRef(null);
4003
- const [columnVisibility, setColumnVisibility] = React4.useState({});
4004
- const [columnFilters, setColumnFilters] = React4.useState([]);
4005
- const [sorting, setSorting] = React4.useState([]);
4006
- const [arrRowSelected, setArrRowSelected] = React4.useState([]);
4007
- const [globalFilter, setGlobalFilter] = React4.useState("");
4008
- const [dataTable, setDataTable] = React4.useState([]);
4009
- const [loading, setLoading] = React4.useState(true);
4010
- const [expanded, setExpanded] = React4.useState({});
4011
- const [total, setTotal] = React4.useState(() => totalData);
4012
- const [{ pageIndex, pageSize }, setPagination] = React4.useState({
4020
+ const tableRef = React5.useRef(null);
4021
+ const [columnVisibility, setColumnVisibility] = React5.useState({});
4022
+ const [columnFilters, setColumnFilters] = React5.useState([]);
4023
+ const [sorting, setSorting] = React5.useState([]);
4024
+ const [arrRowSelected, setArrRowSelected] = React5.useState([]);
4025
+ const [globalFilter, setGlobalFilter] = React5.useState("");
4026
+ const [dataTable, setDataTable] = React5.useState([]);
4027
+ const [loading, setLoading] = React5.useState(true);
4028
+ const [expanded, setExpanded] = React5.useState({});
4029
+ const [total, setTotal] = React5.useState(() => totalData);
4030
+ const [{ pageIndex, pageSize }, setPagination] = React5.useState({
4013
4031
  pageIndex: 0,
4014
4032
  pageSize: hidePagination ? 999999 : perPage ? perPage : 20
4015
4033
  });
4016
- const [paginationScroll, setPaginationScroll] = React4.useState();
4017
- const pagination = React4.useMemo(
4034
+ const [paginationScroll, setPaginationScroll] = React5.useState();
4035
+ const pagination = React5.useMemo(
4018
4036
  () => ({
4019
4037
  pageIndex,
4020
4038
  pageSize
@@ -4069,7 +4087,7 @@ function DataTable({
4069
4087
  pageCount: Number(pageSize2)
4070
4088
  };
4071
4089
  };
4072
- React4.useEffect(() => {
4090
+ React5.useEffect(() => {
4073
4091
  if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
4074
4092
  const resizeObserver = new ResizeObserver(() => {
4075
4093
  var _a2;
@@ -4078,12 +4096,12 @@ function DataTable({
4078
4096
  resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
4079
4097
  return () => resizeObserver.disconnect();
4080
4098
  }, []);
4081
- React4.useEffect(() => {
4099
+ React5.useEffect(() => {
4082
4100
  if (fetchData || autoPagination) {
4083
4101
  fetch();
4084
4102
  }
4085
4103
  }, [pageIndex, pageSize, sorting]);
4086
- React4.useEffect(() => {
4104
+ React5.useEffect(() => {
4087
4105
  if (totalData !== total) {
4088
4106
  setPagination({
4089
4107
  pageIndex: 0,
@@ -4092,7 +4110,7 @@ function DataTable({
4092
4110
  setTotal(totalData);
4093
4111
  }
4094
4112
  }, [totalData]);
4095
- React4.useEffect(() => {
4113
+ React5.useEffect(() => {
4096
4114
  if (data) {
4097
4115
  setDataTable(
4098
4116
  () => autoPagination ? data.slice(0, pageSize) : data
@@ -4139,7 +4157,7 @@ function DataTable({
4139
4157
  getRowStyles: rowClassName
4140
4158
  }
4141
4159
  });
4142
- React4.useEffect(() => {
4160
+ React5.useEffect(() => {
4143
4161
  if (enableRowSelection && rowSelection) {
4144
4162
  setArrRowSelected(Object.keys(rowSelection));
4145
4163
  }
@@ -4192,7 +4210,7 @@ function DataTable({
4192
4210
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4193
4211
  }
4194
4212
  }
4195
- React4.useEffect(() => {
4213
+ React5.useEffect(() => {
4196
4214
  if (rowSelection && Object.keys(rowSelection).length == 0) {
4197
4215
  const elements = document.getElementsByClassName("th-shadow");
4198
4216
  Object.keys(elements).forEach((index) => {
@@ -4297,7 +4315,7 @@ function DataTable({
4297
4315
  );
4298
4316
  }) }, headerGroup.id + headerIndex + "header")) }),
4299
4317
  /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: (_f = (_e = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _e.rows) == null ? void 0 : _f.map((row, rowIndex) => {
4300
- return /* @__PURE__ */ jsxRuntime.jsx(React4__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React4__namespace.default.Fragment, { children: [
4318
+ return /* @__PURE__ */ jsxRuntime.jsx(React5__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.default.Fragment, { children: [
4301
4319
  /* @__PURE__ */ jsxRuntime.jsx(
4302
4320
  TableRow,
4303
4321
  {
@@ -4351,7 +4369,7 @@ function DataTable({
4351
4369
  ] });
4352
4370
  }
4353
4371
  var Accordion = ({ title, children, open = false }) => {
4354
- const [isOpen, setOpen] = React4.useState(open);
4372
+ const [isOpen, setOpen] = React5.useState(open);
4355
4373
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
4356
4374
  "div",
4357
4375
  {
@@ -4411,7 +4429,7 @@ var Accordion = ({ title, children, open = false }) => {
4411
4429
  ) });
4412
4430
  };
4413
4431
  function CopyPopover({ children, valueToCopy }) {
4414
- const [copied, setCopied] = React4.useState(false);
4432
+ const [copied, setCopied] = React5.useState(false);
4415
4433
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4416
4434
  "div",
4417
4435
  {
@@ -4464,7 +4482,7 @@ var Menu = ({ triggerElement, children, className }) => {
4464
4482
  /* @__PURE__ */ jsxRuntime.jsx(
4465
4483
  react.Transition,
4466
4484
  {
4467
- as: React4.Fragment,
4485
+ as: React5.Fragment,
4468
4486
  enter: "transition ease-out duration-200",
4469
4487
  enterFrom: "transform opacity-0 scale-95",
4470
4488
  enterTo: "transform opacity-100 scale-100",
@@ -4507,7 +4525,7 @@ var EditableButton = ({
4507
4525
  button,
4508
4526
  onClose
4509
4527
  }) => {
4510
- const [showModal, setShowModal] = React4.useState(false);
4528
+ const [showModal, setShowModal] = React5.useState(false);
4511
4529
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative", children: [
4512
4530
  /* @__PURE__ */ jsxRuntime.jsx(
4513
4531
  "div",
@@ -4555,7 +4573,7 @@ var EditableText = ({
4555
4573
  hideEditIcon,
4556
4574
  truncate
4557
4575
  }) => {
4558
- const [showModal, setShowModal] = React4.useState(false);
4576
+ const [showModal, setShowModal] = React5.useState(false);
4559
4577
  const truncateText = (str, max, len) => {
4560
4578
  return str.length > max ? str.substring(0, len) + "..." : str;
4561
4579
  };
@@ -4657,9 +4675,9 @@ var EditableTextSelect = ({
4657
4675
  showInputSeach,
4658
4676
  onChangeValue
4659
4677
  }) => {
4660
- const [showModal, setShowModal] = React4.useState(false);
4661
- const [optionsList, setOptionsList] = React4.useState(() => options);
4662
- const [inputSearch, setInputSearch] = React4.useState("");
4678
+ const [showModal, setShowModal] = React5.useState(false);
4679
+ const [optionsList, setOptionsList] = React5.useState(() => options);
4680
+ const [inputSearch, setInputSearch] = React5.useState("");
4663
4681
  const optionsFuse = {
4664
4682
  includeScore: false,
4665
4683
  keys: ["name"]
@@ -4673,10 +4691,10 @@ var EditableTextSelect = ({
4673
4691
  }
4674
4692
  setOptionsList(results);
4675
4693
  };
4676
- React4.useEffect(() => {
4694
+ React5.useEffect(() => {
4677
4695
  setOptionsList(() => options);
4678
4696
  }, [options]);
4679
- React4.useEffect(() => {
4697
+ React5.useEffect(() => {
4680
4698
  filter();
4681
4699
  }, [inputSearch]);
4682
4700
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4797,7 +4815,7 @@ var EditableTextSelect = ({
4797
4815
  );
4798
4816
  };
4799
4817
  function ImagePreview({ open, setOpen, previewImage }) {
4800
- return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show: open, as: React4.Fragment, children: /* @__PURE__ */ jsxRuntime.jsxs(
4818
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show: open, as: React5.Fragment, children: /* @__PURE__ */ jsxRuntime.jsxs(
4801
4819
  react.Dialog,
4802
4820
  {
4803
4821
  as: "div",
@@ -4807,7 +4825,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
4807
4825
  /* @__PURE__ */ jsxRuntime.jsx(
4808
4826
  react.Transition.Child,
4809
4827
  {
4810
- as: React4.Fragment,
4828
+ as: React5.Fragment,
4811
4829
  enter: "ease-out duration-300",
4812
4830
  enterFrom: "opacity-0",
4813
4831
  enterTo: "opacity-100",
@@ -4820,7 +4838,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
4820
4838
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-10 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
4821
4839
  react.Transition.Child,
4822
4840
  {
4823
- as: React4.Fragment,
4841
+ as: React5.Fragment,
4824
4842
  enter: "ease-out duration-300",
4825
4843
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
4826
4844
  enterTo: "opacity-100 translate-y-0 sm:scale-100",
@@ -4876,8 +4894,8 @@ var FileStatus = ({
4876
4894
  ) });
4877
4895
  };
4878
4896
  var ImageFile = ({ isLoading, name, size, onRemove, image }) => {
4879
- const [imagePreviewModal, setImagePreviewModal] = React4.useState(false);
4880
- const [previewImage, setPreviewImage] = React4.useState();
4897
+ const [imagePreviewModal, setImagePreviewModal] = React5.useState(false);
4898
+ const [previewImage, setPreviewImage] = React5.useState();
4881
4899
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "group h-[130px] w-[130px] flex justify-between border border-neutral-300 rounded-[8px]", children: !isLoading && image ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative", children: [
4882
4900
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden group-hover:block absolute top-3 left-3", children: [
4883
4901
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5091,15 +5109,15 @@ var FileUpload = ({
5091
5109
  limitMessage
5092
5110
  }) => {
5093
5111
  var _a;
5094
- const [state, dispatch] = React4.useReducer(reducer, initialState);
5095
- const [dragging, setDragging] = React4.useState(false);
5096
- const [loading, setLoading] = React4.useState(false);
5112
+ const [state, dispatch] = React5.useReducer(reducer, initialState);
5113
+ const [dragging, setDragging] = React5.useState(false);
5114
+ const [loading, setLoading] = React5.useState(false);
5097
5115
  const { readString } = reactPapaparse.usePapaParse();
5098
5116
  const fieldValidationMessages = [error == null ? void 0 : error.message];
5099
5117
  const hasError = {
5100
5118
  hasError: fieldValidationMessages.some((item) => item !== void 0)
5101
5119
  };
5102
- React4.useEffect(() => {
5120
+ React5.useEffect(() => {
5103
5121
  var _a2;
5104
5122
  if ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.some((file) => file.loading === true)) {
5105
5123
  setLoading(true);
@@ -5107,12 +5125,12 @@ var FileUpload = ({
5107
5125
  setLoading(false);
5108
5126
  }
5109
5127
  }, [state == null ? void 0 : state.files]);
5110
- React4.useEffect(() => {
5128
+ React5.useEffect(() => {
5111
5129
  if (!files || files.length == 0) {
5112
5130
  state.files = [];
5113
5131
  }
5114
5132
  }, [files]);
5115
- React4.useEffect(() => {
5133
+ React5.useEffect(() => {
5116
5134
  var _a2;
5117
5135
  if (!multiple && ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.length) === 0 || multiple) {
5118
5136
  window.addEventListener("dragover", handleDragOver);
@@ -5724,7 +5742,7 @@ var InputTag = ({
5724
5742
  placeholder,
5725
5743
  blockSpaces = false
5726
5744
  }) => {
5727
- const [inputValue, setInputValue] = React4.useState("");
5745
+ const [inputValue, setInputValue] = React5.useState("");
5728
5746
  const fieldValidationMessages = [error == null ? void 0 : error.message];
5729
5747
  const hasError = {
5730
5748
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -5954,8 +5972,8 @@ var MultiSelectBottom = ({
5954
5972
  filterOptions,
5955
5973
  debounce: debounce2 = 0
5956
5974
  }) => {
5957
- const [loading, setLoading] = React4.useState(false);
5958
- const [optionsList, setOptionsList] = React4.useState(() => options || []);
5975
+ const [loading, setLoading] = React5.useState(false);
5976
+ const [optionsList, setOptionsList] = React5.useState(() => options || []);
5959
5977
  const fieldValidationMessages = [error == null ? void 0 : error.message];
5960
5978
  const hasError = {
5961
5979
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -6187,7 +6205,7 @@ var ProgressBar = ({
6187
6205
  variant = "primary",
6188
6206
  status
6189
6207
  }) => {
6190
- const [barPercentage, setBarPercentage] = React4.useState(() => fixPercentage());
6208
+ const [barPercentage, setBarPercentage] = React5.useState(() => fixPercentage());
6191
6209
  function fixPercentage() {
6192
6210
  if (percentage > 100) {
6193
6211
  return 100;
@@ -6195,7 +6213,7 @@ var ProgressBar = ({
6195
6213
  return percentage;
6196
6214
  }
6197
6215
  }
6198
- React4.useEffect(() => {
6216
+ React5.useEffect(() => {
6199
6217
  setBarPercentage(fixPercentage());
6200
6218
  }, [percentage]);
6201
6219
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-[2px] min-w-[170px]", children: [
@@ -6217,7 +6235,7 @@ var ProgressBar = ({
6217
6235
  ] });
6218
6236
  };
6219
6237
  function SimpleTab({ tabs, onClick }) {
6220
- const [currentTab, setCurrentTab] = React4.useState(0);
6238
+ const [currentTab, setCurrentTab] = React5.useState(0);
6221
6239
  function isCurrentTab(index) {
6222
6240
  return index === currentTab;
6223
6241
  }
@@ -6475,7 +6493,7 @@ var Tabs = ({
6475
6493
  onSave,
6476
6494
  showNextStep = true
6477
6495
  }) => {
6478
- const [selectedTab, setSelectedTab] = React4.useState(0);
6496
+ const [selectedTab, setSelectedTab] = React5.useState(0);
6479
6497
  const ShowSaveButton = saveButton ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: saveButton }) : /* @__PURE__ */ jsxRuntime.jsx(
6480
6498
  Button,
6481
6499
  {
@@ -6596,7 +6614,7 @@ var TextArea = ({
6596
6614
  inputProps,
6597
6615
  name
6598
6616
  }) => {
6599
- const inputRef = React4.useRef(null);
6617
+ const inputRef = React5.useRef(null);
6600
6618
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6601
6619
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
6602
6620
  const styles = {
@@ -6743,7 +6761,7 @@ function ControlledInput({
6743
6761
  control,
6744
6762
  searchOnClick
6745
6763
  }) {
6746
- let inputRef = React4.useRef(null);
6764
+ let inputRef = React5.useRef(null);
6747
6765
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6748
6766
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
6749
6767
  const styles = {