@helpwave/hightide 0.6.11 → 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 +81 -14
- package/dist/index.d.ts +81 -14
- package/dist/index.js +783 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +760 -346
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +10 -7
- 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
|
}
|
|
@@ -7408,11 +7408,11 @@ function useCreateForm({
|
|
|
7408
7408
|
const callbacks = useMemo3(() => ({
|
|
7409
7409
|
reset: () => storeRef.current.reset(),
|
|
7410
7410
|
submit: () => storeRef.current.submit(),
|
|
7411
|
-
update: (updater) => {
|
|
7411
|
+
update: (updater, triggerUpdate = false) => {
|
|
7412
7412
|
if (typeof updater === "function") {
|
|
7413
|
-
storeRef.current.setValues(updater(storeRef.current.getAllValues()));
|
|
7413
|
+
storeRef.current.setValues(updater(storeRef.current.getAllValues()), triggerUpdate);
|
|
7414
7414
|
} else {
|
|
7415
|
-
storeRef.current.setValues(updater);
|
|
7415
|
+
storeRef.current.setValues(updater, triggerUpdate);
|
|
7416
7416
|
}
|
|
7417
7417
|
},
|
|
7418
7418
|
validateAll: () => storeRef.current.validateAll()
|
|
@@ -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 }) => {
|
|
@@ -12541,8 +12559,7 @@ var Pagination = ({
|
|
|
12541
12559
|
pageIndex,
|
|
12542
12560
|
pageCount,
|
|
12543
12561
|
onPageIndexChanged,
|
|
12544
|
-
|
|
12545
|
-
style
|
|
12562
|
+
...props
|
|
12546
12563
|
}) => {
|
|
12547
12564
|
const translation = useHightideTranslation();
|
|
12548
12565
|
const [value, setValue] = useState25((pageIndex + 1).toString());
|
|
@@ -12559,7 +12576,7 @@ var Pagination = ({
|
|
|
12559
12576
|
const changePage = (page) => {
|
|
12560
12577
|
onPageIndexChanged(page);
|
|
12561
12578
|
};
|
|
12562
|
-
return /* @__PURE__ */ jsxs25("div", { className: clsx23("flex-row-1", className),
|
|
12579
|
+
return /* @__PURE__ */ jsxs25("div", { ...props, className: clsx23("flex-row-1", props.className), children: [
|
|
12563
12580
|
/* @__PURE__ */ jsx50(Tooltip, { tooltip: translation("first"), children: /* @__PURE__ */ jsx50(
|
|
12564
12581
|
Button,
|
|
12565
12582
|
{
|
|
@@ -12935,27 +12952,16 @@ var useTableContainerContext = () => {
|
|
|
12935
12952
|
return context;
|
|
12936
12953
|
};
|
|
12937
12954
|
|
|
12938
|
-
// src/
|
|
12939
|
-
|
|
12940
|
-
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
12941
|
-
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
12942
|
-
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
12943
|
-
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
12944
|
-
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
12945
|
-
generic: ["undefined", "notUndefined"]
|
|
12946
|
-
};
|
|
12947
|
-
function isTableFilterCategory(value) {
|
|
12948
|
-
return typeof value === "string" && value in TableFilterOperator;
|
|
12949
|
-
}
|
|
12950
|
-
var textFilter = (row, columnId, filterValue) => {
|
|
12951
|
-
const value = row.getValue(columnId);
|
|
12955
|
+
// src/utils/filter.ts
|
|
12956
|
+
function filterText(value, filterValue) {
|
|
12952
12957
|
const parameter = filterValue.parameter;
|
|
12953
12958
|
const operator = filterValue.operator;
|
|
12959
|
+
const isCaseSensitive = filterValue.parameter.isCaseSensitive ?? false;
|
|
12954
12960
|
if (operator === "textNotWhitespace") {
|
|
12955
12961
|
return value?.toString().trim().length > 0;
|
|
12956
12962
|
}
|
|
12957
|
-
const searchText = (parameter.searchText ?? "").toLowerCase();
|
|
12958
|
-
const cellText = value?.toString().toLowerCase() ?? "";
|
|
12963
|
+
const searchText = isCaseSensitive ? parameter.searchText ?? "" : (parameter.searchText ?? "").toLowerCase();
|
|
12964
|
+
const cellText = isCaseSensitive ? value?.toString() ?? "" : value?.toString().toLowerCase() ?? "";
|
|
12959
12965
|
switch (operator) {
|
|
12960
12966
|
case "textEquals":
|
|
12961
12967
|
return cellText === searchText;
|
|
@@ -12976,11 +12982,19 @@ var textFilter = (row, columnId, filterValue) => {
|
|
|
12976
12982
|
default:
|
|
12977
12983
|
return false;
|
|
12978
12984
|
}
|
|
12979
|
-
}
|
|
12980
|
-
|
|
12981
|
-
const value = row.getValue(columnId);
|
|
12985
|
+
}
|
|
12986
|
+
function filterNumber(value, filterValue) {
|
|
12982
12987
|
const parameter = filterValue.parameter;
|
|
12983
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
|
+
}
|
|
12984
12998
|
switch (operator) {
|
|
12985
12999
|
case "numberEquals":
|
|
12986
13000
|
return value === parameter.compareValue;
|
|
@@ -13005,58 +13019,57 @@ var numberFilter = (row, columnId, filterValue) => {
|
|
|
13005
13019
|
default:
|
|
13006
13020
|
return false;
|
|
13007
13021
|
}
|
|
13008
|
-
}
|
|
13009
|
-
|
|
13010
|
-
|
|
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) {
|
|
13011
13038
|
const parameter = filterValue.parameter;
|
|
13012
13039
|
const operator = filterValue.operator;
|
|
13013
|
-
const parseDate = (dateValue) => {
|
|
13014
|
-
if (!dateValue) return null;
|
|
13015
|
-
if (dateValue instanceof Date) return dateValue;
|
|
13016
|
-
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13017
|
-
const parsed = new Date(dateValue);
|
|
13018
|
-
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13019
|
-
}
|
|
13020
|
-
return null;
|
|
13021
|
-
};
|
|
13022
|
-
const normalizeToDateOnly = (date2) => {
|
|
13023
|
-
const normalized = new Date(date2);
|
|
13024
|
-
normalized.setHours(0, 0, 0, 0);
|
|
13025
|
-
return normalized;
|
|
13026
|
-
};
|
|
13027
13040
|
const date = parseDate(value);
|
|
13028
13041
|
if (!date && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13029
13042
|
const normalizedDate = date ? normalizeToDateOnly(date) : null;
|
|
13030
13043
|
switch (operator) {
|
|
13031
13044
|
case "dateEquals": {
|
|
13032
|
-
const
|
|
13033
|
-
if (!
|
|
13034
|
-
return normalizedDate.getTime() === normalizeToDateOnly(
|
|
13045
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13046
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13047
|
+
return normalizedDate.getTime() === normalizeToDateOnly(filterDate2).getTime();
|
|
13035
13048
|
}
|
|
13036
13049
|
case "dateNotEquals": {
|
|
13037
|
-
const
|
|
13038
|
-
if (!
|
|
13039
|
-
return normalizedDate.getTime() !== normalizeToDateOnly(
|
|
13050
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13051
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13052
|
+
return normalizedDate.getTime() !== normalizeToDateOnly(filterDate2).getTime();
|
|
13040
13053
|
}
|
|
13041
13054
|
case "dateGreaterThan": {
|
|
13042
|
-
const
|
|
13043
|
-
if (!
|
|
13044
|
-
return normalizedDate > normalizeToDateOnly(
|
|
13055
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13056
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13057
|
+
return normalizedDate > normalizeToDateOnly(filterDate2);
|
|
13045
13058
|
}
|
|
13046
13059
|
case "dateGreaterThanOrEqual": {
|
|
13047
|
-
const
|
|
13048
|
-
if (!
|
|
13049
|
-
return normalizedDate >= normalizeToDateOnly(
|
|
13060
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13061
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13062
|
+
return normalizedDate >= normalizeToDateOnly(filterDate2);
|
|
13050
13063
|
}
|
|
13051
13064
|
case "dateLessThan": {
|
|
13052
|
-
const
|
|
13053
|
-
if (!
|
|
13054
|
-
return normalizedDate < normalizeToDateOnly(
|
|
13065
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13066
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13067
|
+
return normalizedDate < normalizeToDateOnly(filterDate2);
|
|
13055
13068
|
}
|
|
13056
13069
|
case "dateLessThanOrEqual": {
|
|
13057
|
-
const
|
|
13058
|
-
if (!
|
|
13059
|
-
return normalizedDate <= normalizeToDateOnly(
|
|
13070
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13071
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13072
|
+
return normalizedDate <= normalizeToDateOnly(filterDate2);
|
|
13060
13073
|
}
|
|
13061
13074
|
case "dateBetween": {
|
|
13062
13075
|
const minDate = parseDate(parameter.min);
|
|
@@ -13077,9 +13090,70 @@ var dateFilter = (row, columnId, filterValue) => {
|
|
|
13077
13090
|
default:
|
|
13078
13091
|
return false;
|
|
13079
13092
|
}
|
|
13080
|
-
}
|
|
13081
|
-
|
|
13082
|
-
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) {
|
|
13083
13157
|
const operator = filterValue.operator;
|
|
13084
13158
|
switch (operator) {
|
|
13085
13159
|
case "booleanIsTrue":
|
|
@@ -13093,9 +13167,8 @@ var booleanFilter = (row, columnId, filterValue) => {
|
|
|
13093
13167
|
default:
|
|
13094
13168
|
return false;
|
|
13095
13169
|
}
|
|
13096
|
-
}
|
|
13097
|
-
|
|
13098
|
-
const value = row.getValue(columnId);
|
|
13170
|
+
}
|
|
13171
|
+
function filterTags(value, filterValue) {
|
|
13099
13172
|
const parameter = filterValue.parameter;
|
|
13100
13173
|
const operator = filterValue.operator;
|
|
13101
13174
|
switch (operator) {
|
|
@@ -13130,11 +13203,19 @@ var tagsFilter = (row, columnId, filterValue) => {
|
|
|
13130
13203
|
default:
|
|
13131
13204
|
return false;
|
|
13132
13205
|
}
|
|
13133
|
-
}
|
|
13134
|
-
|
|
13135
|
-
const
|
|
13206
|
+
}
|
|
13207
|
+
function filterTagsSingle(value, filterValue) {
|
|
13208
|
+
const parameter = filterValue.parameter;
|
|
13136
13209
|
const operator = filterValue.operator;
|
|
13137
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);
|
|
13138
13219
|
case "undefined":
|
|
13139
13220
|
return value === void 0 || value === null;
|
|
13140
13221
|
case "notUndefined":
|
|
@@ -13142,13 +13223,73 @@ var genericFilter = (row, columnId, filterValue) => {
|
|
|
13142
13223
|
default:
|
|
13143
13224
|
return false;
|
|
13144
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);
|
|
13145
13284
|
};
|
|
13146
13285
|
var TableFilter = {
|
|
13147
13286
|
text: textFilter,
|
|
13148
13287
|
number: numberFilter,
|
|
13149
13288
|
date: dateFilter,
|
|
13289
|
+
datetime: datetimeFilter,
|
|
13150
13290
|
boolean: booleanFilter,
|
|
13151
13291
|
tags: tagsFilter,
|
|
13292
|
+
tagsSingle: tagsSingleFilter,
|
|
13152
13293
|
generic: genericFilter
|
|
13153
13294
|
};
|
|
13154
13295
|
|
|
@@ -13406,7 +13547,7 @@ var TableBody = React5.memo(function TableBodyVisual() {
|
|
|
13406
13547
|
|
|
13407
13548
|
// src/components/layout/table/TableHeader.tsx
|
|
13408
13549
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
13409
|
-
import
|
|
13550
|
+
import clsx34 from "clsx";
|
|
13410
13551
|
|
|
13411
13552
|
// src/components/layout/table/TableSortButton.tsx
|
|
13412
13553
|
import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 } from "lucide-react";
|
|
@@ -13432,31 +13573,41 @@ var TableSortButton = ({
|
|
|
13432
13573
|
icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx57(ChevronUp2, { className: "size-4" }) : /* @__PURE__ */ jsx57(ChevronDown3, { className: "size-4" });
|
|
13433
13574
|
}
|
|
13434
13575
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13435
|
-
return /* @__PURE__ */ jsx57(
|
|
13436
|
-
|
|
13576
|
+
return /* @__PURE__ */ jsx57(
|
|
13577
|
+
Tooltip,
|
|
13437
13578
|
{
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
children:
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
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
|
+
)
|
|
13453
13604
|
}
|
|
13454
|
-
)
|
|
13605
|
+
);
|
|
13455
13606
|
};
|
|
13456
13607
|
|
|
13457
13608
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13458
13609
|
import { FilterIcon } from "lucide-react";
|
|
13459
|
-
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";
|
|
13460
13611
|
|
|
13461
13612
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13462
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";
|
|
@@ -14386,7 +14537,7 @@ var DateTimeInput = forwardRef14(function DateTimeInput2({
|
|
|
14386
14537
|
});
|
|
14387
14538
|
|
|
14388
14539
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14389
|
-
import { useMemo as useMemo25, useState as useState31 } from "react";
|
|
14540
|
+
import { useId as useId14, useMemo as useMemo25, useState as useState31 } from "react";
|
|
14390
14541
|
|
|
14391
14542
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14392
14543
|
import { forwardRef as forwardRef15 } from "react";
|
|
@@ -14435,119 +14586,240 @@ import {
|
|
|
14435
14586
|
CircleDashed,
|
|
14436
14587
|
CircleDot
|
|
14437
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";
|
|
14438
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";
|
|
14439
14663
|
var getOperatorInfo = (operator) => {
|
|
14440
14664
|
switch (operator) {
|
|
14441
14665
|
case "textEquals":
|
|
14442
|
-
return { icon: /* @__PURE__ */
|
|
14666
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14443
14667
|
case "textNotEquals":
|
|
14444
|
-
return { icon: /* @__PURE__ */
|
|
14668
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14445
14669
|
case "textNotWhitespace":
|
|
14446
|
-
return { icon: /* @__PURE__ */
|
|
14670
|
+
return { icon: /* @__PURE__ */ jsx67(TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14447
14671
|
case "textContains":
|
|
14448
|
-
return { icon: /* @__PURE__ */
|
|
14672
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14449
14673
|
case "textNotContains":
|
|
14450
|
-
return { icon: /* @__PURE__ */
|
|
14674
|
+
return { icon: /* @__PURE__ */ jsx67(SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14451
14675
|
case "textStartsWith":
|
|
14452
|
-
return { icon: /* @__PURE__ */
|
|
14676
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14453
14677
|
case "textEndsWith":
|
|
14454
|
-
return { icon: /* @__PURE__ */
|
|
14678
|
+
return { icon: /* @__PURE__ */ jsx67(ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14455
14679
|
case "numberEquals":
|
|
14456
|
-
return { icon: /* @__PURE__ */
|
|
14680
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14457
14681
|
case "numberNotEquals":
|
|
14458
|
-
return { icon: /* @__PURE__ */
|
|
14682
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14459
14683
|
case "numberGreaterThan":
|
|
14460
|
-
return { icon: /* @__PURE__ */
|
|
14684
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14461
14685
|
case "numberGreaterThanOrEqual":
|
|
14462
14686
|
return {
|
|
14463
|
-
icon: /* @__PURE__ */
|
|
14464
|
-
/* @__PURE__ */
|
|
14465
|
-
/* @__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" })
|
|
14466
14690
|
] }),
|
|
14467
14691
|
translationKey: "greaterThanOrEqual"
|
|
14468
14692
|
};
|
|
14469
14693
|
case "numberLessThan":
|
|
14470
|
-
return { icon: /* @__PURE__ */
|
|
14694
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14471
14695
|
case "numberLessThanOrEqual":
|
|
14472
14696
|
return {
|
|
14473
|
-
icon: /* @__PURE__ */
|
|
14474
|
-
/* @__PURE__ */
|
|
14475
|
-
/* @__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" })
|
|
14476
14700
|
] }),
|
|
14477
14701
|
translationKey: "lessThanOrEqual"
|
|
14478
14702
|
};
|
|
14479
14703
|
case "numberBetween":
|
|
14480
14704
|
return {
|
|
14481
|
-
icon: /* @__PURE__ */
|
|
14482
|
-
/* @__PURE__ */
|
|
14483
|
-
/* @__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" })
|
|
14484
14708
|
] }),
|
|
14485
14709
|
translationKey: "between"
|
|
14486
14710
|
};
|
|
14487
14711
|
case "numberNotBetween":
|
|
14488
14712
|
return {
|
|
14489
|
-
icon: /* @__PURE__ */
|
|
14490
|
-
/* @__PURE__ */
|
|
14491
|
-
/* @__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" })
|
|
14492
14716
|
] }),
|
|
14493
14717
|
translationKey: "notBetween"
|
|
14494
14718
|
};
|
|
14495
14719
|
case "dateEquals":
|
|
14496
|
-
return { icon: /* @__PURE__ */
|
|
14720
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14497
14721
|
case "dateNotEquals":
|
|
14498
|
-
return { icon: /* @__PURE__ */
|
|
14722
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14499
14723
|
case "dateGreaterThan":
|
|
14500
|
-
return { icon: /* @__PURE__ */
|
|
14724
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronRight4, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14501
14725
|
case "dateGreaterThanOrEqual":
|
|
14502
14726
|
return {
|
|
14503
|
-
icon: /* @__PURE__ */
|
|
14504
|
-
/* @__PURE__ */
|
|
14505
|
-
/* @__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" })
|
|
14506
14730
|
] }),
|
|
14507
14731
|
translationKey: "onOrAfter"
|
|
14508
14732
|
};
|
|
14509
14733
|
case "dateLessThan":
|
|
14510
|
-
return { icon: /* @__PURE__ */
|
|
14734
|
+
return { icon: /* @__PURE__ */ jsx67(ChevronLeft4, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14511
14735
|
case "dateLessThanOrEqual":
|
|
14512
14736
|
return {
|
|
14513
|
-
icon: /* @__PURE__ */
|
|
14514
|
-
/* @__PURE__ */
|
|
14515
|
-
/* @__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" })
|
|
14516
14740
|
] }),
|
|
14517
14741
|
translationKey: "onOrBefore"
|
|
14518
14742
|
};
|
|
14519
14743
|
case "dateBetween":
|
|
14520
14744
|
return {
|
|
14521
|
-
icon: /* @__PURE__ */
|
|
14522
|
-
/* @__PURE__ */
|
|
14523
|
-
/* @__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" })
|
|
14524
14748
|
] }),
|
|
14525
14749
|
translationKey: "between"
|
|
14526
14750
|
};
|
|
14527
14751
|
case "dateNotBetween":
|
|
14528
14752
|
return {
|
|
14529
|
-
icon: /* @__PURE__ */
|
|
14530
|
-
/* @__PURE__ */
|
|
14531
|
-
/* @__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" })
|
|
14532
14756
|
] }),
|
|
14533
14757
|
translationKey: "notBetween"
|
|
14534
14758
|
};
|
|
14535
14759
|
case "booleanIsTrue":
|
|
14536
|
-
return { icon: /* @__PURE__ */
|
|
14760
|
+
return { icon: /* @__PURE__ */ jsx67(CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14537
14761
|
case "booleanIsFalse":
|
|
14538
|
-
return { icon: /* @__PURE__ */
|
|
14762
|
+
return { icon: /* @__PURE__ */ jsx67(XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14539
14763
|
case "tagsEquals":
|
|
14540
|
-
return { icon: /* @__PURE__ */
|
|
14764
|
+
return { icon: /* @__PURE__ */ jsx67(Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14541
14765
|
case "tagsNotEquals":
|
|
14542
|
-
return { icon: /* @__PURE__ */
|
|
14766
|
+
return { icon: /* @__PURE__ */ jsx67(EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14543
14767
|
case "tagsContains":
|
|
14544
|
-
return { icon: /* @__PURE__ */
|
|
14768
|
+
return { icon: /* @__PURE__ */ jsx67(SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14545
14769
|
case "tagsNotContains":
|
|
14546
|
-
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" };
|
|
14547
14819
|
case "undefined":
|
|
14548
|
-
return { icon: /* @__PURE__ */
|
|
14820
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14549
14821
|
case "notUndefined":
|
|
14550
|
-
return { icon: /* @__PURE__ */
|
|
14822
|
+
return { icon: /* @__PURE__ */ jsx67(CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14551
14823
|
default:
|
|
14552
14824
|
return { icon: null, translationKey: "undefined translation" };
|
|
14553
14825
|
}
|
|
@@ -14556,22 +14828,23 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14556
14828
|
const translation = useHightideTranslation();
|
|
14557
14829
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14558
14830
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14559
|
-
return /* @__PURE__ */
|
|
14831
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14560
14832
|
icon,
|
|
14561
14833
|
label
|
|
14562
14834
|
] });
|
|
14563
14835
|
};
|
|
14564
14836
|
var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14565
14837
|
const translation = useHightideTranslation();
|
|
14566
|
-
const operator = filterValue?.operator ?? "
|
|
14838
|
+
const operator = filterValue?.operator ?? "textContains";
|
|
14567
14839
|
const parameter = filterValue?.parameter ?? {};
|
|
14840
|
+
const id = useId14();
|
|
14568
14841
|
const availableOperators = useMemo25(() => [
|
|
14569
14842
|
...TableFilterOperator.text,
|
|
14570
14843
|
...TableFilterOperator.generic
|
|
14571
14844
|
], []);
|
|
14572
14845
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14573
|
-
return /* @__PURE__ */
|
|
14574
|
-
/* @__PURE__ */
|
|
14846
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14847
|
+
/* @__PURE__ */ jsx67(
|
|
14575
14848
|
Select,
|
|
14576
14849
|
{
|
|
14577
14850
|
value: operator,
|
|
@@ -14582,30 +14855,48 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14582
14855
|
});
|
|
14583
14856
|
},
|
|
14584
14857
|
buttonProps: { className: "min-w-64" },
|
|
14585
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14858
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14586
14859
|
}
|
|
14587
14860
|
),
|
|
14588
|
-
/* @__PURE__ */
|
|
14589
|
-
/* @__PURE__ */
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14603
|
-
|
|
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") }) })
|
|
14604
14895
|
] });
|
|
14605
14896
|
};
|
|
14606
14897
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14607
14898
|
const translation = useHightideTranslation();
|
|
14608
|
-
const operator = filterValue?.operator ?? "
|
|
14899
|
+
const operator = filterValue?.operator ?? "numberBetween";
|
|
14609
14900
|
const parameter = filterValue?.parameter ?? {};
|
|
14610
14901
|
const availableOperators = useMemo25(() => [
|
|
14611
14902
|
...TableFilterOperator.number,
|
|
@@ -14613,8 +14904,8 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14613
14904
|
], []);
|
|
14614
14905
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14615
14906
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14616
|
-
return /* @__PURE__ */
|
|
14617
|
-
/* @__PURE__ */
|
|
14907
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14908
|
+
/* @__PURE__ */ jsx67(
|
|
14618
14909
|
Select,
|
|
14619
14910
|
{
|
|
14620
14911
|
value: operator,
|
|
@@ -14625,12 +14916,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14625
14916
|
});
|
|
14626
14917
|
},
|
|
14627
14918
|
buttonProps: { className: "min-w-64" },
|
|
14628
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
14919
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14629
14920
|
}
|
|
14630
14921
|
),
|
|
14631
|
-
/* @__PURE__ */
|
|
14632
|
-
/* @__PURE__ */
|
|
14633
|
-
/* @__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(
|
|
14634
14925
|
Input,
|
|
14635
14926
|
{
|
|
14636
14927
|
...ariaAttributes,
|
|
@@ -14649,7 +14940,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14649
14940
|
className: "input-indicator-hidden min-w-64"
|
|
14650
14941
|
}
|
|
14651
14942
|
) }),
|
|
14652
|
-
/* @__PURE__ */
|
|
14943
|
+
/* @__PURE__ */ jsx67(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ jsx67(
|
|
14653
14944
|
Input,
|
|
14654
14945
|
{
|
|
14655
14946
|
...ariaAttributes,
|
|
@@ -14669,7 +14960,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14669
14960
|
}
|
|
14670
14961
|
) })
|
|
14671
14962
|
] }) }),
|
|
14672
|
-
/* @__PURE__ */
|
|
14963
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14673
14964
|
Input,
|
|
14674
14965
|
{
|
|
14675
14966
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14685,12 +14976,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14685
14976
|
className: "min-w-64"
|
|
14686
14977
|
}
|
|
14687
14978
|
) }),
|
|
14688
|
-
/* @__PURE__ */
|
|
14979
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ jsx67("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14689
14980
|
] });
|
|
14690
14981
|
};
|
|
14691
14982
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14692
14983
|
const translation = useHightideTranslation();
|
|
14693
|
-
const operator = filterValue?.operator ?? "
|
|
14984
|
+
const operator = filterValue?.operator ?? "dateBetween";
|
|
14694
14985
|
const parameter = filterValue?.parameter ?? {};
|
|
14695
14986
|
const [temporaryMinDateValue, setTemporaryMinDateValue] = useState31(null);
|
|
14696
14987
|
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = useState31(null);
|
|
@@ -14700,8 +14991,8 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14700
14991
|
], []);
|
|
14701
14992
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14702
14993
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14703
|
-
return /* @__PURE__ */
|
|
14704
|
-
/* @__PURE__ */
|
|
14994
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
14995
|
+
/* @__PURE__ */ jsx67(
|
|
14705
14996
|
Select,
|
|
14706
14997
|
{
|
|
14707
14998
|
value: operator,
|
|
@@ -14712,12 +15003,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14712
15003
|
});
|
|
14713
15004
|
},
|
|
14714
15005
|
buttonProps: { className: "min-w-64" },
|
|
14715
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15006
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14716
15007
|
}
|
|
14717
15008
|
),
|
|
14718
|
-
/* @__PURE__ */
|
|
14719
|
-
/* @__PURE__ */
|
|
14720
|
-
/* @__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(
|
|
14721
15012
|
DateTimeInput,
|
|
14722
15013
|
{
|
|
14723
15014
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14750,7 +15041,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14750
15041
|
className: "min-w-64"
|
|
14751
15042
|
}
|
|
14752
15043
|
),
|
|
14753
|
-
/* @__PURE__ */
|
|
15044
|
+
/* @__PURE__ */ jsx67(
|
|
14754
15045
|
DateTimeInput,
|
|
14755
15046
|
{
|
|
14756
15047
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -14783,7 +15074,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14783
15074
|
}
|
|
14784
15075
|
)
|
|
14785
15076
|
] }) }),
|
|
14786
|
-
/* @__PURE__ */
|
|
15077
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
14787
15078
|
DateTimeInput,
|
|
14788
15079
|
{
|
|
14789
15080
|
value: parameter.compareDate ?? null,
|
|
@@ -14799,7 +15090,123 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14799
15090
|
className: "min-w-64"
|
|
14800
15091
|
}
|
|
14801
15092
|
) }),
|
|
14802
|
-
/* @__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") }) })
|
|
14803
15210
|
] });
|
|
14804
15211
|
};
|
|
14805
15212
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14808,7 +15215,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14808
15215
|
...TableFilterOperator.boolean,
|
|
14809
15216
|
...TableFilterOperator.generic
|
|
14810
15217
|
], []);
|
|
14811
|
-
return /* @__PURE__ */
|
|
15218
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14812
15219
|
Select,
|
|
14813
15220
|
{
|
|
14814
15221
|
value: operator,
|
|
@@ -14819,7 +15226,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14819
15226
|
});
|
|
14820
15227
|
},
|
|
14821
15228
|
buttonProps: { className: "min-w-64" },
|
|
14822
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15229
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14823
15230
|
}
|
|
14824
15231
|
) });
|
|
14825
15232
|
};
|
|
@@ -14841,8 +15248,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14841
15248
|
return null;
|
|
14842
15249
|
}
|
|
14843
15250
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14844
|
-
return /* @__PURE__ */
|
|
14845
|
-
/* @__PURE__ */
|
|
15251
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex-col-2 gap-2", children: [
|
|
15252
|
+
/* @__PURE__ */ jsx67(
|
|
14846
15253
|
Select,
|
|
14847
15254
|
{
|
|
14848
15255
|
value: operator,
|
|
@@ -14853,12 +15260,12 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14853
15260
|
});
|
|
14854
15261
|
},
|
|
14855
15262
|
buttonProps: { className: "min-w-64" },
|
|
14856
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15263
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14857
15264
|
}
|
|
14858
15265
|
),
|
|
14859
|
-
/* @__PURE__ */
|
|
14860
|
-
/* @__PURE__ */
|
|
14861
|
-
|
|
15266
|
+
/* @__PURE__ */ jsx67("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15267
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ jsx67(
|
|
15268
|
+
MultiSelect,
|
|
14862
15269
|
{
|
|
14863
15270
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
14864
15271
|
onValueChange: (selectedTags) => {
|
|
@@ -14868,10 +15275,76 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14868
15275
|
});
|
|
14869
15276
|
},
|
|
14870
15277
|
buttonProps: { className: "min-w-64" },
|
|
14871
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */
|
|
15278
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ jsx67(MultiSelectOption, { value: tag, children: label }, tag))
|
|
14872
15279
|
}
|
|
14873
15280
|
) }),
|
|
14874
|
-
/* @__PURE__ */
|
|
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))
|
|
15331
|
+
}
|
|
15332
|
+
) }),
|
|
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") }) })
|
|
14875
15348
|
] });
|
|
14876
15349
|
};
|
|
14877
15350
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14879,7 +15352,7 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14879
15352
|
const availableOperators = useMemo25(() => [
|
|
14880
15353
|
...TableFilterOperator.generic
|
|
14881
15354
|
], []);
|
|
14882
|
-
return /* @__PURE__ */
|
|
15355
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ jsx67(
|
|
14883
15356
|
Select,
|
|
14884
15357
|
{
|
|
14885
15358
|
value: operator,
|
|
@@ -14890,31 +15363,35 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14890
15363
|
});
|
|
14891
15364
|
},
|
|
14892
15365
|
buttonProps: { className: "min-w-64" },
|
|
14893
|
-
children: availableOperators.map((op) => /* @__PURE__ */
|
|
15366
|
+
children: availableOperators.map((op) => /* @__PURE__ */ jsx67(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ jsx67(OperatorLabel, { operator: op }) }, op))
|
|
14894
15367
|
}
|
|
14895
15368
|
) });
|
|
14896
15369
|
};
|
|
14897
15370
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
14898
15371
|
switch (filterType) {
|
|
14899
15372
|
case "text":
|
|
14900
|
-
return /* @__PURE__ */
|
|
15373
|
+
return /* @__PURE__ */ jsx67(TextFilter, { ...props });
|
|
14901
15374
|
case "number":
|
|
14902
|
-
return /* @__PURE__ */
|
|
15375
|
+
return /* @__PURE__ */ jsx67(NumberFilter, { ...props });
|
|
14903
15376
|
case "date":
|
|
14904
|
-
return /* @__PURE__ */
|
|
15377
|
+
return /* @__PURE__ */ jsx67(DateFilter, { ...props });
|
|
15378
|
+
case "datetime":
|
|
15379
|
+
return /* @__PURE__ */ jsx67(DatetimeFilter, { ...props });
|
|
14905
15380
|
case "boolean":
|
|
14906
|
-
return /* @__PURE__ */
|
|
15381
|
+
return /* @__PURE__ */ jsx67(BooleanFilter, { ...props });
|
|
14907
15382
|
case "tags":
|
|
14908
|
-
return /* @__PURE__ */
|
|
15383
|
+
return /* @__PURE__ */ jsx67(TagsFilter, { ...props });
|
|
15384
|
+
case "tagsSingle":
|
|
15385
|
+
return /* @__PURE__ */ jsx67(TagsSingleFilter, { ...props });
|
|
14909
15386
|
case "generic":
|
|
14910
|
-
return /* @__PURE__ */
|
|
15387
|
+
return /* @__PURE__ */ jsx67(GenericFilter, { ...props });
|
|
14911
15388
|
default:
|
|
14912
15389
|
return null;
|
|
14913
15390
|
}
|
|
14914
15391
|
};
|
|
14915
15392
|
|
|
14916
15393
|
// src/components/layout/table/TableFilterButton.tsx
|
|
14917
|
-
import { Fragment as Fragment8, jsx as
|
|
15394
|
+
import { Fragment as Fragment8, jsx as jsx68, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
14918
15395
|
var TableFilterButton = ({
|
|
14919
15396
|
filterType,
|
|
14920
15397
|
column
|
|
@@ -14926,7 +15403,7 @@ var TableFilterButton = ({
|
|
|
14926
15403
|
const anchorRef = useRef24(null);
|
|
14927
15404
|
const containerRef = useRef24(null);
|
|
14928
15405
|
const [isOpen, setIsOpen] = useState32(false);
|
|
14929
|
-
const id =
|
|
15406
|
+
const id = useId15();
|
|
14930
15407
|
const ids = useMemo26(() => ({
|
|
14931
15408
|
button: `table-filter-button-${id}`,
|
|
14932
15409
|
popup: `table-filter-popup-${id}`,
|
|
@@ -14938,8 +15415,8 @@ var TableFilterButton = ({
|
|
|
14938
15415
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
14939
15416
|
return null;
|
|
14940
15417
|
}
|
|
14941
|
-
return /* @__PURE__ */
|
|
14942
|
-
/* @__PURE__ */
|
|
15418
|
+
return /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
15419
|
+
/* @__PURE__ */ jsx68(Tooltip, { tooltip: translation("filter"), position: "top", children: /* @__PURE__ */ jsxs39(
|
|
14943
15420
|
Button,
|
|
14944
15421
|
{
|
|
14945
15422
|
ref: anchorRef,
|
|
@@ -14955,12 +15432,12 @@ var TableFilterButton = ({
|
|
|
14955
15432
|
"aria-labelledby": ids.label,
|
|
14956
15433
|
className: "relative",
|
|
14957
15434
|
children: [
|
|
14958
|
-
/* @__PURE__ */
|
|
14959
|
-
/* @__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" }) })
|
|
14960
15437
|
]
|
|
14961
15438
|
}
|
|
14962
|
-
),
|
|
14963
|
-
/* @__PURE__ */
|
|
15439
|
+
) }),
|
|
15440
|
+
/* @__PURE__ */ jsxs39(
|
|
14964
15441
|
PopUp,
|
|
14965
15442
|
{
|
|
14966
15443
|
ref: containerRef,
|
|
@@ -14976,8 +15453,8 @@ var TableFilterButton = ({
|
|
|
14976
15453
|
"aria-labelledby": ids.label,
|
|
14977
15454
|
className: "flex-col-2 p-2 items-start",
|
|
14978
15455
|
children: [
|
|
14979
|
-
/* @__PURE__ */
|
|
14980
|
-
/* @__PURE__ */
|
|
15456
|
+
/* @__PURE__ */ jsx68("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15457
|
+
/* @__PURE__ */ jsx68(
|
|
14981
15458
|
TableFilterContent,
|
|
14982
15459
|
{
|
|
14983
15460
|
columnId: column.id,
|
|
@@ -14986,12 +15463,12 @@ var TableFilterButton = ({
|
|
|
14986
15463
|
onFilterValueChange: setFilterValue
|
|
14987
15464
|
}
|
|
14988
15465
|
),
|
|
14989
|
-
/* @__PURE__ */
|
|
14990
|
-
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: () => {
|
|
14991
15468
|
column.setFilterValue(void 0);
|
|
14992
15469
|
setIsOpen(false);
|
|
14993
15470
|
}, children: translation("remove") }),
|
|
14994
|
-
/* @__PURE__ */
|
|
15471
|
+
/* @__PURE__ */ jsx68(Button, { size: "sm", onClick: () => {
|
|
14995
15472
|
if (filterValue) {
|
|
14996
15473
|
column.setFilterValue(filterValue);
|
|
14997
15474
|
}
|
|
@@ -15005,12 +15482,12 @@ var TableFilterButton = ({
|
|
|
15005
15482
|
};
|
|
15006
15483
|
|
|
15007
15484
|
// src/components/layout/table/TableHeader.tsx
|
|
15008
|
-
import { useCallback as
|
|
15009
|
-
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";
|
|
15010
15487
|
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15011
15488
|
const { table: tableState } = useTableHeaderContext();
|
|
15012
15489
|
const table = tableOverride ?? tableState;
|
|
15013
|
-
const handleResizeMove =
|
|
15490
|
+
const handleResizeMove = useCallback23((e) => {
|
|
15014
15491
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15015
15492
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
15016
15493
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -15026,7 +15503,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15026
15503
|
deltaOffset
|
|
15027
15504
|
}));
|
|
15028
15505
|
}, [table]);
|
|
15029
|
-
const handleResizeEnd =
|
|
15506
|
+
const handleResizeEnd = useCallback23(() => {
|
|
15030
15507
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15031
15508
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
15032
15509
|
table.setColumnSizing((prev) => {
|
|
@@ -15052,8 +15529,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15052
15529
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15053
15530
|
};
|
|
15054
15531
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15055
|
-
return /* @__PURE__ */
|
|
15056
|
-
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(
|
|
15057
15534
|
"col",
|
|
15058
15535
|
{
|
|
15059
15536
|
style: {
|
|
@@ -15064,16 +15541,16 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15064
15541
|
},
|
|
15065
15542
|
header.id
|
|
15066
15543
|
)) }, headerGroup.id)),
|
|
15067
|
-
/* @__PURE__ */
|
|
15068
|
-
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(
|
|
15069
15546
|
"th",
|
|
15070
15547
|
{
|
|
15071
15548
|
colSpan: header.colSpan,
|
|
15072
15549
|
"data-sticky": isSticky ? "" : void 0,
|
|
15073
|
-
className:
|
|
15550
|
+
className: clsx34("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15074
15551
|
children: [
|
|
15075
|
-
/* @__PURE__ */
|
|
15076
|
-
/* @__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(
|
|
15077
15554
|
TableSortButton,
|
|
15078
15555
|
{
|
|
15079
15556
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15099,7 +15576,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15099
15576
|
}
|
|
15100
15577
|
}
|
|
15101
15578
|
) }),
|
|
15102
|
-
/* @__PURE__ */
|
|
15579
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ jsx69(
|
|
15103
15580
|
TableFilterButton,
|
|
15104
15581
|
{
|
|
15105
15582
|
column: header.column,
|
|
@@ -15111,7 +15588,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15111
15588
|
header.getContext()
|
|
15112
15589
|
)
|
|
15113
15590
|
] }) }),
|
|
15114
|
-
/* @__PURE__ */
|
|
15591
|
+
/* @__PURE__ */ jsx69(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ jsx69(
|
|
15115
15592
|
"div",
|
|
15116
15593
|
{
|
|
15117
15594
|
onPointerDown: (e) => {
|
|
@@ -15142,8 +15619,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15142
15619
|
};
|
|
15143
15620
|
|
|
15144
15621
|
// src/components/layout/table/TableDisplay.tsx
|
|
15145
|
-
import
|
|
15146
|
-
import { jsx as
|
|
15622
|
+
import clsx35 from "clsx";
|
|
15623
|
+
import { jsx as jsx70, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
15147
15624
|
var TableDisplay = ({
|
|
15148
15625
|
children,
|
|
15149
15626
|
containerProps,
|
|
@@ -15153,19 +15630,19 @@ var TableDisplay = ({
|
|
|
15153
15630
|
const { table } = useTableDataContext();
|
|
15154
15631
|
const { containerRef } = useTableContainerContext();
|
|
15155
15632
|
const { sizeVars } = useTableHeaderContext();
|
|
15156
|
-
return /* @__PURE__ */
|
|
15633
|
+
return /* @__PURE__ */ jsx70("div", { ...containerProps, ref: containerRef, className: clsx35("table-container", containerProps?.className), children: /* @__PURE__ */ jsxs41(
|
|
15157
15634
|
"table",
|
|
15158
15635
|
{
|
|
15159
15636
|
...props,
|
|
15160
|
-
className:
|
|
15637
|
+
className: clsx35("table", props.className),
|
|
15161
15638
|
style: {
|
|
15162
15639
|
...sizeVars,
|
|
15163
15640
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15164
15641
|
},
|
|
15165
15642
|
children: [
|
|
15166
15643
|
children,
|
|
15167
|
-
/* @__PURE__ */
|
|
15168
|
-
/* @__PURE__ */
|
|
15644
|
+
/* @__PURE__ */ jsx70(TableHeader, { ...tableHeaderProps }),
|
|
15645
|
+
/* @__PURE__ */ jsx70(TableBody, {})
|
|
15169
15646
|
]
|
|
15170
15647
|
}
|
|
15171
15648
|
) });
|
|
@@ -15173,9 +15650,9 @@ var TableDisplay = ({
|
|
|
15173
15650
|
|
|
15174
15651
|
// src/components/layout/table/TablePagination.tsx
|
|
15175
15652
|
import { useEffect as useEffect32 } from "react";
|
|
15176
|
-
import
|
|
15177
|
-
import { jsx as
|
|
15178
|
-
var TablePaginationMenu = () => {
|
|
15653
|
+
import clsx36 from "clsx";
|
|
15654
|
+
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15655
|
+
var TablePaginationMenu = ({ ...props }) => {
|
|
15179
15656
|
const { table } = useTableDataContext();
|
|
15180
15657
|
useEffect32(() => {
|
|
15181
15658
|
const { pageIndex } = table.getState().pagination;
|
|
@@ -15184,12 +15661,16 @@ var TablePaginationMenu = () => {
|
|
|
15184
15661
|
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15185
15662
|
}
|
|
15186
15663
|
}, [table]);
|
|
15187
|
-
return /* @__PURE__ */
|
|
15664
|
+
return /* @__PURE__ */ jsx71(
|
|
15188
15665
|
Pagination,
|
|
15189
15666
|
{
|
|
15667
|
+
...props,
|
|
15190
15668
|
pageIndex: table.getState().pagination.pageIndex,
|
|
15191
15669
|
pageCount: table.getPageCount(),
|
|
15192
|
-
onPageIndexChanged: (page) =>
|
|
15670
|
+
onPageIndexChanged: (page) => {
|
|
15671
|
+
table.setPageIndex(page);
|
|
15672
|
+
props.onPageIndexChanged?.(page);
|
|
15673
|
+
}
|
|
15193
15674
|
}
|
|
15194
15675
|
);
|
|
15195
15676
|
};
|
|
@@ -15200,92 +15681,21 @@ var TablePageSizeSelect = ({
|
|
|
15200
15681
|
}) => {
|
|
15201
15682
|
const { table } = useTableDataContext();
|
|
15202
15683
|
const currentPageSize = table.getState().pagination.pageSize;
|
|
15203
|
-
return /* @__PURE__ */
|
|
15684
|
+
return /* @__PURE__ */ jsx71(
|
|
15204
15685
|
Select,
|
|
15205
15686
|
{
|
|
15206
15687
|
...props,
|
|
15207
15688
|
value: currentPageSize.toString(),
|
|
15208
15689
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15209
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
15690
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx71(SelectOption, { value: size.toString(), children: size }, size))
|
|
15210
15691
|
}
|
|
15211
15692
|
);
|
|
15212
15693
|
};
|
|
15213
15694
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15214
|
-
return /* @__PURE__ */
|
|
15215
|
-
/* @__PURE__ */
|
|
15216
|
-
/* @__PURE__ */
|
|
15217
|
-
] })
|
|
15218
|
-
};
|
|
15219
|
-
|
|
15220
|
-
// src/components/user-interaction/Checkbox.tsx
|
|
15221
|
-
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
15222
|
-
import { useCallback as useCallback23 } from "react";
|
|
15223
|
-
import clsx36 from "clsx";
|
|
15224
|
-
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
15225
|
-
var Checkbox = ({
|
|
15226
|
-
value = false,
|
|
15227
|
-
indeterminate = false,
|
|
15228
|
-
required = false,
|
|
15229
|
-
invalid = false,
|
|
15230
|
-
disabled = false,
|
|
15231
|
-
readOnly = false,
|
|
15232
|
-
onValueChange,
|
|
15233
|
-
onEditComplete,
|
|
15234
|
-
size = "md",
|
|
15235
|
-
alwaysShowCheckIcon = false,
|
|
15236
|
-
...props
|
|
15237
|
-
}) => {
|
|
15238
|
-
const onChangeWrapper = useCallback23(() => {
|
|
15239
|
-
onValueChange?.(!value);
|
|
15240
|
-
onEditComplete?.(!value);
|
|
15241
|
-
}, [onEditComplete, onValueChange, value]);
|
|
15242
|
-
return /* @__PURE__ */ jsxs42(
|
|
15243
|
-
"div",
|
|
15244
|
-
{
|
|
15245
|
-
...props,
|
|
15246
|
-
onClick: (event) => {
|
|
15247
|
-
if (!disabled) {
|
|
15248
|
-
onChangeWrapper();
|
|
15249
|
-
props.onClick?.(event);
|
|
15250
|
-
}
|
|
15251
|
-
},
|
|
15252
|
-
onKeyDown: (event) => {
|
|
15253
|
-
if (disabled) return;
|
|
15254
|
-
if (event.key === " " || event.key === "Enter") {
|
|
15255
|
-
event.preventDefault();
|
|
15256
|
-
onChangeWrapper();
|
|
15257
|
-
props.onKeyDown?.(event);
|
|
15258
|
-
}
|
|
15259
|
-
},
|
|
15260
|
-
"data-checked": !indeterminate ? value : "indeterminate",
|
|
15261
|
-
"data-size": size ?? void 0,
|
|
15262
|
-
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
15263
|
-
role: "checkbox",
|
|
15264
|
-
tabIndex: disabled ? -1 : 0,
|
|
15265
|
-
"aria-checked": indeterminate ? "mixed" : value,
|
|
15266
|
-
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15267
|
-
className: clsx36("checkbox", props.className),
|
|
15268
|
-
children: [
|
|
15269
|
-
/* @__PURE__ */ jsx71(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx71(Minus2, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15270
|
-
/* @__PURE__ */ jsx71(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx71(Check2, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
15271
|
-
]
|
|
15272
|
-
}
|
|
15273
|
-
);
|
|
15274
|
-
};
|
|
15275
|
-
var CheckboxUncontrolled = ({
|
|
15276
|
-
value: initialValue,
|
|
15277
|
-
onValueChange,
|
|
15278
|
-
...props
|
|
15279
|
-
}) => {
|
|
15280
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15281
|
-
return /* @__PURE__ */ jsx71(
|
|
15282
|
-
Checkbox,
|
|
15283
|
-
{
|
|
15284
|
-
...props,
|
|
15285
|
-
value,
|
|
15286
|
-
onValueChange: setValue
|
|
15287
|
-
}
|
|
15288
|
-
);
|
|
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" } }) })
|
|
15698
|
+
] });
|
|
15289
15699
|
};
|
|
15290
15700
|
|
|
15291
15701
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
@@ -15301,6 +15711,7 @@ var TableWithSelectionProvider = ({
|
|
|
15301
15711
|
onRowClick,
|
|
15302
15712
|
...props
|
|
15303
15713
|
}) => {
|
|
15714
|
+
const translation = useHightideTranslation();
|
|
15304
15715
|
const columnDef = useMemo27(() => [
|
|
15305
15716
|
{
|
|
15306
15717
|
id: selectionRowId,
|
|
@@ -15333,10 +15744,13 @@ var TableWithSelectionProvider = ({
|
|
|
15333
15744
|
enableResizing: false,
|
|
15334
15745
|
enableSorting: false,
|
|
15335
15746
|
enableHiding: false,
|
|
15336
|
-
enableColumnFilter: false
|
|
15747
|
+
enableColumnFilter: false,
|
|
15748
|
+
meta: {
|
|
15749
|
+
columnLabel: translation("selection")
|
|
15750
|
+
}
|
|
15337
15751
|
},
|
|
15338
15752
|
...props.columns ?? []
|
|
15339
|
-
], [selectionRowId, props.columns]);
|
|
15753
|
+
], [selectionRowId, props.columns, translation]);
|
|
15340
15754
|
return /* @__PURE__ */ jsx72(
|
|
15341
15755
|
TableProvider,
|
|
15342
15756
|
{
|
|
@@ -15437,14 +15851,14 @@ var TableColumn = (props) => {
|
|
|
15437
15851
|
};
|
|
15438
15852
|
|
|
15439
15853
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
15440
|
-
import { useMemo as useMemo29, useRef as useRef25, useId as
|
|
15854
|
+
import { useMemo as useMemo29, useRef as useRef25, useId as useId16 } from "react";
|
|
15441
15855
|
import { ChevronUp as ChevronUp3, ChevronDown as ChevronDown5, ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight5, Eye, EyeOff, Pin, PinOff, ArrowLeftRightIcon } from "lucide-react";
|
|
15442
15856
|
import { Fragment as Fragment10, jsx as jsx75, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
15443
15857
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
15444
15858
|
const { table } = useTableDataContext();
|
|
15445
15859
|
const translation = useHightideTranslation();
|
|
15446
15860
|
const containerRef = useRef25(null);
|
|
15447
|
-
const generatedId =
|
|
15861
|
+
const generatedId = useId16();
|
|
15448
15862
|
const ids = useMemo29(() => ({
|
|
15449
15863
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
15450
15864
|
label: `table-column-picker-label-${generatedId}`
|
|
@@ -15555,6 +15969,10 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
15555
15969
|
};
|
|
15556
15970
|
const getColumnHeader = (columnId) => {
|
|
15557
15971
|
const column = table.getColumn(columnId);
|
|
15972
|
+
const columnLabel = column?.columnDef.meta?.columnLabel;
|
|
15973
|
+
if (columnLabel) {
|
|
15974
|
+
return columnLabel;
|
|
15975
|
+
}
|
|
15558
15976
|
const header = column?.columnDef.header;
|
|
15559
15977
|
if (typeof header === "string") {
|
|
15560
15978
|
return header;
|
|
@@ -16101,7 +16519,7 @@ var ScrollPicker = ({
|
|
|
16101
16519
|
};
|
|
16102
16520
|
|
|
16103
16521
|
// src/components/user-interaction/Textarea.tsx
|
|
16104
|
-
import { forwardRef as forwardRef16, useId as
|
|
16522
|
+
import { forwardRef as forwardRef16, useId as useId17 } from "react";
|
|
16105
16523
|
import clsx41 from "clsx";
|
|
16106
16524
|
import { jsx as jsx79, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
16107
16525
|
var Textarea = forwardRef16(function Textarea2({
|
|
@@ -16164,7 +16582,7 @@ var TextareaWithHeadline = ({
|
|
|
16164
16582
|
containerClassName,
|
|
16165
16583
|
...props
|
|
16166
16584
|
}) => {
|
|
16167
|
-
const genId =
|
|
16585
|
+
const genId = useId17();
|
|
16168
16586
|
const usedId = id ?? genId;
|
|
16169
16587
|
return /* @__PURE__ */ jsxs48(
|
|
16170
16588
|
"div",
|
|
@@ -16237,7 +16655,7 @@ var TimeDisplay = ({
|
|
|
16237
16655
|
};
|
|
16238
16656
|
|
|
16239
16657
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16240
|
-
import { useId as
|
|
16658
|
+
import { useId as useId18 } from "react";
|
|
16241
16659
|
import { forwardRef as forwardRef17, useState as useState37 } from "react";
|
|
16242
16660
|
import clsx42 from "clsx";
|
|
16243
16661
|
import { jsx as jsx81, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
@@ -16248,7 +16666,7 @@ var InsideLabelInput = forwardRef17(function InsideLabelInput2({
|
|
|
16248
16666
|
}, forwardedRef) {
|
|
16249
16667
|
const { value } = props;
|
|
16250
16668
|
const [isFocused, setIsFocused] = useState37(false);
|
|
16251
|
-
const generatedId =
|
|
16669
|
+
const generatedId = useId18();
|
|
16252
16670
|
const id = customId ?? generatedId;
|
|
16253
16671
|
return /* @__PURE__ */ jsxs49("div", { className: clsx42("relative"), children: [
|
|
16254
16672
|
/* @__PURE__ */ jsx81(
|
|
@@ -16754,9 +17172,9 @@ import { Binary } from "lucide-react";
|
|
|
16754
17172
|
import { jsx as jsx89, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
16755
17173
|
var NumberProperty = ({
|
|
16756
17174
|
value,
|
|
16757
|
-
onRemove,
|
|
16758
17175
|
onValueChange,
|
|
16759
17176
|
onEditComplete,
|
|
17177
|
+
onValueClear,
|
|
16760
17178
|
readOnly,
|
|
16761
17179
|
suffix,
|
|
16762
17180
|
...baseProps
|
|
@@ -16767,7 +17185,7 @@ var NumberProperty = ({
|
|
|
16767
17185
|
PropertyBase,
|
|
16768
17186
|
{
|
|
16769
17187
|
...baseProps,
|
|
16770
|
-
|
|
17188
|
+
onValueClear,
|
|
16771
17189
|
hasValue,
|
|
16772
17190
|
icon: /* @__PURE__ */ jsx89(Binary, { size: 24 }),
|
|
16773
17191
|
children: ({ invalid }) => /* @__PURE__ */ jsxs55(
|
|
@@ -16789,7 +17207,7 @@ var NumberProperty = ({
|
|
|
16789
17207
|
onValueChange: (value2) => {
|
|
16790
17208
|
const numberValue = parseFloat(value2);
|
|
16791
17209
|
if (isNaN(numberValue)) {
|
|
16792
|
-
|
|
17210
|
+
onValueClear();
|
|
16793
17211
|
} else {
|
|
16794
17212
|
onValueChange?.(numberValue);
|
|
16795
17213
|
}
|
|
@@ -16797,7 +17215,7 @@ var NumberProperty = ({
|
|
|
16797
17215
|
onEditComplete: (value2) => {
|
|
16798
17216
|
const numberValue = parseFloat(value2);
|
|
16799
17217
|
if (isNaN(numberValue)) {
|
|
16800
|
-
|
|
17218
|
+
onValueClear();
|
|
16801
17219
|
} else {
|
|
16802
17220
|
onEditComplete?.(numberValue);
|
|
16803
17221
|
}
|
|
@@ -16868,7 +17286,6 @@ import { jsx as jsx91 } from "react/jsx-runtime";
|
|
|
16868
17286
|
var TextProperty = ({
|
|
16869
17287
|
value,
|
|
16870
17288
|
readOnly,
|
|
16871
|
-
onRemove,
|
|
16872
17289
|
onValueChange,
|
|
16873
17290
|
onEditComplete,
|
|
16874
17291
|
...baseProps
|
|
@@ -16879,7 +17296,6 @@ var TextProperty = ({
|
|
|
16879
17296
|
PropertyBase,
|
|
16880
17297
|
{
|
|
16881
17298
|
...baseProps,
|
|
16882
|
-
onRemove,
|
|
16883
17299
|
hasValue,
|
|
16884
17300
|
icon: /* @__PURE__ */ jsx91(Text, { size: 24 }),
|
|
16885
17301
|
children: ({ invalid }) => /* @__PURE__ */ jsx91(
|
|
@@ -16892,20 +17308,8 @@ var TextProperty = ({
|
|
|
16892
17308
|
value: value ?? "",
|
|
16893
17309
|
readOnly,
|
|
16894
17310
|
placeholder: translation("text"),
|
|
16895
|
-
onValueChange: (value2) =>
|
|
16896
|
-
|
|
16897
|
-
onRemove?.();
|
|
16898
|
-
} else {
|
|
16899
|
-
onValueChange?.(value2);
|
|
16900
|
-
}
|
|
16901
|
-
},
|
|
16902
|
-
onEditComplete: (value2) => {
|
|
16903
|
-
if (!value2) {
|
|
16904
|
-
onRemove?.();
|
|
16905
|
-
} else {
|
|
16906
|
-
onEditComplete?.(value2);
|
|
16907
|
-
}
|
|
16908
|
-
}
|
|
17311
|
+
onValueChange: (value2) => onValueChange?.(value2),
|
|
17312
|
+
onEditComplete: (value2) => onEditComplete?.(value2)
|
|
16909
17313
|
}
|
|
16910
17314
|
)
|
|
16911
17315
|
}
|
|
@@ -17514,6 +17918,7 @@ export {
|
|
|
17514
17918
|
DateTimePickerDialog,
|
|
17515
17919
|
DateTimePickerUncontrolled,
|
|
17516
17920
|
DateUtils,
|
|
17921
|
+
DatetimeFilter,
|
|
17517
17922
|
DayPicker,
|
|
17518
17923
|
DayPickerUncontrolled,
|
|
17519
17924
|
Dialog,
|
|
@@ -17649,6 +18054,7 @@ export {
|
|
|
17649
18054
|
TableWithSelectionProvider,
|
|
17650
18055
|
TagIcon,
|
|
17651
18056
|
TagsFilter,
|
|
18057
|
+
TagsSingleFilter,
|
|
17652
18058
|
TextFilter,
|
|
17653
18059
|
TextImage,
|
|
17654
18060
|
TextProperty,
|
|
@@ -17678,6 +18084,14 @@ export {
|
|
|
17678
18084
|
createLoopingList,
|
|
17679
18085
|
createLoopingListWithIndex,
|
|
17680
18086
|
equalSizeGroups,
|
|
18087
|
+
filterBoolean,
|
|
18088
|
+
filterDate,
|
|
18089
|
+
filterDatetime,
|
|
18090
|
+
filterGeneric,
|
|
18091
|
+
filterNumber,
|
|
18092
|
+
filterTags,
|
|
18093
|
+
filterTagsSingle,
|
|
18094
|
+
filterText,
|
|
17681
18095
|
formatDate,
|
|
17682
18096
|
formatDateTime,
|
|
17683
18097
|
getBetweenDuration,
|