@charlesgomes/leafcode-shared-lib-react 1.0.64 → 1.0.66
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.d.mts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +135 -97
- package/dist/index.mjs +134 -96
- package/dist/styles/input.css +10 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -201,8 +201,10 @@ declare const customMatchModes: {
|
|
|
201
201
|
notEndsWith: string;
|
|
202
202
|
empty: string;
|
|
203
203
|
notEmpty: string;
|
|
204
|
+
dateBeforeAndEquals: string;
|
|
205
|
+
dateAfterAndEquals: string;
|
|
204
206
|
};
|
|
205
|
-
declare const getDefaultFilterMatchOptionsString: (isLanguagePtBr?: boolean) => {
|
|
207
|
+
declare const getDefaultFilterMatchOptionsString: (isLanguagePtBr?: boolean, isNullable?: boolean) => {
|
|
206
208
|
label: string;
|
|
207
209
|
value: string;
|
|
208
210
|
}[];
|
|
@@ -210,17 +212,17 @@ declare const getDefaultFilterMatchOptionsStringArray: (isLanguagePtBr?: boolean
|
|
|
210
212
|
label: string;
|
|
211
213
|
value: FilterMatchMode;
|
|
212
214
|
}[];
|
|
213
|
-
declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean) => {
|
|
215
|
+
declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean, isNullable?: boolean) => {
|
|
214
216
|
label: string;
|
|
215
|
-
value:
|
|
217
|
+
value: string;
|
|
216
218
|
}[];
|
|
217
|
-
declare const getDefaultFilterMatchOptionsEnum: (isLanguagePtBr: boolean) => {
|
|
219
|
+
declare const getDefaultFilterMatchOptionsEnum: (isLanguagePtBr: boolean, isNullable?: boolean) => {
|
|
218
220
|
label: string;
|
|
219
221
|
value: string;
|
|
220
222
|
}[];
|
|
221
|
-
declare const
|
|
223
|
+
declare const getNullable: (isLanguagePtBr: boolean) => {
|
|
222
224
|
label: string;
|
|
223
|
-
value:
|
|
225
|
+
value: string;
|
|
224
226
|
}[];
|
|
225
227
|
|
|
226
228
|
declare const mapPrimeToBackendFilters: (filters: any, globalFilterFields: string[]) => {
|
|
@@ -329,4 +331,4 @@ declare const LeafcodeThemeProvider: ({ children, theme, }: LeafcodeThemeProvide
|
|
|
329
331
|
|
|
330
332
|
declare const defaultTheme: LeafcodeTheme;
|
|
331
333
|
|
|
332
|
-
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum,
|
|
334
|
+
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getNullable, getUrlParams, mapPrimeToBackendFilters };
|
package/dist/index.d.ts
CHANGED
|
@@ -201,8 +201,10 @@ declare const customMatchModes: {
|
|
|
201
201
|
notEndsWith: string;
|
|
202
202
|
empty: string;
|
|
203
203
|
notEmpty: string;
|
|
204
|
+
dateBeforeAndEquals: string;
|
|
205
|
+
dateAfterAndEquals: string;
|
|
204
206
|
};
|
|
205
|
-
declare const getDefaultFilterMatchOptionsString: (isLanguagePtBr?: boolean) => {
|
|
207
|
+
declare const getDefaultFilterMatchOptionsString: (isLanguagePtBr?: boolean, isNullable?: boolean) => {
|
|
206
208
|
label: string;
|
|
207
209
|
value: string;
|
|
208
210
|
}[];
|
|
@@ -210,17 +212,17 @@ declare const getDefaultFilterMatchOptionsStringArray: (isLanguagePtBr?: boolean
|
|
|
210
212
|
label: string;
|
|
211
213
|
value: FilterMatchMode;
|
|
212
214
|
}[];
|
|
213
|
-
declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean) => {
|
|
215
|
+
declare const getDefaultFilterMatchOptionsDate: (isLanguagePtBr: boolean, isNullable?: boolean) => {
|
|
214
216
|
label: string;
|
|
215
|
-
value:
|
|
217
|
+
value: string;
|
|
216
218
|
}[];
|
|
217
|
-
declare const getDefaultFilterMatchOptionsEnum: (isLanguagePtBr: boolean) => {
|
|
219
|
+
declare const getDefaultFilterMatchOptionsEnum: (isLanguagePtBr: boolean, isNullable?: boolean) => {
|
|
218
220
|
label: string;
|
|
219
221
|
value: string;
|
|
220
222
|
}[];
|
|
221
|
-
declare const
|
|
223
|
+
declare const getNullable: (isLanguagePtBr: boolean) => {
|
|
222
224
|
label: string;
|
|
223
|
-
value:
|
|
225
|
+
value: string;
|
|
224
226
|
}[];
|
|
225
227
|
|
|
226
228
|
declare const mapPrimeToBackendFilters: (filters: any, globalFilterFields: string[]) => {
|
|
@@ -329,4 +331,4 @@ declare const LeafcodeThemeProvider: ({ children, theme, }: LeafcodeThemeProvide
|
|
|
329
331
|
|
|
330
332
|
declare const defaultTheme: LeafcodeTheme;
|
|
331
333
|
|
|
332
|
-
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum,
|
|
334
|
+
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getNullable, getUrlParams, mapPrimeToBackendFilters };
|
package/dist/index.js
CHANGED
|
@@ -51,9 +51,9 @@ __export(index_exports, {
|
|
|
51
51
|
defaultTheme: () => defaultTheme,
|
|
52
52
|
getDefaultFilterMatchOptionsDate: () => getDefaultFilterMatchOptionsDate,
|
|
53
53
|
getDefaultFilterMatchOptionsEnum: () => getDefaultFilterMatchOptionsEnum,
|
|
54
|
-
getDefaultFilterMatchOptionsEnumNotNullable: () => getDefaultFilterMatchOptionsEnumNotNullable,
|
|
55
54
|
getDefaultFilterMatchOptionsString: () => getDefaultFilterMatchOptionsString,
|
|
56
55
|
getDefaultFilterMatchOptionsStringArray: () => getDefaultFilterMatchOptionsStringArray,
|
|
56
|
+
getNullable: () => getNullable,
|
|
57
57
|
getUrlParams: () => getUrlParams,
|
|
58
58
|
mapPrimeToBackendFilters: () => mapPrimeToBackendFilters
|
|
59
59
|
});
|
|
@@ -328,6 +328,9 @@ var InputBase = ({
|
|
|
328
328
|
"--label-line": theme.colors.light,
|
|
329
329
|
"--input-border": theme.components.input.colors.border,
|
|
330
330
|
"--input-bg": theme.components.input.colors.background,
|
|
331
|
+
"--autofill-box-shadow": theme.components.input.colors.background,
|
|
332
|
+
"--autofill-text-color": theme.components.input.colors.text,
|
|
333
|
+
"--autofill-border": theme.components.input.colors.focusBorder,
|
|
331
334
|
"--input-text-color": theme.components.input.colors.text,
|
|
332
335
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
333
336
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -425,6 +428,8 @@ var TextAreaBase = ({
|
|
|
425
428
|
"--label-line": theme.colors.light,
|
|
426
429
|
"--input-border": theme.components.input.colors.border,
|
|
427
430
|
"--input-bg": theme.components.input.colors.background,
|
|
431
|
+
"--autofill-box-shadow": theme.components.input.colors.background,
|
|
432
|
+
"--autofill-text-color": theme.components.input.colors.text,
|
|
428
433
|
"--input-text-color": theme.components.input.colors.text,
|
|
429
434
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
430
435
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -688,25 +693,24 @@ var import_react_query = require("@tanstack/react-query");
|
|
|
688
693
|
// src/components/Loading/Loading.tsx
|
|
689
694
|
var import_react10 = require("react");
|
|
690
695
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
691
|
-
var LoadingSpinner = (0, import_react10.memo)(
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
);
|
|
696
|
+
var LoadingSpinner = (0, import_react10.memo)(({ size = 20 }) => {
|
|
697
|
+
const theme = useLeafcodeTheme();
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
699
|
+
"span",
|
|
700
|
+
{
|
|
701
|
+
style: {
|
|
702
|
+
width: size,
|
|
703
|
+
height: size,
|
|
704
|
+
border: `3px solid ${theme.components.input.colors.focusBorder}33`,
|
|
705
|
+
borderTopColor: theme.components.input.colors.focusBorder,
|
|
706
|
+
borderRadius: "50%",
|
|
707
|
+
display: "inline-block",
|
|
708
|
+
animation: "leafcode-spin 0.8s linear infinite"
|
|
709
|
+
},
|
|
710
|
+
"aria-label": "Carregando"
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
});
|
|
710
714
|
LoadingSpinner.displayName = "LoadingSpinner";
|
|
711
715
|
|
|
712
716
|
// src/components/Input/InputAutocomplete.tsx
|
|
@@ -1785,7 +1789,7 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1785
1789
|
return;
|
|
1786
1790
|
}
|
|
1787
1791
|
const valueToFilter = mask ? mask(rawValue) : rawValue;
|
|
1788
|
-
options.filterCallback(valueToFilter, options.index);
|
|
1792
|
+
options.filterCallback(String(valueToFilter), options.index);
|
|
1789
1793
|
};
|
|
1790
1794
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1791
1795
|
import_inputnumber.InputNumber,
|
|
@@ -1801,7 +1805,6 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1801
1805
|
};
|
|
1802
1806
|
var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
1803
1807
|
const selectOptions = items.length > 0 ? items : [
|
|
1804
|
-
{ label: isLanguagePtBr ? "Todos" : "All", value: null },
|
|
1805
1808
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1806
1809
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
1807
1810
|
];
|
|
@@ -1936,50 +1939,47 @@ var customMatchModes = {
|
|
|
1936
1939
|
notStartsWith: "notStartsWith",
|
|
1937
1940
|
notEndsWith: "notEndsWith",
|
|
1938
1941
|
empty: "empty",
|
|
1939
|
-
notEmpty: "notEmpty"
|
|
1942
|
+
notEmpty: "notEmpty",
|
|
1943
|
+
dateBeforeAndEquals: "dateBeforeAndEquals",
|
|
1944
|
+
dateAfterAndEquals: "dateAfterAndEquals"
|
|
1945
|
+
};
|
|
1946
|
+
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true, isNullable = true) => {
|
|
1947
|
+
const baseOptions = [
|
|
1948
|
+
{
|
|
1949
|
+
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1950
|
+
value: import_api3.FilterMatchMode.CONTAINS
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1954
|
+
value: import_api3.FilterMatchMode.NOT_CONTAINS
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1958
|
+
value: import_api3.FilterMatchMode.EQUALS
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1962
|
+
value: import_api3.FilterMatchMode.NOT_EQUALS
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1966
|
+
value: import_api3.FilterMatchMode.STARTS_WITH
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
1970
|
+
value: customMatchModes.notStartsWith
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1974
|
+
value: import_api3.FilterMatchMode.ENDS_WITH
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
1978
|
+
value: customMatchModes.notEndsWith
|
|
1979
|
+
}
|
|
1980
|
+
];
|
|
1981
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
1940
1982
|
};
|
|
1941
|
-
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
1942
|
-
{
|
|
1943
|
-
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1944
|
-
value: import_api3.FilterMatchMode.CONTAINS
|
|
1945
|
-
},
|
|
1946
|
-
{
|
|
1947
|
-
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1948
|
-
value: import_api3.FilterMatchMode.NOT_CONTAINS
|
|
1949
|
-
},
|
|
1950
|
-
{
|
|
1951
|
-
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1952
|
-
value: import_api3.FilterMatchMode.EQUALS
|
|
1953
|
-
},
|
|
1954
|
-
{
|
|
1955
|
-
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1956
|
-
value: import_api3.FilterMatchMode.NOT_EQUALS
|
|
1957
|
-
},
|
|
1958
|
-
{
|
|
1959
|
-
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1960
|
-
value: import_api3.FilterMatchMode.STARTS_WITH
|
|
1961
|
-
},
|
|
1962
|
-
{
|
|
1963
|
-
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
1964
|
-
value: customMatchModes.notStartsWith
|
|
1965
|
-
},
|
|
1966
|
-
{
|
|
1967
|
-
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1968
|
-
value: import_api3.FilterMatchMode.ENDS_WITH
|
|
1969
|
-
},
|
|
1970
|
-
{
|
|
1971
|
-
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
1972
|
-
value: customMatchModes.notEndsWith
|
|
1973
|
-
},
|
|
1974
|
-
{
|
|
1975
|
-
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
1976
|
-
value: customMatchModes.empty
|
|
1977
|
-
},
|
|
1978
|
-
{
|
|
1979
|
-
label: isLanguagePtBr ? "N\xE3o Vazio" : "NotEmpty",
|
|
1980
|
-
value: customMatchModes.notEmpty
|
|
1981
|
-
}
|
|
1982
|
-
];
|
|
1983
1983
|
var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
1984
1984
|
{
|
|
1985
1985
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
@@ -1990,25 +1990,41 @@ var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
|
1990
1990
|
value: import_api3.FilterMatchMode.NOT_CONTAINS
|
|
1991
1991
|
}
|
|
1992
1992
|
];
|
|
1993
|
-
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr) =>
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
1993
|
+
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr, isNullable = true) => {
|
|
1994
|
+
const baseOptions = [
|
|
1995
|
+
{
|
|
1996
|
+
label: isLanguagePtBr ? "Data anterior a" : "Date before",
|
|
1997
|
+
value: import_api3.FilterMatchMode.DATE_BEFORE
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
label: isLanguagePtBr ? "Data anterior ou igual a" : "Date prior to or equal to",
|
|
2001
|
+
value: customMatchModes.dateBeforeAndEquals
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
label: isLanguagePtBr ? "Data posterior a" : "Date after",
|
|
2005
|
+
value: import_api3.FilterMatchMode.DATE_AFTER
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
label: isLanguagePtBr ? "Data posterior ou igual a" : "Date later than or equal to",
|
|
2009
|
+
value: customMatchModes.dateAfterAndEquals
|
|
2010
|
+
}
|
|
2011
|
+
];
|
|
2012
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
2013
|
+
};
|
|
2014
|
+
var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr, isNullable = true) => {
|
|
2015
|
+
const baseOptions = [
|
|
2016
|
+
{
|
|
2017
|
+
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
2018
|
+
value: import_api3.FilterMatchMode.EQUALS
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
2022
|
+
value: import_api3.FilterMatchMode.NOT_EQUALS
|
|
2023
|
+
}
|
|
2024
|
+
];
|
|
2025
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
2026
|
+
};
|
|
2027
|
+
var getNullable = (isLanguagePtBr) => [
|
|
2012
2028
|
{
|
|
2013
2029
|
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
2014
2030
|
value: customMatchModes.empty
|
|
@@ -2018,16 +2034,6 @@ var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
|
2018
2034
|
value: customMatchModes.notEmpty
|
|
2019
2035
|
}
|
|
2020
2036
|
];
|
|
2021
|
-
var getDefaultFilterMatchOptionsEnumNotNullable = (isLanguagePtBr) => [
|
|
2022
|
-
{
|
|
2023
|
-
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
2024
|
-
value: import_api3.FilterMatchMode.EQUALS
|
|
2025
|
-
},
|
|
2026
|
-
{
|
|
2027
|
-
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
2028
|
-
value: import_api3.FilterMatchMode.NOT_EQUALS
|
|
2029
|
-
}
|
|
2030
|
-
];
|
|
2031
2037
|
|
|
2032
2038
|
// src/components/DataTableAdvancedFilter/utils/DataTableUtils.tsx
|
|
2033
2039
|
var import_api4 = require("primereact/api");
|
|
@@ -2077,6 +2083,40 @@ var buildFilterPayload = (fieldName, matchMode, rawValue) => {
|
|
|
2077
2083
|
}
|
|
2078
2084
|
};
|
|
2079
2085
|
}
|
|
2086
|
+
if (matchMode === "dateBeforeAndEquals") {
|
|
2087
|
+
if (normalized === null) return null;
|
|
2088
|
+
return {
|
|
2089
|
+
or: [
|
|
2090
|
+
{
|
|
2091
|
+
field: fieldName,
|
|
2092
|
+
operator: "LessThan",
|
|
2093
|
+
value: normalized
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
field: fieldName,
|
|
2097
|
+
operator: "Equals",
|
|
2098
|
+
value: normalized
|
|
2099
|
+
}
|
|
2100
|
+
]
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
if (matchMode === "dateAfterAndEquals") {
|
|
2104
|
+
if (normalized === null) return null;
|
|
2105
|
+
return {
|
|
2106
|
+
or: [
|
|
2107
|
+
{
|
|
2108
|
+
field: fieldName,
|
|
2109
|
+
operator: "GreaterThan",
|
|
2110
|
+
value: normalized
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
field: fieldName,
|
|
2114
|
+
operator: "Equals",
|
|
2115
|
+
value: normalized
|
|
2116
|
+
}
|
|
2117
|
+
]
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2080
2120
|
if (normalized === null) return null;
|
|
2081
2121
|
if (matchMode === "notStartsWith" || matchMode === "notEndsWith" || matchMode === "notEquals" || // <- notEquals
|
|
2082
2122
|
matchMode === "dateIsNot" || matchMode === "notContains") {
|
|
@@ -2112,11 +2152,9 @@ var buildFilterPayload = (fieldName, matchMode, rawValue) => {
|
|
|
2112
2152
|
};
|
|
2113
2153
|
var mapPrimeToBackendFilters = (filters, globalFilterFields) => {
|
|
2114
2154
|
const finalAnd = [];
|
|
2115
|
-
const globalOr = [];
|
|
2116
2155
|
const camposMap = {};
|
|
2117
2156
|
Object.entries(filters).forEach(([field, config]) => {
|
|
2118
2157
|
if (!config) return;
|
|
2119
|
-
const value = config?.value?.text ?? config?.value;
|
|
2120
2158
|
if (field === "global" && typeof config.value === "string" && config.value.trim() !== "") {
|
|
2121
2159
|
const globalOrNodes = [];
|
|
2122
2160
|
globalFilterFields.forEach((globalField) => {
|
|
@@ -2336,9 +2374,9 @@ var import_api5 = require("primereact/api");
|
|
|
2336
2374
|
defaultTheme,
|
|
2337
2375
|
getDefaultFilterMatchOptionsDate,
|
|
2338
2376
|
getDefaultFilterMatchOptionsEnum,
|
|
2339
|
-
getDefaultFilterMatchOptionsEnumNotNullable,
|
|
2340
2377
|
getDefaultFilterMatchOptionsString,
|
|
2341
2378
|
getDefaultFilterMatchOptionsStringArray,
|
|
2379
|
+
getNullable,
|
|
2342
2380
|
getUrlParams,
|
|
2343
2381
|
mapPrimeToBackendFilters
|
|
2344
2382
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -270,6 +270,9 @@ var InputBase = ({
|
|
|
270
270
|
"--label-line": theme.colors.light,
|
|
271
271
|
"--input-border": theme.components.input.colors.border,
|
|
272
272
|
"--input-bg": theme.components.input.colors.background,
|
|
273
|
+
"--autofill-box-shadow": theme.components.input.colors.background,
|
|
274
|
+
"--autofill-text-color": theme.components.input.colors.text,
|
|
275
|
+
"--autofill-border": theme.components.input.colors.focusBorder,
|
|
273
276
|
"--input-text-color": theme.components.input.colors.text,
|
|
274
277
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
275
278
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -367,6 +370,8 @@ var TextAreaBase = ({
|
|
|
367
370
|
"--label-line": theme.colors.light,
|
|
368
371
|
"--input-border": theme.components.input.colors.border,
|
|
369
372
|
"--input-bg": theme.components.input.colors.background,
|
|
373
|
+
"--autofill-box-shadow": theme.components.input.colors.background,
|
|
374
|
+
"--autofill-text-color": theme.components.input.colors.text,
|
|
370
375
|
"--input-text-color": theme.components.input.colors.text,
|
|
371
376
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
372
377
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -639,25 +644,24 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
639
644
|
// src/components/Loading/Loading.tsx
|
|
640
645
|
import { memo } from "react";
|
|
641
646
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
642
|
-
var LoadingSpinner = memo(
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
);
|
|
647
|
+
var LoadingSpinner = memo(({ size = 20 }) => {
|
|
648
|
+
const theme = useLeafcodeTheme();
|
|
649
|
+
return /* @__PURE__ */ jsx9(
|
|
650
|
+
"span",
|
|
651
|
+
{
|
|
652
|
+
style: {
|
|
653
|
+
width: size,
|
|
654
|
+
height: size,
|
|
655
|
+
border: `3px solid ${theme.components.input.colors.focusBorder}33`,
|
|
656
|
+
borderTopColor: theme.components.input.colors.focusBorder,
|
|
657
|
+
borderRadius: "50%",
|
|
658
|
+
display: "inline-block",
|
|
659
|
+
animation: "leafcode-spin 0.8s linear infinite"
|
|
660
|
+
},
|
|
661
|
+
"aria-label": "Carregando"
|
|
662
|
+
}
|
|
663
|
+
);
|
|
664
|
+
});
|
|
661
665
|
LoadingSpinner.displayName = "LoadingSpinner";
|
|
662
666
|
|
|
663
667
|
// src/components/Input/InputAutocomplete.tsx
|
|
@@ -1736,7 +1740,7 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1736
1740
|
return;
|
|
1737
1741
|
}
|
|
1738
1742
|
const valueToFilter = mask ? mask(rawValue) : rawValue;
|
|
1739
|
-
options.filterCallback(valueToFilter, options.index);
|
|
1743
|
+
options.filterCallback(String(valueToFilter), options.index);
|
|
1740
1744
|
};
|
|
1741
1745
|
return /* @__PURE__ */ jsx18(
|
|
1742
1746
|
InputNumber,
|
|
@@ -1752,7 +1756,6 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1752
1756
|
};
|
|
1753
1757
|
var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
1754
1758
|
const selectOptions = items.length > 0 ? items : [
|
|
1755
|
-
{ label: isLanguagePtBr ? "Todos" : "All", value: null },
|
|
1756
1759
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1757
1760
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
1758
1761
|
];
|
|
@@ -1887,50 +1890,47 @@ var customMatchModes = {
|
|
|
1887
1890
|
notStartsWith: "notStartsWith",
|
|
1888
1891
|
notEndsWith: "notEndsWith",
|
|
1889
1892
|
empty: "empty",
|
|
1890
|
-
notEmpty: "notEmpty"
|
|
1893
|
+
notEmpty: "notEmpty",
|
|
1894
|
+
dateBeforeAndEquals: "dateBeforeAndEquals",
|
|
1895
|
+
dateAfterAndEquals: "dateAfterAndEquals"
|
|
1896
|
+
};
|
|
1897
|
+
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true, isNullable = true) => {
|
|
1898
|
+
const baseOptions = [
|
|
1899
|
+
{
|
|
1900
|
+
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1901
|
+
value: FilterMatchMode3.CONTAINS
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1905
|
+
value: FilterMatchMode3.NOT_CONTAINS
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1909
|
+
value: FilterMatchMode3.EQUALS
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1913
|
+
value: FilterMatchMode3.NOT_EQUALS
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1917
|
+
value: FilterMatchMode3.STARTS_WITH
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
1921
|
+
value: customMatchModes.notStartsWith
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1925
|
+
value: FilterMatchMode3.ENDS_WITH
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
1929
|
+
value: customMatchModes.notEndsWith
|
|
1930
|
+
}
|
|
1931
|
+
];
|
|
1932
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
1891
1933
|
};
|
|
1892
|
-
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
1893
|
-
{
|
|
1894
|
-
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1895
|
-
value: FilterMatchMode3.CONTAINS
|
|
1896
|
-
},
|
|
1897
|
-
{
|
|
1898
|
-
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1899
|
-
value: FilterMatchMode3.NOT_CONTAINS
|
|
1900
|
-
},
|
|
1901
|
-
{
|
|
1902
|
-
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1903
|
-
value: FilterMatchMode3.EQUALS
|
|
1904
|
-
},
|
|
1905
|
-
{
|
|
1906
|
-
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1907
|
-
value: FilterMatchMode3.NOT_EQUALS
|
|
1908
|
-
},
|
|
1909
|
-
{
|
|
1910
|
-
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1911
|
-
value: FilterMatchMode3.STARTS_WITH
|
|
1912
|
-
},
|
|
1913
|
-
{
|
|
1914
|
-
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
1915
|
-
value: customMatchModes.notStartsWith
|
|
1916
|
-
},
|
|
1917
|
-
{
|
|
1918
|
-
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1919
|
-
value: FilterMatchMode3.ENDS_WITH
|
|
1920
|
-
},
|
|
1921
|
-
{
|
|
1922
|
-
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
1923
|
-
value: customMatchModes.notEndsWith
|
|
1924
|
-
},
|
|
1925
|
-
{
|
|
1926
|
-
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
1927
|
-
value: customMatchModes.empty
|
|
1928
|
-
},
|
|
1929
|
-
{
|
|
1930
|
-
label: isLanguagePtBr ? "N\xE3o Vazio" : "NotEmpty",
|
|
1931
|
-
value: customMatchModes.notEmpty
|
|
1932
|
-
}
|
|
1933
|
-
];
|
|
1934
1934
|
var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
1935
1935
|
{
|
|
1936
1936
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
@@ -1941,25 +1941,41 @@ var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
|
1941
1941
|
value: FilterMatchMode3.NOT_CONTAINS
|
|
1942
1942
|
}
|
|
1943
1943
|
];
|
|
1944
|
-
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr) =>
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1944
|
+
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr, isNullable = true) => {
|
|
1945
|
+
const baseOptions = [
|
|
1946
|
+
{
|
|
1947
|
+
label: isLanguagePtBr ? "Data anterior a" : "Date before",
|
|
1948
|
+
value: FilterMatchMode3.DATE_BEFORE
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
label: isLanguagePtBr ? "Data anterior ou igual a" : "Date prior to or equal to",
|
|
1952
|
+
value: customMatchModes.dateBeforeAndEquals
|
|
1953
|
+
},
|
|
1954
|
+
{
|
|
1955
|
+
label: isLanguagePtBr ? "Data posterior a" : "Date after",
|
|
1956
|
+
value: FilterMatchMode3.DATE_AFTER
|
|
1957
|
+
},
|
|
1958
|
+
{
|
|
1959
|
+
label: isLanguagePtBr ? "Data posterior ou igual a" : "Date later than or equal to",
|
|
1960
|
+
value: customMatchModes.dateAfterAndEquals
|
|
1961
|
+
}
|
|
1962
|
+
];
|
|
1963
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
1964
|
+
};
|
|
1965
|
+
var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr, isNullable = true) => {
|
|
1966
|
+
const baseOptions = [
|
|
1967
|
+
{
|
|
1968
|
+
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1969
|
+
value: FilterMatchMode3.EQUALS
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1973
|
+
value: FilterMatchMode3.NOT_EQUALS
|
|
1974
|
+
}
|
|
1975
|
+
];
|
|
1976
|
+
return isNullable ? [...baseOptions, ...getNullable(isLanguagePtBr)] : baseOptions;
|
|
1977
|
+
};
|
|
1978
|
+
var getNullable = (isLanguagePtBr) => [
|
|
1963
1979
|
{
|
|
1964
1980
|
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
1965
1981
|
value: customMatchModes.empty
|
|
@@ -1969,16 +1985,6 @@ var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
|
1969
1985
|
value: customMatchModes.notEmpty
|
|
1970
1986
|
}
|
|
1971
1987
|
];
|
|
1972
|
-
var getDefaultFilterMatchOptionsEnumNotNullable = (isLanguagePtBr) => [
|
|
1973
|
-
{
|
|
1974
|
-
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1975
|
-
value: FilterMatchMode3.EQUALS
|
|
1976
|
-
},
|
|
1977
|
-
{
|
|
1978
|
-
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1979
|
-
value: FilterMatchMode3.NOT_EQUALS
|
|
1980
|
-
}
|
|
1981
|
-
];
|
|
1982
1988
|
|
|
1983
1989
|
// src/components/DataTableAdvancedFilter/utils/DataTableUtils.tsx
|
|
1984
1990
|
import { FilterMatchMode as FilterMatchMode4, FilterOperator } from "primereact/api";
|
|
@@ -2028,6 +2034,40 @@ var buildFilterPayload = (fieldName, matchMode, rawValue) => {
|
|
|
2028
2034
|
}
|
|
2029
2035
|
};
|
|
2030
2036
|
}
|
|
2037
|
+
if (matchMode === "dateBeforeAndEquals") {
|
|
2038
|
+
if (normalized === null) return null;
|
|
2039
|
+
return {
|
|
2040
|
+
or: [
|
|
2041
|
+
{
|
|
2042
|
+
field: fieldName,
|
|
2043
|
+
operator: "LessThan",
|
|
2044
|
+
value: normalized
|
|
2045
|
+
},
|
|
2046
|
+
{
|
|
2047
|
+
field: fieldName,
|
|
2048
|
+
operator: "Equals",
|
|
2049
|
+
value: normalized
|
|
2050
|
+
}
|
|
2051
|
+
]
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
2054
|
+
if (matchMode === "dateAfterAndEquals") {
|
|
2055
|
+
if (normalized === null) return null;
|
|
2056
|
+
return {
|
|
2057
|
+
or: [
|
|
2058
|
+
{
|
|
2059
|
+
field: fieldName,
|
|
2060
|
+
operator: "GreaterThan",
|
|
2061
|
+
value: normalized
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
field: fieldName,
|
|
2065
|
+
operator: "Equals",
|
|
2066
|
+
value: normalized
|
|
2067
|
+
}
|
|
2068
|
+
]
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2031
2071
|
if (normalized === null) return null;
|
|
2032
2072
|
if (matchMode === "notStartsWith" || matchMode === "notEndsWith" || matchMode === "notEquals" || // <- notEquals
|
|
2033
2073
|
matchMode === "dateIsNot" || matchMode === "notContains") {
|
|
@@ -2063,11 +2103,9 @@ var buildFilterPayload = (fieldName, matchMode, rawValue) => {
|
|
|
2063
2103
|
};
|
|
2064
2104
|
var mapPrimeToBackendFilters = (filters, globalFilterFields) => {
|
|
2065
2105
|
const finalAnd = [];
|
|
2066
|
-
const globalOr = [];
|
|
2067
2106
|
const camposMap = {};
|
|
2068
2107
|
Object.entries(filters).forEach(([field, config]) => {
|
|
2069
2108
|
if (!config) return;
|
|
2070
|
-
const value = config?.value?.text ?? config?.value;
|
|
2071
2109
|
if (field === "global" && typeof config.value === "string" && config.value.trim() !== "") {
|
|
2072
2110
|
const globalOrNodes = [];
|
|
2073
2111
|
globalFilterFields.forEach((globalField) => {
|
|
@@ -2286,9 +2324,9 @@ export {
|
|
|
2286
2324
|
defaultTheme,
|
|
2287
2325
|
getDefaultFilterMatchOptionsDate,
|
|
2288
2326
|
getDefaultFilterMatchOptionsEnum,
|
|
2289
|
-
getDefaultFilterMatchOptionsEnumNotNullable,
|
|
2290
2327
|
getDefaultFilterMatchOptionsString,
|
|
2291
2328
|
getDefaultFilterMatchOptionsStringArray,
|
|
2329
|
+
getNullable,
|
|
2292
2330
|
getUrlParams,
|
|
2293
2331
|
mapPrimeToBackendFilters
|
|
2294
2332
|
};
|
package/dist/styles/input.css
CHANGED
|
@@ -88,14 +88,22 @@
|
|
|
88
88
|
|
|
89
89
|
input:-webkit-autofill {
|
|
90
90
|
-webkit-box-shadow: 0 0 0 30px
|
|
91
|
-
light-dark(
|
|
91
|
+
light-dark(
|
|
92
|
+
var(--autofill-box-shadow, #fff),
|
|
93
|
+
var(--autofill-box-shadow, #fff)
|
|
94
|
+
)
|
|
95
|
+
inset !important;
|
|
92
96
|
-webkit-text-fill-color: var(--autofill-text-color, #070707) !important;
|
|
93
97
|
border: 1px solid var(--autofill-border, #ffffff);
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
input:-webkit-autofill:focus {
|
|
97
101
|
-webkit-box-shadow: 0 0 0 30px
|
|
98
|
-
light-dark(
|
|
102
|
+
light-dark(
|
|
103
|
+
var(--autofill-box-shadow, #fff),
|
|
104
|
+
var(--autofill-box-shadow, #fff)
|
|
105
|
+
)
|
|
106
|
+
inset !important;
|
|
99
107
|
-webkit-text-fill-color: var(--autofill-text-color, #070707) !important;
|
|
100
108
|
border: 1px solid var(--autofill-border, #ffffff);
|
|
101
109
|
}
|