@helpwave/hightide 0.6.12 → 0.6.13
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 +74 -6
- package/dist/index.d.ts +74 -6
- package/dist/index.js +765 -330
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +742 -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,11 +13203,19 @@ 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;
|
|
13135
13209
|
const operator = filterValue.operator;
|
|
13136
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);
|
|
13137
13219
|
case "undefined":
|
|
13138
13220
|
return value === void 0 || value === null;
|
|
13139
13221
|
case "notUndefined":
|
|
@@ -13141,13 +13223,73 @@ var genericFilter = (row, columnId, filterValue) => {
|
|
|
13141
13223
|
default:
|
|
13142
13224
|
return false;
|
|
13143
13225
|
}
|
|
13226
|
+
}
|
|
13227
|
+
function filterGeneric(value, filterValue) {
|
|
13228
|
+
const operator = filterValue.operator;
|
|
13229
|
+
switch (operator) {
|
|
13230
|
+
case "undefined":
|
|
13231
|
+
return value === void 0 || value === null;
|
|
13232
|
+
case "notUndefined":
|
|
13233
|
+
return value !== void 0 && value !== null;
|
|
13234
|
+
default:
|
|
13235
|
+
return false;
|
|
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
|
+
};
|
|
13257
|
+
var numberFilter = (row, columnId, filterValue) => {
|
|
13258
|
+
const value = row.getValue(columnId);
|
|
13259
|
+
return filterNumber(value, filterValue);
|
|
13260
|
+
};
|
|
13261
|
+
var dateFilter = (row, columnId, filterValue) => {
|
|
13262
|
+
const value = row.getValue(columnId);
|
|
13263
|
+
return filterDate(value, filterValue);
|
|
13264
|
+
};
|
|
13265
|
+
var datetimeFilter = (row, columnId, filterValue) => {
|
|
13266
|
+
const value = row.getValue(columnId);
|
|
13267
|
+
return filterDatetime(value, filterValue);
|
|
13268
|
+
};
|
|
13269
|
+
var booleanFilter = (row, columnId, filterValue) => {
|
|
13270
|
+
const value = row.getValue(columnId);
|
|
13271
|
+
return filterBoolean(value, filterValue);
|
|
13272
|
+
};
|
|
13273
|
+
var tagsFilter = (row, columnId, filterValue) => {
|
|
13274
|
+
const value = row.getValue(columnId);
|
|
13275
|
+
return filterTags(value, filterValue);
|
|
13276
|
+
};
|
|
13277
|
+
var tagsSingleFilter = (row, columnId, filterValue) => {
|
|
13278
|
+
const value = row.getValue(columnId);
|
|
13279
|
+
return filterTagsSingle(value, filterValue);
|
|
13280
|
+
};
|
|
13281
|
+
var genericFilter = (row, columnId, filterValue) => {
|
|
13282
|
+
const value = row.getValue(columnId);
|
|
13283
|
+
return filterGeneric(value, filterValue);
|
|
13144
13284
|
};
|
|
13145
13285
|
var TableFilter = {
|
|
13146
13286
|
text: textFilter,
|
|
13147
13287
|
number: numberFilter,
|
|
13148
13288
|
date: dateFilter,
|
|
13289
|
+
datetime: datetimeFilter,
|
|
13149
13290
|
boolean: booleanFilter,
|
|
13150
13291
|
tags: tagsFilter,
|
|
13292
|
+
tagsSingle: tagsSingleFilter,
|
|
13151
13293
|
generic: genericFilter
|
|
13152
13294
|
};
|
|
13153
13295
|
|
|
@@ -13405,7 +13547,7 @@ var TableBody = React5.memo(function TableBodyVisual() {
|
|
|
13405
13547
|
|
|
13406
13548
|
// src/components/layout/table/TableHeader.tsx
|
|
13407
13549
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
13408
|
-
import
|
|
13550
|
+
import clsx34 from "clsx";
|
|
13409
13551
|
|
|
13410
13552
|
// src/components/layout/table/TableSortButton.tsx
|
|
13411
13553
|
import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
@@ -13431,31 +13573,41 @@ var TableSortButton = ({
|
|
|
13431
13573
|
icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx57(ChevronUp2, { className: "size-4" }) : /* @__PURE__ */ jsx57(ChevronDown3, { className: "size-4" });
|
|
13432
13574
|
}
|
|
13433
13575
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13434
|
-
return /* @__PURE__ */ jsx57(
|
|
13435
|
-
|
|
13576
|
+
return /* @__PURE__ */ jsx57(
|
|
13577
|
+
Tooltip,
|
|
13436
13578
|
{
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
children:
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13579
|
+
tooltip: /* @__PURE__ */ jsxs28("div", { className: "flex-col-2", children: [
|
|
13580
|
+
/* @__PURE__ */ jsx57("span", { children: translation("sSortingState", { sortDirection: sortDirection || "none" }) }),
|
|
13581
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57("span", { children: translation("rSortingOrderAfter", { otherSortings: index - 1 }) }) })
|
|
13582
|
+
] }),
|
|
13583
|
+
position: "top",
|
|
13584
|
+
children: /* @__PURE__ */ jsxs28(
|
|
13585
|
+
Button,
|
|
13586
|
+
{
|
|
13587
|
+
layout: hasSortingIndex ? "default" : "icon",
|
|
13588
|
+
color,
|
|
13589
|
+
size,
|
|
13590
|
+
className: clsx28("relative", className),
|
|
13591
|
+
...props,
|
|
13592
|
+
children: [
|
|
13593
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx57(
|
|
13594
|
+
"div",
|
|
13595
|
+
{
|
|
13596
|
+
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"),
|
|
13597
|
+
children: `${index}.`
|
|
13598
|
+
}
|
|
13599
|
+
) }),
|
|
13600
|
+
icon
|
|
13601
|
+
]
|
|
13602
|
+
}
|
|
13603
|
+
)
|
|
13452
13604
|
}
|
|
13453
|
-
)
|
|
13605
|
+
);
|
|
13454
13606
|
};
|
|
13455
13607
|
|
|
13456
13608
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13457
13609
|
import { FilterIcon } from "lucide-react";
|
|
13458
|
-
import { useEffect as useEffect30, useId as
|
|
13610
|
+
import { useEffect as useEffect30, useId as useId15, useMemo as useMemo26, useRef as useRef24, useState as useState32 } from "react";
|
|
13459
13611
|
|
|
13460
13612
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13461
13613
|
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 +14537,7 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14385
14537
|
});
|
|
14386
14538
|
|
|
14387
14539
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14388
|
-
import { useMemo as useMemo25, useState as useState31 } from "react";
|
|
14540
|
+
import { useId as useId14, useMemo as useMemo25, useState as useState31 } from "react";
|
|
14389
14541
|
|
|
14390
14542
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14391
14543
|
import { forwardRef as forwardRef15 } from "react";
|
|
@@ -14434,119 +14586,240 @@ import {
|
|
|
14434
14586
|
CircleDashed,
|
|
14435
14587
|
CircleDot
|
|
14436
14588
|
} from "lucide-react";
|
|
14589
|
+
|
|
14590
|
+
// src/components/user-interaction/Checkbox.tsx
|
|
14591
|
+
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
14592
|
+
import { useCallback as useCallback22 } from "react";
|
|
14593
|
+
import clsx33 from "clsx";
|
|
14437
14594
|
import { jsx as jsx66, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
14595
|
+
var Checkbox = ({
|
|
14596
|
+
value = false,
|
|
14597
|
+
indeterminate = false,
|
|
14598
|
+
required = false,
|
|
14599
|
+
invalid = false,
|
|
14600
|
+
disabled = false,
|
|
14601
|
+
readOnly = false,
|
|
14602
|
+
onValueChange,
|
|
14603
|
+
onEditComplete,
|
|
14604
|
+
size = "md",
|
|
14605
|
+
alwaysShowCheckIcon = false,
|
|
14606
|
+
...props
|
|
14607
|
+
}) => {
|
|
14608
|
+
const onChangeWrapper = useCallback22(() => {
|
|
14609
|
+
onValueChange?.(!value);
|
|
14610
|
+
onEditComplete?.(!value);
|
|
14611
|
+
}, [onEditComplete, onValueChange, value]);
|
|
14612
|
+
return /* @__PURE__ */ jsxs37(
|
|
14613
|
+
"div",
|
|
14614
|
+
{
|
|
14615
|
+
...props,
|
|
14616
|
+
onClick: (event) => {
|
|
14617
|
+
if (!disabled) {
|
|
14618
|
+
onChangeWrapper();
|
|
14619
|
+
props.onClick?.(event);
|
|
14620
|
+
}
|
|
14621
|
+
},
|
|
14622
|
+
onKeyDown: (event) => {
|
|
14623
|
+
if (disabled) return;
|
|
14624
|
+
if (event.key === " " || event.key === "Enter") {
|
|
14625
|
+
event.preventDefault();
|
|
14626
|
+
onChangeWrapper();
|
|
14627
|
+
props.onKeyDown?.(event);
|
|
14628
|
+
}
|
|
14629
|
+
},
|
|
14630
|
+
"data-checked": !indeterminate ? value : "indeterminate",
|
|
14631
|
+
"data-size": size ?? void 0,
|
|
14632
|
+
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
14633
|
+
role: "checkbox",
|
|
14634
|
+
tabIndex: disabled ? -1 : 0,
|
|
14635
|
+
"aria-checked": indeterminate ? "mixed" : value,
|
|
14636
|
+
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
14637
|
+
className: clsx33("checkbox", props.className),
|
|
14638
|
+
children: [
|
|
14639
|
+
/* @__PURE__ */ jsx66(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx66(Minus2, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
14640
|
+
/* @__PURE__ */ jsx66(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx66(Check2, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
14641
|
+
]
|
|
14642
|
+
}
|
|
14643
|
+
);
|
|
14644
|
+
};
|
|
14645
|
+
var CheckboxUncontrolled = ({
|
|
14646
|
+
value: initialValue,
|
|
14647
|
+
onValueChange,
|
|
14648
|
+
...props
|
|
14649
|
+
}) => {
|
|
14650
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14651
|
+
return /* @__PURE__ */ jsx66(
|
|
14652
|
+
Checkbox,
|
|
14653
|
+
{
|
|
14654
|
+
...props,
|
|
14655
|
+
value,
|
|
14656
|
+
onValueChange: setValue
|
|
14657
|
+
}
|
|
14658
|
+
);
|
|
14659
|
+
};
|
|
14660
|
+
|
|
14661
|
+
// src/components/layout/table/TableFilterPopups.tsx
|
|
14662
|
+
import { jsx as jsx67, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
14438
14663
|
var getOperatorInfo = (operator) => {
|
|
14439
14664
|
switch (operator) {
|
|
14440
14665
|
case "textEquals":
|
|
14441
|
-
return { icon: /* @__PURE__ */
|
|
14666
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14442
14667
|
case "textNotEquals":
|
|
14443
|
-
return { icon: /* @__PURE__ */
|
|
14668
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14444
14669
|
case "textNotWhitespace":
|
|
14445
|
-
return { icon: /* @__PURE__ */
|
|
14670
|
+
return { icon: /* @__PURE__ */ jsx67(TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14446
14671
|
case "textContains":
|
|
14447
|
-
return { icon: /* @__PURE__ */
|
|
14672
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14448
14673
|
case "textNotContains":
|
|
14449
|
-
return { icon: /* @__PURE__ */
|
|
14674
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14450
14675
|
case "textStartsWith":
|
|
14451
|
-
return { icon: /* @__PURE__ */
|
|
14676
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14452
14677
|
case "textEndsWith":
|
|
14453
|
-
return { icon: /* @__PURE__ */
|
|
14678
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14454
14679
|
case "numberEquals":
|
|
14455
|
-
return { icon: /* @__PURE__ */
|
|
14680
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14456
14681
|
case "numberNotEquals":
|
|
14457
|
-
return { icon: /* @__PURE__ */
|
|
14682
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14458
14683
|
case "numberGreaterThan":
|
|
14459
|
-
return { icon: /* @__PURE__ */
|
|
14684
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14460
14685
|
case "numberGreaterThanOrEqual":
|
|
14461
14686
|
return {
|
|
14462
|
-
icon: /* @__PURE__ */
|
|
14463
|
-
/* @__PURE__ */
|
|
14464
|
-
/* @__PURE__ */
|
|
14687
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14688
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14689
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14465
14690
|
] }),
|
|
14466
14691
|
translationKey: "greaterThanOrEqual"
|
|
14467
14692
|
};
|
|
14468
14693
|
case "numberLessThan":
|
|
14469
|
-
return { icon: /* @__PURE__ */
|
|
14694
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14470
14695
|
case "numberLessThanOrEqual":
|
|
14471
14696
|
return {
|
|
14472
|
-
icon: /* @__PURE__ */
|
|
14473
|
-
/* @__PURE__ */
|
|
14474
|
-
/* @__PURE__ */
|
|
14697
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14698
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14699
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14475
14700
|
] }),
|
|
14476
14701
|
translationKey: "lessThanOrEqual"
|
|
14477
14702
|
};
|
|
14478
14703
|
case "numberBetween":
|
|
14479
14704
|
return {
|
|
14480
|
-
icon: /* @__PURE__ */
|
|
14481
|
-
/* @__PURE__ */
|
|
14482
|
-
/* @__PURE__ */
|
|
14705
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14706
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14707
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14483
14708
|
] }),
|
|
14484
14709
|
translationKey: "between"
|
|
14485
14710
|
};
|
|
14486
14711
|
case "numberNotBetween":
|
|
14487
14712
|
return {
|
|
14488
|
-
icon: /* @__PURE__ */
|
|
14489
|
-
/* @__PURE__ */
|
|
14490
|
-
/* @__PURE__ */
|
|
14713
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14714
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14715
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14491
14716
|
] }),
|
|
14492
14717
|
translationKey: "notBetween"
|
|
14493
14718
|
};
|
|
14494
14719
|
case "dateEquals":
|
|
14495
|
-
return { icon: /* @__PURE__ */
|
|
14720
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14496
14721
|
case "dateNotEquals":
|
|
14497
|
-
return { icon: /* @__PURE__ */
|
|
14722
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14498
14723
|
case "dateGreaterThan":
|
|
14499
|
-
return { icon: /* @__PURE__ */
|
|
14724
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14500
14725
|
case "dateGreaterThanOrEqual":
|
|
14501
14726
|
return {
|
|
14502
|
-
icon: /* @__PURE__ */
|
|
14503
|
-
/* @__PURE__ */
|
|
14504
|
-
/* @__PURE__ */
|
|
14727
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14728
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14729
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14505
14730
|
] }),
|
|
14506
14731
|
translationKey: "onOrAfter"
|
|
14507
14732
|
};
|
|
14508
14733
|
case "dateLessThan":
|
|
14509
|
-
return { icon: /* @__PURE__ */
|
|
14734
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14510
14735
|
case "dateLessThanOrEqual":
|
|
14511
14736
|
return {
|
|
14512
|
-
icon: /* @__PURE__ */
|
|
14513
|
-
/* @__PURE__ */
|
|
14514
|
-
/* @__PURE__ */
|
|
14737
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14738
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14739
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14515
14740
|
] }),
|
|
14516
14741
|
translationKey: "onOrBefore"
|
|
14517
14742
|
};
|
|
14518
14743
|
case "dateBetween":
|
|
14519
14744
|
return {
|
|
14520
|
-
icon: /* @__PURE__ */
|
|
14521
|
-
/* @__PURE__ */
|
|
14522
|
-
/* @__PURE__ */
|
|
14745
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14746
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14747
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14523
14748
|
] }),
|
|
14524
14749
|
translationKey: "between"
|
|
14525
14750
|
};
|
|
14526
14751
|
case "dateNotBetween":
|
|
14527
14752
|
return {
|
|
14528
|
-
icon: /* @__PURE__ */
|
|
14529
|
-
/* @__PURE__ */
|
|
14530
|
-
/* @__PURE__ */
|
|
14753
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14754
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14755
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14531
14756
|
] }),
|
|
14532
14757
|
translationKey: "notBetween"
|
|
14533
14758
|
};
|
|
14534
14759
|
case "booleanIsTrue":
|
|
14535
|
-
return { icon: /* @__PURE__ */
|
|
14760
|
+
return { icon: /* @__PURE__ */ jsx67(CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14536
14761
|
case "booleanIsFalse":
|
|
14537
|
-
return { icon: /* @__PURE__ */
|
|
14762
|
+
return { icon: /* @__PURE__ */ jsx67(XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14538
14763
|
case "tagsEquals":
|
|
14539
|
-
return { icon: /* @__PURE__ */
|
|
14764
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14540
14765
|
case "tagsNotEquals":
|
|
14541
|
-
return { icon: /* @__PURE__ */
|
|
14766
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14542
14767
|
case "tagsContains":
|
|
14543
|
-
return { icon: /* @__PURE__ */
|
|
14768
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14544
14769
|
case "tagsNotContains":
|
|
14545
|
-
return { icon: /* @__PURE__ */
|
|
14770
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14771
|
+
case "datetimeEquals":
|
|
14772
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14773
|
+
case "datetimeNotEquals":
|
|
14774
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14775
|
+
case "datetimeGreaterThan":
|
|
14776
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14777
|
+
case "datetimeGreaterThanOrEqual":
|
|
14778
|
+
return {
|
|
14779
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14780
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14781
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14782
|
+
] }),
|
|
14783
|
+
translationKey: "onOrAfter"
|
|
14784
|
+
};
|
|
14785
|
+
case "datetimeLessThan":
|
|
14786
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14787
|
+
case "datetimeLessThanOrEqual":
|
|
14788
|
+
return {
|
|
14789
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14790
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14791
|
+
/* @__PURE__ */ jsx67(Equal, { className: "-ml-1 w-4 h-4" })
|
|
14792
|
+
] }),
|
|
14793
|
+
translationKey: "onOrBefore"
|
|
14794
|
+
};
|
|
14795
|
+
case "datetimeBetween":
|
|
14796
|
+
return {
|
|
14797
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14798
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }),
|
|
14799
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "-ml-1 w-4 h-4" })
|
|
14800
|
+
] }),
|
|
14801
|
+
translationKey: "between"
|
|
14802
|
+
};
|
|
14803
|
+
case "datetimeNotBetween":
|
|
14804
|
+
return {
|
|
14805
|
+
icon: /* @__PURE__ */ jsxs38("div", { className: "flex-row-0 items-center", children: [
|
|
14806
|
+
/* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }),
|
|
14807
|
+
/* @__PURE__ */ jsx67(ChevronRight4, { className: "-ml-1 w-4 h-4" })
|
|
14808
|
+
] }),
|
|
14809
|
+
translationKey: "notBetween"
|
|
14810
|
+
};
|
|
14811
|
+
case "tagsSingleEquals":
|
|
14812
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14813
|
+
case "tagsSingleNotEquals":
|
|
14814
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14815
|
+
case "tagsSingleContains":
|
|
14816
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14817
|
+
case "tagsSingleNotContains":
|
|
14818
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14546
14819
|
case "undefined":
|
|
14547
|
-
return { icon: /* @__PURE__ */
|
|
14820
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14548
14821
|
case "notUndefined":
|
|
14549
|
-
return { icon: /* @__PURE__ */
|
|
14822
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14550
14823
|
default:
|
|
14551
14824
|
return { icon: null, translationKey: "undefined translation" };
|
|
14552
14825
|
}
|
|
@@ -14555,22 +14828,23 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14555
14828
|
const translation = useHightideTranslation();
|
|
14556
14829
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14557
14830
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14558
|
-
return /* @__PURE__ */
|
|
14831
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14559
14832
|
icon,
|
|
14560
14833
|
label
|
|
14561
14834
|
] });
|
|
14562
14835
|
};
|
|
14563
14836
|
var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14564
14837
|
const translation = useHightideTranslation();
|
|
14565
|
-
const operator = filterValue?.operator ?? "
|
|
14838
|
+
const operator = filterValue?.operator ?? "textContains";
|
|
14566
14839
|
const parameter = filterValue?.parameter ?? {};
|
|
14840
|
+
const id = useId14();
|
|
14567
14841
|
const availableOperators = useMemo25(() => [
|
|
14568
14842
|
...TableFilterOperator.text,
|
|
14569
14843
|
...TableFilterOperator.generic
|
|
14570
14844
|
], []);
|
|
14571
14845
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14572
|
-
return /* @__PURE__ */
|
|
14573
|
-
/* @__PURE__ */
|
|
14846
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14847
|
+
/* @__PURE__ */ jsx67(
|
|
14574
14848
|
Select,
|
|
14575
14849
|
{
|
|
14576
14850
|
value: operator,
|
|
@@ -14581,30 +14855,48 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14581
14855
|
});
|
|
14582
14856
|
},
|
|
14583
14857
|
buttonProps: { className: "min-w-64" },
|
|
14584
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14858
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14585
14859
|
}
|
|
14586
14860
|
),
|
|
14587
|
-
/* @__PURE__ */
|
|
14588
|
-
/* @__PURE__ */
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14861
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14862
|
+
/* @__PURE__ */ jsxs38(Visibility, { isVisible: needsParameterInput, children: [
|
|
14863
|
+
/* @__PURE__ */ jsx67(
|
|
14864
|
+
Input,
|
|
14865
|
+
{
|
|
14866
|
+
value: parameter.searchText ?? "",
|
|
14867
|
+
placeholder: translation("search") + "...",
|
|
14868
|
+
onValueChange: (searchText) => {
|
|
14869
|
+
onFilterValueChange({
|
|
14870
|
+
operator,
|
|
14871
|
+
parameter: { ...parameter, searchText }
|
|
14872
|
+
});
|
|
14873
|
+
},
|
|
14874
|
+
className: "min-w-64"
|
|
14875
|
+
}
|
|
14876
|
+
),
|
|
14877
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex-row-2 items-center gap-2", children: [
|
|
14878
|
+
/* @__PURE__ */ jsx67(
|
|
14879
|
+
Checkbox,
|
|
14880
|
+
{
|
|
14881
|
+
id,
|
|
14882
|
+
value: parameter.isCaseSensitive ?? false,
|
|
14883
|
+
onValueChange: (isCaseSensitive) => {
|
|
14884
|
+
onFilterValueChange({
|
|
14885
|
+
operator,
|
|
14886
|
+
parameter: { ...parameter, isCaseSensitive }
|
|
14887
|
+
});
|
|
14888
|
+
}
|
|
14889
|
+
}
|
|
14890
|
+
),
|
|
14891
|
+
/* @__PURE__ */ jsx67("label", { htmlFor: id, children: translation("caseSensitive") })
|
|
14892
|
+
] })
|
|
14893
|
+
] }),
|
|
14894
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
14603
14895
|
] });
|
|
14604
14896
|
};
|
|
14605
14897
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14606
14898
|
const translation = useHightideTranslation();
|
|
14607
|
-
const operator = filterValue?.operator ?? "
|
|
14899
|
+
const operator = filterValue?.operator ?? "numberBetween";
|
|
14608
14900
|
const parameter = filterValue?.parameter ?? {};
|
|
14609
14901
|
const availableOperators = useMemo25(() => [
|
|
14610
14902
|
...TableFilterOperator.number,
|
|
@@ -14612,8 +14904,8 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14612
14904
|
], []);
|
|
14613
14905
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14614
14906
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14615
|
-
return /* @__PURE__ */
|
|
14616
|
-
/* @__PURE__ */
|
|
14907
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14908
|
+
/* @__PURE__ */ jsx67(
|
|
14617
14909
|
Select,
|
|
14618
14910
|
{
|
|
14619
14911
|
value: operator,
|
|
@@ -14624,12 +14916,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14624
14916
|
});
|
|
14625
14917
|
},
|
|
14626
14918
|
buttonProps: { className: "min-w-64" },
|
|
14627
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14919
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14628
14920
|
}
|
|
14629
14921
|
),
|
|
14630
|
-
/* @__PURE__ */
|
|
14631
|
-
/* @__PURE__ */
|
|
14632
|
-
/* @__PURE__ */
|
|
14922
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14923
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14924
|
+
/* @__PURE__ */ jsx67(FormFieldLayout, { label: translation("min"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ jsx67(
|
|
14633
14925
|
Input,
|
|
14634
14926
|
{
|
|
14635
14927
|
...ariaAttributes,
|
|
@@ -14648,7 +14940,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14648
14940
|
className: "input-indicator-hidden min-w-64"
|
|
14649
14941
|
}
|
|
14650
14942
|
) }),
|
|
14651
|
-
/* @__PURE__ */
|
|
14943
|
+
/* @__PURE__ */ jsx67(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ jsx67(
|
|
14652
14944
|
Input,
|
|
14653
14945
|
{
|
|
14654
14946
|
...ariaAttributes,
|
|
@@ -14668,7 +14960,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14668
14960
|
}
|
|
14669
14961
|
) })
|
|
14670
14962
|
] }) }),
|
|
14671
|
-
/* @__PURE__ */
|
|
14963
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14672
14964
|
Input,
|
|
14673
14965
|
{
|
|
14674
14966
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14684,12 +14976,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14684
14976
|
className: "min-w-64"
|
|
14685
14977
|
}
|
|
14686
14978
|
) }),
|
|
14687
|
-
/* @__PURE__ */
|
|
14979
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14688
14980
|
] });
|
|
14689
14981
|
};
|
|
14690
14982
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14691
14983
|
const translation = useHightideTranslation();
|
|
14692
|
-
const operator = filterValue?.operator ?? "
|
|
14984
|
+
const operator = filterValue?.operator ?? "dateBetween";
|
|
14693
14985
|
const parameter = filterValue?.parameter ?? {};
|
|
14694
14986
|
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState31(null);
|
|
14695
14987
|
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState31(null);
|
|
@@ -14699,8 +14991,8 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14699
14991
|
], []);
|
|
14700
14992
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14701
14993
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14702
|
-
return /* @__PURE__ */
|
|
14703
|
-
/* @__PURE__ */
|
|
14994
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14995
|
+
/* @__PURE__ */ jsx67(
|
|
14704
14996
|
Select,
|
|
14705
14997
|
{
|
|
14706
14998
|
value: operator,
|
|
@@ -14711,12 +15003,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14711
15003
|
});
|
|
14712
15004
|
},
|
|
14713
15005
|
buttonProps: { className: "min-w-64" },
|
|
14714
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15006
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14715
15007
|
}
|
|
14716
15008
|
),
|
|
14717
|
-
/* @__PURE__ */
|
|
14718
|
-
/* @__PURE__ */
|
|
14719
|
-
/* @__PURE__ */
|
|
15009
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15010
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15011
|
+
/* @__PURE__ */ jsx67(
|
|
14720
15012
|
DateTimeInput,
|
|
14721
15013
|
{
|
|
14722
15014
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14749,7 +15041,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14749
15041
|
className: "min-w-64"
|
|
14750
15042
|
}
|
|
14751
15043
|
),
|
|
14752
|
-
/* @__PURE__ */
|
|
15044
|
+
/* @__PURE__ */ jsx67(
|
|
14753
15045
|
DateTimeInput,
|
|
14754
15046
|
{
|
|
14755
15047
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -14782,7 +15074,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14782
15074
|
}
|
|
14783
15075
|
)
|
|
14784
15076
|
] }) }),
|
|
14785
|
-
/* @__PURE__ */
|
|
15077
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14786
15078
|
DateTimeInput,
|
|
14787
15079
|
{
|
|
14788
15080
|
value: parameter.compareDate ?? null,
|
|
@@ -14798,7 +15090,123 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14798
15090
|
className: "min-w-64"
|
|
14799
15091
|
}
|
|
14800
15092
|
) }),
|
|
14801
|
-
/* @__PURE__ */
|
|
15093
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15094
|
+
] });
|
|
15095
|
+
};
|
|
15096
|
+
var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
15097
|
+
const translation = useHightideTranslation();
|
|
15098
|
+
const operator = filterValue?.operator ?? "datetimeBetween";
|
|
15099
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15100
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState31(null);
|
|
15101
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState31(null);
|
|
15102
|
+
const availableOperators = useMemo25(() => [
|
|
15103
|
+
...TableFilterOperator.datetime,
|
|
15104
|
+
...TableFilterOperator.generic
|
|
15105
|
+
], []);
|
|
15106
|
+
const needsRangeInput = operator === "datetimeBetween" || operator === "datetimeNotBetween";
|
|
15107
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15108
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15109
|
+
/* @__PURE__ */ jsx67(
|
|
15110
|
+
Select,
|
|
15111
|
+
{
|
|
15112
|
+
value: operator,
|
|
15113
|
+
onValueChange: (newOperator) => {
|
|
15114
|
+
onFilterValueChange({
|
|
15115
|
+
operator: newOperator,
|
|
15116
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15117
|
+
});
|
|
15118
|
+
},
|
|
15119
|
+
buttonProps: { className: "min-w-64" },
|
|
15120
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
15121
|
+
}
|
|
15122
|
+
),
|
|
15123
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15124
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15125
|
+
/* @__PURE__ */ jsx67(
|
|
15126
|
+
DateTimeInput,
|
|
15127
|
+
{
|
|
15128
|
+
mode: "dateTime",
|
|
15129
|
+
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
15130
|
+
placeholder: translation("startDate"),
|
|
15131
|
+
onValueChange: (value) => setTemporaryMinDateValue(value),
|
|
15132
|
+
onEditComplete: (value) => {
|
|
15133
|
+
if (value && parameter.max && value > parameter.max) {
|
|
15134
|
+
if (!parameter.min) {
|
|
15135
|
+
onFilterValueChange({
|
|
15136
|
+
operator,
|
|
15137
|
+
parameter: { min: parameter.max, max: value }
|
|
15138
|
+
});
|
|
15139
|
+
} else {
|
|
15140
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15141
|
+
onFilterValueChange({
|
|
15142
|
+
operator,
|
|
15143
|
+
parameter: { min: value, max: new Date(value.getTime() + diff) }
|
|
15144
|
+
});
|
|
15145
|
+
}
|
|
15146
|
+
} else {
|
|
15147
|
+
onFilterValueChange({
|
|
15148
|
+
operator,
|
|
15149
|
+
parameter: { ...parameter, min: value }
|
|
15150
|
+
});
|
|
15151
|
+
}
|
|
15152
|
+
setTemporaryMinDateValue(null);
|
|
15153
|
+
},
|
|
15154
|
+
allowRemove: true,
|
|
15155
|
+
outsideClickCloses: false,
|
|
15156
|
+
className: "min-w-64"
|
|
15157
|
+
}
|
|
15158
|
+
),
|
|
15159
|
+
/* @__PURE__ */ jsx67(
|
|
15160
|
+
DateTimeInput,
|
|
15161
|
+
{
|
|
15162
|
+
mode: "dateTime",
|
|
15163
|
+
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
15164
|
+
placeholder: translation("endDate"),
|
|
15165
|
+
onValueChange: (value) => setTemporaryMaxDateValue(value),
|
|
15166
|
+
onEditComplete: (value) => {
|
|
15167
|
+
if (value && parameter.min && value < parameter.min) {
|
|
15168
|
+
if (!parameter.max) {
|
|
15169
|
+
onFilterValueChange({
|
|
15170
|
+
operator,
|
|
15171
|
+
parameter: { min: value, max: parameter.min }
|
|
15172
|
+
});
|
|
15173
|
+
} else {
|
|
15174
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15175
|
+
onFilterValueChange({
|
|
15176
|
+
operator,
|
|
15177
|
+
parameter: { min: new Date(value.getTime() - diff), max: value }
|
|
15178
|
+
});
|
|
15179
|
+
}
|
|
15180
|
+
} else {
|
|
15181
|
+
onFilterValueChange({
|
|
15182
|
+
operator,
|
|
15183
|
+
parameter: { ...parameter, max: value }
|
|
15184
|
+
});
|
|
15185
|
+
}
|
|
15186
|
+
},
|
|
15187
|
+
allowRemove: true,
|
|
15188
|
+
outsideClickCloses: false,
|
|
15189
|
+
className: "min-w-64"
|
|
15190
|
+
}
|
|
15191
|
+
)
|
|
15192
|
+
] }) }),
|
|
15193
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
15194
|
+
DateTimeInput,
|
|
15195
|
+
{
|
|
15196
|
+
value: parameter.compareDatetime ?? null,
|
|
15197
|
+
placeholder: translation("date"),
|
|
15198
|
+
onValueChange: (compareDatetime) => {
|
|
15199
|
+
onFilterValueChange({
|
|
15200
|
+
operator,
|
|
15201
|
+
parameter: { compareDatetime }
|
|
15202
|
+
});
|
|
15203
|
+
},
|
|
15204
|
+
allowRemove: true,
|
|
15205
|
+
outsideClickCloses: false,
|
|
15206
|
+
className: "min-w-64"
|
|
15207
|
+
}
|
|
15208
|
+
) }),
|
|
15209
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14802
15210
|
] });
|
|
14803
15211
|
};
|
|
14804
15212
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14807,7 +15215,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14807
15215
|
...TableFilterOperator.boolean,
|
|
14808
15216
|
...TableFilterOperator.generic
|
|
14809
15217
|
], []);
|
|
14810
|
-
return /* @__PURE__ */
|
|
15218
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14811
15219
|
Select,
|
|
14812
15220
|
{
|
|
14813
15221
|
value: operator,
|
|
@@ -14818,7 +15226,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14818
15226
|
});
|
|
14819
15227
|
},
|
|
14820
15228
|
buttonProps: { className: "min-w-64" },
|
|
14821
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15229
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14822
15230
|
}
|
|
14823
15231
|
) });
|
|
14824
15232
|
};
|
|
@@ -14840,8 +15248,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14840
15248
|
return null;
|
|
14841
15249
|
}
|
|
14842
15250
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14843
|
-
return /* @__PURE__ */
|
|
14844
|
-
/* @__PURE__ */
|
|
15251
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15252
|
+
/* @__PURE__ */ jsx67(
|
|
14845
15253
|
Select,
|
|
14846
15254
|
{
|
|
14847
15255
|
value: operator,
|
|
@@ -14852,12 +15260,12 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14852
15260
|
});
|
|
14853
15261
|
},
|
|
14854
15262
|
buttonProps: { className: "min-w-64" },
|
|
14855
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15263
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14856
15264
|
}
|
|
14857
15265
|
),
|
|
14858
|
-
/* @__PURE__ */
|
|
14859
|
-
/* @__PURE__ */
|
|
14860
|
-
|
|
15266
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15267
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
15268
|
+
MultiSelect,
|
|
14861
15269
|
{
|
|
14862
15270
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
14863
15271
|
onValueChange: (selectedTags) => {
|
|
@@ -14867,10 +15275,76 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14867
15275
|
});
|
|
14868
15276
|
},
|
|
14869
15277
|
buttonProps: { className: "min-w-64" },
|
|
14870
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */
|
|
15278
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(MultiSelectOption, { value: tag, children: label }, tag))
|
|
15279
|
+
}
|
|
15280
|
+
) }),
|
|
15281
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15282
|
+
] });
|
|
15283
|
+
};
|
|
15284
|
+
var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
15285
|
+
const translation = useHightideTranslation();
|
|
15286
|
+
const { table } = useTableDataContext();
|
|
15287
|
+
const operator = filterValue?.operator ?? "tagsSingleContains";
|
|
15288
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15289
|
+
const availableOperators = useMemo25(() => [
|
|
15290
|
+
...TableFilterOperator.tagsSingle,
|
|
15291
|
+
...TableFilterOperator.generic
|
|
15292
|
+
], []);
|
|
15293
|
+
const availableTags = useMemo25(() => {
|
|
15294
|
+
const column = table.getColumn(columnId);
|
|
15295
|
+
if (!column) return [];
|
|
15296
|
+
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
15297
|
+
}, [columnId, table]);
|
|
15298
|
+
if (availableTags.length === 0) {
|
|
15299
|
+
return null;
|
|
15300
|
+
}
|
|
15301
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15302
|
+
const needsMultiSelect = operator === "tagsSingleContains" || operator === "tagsSingleNotContains";
|
|
15303
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15304
|
+
/* @__PURE__ */ jsx67(
|
|
15305
|
+
Select,
|
|
15306
|
+
{
|
|
15307
|
+
value: operator,
|
|
15308
|
+
onValueChange: (newOperator) => {
|
|
15309
|
+
onFilterValueChange({
|
|
15310
|
+
operator: newOperator,
|
|
15311
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15312
|
+
});
|
|
15313
|
+
},
|
|
15314
|
+
buttonProps: { className: "min-w-64" },
|
|
15315
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
15316
|
+
}
|
|
15317
|
+
),
|
|
15318
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15319
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput && needsMultiSelect, children: /* @__PURE__ */ jsx67(
|
|
15320
|
+
MultiSelect,
|
|
15321
|
+
{
|
|
15322
|
+
value: Array.isArray(parameter.searchTagsContains) ? parameter.searchTagsContains.map((tag) => String(tag)) : [],
|
|
15323
|
+
onValueChange: (selectedTags) => {
|
|
15324
|
+
onFilterValueChange({
|
|
15325
|
+
operator,
|
|
15326
|
+
parameter: { searchTagsContains: selectedTags.length > 0 ? selectedTags : void 0 }
|
|
15327
|
+
});
|
|
15328
|
+
},
|
|
15329
|
+
buttonProps: { className: "min-w-64" },
|
|
15330
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(MultiSelectOption, { value: tag, children: label }, tag))
|
|
14871
15331
|
}
|
|
14872
15332
|
) }),
|
|
14873
|
-
/* @__PURE__ */
|
|
15333
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput && !needsMultiSelect, children: /* @__PURE__ */ jsx67(
|
|
15334
|
+
Select,
|
|
15335
|
+
{
|
|
15336
|
+
value: parameter.searchTag ? String(parameter.searchTag) : void 0,
|
|
15337
|
+
onValueChange: (selectedTag) => {
|
|
15338
|
+
onFilterValueChange({
|
|
15339
|
+
operator,
|
|
15340
|
+
parameter: { searchTag: selectedTag ? String(selectedTag) : void 0 }
|
|
15341
|
+
});
|
|
15342
|
+
},
|
|
15343
|
+
buttonProps: { className: "min-w-64" },
|
|
15344
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(SelectOption, { value: tag, children: label }, tag))
|
|
15345
|
+
}
|
|
15346
|
+
) }),
|
|
15347
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14874
15348
|
] });
|
|
14875
15349
|
};
|
|
14876
15350
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14878,7 +15352,7 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14878
15352
|
const availableOperators = useMemo25(() => [
|
|
14879
15353
|
...TableFilterOperator.generic
|
|
14880
15354
|
], []);
|
|
14881
|
-
return /* @__PURE__ */
|
|
15355
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14882
15356
|
Select,
|
|
14883
15357
|
{
|
|
14884
15358
|
value: operator,
|
|
@@ -14889,31 +15363,35 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14889
15363
|
});
|
|
14890
15364
|
},
|
|
14891
15365
|
buttonProps: { className: "min-w-64" },
|
|
14892
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15366
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14893
15367
|
}
|
|
14894
15368
|
) });
|
|
14895
15369
|
};
|
|
14896
15370
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
14897
15371
|
switch (filterType) {
|
|
14898
15372
|
case "text":
|
|
14899
|
-
return /* @__PURE__ */
|
|
15373
|
+
return /* @__PURE__ */ jsx67(TextFilter, { ...props });
|
|
14900
15374
|
case "number":
|
|
14901
|
-
return /* @__PURE__ */
|
|
15375
|
+
return /* @__PURE__ */ jsx67(NumberFilter, { ...props });
|
|
14902
15376
|
case "date":
|
|
14903
|
-
return /* @__PURE__ */
|
|
15377
|
+
return /* @__PURE__ */ jsx67(DateFilter, { ...props });
|
|
15378
|
+
case "datetime":
|
|
15379
|
+
return /* @__PURE__ */ jsx67(DatetimeFilter, { ...props });
|
|
14904
15380
|
case "boolean":
|
|
14905
|
-
return /* @__PURE__ */
|
|
15381
|
+
return /* @__PURE__ */ jsx67(BooleanFilter, { ...props });
|
|
14906
15382
|
case "tags":
|
|
14907
|
-
return /* @__PURE__ */
|
|
15383
|
+
return /* @__PURE__ */ jsx67(TagsFilter, { ...props });
|
|
15384
|
+
case "tagsSingle":
|
|
15385
|
+
return /* @__PURE__ */ jsx67(TagsSingleFilter, { ...props });
|
|
14908
15386
|
case "generic":
|
|
14909
|
-
return /* @__PURE__ */
|
|
15387
|
+
return /* @__PURE__ */ jsx67(GenericFilter, { ...props });
|
|
14910
15388
|
default:
|
|
14911
15389
|
return null;
|
|
14912
15390
|
}
|
|
14913
15391
|
};
|
|
14914
15392
|
|
|
14915
15393
|
// src/components/layout/table/TableFilterButton.tsx
|
|
14916
|
-
import { Fragment as Fragment8, jsx as
|
|
15394
|
+
import { Fragment as Fragment8, jsx as jsx68, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
14917
15395
|
var TableFilterButton = ({
|
|
14918
15396
|
filterType,
|
|
14919
15397
|
column
|
|
@@ -14925,7 +15403,7 @@ var TableFilterButton = ({
|
|
|
14925
15403
|
const anchorRef = useRef24(null);
|
|
14926
15404
|
const containerRef = useRef24(null);
|
|
14927
15405
|
const [isOpen, setIsOpen] = useState32(false);
|
|
14928
|
-
const id =
|
|
15406
|
+
const id = useId15();
|
|
14929
15407
|
const ids = useMemo26(() => ({
|
|
14930
15408
|
button: `table-filter-button-${id}`,
|
|
14931
15409
|
popup: `table-filter-popup-${id}`,
|
|
@@ -14937,8 +15415,8 @@ var TableFilterButton = ({
|
|
|
14937
15415
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
14938
15416
|
return null;
|
|
14939
15417
|
}
|
|
14940
|
-
return /* @__PURE__ */
|
|
14941
|
-
/* @__PURE__ */
|
|
15418
|
+
return /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
15419
|
+
/* @__PURE__ */ jsx68(Tooltip, { tooltip: translation("filter"), position: "top", children: /* @__PURE__ */ jsxs39(
|
|
14942
15420
|
Button,
|
|
14943
15421
|
{
|
|
14944
15422
|
ref: anchorRef,
|
|
@@ -14954,12 +15432,12 @@ var TableFilterButton = ({
|
|
|
14954
15432
|
"aria-labelledby": ids.label,
|
|
14955
15433
|
className: "relative",
|
|
14956
15434
|
children: [
|
|
14957
|
-
/* @__PURE__ */
|
|
14958
|
-
/* @__PURE__ */
|
|
15435
|
+
/* @__PURE__ */ jsx68(FilterIcon, { className: "size-4" }),
|
|
15436
|
+
/* @__PURE__ */ jsx68(Visibility, { isVisible: hasFilter, children: /* @__PURE__ */ jsx68("div", { className: "absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary" }) })
|
|
14959
15437
|
]
|
|
14960
15438
|
}
|
|
14961
|
-
),
|
|
14962
|
-
/* @__PURE__ */
|
|
15439
|
+
) }),
|
|
15440
|
+
/* @__PURE__ */ jsxs39(
|
|
14963
15441
|
PopUp,
|
|
14964
15442
|
{
|
|
14965
15443
|
ref: containerRef,
|
|
@@ -14975,8 +15453,8 @@ var TableFilterButton = ({
|
|
|
14975
15453
|
"aria-labelledby": ids.label,
|
|
14976
15454
|
className: "flex-col-2 p-2 items-start",
|
|
14977
15455
|
children: [
|
|
14978
|
-
/* @__PURE__ */
|
|
14979
|
-
/* @__PURE__ */
|
|
15456
|
+
/* @__PURE__ */ jsx68("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15457
|
+
/* @__PURE__ */ jsx68(
|
|
14980
15458
|
TableFilterContent,
|
|
14981
15459
|
{
|
|
14982
15460
|
columnId: column.id,
|
|
@@ -14985,12 +15463,12 @@ var TableFilterButton = ({
|
|
|
14985
15463
|
onFilterValueChange: setFilterValue
|
|
14986
15464
|
}
|
|
14987
15465
|
),
|
|
14988
|
-
/* @__PURE__ */
|
|
14989
|
-
hasFilter && /* @__PURE__ */
|
|
15466
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
15467
|
+
hasFilter && /* @__PURE__ */ jsx68(Button, { color: "negative", size: "sm", onClick: () => {
|
|
14990
15468
|
column.setFilterValue(void 0);
|
|
14991
15469
|
setIsOpen(false);
|
|
14992
15470
|
}, children: translation("remove") }),
|
|
14993
|
-
/* @__PURE__ */
|
|
15471
|
+
/* @__PURE__ */ jsx68(Button, { size: "sm", onClick: () => {
|
|
14994
15472
|
if (filterValue) {
|
|
14995
15473
|
column.setFilterValue(filterValue);
|
|
14996
15474
|
}
|
|
@@ -15004,12 +15482,12 @@ var TableFilterButton = ({
|
|
|
15004
15482
|
};
|
|
15005
15483
|
|
|
15006
15484
|
// src/components/layout/table/TableHeader.tsx
|
|
15007
|
-
import { useCallback as
|
|
15008
|
-
import { Fragment as Fragment9, jsx as
|
|
15485
|
+
import { useCallback as useCallback23, useEffect as useEffect31 } from "react";
|
|
15486
|
+
import { Fragment as Fragment9, jsx as jsx69, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
15009
15487
|
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15010
15488
|
const { table: tableState } = useTableHeaderContext();
|
|
15011
15489
|
const table = tableOverride ?? tableState;
|
|
15012
|
-
const handleResizeMove =
|
|
15490
|
+
const handleResizeMove = useCallback23((e) => {
|
|
15013
15491
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15014
15492
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
15015
15493
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -15025,7 +15503,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15025
15503
|
deltaOffset
|
|
15026
15504
|
}));
|
|
15027
15505
|
}, [table]);
|
|
15028
|
-
const handleResizeEnd =
|
|
15506
|
+
const handleResizeEnd = useCallback23(() => {
|
|
15029
15507
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15030
15508
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
15031
15509
|
table.setColumnSizing((prev) => {
|
|
@@ -15051,8 +15529,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15051
15529
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15052
15530
|
};
|
|
15053
15531
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15054
|
-
return /* @__PURE__ */
|
|
15055
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
15532
|
+
return /* @__PURE__ */ jsxs40(Fragment9, { children: [
|
|
15533
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx69("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx69(
|
|
15056
15534
|
"col",
|
|
15057
15535
|
{
|
|
15058
15536
|
style: {
|
|
@@ -15063,16 +15541,16 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15063
15541
|
},
|
|
15064
15542
|
header.id
|
|
15065
15543
|
)) }, headerGroup.id)),
|
|
15066
|
-
/* @__PURE__ */
|
|
15067
|
-
return /* @__PURE__ */
|
|
15544
|
+
/* @__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) => {
|
|
15545
|
+
return /* @__PURE__ */ jsxs40(
|
|
15068
15546
|
"th",
|
|
15069
15547
|
{
|
|
15070
15548
|
colSpan: header.colSpan,
|
|
15071
15549
|
"data-sticky": isSticky ? "" : void 0,
|
|
15072
|
-
className:
|
|
15550
|
+
className: clsx34("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15073
15551
|
children: [
|
|
15074
|
-
/* @__PURE__ */
|
|
15075
|
-
/* @__PURE__ */
|
|
15552
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ jsxs40("div", { className: "flex-row-1 items-center", children: [
|
|
15553
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ jsx69(
|
|
15076
15554
|
TableSortButton,
|
|
15077
15555
|
{
|
|
15078
15556
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15098,7 +15576,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15098
15576
|
}
|
|
15099
15577
|
}
|
|
15100
15578
|
) }),
|
|
15101
|
-
/* @__PURE__ */
|
|
15579
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ jsx69(
|
|
15102
15580
|
TableFilterButton,
|
|
15103
15581
|
{
|
|
15104
15582
|
column: header.column,
|
|
@@ -15110,7 +15588,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15110
15588
|
header.getContext()
|
|
15111
15589
|
)
|
|
15112
15590
|
] }) }),
|
|
15113
|
-
/* @__PURE__ */
|
|
15591
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ jsx69(
|
|
15114
15592
|
"div",
|
|
15115
15593
|
{
|
|
15116
15594
|
onPointerDown: (e) => {
|
|
@@ -15141,8 +15619,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15141
15619
|
};
|
|
15142
15620
|
|
|
15143
15621
|
// src/components/layout/table/TableDisplay.tsx
|
|
15144
|
-
import
|
|
15145
|
-
import { jsx as
|
|
15622
|
+
import clsx35 from "clsx";
|
|
15623
|
+
import { jsx as jsx70, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
15146
15624
|
var TableDisplay = ({
|
|
15147
15625
|
children,
|
|
15148
15626
|
containerProps,
|
|
@@ -15152,19 +15630,19 @@ var TableDisplay = ({
|
|
|
15152
15630
|
const { table } = useTableDataContext();
|
|
15153
15631
|
const { containerRef } = useTableContainerContext();
|
|
15154
15632
|
const { sizeVars } = useTableHeaderContext();
|
|
15155
|
-
return /* @__PURE__ */
|
|
15633
|
+
return /* @__PURE__ */ jsx70("div", { ...containerProps, ref: containerRef, className: clsx35("table-container", containerProps?.className), children: /* @__PURE__ */ jsxs41(
|
|
15156
15634
|
"table",
|
|
15157
15635
|
{
|
|
15158
15636
|
...props,
|
|
15159
|
-
className:
|
|
15637
|
+
className: clsx35("table", props.className),
|
|
15160
15638
|
style: {
|
|
15161
15639
|
...sizeVars,
|
|
15162
15640
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15163
15641
|
},
|
|
15164
15642
|
children: [
|
|
15165
15643
|
children,
|
|
15166
|
-
/* @__PURE__ */
|
|
15167
|
-
/* @__PURE__ */
|
|
15644
|
+
/* @__PURE__ */ jsx70(TableHeader, { ...tableHeaderProps }),
|
|
15645
|
+
/* @__PURE__ */ jsx70(TableBody, {})
|
|
15168
15646
|
]
|
|
15169
15647
|
}
|
|
15170
15648
|
) });
|
|
@@ -15172,8 +15650,8 @@ var TableDisplay = ({
|
|
|
15172
15650
|
|
|
15173
15651
|
// src/components/layout/table/TablePagination.tsx
|
|
15174
15652
|
import { useEffect as useEffect32 } from "react";
|
|
15175
|
-
import
|
|
15176
|
-
import { jsx as
|
|
15653
|
+
import clsx36 from "clsx";
|
|
15654
|
+
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15177
15655
|
var TablePaginationMenu = ({ ...props }) => {
|
|
15178
15656
|
const { table } = useTableDataContext();
|
|
15179
15657
|
useEffect32(() => {
|
|
@@ -15183,7 +15661,7 @@ var TablePaginationMenu = ({ ...props }) => {
|
|
|
15183
15661
|
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15184
15662
|
}
|
|
15185
15663
|
}, [table]);
|
|
15186
|
-
return /* @__PURE__ */
|
|
15664
|
+
return /* @__PURE__ */ jsx71(
|
|
15187
15665
|
Pagination,
|
|
15188
15666
|
{
|
|
15189
15667
|
...props,
|
|
@@ -15203,94 +15681,23 @@ var TablePageSizeSelect = ({
|
|
|
15203
15681
|
}) => {
|
|
15204
15682
|
const { table } = useTableDataContext();
|
|
15205
15683
|
const currentPageSize = table.getState().pagination.pageSize;
|
|
15206
|
-
return /* @__PURE__ */
|
|
15684
|
+
return /* @__PURE__ */ jsx71(
|
|
15207
15685
|
Select,
|
|
15208
15686
|
{
|
|
15209
15687
|
...props,
|
|
15210
15688
|
value: currentPageSize.toString(),
|
|
15211
15689
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15212
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
15690
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx71(SelectOption, { value: size.toString(), children: size }, size))
|
|
15213
15691
|
}
|
|
15214
15692
|
);
|
|
15215
15693
|
};
|
|
15216
15694
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15217
|
-
return /* @__PURE__ */
|
|
15218
|
-
/* @__PURE__ */
|
|
15219
|
-
/* @__PURE__ */
|
|
15695
|
+
return /* @__PURE__ */ jsxs42("div", { ...props, className: clsx36("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
|
|
15696
|
+
/* @__PURE__ */ jsx71(TablePaginationMenu, {}),
|
|
15697
|
+
/* @__PURE__ */ jsx71(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ jsx71(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "h-10 min-w-24 max-w-24" } }) })
|
|
15220
15698
|
] });
|
|
15221
15699
|
};
|
|
15222
15700
|
|
|
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
15701
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
15295
15702
|
import { useCallback as useCallback24, useMemo as useMemo27 } from "react";
|
|
15296
15703
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
@@ -15304,6 +15711,7 @@ var TableWithSelectionProvider = ({
|
|
|
15304
15711
|
onRowClick,
|
|
15305
15712
|
...props
|
|
15306
15713
|
}) => {
|
|
15714
|
+
const translation = useHightideTranslation();
|
|
15307
15715
|
const columnDef = useMemo27(() => [
|
|
15308
15716
|
{
|
|
15309
15717
|
id: selectionRowId,
|
|
@@ -15336,10 +15744,13 @@ var TableWithSelectionProvider = ({
|
|
|
15336
15744
|
enableResizing: false,
|
|
15337
15745
|
enableSorting: false,
|
|
15338
15746
|
enableHiding: false,
|
|
15339
|
-
enableColumnFilter: false
|
|
15747
|
+
enableColumnFilter: false,
|
|
15748
|
+
meta: {
|
|
15749
|
+
columnLabel: translation("selection")
|
|
15750
|
+
}
|
|
15340
15751
|
},
|
|
15341
15752
|
...props.columns ?? []
|
|
15342
|
-
], [selectionRowId, props.columns]);
|
|
15753
|
+
], [selectionRowId, props.columns, translation]);
|
|
15343
15754
|
return /* @__PURE__ */ jsx72(
|
|
15344
15755
|
TableProvider,
|
|
15345
15756
|
{
|
|
@@ -15440,14 +15851,14 @@ var TableColumn = (props) => {
|
|
|
15440
15851
|
};
|
|
15441
15852
|
|
|
15442
15853
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
15443
|
-
import { useMemo as useMemo29, useRef as useRef25, useId as
|
|
15854
|
+
import { useMemo as useMemo29, useRef as useRef25, useId as useId16 } from "react";
|
|
15444
15855
|
import { ChevronUp as ChevronUp3, ChevronDown as ChevronDown5, ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight5, Eye, EyeOff, Pin, PinOff, ArrowLeftRightIcon } from "lucide-react";
|
|
15445
15856
|
import { Fragment as Fragment10, jsx as jsx75, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
15446
15857
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
15447
15858
|
const { table } = useTableDataContext();
|
|
15448
15859
|
const translation = useHightideTranslation();
|
|
15449
15860
|
const containerRef = useRef25(null);
|
|
15450
|
-
const generatedId =
|
|
15861
|
+
const generatedId = useId16();
|
|
15451
15862
|
const ids = useMemo29(() => ({
|
|
15452
15863
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
15453
15864
|
label: `table-column-picker-label-${generatedId}`
|
|
@@ -15558,6 +15969,10 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
15558
15969
|
};
|
|
15559
15970
|
const getColumnHeader = (columnId) => {
|
|
15560
15971
|
const column = table.getColumn(columnId);
|
|
15972
|
+
const columnLabel = column?.columnDef.meta?.columnLabel;
|
|
15973
|
+
if (columnLabel) {
|
|
15974
|
+
return columnLabel;
|
|
15975
|
+
}
|
|
15561
15976
|
const header = column?.columnDef.header;
|
|
15562
15977
|
if (typeof header === "string") {
|
|
15563
15978
|
return header;
|
|
@@ -16104,7 +16519,7 @@ var ScrollPicker = ({
|
|
|
16104
16519
|
};
|
|
16105
16520
|
|
|
16106
16521
|
// src/components/user-interaction/Textarea.tsx
|
|
16107
|
-
import { forwardRef as forwardRef16, useId as
|
|
16522
|
+
import { forwardRef as forwardRef16, useId as useId17 } from "react";
|
|
16108
16523
|
import clsx41 from "clsx";
|
|
16109
16524
|
import { jsx as jsx79, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
16110
16525
|
var Textarea = forwardRef16(function Textarea2({
|
|
@@ -16167,7 +16582,7 @@ var TextareaWithHeadline = ({
|
|
|
16167
16582
|
containerClassName,
|
|
16168
16583
|
...props
|
|
16169
16584
|
}) => {
|
|
16170
|
-
const genId =
|
|
16585
|
+
const genId = useId17();
|
|
16171
16586
|
const usedId = id ?? genId;
|
|
16172
16587
|
return /* @__PURE__ */ jsxs48(
|
|
16173
16588
|
"div",
|
|
@@ -16240,7 +16655,7 @@ var TimeDisplay = ({
|
|
|
16240
16655
|
};
|
|
16241
16656
|
|
|
16242
16657
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16243
|
-
import { useId as
|
|
16658
|
+
import { useId as useId18 } from "react";
|
|
16244
16659
|
import { forwardRef as forwardRef17, useState as useState37 } from "react";
|
|
16245
16660
|
import clsx42 from "clsx";
|
|
16246
16661
|
import { jsx as jsx81, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
@@ -16251,7 +16666,7 @@ var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
|
16251
16666
|
}, forwardedRef) {
|
|
16252
16667
|
const { value } = props;
|
|
16253
16668
|
const [isFocused, setIsFocused] = useState37(false);
|
|
16254
|
-
const generatedId =
|
|
16669
|
+
const generatedId = useId18();
|
|
16255
16670
|
const id = customId ?? generatedId;
|
|
16256
16671
|
return /* @__PURE__ */ jsxs49("div", { className: clsx42("relative"), children: [
|
|
16257
16672
|
/* @__PURE__ */ jsx81(
|
|
@@ -17503,6 +17918,7 @@ export {
|
|
|
17503
17918
|
DateTimePickerDialog,
|
|
17504
17919
|
DateTimePickerUncontrolled,
|
|
17505
17920
|
DateUtils,
|
|
17921
|
+
DatetimeFilter,
|
|
17506
17922
|
DayPicker,
|
|
17507
17923
|
DayPickerUncontrolled,
|
|
17508
17924
|
Dialog,
|
|
@@ -17638,6 +18054,7 @@ export {
|
|
|
17638
18054
|
TableWithSelectionProvider,
|
|
17639
18055
|
TagIcon,
|
|
17640
18056
|
TagsFilter,
|
|
18057
|
+
TagsSingleFilter,
|
|
17641
18058
|
TextFilter,
|
|
17642
18059
|
TextImage,
|
|
17643
18060
|
TextProperty,
|
|
@@ -17667,6 +18084,14 @@ export {
|
|
|
17667
18084
|
createLoopingList,
|
|
17668
18085
|
createLoopingListWithIndex,
|
|
17669
18086
|
equalSizeGroups,
|
|
18087
|
+
filterBoolean,
|
|
18088
|
+
filterDate,
|
|
18089
|
+
filterDatetime,
|
|
18090
|
+
filterGeneric,
|
|
18091
|
+
filterNumber,
|
|
18092
|
+
filterTags,
|
|
18093
|
+
filterTagsSingle,
|
|
18094
|
+
filterText,
|
|
17670
18095
|
formatDate,
|
|
17671
18096
|
formatDateTime,
|
|
17672
18097
|
getBetweenDuration,
|