nexaas-ui-components 1.0.89 → 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
  };
@@ -3953,8 +3955,10 @@ var SelectFieldBip = React5.forwardRef(
3953
3955
  const handleKeyDown = async (event) => {
3954
3956
  var _a2;
3955
3957
  if (event.key === "Enter") {
3958
+ if (event.ctrlKey || event.metaKey || event.altKey) return;
3956
3959
  event.preventDefault();
3957
3960
  debouncedFetchOptions.cancel();
3961
+ if (!event.target.value) return;
3958
3962
  const fetchedOptions = await fetchOptions(event.target.value);
3959
3963
  if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
3960
3964
  onChange(fetchedOptions[0]);
@@ -4232,22 +4236,22 @@ function PaginationSelect({
4232
4236
  id: index,
4233
4237
  name: index
4234
4238
  }));
4235
- const [pageSizeSelected, setPageSizeSelected] = React5.useState({
4239
+ const [pageSizeSelected, setPageSizeSelected] = React6.useState({
4236
4240
  id: ((_a = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a.id) || 20,
4237
4241
  name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
4238
4242
  });
4239
- const [pageSelected, setPageSelected] = React5.useState({
4243
+ const [pageSelected, setPageSelected] = React6.useState({
4240
4244
  id: ((_d = (_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageIndex) || 0,
4241
4245
  name: ((_f = (_e = table == null ? void 0 : table.getState()) == null ? void 0 : _e.pagination) == null ? void 0 : _f.pageIndex) || 0
4242
4246
  });
4243
- const [pagesOptions, setPagesOptions] = React5.useState(() => options);
4244
- const [pageSizesOptions, setPagesSizesOptions] = React5.useState(
4247
+ const [pagesOptions, setPagesOptions] = React6.useState(() => options);
4248
+ const [pageSizesOptions, setPagesSizesOptions] = React6.useState(
4245
4249
  pageSizeOptions == null ? void 0 : pageSizeOptions.map((item) => ({
4246
4250
  id: item,
4247
4251
  name: item
4248
4252
  }))
4249
4253
  );
4250
- const [query, setQuery] = React5.useState("");
4254
+ const [query, setQuery] = React6.useState("");
4251
4255
  const filter = () => {
4252
4256
  let copy = [...options];
4253
4257
  setPagesOptions(
@@ -4259,10 +4263,10 @@ function PaginationSelect({
4259
4263
  const saveSessionStorage = (key, values) => {
4260
4264
  sessionStorage.setItem(key, JSON.stringify(values));
4261
4265
  };
4262
- React5.useEffect(() => {
4266
+ React6.useEffect(() => {
4263
4267
  filter();
4264
4268
  }, [query]);
4265
- React5.useEffect(() => {
4269
+ React6.useEffect(() => {
4266
4270
  saveSessionStorage("pageSize", pageSizeSelected);
4267
4271
  table.setPageSize(pageSizeSelected == null ? void 0 : pageSizeSelected.id);
4268
4272
  table.setPageIndex(0);
@@ -4271,7 +4275,7 @@ function PaginationSelect({
4271
4275
  name: 0
4272
4276
  });
4273
4277
  }, [pageSizeSelected]);
4274
- React5.useEffect(() => {
4278
+ React6.useEffect(() => {
4275
4279
  setPagesOptions(
4276
4280
  pageCount ? [...Array(pageCount)].map((item, index) => ({
4277
4281
  id: index,
@@ -4279,7 +4283,7 @@ function PaginationSelect({
4279
4283
  })) : []
4280
4284
  );
4281
4285
  }, [table == null ? void 0 : table.getPageCount()]);
4282
- React5.useEffect(() => {
4286
+ React6.useEffect(() => {
4283
4287
  var _a2, _b2, _c2, _d2, _e2, _f2;
4284
4288
  if (((_b2 = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
4285
4289
  setPageSelected({
@@ -4404,7 +4408,7 @@ function PaginationSelect({
4404
4408
  ] })
4405
4409
  ] });
4406
4410
  }
4407
- var Table = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4411
+ var Table = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4408
4412
  "table",
4409
4413
  {
4410
4414
  ref,
@@ -4417,7 +4421,7 @@ var Table = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @_
4417
4421
  }
4418
4422
  ));
4419
4423
  Table.displayName = "Table";
4420
- var TableHeader = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4424
+ var TableHeader = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4421
4425
  "thead",
4422
4426
  {
4423
4427
  ref,
@@ -4426,9 +4430,9 @@ var TableHeader = React5__namespace.forwardRef(({ className, ...props }, ref) =>
4426
4430
  }
4427
4431
  ));
4428
4432
  TableHeader.displayName = "TableHeader";
4429
- 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 }));
4430
4434
  TableBody.displayName = "TableBody";
4431
- var TableFooter = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4435
+ var TableFooter = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4432
4436
  "div",
4433
4437
  {
4434
4438
  ref,
@@ -4440,9 +4444,9 @@ var TableFooter = React5__namespace.forwardRef(({ className, ...props }, ref) =>
4440
4444
  }
4441
4445
  ));
4442
4446
  TableFooter.displayName = "TableFooter";
4443
- 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 }));
4444
4448
  TableRow.displayName = "TableRow";
4445
- var TableHead = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4449
+ var TableHead = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4446
4450
  "th",
4447
4451
  {
4448
4452
  ref,
@@ -4457,7 +4461,7 @@ var TableHead = React5__namespace.forwardRef(({ className, ...props }, ref) => /
4457
4461
  }
4458
4462
  ));
4459
4463
  TableHead.displayName = "TableHead";
4460
- var TableCell = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4464
+ var TableCell = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4461
4465
  "td",
4462
4466
  {
4463
4467
  ref,
@@ -4469,7 +4473,7 @@ var TableCell = React5__namespace.forwardRef(({ className, ...props }, ref) => /
4469
4473
  }
4470
4474
  ));
4471
4475
  TableCell.displayName = "TableCell";
4472
- var TableCaption = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4476
+ var TableCaption = React6__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4473
4477
  "caption",
4474
4478
  {
4475
4479
  ref,
@@ -4582,7 +4586,7 @@ function DataTablePagination({
4582
4586
  pagesArray.map((elem, index) => {
4583
4587
  const checkPageIndexLimit = index <= limitPagePositive && index >= limitPageNegative;
4584
4588
  const isSelectedPage = index === selectedPage;
4585
- return /* @__PURE__ */ jsxRuntime.jsx(React5.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
4589
+ return /* @__PURE__ */ jsxRuntime.jsx(React6.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
4586
4590
  Button,
4587
4591
  {
4588
4592
  onClick: () => table.setPageIndex(index),
@@ -4692,22 +4696,22 @@ function DataTable({
4692
4696
  onFinishFetch
4693
4697
  }) {
4694
4698
  var _a, _b, _c, _d, _e, _f;
4695
- const tableRef = React5.useRef(null);
4696
- const [columnVisibility, setColumnVisibility] = React5.useState({});
4697
- const [columnFilters, setColumnFilters] = React5.useState([]);
4698
- const [sorting, setSorting] = React5.useState([]);
4699
- const [arrRowSelected, setArrRowSelected] = React5.useState([]);
4700
- const [globalFilter, setGlobalFilter] = React5.useState("");
4701
- const [dataTable, setDataTable] = React5.useState([]);
4702
- const [loading, setLoading] = React5.useState(true);
4703
- const [expanded, setExpanded] = React5.useState({});
4704
- const [total, setTotal] = React5.useState(() => totalData);
4705
- 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({
4706
4710
  pageIndex: 0,
4707
4711
  pageSize: hidePagination ? 999999 : perPage ? perPage : 20
4708
4712
  });
4709
- const [paginationScroll, setPaginationScroll] = React5.useState();
4710
- const pagination = React5.useMemo(
4713
+ const [paginationScroll, setPaginationScroll] = React6.useState();
4714
+ const pagination = React6.useMemo(
4711
4715
  () => ({
4712
4716
  pageIndex,
4713
4717
  pageSize
@@ -4762,7 +4766,7 @@ function DataTable({
4762
4766
  pageCount: Number(pageSize2)
4763
4767
  };
4764
4768
  };
4765
- React5.useEffect(() => {
4769
+ React6.useEffect(() => {
4766
4770
  if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
4767
4771
  const resizeObserver = new ResizeObserver(() => {
4768
4772
  var _a2;
@@ -4771,12 +4775,12 @@ function DataTable({
4771
4775
  resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
4772
4776
  return () => resizeObserver.disconnect();
4773
4777
  }, []);
4774
- React5.useEffect(() => {
4778
+ React6.useEffect(() => {
4775
4779
  if (fetchData || autoPagination) {
4776
4780
  fetch();
4777
4781
  }
4778
4782
  }, [pageIndex, pageSize, sorting]);
4779
- React5.useEffect(() => {
4783
+ React6.useEffect(() => {
4780
4784
  if (totalData !== total) {
4781
4785
  setPagination({
4782
4786
  pageIndex: 0,
@@ -4785,7 +4789,7 @@ function DataTable({
4785
4789
  setTotal(totalData);
4786
4790
  }
4787
4791
  }, [totalData]);
4788
- React5.useEffect(() => {
4792
+ React6.useEffect(() => {
4789
4793
  if (data) {
4790
4794
  setDataTable(
4791
4795
  () => autoPagination ? data.slice(0, pageSize) : data
@@ -4832,7 +4836,7 @@ function DataTable({
4832
4836
  getRowStyles: rowClassName
4833
4837
  }
4834
4838
  });
4835
- React5.useEffect(() => {
4839
+ React6.useEffect(() => {
4836
4840
  if (enableRowSelection && rowSelection) {
4837
4841
  setArrRowSelected(Object.keys(rowSelection));
4838
4842
  }
@@ -4885,7 +4889,7 @@ function DataTable({
4885
4889
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4886
4890
  }
4887
4891
  }
4888
- React5.useEffect(() => {
4892
+ React6.useEffect(() => {
4889
4893
  if (rowSelection && Object.keys(rowSelection).length == 0) {
4890
4894
  const elements = document.getElementsByClassName("th-shadow");
4891
4895
  Object.keys(elements).forEach((index) => {
@@ -4990,7 +4994,7 @@ function DataTable({
4990
4994
  );
4991
4995
  }) }, headerGroup.id + headerIndex + "header")) }),
4992
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) => {
4993
- 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: [
4994
4998
  /* @__PURE__ */ jsxRuntime.jsx(
4995
4999
  TableRow,
4996
5000
  {
@@ -5044,7 +5048,7 @@ function DataTable({
5044
5048
  ] });
5045
5049
  }
5046
5050
  var Accordion = ({ title, children, open = false }) => {
5047
- const [isOpen, setOpen] = React5.useState(open);
5051
+ const [isOpen, setOpen] = React6.useState(open);
5048
5052
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
5049
5053
  "div",
5050
5054
  {
@@ -5104,7 +5108,7 @@ var Accordion = ({ title, children, open = false }) => {
5104
5108
  ) });
5105
5109
  };
5106
5110
  function CopyPopover({ children, valueToCopy }) {
5107
- const [copied, setCopied] = React5.useState(false);
5111
+ const [copied, setCopied] = React6.useState(false);
5108
5112
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
5109
5113
  "div",
5110
5114
  {
@@ -5157,7 +5161,7 @@ var Menu = ({ triggerElement, children, className }) => {
5157
5161
  /* @__PURE__ */ jsxRuntime.jsx(
5158
5162
  react.Transition,
5159
5163
  {
5160
- as: React5.Fragment,
5164
+ as: React6.Fragment,
5161
5165
  enter: "transition ease-out duration-200",
5162
5166
  enterFrom: "transform opacity-0 scale-95",
5163
5167
  enterTo: "transform opacity-100 scale-100",
@@ -5200,7 +5204,7 @@ var EditableButton = ({
5200
5204
  button,
5201
5205
  onClose
5202
5206
  }) => {
5203
- const [showModal, setShowModal] = React5.useState(false);
5207
+ const [showModal, setShowModal] = React6.useState(false);
5204
5208
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative", children: [
5205
5209
  /* @__PURE__ */ jsxRuntime.jsx(
5206
5210
  "div",
@@ -5248,7 +5252,7 @@ var EditableText = ({
5248
5252
  hideEditIcon,
5249
5253
  truncate
5250
5254
  }) => {
5251
- const [showModal, setShowModal] = React5.useState(false);
5255
+ const [showModal, setShowModal] = React6.useState(false);
5252
5256
  const truncateText = (str, max, len) => {
5253
5257
  return str.length > max ? str.substring(0, len) + "..." : str;
5254
5258
  };
@@ -5350,9 +5354,9 @@ var EditableTextSelect = ({
5350
5354
  showInputSeach,
5351
5355
  onChangeValue
5352
5356
  }) => {
5353
- const [showModal, setShowModal] = React5.useState(false);
5354
- const [optionsList, setOptionsList] = React5.useState(() => options);
5355
- 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("");
5356
5360
  const optionsFuse = {
5357
5361
  includeScore: false,
5358
5362
  keys: ["name"]
@@ -5366,10 +5370,10 @@ var EditableTextSelect = ({
5366
5370
  }
5367
5371
  setOptionsList(results);
5368
5372
  };
5369
- React5.useEffect(() => {
5373
+ React6.useEffect(() => {
5370
5374
  setOptionsList(() => options);
5371
5375
  }, [options]);
5372
- React5.useEffect(() => {
5376
+ React6.useEffect(() => {
5373
5377
  filter();
5374
5378
  }, [inputSearch]);
5375
5379
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5490,7 +5494,7 @@ var EditableTextSelect = ({
5490
5494
  );
5491
5495
  };
5492
5496
  function ImagePreview({ open, setOpen, previewImage }) {
5493
- 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(
5494
5498
  react.Dialog,
5495
5499
  {
5496
5500
  as: "div",
@@ -5500,7 +5504,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
5500
5504
  /* @__PURE__ */ jsxRuntime.jsx(
5501
5505
  react.Transition.Child,
5502
5506
  {
5503
- as: React5.Fragment,
5507
+ as: React6.Fragment,
5504
5508
  enter: "ease-out duration-300",
5505
5509
  enterFrom: "opacity-0",
5506
5510
  enterTo: "opacity-100",
@@ -5513,7 +5517,7 @@ function ImagePreview({ open, setOpen, previewImage }) {
5513
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(
5514
5518
  react.Transition.Child,
5515
5519
  {
5516
- as: React5.Fragment,
5520
+ as: React6.Fragment,
5517
5521
  enter: "ease-out duration-300",
5518
5522
  enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
5519
5523
  enterTo: "opacity-100 translate-y-0 sm:scale-100",
@@ -5569,8 +5573,8 @@ var FileStatus = ({
5569
5573
  ) });
5570
5574
  };
5571
5575
  var ImageFile = ({ isLoading, name, size, onRemove, image }) => {
5572
- const [imagePreviewModal, setImagePreviewModal] = React5.useState(false);
5573
- const [previewImage, setPreviewImage] = React5.useState();
5576
+ const [imagePreviewModal, setImagePreviewModal] = React6.useState(false);
5577
+ const [previewImage, setPreviewImage] = React6.useState();
5574
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: [
5575
5579
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden group-hover:block absolute top-3 left-3", children: [
5576
5580
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5784,15 +5788,15 @@ var FileUpload = ({
5784
5788
  limitMessage
5785
5789
  }) => {
5786
5790
  var _a;
5787
- const [state, dispatch] = React5.useReducer(reducer, initialState);
5788
- const [dragging, setDragging] = React5.useState(false);
5789
- 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);
5790
5794
  const { readString } = reactPapaparse.usePapaParse();
5791
5795
  const fieldValidationMessages = [error == null ? void 0 : error.message];
5792
5796
  const hasError = {
5793
5797
  hasError: fieldValidationMessages.some((item) => item !== void 0)
5794
5798
  };
5795
- React5.useEffect(() => {
5799
+ React6.useEffect(() => {
5796
5800
  var _a2;
5797
5801
  if ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.some((file) => file.loading === true)) {
5798
5802
  setLoading(true);
@@ -5800,12 +5804,12 @@ var FileUpload = ({
5800
5804
  setLoading(false);
5801
5805
  }
5802
5806
  }, [state == null ? void 0 : state.files]);
5803
- React5.useEffect(() => {
5807
+ React6.useEffect(() => {
5804
5808
  if (!files || files.length == 0) {
5805
5809
  state.files = [];
5806
5810
  }
5807
5811
  }, [files]);
5808
- React5.useEffect(() => {
5812
+ React6.useEffect(() => {
5809
5813
  var _a2;
5810
5814
  if (!multiple && ((_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.length) === 0 || multiple) {
5811
5815
  window.addEventListener("dragover", handleDragOver);
@@ -6425,7 +6429,7 @@ var InputTag = ({
6425
6429
  placeholder,
6426
6430
  blockSpaces = false
6427
6431
  }) => {
6428
- const [inputValue, setInputValue] = React5.useState("");
6432
+ const [inputValue, setInputValue] = React6.useState("");
6429
6433
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6430
6434
  const hasError = {
6431
6435
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -6660,8 +6664,8 @@ var MultiSelectBottom = ({
6660
6664
  filterOptions,
6661
6665
  debounce: debounce2 = 0
6662
6666
  }) => {
6663
- const [loading, setLoading] = React5.useState(false);
6664
- const [optionsList, setOptionsList] = React5.useState(() => options || []);
6667
+ const [loading, setLoading] = React6.useState(false);
6668
+ const [optionsList, setOptionsList] = React6.useState(() => options || []);
6665
6669
  const fieldValidationMessages = [error == null ? void 0 : error.message];
6666
6670
  const hasError = {
6667
6671
  hasError: fieldValidationMessages.some((item) => item !== void 0)
@@ -6893,7 +6897,7 @@ var ProgressBar = ({
6893
6897
  variant = "primary",
6894
6898
  status
6895
6899
  }) => {
6896
- const [barPercentage, setBarPercentage] = React5.useState(() => fixPercentage());
6900
+ const [barPercentage, setBarPercentage] = React6.useState(() => fixPercentage());
6897
6901
  function fixPercentage() {
6898
6902
  if (percentage > 100) {
6899
6903
  return 100;
@@ -6901,7 +6905,7 @@ var ProgressBar = ({
6901
6905
  return percentage;
6902
6906
  }
6903
6907
  }
6904
- React5.useEffect(() => {
6908
+ React6.useEffect(() => {
6905
6909
  setBarPercentage(fixPercentage());
6906
6910
  }, [percentage]);
6907
6911
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-[2px] min-w-[170px]", children: [
@@ -6923,7 +6927,7 @@ var ProgressBar = ({
6923
6927
  ] });
6924
6928
  };
6925
6929
  function SimpleTab({ tabs, onClick }) {
6926
- const [currentTab, setCurrentTab] = React5.useState(0);
6930
+ const [currentTab, setCurrentTab] = React6.useState(0);
6927
6931
  function isCurrentTab(index) {
6928
6932
  return index === currentTab;
6929
6933
  }
@@ -7180,7 +7184,7 @@ var Tabs = ({
7180
7184
  onSave,
7181
7185
  showNextStep = true
7182
7186
  }) => {
7183
- const [selectedTab, setSelectedTab] = React5.useState(0);
7187
+ const [selectedTab, setSelectedTab] = React6.useState(0);
7184
7188
  const ShowSaveButton = saveButton ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: saveButton }) : /* @__PURE__ */ jsxRuntime.jsx(
7185
7189
  Button,
7186
7190
  {
@@ -7301,7 +7305,7 @@ var TextArea = ({
7301
7305
  inputProps,
7302
7306
  name
7303
7307
  }) => {
7304
- const inputRef = React5.useRef(null);
7308
+ const inputRef = React6.useRef(null);
7305
7309
  const fieldValidationMessages = [error == null ? void 0 : error.message];
7306
7310
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
7307
7311
  const styles = {
@@ -7448,7 +7452,7 @@ function ControlledInput({
7448
7452
  control,
7449
7453
  searchOnClick
7450
7454
  }) {
7451
- let inputRef = React5.useRef(null);
7455
+ let inputRef = React6.useRef(null);
7452
7456
  const fieldValidationMessages = [error == null ? void 0 : error.message];
7453
7457
  const hasError = fieldValidationMessages.some((item) => item !== void 0);
7454
7458
  const styles = {