@charlesgomes/leafcode-shared-lib-react 1.0.30 → 1.0.31
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.js +25 -27
- package/dist/index.mjs +21 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,8 +34,8 @@ __export(index_exports, {
|
|
|
34
34
|
DataTableAdvancedFilter: () => DataTableAdvancedFilter,
|
|
35
35
|
DateFilterTemplate: () => DateFilterTemplate,
|
|
36
36
|
DateTimeFilterTemplate: () => DateTimeFilterTemplate,
|
|
37
|
-
FilterMatchMode: () =>
|
|
38
|
-
FilterOperator: () =>
|
|
37
|
+
FilterMatchMode: () => import_api5.FilterMatchMode,
|
|
38
|
+
FilterOperator: () => import_api5.FilterOperator,
|
|
39
39
|
ModalBase: () => ModalBase,
|
|
40
40
|
SelectFilterTemplate: () => SelectFilterTemplate,
|
|
41
41
|
ValueFilterTemplate: () => ValueFilterTemplate,
|
|
@@ -493,6 +493,7 @@ function DynamicColumns({
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
// src/utils/DataTableUtils.tsx
|
|
496
|
+
var import_api2 = require("primereact/api");
|
|
496
497
|
var getUrlParams = (sortFieldInitial, sortOrderInitial) => {
|
|
497
498
|
const params = new URLSearchParams(
|
|
498
499
|
typeof window !== "undefined" ? window.location.search : ""
|
|
@@ -766,11 +767,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
766
767
|
...filters[key]?.filterFieldCollection && {
|
|
767
768
|
filterFieldCollection: filters[key].filterFieldCollection
|
|
768
769
|
},
|
|
769
|
-
...filters[key]?.
|
|
770
|
-
|
|
771
|
-
},
|
|
772
|
-
...filters[key]?.operator && {
|
|
773
|
-
operator: filters[key].operator
|
|
770
|
+
...filters[key]?.fieldId && {
|
|
771
|
+
fieldId: filters[key].fieldId
|
|
774
772
|
}
|
|
775
773
|
};
|
|
776
774
|
}
|
|
@@ -797,7 +795,7 @@ function DataTableAdvancedFilterWrapper({
|
|
|
797
795
|
}
|
|
798
796
|
|
|
799
797
|
// src/components/DataTableAdvancedFilter/DataTableAdvancedFilter.tsx
|
|
800
|
-
var
|
|
798
|
+
var import_api3 = require("primereact/api");
|
|
801
799
|
|
|
802
800
|
// src/utils/locale.ts
|
|
803
801
|
var localePtBr = {
|
|
@@ -973,16 +971,16 @@ function DataTableAdvancedFilter({
|
|
|
973
971
|
}) {
|
|
974
972
|
const [isClient, setIsClient] = (0, import_react8.useState)(false);
|
|
975
973
|
(0, import_react8.useEffect)(() => {
|
|
976
|
-
(0,
|
|
974
|
+
(0, import_api3.addLocale)("pt", localePtBr);
|
|
977
975
|
}, []);
|
|
978
976
|
(0, import_react8.useEffect)(() => {
|
|
979
|
-
(0,
|
|
977
|
+
(0, import_api3.locale)(isLanguagePtBr ? "pt" : "en");
|
|
980
978
|
}, [isLanguagePtBr]);
|
|
981
979
|
(0, import_react8.useEffect)(() => {
|
|
982
980
|
setIsClient(true);
|
|
983
981
|
}, []);
|
|
984
982
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: isClient && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
985
|
-
|
|
983
|
+
import_api3.PrimeReactProvider,
|
|
986
984
|
{
|
|
987
985
|
value: isLanguagePtBr ? { locale: "pt" } : { locale: "en" },
|
|
988
986
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1143,7 +1141,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1143
1141
|
};
|
|
1144
1142
|
|
|
1145
1143
|
// src/components/DataTableAdvancedFilter/filterModes.ts
|
|
1146
|
-
var
|
|
1144
|
+
var import_api4 = require("primereact/api");
|
|
1147
1145
|
var customMatchModes = {
|
|
1148
1146
|
notStartsWith: "notStartsWith",
|
|
1149
1147
|
notEndsWith: "notEndsWith",
|
|
@@ -1153,23 +1151,23 @@ var customMatchModes = {
|
|
|
1153
1151
|
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
1154
1152
|
{
|
|
1155
1153
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1156
|
-
value:
|
|
1154
|
+
value: import_api4.FilterMatchMode.CONTAINS
|
|
1157
1155
|
},
|
|
1158
1156
|
{
|
|
1159
1157
|
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1160
|
-
value:
|
|
1158
|
+
value: import_api4.FilterMatchMode.NOT_CONTAINS
|
|
1161
1159
|
},
|
|
1162
1160
|
{
|
|
1163
1161
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1164
|
-
value:
|
|
1162
|
+
value: import_api4.FilterMatchMode.EQUALS
|
|
1165
1163
|
},
|
|
1166
1164
|
{
|
|
1167
1165
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1168
|
-
value:
|
|
1166
|
+
value: import_api4.FilterMatchMode.NOT_EQUALS
|
|
1169
1167
|
},
|
|
1170
1168
|
{
|
|
1171
1169
|
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1172
|
-
value:
|
|
1170
|
+
value: import_api4.FilterMatchMode.STARTS_WITH
|
|
1173
1171
|
},
|
|
1174
1172
|
{
|
|
1175
1173
|
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
@@ -1177,7 +1175,7 @@ var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
|
1177
1175
|
},
|
|
1178
1176
|
{
|
|
1179
1177
|
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1180
|
-
value:
|
|
1178
|
+
value: import_api4.FilterMatchMode.ENDS_WITH
|
|
1181
1179
|
},
|
|
1182
1180
|
{
|
|
1183
1181
|
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
@@ -1191,31 +1189,31 @@ var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
|
1191
1189
|
var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
1192
1190
|
{
|
|
1193
1191
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1194
|
-
value:
|
|
1192
|
+
value: import_api4.FilterMatchMode.CONTAINS
|
|
1195
1193
|
},
|
|
1196
1194
|
{
|
|
1197
1195
|
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1198
|
-
value:
|
|
1196
|
+
value: import_api4.FilterMatchMode.NOT_CONTAINS
|
|
1199
1197
|
}
|
|
1200
1198
|
];
|
|
1201
1199
|
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr) => [
|
|
1202
1200
|
{
|
|
1203
1201
|
label: isLanguagePtBr ? "Data antes de" : "Date before",
|
|
1204
|
-
value:
|
|
1202
|
+
value: import_api4.FilterMatchMode.DATE_BEFORE
|
|
1205
1203
|
},
|
|
1206
1204
|
{
|
|
1207
1205
|
label: isLanguagePtBr ? "Data depois de" : "Date after",
|
|
1208
|
-
value:
|
|
1206
|
+
value: import_api4.FilterMatchMode.DATE_AFTER
|
|
1209
1207
|
}
|
|
1210
1208
|
];
|
|
1211
1209
|
var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
1212
1210
|
{
|
|
1213
1211
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1214
|
-
value:
|
|
1212
|
+
value: import_api4.FilterMatchMode.EQUALS
|
|
1215
1213
|
},
|
|
1216
1214
|
{
|
|
1217
1215
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1218
|
-
value:
|
|
1216
|
+
value: import_api4.FilterMatchMode.NOT_EQUALS
|
|
1219
1217
|
},
|
|
1220
1218
|
{
|
|
1221
1219
|
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
@@ -1229,16 +1227,16 @@ var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
|
1229
1227
|
var getDefaultFilterMatchOptionsEnumNotNullable = (isLanguagePtBr) => [
|
|
1230
1228
|
{
|
|
1231
1229
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1232
|
-
value:
|
|
1230
|
+
value: import_api4.FilterMatchMode.EQUALS
|
|
1233
1231
|
},
|
|
1234
1232
|
{
|
|
1235
1233
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1236
|
-
value:
|
|
1234
|
+
value: import_api4.FilterMatchMode.NOT_EQUALS
|
|
1237
1235
|
}
|
|
1238
1236
|
];
|
|
1239
1237
|
|
|
1240
1238
|
// src/index.tsx
|
|
1241
|
-
var
|
|
1239
|
+
var import_api5 = require("primereact/api");
|
|
1242
1240
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1243
1241
|
0 && (module.exports = {
|
|
1244
1242
|
Button,
|
package/dist/index.mjs
CHANGED
|
@@ -444,6 +444,7 @@ function DynamicColumns({
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
// src/utils/DataTableUtils.tsx
|
|
447
|
+
import { FilterMatchMode as FilterMatchMode3, FilterOperator } from "primereact/api";
|
|
447
448
|
var getUrlParams = (sortFieldInitial, sortOrderInitial) => {
|
|
448
449
|
const params = new URLSearchParams(
|
|
449
450
|
typeof window !== "undefined" ? window.location.search : ""
|
|
@@ -717,11 +718,8 @@ function DataTableAdvancedFilterWrapper({
|
|
|
717
718
|
...filters[key]?.filterFieldCollection && {
|
|
718
719
|
filterFieldCollection: filters[key].filterFieldCollection
|
|
719
720
|
},
|
|
720
|
-
...filters[key]?.
|
|
721
|
-
|
|
722
|
-
},
|
|
723
|
-
...filters[key]?.operator && {
|
|
724
|
-
operator: filters[key].operator
|
|
721
|
+
...filters[key]?.fieldId && {
|
|
722
|
+
fieldId: filters[key].fieldId
|
|
725
723
|
}
|
|
726
724
|
};
|
|
727
725
|
}
|
|
@@ -1094,7 +1092,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1094
1092
|
};
|
|
1095
1093
|
|
|
1096
1094
|
// src/components/DataTableAdvancedFilter/filterModes.ts
|
|
1097
|
-
import { FilterMatchMode as
|
|
1095
|
+
import { FilterMatchMode as FilterMatchMode4 } from "primereact/api";
|
|
1098
1096
|
var customMatchModes = {
|
|
1099
1097
|
notStartsWith: "notStartsWith",
|
|
1100
1098
|
notEndsWith: "notEndsWith",
|
|
@@ -1104,23 +1102,23 @@ var customMatchModes = {
|
|
|
1104
1102
|
var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
1105
1103
|
{
|
|
1106
1104
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1107
|
-
value:
|
|
1105
|
+
value: FilterMatchMode4.CONTAINS
|
|
1108
1106
|
},
|
|
1109
1107
|
{
|
|
1110
1108
|
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1111
|
-
value:
|
|
1109
|
+
value: FilterMatchMode4.NOT_CONTAINS
|
|
1112
1110
|
},
|
|
1113
1111
|
{
|
|
1114
1112
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1115
|
-
value:
|
|
1113
|
+
value: FilterMatchMode4.EQUALS
|
|
1116
1114
|
},
|
|
1117
1115
|
{
|
|
1118
1116
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1119
|
-
value:
|
|
1117
|
+
value: FilterMatchMode4.NOT_EQUALS
|
|
1120
1118
|
},
|
|
1121
1119
|
{
|
|
1122
1120
|
label: isLanguagePtBr ? "Come\xE7a com" : "Starts with",
|
|
1123
|
-
value:
|
|
1121
|
+
value: FilterMatchMode4.STARTS_WITH
|
|
1124
1122
|
},
|
|
1125
1123
|
{
|
|
1126
1124
|
label: isLanguagePtBr ? "N\xE3o come\xE7a com" : "Does not start with",
|
|
@@ -1128,7 +1126,7 @@ var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
|
1128
1126
|
},
|
|
1129
1127
|
{
|
|
1130
1128
|
label: isLanguagePtBr ? "Termina com" : "Ends with",
|
|
1131
|
-
value:
|
|
1129
|
+
value: FilterMatchMode4.ENDS_WITH
|
|
1132
1130
|
},
|
|
1133
1131
|
{
|
|
1134
1132
|
label: isLanguagePtBr ? "N\xE3o termina com" : "Does not end with",
|
|
@@ -1142,31 +1140,31 @@ var getDefaultFilterMatchOptionsString = (isLanguagePtBr = true) => [
|
|
|
1142
1140
|
var getDefaultFilterMatchOptionsStringArray = (isLanguagePtBr = true) => [
|
|
1143
1141
|
{
|
|
1144
1142
|
label: isLanguagePtBr ? "Cont\xE9m" : "Contains",
|
|
1145
|
-
value:
|
|
1143
|
+
value: FilterMatchMode4.CONTAINS
|
|
1146
1144
|
},
|
|
1147
1145
|
{
|
|
1148
1146
|
label: isLanguagePtBr ? "N\xE3o cont\xE9m" : "Does not contain",
|
|
1149
|
-
value:
|
|
1147
|
+
value: FilterMatchMode4.NOT_CONTAINS
|
|
1150
1148
|
}
|
|
1151
1149
|
];
|
|
1152
1150
|
var getDefaultFilterMatchOptionsDate = (isLanguagePtBr) => [
|
|
1153
1151
|
{
|
|
1154
1152
|
label: isLanguagePtBr ? "Data antes de" : "Date before",
|
|
1155
|
-
value:
|
|
1153
|
+
value: FilterMatchMode4.DATE_BEFORE
|
|
1156
1154
|
},
|
|
1157
1155
|
{
|
|
1158
1156
|
label: isLanguagePtBr ? "Data depois de" : "Date after",
|
|
1159
|
-
value:
|
|
1157
|
+
value: FilterMatchMode4.DATE_AFTER
|
|
1160
1158
|
}
|
|
1161
1159
|
];
|
|
1162
1160
|
var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
1163
1161
|
{
|
|
1164
1162
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1165
|
-
value:
|
|
1163
|
+
value: FilterMatchMode4.EQUALS
|
|
1166
1164
|
},
|
|
1167
1165
|
{
|
|
1168
1166
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1169
|
-
value:
|
|
1167
|
+
value: FilterMatchMode4.NOT_EQUALS
|
|
1170
1168
|
},
|
|
1171
1169
|
{
|
|
1172
1170
|
label: isLanguagePtBr ? "Vazio" : "Empty",
|
|
@@ -1180,23 +1178,23 @@ var getDefaultFilterMatchOptionsEnum = (isLanguagePtBr) => [
|
|
|
1180
1178
|
var getDefaultFilterMatchOptionsEnumNotNullable = (isLanguagePtBr) => [
|
|
1181
1179
|
{
|
|
1182
1180
|
label: isLanguagePtBr ? "Igual" : "Equals",
|
|
1183
|
-
value:
|
|
1181
|
+
value: FilterMatchMode4.EQUALS
|
|
1184
1182
|
},
|
|
1185
1183
|
{
|
|
1186
1184
|
label: isLanguagePtBr ? "Diferente" : "Not equals",
|
|
1187
|
-
value:
|
|
1185
|
+
value: FilterMatchMode4.NOT_EQUALS
|
|
1188
1186
|
}
|
|
1189
1187
|
];
|
|
1190
1188
|
|
|
1191
1189
|
// src/index.tsx
|
|
1192
|
-
import { FilterMatchMode as
|
|
1190
|
+
import { FilterMatchMode as FilterMatchMode5, FilterOperator as FilterOperator2 } from "primereact/api";
|
|
1193
1191
|
export {
|
|
1194
1192
|
Button,
|
|
1195
1193
|
DataTableAdvancedFilter,
|
|
1196
1194
|
DateFilterTemplate,
|
|
1197
1195
|
DateTimeFilterTemplate,
|
|
1198
|
-
|
|
1199
|
-
FilterOperator,
|
|
1196
|
+
FilterMatchMode5 as FilterMatchMode,
|
|
1197
|
+
FilterOperator2 as FilterOperator,
|
|
1200
1198
|
ModalBase,
|
|
1201
1199
|
SelectFilterTemplate,
|
|
1202
1200
|
ValueFilterTemplate,
|