nexaas-ui-components 1.0.103 → 1.0.105
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 +231 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +233 -136
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -270,7 +270,7 @@ var Button = ({
|
|
|
270
270
|
React6.useEffect(() => {
|
|
271
271
|
if (!hotkey || !props.onClick) return;
|
|
272
272
|
const handleKeyDown = (event) => {
|
|
273
|
-
var
|
|
273
|
+
var _a2, _b;
|
|
274
274
|
if (props.disabled || props.loading) return;
|
|
275
275
|
const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
|
|
276
276
|
const primaryKey = keys.pop();
|
|
@@ -285,7 +285,7 @@ var Button = ({
|
|
|
285
285
|
space: " ",
|
|
286
286
|
spacebar: " "
|
|
287
287
|
};
|
|
288
|
-
const normalizedPrimary = (
|
|
288
|
+
const normalizedPrimary = (_a2 = keyAliases[primaryKey]) != null ? _a2 : primaryKey;
|
|
289
289
|
const match = event.key.toLowerCase() === normalizedPrimary && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
|
|
290
290
|
if (match) {
|
|
291
291
|
event.preventDefault();
|
|
@@ -447,12 +447,12 @@ var ButtonLink = React6.forwardRef(
|
|
|
447
447
|
iconPosition = "left",
|
|
448
448
|
...props
|
|
449
449
|
}, ref) => {
|
|
450
|
-
var
|
|
450
|
+
var _a2;
|
|
451
451
|
const applyGap = icon;
|
|
452
452
|
React6.useEffect(() => {
|
|
453
453
|
if (!hotkey) return;
|
|
454
454
|
const handleKeyDown = (event) => {
|
|
455
|
-
var
|
|
455
|
+
var _a3;
|
|
456
456
|
if (disabled) return;
|
|
457
457
|
const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
|
|
458
458
|
const primaryKey = keys.pop();
|
|
@@ -465,7 +465,7 @@ var ButtonLink = React6.forwardRef(
|
|
|
465
465
|
if (match) {
|
|
466
466
|
event.preventDefault();
|
|
467
467
|
if (props.onClick) {
|
|
468
|
-
(
|
|
468
|
+
(_a3 = props.onClick) == null ? void 0 : _a3.call(props, event);
|
|
469
469
|
} else {
|
|
470
470
|
const linkElement = document.querySelector(
|
|
471
471
|
`a[href="${props.href}"]`
|
|
@@ -502,7 +502,7 @@ var ButtonLink = React6.forwardRef(
|
|
|
502
502
|
ref,
|
|
503
503
|
className: clsx9__default.default(
|
|
504
504
|
{
|
|
505
|
-
[(
|
|
505
|
+
[(_a2 = variants2[variant]) == null ? void 0 : _a2.text]: true,
|
|
506
506
|
[sizes2[size].text]: true,
|
|
507
507
|
["pointer-events-none shadow-none text-label"]: disabled,
|
|
508
508
|
["px-2"]: variant !== "link" && variant !== "linkDanger",
|
|
@@ -803,7 +803,65 @@ var useFieldErrorsStore = zustand.create(
|
|
|
803
803
|
}))
|
|
804
804
|
})
|
|
805
805
|
);
|
|
806
|
+
|
|
807
|
+
// src/utils/date-input.ts
|
|
808
|
+
var MASK_SLASH_POSITIONS = [2, 5];
|
|
809
|
+
var MAX_DIGITS = 8;
|
|
810
|
+
var formatDigits = (digits) => {
|
|
811
|
+
let out = digits.slice(0, 2);
|
|
812
|
+
if (digits.length > 2) out += `/${digits.slice(2, 4)}`;
|
|
813
|
+
if (digits.length > 4) out += `/${digits.slice(4, MAX_DIGITS)}`;
|
|
814
|
+
return out;
|
|
815
|
+
};
|
|
816
|
+
var maskDateInput = (raw) => {
|
|
817
|
+
if (!/^[\d/]*$/.test(raw)) return raw;
|
|
818
|
+
for (let i = 0; i < raw.length; i++) {
|
|
819
|
+
if (raw[i] === "/" && !MASK_SLASH_POSITIONS.includes(i)) return raw;
|
|
820
|
+
}
|
|
821
|
+
const digits = raw.replace(/\//g, "").slice(0, MAX_DIGITS);
|
|
822
|
+
let out = formatDigits(digits);
|
|
823
|
+
if (raw.endsWith("/") && (digits.length === 2 || digits.length === 4)) {
|
|
824
|
+
out += "/";
|
|
825
|
+
}
|
|
826
|
+
return out;
|
|
827
|
+
};
|
|
828
|
+
var resolveTwoDigitYear = (yy, maxYear) => {
|
|
829
|
+
const year = 2e3 + yy;
|
|
830
|
+
return year > maxYear ? year - 100 : year;
|
|
831
|
+
};
|
|
832
|
+
var parseDateInput = (value, maxYear, allowTwoDigitYear = false) => {
|
|
833
|
+
const text = value.trim().replace(/[-.]/g, "/");
|
|
834
|
+
const digitsOnly = /^(\d{2})(\d{2})(\d{4})$/.exec(text);
|
|
835
|
+
const withSeparators = allowTwoDigitYear ? /^(\d{1,2})\/(\d{1,2})\/(\d{2}|\d{4})$/.exec(text) : /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(text);
|
|
836
|
+
const match = digitsOnly != null ? digitsOnly : withSeparators;
|
|
837
|
+
if (!match) return /* @__PURE__ */ new Date(NaN);
|
|
838
|
+
const day = Number(match[1]);
|
|
839
|
+
const month = Number(match[2]);
|
|
840
|
+
const year = match[3].length === 2 ? resolveTwoDigitYear(Number(match[3]), maxYear) : Number(match[3]);
|
|
841
|
+
const date = new Date(2e3, 0, 1);
|
|
842
|
+
date.setFullYear(year, month - 1, day);
|
|
843
|
+
date.setHours(0, 0, 0, 0);
|
|
844
|
+
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
|
|
845
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
846
|
+
}
|
|
847
|
+
return date;
|
|
848
|
+
};
|
|
806
849
|
var DEFAULT_POPOVER_OFFSET = [0, 8];
|
|
850
|
+
var INVALID_DATE_MESSAGE = "Data inv\xE1lida";
|
|
851
|
+
var OUT_OF_RANGE_MESSAGE = "Data n\xE3o permitida";
|
|
852
|
+
var _a;
|
|
853
|
+
var nativeValueSetter = (_a = Object.getOwnPropertyDescriptor(
|
|
854
|
+
typeof HTMLInputElement !== "undefined" ? HTMLInputElement.prototype : {},
|
|
855
|
+
"value"
|
|
856
|
+
)) == null ? void 0 : _a.set;
|
|
857
|
+
var applyDateMask = (event) => {
|
|
858
|
+
const input = event.target;
|
|
859
|
+
if (input.selectionStart !== input.value.length) return;
|
|
860
|
+
const masked = maskDateInput(input.value);
|
|
861
|
+
if (masked !== input.value && nativeValueSetter) {
|
|
862
|
+
nativeValueSetter.call(input, masked);
|
|
863
|
+
}
|
|
864
|
+
};
|
|
807
865
|
var DatePickerInput = React6.forwardRef(
|
|
808
866
|
({
|
|
809
867
|
icon,
|
|
@@ -824,17 +882,28 @@ var DatePickerInput = React6.forwardRef(
|
|
|
824
882
|
onClear,
|
|
825
883
|
popoverOffset
|
|
826
884
|
}, ref) => {
|
|
827
|
-
var
|
|
828
|
-
const [
|
|
885
|
+
var _a2;
|
|
886
|
+
const [dateError, setDateError] = React6.useState(null);
|
|
829
887
|
const [showCalendar, setShowCalendar] = React6.useState(false);
|
|
830
888
|
const inputContainerRef = React6.useRef(null);
|
|
831
889
|
const dateFnsFormat = "dd/MM/yyyy";
|
|
890
|
+
const effectiveMaxDate = maxDate || new Date((/* @__PURE__ */ new Date()).getFullYear() + 5, 11, 31);
|
|
891
|
+
const maxYear = new Date(effectiveMaxDate).getFullYear();
|
|
892
|
+
const effectiveMinDate = minDate || new Date(1900, 0, 1);
|
|
893
|
+
const maskedInputNodeRef = React6.useRef(null);
|
|
894
|
+
const maskedInputRef = React6.useCallback((node) => {
|
|
895
|
+
var _a3;
|
|
896
|
+
(_a3 = maskedInputNodeRef.current) == null ? void 0 : _a3.removeEventListener("input", applyDateMask);
|
|
897
|
+
maskedInputNodeRef.current = node;
|
|
898
|
+
node == null ? void 0 : node.addEventListener("input", applyDateMask);
|
|
899
|
+
}, []);
|
|
832
900
|
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
833
901
|
const fieldValidationMessages = [
|
|
834
|
-
(
|
|
902
|
+
(_a2 = fieldValidation[name ? name : registration == null ? void 0 : registration.name]) == null ? void 0 : _a2.message,
|
|
835
903
|
error == null ? void 0 : error.message
|
|
836
904
|
];
|
|
837
905
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
906
|
+
const inputBorder = (dateErrorShown) => hasError ? "border-dangerous-500 text-dangerous-500" : dateErrorShown ? "border-dangerous-500 placeholder:text-dangerous-500" : "border-stroke";
|
|
838
907
|
const styles = {
|
|
839
908
|
// Borda e sombra iguais as do Input: `rounded-lg` (era `rounded`, 4px contra os 8px do
|
|
840
909
|
// Input) e o mesmo bloco de disabled, com os tokens `--input-bg-disabled` /
|
|
@@ -843,9 +912,9 @@ var DatePickerInput = React6.forwardRef(
|
|
|
843
912
|
// `border-solid` e obrigatorio aqui (o Input nao precisa): o Blueprint declara
|
|
844
913
|
// `.bp6-input { border: none }`, que vence o `border-style: solid` do preflight do
|
|
845
914
|
// Tailwind (seletor `*`). Sem ele a borda tem largura e cor certas mas nao aparece.
|
|
846
|
-
input: `text-p-md text-paragraph bg-surface shadow-input border-solid border-[0.5px] rounded-lg block pb-[10px] h-[46px] w-full disabled:bg-[var(--input-bg-disabled)] disabled:border-[var(--input-border-disabled)] disabled:text-disabled disabled:cursor-not-allowed disabled:shadow-none input-focus-ring
|
|
915
|
+
input: `text-p-md text-paragraph bg-surface shadow-input border-solid border-[0.5px] rounded-lg block pb-[10px] h-[46px] w-full disabled:bg-[var(--input-bg-disabled)] disabled:border-[var(--input-border-disabled)] disabled:text-disabled disabled:cursor-not-allowed disabled:shadow-none input-focus-ring`,
|
|
847
916
|
// left-[1.5px] como no Input: cobre a borda de 0.5px sem deixar fiapo aparecendo.
|
|
848
|
-
icon:
|
|
917
|
+
icon: "absolute bg-neutral-100 h-[42px] w-[38px] top-[2px] left-[1.5px] rounded-l-lg rounded-r-none",
|
|
849
918
|
label: "absolute text-label text-sm",
|
|
850
919
|
clear: "absolute top-[8px] right-[8px] cursor-pointer text-label text-[22px]"
|
|
851
920
|
};
|
|
@@ -869,6 +938,41 @@ var DatePickerInput = React6.forwardRef(
|
|
|
869
938
|
return null;
|
|
870
939
|
};
|
|
871
940
|
const normalizedValue = normalizeDate(field.value);
|
|
941
|
+
const dateErrorShown = !normalizedValue && dateError !== null;
|
|
942
|
+
const commitValue = (e) => {
|
|
943
|
+
let value = null;
|
|
944
|
+
if (e) {
|
|
945
|
+
const date = new Date(e);
|
|
946
|
+
date.setUTCHours(23, 59, 59, 0);
|
|
947
|
+
value = date.toISOString();
|
|
948
|
+
}
|
|
949
|
+
field.onChange(value);
|
|
950
|
+
setShowCalendar(false);
|
|
951
|
+
if (onChangeFunction) {
|
|
952
|
+
onChangeFunction(value);
|
|
953
|
+
}
|
|
954
|
+
setDateError(null);
|
|
955
|
+
};
|
|
956
|
+
const handleDateError = (date) => {
|
|
957
|
+
setDateError(
|
|
958
|
+
date && !isNaN(date.getTime()) ? OUT_OF_RANGE_MESSAGE : INVALID_DATE_MESSAGE
|
|
959
|
+
);
|
|
960
|
+
if (field.value) {
|
|
961
|
+
field.onChange(null);
|
|
962
|
+
if (onChangeFunction) {
|
|
963
|
+
onChangeFunction(null);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
const commitTwoDigitYear = (e) => {
|
|
968
|
+
const typed = e.target.value.trim();
|
|
969
|
+
if (!/^\d{1,2}[/.-]\d{1,2}[/.-]\d{2}$/.test(typed)) return;
|
|
970
|
+
const date = parseDateInput(typed, maxYear, true);
|
|
971
|
+
if (isNaN(date.getTime()) || date < dateFns.startOfDay(new Date(effectiveMinDate)) || date > dateFns.endOfDay(new Date(effectiveMaxDate))) {
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
commitValue(date);
|
|
975
|
+
};
|
|
872
976
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
873
977
|
"div",
|
|
874
978
|
{
|
|
@@ -889,6 +993,7 @@ var DatePickerInput = React6.forwardRef(
|
|
|
889
993
|
id: "icon",
|
|
890
994
|
className: clsx9__default.default(
|
|
891
995
|
styles.icon,
|
|
996
|
+
hasError || dateErrorShown ? "text-dangerous-700" : "text-label",
|
|
892
997
|
"flex justify-center items-center text-[20px]"
|
|
893
998
|
),
|
|
894
999
|
children: icon
|
|
@@ -897,9 +1002,9 @@ var DatePickerInput = React6.forwardRef(
|
|
|
897
1002
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
898
1003
|
datetime2.DateInput3,
|
|
899
1004
|
{
|
|
900
|
-
outOfRangeMessage: "
|
|
901
|
-
invalidDateMessage: "
|
|
902
|
-
onError:
|
|
1005
|
+
outOfRangeMessage: "",
|
|
1006
|
+
invalidDateMessage: "",
|
|
1007
|
+
onError: handleDateError,
|
|
903
1008
|
defaultValue: normalizedValue,
|
|
904
1009
|
inputProps: {
|
|
905
1010
|
// `inputClassName`, nao `className`: o DateInput3 repassa `inputProps` para o
|
|
@@ -907,8 +1012,11 @@ var DatePickerInput = React6.forwardRef(
|
|
|
907
1012
|
// sai so com `bp6-input` e todas as classes daqui viravam letra morta (sem
|
|
908
1013
|
// `shadow-input`, sem `input-focus-ring`, sem os estados de disabled). O
|
|
909
1014
|
// InputGroup aplica `inputClassName` no proprio <input>.
|
|
910
|
-
inputClassName: styles.input,
|
|
911
|
-
|
|
1015
|
+
inputClassName: clsx9__default.default(styles.input, inputBorder(dateErrorShown)),
|
|
1016
|
+
placeholder: dateErrorShown ? dateError : void 0,
|
|
1017
|
+
style: { height: "46px" },
|
|
1018
|
+
inputRef: maskedInputRef,
|
|
1019
|
+
onBlur: commitTwoDigitYear
|
|
912
1020
|
},
|
|
913
1021
|
popoverProps: {
|
|
914
1022
|
placement: "bottom-start",
|
|
@@ -940,18 +1048,7 @@ var DatePickerInput = React6.forwardRef(
|
|
|
940
1048
|
disabled,
|
|
941
1049
|
onChange: (e, isUserChange) => {
|
|
942
1050
|
if (isUserChange) {
|
|
943
|
-
|
|
944
|
-
if (e) {
|
|
945
|
-
const date = new Date(e);
|
|
946
|
-
date.setUTCHours(23, 59, 59, 0);
|
|
947
|
-
value = date.toISOString();
|
|
948
|
-
}
|
|
949
|
-
field.onChange(value);
|
|
950
|
-
setShowCalendar(false);
|
|
951
|
-
if (onChangeFunction) {
|
|
952
|
-
onChangeFunction(value);
|
|
953
|
-
}
|
|
954
|
-
setInvalidDate(false);
|
|
1051
|
+
commitValue(e);
|
|
955
1052
|
}
|
|
956
1053
|
},
|
|
957
1054
|
value: normalizedValue,
|
|
@@ -963,9 +1060,9 @@ var DatePickerInput = React6.forwardRef(
|
|
|
963
1060
|
);
|
|
964
1061
|
return dateFns.format(adjusted, dateFnsFormat);
|
|
965
1062
|
},
|
|
966
|
-
parseDate: (value) =>
|
|
967
|
-
maxDate:
|
|
968
|
-
minDate:
|
|
1063
|
+
parseDate: (value) => parseDateInput(value, maxYear),
|
|
1064
|
+
maxDate: effectiveMaxDate,
|
|
1065
|
+
minDate: effectiveMinDate
|
|
969
1066
|
}
|
|
970
1067
|
),
|
|
971
1068
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -975,7 +1072,7 @@ var DatePickerInput = React6.forwardRef(
|
|
|
975
1072
|
"pointer-events-none ",
|
|
976
1073
|
styles.label,
|
|
977
1074
|
`
|
|
978
|
-
${field.value && field.value[0] !== null ||
|
|
1075
|
+
${field.value && field.value[0] !== null || dateErrorShown ? " scale-75 -translate-y-[10px] " : ""}
|
|
979
1076
|
${icon ? "left-[3rem]" : "left-2.5"}`
|
|
980
1077
|
),
|
|
981
1078
|
style: { top: "13px" },
|
|
@@ -1600,8 +1697,8 @@ var FilterCalendar = ({
|
|
|
1600
1697
|
name,
|
|
1601
1698
|
control,
|
|
1602
1699
|
render: ({ field }) => {
|
|
1603
|
-
var
|
|
1604
|
-
let hasValue = ((
|
|
1700
|
+
var _a2, _b, _c;
|
|
1701
|
+
let hasValue = ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.length) > 0 || !!calendarLabel && calendarLabel !== shorcuts[0].label;
|
|
1605
1702
|
const clearValue = () => {
|
|
1606
1703
|
if (!onClear) return;
|
|
1607
1704
|
onClear();
|
|
@@ -1852,13 +1949,13 @@ var FilterOptions = ({
|
|
|
1852
1949
|
} else {
|
|
1853
1950
|
const result = options.filter(
|
|
1854
1951
|
(opt) => {
|
|
1855
|
-
var
|
|
1856
|
-
return (
|
|
1952
|
+
var _a2;
|
|
1953
|
+
return (_a2 = opt == null ? void 0 : opt.label) == null ? void 0 : _a2.toLowerCase().includes(filter.toLowerCase());
|
|
1857
1954
|
}
|
|
1858
1955
|
);
|
|
1859
1956
|
const order = result.sort((a, b) => {
|
|
1860
|
-
var
|
|
1861
|
-
return (
|
|
1957
|
+
var _a2;
|
|
1958
|
+
return (_a2 = a == null ? void 0 : a.label) == null ? void 0 : _a2.toLowerCase();
|
|
1862
1959
|
});
|
|
1863
1960
|
setData(order);
|
|
1864
1961
|
}
|
|
@@ -1945,8 +2042,8 @@ var FilterOptions = ({
|
|
|
1945
2042
|
name,
|
|
1946
2043
|
control,
|
|
1947
2044
|
render: ({ field }) => {
|
|
1948
|
-
var
|
|
1949
|
-
let hasValue = isMulti ? ((
|
|
2045
|
+
var _a2, _b;
|
|
2046
|
+
let hasValue = isMulti ? ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.length) > 0 : !!((_b = field == null ? void 0 : field.value) == null ? void 0 : _b.id);
|
|
1950
2047
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1951
2048
|
react.Popover,
|
|
1952
2049
|
{
|
|
@@ -1955,7 +2052,7 @@ var FilterOptions = ({
|
|
|
1955
2052
|
"relative text-paragraph"
|
|
1956
2053
|
),
|
|
1957
2054
|
children: ({ open }) => {
|
|
1958
|
-
var
|
|
2055
|
+
var _a3, _b2;
|
|
1959
2056
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Float, { composable: true, shift: 8, zIndex: 99, offset: 6, children: [
|
|
1960
2057
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1961
2058
|
react.PopoverButton,
|
|
@@ -1996,7 +2093,7 @@ var FilterOptions = ({
|
|
|
1996
2093
|
},
|
|
1997
2094
|
"truncate cursor-pointer"
|
|
1998
2095
|
),
|
|
1999
|
-
children: isMulti ? label : ((
|
|
2096
|
+
children: isMulti ? label : ((_a3 = field == null ? void 0 : field.value) == null ? void 0 : _a3.id) ? (_b2 = field == null ? void 0 : field.value) == null ? void 0 : _b2.label : label
|
|
2000
2097
|
}
|
|
2001
2098
|
),
|
|
2002
2099
|
isMulti && field.value && field.value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-blue-500 text-accent-label text-p-xs px-1 py-[2px] rounded group-hover:bg-blue-500", children: field.value.length }),
|
|
@@ -2242,13 +2339,13 @@ var FilterSelect = ({
|
|
|
2242
2339
|
} else {
|
|
2243
2340
|
const result = options.filter(
|
|
2244
2341
|
(opt) => {
|
|
2245
|
-
var
|
|
2246
|
-
return (
|
|
2342
|
+
var _a2;
|
|
2343
|
+
return (_a2 = opt == null ? void 0 : opt.label) == null ? void 0 : _a2.toLowerCase().includes(filter.toLowerCase());
|
|
2247
2344
|
}
|
|
2248
2345
|
);
|
|
2249
2346
|
const order = result.sort((a, b) => {
|
|
2250
|
-
var
|
|
2251
|
-
return (
|
|
2347
|
+
var _a2;
|
|
2348
|
+
return (_a2 = a == null ? void 0 : a.label) == null ? void 0 : _a2.toLowerCase();
|
|
2252
2349
|
});
|
|
2253
2350
|
setData(order);
|
|
2254
2351
|
}
|
|
@@ -2335,8 +2432,8 @@ var FilterSelect = ({
|
|
|
2335
2432
|
name,
|
|
2336
2433
|
control,
|
|
2337
2434
|
render: ({ field }) => {
|
|
2338
|
-
var
|
|
2339
|
-
let hasValue = isMulti ? ((
|
|
2435
|
+
var _a2, _b;
|
|
2436
|
+
let hasValue = isMulti ? ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.length) > 0 : !!((_b = field == null ? void 0 : field.value) == null ? void 0 : _b.id);
|
|
2340
2437
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2341
2438
|
react.Popover,
|
|
2342
2439
|
{
|
|
@@ -2345,7 +2442,7 @@ var FilterSelect = ({
|
|
|
2345
2442
|
"relative text-paragraph"
|
|
2346
2443
|
),
|
|
2347
2444
|
children: ({ open }) => {
|
|
2348
|
-
var
|
|
2445
|
+
var _a3, _b2;
|
|
2349
2446
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Float, { composable: true, shift: 8, zIndex: 99, offset: 6, children: [
|
|
2350
2447
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group", children: [
|
|
2351
2448
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2358,7 +2455,7 @@ var FilterSelect = ({
|
|
|
2358
2455
|
),
|
|
2359
2456
|
children: [
|
|
2360
2457
|
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] leading-none", children: icon }),
|
|
2361
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate cursor-pointer", children: isMulti ? label : ((
|
|
2458
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate cursor-pointer", children: isMulti ? label : ((_a3 = field == null ? void 0 : field.value) == null ? void 0 : _a3.id) ? (_b2 = field == null ? void 0 : field.value) == null ? void 0 : _b2.label : label }),
|
|
2362
2459
|
isMulti && field.value && field.value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[2px] bg-blue-500 px-1 py-px text-p-xs text-white group-hover/chip:bg-[#007fb0] group-active/chip:bg-[#007fb0]", children: field.value.length }),
|
|
2363
2460
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2364
2461
|
"i",
|
|
@@ -3154,7 +3251,7 @@ var ModalDialog = ({
|
|
|
3154
3251
|
headerBorder = false,
|
|
3155
3252
|
closeOnOverlayClick = true
|
|
3156
3253
|
}) => {
|
|
3157
|
-
var
|
|
3254
|
+
var _a2;
|
|
3158
3255
|
const customStyles6 = {
|
|
3159
3256
|
content: {
|
|
3160
3257
|
top: "50%",
|
|
@@ -3175,7 +3272,7 @@ var ModalDialog = ({
|
|
|
3175
3272
|
zIndex: 9999
|
|
3176
3273
|
}
|
|
3177
3274
|
};
|
|
3178
|
-
const hasIcon = React6__namespace.default.isValidElement(icon) && !(icon.type === React6__namespace.default.Fragment && React6__namespace.default.Children.count((
|
|
3275
|
+
const hasIcon = React6__namespace.default.isValidElement(icon) && !(icon.type === React6__namespace.default.Fragment && React6__namespace.default.Children.count((_a2 = icon.props) == null ? void 0 : _a2.children) === 0);
|
|
3179
3276
|
const trigger = triggerButton ? React6.cloneElement(triggerButton, {
|
|
3180
3277
|
onClick: () => {
|
|
3181
3278
|
onOpen();
|
|
@@ -3264,10 +3361,10 @@ var ModalDialog = ({
|
|
|
3264
3361
|
// src/components/Select/Select.styles.ts
|
|
3265
3362
|
var customStyles = {
|
|
3266
3363
|
indicatorSeparator: (provided, props) => {
|
|
3267
|
-
var
|
|
3364
|
+
var _a2;
|
|
3268
3365
|
return {
|
|
3269
3366
|
...provided,
|
|
3270
|
-
backgroundColor: props.hasValue && ((
|
|
3367
|
+
backgroundColor: props.hasValue && ((_a2 = provided == null ? void 0 : provided.selectProps) == null ? void 0 : _a2.isSearchable) ? "var(--input)" : "transparent"
|
|
3271
3368
|
};
|
|
3272
3369
|
},
|
|
3273
3370
|
clearIndicator: (provided) => ({
|
|
@@ -3427,7 +3524,7 @@ var SelectField = ({
|
|
|
3427
3524
|
clearOnMenuClose,
|
|
3428
3525
|
showArrow = true
|
|
3429
3526
|
}) => {
|
|
3430
|
-
var
|
|
3527
|
+
var _a2;
|
|
3431
3528
|
const { Option, DropdownIndicator, ClearIndicator, SingleValue } = Select.components;
|
|
3432
3529
|
const selectRef = React6.useRef(null);
|
|
3433
3530
|
const [inputValue, setInputValue] = React6.useState("");
|
|
@@ -3438,8 +3535,8 @@ var SelectField = ({
|
|
|
3438
3535
|
const [isFocused, setIsFocused] = React6.useState(false);
|
|
3439
3536
|
React6.useEffect(() => {
|
|
3440
3537
|
const updateAvailableHeight = () => {
|
|
3441
|
-
var
|
|
3442
|
-
if ((
|
|
3538
|
+
var _a3, _b;
|
|
3539
|
+
if ((_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.getBoundingClientRect) {
|
|
3443
3540
|
const rect = (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
3444
3541
|
const bottomSpace = window.innerHeight - rect.bottom;
|
|
3445
3542
|
const margin = bottomSpace - 24;
|
|
@@ -3469,7 +3566,7 @@ var SelectField = ({
|
|
|
3469
3566
|
};
|
|
3470
3567
|
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
3471
3568
|
const fieldValidationMessages = [
|
|
3472
|
-
(
|
|
3569
|
+
(_a2 = fieldValidation[name]) == null ? void 0 : _a2.message,
|
|
3473
3570
|
error == null ? void 0 : error.message
|
|
3474
3571
|
];
|
|
3475
3572
|
const hasError = {
|
|
@@ -3538,7 +3635,7 @@ var SelectField = ({
|
|
|
3538
3635
|
}
|
|
3539
3636
|
};
|
|
3540
3637
|
const NoOptionsMessage = (props) => {
|
|
3541
|
-
var
|
|
3638
|
+
var _a3, _b;
|
|
3542
3639
|
if (props.selectProps.inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && props.selectProps.inputValue.length < debounce2) {
|
|
3543
3640
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
3544
3641
|
"Digite ",
|
|
@@ -3547,18 +3644,18 @@ var SelectField = ({
|
|
|
3547
3644
|
] });
|
|
3548
3645
|
} else if (initialMessage && !debounce2 && isSearchable && props.selectProps.inputValue.length === 0) {
|
|
3549
3646
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-neutral-300", children: initialMessage });
|
|
3550
|
-
} else if ((props.selectProps.inputValue.length > 0 && isSearchable || !isSearchable || isSearchable && ((
|
|
3647
|
+
} else if ((props.selectProps.inputValue.length > 0 && isSearchable || !isSearchable || isSearchable && ((_a3 = props == null ? void 0 : props.options) == null ? void 0 : _a3.length) == 0) && ((_b = props == null ? void 0 : props.options) == null ? void 0 : _b.length) == 0) {
|
|
3551
3648
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-neutral-300", children: emptyMessage || "Sem opc\u0327o\u0303es disponi\u0301veis" });
|
|
3552
3649
|
}
|
|
3553
3650
|
};
|
|
3554
3651
|
const DropdownIndicatorCustom = (props) => {
|
|
3555
|
-
var
|
|
3652
|
+
var _a3;
|
|
3556
3653
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3557
3654
|
"i",
|
|
3558
3655
|
{
|
|
3559
3656
|
className: clsx9__default.default(
|
|
3560
3657
|
"uil text-[20px]",
|
|
3561
|
-
((
|
|
3658
|
+
((_a3 = props.selectProps) == null ? void 0 : _a3.menuIsOpen) ? "uil-angle-up" : "uil-angle-down",
|
|
3562
3659
|
small ? "h-[20px] -mt-[7px]" : "h-full"
|
|
3563
3660
|
)
|
|
3564
3661
|
}
|
|
@@ -3574,10 +3671,10 @@ var SelectField = ({
|
|
|
3574
3671
|
}
|
|
3575
3672
|
};
|
|
3576
3673
|
const handleKeyDown = async (event) => {
|
|
3577
|
-
var
|
|
3674
|
+
var _a3;
|
|
3578
3675
|
if (event.key === "Enter") {
|
|
3579
3676
|
event.preventDefault();
|
|
3580
|
-
const fetchedOptions = await loadOptions((
|
|
3677
|
+
const fetchedOptions = await loadOptions((_a3 = event == null ? void 0 : event.target) == null ? void 0 : _a3.value);
|
|
3581
3678
|
if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
|
|
3582
3679
|
onChange2(fetchedOptions[0]);
|
|
3583
3680
|
}
|
|
@@ -3696,10 +3793,10 @@ var ValueContainer = ({ children, ...props }) => {
|
|
|
3696
3793
|
// src/components/SelectFieldBip/SelectFieldBip.styles.tsx
|
|
3697
3794
|
var customStyles2 = {
|
|
3698
3795
|
indicatorSeparator: (provided, props) => {
|
|
3699
|
-
var
|
|
3796
|
+
var _a2;
|
|
3700
3797
|
return {
|
|
3701
3798
|
...provided,
|
|
3702
|
-
backgroundColor: props.hasValue && ((
|
|
3799
|
+
backgroundColor: props.hasValue && ((_a2 = provided == null ? void 0 : provided.selectProps) == null ? void 0 : _a2.isSearchable) ? "var(--input)" : "transparent",
|
|
3703
3800
|
padding: "0px"
|
|
3704
3801
|
};
|
|
3705
3802
|
},
|
|
@@ -3711,11 +3808,11 @@ var customStyles2 = {
|
|
|
3711
3808
|
}
|
|
3712
3809
|
}),
|
|
3713
3810
|
dropdownIndicator: (provided, state) => {
|
|
3714
|
-
var
|
|
3811
|
+
var _a2;
|
|
3715
3812
|
return {
|
|
3716
3813
|
...provided,
|
|
3717
3814
|
color: "var(--paragraph)",
|
|
3718
|
-
transform: ((
|
|
3815
|
+
transform: ((_a2 = state == null ? void 0 : state.selectProps) == null ? void 0 : _a2.menuIsOpen) ? "rotate(180deg)" : "rotate(0)",
|
|
3719
3816
|
":hover": {
|
|
3720
3817
|
color: "var(--paragraph)"
|
|
3721
3818
|
}
|
|
@@ -3863,7 +3960,7 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
3863
3960
|
loading: "Carregando..."
|
|
3864
3961
|
}
|
|
3865
3962
|
}, ref) => {
|
|
3866
|
-
var
|
|
3963
|
+
var _a2;
|
|
3867
3964
|
const { Option, SingleValue } = Select.components;
|
|
3868
3965
|
const selectRef = React6.useRef(null);
|
|
3869
3966
|
const [inputValue, setInputValue] = React6.useState("");
|
|
@@ -3871,16 +3968,16 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
3871
3968
|
const [cachedOptions, setCachedOptions] = React6.useState([]);
|
|
3872
3969
|
React6.useImperativeHandle(ref, () => ({
|
|
3873
3970
|
focus: () => {
|
|
3874
|
-
var
|
|
3875
|
-
return (
|
|
3971
|
+
var _a3;
|
|
3972
|
+
return (_a3 = selectRef.current) == null ? void 0 : _a3.focus();
|
|
3876
3973
|
},
|
|
3877
3974
|
clearValue: () => {
|
|
3878
|
-
var
|
|
3879
|
-
return (
|
|
3975
|
+
var _a3;
|
|
3976
|
+
return (_a3 = selectRef.current) == null ? void 0 : _a3.clearValue();
|
|
3880
3977
|
},
|
|
3881
3978
|
getValue: () => {
|
|
3882
|
-
var
|
|
3883
|
-
return (
|
|
3979
|
+
var _a3;
|
|
3980
|
+
return (_a3 = selectRef.current) == null ? void 0 : _a3.getValue();
|
|
3884
3981
|
},
|
|
3885
3982
|
selectRef: selectRef.current
|
|
3886
3983
|
}));
|
|
@@ -3898,7 +3995,7 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
3898
3995
|
};
|
|
3899
3996
|
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
3900
3997
|
const fieldValidationMessages = [
|
|
3901
|
-
(
|
|
3998
|
+
(_a2 = fieldValidation[name]) == null ? void 0 : _a2.message,
|
|
3902
3999
|
error == null ? void 0 : error.message
|
|
3903
4000
|
];
|
|
3904
4001
|
const hasError = {
|
|
@@ -3979,7 +4076,7 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
3979
4076
|
}
|
|
3980
4077
|
};
|
|
3981
4078
|
const NoOptionsMessage = (props) => {
|
|
3982
|
-
var
|
|
4079
|
+
var _a3;
|
|
3983
4080
|
if (inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && inputValue.length < debounce2) {
|
|
3984
4081
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3985
4082
|
"div",
|
|
@@ -3989,7 +4086,7 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
3989
4086
|
children: messages.debounce.replace("{debounce}", String(debounce2))
|
|
3990
4087
|
}
|
|
3991
4088
|
);
|
|
3992
|
-
} else if (inputValue.length > 0 && ((
|
|
4089
|
+
} else if (inputValue.length > 0 && ((_a3 = props == null ? void 0 : props.options) == null ? void 0 : _a3.length) == 0) {
|
|
3993
4090
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3994
4091
|
"div",
|
|
3995
4092
|
{
|
|
@@ -4004,7 +4101,7 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
4004
4101
|
return null;
|
|
4005
4102
|
};
|
|
4006
4103
|
const handleKeyDown = async (event) => {
|
|
4007
|
-
var
|
|
4104
|
+
var _a3;
|
|
4008
4105
|
if (event.key === "Enter") {
|
|
4009
4106
|
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
4010
4107
|
event.preventDefault();
|
|
@@ -4014,17 +4111,17 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
4014
4111
|
if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
|
|
4015
4112
|
onChange(fetchedOptions[0]);
|
|
4016
4113
|
setTimeout(() => {
|
|
4017
|
-
var
|
|
4114
|
+
var _a4, _b, _c;
|
|
4018
4115
|
if (clearAfterSelect) {
|
|
4019
4116
|
setInputValue("");
|
|
4020
|
-
(
|
|
4117
|
+
(_a4 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a4.clearValue();
|
|
4021
4118
|
(_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.focus();
|
|
4022
4119
|
(_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.onMenuClose();
|
|
4023
4120
|
field.onChange(null);
|
|
4024
4121
|
}
|
|
4025
4122
|
}, 10);
|
|
4026
4123
|
} else {
|
|
4027
|
-
onErrorBip((
|
|
4124
|
+
onErrorBip((_a3 = event == null ? void 0 : event.target) == null ? void 0 : _a3.value);
|
|
4028
4125
|
selectRef.current.inputRef.select();
|
|
4029
4126
|
selectRef.current.onMenuClose();
|
|
4030
4127
|
}
|
|
@@ -4037,12 +4134,12 @@ var SelectFieldBip = React6.forwardRef(
|
|
|
4037
4134
|
return value;
|
|
4038
4135
|
};
|
|
4039
4136
|
const onChange = async (value, action) => {
|
|
4040
|
-
var
|
|
4137
|
+
var _a3, _b, _c, _d, _e;
|
|
4041
4138
|
if (onChangeValue) onChangeValue(value);
|
|
4042
4139
|
if ((action == null ? void 0 : action.action) === "select-option") {
|
|
4043
4140
|
if (clearAfterSelect) {
|
|
4044
4141
|
setInputValue("");
|
|
4045
|
-
(
|
|
4142
|
+
(_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.clearValue();
|
|
4046
4143
|
(_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.onMenuClose();
|
|
4047
4144
|
(_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.focus();
|
|
4048
4145
|
field.onChange(null);
|
|
@@ -4280,7 +4377,7 @@ function PaginationSelect({
|
|
|
4280
4377
|
pageSizeOptions,
|
|
4281
4378
|
table
|
|
4282
4379
|
}) {
|
|
4283
|
-
var
|
|
4380
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
4284
4381
|
const pageCount = table == null ? void 0 : table.getPageCount();
|
|
4285
4382
|
const pagesArray = pageCount ? [...Array(pageCount)] : [];
|
|
4286
4383
|
const options = pagesArray == null ? void 0 : pagesArray.map((item, index) => ({
|
|
@@ -4288,7 +4385,7 @@ function PaginationSelect({
|
|
|
4288
4385
|
name: index
|
|
4289
4386
|
}));
|
|
4290
4387
|
const [pageSizeSelected, setPageSizeSelected] = React6.useState({
|
|
4291
|
-
id: ((
|
|
4388
|
+
id: ((_a2 = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a2.id) || 20,
|
|
4292
4389
|
name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
|
|
4293
4390
|
});
|
|
4294
4391
|
const [pageSelected, setPageSelected] = React6.useState({
|
|
@@ -4335,8 +4432,8 @@ function PaginationSelect({
|
|
|
4335
4432
|
);
|
|
4336
4433
|
}, [table == null ? void 0 : table.getPageCount()]);
|
|
4337
4434
|
React6.useEffect(() => {
|
|
4338
|
-
var
|
|
4339
|
-
if (((_b2 = (
|
|
4435
|
+
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
4436
|
+
if (((_b2 = (_a3 = table == null ? void 0 : table.getState()) == null ? void 0 : _a3.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
|
|
4340
4437
|
setPageSelected({
|
|
4341
4438
|
id: (_d2 = (_c2 = table == null ? void 0 : table.getState()) == null ? void 0 : _c2.pagination) == null ? void 0 : _d2.pageIndex,
|
|
4342
4439
|
name: (_f2 = (_e2 = table == null ? void 0 : table.getState()) == null ? void 0 : _e2.pagination) == null ? void 0 : _f2.pageIndex
|
|
@@ -4408,8 +4505,8 @@ function PaginationSelect({
|
|
|
4408
4505
|
{
|
|
4409
4506
|
as: "input",
|
|
4410
4507
|
onKeyDown: (e) => {
|
|
4411
|
-
var
|
|
4412
|
-
const val = Number((
|
|
4508
|
+
var _a3;
|
|
4509
|
+
const val = Number((_a3 = e.target) == null ? void 0 : _a3.value);
|
|
4413
4510
|
if (e.key == "Enter" && val && val <= pageCount) {
|
|
4414
4511
|
setPageSelected({
|
|
4415
4512
|
id: val - 1,
|
|
@@ -4545,8 +4642,8 @@ function DataTablePagination({
|
|
|
4545
4642
|
paginationScroll,
|
|
4546
4643
|
pageSizeOptions = []
|
|
4547
4644
|
}) {
|
|
4548
|
-
var
|
|
4549
|
-
const selectedPage = (
|
|
4645
|
+
var _a2, _b, _c, _d, _e;
|
|
4646
|
+
const selectedPage = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination.pageIndex;
|
|
4550
4647
|
const results = totalData;
|
|
4551
4648
|
const pageCount = table == null ? void 0 : table.getPageCount();
|
|
4552
4649
|
const limitPagePositive = ((_b = table == null ? void 0 : table.getState()) == null ? void 0 : _b.pagination.pageIndex) + 2;
|
|
@@ -4746,7 +4843,7 @@ function DataTable({
|
|
|
4746
4843
|
pageSizeOptions,
|
|
4747
4844
|
onFinishFetch
|
|
4748
4845
|
}) {
|
|
4749
|
-
var
|
|
4846
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
4750
4847
|
const tableRef = React6.useRef(null);
|
|
4751
4848
|
const [columnVisibility, setColumnVisibility] = React6.useState({});
|
|
4752
4849
|
const [columnFilters, setColumnFilters] = React6.useState([]);
|
|
@@ -4770,12 +4867,12 @@ function DataTable({
|
|
|
4770
4867
|
[pageIndex, pageSize]
|
|
4771
4868
|
);
|
|
4772
4869
|
const fetch = () => {
|
|
4773
|
-
var
|
|
4870
|
+
var _a3, _b2;
|
|
4774
4871
|
if (fetchData && !autoPagination) {
|
|
4775
4872
|
fetchData({
|
|
4776
4873
|
pageSize,
|
|
4777
4874
|
pageIndex,
|
|
4778
|
-
order: (
|
|
4875
|
+
order: (_a3 = sorting[0]) == null ? void 0 : _a3.id,
|
|
4779
4876
|
orderDir: ((_b2 = sorting[0]) == null ? void 0 : _b2.desc) ? "DESC" : "ASC"
|
|
4780
4877
|
}).then((response) => {
|
|
4781
4878
|
setDataTable(response.rows);
|
|
@@ -4820,8 +4917,8 @@ function DataTable({
|
|
|
4820
4917
|
React6.useEffect(() => {
|
|
4821
4918
|
if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
|
|
4822
4919
|
const resizeObserver = new ResizeObserver(() => {
|
|
4823
|
-
var
|
|
4824
|
-
setPaginationScroll((
|
|
4920
|
+
var _a3;
|
|
4921
|
+
setPaginationScroll((_a3 = tableContainerRef == null ? void 0 : tableContainerRef.current) == null ? void 0 : _a3.scrollWidth);
|
|
4825
4922
|
});
|
|
4826
4923
|
resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
|
|
4827
4924
|
return () => resizeObserver.disconnect();
|
|
@@ -4910,10 +5007,10 @@ function DataTable({
|
|
|
4910
5007
|
setRowSelection({});
|
|
4911
5008
|
return;
|
|
4912
5009
|
};
|
|
4913
|
-
const hideTableData = dataTable && (dataTable == null ? void 0 : dataTable.length) == 0 && !loading && !hideBlankState || !dataTable || ((_b = (
|
|
5010
|
+
const hideTableData = dataTable && (dataTable == null ? void 0 : dataTable.length) == 0 && !loading && !hideBlankState || !dataTable || ((_b = (_a2 = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _a2.rows) == null ? void 0 : _b.length) == 0;
|
|
4914
5011
|
const canShowTableData = !hidePagination && totalData > 0 && table;
|
|
4915
5012
|
function renderBottomTable() {
|
|
4916
|
-
var
|
|
5013
|
+
var _a3;
|
|
4917
5014
|
if (hideTableData && totalData !== null) {
|
|
4918
5015
|
if (emptyState) {
|
|
4919
5016
|
return emptyState;
|
|
@@ -4930,7 +5027,7 @@ function DataTable({
|
|
|
4930
5027
|
tableRef: tableContainerRef,
|
|
4931
5028
|
selectAllOption,
|
|
4932
5029
|
onSelectAll,
|
|
4933
|
-
rowsSelected: (
|
|
5030
|
+
rowsSelected: (_a3 = Object.keys(rowSelection || {})) == null ? void 0 : _a3.length,
|
|
4934
5031
|
onRemoveAll,
|
|
4935
5032
|
paginationScroll,
|
|
4936
5033
|
pageSizeOptions
|
|
@@ -4944,21 +5041,21 @@ function DataTable({
|
|
|
4944
5041
|
if (rowSelection && Object.keys(rowSelection).length == 0) {
|
|
4945
5042
|
const elements = document.getElementsByClassName("th-shadow");
|
|
4946
5043
|
Object.keys(elements).forEach((index) => {
|
|
4947
|
-
var
|
|
4948
|
-
(_b2 = (
|
|
5044
|
+
var _a3, _b2;
|
|
5045
|
+
(_b2 = (_a3 = elements[index]) == null ? void 0 : _a3.classList) == null ? void 0 : _b2.add("with-shadow");
|
|
4949
5046
|
});
|
|
4950
5047
|
} else if (rowSelection && Object.keys(rowSelection).length == 1) {
|
|
4951
5048
|
const elements = document.getElementsByClassName("th-shadow");
|
|
4952
5049
|
Object.keys(elements).forEach((index) => {
|
|
4953
|
-
var
|
|
4954
|
-
(_b2 = (
|
|
5050
|
+
var _a3, _b2;
|
|
5051
|
+
(_b2 = (_a3 = elements[index]) == null ? void 0 : _a3.classList) == null ? void 0 : _b2.remove("with-shadow");
|
|
4955
5052
|
});
|
|
4956
5053
|
}
|
|
4957
5054
|
}, [rowSelection]);
|
|
4958
5055
|
const stylesRow = (row) => {
|
|
4959
|
-
var
|
|
5056
|
+
var _a3, _b2;
|
|
4960
5057
|
const tb = table;
|
|
4961
|
-
return rowClassName ? (_b2 = (
|
|
5058
|
+
return rowClassName ? (_b2 = (_a3 = tb == null ? void 0 : tb.options) == null ? void 0 : _a3.meta) == null ? void 0 : _b2.getRowStyles(row) : {};
|
|
4962
5059
|
};
|
|
4963
5060
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col", children: [
|
|
4964
5061
|
showFilter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex justify-between md:items-center flex-col md:flex-row gap-y-2 md:gap-y-0", children: [
|
|
@@ -5005,7 +5102,7 @@ function DataTable({
|
|
|
5005
5102
|
] }),
|
|
5006
5103
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "table w-full mr-[2px]", ref: tableRef, children: [
|
|
5007
5104
|
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: (_d = table == null ? void 0 : table.getHeaderGroups()) == null ? void 0 : _d.map((headerGroup, headerIndex) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header, index) => {
|
|
5008
|
-
var
|
|
5105
|
+
var _a3, _b2, _c2;
|
|
5009
5106
|
const classes = header.column.columnDef.meta;
|
|
5010
5107
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5011
5108
|
TableHead,
|
|
@@ -5027,7 +5124,7 @@ function DataTable({
|
|
|
5027
5124
|
header.column.columnDef.header,
|
|
5028
5125
|
header.getContext()
|
|
5029
5126
|
),
|
|
5030
|
-
((
|
|
5127
|
+
((_a3 = sorting[0]) == null ? void 0 : _a3.id) == header.column.id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5031
5128
|
"i",
|
|
5032
5129
|
{
|
|
5033
5130
|
className: clsx9__default.default(
|
|
@@ -5414,10 +5511,10 @@ var EditableTextSelect = ({
|
|
|
5414
5511
|
};
|
|
5415
5512
|
const fuse = new Fuse__default.default(optionsList, optionsFuse);
|
|
5416
5513
|
const filter = () => {
|
|
5417
|
-
var
|
|
5514
|
+
var _a2;
|
|
5418
5515
|
let results = [...options];
|
|
5419
5516
|
if (inputSearch) {
|
|
5420
|
-
results = (
|
|
5517
|
+
results = (_a2 = fuse.search(inputSearch)) == null ? void 0 : _a2.map((result) => result.item);
|
|
5421
5518
|
}
|
|
5422
5519
|
setOptionsList(results);
|
|
5423
5520
|
};
|
|
@@ -5433,7 +5530,7 @@ var EditableTextSelect = ({
|
|
|
5433
5530
|
control,
|
|
5434
5531
|
name,
|
|
5435
5532
|
render: ({ field }) => {
|
|
5436
|
-
var
|
|
5533
|
+
var _a2;
|
|
5437
5534
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Menu, { children: [
|
|
5438
5535
|
/* @__PURE__ */ jsxRuntime.jsx(react.Menu.Button, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5439
5536
|
"div",
|
|
@@ -5441,7 +5538,7 @@ var EditableTextSelect = ({
|
|
|
5441
5538
|
className: "group flex gap-[5px] cursor-pointer z-[500] items-center",
|
|
5442
5539
|
onClick: () => setShowModal(!showModal),
|
|
5443
5540
|
children: [
|
|
5444
|
-
field.value ? valueStyle ? valueStyle(field.value) : (
|
|
5541
|
+
field.value ? valueStyle ? valueStyle(field.value) : (_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.name : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5445
5542
|
"label",
|
|
5446
5543
|
{
|
|
5447
5544
|
className: clsx9__default.default(
|
|
@@ -5481,8 +5578,8 @@ var EditableTextSelect = ({
|
|
|
5481
5578
|
}
|
|
5482
5579
|
) }),
|
|
5483
5580
|
optionsList == null ? void 0 : optionsList.map((opt) => {
|
|
5484
|
-
var
|
|
5485
|
-
const selected = (opt == null ? void 0 : opt.id) === ((
|
|
5581
|
+
var _a3;
|
|
5582
|
+
const selected = (opt == null ? void 0 : opt.id) === ((_a3 = field == null ? void 0 : field.value) == null ? void 0 : _a3.id);
|
|
5486
5583
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5487
5584
|
react.Menu.Item,
|
|
5488
5585
|
{
|
|
@@ -5733,7 +5830,7 @@ var initialState = {
|
|
|
5733
5830
|
files: []
|
|
5734
5831
|
};
|
|
5735
5832
|
function reducer(state, action) {
|
|
5736
|
-
var
|
|
5833
|
+
var _a2, _b;
|
|
5737
5834
|
switch (action.type) {
|
|
5738
5835
|
case "UPLOAD_START":
|
|
5739
5836
|
return {
|
|
@@ -5750,7 +5847,7 @@ function reducer(state, action) {
|
|
|
5750
5847
|
};
|
|
5751
5848
|
case "UPLOAD_END":
|
|
5752
5849
|
return {
|
|
5753
|
-
files: (
|
|
5850
|
+
files: (_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.map((file) => {
|
|
5754
5851
|
if (file.name === action.payload.name) {
|
|
5755
5852
|
return {
|
|
5756
5853
|
...file,
|
|
@@ -5838,7 +5935,7 @@ var FileUpload = ({
|
|
|
5838
5935
|
name,
|
|
5839
5936
|
limitMessage
|
|
5840
5937
|
}) => {
|
|
5841
|
-
var
|
|
5938
|
+
var _a2;
|
|
5842
5939
|
const [state, dispatch] = React6.useReducer(reducer, initialState);
|
|
5843
5940
|
const [dragging, setDragging] = React6.useState(false);
|
|
5844
5941
|
const [loading, setLoading] = React6.useState(false);
|
|
@@ -5848,8 +5945,8 @@ var FileUpload = ({
|
|
|
5848
5945
|
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
5849
5946
|
};
|
|
5850
5947
|
React6.useEffect(() => {
|
|
5851
|
-
var
|
|
5852
|
-
if ((
|
|
5948
|
+
var _a3;
|
|
5949
|
+
if ((_a3 = state == null ? void 0 : state.files) == null ? void 0 : _a3.some((file) => file.loading === true)) {
|
|
5853
5950
|
setLoading(true);
|
|
5854
5951
|
} else {
|
|
5855
5952
|
setLoading(false);
|
|
@@ -5861,8 +5958,8 @@ var FileUpload = ({
|
|
|
5861
5958
|
}
|
|
5862
5959
|
}, [files]);
|
|
5863
5960
|
React6.useEffect(() => {
|
|
5864
|
-
var
|
|
5865
|
-
if (!multiple && ((
|
|
5961
|
+
var _a3;
|
|
5962
|
+
if (!multiple && ((_a3 = state == null ? void 0 : state.files) == null ? void 0 : _a3.length) === 0 || multiple) {
|
|
5866
5963
|
window.addEventListener("dragover", handleDragOver);
|
|
5867
5964
|
window.addEventListener("drop", handleDrop);
|
|
5868
5965
|
window.addEventListener("dragleave", handleDragLeave);
|
|
@@ -5874,21 +5971,21 @@ var FileUpload = ({
|
|
|
5874
5971
|
};
|
|
5875
5972
|
}, [multiple, state.files]);
|
|
5876
5973
|
const handleDragOver = (event) => {
|
|
5877
|
-
var
|
|
5974
|
+
var _a3;
|
|
5878
5975
|
event.preventDefault();
|
|
5879
5976
|
event.stopPropagation();
|
|
5880
|
-
if (!multiple && ((
|
|
5977
|
+
if (!multiple && ((_a3 = state.files) == null ? void 0 : _a3.length) === 1) {
|
|
5881
5978
|
setDragging(false);
|
|
5882
5979
|
} else {
|
|
5883
5980
|
setDragging(true);
|
|
5884
5981
|
}
|
|
5885
5982
|
};
|
|
5886
5983
|
const handleDrop = (event) => {
|
|
5887
|
-
var
|
|
5984
|
+
var _a3, _b, _c;
|
|
5888
5985
|
event.preventDefault();
|
|
5889
5986
|
event.stopPropagation();
|
|
5890
5987
|
setDragging(false);
|
|
5891
|
-
let files2 = [...(
|
|
5988
|
+
let files2 = [...(_a3 = event == null ? void 0 : event.dataTransfer) == null ? void 0 : _a3.files];
|
|
5892
5989
|
if (!multiple && (files2 == null ? void 0 : files2.length) === 1 || multiple && (files2 == null ? void 0 : files2.length) > 0) {
|
|
5893
5990
|
const existingFiles = (_b = state == null ? void 0 : state.files) == null ? void 0 : _b.map((f) => f.name);
|
|
5894
5991
|
files2 = files2.filter((f) => !(existingFiles == null ? void 0 : existingFiles.includes(f.name)));
|
|
@@ -5994,12 +6091,12 @@ var FileUpload = ({
|
|
|
5994
6091
|
});
|
|
5995
6092
|
};
|
|
5996
6093
|
const renderContent = () => {
|
|
5997
|
-
var
|
|
6094
|
+
var _a3;
|
|
5998
6095
|
if (loading) {
|
|
5999
6096
|
return /* @__PURE__ */ jsxRuntime.jsx(LoadingContent, {});
|
|
6000
6097
|
} else if (dragging) {
|
|
6001
6098
|
return /* @__PURE__ */ jsxRuntime.jsx(DraggingContent, {});
|
|
6002
|
-
} else if (!multiple && ((
|
|
6099
|
+
} else if (!multiple && ((_a3 = state == null ? void 0 : state.files) == null ? void 0 : _a3.length) > 0) {
|
|
6003
6100
|
return /* @__PURE__ */ jsxRuntime.jsx(BlockedContent, {});
|
|
6004
6101
|
}
|
|
6005
6102
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6060,7 +6157,7 @@ var FileUpload = ({
|
|
|
6060
6157
|
"flex gap-[6px]": direction === "horizontal" && !isImage
|
|
6061
6158
|
}
|
|
6062
6159
|
),
|
|
6063
|
-
children: (
|
|
6160
|
+
children: (_a2 = state == null ? void 0 : state.files) == null ? void 0 : _a2.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6064
6161
|
FileStatus,
|
|
6065
6162
|
{
|
|
6066
6163
|
name: file == null ? void 0 : file.name,
|
|
@@ -6761,20 +6858,20 @@ var MultiSelectBottom = ({
|
|
|
6761
6858
|
control,
|
|
6762
6859
|
defaultValue,
|
|
6763
6860
|
render: ({ field }) => {
|
|
6764
|
-
var
|
|
6861
|
+
var _a2, _b;
|
|
6765
6862
|
const { DropdownIndicator, Option } = Select.components;
|
|
6766
6863
|
const DropdownIndicatorCustom = (props) => {
|
|
6767
6864
|
return /* @__PURE__ */ jsxRuntime.jsx(DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[20px]" }) });
|
|
6768
6865
|
};
|
|
6769
6866
|
const NoOptionsMessage = (props) => {
|
|
6770
|
-
var
|
|
6867
|
+
var _a3;
|
|
6771
6868
|
if (props.selectProps.inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && props.selectProps.inputValue.length < debounce2) {
|
|
6772
6869
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
6773
6870
|
"Digite ",
|
|
6774
6871
|
debounce2,
|
|
6775
6872
|
" ou mais caracteres para pesquisar"
|
|
6776
6873
|
] });
|
|
6777
|
-
} else if (props.selectProps.inputValue.length > 0 && ((
|
|
6874
|
+
} else if (props.selectProps.inputValue.length > 0 && ((_a3 = props == null ? void 0 : props.options) == null ? void 0 : _a3.length) == 0) {
|
|
6778
6875
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-neutral-300", children: "Nenhum dado encontrado" });
|
|
6779
6876
|
}
|
|
6780
6877
|
};
|
|
@@ -6874,7 +6971,7 @@ var MultiSelectBottom = ({
|
|
|
6874
6971
|
},
|
|
6875
6972
|
index
|
|
6876
6973
|
)),
|
|
6877
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-x-2 gap-y-1 flex-wrap", children: ((
|
|
6974
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-x-2 gap-y-1 flex-wrap", children: ((_a2 = field == null ? void 0 : field.value) == null ? void 0 : _a2.length) > 0 ? (_b = field == null ? void 0 : field.value) == null ? void 0 : _b.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-p-sm bg-neutral-100 rounded-[20px] py-2 px-3 flex items-center justify-between mt-3", children: [
|
|
6878
6975
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: item.label }),
|
|
6879
6976
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6880
6977
|
"button",
|
|
@@ -7449,7 +7546,7 @@ var variants6 = {
|
|
|
7449
7546
|
};
|
|
7450
7547
|
var Timeline = ({ data }) => {
|
|
7451
7548
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col", children: (data == null ? void 0 : data.length) > 0 && (data == null ? void 0 : data.map((item, index) => {
|
|
7452
|
-
var
|
|
7549
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
7453
7550
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
|
|
7454
7551
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mr-3 relative", children: [
|
|
7455
7552
|
index !== data.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[2px] bg-neutral-200 ml-[5px] h-full absolute mt-8" }),
|
|
@@ -7459,7 +7556,7 @@ var Timeline = ({ data }) => {
|
|
|
7459
7556
|
{
|
|
7460
7557
|
className: clsx9__default.default(
|
|
7461
7558
|
{
|
|
7462
|
-
[(
|
|
7559
|
+
[(_a2 = variants6[item == null ? void 0 : item.variant]) == null ? void 0 : _a2.big]: !(item == null ? void 0 : item.color)
|
|
7463
7560
|
},
|
|
7464
7561
|
"h-3 w-3 rounded-full"
|
|
7465
7562
|
),
|