nexaas-ui-components 1.0.90 → 1.0.91

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 React5 = require('react');
3
+ var React6 = 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 React5__namespace = /*#__PURE__*/_interopNamespace(React5);
45
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
46
46
  var clsx9__default = /*#__PURE__*/_interopDefault(clsx9);
47
47
  var IntlCurrencyInputRaw__default = /*#__PURE__*/_interopDefault(IntlCurrencyInputRaw);
48
48
  var lodashNamespace__namespace = /*#__PURE__*/_interopNamespace(lodashNamespace);
@@ -263,7 +263,7 @@ var Button = ({
263
263
  const neutralShadow = NEUTRAL_BORDERED_VARIANTS.has(variant) ? size === "lg" ? SHADOW_SM_NEUTRAL : SHADOW_XS_NEUTRAL : "";
264
264
  const appliedPadding = props.icon ? props.children ? paddingConfig[size].icon : paddingConfig[size].iconOnly : paddingConfig[size].normal;
265
265
  const gapText = applyGap ? appliedSize.gap : "gap-0";
266
- React5.useEffect(() => {
266
+ React6.useEffect(() => {
267
267
  if (!hotkey || !props.onClick) return;
268
268
  const handleKeyDown = (event) => {
269
269
  var _a, _b;
@@ -426,7 +426,7 @@ var variants2 = {
426
426
  text: "shadow-button rounded-3xl border border-blue-700 text-blue-500 bg-blue-100 shadow-button hover:bg-blue-700 hover:text-accent-label active:text-accent-label active:bg-blue-900 active:border-blue-900 focus:text-accent-label focus:bg-blue-900 focus:border-blue-900"
427
427
  }
428
428
  };
429
- var ButtonLink = React5.forwardRef(
429
+ var ButtonLink = React6.forwardRef(
430
430
  ({
431
431
  size = "md",
432
432
  icon,
@@ -445,7 +445,7 @@ var ButtonLink = React5.forwardRef(
445
445
  }, ref) => {
446
446
  var _a;
447
447
  const applyGap = icon;
448
- React5.useEffect(() => {
448
+ React6.useEffect(() => {
449
449
  if (!hotkey) return;
450
450
  const handleKeyDown = (event) => {
451
451
  var _a2;
@@ -574,7 +574,7 @@ var Input = ({
574
574
  }) => {
575
575
  const fieldValidationMessages = [error == null ? void 0 : error.message];
576
576
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
577
- const [showPassword, setShowPassword] = React5__namespace.default.useState(false);
577
+ const [showPassword, setShowPassword] = React6__namespace.default.useState(false);
578
578
  const styles = {
579
579
  // Sem `focus-visible:rounded-*`: o anel de foco tem que seguir o mesmo raio do campo
580
580
  // (`rounded-lg`) — reduzir pra 2px no foco deixava o anel quadrado sobre um campo arredondado.
@@ -795,7 +795,7 @@ var useFieldErrorsStore = zustand.create(
795
795
  }))
796
796
  })
797
797
  );
798
- var DatePickerInput = React5.forwardRef(
798
+ var DatePickerInput = React6.forwardRef(
799
799
  ({
800
800
  icon,
801
801
  label,
@@ -816,9 +816,9 @@ var DatePickerInput = React5.forwardRef(
816
816
  popoverOffset
817
817
  }, ref) => {
818
818
  var _a;
819
- const [invalidDate, setInvalidDate] = React5.useState(false);
820
- const [showCalendar, setShowCalendar] = React5.useState(false);
821
- const inputContainerRef = React5.useRef(null);
819
+ const [invalidDate, setInvalidDate] = React6.useState(false);
820
+ const [showCalendar, setShowCalendar] = React6.useState(false);
821
+ const inputContainerRef = React6.useRef(null);
822
822
  const dateFnsFormat = "dd/MM/yyyy";
823
823
  const fieldValidation = useFieldErrorsStore((state) => state.field);
824
824
  const fieldValidationMessages = [
@@ -1342,7 +1342,7 @@ var FilterCalendar = ({
1342
1342
  labelClassName,
1343
1343
  clearButton = true
1344
1344
  }) => {
1345
- const [currentValue, setCurrentValue] = React5.useState([]);
1345
+ const [currentValue, setCurrentValue] = React6.useState([]);
1346
1346
  const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
1347
1347
  const shorcuts = [
1348
1348
  {
@@ -1503,10 +1503,10 @@ var FilterCalendar = ({
1503
1503
  ]
1504
1504
  }
1505
1505
  ];
1506
- const [selectedShortcut, setSelectedShortcut] = React5.useState(
1506
+ const [selectedShortcut, setSelectedShortcut] = React6.useState(
1507
1507
  defaultShortcut || shorcuts[0]
1508
1508
  );
1509
- const [calendarLabel, setCalendarLabel] = React5.useState(
1509
+ const [calendarLabel, setCalendarLabel] = React6.useState(
1510
1510
  defaultShortcut != null && shorcuts[defaultShortcut] ? shorcuts[defaultShortcut].label : ""
1511
1511
  );
1512
1512
  const calendar = /* @__PURE__ */ jsxRuntime.jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -1644,7 +1644,7 @@ var FilterCalendar = ({
1644
1644
  setCurrentValue(field.value);
1645
1645
  close();
1646
1646
  };
1647
- React5.useEffect(() => {
1647
+ React6.useEffect(() => {
1648
1648
  setCurrentValue(field.value);
1649
1649
  }, [open]);
1650
1650
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -1715,7 +1715,7 @@ function InputSmall({
1715
1715
  onClear,
1716
1716
  collapsed
1717
1717
  }) {
1718
- const inputRef = React5.useRef(null);
1718
+ const inputRef = React6.useRef(null);
1719
1719
  const styles = {
1720
1720
  input: `text-p-md text-paragraph w-full outline-none placeholder:text-label disabled:text-disabled disabled:cursor-not-allowed bg-transparent`,
1721
1721
  icon: "text-label group-focus-within:text-neutral-600 m-[10px]",
@@ -1809,13 +1809,13 @@ var FilterOptions = ({
1809
1809
  filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
1810
1810
  filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-accent-label active:text-accent-label active:bg-blue-600 active:border-blue-600"
1811
1811
  };
1812
- const [currentValue, setCurrentValue] = React5.useState(isMulti ? [] : {});
1813
- const [data, setData] = React5.useState(() => options);
1814
- const [filter, setFilter] = React5.useState("");
1815
- const [subFilter, setSubFilter] = React5.useState(
1812
+ const [currentValue, setCurrentValue] = React6.useState(isMulti ? [] : {});
1813
+ const [data, setData] = React6.useState(() => options);
1814
+ const [filter, setFilter] = React6.useState("");
1815
+ const [subFilter, setSubFilter] = React6.useState(
1816
1816
  (subFilters == null ? void 0 : subFilters.length) > 0 ? subFilters[0].id : null
1817
1817
  );
1818
- const [loading, setLoading] = React5.useState(false);
1818
+ const [loading, setLoading] = React6.useState(false);
1819
1819
  const search = async () => {
1820
1820
  if ((filter == null ? void 0 : filter.length) > 0 || (options == null ? void 0 : options.length) > 0) {
1821
1821
  if (fetch) {
@@ -1838,7 +1838,7 @@ var FilterOptions = ({
1838
1838
  }
1839
1839
  setLoading(false);
1840
1840
  };
1841
- React5.useEffect(() => {
1841
+ React6.useEffect(() => {
1842
1842
  setLoading(true);
1843
1843
  const timeout = setTimeout(() => {
1844
1844
  search();
@@ -1851,7 +1851,7 @@ var FilterOptions = ({
1851
1851
  {
1852
1852
  disabled: option.disabled,
1853
1853
  value: option,
1854
- as: React5.Fragment,
1854
+ as: React6.Fragment,
1855
1855
  children: renderOption ? /* @__PURE__ */ jsxRuntime.jsx(
1856
1856
  "div",
1857
1857
  {
@@ -2013,7 +2013,7 @@ var FilterOptions = ({
2013
2013
  setCurrentValue(field.value);
2014
2014
  close();
2015
2015
  };
2016
- React5.useEffect(() => {
2016
+ React6.useEffect(() => {
2017
2017
  setCurrentValue(field.value);
2018
2018
  }, [open]);
2019
2019
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -2198,13 +2198,13 @@ var FilterSelect = ({
2198
2198
  selectAllLabel = "Marcar todos",
2199
2199
  clearButton = true
2200
2200
  }) => {
2201
- const [currentValue, setCurrentValue] = React5.useState(isMulti ? [] : {});
2202
- const [data, setData] = React5.useState(() => options);
2203
- const [filter, setFilter] = React5.useState("");
2204
- const [subFilter, setSubFilter] = React5.useState(
2201
+ const [currentValue, setCurrentValue] = React6.useState(isMulti ? [] : {});
2202
+ const [data, setData] = React6.useState(() => options);
2203
+ const [filter, setFilter] = React6.useState("");
2204
+ const [subFilter, setSubFilter] = React6.useState(
2205
2205
  (subFilters == null ? void 0 : subFilters.length) > 0 ? subFilters[0].id : null
2206
2206
  );
2207
- const [loading, setLoading] = React5.useState(false);
2207
+ const [loading, setLoading] = React6.useState(false);
2208
2208
  const search = async () => {
2209
2209
  if ((filter == null ? void 0 : filter.length) > 0 || (options == null ? void 0 : options.length) > 0) {
2210
2210
  if (fetch) {
@@ -2227,7 +2227,7 @@ var FilterSelect = ({
2227
2227
  }
2228
2228
  setLoading(false);
2229
2229
  };
2230
- React5.useEffect(() => {
2230
+ React6.useEffect(() => {
2231
2231
  setLoading(true);
2232
2232
  const timeout = setTimeout(() => {
2233
2233
  search();
@@ -2240,7 +2240,7 @@ var FilterSelect = ({
2240
2240
  {
2241
2241
  disabled: option.disabled,
2242
2242
  value: option,
2243
- as: React5.Fragment,
2243
+ as: React6.Fragment,
2244
2244
  children: renderOption ? /* @__PURE__ */ jsxRuntime.jsx(
2245
2245
  "div",
2246
2246
  {
@@ -2382,7 +2382,7 @@ var FilterSelect = ({
2382
2382
  setCurrentValue(field.value);
2383
2383
  close();
2384
2384
  };
2385
- React5.useEffect(() => {
2385
+ React6.useEffect(() => {
2386
2386
  setCurrentValue(field.value);
2387
2387
  }, [open]);
2388
2388
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -2714,13 +2714,13 @@ function InputNumber({
2714
2714
  buttonsWrapper: "absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",
2715
2715
  button: `border-[0.5px] border-neutral-300 rounded shadow-[0px_1px_1px_rgba(56,61,77,0.1)] h-4 w-4 flex items-center justify-center ${disabled ? "bg-neutral-100" : "bg-surface"}`
2716
2716
  };
2717
- const [debouncedCount, setDebouncedCount] = React5.useState(0);
2717
+ const [debouncedCount, setDebouncedCount] = React6.useState(0);
2718
2718
  const save = () => {
2719
2719
  if (onBlur) {
2720
2720
  onBlur(value);
2721
2721
  }
2722
2722
  };
2723
- const updateCount = React5.useMemo(() => {
2723
+ const updateCount = React6.useMemo(() => {
2724
2724
  return debounce_default(() => {
2725
2725
  save();
2726
2726
  }, 1e3);
@@ -3025,7 +3025,7 @@ var MaskedInput = ({
3025
3025
  defaultValue,
3026
3026
  disabled
3027
3027
  }) => {
3028
- const ref = React5.useRef(null);
3028
+ const ref = React6.useRef(null);
3029
3029
  return /* @__PURE__ */ jsxRuntime.jsx(
3030
3030
  reactHookForm.Controller,
3031
3031
  {
@@ -3124,6 +3124,7 @@ var ModalDialog = ({
3124
3124
  headerBorder = false,
3125
3125
  closeOnOverlayClick = true
3126
3126
  }) => {
3127
+ var _a;
3127
3128
  const customStyles6 = {
3128
3129
  content: {
3129
3130
  top: "50%",
@@ -3144,7 +3145,8 @@ var ModalDialog = ({
3144
3145
  zIndex: 9999
3145
3146
  }
3146
3147
  };
3147
- const trigger = triggerButton ? React5.cloneElement(triggerButton, {
3148
+ const hasIcon = React6__namespace.default.isValidElement(icon) && !(icon.type === React6__namespace.default.Fragment && React6__namespace.default.Children.count((_a = icon.props) == null ? void 0 : _a.children) === 0);
3149
+ const trigger = triggerButton ? React6.cloneElement(triggerButton, {
3148
3150
  onClick: () => {
3149
3151
  onOpen();
3150
3152
  }
@@ -3171,11 +3173,11 @@ var ModalDialog = ({
3171
3173
  }),
3172
3174
  children: [
3173
3175
  /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "font-title text-t-sm font-bold flex items-center gap-2", children: [
3174
- alertType && /* @__PURE__ */ jsxRuntime.jsx(
3176
+ hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
3175
3177
  "div",
3176
3178
  {
3177
3179
  className: clsx9__default.default(
3178
- alertTypes[alertType],
3180
+ alertType && alertTypes[alertType],
3179
3181
  "w-[26px] h-[26px] text-[26px] flex items-center justify-center shrink-0"
3180
3182
  ),
3181
3183
  children: icon
@@ -3391,14 +3393,14 @@ var SelectField = ({
3391
3393
  }) => {
3392
3394
  var _a;
3393
3395
  const { Option, DropdownIndicator, ClearIndicator, SingleValue } = Select.components;
3394
- const selectRef = React5.useRef(null);
3395
- const [inputValue, setInputValue] = React5.useState("");
3396
- const [loading, setLoading] = React5.useState(false);
3397
- const [options, setOptions] = React5.useState(() => optionsList || []);
3398
- const [cachedOptions, setCachedOptions] = React5.useState([]);
3399
- const [availableHeight, setAvailableHeight] = React5.useState(300);
3400
- const [isFocused, setIsFocused] = React5.useState(false);
3401
- React5.useEffect(() => {
3396
+ const selectRef = React6.useRef(null);
3397
+ const [inputValue, setInputValue] = React6.useState("");
3398
+ const [loading, setLoading] = React6.useState(false);
3399
+ const [options, setOptions] = React6.useState(() => optionsList || []);
3400
+ const [cachedOptions, setCachedOptions] = React6.useState([]);
3401
+ const [availableHeight, setAvailableHeight] = React6.useState(300);
3402
+ const [isFocused, setIsFocused] = React6.useState(false);
3403
+ React6.useEffect(() => {
3402
3404
  const updateAvailableHeight = () => {
3403
3405
  var _a2, _b;
3404
3406
  if ((_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.getBoundingClientRect) {
@@ -3449,7 +3451,7 @@ var SelectField = ({
3449
3451
  const hasIcon = {
3450
3452
  hasIcon: icon
3451
3453
  };
3452
- React5.useEffect(() => {
3454
+ React6.useEffect(() => {
3453
3455
  setOptions(() => optionsList);
3454
3456
  }, [optionsList]);
3455
3457
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3783,7 +3785,7 @@ var customStyles2 = {
3783
3785
  margin: "none"
3784
3786
  })
3785
3787
  };
3786
- var SelectFieldBip = React5.forwardRef(
3788
+ var SelectFieldBip = React6.forwardRef(
3787
3789
  ({
3788
3790
  name,
3789
3791
  label,
@@ -3812,11 +3814,11 @@ var SelectFieldBip = React5.forwardRef(
3812
3814
  }, ref) => {
3813
3815
  var _a;
3814
3816
  const { Option, SingleValue } = Select.components;
3815
- const selectRef = React5.useRef(null);
3816
- const [inputValue, setInputValue] = React5.useState("");
3817
- const [loading, setLoading] = React5.useState(false);
3818
- const [cachedOptions, setCachedOptions] = React5.useState([]);
3819
- React5.useImperativeHandle(ref, () => ({
3817
+ const selectRef = React6.useRef(null);
3818
+ const [inputValue, setInputValue] = React6.useState("");
3819
+ const [loading, setLoading] = React6.useState(false);
3820
+ const [cachedOptions, setCachedOptions] = React6.useState([]);
3821
+ React6.useImperativeHandle(ref, () => ({
3820
3822
  focus: () => {
3821
3823
  var _a2;
3822
3824
  return (_a2 = selectRef.current) == null ? void 0 : _a2.focus();
@@ -3858,12 +3860,12 @@ var SelectFieldBip = React5.forwardRef(
3858
3860
  hasIcon: icon
3859
3861
  };
3860
3862
  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"}`;
3861
- const debouncedFetchOptions = React5.useMemo(() => {
3863
+ const debouncedFetchOptions = React6.useMemo(() => {
3862
3864
  return debounce_default((value, callback) => {
3863
3865
  fetchOptions(value).then(callback);
3864
3866
  }, 300);
3865
3867
  }, [filterOptions]);
3866
- React5.useEffect(() => {
3868
+ React6.useEffect(() => {
3867
3869
  return () => {
3868
3870
  debouncedFetchOptions.cancel();
3869
3871
  };
@@ -4234,22 +4236,22 @@ function PaginationSelect({
4234
4236
  id: index,
4235
4237
  name: index
4236
4238
  }));
4237
- const [pageSizeSelected, setPageSizeSelected] = React5.useState({
4239
+ const [pageSizeSelected, setPageSizeSelected] = React6.useState({
4238
4240
  id: ((_a = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a.id) || 20,
4239
4241
  name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
4240
4242
  });
4241
- const [pageSelected, setPageSelected] = React5.useState({
4243
+ const [pageSelected, setPageSelected] = React6.useState({
4242
4244
  id: ((_d = (_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageIndex) || 0,
4243
4245
  name: ((_f = (_e = table == null ? void 0 : table.getState()) == null ? void 0 : _e.pagination) == null ? void 0 : _f.pageIndex) || 0
4244
4246
  });
4245
- const [pagesOptions, setPagesOptions] = React5.useState(() => options);
4246
- const [pageSizesOptions, setPagesSizesOptions] = React5.useState(
4247
+ const [pagesOptions, setPagesOptions] = React6.useState(() => options);
4248
+ const [pageSizesOptions, setPagesSizesOptions] = React6.useState(
4247
4249
  pageSizeOptions == null ? void 0 : pageSizeOptions.map((item) => ({
4248
4250
  id: item,
4249
4251
  name: item
4250
4252
  }))
4251
4253
  );
4252
- const [query, setQuery] = React5.useState("");
4254
+ const [query, setQuery] = React6.useState("");
4253
4255
  const filter = () => {
4254
4256
  let copy = [...options];
4255
4257
  setPagesOptions(
@@ -4261,10 +4263,10 @@ function PaginationSelect({
4261
4263
  const saveSessionStorage = (key, values) => {
4262
4264
  sessionStorage.setItem(key, JSON.stringify(values));
4263
4265
  };
4264
- React5.useEffect(() => {
4266
+ React6.useEffect(() => {
4265
4267
  filter();
4266
4268
  }, [query]);
4267
- React5.useEffect(() => {
4269
+ React6.useEffect(() => {
4268
4270
  saveSessionStorage("pageSize", pageSizeSelected);
4269
4271
  table.setPageSize(pageSizeSelected == null ? void 0 : pageSizeSelected.id);
4270
4272
  table.setPageIndex(0);
@@ -4273,7 +4275,7 @@ function PaginationSelect({
4273
4275
  name: 0
4274
4276
  });
4275
4277
  }, [pageSizeSelected]);
4276
- React5.useEffect(() => {
4278
+ React6.useEffect(() => {
4277
4279
  setPagesOptions(
4278
4280
  pageCount ? [...Array(pageCount)].map((item, index) => ({
4279
4281
  id: index,
@@ -4281,7 +4283,7 @@ function PaginationSelect({
4281
4283
  })) : []
4282
4284
  );
4283
4285
  }, [table == null ? void 0 : table.getPageCount()]);
4284
- React5.useEffect(() => {
4286
+ React6.useEffect(() => {
4285
4287
  var _a2, _b2, _c2, _d2, _e2, _f2;
4286
4288
  if (((_b2 = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
4287
4289
  setPageSelected({
@@ -4406,7 +4408,7 @@ function PaginationSelect({
4406
4408
  ] })
4407
4409
  ] });
4408
4410
  }
4409
- var Table = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4411
+ var Table = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4410
4412
  "table",
4411
4413
  {
4412
4414
  ref,
@@ -4419,7 +4421,7 @@ var Table = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @_
4419
4421
  }
4420
4422
  ));
4421
4423
  Table.displayName = "Table";
4422
- var TableHeader = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4424
+ var TableHeader = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4423
4425
  "thead",
4424
4426
  {
4425
4427
  ref,
@@ -4428,9 +4430,9 @@ var TableHeader = React5__namespace.forwardRef(({ className, ...props }, ref) =>
4428
4430
  }
4429
4431
  ));
4430
4432
  TableHeader.displayName = "TableHeader";
4431
- var TableBody = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx9.clsx(className), ...props }));
4433
+ var TableBody = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx9.clsx(className), ...props }));
4432
4434
  TableBody.displayName = "TableBody";
4433
- var TableFooter = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4435
+ var TableFooter = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4434
4436
  "div",
4435
4437
  {
4436
4438
  ref,
@@ -4442,9 +4444,9 @@ var TableFooter = React5__namespace.forwardRef(({ className, ...props }, ref) =>
4442
4444
  }
4443
4445
  ));
4444
4446
  TableFooter.displayName = "TableFooter";
4445
- var TableRow = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx9.clsx(className), ...props }));
4447
+ var TableRow = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx9.clsx(className), ...props }));
4446
4448
  TableRow.displayName = "TableRow";
4447
- var TableHead = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4449
+ var TableHead = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4448
4450
  "th",
4449
4451
  {
4450
4452
  ref,
@@ -4459,7 +4461,7 @@ var TableHead = React5__namespace.forwardRef(({ className, ...props }, ref) => /
4459
4461
  }
4460
4462
  ));
4461
4463
  TableHead.displayName = "TableHead";
4462
- var TableCell = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4464
+ var TableCell = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4463
4465
  "td",
4464
4466
  {
4465
4467
  ref,
@@ -4471,7 +4473,7 @@ var TableCell = React5__namespace.forwardRef(({ className, ...props }, ref) => /
4471
4473
  }
4472
4474
  ));
4473
4475
  TableCell.displayName = "TableCell";
4474
- var TableCaption = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4476
+ var TableCaption = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4475
4477
  "caption",
4476
4478
  {
4477
4479
  ref,
@@ -4584,7 +4586,7 @@ function DataTablePagination({
4584
4586
  pagesArray.map((elem, index) => {
4585
4587
  const checkPageIndexLimit = index <= limitPagePositive && index >= limitPageNegative;
4586
4588
  const isSelectedPage = index === selectedPage;
4587
- return /* @__PURE__ */ jsxRuntime.jsx(React5.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
4589
+ return /* @__PURE__ */ jsxRuntime.jsx(React6.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
4588
4590
  Button,
4589
4591
  {
4590
4592
  onClick: () => table.setPageIndex(index),
@@ -4694,22 +4696,22 @@ function DataTable({
4694
4696
  onFinishFetch
4695
4697
  }) {
4696
4698
  var _a, _b, _c, _d, _e, _f;
4697
- const tableRef = React5.useRef(null);
4698
- const [columnVisibility, setColumnVisibility] = React5.useState({});
4699
- const [columnFilters, setColumnFilters] = React5.useState([]);
4700
- const [sorting, setSorting] = React5.useState([]);
4701
- const [arrRowSelected, setArrRowSelected] = React5.useState([]);
4702
- const [globalFilter, setGlobalFilter] = React5.useState("");
4703
- const [dataTable, setDataTable] = React5.useState([]);
4704
- const [loading, setLoading] = React5.useState(true);
4705
- const [expanded, setExpanded] = React5.useState({});
4706
- const [total, setTotal] = React5.useState(() => totalData);
4707
- const [{ pageIndex, pageSize }, setPagination] = React5.useState({
4699
+ const tableRef = React6.useRef(null);
4700
+ const [columnVisibility, setColumnVisibility] = React6.useState({});
4701
+ const [columnFilters, setColumnFilters] = React6.useState([]);
4702
+ const [sorting, setSorting] = React6.useState([]);
4703
+ const [arrRowSelected, setArrRowSelected] = React6.useState([]);
4704
+ const [globalFilter, setGlobalFilter] = React6.useState("");
4705
+ const [dataTable, setDataTable] = React6.useState([]);
4706
+ const [loading, setLoading] = React6.useState(true);
4707
+ const [expanded, setExpanded] = React6.useState({});
4708
+ const [total, setTotal] = React6.useState(() => totalData);
4709
+ const [{ pageIndex, pageSize }, setPagination] = React6.useState({
4708
4710
  pageIndex: 0,
4709
4711
  pageSize: hidePagination ? 999999 : perPage ? perPage : 20
4710
4712
  });
4711
- const [paginationScroll, setPaginationScroll] = React5.useState();
4712
- const pagination = React5.useMemo(
4713
+ const [paginationScroll, setPaginationScroll] = React6.useState();
4714
+ const pagination = React6.useMemo(
4713
4715
  () => ({
4714
4716
  pageIndex,
4715
4717
  pageSize
@@ -4764,7 +4766,7 @@ function DataTable({
4764
4766
  pageCount: Number(pageSize2)
4765
4767
  };
4766
4768
  };
4767
- React5.useEffect(() => {
4769
+ React6.useEffect(() => {
4768
4770
  if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
4769
4771
  const resizeObserver = new ResizeObserver(() => {
4770
4772
  var _a2;
@@ -4773,12 +4775,12 @@ function DataTable({
4773
4775
  resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
4774
4776
  return () => resizeObserver.disconnect();
4775
4777
  }, []);
4776
- React5.useEffect(() => {
4778
+ React6.useEffect(() => {
4777
4779
  if (fetchData || autoPagination) {
4778
4780
  fetch();
4779
4781
  }
4780
4782
  }, [pageIndex, pageSize, sorting]);
4781
- React5.useEffect(() => {
4783
+ React6.useEffect(() => {
4782
4784
  if (totalData !== total) {
4783
4785
  setPagination({
4784
4786
  pageIndex: 0,
@@ -4787,7 +4789,7 @@ function DataTable({
4787
4789
  setTotal(totalData);
4788
4790
  }
4789
4791
  }, [totalData]);
4790
- React5.useEffect(() => {
4792
+ React6.useEffect(() => {
4791
4793
  if (data) {
4792
4794
  setDataTable(
4793
4795
  () => autoPagination ? data.slice(0, pageSize) : data
@@ -4834,7 +4836,7 @@ function DataTable({
4834
4836
  getRowStyles: rowClassName
4835
4837
  }
4836
4838
  });
4837
- React5.useEffect(() => {
4839
+ React6.useEffect(() => {
4838
4840
  if (enableRowSelection && rowSelection) {
4839
4841
  setArrRowSelected(Object.keys(rowSelection));
4840
4842
  }
@@ -4887,7 +4889,7 @@ function DataTable({
4887
4889
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4888
4890
  }
4889
4891
  }
4890
- React5.useEffect(() => {
4892
+ React6.useEffect(() => {
4891
4893
  if (rowSelection && Object.keys(rowSelection).length == 0) {
4892
4894
  const elements = document.getElementsByClassName("th-shadow");
4893
4895
  Object.keys(elements).forEach((index) => {
@@ -4992,7 +4994,7 @@ function DataTable({
4992
4994
  );
4993
4995
  }) }, headerGroup.id + headerIndex + "header")) }),
4994
4996
  /* @__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) => {
4995
- return /* @__PURE__ */ jsxRuntime.jsx(React5__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.default.Fragment, { children: [
4997
+ return /* @__PURE__ */ jsxRuntime.jsx(React6__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React6__namespace.default.Fragment, { children: [
4996
4998
  /* @__PURE__ */ jsxRuntime.jsx(
4997
4999
  TableRow,
4998
5000
  {
@@ -5046,7 +5048,7 @@ function DataTable({
5046
5048
  ] });
5047
5049
  }
5048
5050
  var Accordion = ({ title, children, open = false }) => {
5049
- const [isOpen, setOpen] = React5.useState(open);
5051
+ const [isOpen, setOpen] = React6.useState(open);
5050
5052
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
5051
5053
  "div",
5052
5054
  {
@@ -5106,7 +5108,7 @@ var Accordion = ({ title, children, open = false }) => {
5106
5108
  ) });
5107
5109
  };
5108
5110
  function CopyPopover({ children, valueToCopy }) {
5109
- const [copied, setCopied] = React5.useState(false);
5111
+ const [copied, setCopied] = React6.useState(false);
5110
5112
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
5111
5113
  "div",
5112
5114
  {
@@ -5159,7 +5161,7 @@ var Menu = ({ triggerElement, children, className }) => {
5159
5161
  /* @__PURE__ */ jsxRuntime.jsx(
5160
5162
  react.Transition,
5161
5163
  {
5162
- as: React5.Fragment,
5164
+ as: React6.Fragment,
5163
5165
  enter: "transition ease-out duration-200",
5164
5166
  enterFrom: "transform opacity-0 scale-95",
5165
5167
  enterTo: "transform opacity-100 scale-100",
@@ -5202,7 +5204,7 @@ var EditableButton = ({
5202
5204
  button,
5203
5205
  onClose
5204
5206
  }) => {
5205
- const [showModal, setShowModal] = React5.useState(false);
5207
+ const [showModal, setShowModal] = React6.useState(false);
5206
5208
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative", children: [
5207
5209
  /* @__PURE__ */ jsxRuntime.jsx(
5208
5210
  "div",
@@ -5250,7 +5252,7 @@ var EditableText = ({
5250
5252
  hideEditIcon,
5251
5253
  truncate
5252
5254
  }) => {
5253
- const [showModal, setShowModal] = React5.useState(false);
5255
+ const [showModal, setShowModal] = React6.useState(false);
5254
5256
  const truncateText = (str, max, len) => {
5255
5257
  return str.length > max ? str.substring(0, len) + "..." : str;
5256
5258
  };
@@ -5352,9 +5354,9 @@ var EditableTextSelect = ({
5352
5354
  showInputSeach,
5353
5355
  onChangeValue
5354
5356
  }) => {
5355
- const [showModal, setShowModal] = React5.useState(false);
5356
- const [optionsList, setOptionsList] = React5.useState(() => options);
5357
- const [inputSearch, setInputSearch] = React5.useState("");
5357
+ const [showModal, setShowModal] = React6.useState(false);
5358
+ const [optionsList, setOptionsList] = React6.useState(() => options);
5359
+ const [inputSearch, setInputSearch] = React6.useState("");
5358
5360
  const optionsFuse = {
5359
5361
  includeScore: false,
5360
5362
  keys: ["name"]
@@ -5368,10 +5370,10 @@ var EditableTextSelect = ({
5368
5370
  }
5369
5371
  setOptionsList(results);
5370
5372
  };
5371
- React5.useEffect(() => {
5373
+ React6.useEffect(() => {
5372
5374
  setOptionsList(() => options);
5373
5375
  }, [options]);
5374
- React5.useEffect(() => {
5376
+ React6.useEffect(() => {
5375
5377
  filter();
5376
5378
  }, [inputSearch]);
5377
5379
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5492,7 +5494,7 @@ var EditableTextSelect = ({
5492
5494
  );
5493
5495
  };
5494
5496
  function ImagePreview({ open, setOpen, previewImage }) {
5495
- return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show: open, as: React5.Fragment, children: /* @__PURE__ */ jsxRuntime.jsxs(
5497
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show: open, as: React6.Fragment, children: /* @__PURE__ */ jsxRuntime.jsxs(
5496
5498
  react.Dialog,
5497
5499
  {
5498
5500
  as: "div",
@@ -5502,7 +5504,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
5502
5504
  /* @__PURE__ */ jsxRuntime.jsx(
5503
5505
  react.Transition.Child,
5504
5506
  {
5505
- as: React5.Fragment,
5507
+ as: React6.Fragment,
5506
5508
  enter: "ease-out duration-300",
5507
5509
  enterFrom: "opacity-0",
5508
5510
  enterTo: "opacity-100",
@@ -5515,7 +5517,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
5515
5517
  /* @__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(
5516
5518
  react.Transition.Child,
5517
5519
  {
5518
- as: React5.Fragment,
5520
+ as: React6.Fragment,
5519
5521
  enter: "ease-out duration-300",
5520
5522
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
5521
5523
  enterTo: "opacity-100 translate-y-0 sm:scale-100",
@@ -5571,8 +5573,8 @@ var FileStatus = ({
5571
5573
  ) });
5572
5574
  };
5573
5575
  var ImageFile = ({ isLoading, name, size, onRemove, image }) => {
5574
- const [imagePreviewModal, setImagePreviewModal] = React5.useState(false);
5575
- const [previewImage, setPreviewImage] = React5.useState();
5576
+ const [imagePreviewModal, setImagePreviewModal] = React6.useState(false);
5577
+ const [previewImage, setPreviewImage] = React6.useState();
5576
5578
  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: [
5577
5579
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden group-hover:block absolute top-3 left-3", children: [
5578
5580
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5786,15 +5788,15 @@ var FileUpload = ({
5786
5788
  limitMessage
5787
5789
  }) => {
5788
5790
  var _a;
5789
- const [state, dispatch] = React5.useReducer(reducer, initialState);
5790
- const [dragging, setDragging] = React5.useState(false);
5791
- const [loading, setLoading] = React5.useState(false);
5791
+ const [state, dispatch] = React6.useReducer(reducer, initialState);
5792
+ const [dragging, setDragging] = React6.useState(false);
5793
+ const [loading, setLoading] = React6.useState(false);
5792
5794
  const { readString } = reactPapaparse.usePapaParse();
5793
5795
  const fieldValidationMessages = [error == null ? void 0 : error.message];
5794
5796
  const hasError = {
5795
5797
  hasError: fieldValidationMessages.some((item) => item !== void 0)
5796
5798
  };
5797
- React5.useEffect(() => {
5799
+ React6.useEffect(() => {
5798
5800
  var _a2;
5799
5801
  if ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.some((file) => file.loading === true)) {
5800
5802
  setLoading(true);
@@ -5802,12 +5804,12 @@ var FileUpload = ({
5802
5804
  setLoading(false);
5803
5805
  }
5804
5806
  }, [state == null ? void 0 : state.files]);
5805
- React5.useEffect(() => {
5807
+ React6.useEffect(() => {
5806
5808
  if (!files || files.length == 0) {
5807
5809
  state.files = [];
5808
5810
  }
5809
5811
  }, [files]);
5810
- React5.useEffect(() => {
5812
+ React6.useEffect(() => {
5811
5813
  var _a2;
5812
5814
  if (!multiple && ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.length) === 0 || multiple) {
5813
5815
  window.addEventListener("dragover", handleDragOver);
@@ -6427,7 +6429,7 @@ var InputTag = ({
6427
6429
  placeholder,
6428
6430
  blockSpaces = false
6429
6431
  }) => {
6430
- const [inputValue, setInputValue] = React5.useState("");
6432
+ const [inputValue, setInputValue] = React6.useState("");
6431
6433
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6432
6434
  const hasError = {
6433
6435
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -6662,8 +6664,8 @@ var MultiSelectBottom = ({
6662
6664
  filterOptions,
6663
6665
  debounce: debounce2 = 0
6664
6666
  }) => {
6665
- const [loading, setLoading] = React5.useState(false);
6666
- const [optionsList, setOptionsList] = React5.useState(() => options || []);
6667
+ const [loading, setLoading] = React6.useState(false);
6668
+ const [optionsList, setOptionsList] = React6.useState(() => options || []);
6667
6669
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6668
6670
  const hasError = {
6669
6671
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -6895,7 +6897,7 @@ var ProgressBar = ({
6895
6897
  variant = "primary",
6896
6898
  status
6897
6899
  }) => {
6898
- const [barPercentage, setBarPercentage] = React5.useState(() => fixPercentage());
6900
+ const [barPercentage, setBarPercentage] = React6.useState(() => fixPercentage());
6899
6901
  function fixPercentage() {
6900
6902
  if (percentage > 100) {
6901
6903
  return 100;
@@ -6903,7 +6905,7 @@ var ProgressBar = ({
6903
6905
  return percentage;
6904
6906
  }
6905
6907
  }
6906
- React5.useEffect(() => {
6908
+ React6.useEffect(() => {
6907
6909
  setBarPercentage(fixPercentage());
6908
6910
  }, [percentage]);
6909
6911
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-[2px] min-w-[170px]", children: [
@@ -6925,7 +6927,7 @@ var ProgressBar = ({
6925
6927
  ] });
6926
6928
  };
6927
6929
  function SimpleTab({ tabs, onClick }) {
6928
- const [currentTab, setCurrentTab] = React5.useState(0);
6930
+ const [currentTab, setCurrentTab] = React6.useState(0);
6929
6931
  function isCurrentTab(index) {
6930
6932
  return index === currentTab;
6931
6933
  }
@@ -7182,7 +7184,7 @@ var Tabs = ({
7182
7184
  onSave,
7183
7185
  showNextStep = true
7184
7186
  }) => {
7185
- const [selectedTab, setSelectedTab] = React5.useState(0);
7187
+ const [selectedTab, setSelectedTab] = React6.useState(0);
7186
7188
  const ShowSaveButton = saveButton ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: saveButton }) : /* @__PURE__ */ jsxRuntime.jsx(
7187
7189
  Button,
7188
7190
  {
@@ -7303,7 +7305,7 @@ var TextArea = ({
7303
7305
  inputProps,
7304
7306
  name
7305
7307
  }) => {
7306
- const inputRef = React5.useRef(null);
7308
+ const inputRef = React6.useRef(null);
7307
7309
  const fieldValidationMessages = [error == null ? void 0 : error.message];
7308
7310
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
7309
7311
  const styles = {
@@ -7450,7 +7452,7 @@ function ControlledInput({
7450
7452
  control,
7451
7453
  searchOnClick
7452
7454
  }) {
7453
- let inputRef = React5.useRef(null);
7455
+ let inputRef = React6.useRef(null);
7454
7456
  const fieldValidationMessages = [error == null ? void 0 : error.message];
7455
7457
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
7456
7458
  const styles = {