@helpwave/hightide 0.6.12 → 0.6.14
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 +76 -6
- package/dist/index.d.ts +76 -6
- package/dist/index.js +787 -330
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -317
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7089,17 +7089,17 @@ function useFormObserver({ formStore } = {}) {
|
|
|
7089
7089
|
hasTriedSubmitting
|
|
7090
7090
|
};
|
|
7091
7091
|
}
|
|
7092
|
-
function useFormObserverKey({ formStore,
|
|
7092
|
+
function useFormObserverKey({ formStore, formKey }) {
|
|
7093
7093
|
const context = useContext(FormContext);
|
|
7094
7094
|
const store = formStore ?? context?.store;
|
|
7095
7095
|
const subscribe = useCallback2((cb) => {
|
|
7096
7096
|
if (!store) return () => {
|
|
7097
7097
|
};
|
|
7098
|
-
return store.subscribe(
|
|
7099
|
-
}, [store,
|
|
7100
|
-
const value = useSyncExternalStore(subscribe, () => store ? store.getValue(
|
|
7101
|
-
const error = useSyncExternalStore(subscribe, () => store ? store.getError(
|
|
7102
|
-
const touched = useSyncExternalStore(subscribe, () => store ? store.getTouched(
|
|
7098
|
+
return store.subscribe(formKey, cb);
|
|
7099
|
+
}, [store, formKey]);
|
|
7100
|
+
const value = useSyncExternalStore(subscribe, () => store ? store.getValue(formKey) : void 0);
|
|
7101
|
+
const error = useSyncExternalStore(subscribe, () => store ? store.getError(formKey) : void 0);
|
|
7102
|
+
const touched = useSyncExternalStore(subscribe, () => store ? store.getTouched(formKey) : void 0);
|
|
7103
7103
|
if (!store) return null;
|
|
7104
7104
|
return {
|
|
7105
7105
|
store,
|
|
@@ -7151,8 +7151,8 @@ var FormObserver = ({ children, formStore }) => {
|
|
|
7151
7151
|
}
|
|
7152
7152
|
return BagFunctionUtil.resolve(children, formObserver);
|
|
7153
7153
|
};
|
|
7154
|
-
var FormObserverKey = ({ children, formStore,
|
|
7155
|
-
const formObserver = useFormObserverKey({ formStore,
|
|
7154
|
+
var FormObserverKey = ({ children, formStore, formKey }) => {
|
|
7155
|
+
const formObserver = useFormObserverKey({ formStore, formKey });
|
|
7156
7156
|
if (!formObserver) {
|
|
7157
7157
|
throw new Error("<FormObserverKey> can only be used inside a <FormProvider>");
|
|
7158
7158
|
}
|
|
@@ -7946,6 +7946,7 @@ var hightideTranslation = {
|
|
|
7946
7946
|
"between": `Zwischen`,
|
|
7947
7947
|
"cancel": `Abbrechen`,
|
|
7948
7948
|
"carousel": `Karussell`,
|
|
7949
|
+
"caseSensitive": `Gro\xDF-/Klein beachten`,
|
|
7949
7950
|
"change": `\xC4ndern`,
|
|
7950
7951
|
"changeColumnDisplay": `Spaltenanzeige \xE4ndern`,
|
|
7951
7952
|
"chooseLanguage": `W\xE4hle deine bevorzugte Sprache`,
|
|
@@ -8091,6 +8092,14 @@ var hightideTranslation = {
|
|
|
8091
8092
|
"slideOf": ({ index, length }) => {
|
|
8092
8093
|
return `Slide ${index} von ${length} slides`;
|
|
8093
8094
|
},
|
|
8095
|
+
"sorting": `Sortierung`,
|
|
8096
|
+
"sSortingState": ({ sortDirection }) => {
|
|
8097
|
+
return TranslationGen.resolveSelect(sortDirection, {
|
|
8098
|
+
"asc": `Sortierung (Aktuell Aufsteigend)`,
|
|
8099
|
+
"desc": `Sortierung (Aktuell Absteigend)`,
|
|
8100
|
+
"other": `Sortierung (Aktuell Keine)`
|
|
8101
|
+
});
|
|
8102
|
+
},
|
|
8094
8103
|
"startDate": `Start`,
|
|
8095
8104
|
"startsWith": `Beginnt mit`,
|
|
8096
8105
|
"sThemeMode": ({ theme }) => {
|
|
@@ -8243,6 +8252,7 @@ var hightideTranslation = {
|
|
|
8243
8252
|
"between": `Between`,
|
|
8244
8253
|
"cancel": `Cancel`,
|
|
8245
8254
|
"carousel": `Carousel`,
|
|
8255
|
+
"caseSensitive": `Case Sensitive`,
|
|
8246
8256
|
"change": `Change`,
|
|
8247
8257
|
"changeColumnDisplay": `Change column display`,
|
|
8248
8258
|
"chooseLanguage": `Choose your language`,
|
|
@@ -8388,6 +8398,14 @@ var hightideTranslation = {
|
|
|
8388
8398
|
"slideOf": ({ index, length }) => {
|
|
8389
8399
|
return `Slide ${index} of ${length} slides`;
|
|
8390
8400
|
},
|
|
8401
|
+
"sorting": `Sorting`,
|
|
8402
|
+
"sSortingState": ({ sortDirection }) => {
|
|
8403
|
+
return TranslationGen.resolveSelect(sortDirection, {
|
|
8404
|
+
"asc": `Sorting (Currently Ascending)`,
|
|
8405
|
+
"desc": `Sorting (Currently Descending)`,
|
|
8406
|
+
"other": `Sorting (Currently None)`
|
|
8407
|
+
});
|
|
8408
|
+
},
|
|
8391
8409
|
"startDate": `Start`,
|
|
8392
8410
|
"startsWith": `Starts with`,
|
|
8393
8411
|
"sThemeMode": ({ theme }) => {
|
|
@@ -12934,27 +12952,16 @@ var useTableContainerContext = () => {
|
|
|
12934
12952
|
return context;
|
|
12935
12953
|
};
|
|
12936
12954
|
|
|
12937
|
-
// src/
|
|
12938
|
-
|
|
12939
|
-
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
12940
|
-
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
12941
|
-
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
12942
|
-
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
12943
|
-
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
12944
|
-
generic: ["undefined", "notUndefined"]
|
|
12945
|
-
};
|
|
12946
|
-
function isTableFilterCategory(value) {
|
|
12947
|
-
return typeof value === "string" && value in TableFilterOperator;
|
|
12948
|
-
}
|
|
12949
|
-
var textFilter = (row, columnId, filterValue) => {
|
|
12950
|
-
const value = row.getValue(columnId);
|
|
12955
|
+
// src/utils/filter.ts
|
|
12956
|
+
function filterText(value, filterValue) {
|
|
12951
12957
|
const parameter = filterValue.parameter;
|
|
12952
12958
|
const operator = filterValue.operator;
|
|
12959
|
+
const isCaseSensitive = filterValue.parameter.isCaseSensitive ?? false;
|
|
12953
12960
|
if (operator === "textNotWhitespace") {
|
|
12954
12961
|
return value?.toString().trim().length > 0;
|
|
12955
12962
|
}
|
|
12956
|
-
const searchText = (parameter.searchText ?? "").toLowerCase();
|
|
12957
|
-
const cellText = value?.toString().toLowerCase() ?? "";
|
|
12963
|
+
const searchText = isCaseSensitive ? parameter.searchText ?? "" : (parameter.searchText ?? "").toLowerCase();
|
|
12964
|
+
const cellText = isCaseSensitive ? value?.toString() ?? "" : value?.toString().toLowerCase() ?? "";
|
|
12958
12965
|
switch (operator) {
|
|
12959
12966
|
case "textEquals":
|
|
12960
12967
|
return cellText === searchText;
|
|
@@ -12975,11 +12982,19 @@ var textFilter = (row, columnId, filterValue) => {
|
|
|
12975
12982
|
default:
|
|
12976
12983
|
return false;
|
|
12977
12984
|
}
|
|
12978
|
-
}
|
|
12979
|
-
|
|
12980
|
-
const value = row.getValue(columnId);
|
|
12985
|
+
}
|
|
12986
|
+
function filterNumber(value, filterValue) {
|
|
12981
12987
|
const parameter = filterValue.parameter;
|
|
12982
12988
|
const operator = filterValue.operator;
|
|
12989
|
+
if (typeof value !== "number") {
|
|
12990
|
+
if (operator === "undefined") {
|
|
12991
|
+
return value === void 0 || value === null;
|
|
12992
|
+
}
|
|
12993
|
+
if (operator === "notUndefined") {
|
|
12994
|
+
return value !== void 0 && value !== null;
|
|
12995
|
+
}
|
|
12996
|
+
return false;
|
|
12997
|
+
}
|
|
12983
12998
|
switch (operator) {
|
|
12984
12999
|
case "numberEquals":
|
|
12985
13000
|
return value === parameter.compareValue;
|
|
@@ -13004,58 +13019,57 @@ var numberFilter = (row, columnId, filterValue) => {
|
|
|
13004
13019
|
default:
|
|
13005
13020
|
return false;
|
|
13006
13021
|
}
|
|
13007
|
-
}
|
|
13008
|
-
|
|
13009
|
-
|
|
13022
|
+
}
|
|
13023
|
+
function parseDate(dateValue) {
|
|
13024
|
+
if (!dateValue) return null;
|
|
13025
|
+
if (dateValue instanceof Date) return dateValue;
|
|
13026
|
+
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13027
|
+
const parsed = new Date(dateValue);
|
|
13028
|
+
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13029
|
+
}
|
|
13030
|
+
return null;
|
|
13031
|
+
}
|
|
13032
|
+
function normalizeToDateOnly(date) {
|
|
13033
|
+
const normalized = new Date(date);
|
|
13034
|
+
normalized.setHours(0, 0, 0, 0);
|
|
13035
|
+
return normalized;
|
|
13036
|
+
}
|
|
13037
|
+
function filterDate(value, filterValue) {
|
|
13010
13038
|
const parameter = filterValue.parameter;
|
|
13011
13039
|
const operator = filterValue.operator;
|
|
13012
|
-
const parseDate = (dateValue) => {
|
|
13013
|
-
if (!dateValue) return null;
|
|
13014
|
-
if (dateValue instanceof Date) return dateValue;
|
|
13015
|
-
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13016
|
-
const parsed = new Date(dateValue);
|
|
13017
|
-
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13018
|
-
}
|
|
13019
|
-
return null;
|
|
13020
|
-
};
|
|
13021
|
-
const normalizeToDateOnly = (date2) => {
|
|
13022
|
-
const normalized = new Date(date2);
|
|
13023
|
-
normalized.setHours(0, 0, 0, 0);
|
|
13024
|
-
return normalized;
|
|
13025
|
-
};
|
|
13026
13040
|
const date = parseDate(value);
|
|
13027
13041
|
if (!date && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13028
13042
|
const normalizedDate = date ? normalizeToDateOnly(date) : null;
|
|
13029
13043
|
switch (operator) {
|
|
13030
13044
|
case "dateEquals": {
|
|
13031
|
-
const
|
|
13032
|
-
if (!
|
|
13033
|
-
return normalizedDate.getTime() === normalizeToDateOnly(
|
|
13045
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13046
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13047
|
+
return normalizedDate.getTime() === normalizeToDateOnly(filterDate2).getTime();
|
|
13034
13048
|
}
|
|
13035
13049
|
case "dateNotEquals": {
|
|
13036
|
-
const
|
|
13037
|
-
if (!
|
|
13038
|
-
return normalizedDate.getTime() !== normalizeToDateOnly(
|
|
13050
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13051
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13052
|
+
return normalizedDate.getTime() !== normalizeToDateOnly(filterDate2).getTime();
|
|
13039
13053
|
}
|
|
13040
13054
|
case "dateGreaterThan": {
|
|
13041
|
-
const
|
|
13042
|
-
if (!
|
|
13043
|
-
return normalizedDate > normalizeToDateOnly(
|
|
13055
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13056
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13057
|
+
return normalizedDate > normalizeToDateOnly(filterDate2);
|
|
13044
13058
|
}
|
|
13045
13059
|
case "dateGreaterThanOrEqual": {
|
|
13046
|
-
const
|
|
13047
|
-
if (!
|
|
13048
|
-
return normalizedDate >= normalizeToDateOnly(
|
|
13060
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13061
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13062
|
+
return normalizedDate >= normalizeToDateOnly(filterDate2);
|
|
13049
13063
|
}
|
|
13050
13064
|
case "dateLessThan": {
|
|
13051
|
-
const
|
|
13052
|
-
if (!
|
|
13053
|
-
return normalizedDate < normalizeToDateOnly(
|
|
13065
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13066
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13067
|
+
return normalizedDate < normalizeToDateOnly(filterDate2);
|
|
13054
13068
|
}
|
|
13055
13069
|
case "dateLessThanOrEqual": {
|
|
13056
|
-
const
|
|
13057
|
-
if (!
|
|
13058
|
-
return normalizedDate <= normalizeToDateOnly(
|
|
13070
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13071
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13072
|
+
return normalizedDate <= normalizeToDateOnly(filterDate2);
|
|
13059
13073
|
}
|
|
13060
13074
|
case "dateBetween": {
|
|
13061
13075
|
const minDate = parseDate(parameter.min);
|
|
@@ -13076,9 +13090,70 @@ var dateFilter = (row, columnId, filterValue) => {
|
|
|
13076
13090
|
default:
|
|
13077
13091
|
return false;
|
|
13078
13092
|
}
|
|
13079
|
-
}
|
|
13080
|
-
|
|
13081
|
-
const
|
|
13093
|
+
}
|
|
13094
|
+
function normalizeDatetime(dateTime) {
|
|
13095
|
+
const normalized = new Date(dateTime);
|
|
13096
|
+
normalized.setSeconds(0, 0);
|
|
13097
|
+
return normalized;
|
|
13098
|
+
}
|
|
13099
|
+
function filterDatetime(value, filterValue) {
|
|
13100
|
+
const parameter = filterValue.parameter;
|
|
13101
|
+
const operator = filterValue.operator;
|
|
13102
|
+
const dateTime = parseDate(value);
|
|
13103
|
+
if (!dateTime && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13104
|
+
const normalizedDatetime = dateTime ? normalizeDatetime(dateTime) : null;
|
|
13105
|
+
switch (operator) {
|
|
13106
|
+
case "dateTimeEquals": {
|
|
13107
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13108
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13109
|
+
return normalizedDatetime.getTime() === normalizeDatetime(filterDatetime2).getTime();
|
|
13110
|
+
}
|
|
13111
|
+
case "dateTimeNotEquals": {
|
|
13112
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13113
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13114
|
+
return normalizedDatetime.getTime() !== normalizeDatetime(filterDatetime2).getTime();
|
|
13115
|
+
}
|
|
13116
|
+
case "dateTimeGreaterThan": {
|
|
13117
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13118
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13119
|
+
return normalizedDatetime > normalizeDatetime(filterDatetime2);
|
|
13120
|
+
}
|
|
13121
|
+
case "dateTimeGreaterThanOrEqual": {
|
|
13122
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13123
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13124
|
+
return normalizedDatetime >= normalizeDatetime(filterDatetime2);
|
|
13125
|
+
}
|
|
13126
|
+
case "dateTimeLessThan": {
|
|
13127
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13128
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13129
|
+
return normalizedDatetime < normalizeDatetime(filterDatetime2);
|
|
13130
|
+
}
|
|
13131
|
+
case "dateTimeLessThanOrEqual": {
|
|
13132
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13133
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13134
|
+
return normalizedDatetime <= normalizeDatetime(filterDatetime2);
|
|
13135
|
+
}
|
|
13136
|
+
case "dateTimeBetween": {
|
|
13137
|
+
const minDatetime = parseDate(parameter.min);
|
|
13138
|
+
const maxDatetime = parseDate(parameter.max);
|
|
13139
|
+
if (!minDatetime || !maxDatetime || !normalizedDatetime) return false;
|
|
13140
|
+
return normalizedDatetime >= normalizeDatetime(minDatetime) && normalizedDatetime <= normalizeDatetime(maxDatetime);
|
|
13141
|
+
}
|
|
13142
|
+
case "dateTimeNotBetween": {
|
|
13143
|
+
const minDatetime = parseDate(parameter.min);
|
|
13144
|
+
const maxDatetime = parseDate(parameter.max);
|
|
13145
|
+
if (!minDatetime || !maxDatetime || !normalizedDatetime) return false;
|
|
13146
|
+
return normalizedDatetime < normalizeDatetime(minDatetime) || normalizedDatetime > normalizeDatetime(maxDatetime);
|
|
13147
|
+
}
|
|
13148
|
+
case "undefined":
|
|
13149
|
+
return value === void 0 || value === null;
|
|
13150
|
+
case "notUndefined":
|
|
13151
|
+
return value !== void 0 && value !== null;
|
|
13152
|
+
default:
|
|
13153
|
+
return false;
|
|
13154
|
+
}
|
|
13155
|
+
}
|
|
13156
|
+
function filterBoolean(value, filterValue) {
|
|
13082
13157
|
const operator = filterValue.operator;
|
|
13083
13158
|
switch (operator) {
|
|
13084
13159
|
case "booleanIsTrue":
|
|
@@ -13092,9 +13167,8 @@ var booleanFilter = (row, columnId, filterValue) => {
|
|
|
13092
13167
|
default:
|
|
13093
13168
|
return false;
|
|
13094
13169
|
}
|
|
13095
|
-
}
|
|
13096
|
-
|
|
13097
|
-
const value = row.getValue(columnId);
|
|
13170
|
+
}
|
|
13171
|
+
function filterTags(value, filterValue) {
|
|
13098
13172
|
const parameter = filterValue.parameter;
|
|
13099
13173
|
const operator = filterValue.operator;
|
|
13100
13174
|
switch (operator) {
|
|
@@ -13129,9 +13203,28 @@ var tagsFilter = (row, columnId, filterValue) => {
|
|
|
13129
13203
|
default:
|
|
13130
13204
|
return false;
|
|
13131
13205
|
}
|
|
13132
|
-
}
|
|
13133
|
-
|
|
13134
|
-
const
|
|
13206
|
+
}
|
|
13207
|
+
function filterTagsSingle(value, filterValue) {
|
|
13208
|
+
const parameter = filterValue.parameter;
|
|
13209
|
+
const operator = filterValue.operator;
|
|
13210
|
+
switch (operator) {
|
|
13211
|
+
case "tagsSingleEquals":
|
|
13212
|
+
return value === parameter.searchTag;
|
|
13213
|
+
case "tagsSingleNotEquals":
|
|
13214
|
+
return value !== parameter.searchTag;
|
|
13215
|
+
case "tagsSingleContains":
|
|
13216
|
+
return parameter.searchTagsContains?.includes(value) ?? false;
|
|
13217
|
+
case "tagsSingleNotContains":
|
|
13218
|
+
return !(parameter.searchTagsContains?.includes(value) ?? false);
|
|
13219
|
+
case "undefined":
|
|
13220
|
+
return value === void 0 || value === null;
|
|
13221
|
+
case "notUndefined":
|
|
13222
|
+
return value !== void 0 && value !== null;
|
|
13223
|
+
default:
|
|
13224
|
+
return false;
|
|
13225
|
+
}
|
|
13226
|
+
}
|
|
13227
|
+
function filterGeneric(value, filterValue) {
|
|
13135
13228
|
const operator = filterValue.operator;
|
|
13136
13229
|
switch (operator) {
|
|
13137
13230
|
case "undefined":
|
|
@@ -13141,13 +13234,66 @@ var genericFilter = (row, columnId, filterValue) => {
|
|
|
13141
13234
|
default:
|
|
13142
13235
|
return false;
|
|
13143
13236
|
}
|
|
13237
|
+
}
|
|
13238
|
+
|
|
13239
|
+
// src/components/layout/table/TableFilter.ts
|
|
13240
|
+
var TableFilterOperator = {
|
|
13241
|
+
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
13242
|
+
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
13243
|
+
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
13244
|
+
dateTime: ["dateTimeEquals", "dateTimeNotEquals", "dateTimeGreaterThan", "dateTimeGreaterThanOrEqual", "dateTimeLessThan", "dateTimeLessThanOrEqual", "dateTimeBetween", "dateTimeNotBetween"],
|
|
13245
|
+
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
13246
|
+
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
13247
|
+
tagsSingle: ["tagsSingleEquals", "tagsSingleNotEquals", "tagsSingleContains", "tagsSingleNotContains"],
|
|
13248
|
+
generic: ["undefined", "notUndefined"]
|
|
13249
|
+
};
|
|
13250
|
+
function isTableFilterCategory(value) {
|
|
13251
|
+
return typeof value === "string" && value in TableFilterOperator;
|
|
13252
|
+
}
|
|
13253
|
+
var textFilter = (row, columnId, filterValue) => {
|
|
13254
|
+
const value = row.getValue(columnId);
|
|
13255
|
+
return filterText(value, filterValue);
|
|
13256
|
+
return filterText(value, filterValue);
|
|
13257
|
+
};
|
|
13258
|
+
var numberFilter = (row, columnId, filterValue) => {
|
|
13259
|
+
const value = row.getValue(columnId);
|
|
13260
|
+
return filterNumber(value, filterValue);
|
|
13261
|
+
return filterNumber(value, filterValue);
|
|
13262
|
+
};
|
|
13263
|
+
var dateFilter = (row, columnId, filterValue) => {
|
|
13264
|
+
const value = row.getValue(columnId);
|
|
13265
|
+
return filterDate(value, filterValue);
|
|
13266
|
+
};
|
|
13267
|
+
var dateTimeFilter = (row, columnId, filterValue) => {
|
|
13268
|
+
const value = row.getValue(columnId);
|
|
13269
|
+
return filterDatetime(value, filterValue);
|
|
13270
|
+
};
|
|
13271
|
+
var booleanFilter = (row, columnId, filterValue) => {
|
|
13272
|
+
const value = row.getValue(columnId);
|
|
13273
|
+
return filterBoolean(value, filterValue);
|
|
13274
|
+
return filterBoolean(value, filterValue);
|
|
13275
|
+
};
|
|
13276
|
+
var tagsFilter = (row, columnId, filterValue) => {
|
|
13277
|
+
const value = row.getValue(columnId);
|
|
13278
|
+
return filterTags(value, filterValue);
|
|
13279
|
+
};
|
|
13280
|
+
var tagsSingleFilter = (row, columnId, filterValue) => {
|
|
13281
|
+
const value = row.getValue(columnId);
|
|
13282
|
+
return filterTagsSingle(value, filterValue);
|
|
13283
|
+
};
|
|
13284
|
+
var genericFilter = (row, columnId, filterValue) => {
|
|
13285
|
+
const value = row.getValue(columnId);
|
|
13286
|
+
return filterGeneric(value, filterValue);
|
|
13287
|
+
return filterGeneric(value, filterValue);
|
|
13144
13288
|
};
|
|
13145
13289
|
var TableFilter = {
|
|
13146
13290
|
text: textFilter,
|
|
13147
13291
|
number: numberFilter,
|
|
13148
13292
|
date: dateFilter,
|
|
13293
|
+
dateTime: dateTimeFilter,
|
|
13149
13294
|
boolean: booleanFilter,
|
|
13150
13295
|
tags: tagsFilter,
|
|
13296
|
+
tagsSingle: tagsSingleFilter,
|
|
13151
13297
|
generic: genericFilter
|
|
13152
13298
|
};
|
|
13153
13299
|
|
|
@@ -13284,8 +13430,10 @@ var TableProvider = ({
|
|
|
13284
13430
|
text: TableFilter.text,
|
|
13285
13431
|
number: TableFilter.number,
|
|
13286
13432
|
date: TableFilter.date,
|
|
13433
|
+
dateTime: TableFilter.dateTime,
|
|
13287
13434
|
boolean: TableFilter.boolean,
|
|
13288
13435
|
tags: TableFilter.tags,
|
|
13436
|
+
tagsSingle: TableFilter.tagsSingle,
|
|
13289
13437
|
generic: TableFilter.generic
|
|
13290
13438
|
},
|
|
13291
13439
|
onColumnSizingChange: (updaterOrValue) => {
|
|
@@ -13405,7 +13553,7 @@ var TableBody = React5.memo(function TableBodyVisual() {
|
|
|
13405
13553
|
|
|
13406
13554
|
// src/components/layout/table/TableHeader.tsx
|
|
13407
13555
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
13408
|
-
import
|
|
13556
|
+
import clsx34 from "clsx";
|
|
13409
13557
|
|
|
13410
13558
|
// src/components/layout/table/TableSortButton.tsx
|
|
13411
13559
|
import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
@@ -13431,31 +13579,41 @@ var TableSortButton = ({
|
|
|
13431
13579
|
icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx57(ChevronUp2, { className: "size-4" }) : /* @__PURE__ */ jsx57(ChevronDown3, { className: "size-4" });
|
|
13432
13580
|
}
|
|
13433
13581
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13434
|
-
return /* @__PURE__ */ jsx57(
|
|
13435
|
-
|
|
13582
|
+
return /* @__PURE__ */ jsx57(
|
|
13583
|
+
Tooltip,
|
|
13436
13584
|
{
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
children:
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13585
|
+
tooltip: /* @__PURE__ */ jsxs28("div", { className: "flex-col-2", children: [
|
|
13586
|
+
/* @__PURE__ */ jsx57("span", { children: translation("sSortingState", { sortDirection: sortDirection || "none" }) }),
|
|
13587
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57("span", { children: translation("rSortingOrderAfter", { otherSortings: index - 1 }) }) })
|
|
13588
|
+
] }),
|
|
13589
|
+
position: "top",
|
|
13590
|
+
children: /* @__PURE__ */ jsxs28(
|
|
13591
|
+
Button,
|
|
13592
|
+
{
|
|
13593
|
+
layout: hasSortingIndex ? "default" : "icon",
|
|
13594
|
+
color,
|
|
13595
|
+
size,
|
|
13596
|
+
className: clsx28("relative", className),
|
|
13597
|
+
...props,
|
|
13598
|
+
children: [
|
|
13599
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57(
|
|
13600
|
+
"div",
|
|
13601
|
+
{
|
|
13602
|
+
className: clsx28("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
13603
|
+
children: `${index}.`
|
|
13604
|
+
}
|
|
13605
|
+
) }),
|
|
13606
|
+
icon
|
|
13607
|
+
]
|
|
13608
|
+
}
|
|
13609
|
+
)
|
|
13452
13610
|
}
|
|
13453
|
-
)
|
|
13611
|
+
);
|
|
13454
13612
|
};
|
|
13455
13613
|
|
|
13456
13614
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13457
13615
|
import { FilterIcon } from "lucide-react";
|
|
13458
|
-
import { useEffect as useEffect30, useId as
|
|
13616
|
+
import { useEffect as useEffect30, useId as useId15, useMemo as useMemo26, useRef as useRef24, useState as useState32 } from "react";
|
|
13459
13617
|
|
|
13460
13618
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13461
13619
|
import { forwardRef as forwardRef14, useCallback as useCallback21, useEffect as useEffect29, useId as useId13, useImperativeHandle as useImperativeHandle9, useMemo as useMemo24, useRef as useRef23, useState as useState30 } from "react";
|
|
@@ -14385,7 +14543,7 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14385
14543
|
});
|
|
14386
14544
|
|
|
14387
14545
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14388
|
-
import { useMemo as useMemo25, useState as useState31 } from "react";
|
|
14546
|
+
import { useId as useId14, useMemo as useMemo25, useState as useState31 } from "react";
|
|
14389
14547
|
|
|
14390
14548
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14391
14549
|
import { forwardRef as forwardRef15 } from "react";
|
|
@@ -14434,119 +14592,240 @@ import {
|
|
|
14434
14592
|
CircleDashed,
|
|
14435
14593
|
CircleDot
|
|
14436
14594
|
} from "lucide-react";
|
|
14595
|
+
|
|
14596
|
+
// src/components/user-interaction/Checkbox.tsx
|
|
14597
|
+
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
14598
|
+
import { useCallback as useCallback22 } from "react";
|
|
14599
|
+
import clsx33 from "clsx";
|
|
14437
14600
|
import { jsx as jsx66, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
14601
|
+
var Checkbox = ({
|
|
14602
|
+
value = false,
|
|
14603
|
+
indeterminate = false,
|
|
14604
|
+
required = false,
|
|
14605
|
+
invalid = false,
|
|
14606
|
+
disabled = false,
|
|
14607
|
+
readOnly = false,
|
|
14608
|
+
onValueChange,
|
|
14609
|
+
onEditComplete,
|
|
14610
|
+
size = "md",
|
|
14611
|
+
alwaysShowCheckIcon = false,
|
|
14612
|
+
...props
|
|
14613
|
+
}) => {
|
|
14614
|
+
const onChangeWrapper = useCallback22(() => {
|
|
14615
|
+
onValueChange?.(!value);
|
|
14616
|
+
onEditComplete?.(!value);
|
|
14617
|
+
}, [onEditComplete, onValueChange, value]);
|
|
14618
|
+
return /* @__PURE__ */ jsxs37(
|
|
14619
|
+
"div",
|
|
14620
|
+
{
|
|
14621
|
+
...props,
|
|
14622
|
+
onClick: (event) => {
|
|
14623
|
+
if (!disabled) {
|
|
14624
|
+
onChangeWrapper();
|
|
14625
|
+
props.onClick?.(event);
|
|
14626
|
+
}
|
|
14627
|
+
},
|
|
14628
|
+
onKeyDown: (event) => {
|
|
14629
|
+
if (disabled) return;
|
|
14630
|
+
if (event.key === " " || event.key === "Enter") {
|
|
14631
|
+
event.preventDefault();
|
|
14632
|
+
onChangeWrapper();
|
|
14633
|
+
props.onKeyDown?.(event);
|
|
14634
|
+
}
|
|
14635
|
+
},
|
|
14636
|
+
"data-checked": !indeterminate ? value : "indeterminate",
|
|
14637
|
+
"data-size": size ?? void 0,
|
|
14638
|
+
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
14639
|
+
role: "checkbox",
|
|
14640
|
+
tabIndex: disabled ? -1 : 0,
|
|
14641
|
+
"aria-checked": indeterminate ? "mixed" : value,
|
|
14642
|
+
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
14643
|
+
className: clsx33("checkbox", props.className),
|
|
14644
|
+
children: [
|
|
14645
|
+
/* @__PURE__ */ jsx66(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx66(Minus2, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
14646
|
+
/* @__PURE__ */ jsx66(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx66(Check2, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
14647
|
+
]
|
|
14648
|
+
}
|
|
14649
|
+
);
|
|
14650
|
+
};
|
|
14651
|
+
var CheckboxUncontrolled = ({
|
|
14652
|
+
value: initialValue,
|
|
14653
|
+
onValueChange,
|
|
14654
|
+
...props
|
|
14655
|
+
}) => {
|
|
14656
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14657
|
+
return /* @__PURE__ */ jsx66(
|
|
14658
|
+
Checkbox,
|
|
14659
|
+
{
|
|
14660
|
+
...props,
|
|
14661
|
+
value,
|
|
14662
|
+
onValueChange: setValue
|
|
14663
|
+
}
|
|
14664
|
+
);
|
|
14665
|
+
};
|
|
14666
|
+
|
|
14667
|
+
// src/components/layout/table/TableFilterPopups.tsx
|
|
14668
|
+
import { jsx as jsx67, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
14438
14669
|
var getOperatorInfo = (operator) => {
|
|
14439
14670
|
switch (operator) {
|
|
14440
14671
|
case "textEquals":
|
|
14441
|
-
return { icon: /* @__PURE__ */
|
|
14672
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14442
14673
|
case "textNotEquals":
|
|
14443
|
-
return { icon: /* @__PURE__ */
|
|
14674
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14444
14675
|
case "textNotWhitespace":
|
|
14445
|
-
return { icon: /* @__PURE__ */
|
|
14676
|
+
return { icon: /* @__PURE__ */ jsx67(TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14446
14677
|
case "textContains":
|
|
14447
|
-
return { icon: /* @__PURE__ */
|
|
14678
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14448
14679
|
case "textNotContains":
|
|
14449
|
-
return { icon: /* @__PURE__ */
|
|
14680
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14450
14681
|
case "textStartsWith":
|
|
14451
|
-
return { icon: /* @__PURE__ */
|
|
14682
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14452
14683
|
case "textEndsWith":
|
|
14453
|
-
return { icon: /* @__PURE__ */
|
|
14684
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14454
14685
|
case "numberEquals":
|
|
14455
|
-
return { icon: /* @__PURE__ */
|
|
14686
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14456
14687
|
case "numberNotEquals":
|
|
14457
|
-
return { icon: /* @__PURE__ */
|
|
14688
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14458
14689
|
case "numberGreaterThan":
|
|
14459
|
-
return { icon: /* @__PURE__ */
|
|
14690
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14460
14691
|
case "numberGreaterThanOrEqual":
|
|
14461
14692
|
return {
|
|
14462
|
-
icon: /* @__PURE__ */
|
|
14463
|
-
/* @__PURE__ */
|
|
14464
|
-
/* @__PURE__ */
|
|
14693
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14694
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14695
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14465
14696
|
] }),
|
|
14466
14697
|
translationKey: "greaterThanOrEqual"
|
|
14467
14698
|
};
|
|
14468
14699
|
case "numberLessThan":
|
|
14469
|
-
return { icon: /* @__PURE__ */
|
|
14700
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14470
14701
|
case "numberLessThanOrEqual":
|
|
14471
14702
|
return {
|
|
14472
|
-
icon: /* @__PURE__ */
|
|
14473
|
-
/* @__PURE__ */
|
|
14474
|
-
/* @__PURE__ */
|
|
14703
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14704
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14705
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14475
14706
|
] }),
|
|
14476
14707
|
translationKey: "lessThanOrEqual"
|
|
14477
14708
|
};
|
|
14478
14709
|
case "numberBetween":
|
|
14479
14710
|
return {
|
|
14480
|
-
icon: /* @__PURE__ */
|
|
14481
|
-
/* @__PURE__ */
|
|
14482
|
-
/* @__PURE__ */
|
|
14711
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14712
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14713
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14483
14714
|
] }),
|
|
14484
14715
|
translationKey: "between"
|
|
14485
14716
|
};
|
|
14486
14717
|
case "numberNotBetween":
|
|
14487
14718
|
return {
|
|
14488
|
-
icon: /* @__PURE__ */
|
|
14489
|
-
/* @__PURE__ */
|
|
14490
|
-
/* @__PURE__ */
|
|
14719
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14720
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14721
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14491
14722
|
] }),
|
|
14492
14723
|
translationKey: "notBetween"
|
|
14493
14724
|
};
|
|
14494
14725
|
case "dateEquals":
|
|
14495
|
-
return { icon: /* @__PURE__ */
|
|
14726
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14496
14727
|
case "dateNotEquals":
|
|
14497
|
-
return { icon: /* @__PURE__ */
|
|
14728
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14498
14729
|
case "dateGreaterThan":
|
|
14499
|
-
return { icon: /* @__PURE__ */
|
|
14730
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14500
14731
|
case "dateGreaterThanOrEqual":
|
|
14501
14732
|
return {
|
|
14502
|
-
icon: /* @__PURE__ */
|
|
14503
|
-
/* @__PURE__ */
|
|
14504
|
-
/* @__PURE__ */
|
|
14733
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14734
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14735
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14505
14736
|
] }),
|
|
14506
14737
|
translationKey: "onOrAfter"
|
|
14507
14738
|
};
|
|
14508
14739
|
case "dateLessThan":
|
|
14509
|
-
return { icon: /* @__PURE__ */
|
|
14740
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14510
14741
|
case "dateLessThanOrEqual":
|
|
14511
14742
|
return {
|
|
14512
|
-
icon: /* @__PURE__ */
|
|
14513
|
-
/* @__PURE__ */
|
|
14514
|
-
/* @__PURE__ */
|
|
14743
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14744
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14745
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14515
14746
|
] }),
|
|
14516
14747
|
translationKey: "onOrBefore"
|
|
14517
14748
|
};
|
|
14518
14749
|
case "dateBetween":
|
|
14519
14750
|
return {
|
|
14520
|
-
icon: /* @__PURE__ */
|
|
14521
|
-
/* @__PURE__ */
|
|
14522
|
-
/* @__PURE__ */
|
|
14751
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14752
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14753
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14523
14754
|
] }),
|
|
14524
14755
|
translationKey: "between"
|
|
14525
14756
|
};
|
|
14526
14757
|
case "dateNotBetween":
|
|
14527
14758
|
return {
|
|
14528
|
-
icon: /* @__PURE__ */
|
|
14529
|
-
/* @__PURE__ */
|
|
14530
|
-
/* @__PURE__ */
|
|
14759
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14760
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14761
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14531
14762
|
] }),
|
|
14532
14763
|
translationKey: "notBetween"
|
|
14533
14764
|
};
|
|
14534
14765
|
case "booleanIsTrue":
|
|
14535
|
-
return { icon: /* @__PURE__ */
|
|
14766
|
+
return { icon: /* @__PURE__ */ jsx67(CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14536
14767
|
case "booleanIsFalse":
|
|
14537
|
-
return { icon: /* @__PURE__ */
|
|
14768
|
+
return { icon: /* @__PURE__ */ jsx67(XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14538
14769
|
case "tagsEquals":
|
|
14539
|
-
return { icon: /* @__PURE__ */
|
|
14770
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14540
14771
|
case "tagsNotEquals":
|
|
14541
|
-
return { icon: /* @__PURE__ */
|
|
14772
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14542
14773
|
case "tagsContains":
|
|
14543
|
-
return { icon: /* @__PURE__ */
|
|
14774
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14544
14775
|
case "tagsNotContains":
|
|
14545
|
-
return { icon: /* @__PURE__ */
|
|
14776
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14777
|
+
case "dateTimeEquals":
|
|
14778
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14779
|
+
case "dateTimeNotEquals":
|
|
14780
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14781
|
+
case "dateTimeGreaterThan":
|
|
14782
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14783
|
+
case "dateTimeGreaterThanOrEqual":
|
|
14784
|
+
return {
|
|
14785
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14786
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14787
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14788
|
+
] }),
|
|
14789
|
+
translationKey: "onOrAfter"
|
|
14790
|
+
};
|
|
14791
|
+
case "dateTimeLessThan":
|
|
14792
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14793
|
+
case "dateTimeLessThanOrEqual":
|
|
14794
|
+
return {
|
|
14795
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14796
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14797
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14798
|
+
] }),
|
|
14799
|
+
translationKey: "onOrBefore"
|
|
14800
|
+
};
|
|
14801
|
+
case "dateTimeBetween":
|
|
14802
|
+
return {
|
|
14803
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14804
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14805
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14806
|
+
] }),
|
|
14807
|
+
translationKey: "between"
|
|
14808
|
+
};
|
|
14809
|
+
case "dateTimeNotBetween":
|
|
14810
|
+
return {
|
|
14811
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14812
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14813
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14814
|
+
] }),
|
|
14815
|
+
translationKey: "notBetween"
|
|
14816
|
+
};
|
|
14817
|
+
case "tagsSingleEquals":
|
|
14818
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14819
|
+
case "tagsSingleNotEquals":
|
|
14820
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14821
|
+
case "tagsSingleContains":
|
|
14822
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14823
|
+
case "tagsSingleNotContains":
|
|
14824
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14546
14825
|
case "undefined":
|
|
14547
|
-
return { icon: /* @__PURE__ */
|
|
14826
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14548
14827
|
case "notUndefined":
|
|
14549
|
-
return { icon: /* @__PURE__ */
|
|
14828
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14550
14829
|
default:
|
|
14551
14830
|
return { icon: null, translationKey: "undefined translation" };
|
|
14552
14831
|
}
|
|
@@ -14555,22 +14834,23 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14555
14834
|
const translation = useHightideTranslation();
|
|
14556
14835
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14557
14836
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14558
|
-
return /* @__PURE__ */
|
|
14837
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14559
14838
|
icon,
|
|
14560
14839
|
label
|
|
14561
14840
|
] });
|
|
14562
14841
|
};
|
|
14563
14842
|
var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14564
14843
|
const translation = useHightideTranslation();
|
|
14565
|
-
const operator = filterValue?.operator ?? "
|
|
14844
|
+
const operator = filterValue?.operator ?? "textContains";
|
|
14566
14845
|
const parameter = filterValue?.parameter ?? {};
|
|
14846
|
+
const id = useId14();
|
|
14567
14847
|
const availableOperators = useMemo25(() => [
|
|
14568
14848
|
...TableFilterOperator.text,
|
|
14569
14849
|
...TableFilterOperator.generic
|
|
14570
14850
|
], []);
|
|
14571
14851
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14572
|
-
return /* @__PURE__ */
|
|
14573
|
-
/* @__PURE__ */
|
|
14852
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14853
|
+
/* @__PURE__ */ jsx67(
|
|
14574
14854
|
Select,
|
|
14575
14855
|
{
|
|
14576
14856
|
value: operator,
|
|
@@ -14581,30 +14861,64 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14581
14861
|
});
|
|
14582
14862
|
},
|
|
14583
14863
|
buttonProps: { className: "min-w-64" },
|
|
14584
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14864
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14585
14865
|
}
|
|
14586
14866
|
),
|
|
14587
|
-
/* @__PURE__ */
|
|
14588
|
-
/* @__PURE__ */
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14867
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14868
|
+
/* @__PURE__ */ jsxs38(Visibility, { isVisible: needsParameterInput, children: [
|
|
14869
|
+
/* @__PURE__ */ jsx67(
|
|
14870
|
+
Input,
|
|
14871
|
+
{
|
|
14872
|
+
value: parameter.searchText ?? "",
|
|
14873
|
+
placeholder: translation("search") + "...",
|
|
14874
|
+
onValueChange: (searchText) => {
|
|
14875
|
+
onFilterValueChange({
|
|
14876
|
+
operator,
|
|
14877
|
+
parameter: { ...parameter, searchText }
|
|
14878
|
+
});
|
|
14879
|
+
},
|
|
14880
|
+
className: "min-w-64"
|
|
14881
|
+
}
|
|
14882
|
+
),
|
|
14883
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex-row-2 items-center gap-2", children: [
|
|
14884
|
+
/* @__PURE__ */ jsx67(
|
|
14885
|
+
Checkbox,
|
|
14886
|
+
{
|
|
14887
|
+
id,
|
|
14888
|
+
value: parameter.isCaseSensitive ?? false,
|
|
14889
|
+
onValueChange: (isCaseSensitive) => {
|
|
14890
|
+
onFilterValueChange({
|
|
14891
|
+
operator,
|
|
14892
|
+
parameter: { ...parameter, isCaseSensitive }
|
|
14893
|
+
});
|
|
14894
|
+
}
|
|
14895
|
+
}
|
|
14896
|
+
),
|
|
14897
|
+
/* @__PURE__ */ jsx67("label", { htmlFor: id, children: translation("caseSensitive") })
|
|
14898
|
+
] }),
|
|
14899
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex-row-2 items-center gap-2", children: [
|
|
14900
|
+
/* @__PURE__ */ jsx67(
|
|
14901
|
+
Checkbox,
|
|
14902
|
+
{
|
|
14903
|
+
id,
|
|
14904
|
+
value: parameter.isCaseSensitive ?? false,
|
|
14905
|
+
onValueChange: (isCaseSensitive) => {
|
|
14906
|
+
onFilterValueChange({
|
|
14907
|
+
operator,
|
|
14908
|
+
parameter: { ...parameter, isCaseSensitive }
|
|
14909
|
+
});
|
|
14910
|
+
}
|
|
14911
|
+
}
|
|
14912
|
+
),
|
|
14913
|
+
/* @__PURE__ */ jsx67("label", { htmlFor: id, children: translation("caseSensitive") })
|
|
14914
|
+
] })
|
|
14915
|
+
] }),
|
|
14916
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
14603
14917
|
] });
|
|
14604
14918
|
};
|
|
14605
14919
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14606
14920
|
const translation = useHightideTranslation();
|
|
14607
|
-
const operator = filterValue?.operator ?? "
|
|
14921
|
+
const operator = filterValue?.operator ?? "numberBetween";
|
|
14608
14922
|
const parameter = filterValue?.parameter ?? {};
|
|
14609
14923
|
const availableOperators = useMemo25(() => [
|
|
14610
14924
|
...TableFilterOperator.number,
|
|
@@ -14612,8 +14926,8 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14612
14926
|
], []);
|
|
14613
14927
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14614
14928
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14615
|
-
return /* @__PURE__ */
|
|
14616
|
-
/* @__PURE__ */
|
|
14929
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14930
|
+
/* @__PURE__ */ jsx67(
|
|
14617
14931
|
Select,
|
|
14618
14932
|
{
|
|
14619
14933
|
value: operator,
|
|
@@ -14624,12 +14938,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14624
14938
|
});
|
|
14625
14939
|
},
|
|
14626
14940
|
buttonProps: { className: "min-w-64" },
|
|
14627
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14941
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14628
14942
|
}
|
|
14629
14943
|
),
|
|
14630
|
-
/* @__PURE__ */
|
|
14631
|
-
/* @__PURE__ */
|
|
14632
|
-
/* @__PURE__ */
|
|
14944
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14945
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14946
|
+
/* @__PURE__ */ jsx67(FormFieldLayout, { label: translation("min"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ jsx67(
|
|
14633
14947
|
Input,
|
|
14634
14948
|
{
|
|
14635
14949
|
...ariaAttributes,
|
|
@@ -14648,7 +14962,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14648
14962
|
className: "input-indicator-hidden min-w-64"
|
|
14649
14963
|
}
|
|
14650
14964
|
) }),
|
|
14651
|
-
/* @__PURE__ */
|
|
14965
|
+
/* @__PURE__ */ jsx67(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ jsx67(
|
|
14652
14966
|
Input,
|
|
14653
14967
|
{
|
|
14654
14968
|
...ariaAttributes,
|
|
@@ -14668,7 +14982,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14668
14982
|
}
|
|
14669
14983
|
) })
|
|
14670
14984
|
] }) }),
|
|
14671
|
-
/* @__PURE__ */
|
|
14985
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14672
14986
|
Input,
|
|
14673
14987
|
{
|
|
14674
14988
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14684,12 +14998,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14684
14998
|
className: "min-w-64"
|
|
14685
14999
|
}
|
|
14686
15000
|
) }),
|
|
14687
|
-
/* @__PURE__ */
|
|
15001
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14688
15002
|
] });
|
|
14689
15003
|
};
|
|
14690
15004
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14691
15005
|
const translation = useHightideTranslation();
|
|
14692
|
-
const operator = filterValue?.operator ?? "
|
|
15006
|
+
const operator = filterValue?.operator ?? "dateBetween";
|
|
14693
15007
|
const parameter = filterValue?.parameter ?? {};
|
|
14694
15008
|
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState31(null);
|
|
14695
15009
|
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState31(null);
|
|
@@ -14699,8 +15013,8 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14699
15013
|
], []);
|
|
14700
15014
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14701
15015
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14702
|
-
return /* @__PURE__ */
|
|
14703
|
-
/* @__PURE__ */
|
|
15016
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15017
|
+
/* @__PURE__ */ jsx67(
|
|
14704
15018
|
Select,
|
|
14705
15019
|
{
|
|
14706
15020
|
value: operator,
|
|
@@ -14711,12 +15025,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14711
15025
|
});
|
|
14712
15026
|
},
|
|
14713
15027
|
buttonProps: { className: "min-w-64" },
|
|
14714
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15028
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14715
15029
|
}
|
|
14716
15030
|
),
|
|
14717
|
-
/* @__PURE__ */
|
|
14718
|
-
/* @__PURE__ */
|
|
14719
|
-
/* @__PURE__ */
|
|
15031
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15032
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15033
|
+
/* @__PURE__ */ jsx67(
|
|
14720
15034
|
DateTimeInput,
|
|
14721
15035
|
{
|
|
14722
15036
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14749,7 +15063,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14749
15063
|
className: "min-w-64"
|
|
14750
15064
|
}
|
|
14751
15065
|
),
|
|
14752
|
-
/* @__PURE__ */
|
|
15066
|
+
/* @__PURE__ */ jsx67(
|
|
14753
15067
|
DateTimeInput,
|
|
14754
15068
|
{
|
|
14755
15069
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -14782,7 +15096,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14782
15096
|
}
|
|
14783
15097
|
)
|
|
14784
15098
|
] }) }),
|
|
14785
|
-
/* @__PURE__ */
|
|
15099
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14786
15100
|
DateTimeInput,
|
|
14787
15101
|
{
|
|
14788
15102
|
value: parameter.compareDate ?? null,
|
|
@@ -14798,7 +15112,123 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14798
15112
|
className: "min-w-64"
|
|
14799
15113
|
}
|
|
14800
15114
|
) }),
|
|
14801
|
-
/* @__PURE__ */
|
|
15115
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15116
|
+
] });
|
|
15117
|
+
};
|
|
15118
|
+
var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
15119
|
+
const translation = useHightideTranslation();
|
|
15120
|
+
const operator = filterValue?.operator ?? "dateTimeBetween";
|
|
15121
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15122
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState31(null);
|
|
15123
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState31(null);
|
|
15124
|
+
const availableOperators = useMemo25(() => [
|
|
15125
|
+
...TableFilterOperator.dateTime,
|
|
15126
|
+
...TableFilterOperator.generic
|
|
15127
|
+
], []);
|
|
15128
|
+
const needsRangeInput = operator === "dateTimeBetween" || operator === "dateTimeNotBetween";
|
|
15129
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15130
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15131
|
+
/* @__PURE__ */ jsx67(
|
|
15132
|
+
Select,
|
|
15133
|
+
{
|
|
15134
|
+
value: operator,
|
|
15135
|
+
onValueChange: (newOperator) => {
|
|
15136
|
+
onFilterValueChange({
|
|
15137
|
+
operator: newOperator,
|
|
15138
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15139
|
+
});
|
|
15140
|
+
},
|
|
15141
|
+
buttonProps: { className: "min-w-64" },
|
|
15142
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
15143
|
+
}
|
|
15144
|
+
),
|
|
15145
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15146
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15147
|
+
/* @__PURE__ */ jsx67(
|
|
15148
|
+
DateTimeInput,
|
|
15149
|
+
{
|
|
15150
|
+
mode: "dateTime",
|
|
15151
|
+
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
15152
|
+
placeholder: translation("startDate"),
|
|
15153
|
+
onValueChange: (value) => setTemporaryMinDateValue(value),
|
|
15154
|
+
onEditComplete: (value) => {
|
|
15155
|
+
if (value && parameter.max && value > parameter.max) {
|
|
15156
|
+
if (!parameter.min) {
|
|
15157
|
+
onFilterValueChange({
|
|
15158
|
+
operator,
|
|
15159
|
+
parameter: { min: parameter.max, max: value }
|
|
15160
|
+
});
|
|
15161
|
+
} else {
|
|
15162
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15163
|
+
onFilterValueChange({
|
|
15164
|
+
operator,
|
|
15165
|
+
parameter: { min: value, max: new Date(value.getTime() + diff) }
|
|
15166
|
+
});
|
|
15167
|
+
}
|
|
15168
|
+
} else {
|
|
15169
|
+
onFilterValueChange({
|
|
15170
|
+
operator,
|
|
15171
|
+
parameter: { ...parameter, min: value }
|
|
15172
|
+
});
|
|
15173
|
+
}
|
|
15174
|
+
setTemporaryMinDateValue(null);
|
|
15175
|
+
},
|
|
15176
|
+
allowRemove: true,
|
|
15177
|
+
outsideClickCloses: false,
|
|
15178
|
+
className: "min-w-64"
|
|
15179
|
+
}
|
|
15180
|
+
),
|
|
15181
|
+
/* @__PURE__ */ jsx67(
|
|
15182
|
+
DateTimeInput,
|
|
15183
|
+
{
|
|
15184
|
+
mode: "dateTime",
|
|
15185
|
+
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
15186
|
+
placeholder: translation("endDate"),
|
|
15187
|
+
onValueChange: (value) => setTemporaryMaxDateValue(value),
|
|
15188
|
+
onEditComplete: (value) => {
|
|
15189
|
+
if (value && parameter.min && value < parameter.min) {
|
|
15190
|
+
if (!parameter.max) {
|
|
15191
|
+
onFilterValueChange({
|
|
15192
|
+
operator,
|
|
15193
|
+
parameter: { min: value, max: parameter.min }
|
|
15194
|
+
});
|
|
15195
|
+
} else {
|
|
15196
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15197
|
+
onFilterValueChange({
|
|
15198
|
+
operator,
|
|
15199
|
+
parameter: { min: new Date(value.getTime() - diff), max: value }
|
|
15200
|
+
});
|
|
15201
|
+
}
|
|
15202
|
+
} else {
|
|
15203
|
+
onFilterValueChange({
|
|
15204
|
+
operator,
|
|
15205
|
+
parameter: { ...parameter, max: value }
|
|
15206
|
+
});
|
|
15207
|
+
}
|
|
15208
|
+
},
|
|
15209
|
+
allowRemove: true,
|
|
15210
|
+
outsideClickCloses: false,
|
|
15211
|
+
className: "min-w-64"
|
|
15212
|
+
}
|
|
15213
|
+
)
|
|
15214
|
+
] }) }),
|
|
15215
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
15216
|
+
DateTimeInput,
|
|
15217
|
+
{
|
|
15218
|
+
value: parameter.compareDatetime ?? null,
|
|
15219
|
+
placeholder: translation("date"),
|
|
15220
|
+
onValueChange: (compareDatetime) => {
|
|
15221
|
+
onFilterValueChange({
|
|
15222
|
+
operator,
|
|
15223
|
+
parameter: { compareDatetime }
|
|
15224
|
+
});
|
|
15225
|
+
},
|
|
15226
|
+
allowRemove: true,
|
|
15227
|
+
outsideClickCloses: false,
|
|
15228
|
+
className: "min-w-64"
|
|
15229
|
+
}
|
|
15230
|
+
) }),
|
|
15231
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14802
15232
|
] });
|
|
14803
15233
|
};
|
|
14804
15234
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14807,7 +15237,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14807
15237
|
...TableFilterOperator.boolean,
|
|
14808
15238
|
...TableFilterOperator.generic
|
|
14809
15239
|
], []);
|
|
14810
|
-
return /* @__PURE__ */
|
|
15240
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14811
15241
|
Select,
|
|
14812
15242
|
{
|
|
14813
15243
|
value: operator,
|
|
@@ -14818,7 +15248,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14818
15248
|
});
|
|
14819
15249
|
},
|
|
14820
15250
|
buttonProps: { className: "min-w-64" },
|
|
14821
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15251
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14822
15252
|
}
|
|
14823
15253
|
) });
|
|
14824
15254
|
};
|
|
@@ -14840,8 +15270,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14840
15270
|
return null;
|
|
14841
15271
|
}
|
|
14842
15272
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14843
|
-
return /* @__PURE__ */
|
|
14844
|
-
/* @__PURE__ */
|
|
15273
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15274
|
+
/* @__PURE__ */ jsx67(
|
|
14845
15275
|
Select,
|
|
14846
15276
|
{
|
|
14847
15277
|
value: operator,
|
|
@@ -14852,12 +15282,12 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14852
15282
|
});
|
|
14853
15283
|
},
|
|
14854
15284
|
buttonProps: { className: "min-w-64" },
|
|
14855
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15285
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14856
15286
|
}
|
|
14857
15287
|
),
|
|
14858
|
-
/* @__PURE__ */
|
|
14859
|
-
/* @__PURE__ */
|
|
14860
|
-
|
|
15288
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15289
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
15290
|
+
MultiSelect,
|
|
14861
15291
|
{
|
|
14862
15292
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
14863
15293
|
onValueChange: (selectedTags) => {
|
|
@@ -14867,10 +15297,76 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14867
15297
|
});
|
|
14868
15298
|
},
|
|
14869
15299
|
buttonProps: { className: "min-w-64" },
|
|
14870
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */
|
|
15300
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(MultiSelectOption, { value: tag, children: label }, tag))
|
|
15301
|
+
}
|
|
15302
|
+
) }),
|
|
15303
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15304
|
+
] });
|
|
15305
|
+
};
|
|
15306
|
+
var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
15307
|
+
const translation = useHightideTranslation();
|
|
15308
|
+
const { table } = useTableDataContext();
|
|
15309
|
+
const operator = filterValue?.operator ?? "tagsSingleContains";
|
|
15310
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15311
|
+
const availableOperators = useMemo25(() => [
|
|
15312
|
+
...TableFilterOperator.tagsSingle,
|
|
15313
|
+
...TableFilterOperator.generic
|
|
15314
|
+
], []);
|
|
15315
|
+
const availableTags = useMemo25(() => {
|
|
15316
|
+
const column = table.getColumn(columnId);
|
|
15317
|
+
if (!column) return [];
|
|
15318
|
+
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
15319
|
+
}, [columnId, table]);
|
|
15320
|
+
if (availableTags.length === 0) {
|
|
15321
|
+
return null;
|
|
15322
|
+
}
|
|
15323
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15324
|
+
const needsMultiSelect = operator === "tagsSingleContains" || operator === "tagsSingleNotContains";
|
|
15325
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15326
|
+
/* @__PURE__ */ jsx67(
|
|
15327
|
+
Select,
|
|
15328
|
+
{
|
|
15329
|
+
value: operator,
|
|
15330
|
+
onValueChange: (newOperator) => {
|
|
15331
|
+
onFilterValueChange({
|
|
15332
|
+
operator: newOperator,
|
|
15333
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15334
|
+
});
|
|
15335
|
+
},
|
|
15336
|
+
buttonProps: { className: "min-w-64" },
|
|
15337
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
15338
|
+
}
|
|
15339
|
+
),
|
|
15340
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15341
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput && needsMultiSelect, children: /* @__PURE__ */ jsx67(
|
|
15342
|
+
MultiSelect,
|
|
15343
|
+
{
|
|
15344
|
+
value: Array.isArray(parameter.searchTagsContains) ? parameter.searchTagsContains.map((tag) => String(tag)) : [],
|
|
15345
|
+
onValueChange: (selectedTags) => {
|
|
15346
|
+
onFilterValueChange({
|
|
15347
|
+
operator,
|
|
15348
|
+
parameter: { searchTagsContains: selectedTags.length > 0 ? selectedTags : void 0 }
|
|
15349
|
+
});
|
|
15350
|
+
},
|
|
15351
|
+
buttonProps: { className: "min-w-64" },
|
|
15352
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(MultiSelectOption, { value: tag, children: label }, tag))
|
|
14871
15353
|
}
|
|
14872
15354
|
) }),
|
|
14873
|
-
/* @__PURE__ */
|
|
15355
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput && !needsMultiSelect, children: /* @__PURE__ */ jsx67(
|
|
15356
|
+
Select,
|
|
15357
|
+
{
|
|
15358
|
+
value: parameter.searchTag ? String(parameter.searchTag) : void 0,
|
|
15359
|
+
onValueChange: (selectedTag) => {
|
|
15360
|
+
onFilterValueChange({
|
|
15361
|
+
operator,
|
|
15362
|
+
parameter: { searchTag: selectedTag ? String(selectedTag) : void 0 }
|
|
15363
|
+
});
|
|
15364
|
+
},
|
|
15365
|
+
buttonProps: { className: "min-w-64" },
|
|
15366
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(SelectOption, { value: tag, children: label }, tag))
|
|
15367
|
+
}
|
|
15368
|
+
) }),
|
|
15369
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14874
15370
|
] });
|
|
14875
15371
|
};
|
|
14876
15372
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14878,7 +15374,7 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14878
15374
|
const availableOperators = useMemo25(() => [
|
|
14879
15375
|
...TableFilterOperator.generic
|
|
14880
15376
|
], []);
|
|
14881
|
-
return /* @__PURE__ */
|
|
15377
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14882
15378
|
Select,
|
|
14883
15379
|
{
|
|
14884
15380
|
value: operator,
|
|
@@ -14889,31 +15385,35 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14889
15385
|
});
|
|
14890
15386
|
},
|
|
14891
15387
|
buttonProps: { className: "min-w-64" },
|
|
14892
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15388
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14893
15389
|
}
|
|
14894
15390
|
) });
|
|
14895
15391
|
};
|
|
14896
15392
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
14897
15393
|
switch (filterType) {
|
|
14898
15394
|
case "text":
|
|
14899
|
-
return /* @__PURE__ */
|
|
15395
|
+
return /* @__PURE__ */ jsx67(TextFilter, { ...props });
|
|
14900
15396
|
case "number":
|
|
14901
|
-
return /* @__PURE__ */
|
|
15397
|
+
return /* @__PURE__ */ jsx67(NumberFilter, { ...props });
|
|
14902
15398
|
case "date":
|
|
14903
|
-
return /* @__PURE__ */
|
|
15399
|
+
return /* @__PURE__ */ jsx67(DateFilter, { ...props });
|
|
15400
|
+
case "dateTime":
|
|
15401
|
+
return /* @__PURE__ */ jsx67(DatetimeFilter, { ...props });
|
|
14904
15402
|
case "boolean":
|
|
14905
|
-
return /* @__PURE__ */
|
|
15403
|
+
return /* @__PURE__ */ jsx67(BooleanFilter, { ...props });
|
|
14906
15404
|
case "tags":
|
|
14907
|
-
return /* @__PURE__ */
|
|
15405
|
+
return /* @__PURE__ */ jsx67(TagsFilter, { ...props });
|
|
15406
|
+
case "tagsSingle":
|
|
15407
|
+
return /* @__PURE__ */ jsx67(TagsSingleFilter, { ...props });
|
|
14908
15408
|
case "generic":
|
|
14909
|
-
return /* @__PURE__ */
|
|
15409
|
+
return /* @__PURE__ */ jsx67(GenericFilter, { ...props });
|
|
14910
15410
|
default:
|
|
14911
15411
|
return null;
|
|
14912
15412
|
}
|
|
14913
15413
|
};
|
|
14914
15414
|
|
|
14915
15415
|
// src/components/layout/table/TableFilterButton.tsx
|
|
14916
|
-
import { Fragment as Fragment8, jsx as
|
|
15416
|
+
import { Fragment as Fragment8, jsx as jsx68, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
14917
15417
|
var TableFilterButton = ({
|
|
14918
15418
|
filterType,
|
|
14919
15419
|
column
|
|
@@ -14925,7 +15425,7 @@ var TableFilterButton = ({
|
|
|
14925
15425
|
const anchorRef = useRef24(null);
|
|
14926
15426
|
const containerRef = useRef24(null);
|
|
14927
15427
|
const [isOpen, setIsOpen] = useState32(false);
|
|
14928
|
-
const id =
|
|
15428
|
+
const id = useId15();
|
|
14929
15429
|
const ids = useMemo26(() => ({
|
|
14930
15430
|
button: `table-filter-button-${id}`,
|
|
14931
15431
|
popup: `table-filter-popup-${id}`,
|
|
@@ -14937,8 +15437,8 @@ var TableFilterButton = ({
|
|
|
14937
15437
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
14938
15438
|
return null;
|
|
14939
15439
|
}
|
|
14940
|
-
return /* @__PURE__ */
|
|
14941
|
-
/* @__PURE__ */
|
|
15440
|
+
return /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
15441
|
+
/* @__PURE__ */ jsx68(Tooltip, { tooltip: translation("filter"), position: "top", children: /* @__PURE__ */ jsxs39(
|
|
14942
15442
|
Button,
|
|
14943
15443
|
{
|
|
14944
15444
|
ref: anchorRef,
|
|
@@ -14954,12 +15454,12 @@ var TableFilterButton = ({
|
|
|
14954
15454
|
"aria-labelledby": ids.label,
|
|
14955
15455
|
className: "relative",
|
|
14956
15456
|
children: [
|
|
14957
|
-
/* @__PURE__ */
|
|
14958
|
-
/* @__PURE__ */
|
|
15457
|
+
/* @__PURE__ */ jsx68(FilterIcon, { className: "size-4" }),
|
|
15458
|
+
/* @__PURE__ */ jsx68(Visibility, { isVisible: hasFilter, children: /* @__PURE__ */ jsx68("div", { className: "absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary" }) })
|
|
14959
15459
|
]
|
|
14960
15460
|
}
|
|
14961
|
-
),
|
|
14962
|
-
/* @__PURE__ */
|
|
15461
|
+
) }),
|
|
15462
|
+
/* @__PURE__ */ jsxs39(
|
|
14963
15463
|
PopUp,
|
|
14964
15464
|
{
|
|
14965
15465
|
ref: containerRef,
|
|
@@ -14975,8 +15475,8 @@ var TableFilterButton = ({
|
|
|
14975
15475
|
"aria-labelledby": ids.label,
|
|
14976
15476
|
className: "flex-col-2 p-2 items-start",
|
|
14977
15477
|
children: [
|
|
14978
|
-
/* @__PURE__ */
|
|
14979
|
-
/* @__PURE__ */
|
|
15478
|
+
/* @__PURE__ */ jsx68("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15479
|
+
/* @__PURE__ */ jsx68(
|
|
14980
15480
|
TableFilterContent,
|
|
14981
15481
|
{
|
|
14982
15482
|
columnId: column.id,
|
|
@@ -14985,12 +15485,12 @@ var TableFilterButton = ({
|
|
|
14985
15485
|
onFilterValueChange: setFilterValue
|
|
14986
15486
|
}
|
|
14987
15487
|
),
|
|
14988
|
-
/* @__PURE__ */
|
|
14989
|
-
hasFilter && /* @__PURE__ */
|
|
15488
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
15489
|
+
hasFilter && /* @__PURE__ */ jsx68(Button, { color: "negative", size: "sm", onClick: () => {
|
|
14990
15490
|
column.setFilterValue(void 0);
|
|
14991
15491
|
setIsOpen(false);
|
|
14992
15492
|
}, children: translation("remove") }),
|
|
14993
|
-
/* @__PURE__ */
|
|
15493
|
+
/* @__PURE__ */ jsx68(Button, { size: "sm", onClick: () => {
|
|
14994
15494
|
if (filterValue) {
|
|
14995
15495
|
column.setFilterValue(filterValue);
|
|
14996
15496
|
}
|
|
@@ -15004,12 +15504,12 @@ var TableFilterButton = ({
|
|
|
15004
15504
|
};
|
|
15005
15505
|
|
|
15006
15506
|
// src/components/layout/table/TableHeader.tsx
|
|
15007
|
-
import { useCallback as
|
|
15008
|
-
import { Fragment as Fragment9, jsx as
|
|
15507
|
+
import { useCallback as useCallback23, useEffect as useEffect31 } from "react";
|
|
15508
|
+
import { Fragment as Fragment9, jsx as jsx69, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
15009
15509
|
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15010
15510
|
const { table: tableState } = useTableHeaderContext();
|
|
15011
15511
|
const table = tableOverride ?? tableState;
|
|
15012
|
-
const handleResizeMove =
|
|
15512
|
+
const handleResizeMove = useCallback23((e) => {
|
|
15013
15513
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15014
15514
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
15015
15515
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -15025,7 +15525,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15025
15525
|
deltaOffset
|
|
15026
15526
|
}));
|
|
15027
15527
|
}, [table]);
|
|
15028
|
-
const handleResizeEnd =
|
|
15528
|
+
const handleResizeEnd = useCallback23(() => {
|
|
15029
15529
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15030
15530
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
15031
15531
|
table.setColumnSizing((prev) => {
|
|
@@ -15051,8 +15551,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15051
15551
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15052
15552
|
};
|
|
15053
15553
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15054
|
-
return /* @__PURE__ */
|
|
15055
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
15554
|
+
return /* @__PURE__ */ jsxs40(Fragment9, { children: [
|
|
15555
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx69("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx69(
|
|
15056
15556
|
"col",
|
|
15057
15557
|
{
|
|
15058
15558
|
style: {
|
|
@@ -15063,16 +15563,16 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15063
15563
|
},
|
|
15064
15564
|
header.id
|
|
15065
15565
|
)) }, headerGroup.id)),
|
|
15066
|
-
/* @__PURE__ */
|
|
15067
|
-
return /* @__PURE__ */
|
|
15566
|
+
/* @__PURE__ */ jsx69("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx69("tr", { className: clsx34("table-header-row", table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
|
|
15567
|
+
return /* @__PURE__ */ jsxs40(
|
|
15068
15568
|
"th",
|
|
15069
15569
|
{
|
|
15070
15570
|
colSpan: header.colSpan,
|
|
15071
15571
|
"data-sticky": isSticky ? "" : void 0,
|
|
15072
|
-
className:
|
|
15572
|
+
className: clsx34("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15073
15573
|
children: [
|
|
15074
|
-
/* @__PURE__ */
|
|
15075
|
-
/* @__PURE__ */
|
|
15574
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ jsxs40("div", { className: "flex-row-1 items-center", children: [
|
|
15575
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ jsx69(
|
|
15076
15576
|
TableSortButton,
|
|
15077
15577
|
{
|
|
15078
15578
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15098,7 +15598,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15098
15598
|
}
|
|
15099
15599
|
}
|
|
15100
15600
|
) }),
|
|
15101
|
-
/* @__PURE__ */
|
|
15601
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ jsx69(
|
|
15102
15602
|
TableFilterButton,
|
|
15103
15603
|
{
|
|
15104
15604
|
column: header.column,
|
|
@@ -15110,7 +15610,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15110
15610
|
header.getContext()
|
|
15111
15611
|
)
|
|
15112
15612
|
] }) }),
|
|
15113
|
-
/* @__PURE__ */
|
|
15613
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ jsx69(
|
|
15114
15614
|
"div",
|
|
15115
15615
|
{
|
|
15116
15616
|
onPointerDown: (e) => {
|
|
@@ -15141,8 +15641,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15141
15641
|
};
|
|
15142
15642
|
|
|
15143
15643
|
// src/components/layout/table/TableDisplay.tsx
|
|
15144
|
-
import
|
|
15145
|
-
import { jsx as
|
|
15644
|
+
import clsx35 from "clsx";
|
|
15645
|
+
import { jsx as jsx70, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
15146
15646
|
var TableDisplay = ({
|
|
15147
15647
|
children,
|
|
15148
15648
|
containerProps,
|
|
@@ -15152,19 +15652,19 @@ var TableDisplay = ({
|
|
|
15152
15652
|
const { table } = useTableDataContext();
|
|
15153
15653
|
const { containerRef } = useTableContainerContext();
|
|
15154
15654
|
const { sizeVars } = useTableHeaderContext();
|
|
15155
|
-
return /* @__PURE__ */
|
|
15655
|
+
return /* @__PURE__ */ jsx70("div", { ...containerProps, ref: containerRef, className: clsx35("table-container", containerProps?.className), children: /* @__PURE__ */ jsxs41(
|
|
15156
15656
|
"table",
|
|
15157
15657
|
{
|
|
15158
15658
|
...props,
|
|
15159
|
-
className:
|
|
15659
|
+
className: clsx35("table", props.className),
|
|
15160
15660
|
style: {
|
|
15161
15661
|
...sizeVars,
|
|
15162
15662
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15163
15663
|
},
|
|
15164
15664
|
children: [
|
|
15165
15665
|
children,
|
|
15166
|
-
/* @__PURE__ */
|
|
15167
|
-
/* @__PURE__ */
|
|
15666
|
+
/* @__PURE__ */ jsx70(TableHeader, { ...tableHeaderProps }),
|
|
15667
|
+
/* @__PURE__ */ jsx70(TableBody, {})
|
|
15168
15668
|
]
|
|
15169
15669
|
}
|
|
15170
15670
|
) });
|
|
@@ -15172,8 +15672,8 @@ var TableDisplay = ({
|
|
|
15172
15672
|
|
|
15173
15673
|
// src/components/layout/table/TablePagination.tsx
|
|
15174
15674
|
import { useEffect as useEffect32 } from "react";
|
|
15175
|
-
import
|
|
15176
|
-
import { jsx as
|
|
15675
|
+
import clsx36 from "clsx";
|
|
15676
|
+
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15177
15677
|
var TablePaginationMenu = ({ ...props }) => {
|
|
15178
15678
|
const { table } = useTableDataContext();
|
|
15179
15679
|
useEffect32(() => {
|
|
@@ -15183,7 +15683,7 @@ var TablePaginationMenu = ({ ...props }) => {
|
|
|
15183
15683
|
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15184
15684
|
}
|
|
15185
15685
|
}, [table]);
|
|
15186
|
-
return /* @__PURE__ */
|
|
15686
|
+
return /* @__PURE__ */ jsx71(
|
|
15187
15687
|
Pagination,
|
|
15188
15688
|
{
|
|
15189
15689
|
...props,
|
|
@@ -15203,94 +15703,23 @@ var TablePageSizeSelect = ({
|
|
|
15203
15703
|
}) => {
|
|
15204
15704
|
const { table } = useTableDataContext();
|
|
15205
15705
|
const currentPageSize = table.getState().pagination.pageSize;
|
|
15206
|
-
return /* @__PURE__ */
|
|
15706
|
+
return /* @__PURE__ */ jsx71(
|
|
15207
15707
|
Select,
|
|
15208
15708
|
{
|
|
15209
15709
|
...props,
|
|
15210
15710
|
value: currentPageSize.toString(),
|
|
15211
15711
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15212
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
15712
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx71(SelectOption, { value: size.toString(), children: size }, size))
|
|
15213
15713
|
}
|
|
15214
15714
|
);
|
|
15215
15715
|
};
|
|
15216
15716
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15217
|
-
return /* @__PURE__ */
|
|
15218
|
-
/* @__PURE__ */
|
|
15219
|
-
/* @__PURE__ */
|
|
15717
|
+
return /* @__PURE__ */ jsxs42("div", { ...props, className: clsx36("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
|
|
15718
|
+
/* @__PURE__ */ jsx71(TablePaginationMenu, {}),
|
|
15719
|
+
/* @__PURE__ */ jsx71(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ jsx71(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "h-10 min-w-24 max-w-24" } }) })
|
|
15220
15720
|
] });
|
|
15221
15721
|
};
|
|
15222
15722
|
|
|
15223
|
-
// src/components/user-interaction/Checkbox.tsx
|
|
15224
|
-
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
15225
|
-
import { useCallback as useCallback23 } from "react";
|
|
15226
|
-
import clsx36 from "clsx";
|
|
15227
|
-
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15228
|
-
var Checkbox = ({
|
|
15229
|
-
value = false,
|
|
15230
|
-
indeterminate = false,
|
|
15231
|
-
required = false,
|
|
15232
|
-
invalid = false,
|
|
15233
|
-
disabled = false,
|
|
15234
|
-
readOnly = false,
|
|
15235
|
-
onValueChange,
|
|
15236
|
-
onEditComplete,
|
|
15237
|
-
size = "md",
|
|
15238
|
-
alwaysShowCheckIcon = false,
|
|
15239
|
-
...props
|
|
15240
|
-
}) => {
|
|
15241
|
-
const onChangeWrapper = useCallback23(() => {
|
|
15242
|
-
onValueChange?.(!value);
|
|
15243
|
-
onEditComplete?.(!value);
|
|
15244
|
-
}, [onEditComplete, onValueChange, value]);
|
|
15245
|
-
return /* @__PURE__ */ jsxs42(
|
|
15246
|
-
"div",
|
|
15247
|
-
{
|
|
15248
|
-
...props,
|
|
15249
|
-
onClick: (event) => {
|
|
15250
|
-
if (!disabled) {
|
|
15251
|
-
onChangeWrapper();
|
|
15252
|
-
props.onClick?.(event);
|
|
15253
|
-
}
|
|
15254
|
-
},
|
|
15255
|
-
onKeyDown: (event) => {
|
|
15256
|
-
if (disabled) return;
|
|
15257
|
-
if (event.key === " " || event.key === "Enter") {
|
|
15258
|
-
event.preventDefault();
|
|
15259
|
-
onChangeWrapper();
|
|
15260
|
-
props.onKeyDown?.(event);
|
|
15261
|
-
}
|
|
15262
|
-
},
|
|
15263
|
-
"data-checked": !indeterminate ? value : "indeterminate",
|
|
15264
|
-
"data-size": size ?? void 0,
|
|
15265
|
-
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
15266
|
-
role: "checkbox",
|
|
15267
|
-
tabIndex: disabled ? -1 : 0,
|
|
15268
|
-
"aria-checked": indeterminate ? "mixed" : value,
|
|
15269
|
-
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15270
|
-
className: clsx36("checkbox", props.className),
|
|
15271
|
-
children: [
|
|
15272
|
-
/* @__PURE__ */ jsx71(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx71(Minus2, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15273
|
-
/* @__PURE__ */ jsx71(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx71(Check2, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
15274
|
-
]
|
|
15275
|
-
}
|
|
15276
|
-
);
|
|
15277
|
-
};
|
|
15278
|
-
var CheckboxUncontrolled = ({
|
|
15279
|
-
value: initialValue,
|
|
15280
|
-
onValueChange,
|
|
15281
|
-
...props
|
|
15282
|
-
}) => {
|
|
15283
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15284
|
-
return /* @__PURE__ */ jsx71(
|
|
15285
|
-
Checkbox,
|
|
15286
|
-
{
|
|
15287
|
-
...props,
|
|
15288
|
-
value,
|
|
15289
|
-
onValueChange: setValue
|
|
15290
|
-
}
|
|
15291
|
-
);
|
|
15292
|
-
};
|
|
15293
|
-
|
|
15294
15723
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
15295
15724
|
import { useCallback as useCallback24, useMemo as useMemo27 } from "react";
|
|
15296
15725
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
@@ -15304,6 +15733,7 @@ var TableWithSelectionProvider = ({
|
|
|
15304
15733
|
onRowClick,
|
|
15305
15734
|
...props
|
|
15306
15735
|
}) => {
|
|
15736
|
+
const translation = useHightideTranslation();
|
|
15307
15737
|
const columnDef = useMemo27(() => [
|
|
15308
15738
|
{
|
|
15309
15739
|
id: selectionRowId,
|
|
@@ -15336,10 +15766,13 @@ var TableWithSelectionProvider = ({
|
|
|
15336
15766
|
enableResizing: false,
|
|
15337
15767
|
enableSorting: false,
|
|
15338
15768
|
enableHiding: false,
|
|
15339
|
-
enableColumnFilter: false
|
|
15769
|
+
enableColumnFilter: false,
|
|
15770
|
+
meta: {
|
|
15771
|
+
columnLabel: translation("selection")
|
|
15772
|
+
}
|
|
15340
15773
|
},
|
|
15341
15774
|
...props.columns ?? []
|
|
15342
|
-
], [selectionRowId, props.columns]);
|
|
15775
|
+
], [selectionRowId, props.columns, translation]);
|
|
15343
15776
|
return /* @__PURE__ */ jsx72(
|
|
15344
15777
|
TableProvider,
|
|
15345
15778
|
{
|
|
@@ -15440,14 +15873,14 @@ var TableColumn = (props) => {
|
|
|
15440
15873
|
};
|
|
15441
15874
|
|
|
15442
15875
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
15443
|
-
import { useMemo as useMemo29, useRef as useRef25, useId as
|
|
15876
|
+
import { useMemo as useMemo29, useRef as useRef25, useId as useId16 } from "react";
|
|
15444
15877
|
import { ChevronUp as ChevronUp3, ChevronDown as ChevronDown5, ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight5, Eye, EyeOff, Pin, PinOff, ArrowLeftRightIcon } from "lucide-react";
|
|
15445
15878
|
import { Fragment as Fragment10, jsx as jsx75, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
15446
15879
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
15447
15880
|
const { table } = useTableDataContext();
|
|
15448
15881
|
const translation = useHightideTranslation();
|
|
15449
15882
|
const containerRef = useRef25(null);
|
|
15450
|
-
const generatedId =
|
|
15883
|
+
const generatedId = useId16();
|
|
15451
15884
|
const ids = useMemo29(() => ({
|
|
15452
15885
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
15453
15886
|
label: `table-column-picker-label-${generatedId}`
|
|
@@ -15558,6 +15991,10 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
15558
15991
|
};
|
|
15559
15992
|
const getColumnHeader = (columnId) => {
|
|
15560
15993
|
const column = table.getColumn(columnId);
|
|
15994
|
+
const columnLabel = column?.columnDef.meta?.columnLabel;
|
|
15995
|
+
if (columnLabel) {
|
|
15996
|
+
return columnLabel;
|
|
15997
|
+
}
|
|
15561
15998
|
const header = column?.columnDef.header;
|
|
15562
15999
|
if (typeof header === "string") {
|
|
15563
16000
|
return header;
|
|
@@ -16104,7 +16541,7 @@ var ScrollPicker = ({
|
|
|
16104
16541
|
};
|
|
16105
16542
|
|
|
16106
16543
|
// src/components/user-interaction/Textarea.tsx
|
|
16107
|
-
import { forwardRef as forwardRef16, useId as
|
|
16544
|
+
import { forwardRef as forwardRef16, useId as useId17 } from "react";
|
|
16108
16545
|
import clsx41 from "clsx";
|
|
16109
16546
|
import { jsx as jsx79, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
16110
16547
|
var Textarea = forwardRef16(function Textarea2({
|
|
@@ -16167,7 +16604,7 @@ var TextareaWithHeadline = ({
|
|
|
16167
16604
|
containerClassName,
|
|
16168
16605
|
...props
|
|
16169
16606
|
}) => {
|
|
16170
|
-
const genId =
|
|
16607
|
+
const genId = useId17();
|
|
16171
16608
|
const usedId = id ?? genId;
|
|
16172
16609
|
return /* @__PURE__ */ jsxs48(
|
|
16173
16610
|
"div",
|
|
@@ -16240,7 +16677,7 @@ var TimeDisplay = ({
|
|
|
16240
16677
|
};
|
|
16241
16678
|
|
|
16242
16679
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16243
|
-
import { useId as
|
|
16680
|
+
import { useId as useId18 } from "react";
|
|
16244
16681
|
import { forwardRef as forwardRef17, useState as useState37 } from "react";
|
|
16245
16682
|
import clsx42 from "clsx";
|
|
16246
16683
|
import { jsx as jsx81, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
@@ -16251,7 +16688,7 @@ var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
|
16251
16688
|
}, forwardedRef) {
|
|
16252
16689
|
const { value } = props;
|
|
16253
16690
|
const [isFocused, setIsFocused] = useState37(false);
|
|
16254
|
-
const generatedId =
|
|
16691
|
+
const generatedId = useId18();
|
|
16255
16692
|
const id = customId ?? generatedId;
|
|
16256
16693
|
return /* @__PURE__ */ jsxs49("div", { className: clsx42("relative"), children: [
|
|
16257
16694
|
/* @__PURE__ */ jsx81(
|
|
@@ -17503,6 +17940,7 @@ export {
|
|
|
17503
17940
|
DateTimePickerDialog,
|
|
17504
17941
|
DateTimePickerUncontrolled,
|
|
17505
17942
|
DateUtils,
|
|
17943
|
+
DatetimeFilter,
|
|
17506
17944
|
DayPicker,
|
|
17507
17945
|
DayPickerUncontrolled,
|
|
17508
17946
|
Dialog,
|
|
@@ -17638,6 +18076,7 @@ export {
|
|
|
17638
18076
|
TableWithSelectionProvider,
|
|
17639
18077
|
TagIcon,
|
|
17640
18078
|
TagsFilter,
|
|
18079
|
+
TagsSingleFilter,
|
|
17641
18080
|
TextFilter,
|
|
17642
18081
|
TextImage,
|
|
17643
18082
|
TextProperty,
|
|
@@ -17667,6 +18106,14 @@ export {
|
|
|
17667
18106
|
createLoopingList,
|
|
17668
18107
|
createLoopingListWithIndex,
|
|
17669
18108
|
equalSizeGroups,
|
|
18109
|
+
filterBoolean,
|
|
18110
|
+
filterDate,
|
|
18111
|
+
filterDatetime,
|
|
18112
|
+
filterGeneric,
|
|
18113
|
+
filterNumber,
|
|
18114
|
+
filterTags,
|
|
18115
|
+
filterTagsSingle,
|
|
18116
|
+
filterText,
|
|
17670
18117
|
formatDate,
|
|
17671
18118
|
formatDateTime,
|
|
17672
18119
|
getBetweenDuration,
|