@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.js
CHANGED
|
@@ -6272,6 +6272,7 @@ __export(index_exports, {
|
|
|
6272
6272
|
DateTimePickerDialog: () => DateTimePickerDialog,
|
|
6273
6273
|
DateTimePickerUncontrolled: () => DateTimePickerUncontrolled,
|
|
6274
6274
|
DateUtils: () => DateUtils,
|
|
6275
|
+
DatetimeFilter: () => DatetimeFilter,
|
|
6275
6276
|
DayPicker: () => DayPicker,
|
|
6276
6277
|
DayPickerUncontrolled: () => DayPickerUncontrolled,
|
|
6277
6278
|
Dialog: () => Dialog,
|
|
@@ -6407,6 +6408,7 @@ __export(index_exports, {
|
|
|
6407
6408
|
TableWithSelectionProvider: () => TableWithSelectionProvider,
|
|
6408
6409
|
TagIcon: () => TagIcon,
|
|
6409
6410
|
TagsFilter: () => TagsFilter,
|
|
6411
|
+
TagsSingleFilter: () => TagsSingleFilter,
|
|
6410
6412
|
TextFilter: () => TextFilter,
|
|
6411
6413
|
TextImage: () => TextImage,
|
|
6412
6414
|
TextProperty: () => TextProperty,
|
|
@@ -6436,6 +6438,14 @@ __export(index_exports, {
|
|
|
6436
6438
|
createLoopingList: () => createLoopingList,
|
|
6437
6439
|
createLoopingListWithIndex: () => createLoopingListWithIndex,
|
|
6438
6440
|
equalSizeGroups: () => equalSizeGroups,
|
|
6441
|
+
filterBoolean: () => filterBoolean,
|
|
6442
|
+
filterDate: () => filterDate,
|
|
6443
|
+
filterDatetime: () => filterDatetime,
|
|
6444
|
+
filterGeneric: () => filterGeneric,
|
|
6445
|
+
filterNumber: () => filterNumber,
|
|
6446
|
+
filterTags: () => filterTags,
|
|
6447
|
+
filterTagsSingle: () => filterTagsSingle,
|
|
6448
|
+
filterText: () => filterText,
|
|
6439
6449
|
formatDate: () => formatDate,
|
|
6440
6450
|
formatDateTime: () => formatDateTime,
|
|
6441
6451
|
getBetweenDuration: () => getBetweenDuration,
|
|
@@ -7351,17 +7361,17 @@ function useFormObserver({ formStore } = {}) {
|
|
|
7351
7361
|
hasTriedSubmitting
|
|
7352
7362
|
};
|
|
7353
7363
|
}
|
|
7354
|
-
function useFormObserverKey({ formStore,
|
|
7364
|
+
function useFormObserverKey({ formStore, formKey }) {
|
|
7355
7365
|
const context = (0, import_react6.useContext)(FormContext);
|
|
7356
7366
|
const store = formStore ?? context?.store;
|
|
7357
7367
|
const subscribe = (0, import_react6.useCallback)((cb) => {
|
|
7358
7368
|
if (!store) return () => {
|
|
7359
7369
|
};
|
|
7360
|
-
return store.subscribe(
|
|
7361
|
-
}, [store,
|
|
7362
|
-
const value = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getValue(
|
|
7363
|
-
const error = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getError(
|
|
7364
|
-
const touched = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getTouched(
|
|
7370
|
+
return store.subscribe(formKey, cb);
|
|
7371
|
+
}, [store, formKey]);
|
|
7372
|
+
const value = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getValue(formKey) : void 0);
|
|
7373
|
+
const error = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getError(formKey) : void 0);
|
|
7374
|
+
const touched = (0, import_react6.useSyncExternalStore)(subscribe, () => store ? store.getTouched(formKey) : void 0);
|
|
7365
7375
|
if (!store) return null;
|
|
7366
7376
|
return {
|
|
7367
7377
|
store,
|
|
@@ -7413,8 +7423,8 @@ var FormObserver = ({ children, formStore }) => {
|
|
|
7413
7423
|
}
|
|
7414
7424
|
return BagFunctionUtil.resolve(children, formObserver);
|
|
7415
7425
|
};
|
|
7416
|
-
var FormObserverKey = ({ children, formStore,
|
|
7417
|
-
const formObserver = useFormObserverKey({ formStore,
|
|
7426
|
+
var FormObserverKey = ({ children, formStore, formKey }) => {
|
|
7427
|
+
const formObserver = useFormObserverKey({ formStore, formKey });
|
|
7418
7428
|
if (!formObserver) {
|
|
7419
7429
|
throw new Error("<FormObserverKey> can only be used inside a <FormProvider>");
|
|
7420
7430
|
}
|
|
@@ -7670,11 +7680,11 @@ function useCreateForm({
|
|
|
7670
7680
|
const callbacks = (0, import_react7.useMemo)(() => ({
|
|
7671
7681
|
reset: () => storeRef.current.reset(),
|
|
7672
7682
|
submit: () => storeRef.current.submit(),
|
|
7673
|
-
update: (updater) => {
|
|
7683
|
+
update: (updater, triggerUpdate = false) => {
|
|
7674
7684
|
if (typeof updater === "function") {
|
|
7675
|
-
storeRef.current.setValues(updater(storeRef.current.getAllValues()));
|
|
7685
|
+
storeRef.current.setValues(updater(storeRef.current.getAllValues()), triggerUpdate);
|
|
7676
7686
|
} else {
|
|
7677
|
-
storeRef.current.setValues(updater);
|
|
7687
|
+
storeRef.current.setValues(updater, triggerUpdate);
|
|
7678
7688
|
}
|
|
7679
7689
|
},
|
|
7680
7690
|
validateAll: () => storeRef.current.validateAll()
|
|
@@ -8198,6 +8208,7 @@ var hightideTranslation = {
|
|
|
8198
8208
|
"between": `Zwischen`,
|
|
8199
8209
|
"cancel": `Abbrechen`,
|
|
8200
8210
|
"carousel": `Karussell`,
|
|
8211
|
+
"caseSensitive": `Gro\xDF-/Klein beachten`,
|
|
8201
8212
|
"change": `\xC4ndern`,
|
|
8202
8213
|
"changeColumnDisplay": `Spaltenanzeige \xE4ndern`,
|
|
8203
8214
|
"chooseLanguage": `W\xE4hle deine bevorzugte Sprache`,
|
|
@@ -8343,6 +8354,14 @@ var hightideTranslation = {
|
|
|
8343
8354
|
"slideOf": ({ index, length }) => {
|
|
8344
8355
|
return `Slide ${index} von ${length} slides`;
|
|
8345
8356
|
},
|
|
8357
|
+
"sorting": `Sortierung`,
|
|
8358
|
+
"sSortingState": ({ sortDirection }) => {
|
|
8359
|
+
return import_internationalization.TranslationGen.resolveSelect(sortDirection, {
|
|
8360
|
+
"asc": `Sortierung (Aktuell Aufsteigend)`,
|
|
8361
|
+
"desc": `Sortierung (Aktuell Absteigend)`,
|
|
8362
|
+
"other": `Sortierung (Aktuell Keine)`
|
|
8363
|
+
});
|
|
8364
|
+
},
|
|
8346
8365
|
"startDate": `Start`,
|
|
8347
8366
|
"startsWith": `Beginnt mit`,
|
|
8348
8367
|
"sThemeMode": ({ theme }) => {
|
|
@@ -8495,6 +8514,7 @@ var hightideTranslation = {
|
|
|
8495
8514
|
"between": `Between`,
|
|
8496
8515
|
"cancel": `Cancel`,
|
|
8497
8516
|
"carousel": `Carousel`,
|
|
8517
|
+
"caseSensitive": `Case Sensitive`,
|
|
8498
8518
|
"change": `Change`,
|
|
8499
8519
|
"changeColumnDisplay": `Change column display`,
|
|
8500
8520
|
"chooseLanguage": `Choose your language`,
|
|
@@ -8640,6 +8660,14 @@ var hightideTranslation = {
|
|
|
8640
8660
|
"slideOf": ({ index, length }) => {
|
|
8641
8661
|
return `Slide ${index} of ${length} slides`;
|
|
8642
8662
|
},
|
|
8663
|
+
"sorting": `Sorting`,
|
|
8664
|
+
"sSortingState": ({ sortDirection }) => {
|
|
8665
|
+
return import_internationalization.TranslationGen.resolveSelect(sortDirection, {
|
|
8666
|
+
"asc": `Sorting (Currently Ascending)`,
|
|
8667
|
+
"desc": `Sorting (Currently Descending)`,
|
|
8668
|
+
"other": `Sorting (Currently None)`
|
|
8669
|
+
});
|
|
8670
|
+
},
|
|
8643
8671
|
"startDate": `Start`,
|
|
8644
8672
|
"startsWith": `Starts with`,
|
|
8645
8673
|
"sThemeMode": ({ theme }) => {
|
|
@@ -12785,8 +12813,7 @@ var Pagination = ({
|
|
|
12785
12813
|
pageIndex,
|
|
12786
12814
|
pageCount,
|
|
12787
12815
|
onPageIndexChanged,
|
|
12788
|
-
|
|
12789
|
-
style
|
|
12816
|
+
...props
|
|
12790
12817
|
}) => {
|
|
12791
12818
|
const translation = useHightideTranslation();
|
|
12792
12819
|
const [value, setValue] = (0, import_react52.useState)((pageIndex + 1).toString());
|
|
@@ -12803,7 +12830,7 @@ var Pagination = ({
|
|
|
12803
12830
|
const changePage = (page) => {
|
|
12804
12831
|
onPageIndexChanged(page);
|
|
12805
12832
|
};
|
|
12806
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: (0, import_clsx23.default)("flex-row-1", className),
|
|
12833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ...props, className: (0, import_clsx23.default)("flex-row-1", props.className), children: [
|
|
12807
12834
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tooltip, { tooltip: translation("first"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12808
12835
|
Button,
|
|
12809
12836
|
{
|
|
@@ -13179,27 +13206,16 @@ var useTableContainerContext = () => {
|
|
|
13179
13206
|
return context;
|
|
13180
13207
|
};
|
|
13181
13208
|
|
|
13182
|
-
// src/
|
|
13183
|
-
|
|
13184
|
-
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
13185
|
-
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
13186
|
-
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
13187
|
-
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
13188
|
-
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
13189
|
-
generic: ["undefined", "notUndefined"]
|
|
13190
|
-
};
|
|
13191
|
-
function isTableFilterCategory(value) {
|
|
13192
|
-
return typeof value === "string" && value in TableFilterOperator;
|
|
13193
|
-
}
|
|
13194
|
-
var textFilter = (row, columnId, filterValue) => {
|
|
13195
|
-
const value = row.getValue(columnId);
|
|
13209
|
+
// src/utils/filter.ts
|
|
13210
|
+
function filterText(value, filterValue) {
|
|
13196
13211
|
const parameter = filterValue.parameter;
|
|
13197
13212
|
const operator = filterValue.operator;
|
|
13213
|
+
const isCaseSensitive = filterValue.parameter.isCaseSensitive ?? false;
|
|
13198
13214
|
if (operator === "textNotWhitespace") {
|
|
13199
13215
|
return value?.toString().trim().length > 0;
|
|
13200
13216
|
}
|
|
13201
|
-
const searchText = (parameter.searchText ?? "").toLowerCase();
|
|
13202
|
-
const cellText = value?.toString().toLowerCase() ?? "";
|
|
13217
|
+
const searchText = isCaseSensitive ? parameter.searchText ?? "" : (parameter.searchText ?? "").toLowerCase();
|
|
13218
|
+
const cellText = isCaseSensitive ? value?.toString() ?? "" : value?.toString().toLowerCase() ?? "";
|
|
13203
13219
|
switch (operator) {
|
|
13204
13220
|
case "textEquals":
|
|
13205
13221
|
return cellText === searchText;
|
|
@@ -13220,11 +13236,19 @@ var textFilter = (row, columnId, filterValue) => {
|
|
|
13220
13236
|
default:
|
|
13221
13237
|
return false;
|
|
13222
13238
|
}
|
|
13223
|
-
}
|
|
13224
|
-
|
|
13225
|
-
const value = row.getValue(columnId);
|
|
13239
|
+
}
|
|
13240
|
+
function filterNumber(value, filterValue) {
|
|
13226
13241
|
const parameter = filterValue.parameter;
|
|
13227
13242
|
const operator = filterValue.operator;
|
|
13243
|
+
if (typeof value !== "number") {
|
|
13244
|
+
if (operator === "undefined") {
|
|
13245
|
+
return value === void 0 || value === null;
|
|
13246
|
+
}
|
|
13247
|
+
if (operator === "notUndefined") {
|
|
13248
|
+
return value !== void 0 && value !== null;
|
|
13249
|
+
}
|
|
13250
|
+
return false;
|
|
13251
|
+
}
|
|
13228
13252
|
switch (operator) {
|
|
13229
13253
|
case "numberEquals":
|
|
13230
13254
|
return value === parameter.compareValue;
|
|
@@ -13249,58 +13273,57 @@ var numberFilter = (row, columnId, filterValue) => {
|
|
|
13249
13273
|
default:
|
|
13250
13274
|
return false;
|
|
13251
13275
|
}
|
|
13252
|
-
}
|
|
13253
|
-
|
|
13254
|
-
|
|
13276
|
+
}
|
|
13277
|
+
function parseDate(dateValue) {
|
|
13278
|
+
if (!dateValue) return null;
|
|
13279
|
+
if (dateValue instanceof Date) return dateValue;
|
|
13280
|
+
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13281
|
+
const parsed = new Date(dateValue);
|
|
13282
|
+
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13283
|
+
}
|
|
13284
|
+
return null;
|
|
13285
|
+
}
|
|
13286
|
+
function normalizeToDateOnly(date) {
|
|
13287
|
+
const normalized = new Date(date);
|
|
13288
|
+
normalized.setHours(0, 0, 0, 0);
|
|
13289
|
+
return normalized;
|
|
13290
|
+
}
|
|
13291
|
+
function filterDate(value, filterValue) {
|
|
13255
13292
|
const parameter = filterValue.parameter;
|
|
13256
13293
|
const operator = filterValue.operator;
|
|
13257
|
-
const parseDate = (dateValue) => {
|
|
13258
|
-
if (!dateValue) return null;
|
|
13259
|
-
if (dateValue instanceof Date) return dateValue;
|
|
13260
|
-
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13261
|
-
const parsed = new Date(dateValue);
|
|
13262
|
-
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13263
|
-
}
|
|
13264
|
-
return null;
|
|
13265
|
-
};
|
|
13266
|
-
const normalizeToDateOnly = (date2) => {
|
|
13267
|
-
const normalized = new Date(date2);
|
|
13268
|
-
normalized.setHours(0, 0, 0, 0);
|
|
13269
|
-
return normalized;
|
|
13270
|
-
};
|
|
13271
13294
|
const date = parseDate(value);
|
|
13272
13295
|
if (!date && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13273
13296
|
const normalizedDate = date ? normalizeToDateOnly(date) : null;
|
|
13274
13297
|
switch (operator) {
|
|
13275
13298
|
case "dateEquals": {
|
|
13276
|
-
const
|
|
13277
|
-
if (!
|
|
13278
|
-
return normalizedDate.getTime() === normalizeToDateOnly(
|
|
13299
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13300
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13301
|
+
return normalizedDate.getTime() === normalizeToDateOnly(filterDate2).getTime();
|
|
13279
13302
|
}
|
|
13280
13303
|
case "dateNotEquals": {
|
|
13281
|
-
const
|
|
13282
|
-
if (!
|
|
13283
|
-
return normalizedDate.getTime() !== normalizeToDateOnly(
|
|
13304
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13305
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13306
|
+
return normalizedDate.getTime() !== normalizeToDateOnly(filterDate2).getTime();
|
|
13284
13307
|
}
|
|
13285
13308
|
case "dateGreaterThan": {
|
|
13286
|
-
const
|
|
13287
|
-
if (!
|
|
13288
|
-
return normalizedDate > normalizeToDateOnly(
|
|
13309
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13310
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13311
|
+
return normalizedDate > normalizeToDateOnly(filterDate2);
|
|
13289
13312
|
}
|
|
13290
13313
|
case "dateGreaterThanOrEqual": {
|
|
13291
|
-
const
|
|
13292
|
-
if (!
|
|
13293
|
-
return normalizedDate >= normalizeToDateOnly(
|
|
13314
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13315
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13316
|
+
return normalizedDate >= normalizeToDateOnly(filterDate2);
|
|
13294
13317
|
}
|
|
13295
13318
|
case "dateLessThan": {
|
|
13296
|
-
const
|
|
13297
|
-
if (!
|
|
13298
|
-
return normalizedDate < normalizeToDateOnly(
|
|
13319
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13320
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13321
|
+
return normalizedDate < normalizeToDateOnly(filterDate2);
|
|
13299
13322
|
}
|
|
13300
13323
|
case "dateLessThanOrEqual": {
|
|
13301
|
-
const
|
|
13302
|
-
if (!
|
|
13303
|
-
return normalizedDate <= normalizeToDateOnly(
|
|
13324
|
+
const filterDate2 = parseDate(parameter.compareDate);
|
|
13325
|
+
if (!filterDate2 || !normalizedDate) return false;
|
|
13326
|
+
return normalizedDate <= normalizeToDateOnly(filterDate2);
|
|
13304
13327
|
}
|
|
13305
13328
|
case "dateBetween": {
|
|
13306
13329
|
const minDate = parseDate(parameter.min);
|
|
@@ -13321,9 +13344,70 @@ var dateFilter = (row, columnId, filterValue) => {
|
|
|
13321
13344
|
default:
|
|
13322
13345
|
return false;
|
|
13323
13346
|
}
|
|
13324
|
-
}
|
|
13325
|
-
|
|
13326
|
-
const
|
|
13347
|
+
}
|
|
13348
|
+
function normalizeDatetime(datetime) {
|
|
13349
|
+
const normalized = new Date(datetime);
|
|
13350
|
+
normalized.setSeconds(0, 0);
|
|
13351
|
+
return normalized;
|
|
13352
|
+
}
|
|
13353
|
+
function filterDatetime(value, filterValue) {
|
|
13354
|
+
const parameter = filterValue.parameter;
|
|
13355
|
+
const operator = filterValue.operator;
|
|
13356
|
+
const datetime = parseDate(value);
|
|
13357
|
+
if (!datetime && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13358
|
+
const normalizedDatetime = datetime ? normalizeDatetime(datetime) : null;
|
|
13359
|
+
switch (operator) {
|
|
13360
|
+
case "datetimeEquals": {
|
|
13361
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13362
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13363
|
+
return normalizedDatetime.getTime() === normalizeDatetime(filterDatetime2).getTime();
|
|
13364
|
+
}
|
|
13365
|
+
case "datetimeNotEquals": {
|
|
13366
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13367
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13368
|
+
return normalizedDatetime.getTime() !== normalizeDatetime(filterDatetime2).getTime();
|
|
13369
|
+
}
|
|
13370
|
+
case "datetimeGreaterThan": {
|
|
13371
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13372
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13373
|
+
return normalizedDatetime > normalizeDatetime(filterDatetime2);
|
|
13374
|
+
}
|
|
13375
|
+
case "datetimeGreaterThanOrEqual": {
|
|
13376
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13377
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13378
|
+
return normalizedDatetime >= normalizeDatetime(filterDatetime2);
|
|
13379
|
+
}
|
|
13380
|
+
case "datetimeLessThan": {
|
|
13381
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13382
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13383
|
+
return normalizedDatetime < normalizeDatetime(filterDatetime2);
|
|
13384
|
+
}
|
|
13385
|
+
case "datetimeLessThanOrEqual": {
|
|
13386
|
+
const filterDatetime2 = parseDate(parameter.compareDatetime);
|
|
13387
|
+
if (!filterDatetime2 || !normalizedDatetime) return false;
|
|
13388
|
+
return normalizedDatetime <= normalizeDatetime(filterDatetime2);
|
|
13389
|
+
}
|
|
13390
|
+
case "datetimeBetween": {
|
|
13391
|
+
const minDatetime = parseDate(parameter.min);
|
|
13392
|
+
const maxDatetime = parseDate(parameter.max);
|
|
13393
|
+
if (!minDatetime || !maxDatetime || !normalizedDatetime) return false;
|
|
13394
|
+
return normalizedDatetime >= normalizeDatetime(minDatetime) && normalizedDatetime <= normalizeDatetime(maxDatetime);
|
|
13395
|
+
}
|
|
13396
|
+
case "datetimeNotBetween": {
|
|
13397
|
+
const minDatetime = parseDate(parameter.min);
|
|
13398
|
+
const maxDatetime = parseDate(parameter.max);
|
|
13399
|
+
if (!minDatetime || !maxDatetime || !normalizedDatetime) return false;
|
|
13400
|
+
return normalizedDatetime < normalizeDatetime(minDatetime) || normalizedDatetime > normalizeDatetime(maxDatetime);
|
|
13401
|
+
}
|
|
13402
|
+
case "undefined":
|
|
13403
|
+
return value === void 0 || value === null;
|
|
13404
|
+
case "notUndefined":
|
|
13405
|
+
return value !== void 0 && value !== null;
|
|
13406
|
+
default:
|
|
13407
|
+
return false;
|
|
13408
|
+
}
|
|
13409
|
+
}
|
|
13410
|
+
function filterBoolean(value, filterValue) {
|
|
13327
13411
|
const operator = filterValue.operator;
|
|
13328
13412
|
switch (operator) {
|
|
13329
13413
|
case "booleanIsTrue":
|
|
@@ -13337,9 +13421,8 @@ var booleanFilter = (row, columnId, filterValue) => {
|
|
|
13337
13421
|
default:
|
|
13338
13422
|
return false;
|
|
13339
13423
|
}
|
|
13340
|
-
}
|
|
13341
|
-
|
|
13342
|
-
const value = row.getValue(columnId);
|
|
13424
|
+
}
|
|
13425
|
+
function filterTags(value, filterValue) {
|
|
13343
13426
|
const parameter = filterValue.parameter;
|
|
13344
13427
|
const operator = filterValue.operator;
|
|
13345
13428
|
switch (operator) {
|
|
@@ -13374,9 +13457,28 @@ var tagsFilter = (row, columnId, filterValue) => {
|
|
|
13374
13457
|
default:
|
|
13375
13458
|
return false;
|
|
13376
13459
|
}
|
|
13377
|
-
}
|
|
13378
|
-
|
|
13379
|
-
const
|
|
13460
|
+
}
|
|
13461
|
+
function filterTagsSingle(value, filterValue) {
|
|
13462
|
+
const parameter = filterValue.parameter;
|
|
13463
|
+
const operator = filterValue.operator;
|
|
13464
|
+
switch (operator) {
|
|
13465
|
+
case "tagsSingleEquals":
|
|
13466
|
+
return value === parameter.searchTag;
|
|
13467
|
+
case "tagsSingleNotEquals":
|
|
13468
|
+
return value !== parameter.searchTag;
|
|
13469
|
+
case "tagsSingleContains":
|
|
13470
|
+
return parameter.searchTagsContains?.includes(value) ?? false;
|
|
13471
|
+
case "tagsSingleNotContains":
|
|
13472
|
+
return !(parameter.searchTagsContains?.includes(value) ?? false);
|
|
13473
|
+
case "undefined":
|
|
13474
|
+
return value === void 0 || value === null;
|
|
13475
|
+
case "notUndefined":
|
|
13476
|
+
return value !== void 0 && value !== null;
|
|
13477
|
+
default:
|
|
13478
|
+
return false;
|
|
13479
|
+
}
|
|
13480
|
+
}
|
|
13481
|
+
function filterGeneric(value, filterValue) {
|
|
13380
13482
|
const operator = filterValue.operator;
|
|
13381
13483
|
switch (operator) {
|
|
13382
13484
|
case "undefined":
|
|
@@ -13386,13 +13488,62 @@ var genericFilter = (row, columnId, filterValue) => {
|
|
|
13386
13488
|
default:
|
|
13387
13489
|
return false;
|
|
13388
13490
|
}
|
|
13491
|
+
}
|
|
13492
|
+
|
|
13493
|
+
// src/components/layout/table/TableFilter.ts
|
|
13494
|
+
var TableFilterOperator = {
|
|
13495
|
+
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
13496
|
+
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
13497
|
+
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
13498
|
+
datetime: ["datetimeEquals", "datetimeNotEquals", "datetimeGreaterThan", "datetimeGreaterThanOrEqual", "datetimeLessThan", "datetimeLessThanOrEqual", "datetimeBetween", "datetimeNotBetween"],
|
|
13499
|
+
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
13500
|
+
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
13501
|
+
tagsSingle: ["tagsSingleEquals", "tagsSingleNotEquals", "tagsSingleContains", "tagsSingleNotContains"],
|
|
13502
|
+
generic: ["undefined", "notUndefined"]
|
|
13503
|
+
};
|
|
13504
|
+
function isTableFilterCategory(value) {
|
|
13505
|
+
return typeof value === "string" && value in TableFilterOperator;
|
|
13506
|
+
}
|
|
13507
|
+
var textFilter = (row, columnId, filterValue) => {
|
|
13508
|
+
const value = row.getValue(columnId);
|
|
13509
|
+
return filterText(value, filterValue);
|
|
13510
|
+
};
|
|
13511
|
+
var numberFilter = (row, columnId, filterValue) => {
|
|
13512
|
+
const value = row.getValue(columnId);
|
|
13513
|
+
return filterNumber(value, filterValue);
|
|
13514
|
+
};
|
|
13515
|
+
var dateFilter = (row, columnId, filterValue) => {
|
|
13516
|
+
const value = row.getValue(columnId);
|
|
13517
|
+
return filterDate(value, filterValue);
|
|
13518
|
+
};
|
|
13519
|
+
var datetimeFilter = (row, columnId, filterValue) => {
|
|
13520
|
+
const value = row.getValue(columnId);
|
|
13521
|
+
return filterDatetime(value, filterValue);
|
|
13522
|
+
};
|
|
13523
|
+
var booleanFilter = (row, columnId, filterValue) => {
|
|
13524
|
+
const value = row.getValue(columnId);
|
|
13525
|
+
return filterBoolean(value, filterValue);
|
|
13526
|
+
};
|
|
13527
|
+
var tagsFilter = (row, columnId, filterValue) => {
|
|
13528
|
+
const value = row.getValue(columnId);
|
|
13529
|
+
return filterTags(value, filterValue);
|
|
13530
|
+
};
|
|
13531
|
+
var tagsSingleFilter = (row, columnId, filterValue) => {
|
|
13532
|
+
const value = row.getValue(columnId);
|
|
13533
|
+
return filterTagsSingle(value, filterValue);
|
|
13534
|
+
};
|
|
13535
|
+
var genericFilter = (row, columnId, filterValue) => {
|
|
13536
|
+
const value = row.getValue(columnId);
|
|
13537
|
+
return filterGeneric(value, filterValue);
|
|
13389
13538
|
};
|
|
13390
13539
|
var TableFilter = {
|
|
13391
13540
|
text: textFilter,
|
|
13392
13541
|
number: numberFilter,
|
|
13393
13542
|
date: dateFilter,
|
|
13543
|
+
datetime: datetimeFilter,
|
|
13394
13544
|
boolean: booleanFilter,
|
|
13395
13545
|
tags: tagsFilter,
|
|
13546
|
+
tagsSingle: tagsSingleFilter,
|
|
13396
13547
|
generic: genericFilter
|
|
13397
13548
|
};
|
|
13398
13549
|
|
|
@@ -13650,7 +13801,7 @@ var TableBody = import_react58.default.memo(function TableBodyVisual() {
|
|
|
13650
13801
|
|
|
13651
13802
|
// src/components/layout/table/TableHeader.tsx
|
|
13652
13803
|
var import_react_table3 = require("@tanstack/react-table");
|
|
13653
|
-
var
|
|
13804
|
+
var import_clsx34 = __toESM(require("clsx"));
|
|
13654
13805
|
|
|
13655
13806
|
// src/components/layout/table/TableSortButton.tsx
|
|
13656
13807
|
var import_lucide_react14 = require("lucide-react");
|
|
@@ -13676,31 +13827,41 @@ var TableSortButton = ({
|
|
|
13676
13827
|
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronDown, { className: "size-4" });
|
|
13677
13828
|
}
|
|
13678
13829
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13679
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13680
|
-
|
|
13830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13831
|
+
Tooltip,
|
|
13681
13832
|
{
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
children:
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13833
|
+
tooltip: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex-col-2", children: [
|
|
13834
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: translation("sSortingState", { sortDirection: sortDirection || "none" }) }),
|
|
13835
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: translation("rSortingOrderAfter", { otherSortings: index - 1 }) }) })
|
|
13836
|
+
] }),
|
|
13837
|
+
position: "top",
|
|
13838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13839
|
+
Button,
|
|
13840
|
+
{
|
|
13841
|
+
layout: hasSortingIndex ? "default" : "icon",
|
|
13842
|
+
color,
|
|
13843
|
+
size,
|
|
13844
|
+
className: (0, import_clsx28.default)("relative", className),
|
|
13845
|
+
...props,
|
|
13846
|
+
children: [
|
|
13847
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13848
|
+
"div",
|
|
13849
|
+
{
|
|
13850
|
+
className: (0, import_clsx28.default)("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"),
|
|
13851
|
+
children: `${index}.`
|
|
13852
|
+
}
|
|
13853
|
+
) }),
|
|
13854
|
+
icon
|
|
13855
|
+
]
|
|
13856
|
+
}
|
|
13857
|
+
)
|
|
13697
13858
|
}
|
|
13698
|
-
)
|
|
13859
|
+
);
|
|
13699
13860
|
};
|
|
13700
13861
|
|
|
13701
13862
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13702
|
-
var
|
|
13703
|
-
var
|
|
13863
|
+
var import_lucide_react19 = require("lucide-react");
|
|
13864
|
+
var import_react68 = require("react");
|
|
13704
13865
|
|
|
13705
13866
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13706
13867
|
var import_react64 = require("react");
|
|
@@ -14630,7 +14791,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14630
14791
|
});
|
|
14631
14792
|
|
|
14632
14793
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14633
|
-
var
|
|
14794
|
+
var import_react67 = require("react");
|
|
14634
14795
|
|
|
14635
14796
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14636
14797
|
var import_react65 = require("react");
|
|
@@ -14664,120 +14825,241 @@ var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelec
|
|
|
14664
14825
|
});
|
|
14665
14826
|
|
|
14666
14827
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14828
|
+
var import_lucide_react18 = require("lucide-react");
|
|
14829
|
+
|
|
14830
|
+
// src/components/user-interaction/Checkbox.tsx
|
|
14667
14831
|
var import_lucide_react17 = require("lucide-react");
|
|
14832
|
+
var import_react66 = require("react");
|
|
14833
|
+
var import_clsx33 = __toESM(require("clsx"));
|
|
14668
14834
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14835
|
+
var Checkbox = ({
|
|
14836
|
+
value = false,
|
|
14837
|
+
indeterminate = false,
|
|
14838
|
+
required = false,
|
|
14839
|
+
invalid = false,
|
|
14840
|
+
disabled = false,
|
|
14841
|
+
readOnly = false,
|
|
14842
|
+
onValueChange,
|
|
14843
|
+
onEditComplete,
|
|
14844
|
+
size = "md",
|
|
14845
|
+
alwaysShowCheckIcon = false,
|
|
14846
|
+
...props
|
|
14847
|
+
}) => {
|
|
14848
|
+
const onChangeWrapper = (0, import_react66.useCallback)(() => {
|
|
14849
|
+
onValueChange?.(!value);
|
|
14850
|
+
onEditComplete?.(!value);
|
|
14851
|
+
}, [onEditComplete, onValueChange, value]);
|
|
14852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
14853
|
+
"div",
|
|
14854
|
+
{
|
|
14855
|
+
...props,
|
|
14856
|
+
onClick: (event) => {
|
|
14857
|
+
if (!disabled) {
|
|
14858
|
+
onChangeWrapper();
|
|
14859
|
+
props.onClick?.(event);
|
|
14860
|
+
}
|
|
14861
|
+
},
|
|
14862
|
+
onKeyDown: (event) => {
|
|
14863
|
+
if (disabled) return;
|
|
14864
|
+
if (event.key === " " || event.key === "Enter") {
|
|
14865
|
+
event.preventDefault();
|
|
14866
|
+
onChangeWrapper();
|
|
14867
|
+
props.onKeyDown?.(event);
|
|
14868
|
+
}
|
|
14869
|
+
},
|
|
14870
|
+
"data-checked": !indeterminate ? value : "indeterminate",
|
|
14871
|
+
"data-size": size ?? void 0,
|
|
14872
|
+
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
14873
|
+
role: "checkbox",
|
|
14874
|
+
tabIndex: disabled ? -1 : 0,
|
|
14875
|
+
"aria-checked": indeterminate ? "mixed" : value,
|
|
14876
|
+
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
14877
|
+
className: (0, import_clsx33.default)("checkbox", props.className),
|
|
14878
|
+
children: [
|
|
14879
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Minus, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
14880
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Check, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
14881
|
+
]
|
|
14882
|
+
}
|
|
14883
|
+
);
|
|
14884
|
+
};
|
|
14885
|
+
var CheckboxUncontrolled = ({
|
|
14886
|
+
value: initialValue,
|
|
14887
|
+
onValueChange,
|
|
14888
|
+
...props
|
|
14889
|
+
}) => {
|
|
14890
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14892
|
+
Checkbox,
|
|
14893
|
+
{
|
|
14894
|
+
...props,
|
|
14895
|
+
value,
|
|
14896
|
+
onValueChange: setValue
|
|
14897
|
+
}
|
|
14898
|
+
);
|
|
14899
|
+
};
|
|
14900
|
+
|
|
14901
|
+
// src/components/layout/table/TableFilterPopups.tsx
|
|
14902
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14669
14903
|
var getOperatorInfo = (operator) => {
|
|
14670
14904
|
switch (operator) {
|
|
14671
14905
|
case "textEquals":
|
|
14672
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14906
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14673
14907
|
case "textNotEquals":
|
|
14674
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14908
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14675
14909
|
case "textNotWhitespace":
|
|
14676
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14910
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14677
14911
|
case "textContains":
|
|
14678
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14912
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14679
14913
|
case "textNotContains":
|
|
14680
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14914
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14681
14915
|
case "textStartsWith":
|
|
14682
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14916
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14683
14917
|
case "textEndsWith":
|
|
14684
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14918
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14685
14919
|
case "numberEquals":
|
|
14686
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14920
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14687
14921
|
case "numberNotEquals":
|
|
14688
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14922
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14689
14923
|
case "numberGreaterThan":
|
|
14690
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14924
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14691
14925
|
case "numberGreaterThanOrEqual":
|
|
14692
14926
|
return {
|
|
14693
|
-
icon: /* @__PURE__ */ (0,
|
|
14694
|
-
/* @__PURE__ */ (0,
|
|
14695
|
-
/* @__PURE__ */ (0,
|
|
14927
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14928
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
14929
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14696
14930
|
] }),
|
|
14697
14931
|
translationKey: "greaterThanOrEqual"
|
|
14698
14932
|
};
|
|
14699
14933
|
case "numberLessThan":
|
|
14700
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14934
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14701
14935
|
case "numberLessThanOrEqual":
|
|
14702
14936
|
return {
|
|
14703
|
-
icon: /* @__PURE__ */ (0,
|
|
14704
|
-
/* @__PURE__ */ (0,
|
|
14705
|
-
/* @__PURE__ */ (0,
|
|
14937
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14938
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
14939
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14706
14940
|
] }),
|
|
14707
14941
|
translationKey: "lessThanOrEqual"
|
|
14708
14942
|
};
|
|
14709
14943
|
case "numberBetween":
|
|
14710
14944
|
return {
|
|
14711
|
-
icon: /* @__PURE__ */ (0,
|
|
14712
|
-
/* @__PURE__ */ (0,
|
|
14713
|
-
/* @__PURE__ */ (0,
|
|
14945
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14946
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
14947
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14714
14948
|
] }),
|
|
14715
14949
|
translationKey: "between"
|
|
14716
14950
|
};
|
|
14717
14951
|
case "numberNotBetween":
|
|
14718
14952
|
return {
|
|
14719
|
-
icon: /* @__PURE__ */ (0,
|
|
14720
|
-
/* @__PURE__ */ (0,
|
|
14721
|
-
/* @__PURE__ */ (0,
|
|
14953
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14954
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
14955
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14722
14956
|
] }),
|
|
14723
14957
|
translationKey: "notBetween"
|
|
14724
14958
|
};
|
|
14725
14959
|
case "dateEquals":
|
|
14726
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14960
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14727
14961
|
case "dateNotEquals":
|
|
14728
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14962
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14729
14963
|
case "dateGreaterThan":
|
|
14730
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14964
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14731
14965
|
case "dateGreaterThanOrEqual":
|
|
14732
14966
|
return {
|
|
14733
|
-
icon: /* @__PURE__ */ (0,
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14735
|
-
/* @__PURE__ */ (0,
|
|
14967
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14968
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
14969
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14736
14970
|
] }),
|
|
14737
14971
|
translationKey: "onOrAfter"
|
|
14738
14972
|
};
|
|
14739
14973
|
case "dateLessThan":
|
|
14740
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14974
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14741
14975
|
case "dateLessThanOrEqual":
|
|
14742
14976
|
return {
|
|
14743
|
-
icon: /* @__PURE__ */ (0,
|
|
14744
|
-
/* @__PURE__ */ (0,
|
|
14745
|
-
/* @__PURE__ */ (0,
|
|
14977
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14978
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
14979
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14746
14980
|
] }),
|
|
14747
14981
|
translationKey: "onOrBefore"
|
|
14748
14982
|
};
|
|
14749
14983
|
case "dateBetween":
|
|
14750
14984
|
return {
|
|
14751
|
-
icon: /* @__PURE__ */ (0,
|
|
14752
|
-
/* @__PURE__ */ (0,
|
|
14753
|
-
/* @__PURE__ */ (0,
|
|
14985
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14986
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
14987
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14754
14988
|
] }),
|
|
14755
14989
|
translationKey: "between"
|
|
14756
14990
|
};
|
|
14757
14991
|
case "dateNotBetween":
|
|
14758
14992
|
return {
|
|
14759
|
-
icon: /* @__PURE__ */ (0,
|
|
14760
|
-
/* @__PURE__ */ (0,
|
|
14761
|
-
/* @__PURE__ */ (0,
|
|
14993
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14994
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
14995
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14762
14996
|
] }),
|
|
14763
14997
|
translationKey: "notBetween"
|
|
14764
14998
|
};
|
|
14765
14999
|
case "booleanIsTrue":
|
|
14766
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15000
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14767
15001
|
case "booleanIsFalse":
|
|
14768
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15002
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14769
15003
|
case "tagsEquals":
|
|
14770
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15004
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14771
15005
|
case "tagsNotEquals":
|
|
14772
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15006
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14773
15007
|
case "tagsContains":
|
|
14774
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15008
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14775
15009
|
case "tagsNotContains":
|
|
14776
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15010
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
15011
|
+
case "datetimeEquals":
|
|
15012
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
15013
|
+
case "datetimeNotEquals":
|
|
15014
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
15015
|
+
case "datetimeGreaterThan":
|
|
15016
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }), translationKey: "after" };
|
|
15017
|
+
case "datetimeGreaterThanOrEqual":
|
|
15018
|
+
return {
|
|
15019
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
15020
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
15021
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
15022
|
+
] }),
|
|
15023
|
+
translationKey: "onOrAfter"
|
|
15024
|
+
};
|
|
15025
|
+
case "datetimeLessThan":
|
|
15026
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }), translationKey: "before" };
|
|
15027
|
+
case "datetimeLessThanOrEqual":
|
|
15028
|
+
return {
|
|
15029
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
15030
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
15031
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "-ml-1 w-4 h-4" })
|
|
15032
|
+
] }),
|
|
15033
|
+
translationKey: "onOrBefore"
|
|
15034
|
+
};
|
|
15035
|
+
case "datetimeBetween":
|
|
15036
|
+
return {
|
|
15037
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
15038
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "w-4 h-4" }),
|
|
15039
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
15040
|
+
] }),
|
|
15041
|
+
translationKey: "between"
|
|
15042
|
+
};
|
|
15043
|
+
case "datetimeNotBetween":
|
|
15044
|
+
return {
|
|
15045
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
15046
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronLeft, { className: "w-4 h-4" }),
|
|
15047
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
15048
|
+
] }),
|
|
15049
|
+
translationKey: "notBetween"
|
|
15050
|
+
};
|
|
15051
|
+
case "tagsSingleEquals":
|
|
15052
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
15053
|
+
case "tagsSingleNotEquals":
|
|
15054
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
15055
|
+
case "tagsSingleContains":
|
|
15056
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
15057
|
+
case "tagsSingleNotContains":
|
|
15058
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14777
15059
|
case "undefined":
|
|
14778
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15060
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14779
15061
|
case "notUndefined":
|
|
14780
|
-
return { icon: /* @__PURE__ */ (0,
|
|
15062
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14781
15063
|
default:
|
|
14782
15064
|
return { icon: null, translationKey: "undefined translation" };
|
|
14783
15065
|
}
|
|
@@ -14786,22 +15068,23 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14786
15068
|
const translation = useHightideTranslation();
|
|
14787
15069
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14788
15070
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14789
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14790
15072
|
icon,
|
|
14791
15073
|
label
|
|
14792
15074
|
] });
|
|
14793
15075
|
};
|
|
14794
15076
|
var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14795
15077
|
const translation = useHightideTranslation();
|
|
14796
|
-
const operator = filterValue?.operator ?? "
|
|
15078
|
+
const operator = filterValue?.operator ?? "textContains";
|
|
14797
15079
|
const parameter = filterValue?.parameter ?? {};
|
|
14798
|
-
const
|
|
15080
|
+
const id = (0, import_react67.useId)();
|
|
15081
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
14799
15082
|
...TableFilterOperator.text,
|
|
14800
15083
|
...TableFilterOperator.generic
|
|
14801
15084
|
], []);
|
|
14802
15085
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14803
|
-
return /* @__PURE__ */ (0,
|
|
14804
|
-
/* @__PURE__ */ (0,
|
|
15086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15087
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14805
15088
|
Select,
|
|
14806
15089
|
{
|
|
14807
15090
|
value: operator,
|
|
@@ -14812,39 +15095,57 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14812
15095
|
});
|
|
14813
15096
|
},
|
|
14814
15097
|
buttonProps: { className: "min-w-64" },
|
|
14815
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15098
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14816
15099
|
}
|
|
14817
15100
|
),
|
|
14818
|
-
/* @__PURE__ */ (0,
|
|
14819
|
-
/* @__PURE__ */ (0,
|
|
14820
|
-
|
|
14821
|
-
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
15101
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15102
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Visibility, { isVisible: needsParameterInput, children: [
|
|
15103
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15104
|
+
Input,
|
|
15105
|
+
{
|
|
15106
|
+
value: parameter.searchText ?? "",
|
|
15107
|
+
placeholder: translation("search") + "...",
|
|
15108
|
+
onValueChange: (searchText) => {
|
|
15109
|
+
onFilterValueChange({
|
|
15110
|
+
operator,
|
|
15111
|
+
parameter: { ...parameter, searchText }
|
|
15112
|
+
});
|
|
15113
|
+
},
|
|
15114
|
+
className: "min-w-64"
|
|
15115
|
+
}
|
|
15116
|
+
),
|
|
15117
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 items-center gap-2", children: [
|
|
15118
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15119
|
+
Checkbox,
|
|
15120
|
+
{
|
|
15121
|
+
id,
|
|
15122
|
+
value: parameter.isCaseSensitive ?? false,
|
|
15123
|
+
onValueChange: (isCaseSensitive) => {
|
|
15124
|
+
onFilterValueChange({
|
|
15125
|
+
operator,
|
|
15126
|
+
parameter: { ...parameter, isCaseSensitive }
|
|
15127
|
+
});
|
|
15128
|
+
}
|
|
15129
|
+
}
|
|
15130
|
+
),
|
|
15131
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("label", { htmlFor: id, children: translation("caseSensitive") })
|
|
15132
|
+
] })
|
|
15133
|
+
] }),
|
|
15134
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
14834
15135
|
] });
|
|
14835
15136
|
};
|
|
14836
15137
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14837
15138
|
const translation = useHightideTranslation();
|
|
14838
|
-
const operator = filterValue?.operator ?? "
|
|
15139
|
+
const operator = filterValue?.operator ?? "numberBetween";
|
|
14839
15140
|
const parameter = filterValue?.parameter ?? {};
|
|
14840
|
-
const availableOperators = (0,
|
|
15141
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
14841
15142
|
...TableFilterOperator.number,
|
|
14842
15143
|
...TableFilterOperator.generic
|
|
14843
15144
|
], []);
|
|
14844
15145
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14845
15146
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14846
|
-
return /* @__PURE__ */ (0,
|
|
14847
|
-
/* @__PURE__ */ (0,
|
|
15147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15148
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14848
15149
|
Select,
|
|
14849
15150
|
{
|
|
14850
15151
|
value: operator,
|
|
@@ -14855,12 +15156,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14855
15156
|
});
|
|
14856
15157
|
},
|
|
14857
15158
|
buttonProps: { className: "min-w-64" },
|
|
14858
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15159
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14859
15160
|
}
|
|
14860
15161
|
),
|
|
14861
|
-
/* @__PURE__ */ (0,
|
|
14862
|
-
/* @__PURE__ */ (0,
|
|
14863
|
-
/* @__PURE__ */ (0,
|
|
15162
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15163
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15164
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormFieldLayout, { label: translation("min"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14864
15165
|
Input,
|
|
14865
15166
|
{
|
|
14866
15167
|
...ariaAttributes,
|
|
@@ -14879,7 +15180,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14879
15180
|
className: "input-indicator-hidden min-w-64"
|
|
14880
15181
|
}
|
|
14881
15182
|
) }),
|
|
14882
|
-
/* @__PURE__ */ (0,
|
|
15183
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14883
15184
|
Input,
|
|
14884
15185
|
{
|
|
14885
15186
|
...ariaAttributes,
|
|
@@ -14899,7 +15200,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14899
15200
|
}
|
|
14900
15201
|
) })
|
|
14901
15202
|
] }) }),
|
|
14902
|
-
/* @__PURE__ */ (0,
|
|
15203
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14903
15204
|
Input,
|
|
14904
15205
|
{
|
|
14905
15206
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14915,23 +15216,23 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14915
15216
|
className: "min-w-64"
|
|
14916
15217
|
}
|
|
14917
15218
|
) }),
|
|
14918
|
-
/* @__PURE__ */ (0,
|
|
15219
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14919
15220
|
] });
|
|
14920
15221
|
};
|
|
14921
15222
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
14922
15223
|
const translation = useHightideTranslation();
|
|
14923
|
-
const operator = filterValue?.operator ?? "
|
|
15224
|
+
const operator = filterValue?.operator ?? "dateBetween";
|
|
14924
15225
|
const parameter = filterValue?.parameter ?? {};
|
|
14925
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
14926
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
14927
|
-
const availableOperators = (0,
|
|
15226
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react67.useState)(null);
|
|
15227
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react67.useState)(null);
|
|
15228
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
14928
15229
|
...TableFilterOperator.date,
|
|
14929
15230
|
...TableFilterOperator.generic
|
|
14930
15231
|
], []);
|
|
14931
15232
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14932
15233
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14933
|
-
return /* @__PURE__ */ (0,
|
|
14934
|
-
/* @__PURE__ */ (0,
|
|
15234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15235
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14935
15236
|
Select,
|
|
14936
15237
|
{
|
|
14937
15238
|
value: operator,
|
|
@@ -14942,12 +15243,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14942
15243
|
});
|
|
14943
15244
|
},
|
|
14944
15245
|
buttonProps: { className: "min-w-64" },
|
|
14945
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15246
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14946
15247
|
}
|
|
14947
15248
|
),
|
|
14948
|
-
/* @__PURE__ */ (0,
|
|
14949
|
-
/* @__PURE__ */ (0,
|
|
14950
|
-
/* @__PURE__ */ (0,
|
|
15249
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15250
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15251
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14951
15252
|
DateTimeInput,
|
|
14952
15253
|
{
|
|
14953
15254
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14980,7 +15281,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14980
15281
|
className: "min-w-64"
|
|
14981
15282
|
}
|
|
14982
15283
|
),
|
|
14983
|
-
/* @__PURE__ */ (0,
|
|
15284
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14984
15285
|
DateTimeInput,
|
|
14985
15286
|
{
|
|
14986
15287
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -15013,7 +15314,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15013
15314
|
}
|
|
15014
15315
|
)
|
|
15015
15316
|
] }) }),
|
|
15016
|
-
/* @__PURE__ */ (0,
|
|
15317
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15017
15318
|
DateTimeInput,
|
|
15018
15319
|
{
|
|
15019
15320
|
value: parameter.compareDate ?? null,
|
|
@@ -15029,16 +15330,132 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15029
15330
|
className: "min-w-64"
|
|
15030
15331
|
}
|
|
15031
15332
|
) }),
|
|
15032
|
-
/* @__PURE__ */ (0,
|
|
15333
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15334
|
+
] });
|
|
15335
|
+
};
|
|
15336
|
+
var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
15337
|
+
const translation = useHightideTranslation();
|
|
15338
|
+
const operator = filterValue?.operator ?? "datetimeBetween";
|
|
15339
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15340
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react67.useState)(null);
|
|
15341
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react67.useState)(null);
|
|
15342
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
15343
|
+
...TableFilterOperator.datetime,
|
|
15344
|
+
...TableFilterOperator.generic
|
|
15345
|
+
], []);
|
|
15346
|
+
const needsRangeInput = operator === "datetimeBetween" || operator === "datetimeNotBetween";
|
|
15347
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15349
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15350
|
+
Select,
|
|
15351
|
+
{
|
|
15352
|
+
value: operator,
|
|
15353
|
+
onValueChange: (newOperator) => {
|
|
15354
|
+
onFilterValueChange({
|
|
15355
|
+
operator: newOperator,
|
|
15356
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15357
|
+
});
|
|
15358
|
+
},
|
|
15359
|
+
buttonProps: { className: "min-w-64" },
|
|
15360
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15361
|
+
}
|
|
15362
|
+
),
|
|
15363
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15364
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15365
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15366
|
+
DateTimeInput,
|
|
15367
|
+
{
|
|
15368
|
+
mode: "dateTime",
|
|
15369
|
+
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
15370
|
+
placeholder: translation("startDate"),
|
|
15371
|
+
onValueChange: (value) => setTemporaryMinDateValue(value),
|
|
15372
|
+
onEditComplete: (value) => {
|
|
15373
|
+
if (value && parameter.max && value > parameter.max) {
|
|
15374
|
+
if (!parameter.min) {
|
|
15375
|
+
onFilterValueChange({
|
|
15376
|
+
operator,
|
|
15377
|
+
parameter: { min: parameter.max, max: value }
|
|
15378
|
+
});
|
|
15379
|
+
} else {
|
|
15380
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15381
|
+
onFilterValueChange({
|
|
15382
|
+
operator,
|
|
15383
|
+
parameter: { min: value, max: new Date(value.getTime() + diff) }
|
|
15384
|
+
});
|
|
15385
|
+
}
|
|
15386
|
+
} else {
|
|
15387
|
+
onFilterValueChange({
|
|
15388
|
+
operator,
|
|
15389
|
+
parameter: { ...parameter, min: value }
|
|
15390
|
+
});
|
|
15391
|
+
}
|
|
15392
|
+
setTemporaryMinDateValue(null);
|
|
15393
|
+
},
|
|
15394
|
+
allowRemove: true,
|
|
15395
|
+
outsideClickCloses: false,
|
|
15396
|
+
className: "min-w-64"
|
|
15397
|
+
}
|
|
15398
|
+
),
|
|
15399
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15400
|
+
DateTimeInput,
|
|
15401
|
+
{
|
|
15402
|
+
mode: "dateTime",
|
|
15403
|
+
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
15404
|
+
placeholder: translation("endDate"),
|
|
15405
|
+
onValueChange: (value) => setTemporaryMaxDateValue(value),
|
|
15406
|
+
onEditComplete: (value) => {
|
|
15407
|
+
if (value && parameter.min && value < parameter.min) {
|
|
15408
|
+
if (!parameter.max) {
|
|
15409
|
+
onFilterValueChange({
|
|
15410
|
+
operator,
|
|
15411
|
+
parameter: { min: value, max: parameter.min }
|
|
15412
|
+
});
|
|
15413
|
+
} else {
|
|
15414
|
+
const diff = parameter.max.getTime() - parameter.min.getTime();
|
|
15415
|
+
onFilterValueChange({
|
|
15416
|
+
operator,
|
|
15417
|
+
parameter: { min: new Date(value.getTime() - diff), max: value }
|
|
15418
|
+
});
|
|
15419
|
+
}
|
|
15420
|
+
} else {
|
|
15421
|
+
onFilterValueChange({
|
|
15422
|
+
operator,
|
|
15423
|
+
parameter: { ...parameter, max: value }
|
|
15424
|
+
});
|
|
15425
|
+
}
|
|
15426
|
+
},
|
|
15427
|
+
allowRemove: true,
|
|
15428
|
+
outsideClickCloses: false,
|
|
15429
|
+
className: "min-w-64"
|
|
15430
|
+
}
|
|
15431
|
+
)
|
|
15432
|
+
] }) }),
|
|
15433
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15434
|
+
DateTimeInput,
|
|
15435
|
+
{
|
|
15436
|
+
value: parameter.compareDatetime ?? null,
|
|
15437
|
+
placeholder: translation("date"),
|
|
15438
|
+
onValueChange: (compareDatetime) => {
|
|
15439
|
+
onFilterValueChange({
|
|
15440
|
+
operator,
|
|
15441
|
+
parameter: { compareDatetime }
|
|
15442
|
+
});
|
|
15443
|
+
},
|
|
15444
|
+
allowRemove: true,
|
|
15445
|
+
outsideClickCloses: false,
|
|
15446
|
+
className: "min-w-64"
|
|
15447
|
+
}
|
|
15448
|
+
) }),
|
|
15449
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15033
15450
|
] });
|
|
15034
15451
|
};
|
|
15035
15452
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
15036
15453
|
const operator = filterValue?.operator ?? "booleanIsTrue";
|
|
15037
|
-
const availableOperators = (0,
|
|
15454
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
15038
15455
|
...TableFilterOperator.boolean,
|
|
15039
15456
|
...TableFilterOperator.generic
|
|
15040
15457
|
], []);
|
|
15041
|
-
return /* @__PURE__ */ (0,
|
|
15458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15042
15459
|
Select,
|
|
15043
15460
|
{
|
|
15044
15461
|
value: operator,
|
|
@@ -15049,7 +15466,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15049
15466
|
});
|
|
15050
15467
|
},
|
|
15051
15468
|
buttonProps: { className: "min-w-64" },
|
|
15052
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15469
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15053
15470
|
}
|
|
15054
15471
|
) });
|
|
15055
15472
|
};
|
|
@@ -15058,11 +15475,11 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
15058
15475
|
const { table } = useTableDataContext();
|
|
15059
15476
|
const operator = filterValue?.operator ?? "tagsContains";
|
|
15060
15477
|
const parameter = filterValue?.parameter ?? {};
|
|
15061
|
-
const availableOperators = (0,
|
|
15478
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
15062
15479
|
...TableFilterOperator.tags,
|
|
15063
15480
|
...TableFilterOperator.generic
|
|
15064
15481
|
], []);
|
|
15065
|
-
const availableTags = (0,
|
|
15482
|
+
const availableTags = (0, import_react67.useMemo)(() => {
|
|
15066
15483
|
const column = table.getColumn(columnId);
|
|
15067
15484
|
if (!column) return [];
|
|
15068
15485
|
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
@@ -15071,8 +15488,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
15071
15488
|
return null;
|
|
15072
15489
|
}
|
|
15073
15490
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15074
|
-
return /* @__PURE__ */ (0,
|
|
15075
|
-
/* @__PURE__ */ (0,
|
|
15491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15492
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15076
15493
|
Select,
|
|
15077
15494
|
{
|
|
15078
15495
|
value: operator,
|
|
@@ -15083,12 +15500,12 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
15083
15500
|
});
|
|
15084
15501
|
},
|
|
15085
15502
|
buttonProps: { className: "min-w-64" },
|
|
15086
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15503
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15087
15504
|
}
|
|
15088
15505
|
),
|
|
15089
|
-
/* @__PURE__ */ (0,
|
|
15090
|
-
/* @__PURE__ */ (0,
|
|
15091
|
-
|
|
15506
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15507
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15508
|
+
MultiSelect,
|
|
15092
15509
|
{
|
|
15093
15510
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
15094
15511
|
onValueChange: (selectedTags) => {
|
|
@@ -15098,18 +15515,84 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
15098
15515
|
});
|
|
15099
15516
|
},
|
|
15100
15517
|
buttonProps: { className: "min-w-64" },
|
|
15101
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
15518
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MultiSelectOption, { value: tag, children: label }, tag))
|
|
15102
15519
|
}
|
|
15103
15520
|
) }),
|
|
15104
|
-
/* @__PURE__ */ (0,
|
|
15521
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15522
|
+
] });
|
|
15523
|
+
};
|
|
15524
|
+
var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
15525
|
+
const translation = useHightideTranslation();
|
|
15526
|
+
const { table } = useTableDataContext();
|
|
15527
|
+
const operator = filterValue?.operator ?? "tagsSingleContains";
|
|
15528
|
+
const parameter = filterValue?.parameter ?? {};
|
|
15529
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
15530
|
+
...TableFilterOperator.tagsSingle,
|
|
15531
|
+
...TableFilterOperator.generic
|
|
15532
|
+
], []);
|
|
15533
|
+
const availableTags = (0, import_react67.useMemo)(() => {
|
|
15534
|
+
const column = table.getColumn(columnId);
|
|
15535
|
+
if (!column) return [];
|
|
15536
|
+
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
15537
|
+
}, [columnId, table]);
|
|
15538
|
+
if (availableTags.length === 0) {
|
|
15539
|
+
return null;
|
|
15540
|
+
}
|
|
15541
|
+
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
15542
|
+
const needsMultiSelect = operator === "tagsSingleContains" || operator === "tagsSingleNotContains";
|
|
15543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
15544
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15545
|
+
Select,
|
|
15546
|
+
{
|
|
15547
|
+
value: operator,
|
|
15548
|
+
onValueChange: (newOperator) => {
|
|
15549
|
+
onFilterValueChange({
|
|
15550
|
+
operator: newOperator,
|
|
15551
|
+
parameter: needsParameterInput ? parameter : {}
|
|
15552
|
+
});
|
|
15553
|
+
},
|
|
15554
|
+
buttonProps: { className: "min-w-64" },
|
|
15555
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15556
|
+
}
|
|
15557
|
+
),
|
|
15558
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15559
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsParameterInput && needsMultiSelect, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15560
|
+
MultiSelect,
|
|
15561
|
+
{
|
|
15562
|
+
value: Array.isArray(parameter.searchTagsContains) ? parameter.searchTagsContains.map((tag) => String(tag)) : [],
|
|
15563
|
+
onValueChange: (selectedTags) => {
|
|
15564
|
+
onFilterValueChange({
|
|
15565
|
+
operator,
|
|
15566
|
+
parameter: { searchTagsContains: selectedTags.length > 0 ? selectedTags : void 0 }
|
|
15567
|
+
});
|
|
15568
|
+
},
|
|
15569
|
+
buttonProps: { className: "min-w-64" },
|
|
15570
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MultiSelectOption, { value: tag, children: label }, tag))
|
|
15571
|
+
}
|
|
15572
|
+
) }),
|
|
15573
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: needsParameterInput && !needsMultiSelect, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15574
|
+
Select,
|
|
15575
|
+
{
|
|
15576
|
+
value: parameter.searchTag ? String(parameter.searchTag) : void 0,
|
|
15577
|
+
onValueChange: (selectedTag) => {
|
|
15578
|
+
onFilterValueChange({
|
|
15579
|
+
operator,
|
|
15580
|
+
parameter: { searchTag: selectedTag ? String(selectedTag) : void 0 }
|
|
15581
|
+
});
|
|
15582
|
+
},
|
|
15583
|
+
buttonProps: { className: "min-w-64" },
|
|
15584
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: tag, children: label }, tag))
|
|
15585
|
+
}
|
|
15586
|
+
) }),
|
|
15587
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
15105
15588
|
] });
|
|
15106
15589
|
};
|
|
15107
15590
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
15108
15591
|
const operator = filterValue?.operator ?? "notUndefined";
|
|
15109
|
-
const availableOperators = (0,
|
|
15592
|
+
const availableOperators = (0, import_react67.useMemo)(() => [
|
|
15110
15593
|
...TableFilterOperator.generic
|
|
15111
15594
|
], []);
|
|
15112
|
-
return /* @__PURE__ */ (0,
|
|
15595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15113
15596
|
Select,
|
|
15114
15597
|
{
|
|
15115
15598
|
value: operator,
|
|
@@ -15120,56 +15603,60 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15120
15603
|
});
|
|
15121
15604
|
},
|
|
15122
15605
|
buttonProps: { className: "min-w-64" },
|
|
15123
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15606
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15124
15607
|
}
|
|
15125
15608
|
) });
|
|
15126
15609
|
};
|
|
15127
15610
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
15128
15611
|
switch (filterType) {
|
|
15129
15612
|
case "text":
|
|
15130
|
-
return /* @__PURE__ */ (0,
|
|
15613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TextFilter, { ...props });
|
|
15131
15614
|
case "number":
|
|
15132
|
-
return /* @__PURE__ */ (0,
|
|
15615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(NumberFilter, { ...props });
|
|
15133
15616
|
case "date":
|
|
15134
|
-
return /* @__PURE__ */ (0,
|
|
15617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DateFilter, { ...props });
|
|
15618
|
+
case "datetime":
|
|
15619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DatetimeFilter, { ...props });
|
|
15135
15620
|
case "boolean":
|
|
15136
|
-
return /* @__PURE__ */ (0,
|
|
15621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(BooleanFilter, { ...props });
|
|
15137
15622
|
case "tags":
|
|
15138
|
-
return /* @__PURE__ */ (0,
|
|
15623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TagsFilter, { ...props });
|
|
15624
|
+
case "tagsSingle":
|
|
15625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TagsSingleFilter, { ...props });
|
|
15139
15626
|
case "generic":
|
|
15140
|
-
return /* @__PURE__ */ (0,
|
|
15627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GenericFilter, { ...props });
|
|
15141
15628
|
default:
|
|
15142
15629
|
return null;
|
|
15143
15630
|
}
|
|
15144
15631
|
};
|
|
15145
15632
|
|
|
15146
15633
|
// src/components/layout/table/TableFilterButton.tsx
|
|
15147
|
-
var
|
|
15634
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
15148
15635
|
var TableFilterButton = ({
|
|
15149
15636
|
filterType,
|
|
15150
15637
|
column
|
|
15151
15638
|
}) => {
|
|
15152
15639
|
const translation = useHightideTranslation();
|
|
15153
15640
|
const columnFilterValue = column.getFilterValue();
|
|
15154
|
-
const [filterValue, setFilterValue] = (0,
|
|
15641
|
+
const [filterValue, setFilterValue] = (0, import_react68.useState)(columnFilterValue);
|
|
15155
15642
|
const hasFilter = !!filterValue;
|
|
15156
|
-
const anchorRef = (0,
|
|
15157
|
-
const containerRef = (0,
|
|
15158
|
-
const [isOpen, setIsOpen] = (0,
|
|
15159
|
-
const id = (0,
|
|
15160
|
-
const ids = (0,
|
|
15643
|
+
const anchorRef = (0, import_react68.useRef)(null);
|
|
15644
|
+
const containerRef = (0, import_react68.useRef)(null);
|
|
15645
|
+
const [isOpen, setIsOpen] = (0, import_react68.useState)(false);
|
|
15646
|
+
const id = (0, import_react68.useId)();
|
|
15647
|
+
const ids = (0, import_react68.useMemo)(() => ({
|
|
15161
15648
|
button: `table-filter-button-${id}`,
|
|
15162
15649
|
popup: `table-filter-popup-${id}`,
|
|
15163
15650
|
label: `table-filter-label-${id}`
|
|
15164
15651
|
}), [id]);
|
|
15165
|
-
(0,
|
|
15652
|
+
(0, import_react68.useEffect)(() => {
|
|
15166
15653
|
setFilterValue(columnFilterValue);
|
|
15167
15654
|
}, [columnFilterValue]);
|
|
15168
15655
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
15169
15656
|
return null;
|
|
15170
15657
|
}
|
|
15171
|
-
return /* @__PURE__ */ (0,
|
|
15172
|
-
/* @__PURE__ */ (0,
|
|
15658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
15659
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Tooltip, { tooltip: translation("filter"), position: "top", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
15173
15660
|
Button,
|
|
15174
15661
|
{
|
|
15175
15662
|
ref: anchorRef,
|
|
@@ -15185,12 +15672,12 @@ var TableFilterButton = ({
|
|
|
15185
15672
|
"aria-labelledby": ids.label,
|
|
15186
15673
|
className: "relative",
|
|
15187
15674
|
children: [
|
|
15188
|
-
/* @__PURE__ */ (0,
|
|
15189
|
-
/* @__PURE__ */ (0,
|
|
15675
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react19.FilterIcon, { className: "size-4" }),
|
|
15676
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: hasFilter, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary" }) })
|
|
15190
15677
|
]
|
|
15191
15678
|
}
|
|
15192
|
-
),
|
|
15193
|
-
/* @__PURE__ */ (0,
|
|
15679
|
+
) }),
|
|
15680
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
15194
15681
|
PopUp,
|
|
15195
15682
|
{
|
|
15196
15683
|
ref: containerRef,
|
|
@@ -15206,8 +15693,8 @@ var TableFilterButton = ({
|
|
|
15206
15693
|
"aria-labelledby": ids.label,
|
|
15207
15694
|
className: "flex-col-2 p-2 items-start",
|
|
15208
15695
|
children: [
|
|
15209
|
-
/* @__PURE__ */ (0,
|
|
15210
|
-
/* @__PURE__ */ (0,
|
|
15696
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15697
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15211
15698
|
TableFilterContent,
|
|
15212
15699
|
{
|
|
15213
15700
|
columnId: column.id,
|
|
@@ -15216,12 +15703,12 @@ var TableFilterButton = ({
|
|
|
15216
15703
|
onFilterValueChange: setFilterValue
|
|
15217
15704
|
}
|
|
15218
15705
|
),
|
|
15219
|
-
/* @__PURE__ */ (0,
|
|
15220
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
15706
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
15707
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
15221
15708
|
column.setFilterValue(void 0);
|
|
15222
15709
|
setIsOpen(false);
|
|
15223
15710
|
}, children: translation("remove") }),
|
|
15224
|
-
/* @__PURE__ */ (0,
|
|
15711
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Button, { size: "sm", onClick: () => {
|
|
15225
15712
|
if (filterValue) {
|
|
15226
15713
|
column.setFilterValue(filterValue);
|
|
15227
15714
|
}
|
|
@@ -15235,12 +15722,12 @@ var TableFilterButton = ({
|
|
|
15235
15722
|
};
|
|
15236
15723
|
|
|
15237
15724
|
// src/components/layout/table/TableHeader.tsx
|
|
15238
|
-
var
|
|
15239
|
-
var
|
|
15725
|
+
var import_react69 = require("react");
|
|
15726
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
15240
15727
|
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15241
15728
|
const { table: tableState } = useTableHeaderContext();
|
|
15242
15729
|
const table = tableOverride ?? tableState;
|
|
15243
|
-
const handleResizeMove = (0,
|
|
15730
|
+
const handleResizeMove = (0, import_react69.useCallback)((e) => {
|
|
15244
15731
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15245
15732
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
15246
15733
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -15256,7 +15743,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15256
15743
|
deltaOffset
|
|
15257
15744
|
}));
|
|
15258
15745
|
}, [table]);
|
|
15259
|
-
const handleResizeEnd = (0,
|
|
15746
|
+
const handleResizeEnd = (0, import_react69.useCallback)(() => {
|
|
15260
15747
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
15261
15748
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
15262
15749
|
table.setColumnSizing((prev) => {
|
|
@@ -15274,7 +15761,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15274
15761
|
startSize: null
|
|
15275
15762
|
});
|
|
15276
15763
|
}, [table]);
|
|
15277
|
-
(0,
|
|
15764
|
+
(0, import_react69.useEffect)(() => {
|
|
15278
15765
|
window.addEventListener("pointermove", handleResizeMove);
|
|
15279
15766
|
window.addEventListener("pointerup", handleResizeEnd);
|
|
15280
15767
|
return () => {
|
|
@@ -15282,8 +15769,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15282
15769
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15283
15770
|
};
|
|
15284
15771
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15285
|
-
return /* @__PURE__ */ (0,
|
|
15286
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
15772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
15773
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
15287
15774
|
"col",
|
|
15288
15775
|
{
|
|
15289
15776
|
style: {
|
|
@@ -15294,16 +15781,16 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15294
15781
|
},
|
|
15295
15782
|
header.id
|
|
15296
15783
|
)) }, headerGroup.id)),
|
|
15297
|
-
/* @__PURE__ */ (0,
|
|
15298
|
-
return /* @__PURE__ */ (0,
|
|
15784
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("tr", { className: (0, import_clsx34.default)("table-header-row", table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
|
|
15785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
15299
15786
|
"th",
|
|
15300
15787
|
{
|
|
15301
15788
|
colSpan: header.colSpan,
|
|
15302
15789
|
"data-sticky": isSticky ? "" : void 0,
|
|
15303
|
-
className: (0,
|
|
15790
|
+
className: (0, import_clsx34.default)("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15304
15791
|
children: [
|
|
15305
|
-
/* @__PURE__ */ (0,
|
|
15306
|
-
/* @__PURE__ */ (0,
|
|
15792
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
15793
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
15307
15794
|
TableSortButton,
|
|
15308
15795
|
{
|
|
15309
15796
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15329,7 +15816,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15329
15816
|
}
|
|
15330
15817
|
}
|
|
15331
15818
|
) }),
|
|
15332
|
-
/* @__PURE__ */ (0,
|
|
15819
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
15333
15820
|
TableFilterButton,
|
|
15334
15821
|
{
|
|
15335
15822
|
column: header.column,
|
|
@@ -15341,7 +15828,7 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15341
15828
|
header.getContext()
|
|
15342
15829
|
)
|
|
15343
15830
|
] }) }),
|
|
15344
|
-
/* @__PURE__ */ (0,
|
|
15831
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
15345
15832
|
"div",
|
|
15346
15833
|
{
|
|
15347
15834
|
onPointerDown: (e) => {
|
|
@@ -15372,8 +15859,8 @@ var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
|
15372
15859
|
};
|
|
15373
15860
|
|
|
15374
15861
|
// src/components/layout/table/TableDisplay.tsx
|
|
15375
|
-
var
|
|
15376
|
-
var
|
|
15862
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
15863
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15377
15864
|
var TableDisplay = ({
|
|
15378
15865
|
children,
|
|
15379
15866
|
containerProps,
|
|
@@ -15383,43 +15870,47 @@ var TableDisplay = ({
|
|
|
15383
15870
|
const { table } = useTableDataContext();
|
|
15384
15871
|
const { containerRef } = useTableContainerContext();
|
|
15385
15872
|
const { sizeVars } = useTableHeaderContext();
|
|
15386
|
-
return /* @__PURE__ */ (0,
|
|
15873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ...containerProps, ref: containerRef, className: (0, import_clsx35.default)("table-container", containerProps?.className), children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
15387
15874
|
"table",
|
|
15388
15875
|
{
|
|
15389
15876
|
...props,
|
|
15390
|
-
className: (0,
|
|
15877
|
+
className: (0, import_clsx35.default)("table", props.className),
|
|
15391
15878
|
style: {
|
|
15392
15879
|
...sizeVars,
|
|
15393
15880
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15394
15881
|
},
|
|
15395
15882
|
children: [
|
|
15396
15883
|
children,
|
|
15397
|
-
/* @__PURE__ */ (0,
|
|
15398
|
-
/* @__PURE__ */ (0,
|
|
15884
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TableHeader, { ...tableHeaderProps }),
|
|
15885
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TableBody, {})
|
|
15399
15886
|
]
|
|
15400
15887
|
}
|
|
15401
15888
|
) });
|
|
15402
15889
|
};
|
|
15403
15890
|
|
|
15404
15891
|
// src/components/layout/table/TablePagination.tsx
|
|
15405
|
-
var
|
|
15406
|
-
var
|
|
15407
|
-
var
|
|
15408
|
-
var TablePaginationMenu = () => {
|
|
15892
|
+
var import_react70 = require("react");
|
|
15893
|
+
var import_clsx36 = __toESM(require("clsx"));
|
|
15894
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15895
|
+
var TablePaginationMenu = ({ ...props }) => {
|
|
15409
15896
|
const { table } = useTableDataContext();
|
|
15410
|
-
(0,
|
|
15897
|
+
(0, import_react70.useEffect)(() => {
|
|
15411
15898
|
const { pageIndex } = table.getState().pagination;
|
|
15412
15899
|
const pageCount = table.getPageCount();
|
|
15413
15900
|
if (pageIndex >= pageCount || pageIndex < 0) {
|
|
15414
15901
|
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15415
15902
|
}
|
|
15416
15903
|
}, [table]);
|
|
15417
|
-
return /* @__PURE__ */ (0,
|
|
15904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15418
15905
|
Pagination,
|
|
15419
15906
|
{
|
|
15907
|
+
...props,
|
|
15420
15908
|
pageIndex: table.getState().pagination.pageIndex,
|
|
15421
15909
|
pageCount: table.getPageCount(),
|
|
15422
|
-
onPageIndexChanged: (page) =>
|
|
15910
|
+
onPageIndexChanged: (page) => {
|
|
15911
|
+
table.setPageIndex(page);
|
|
15912
|
+
props.onPageIndexChanged?.(page);
|
|
15913
|
+
}
|
|
15423
15914
|
}
|
|
15424
15915
|
);
|
|
15425
15916
|
};
|
|
@@ -15430,92 +15921,21 @@ var TablePageSizeSelect = ({
|
|
|
15430
15921
|
}) => {
|
|
15431
15922
|
const { table } = useTableDataContext();
|
|
15432
15923
|
const currentPageSize = table.getState().pagination.pageSize;
|
|
15433
|
-
return /* @__PURE__ */ (0,
|
|
15924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15434
15925
|
Select,
|
|
15435
15926
|
{
|
|
15436
15927
|
...props,
|
|
15437
15928
|
value: currentPageSize.toString(),
|
|
15438
15929
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15439
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0,
|
|
15930
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SelectOption, { value: size.toString(), children: size }, size))
|
|
15440
15931
|
}
|
|
15441
15932
|
);
|
|
15442
15933
|
};
|
|
15443
15934
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15444
|
-
return /* @__PURE__ */ (0,
|
|
15445
|
-
/* @__PURE__ */ (0,
|
|
15446
|
-
/* @__PURE__ */ (0,
|
|
15447
|
-
] })
|
|
15448
|
-
};
|
|
15449
|
-
|
|
15450
|
-
// src/components/user-interaction/Checkbox.tsx
|
|
15451
|
-
var import_lucide_react19 = require("lucide-react");
|
|
15452
|
-
var import_react70 = require("react");
|
|
15453
|
-
var import_clsx36 = __toESM(require("clsx"));
|
|
15454
|
-
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15455
|
-
var Checkbox = ({
|
|
15456
|
-
value = false,
|
|
15457
|
-
indeterminate = false,
|
|
15458
|
-
required = false,
|
|
15459
|
-
invalid = false,
|
|
15460
|
-
disabled = false,
|
|
15461
|
-
readOnly = false,
|
|
15462
|
-
onValueChange,
|
|
15463
|
-
onEditComplete,
|
|
15464
|
-
size = "md",
|
|
15465
|
-
alwaysShowCheckIcon = false,
|
|
15466
|
-
...props
|
|
15467
|
-
}) => {
|
|
15468
|
-
const onChangeWrapper = (0, import_react70.useCallback)(() => {
|
|
15469
|
-
onValueChange?.(!value);
|
|
15470
|
-
onEditComplete?.(!value);
|
|
15471
|
-
}, [onEditComplete, onValueChange, value]);
|
|
15472
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
15473
|
-
"div",
|
|
15474
|
-
{
|
|
15475
|
-
...props,
|
|
15476
|
-
onClick: (event) => {
|
|
15477
|
-
if (!disabled) {
|
|
15478
|
-
onChangeWrapper();
|
|
15479
|
-
props.onClick?.(event);
|
|
15480
|
-
}
|
|
15481
|
-
},
|
|
15482
|
-
onKeyDown: (event) => {
|
|
15483
|
-
if (disabled) return;
|
|
15484
|
-
if (event.key === " " || event.key === "Enter") {
|
|
15485
|
-
event.preventDefault();
|
|
15486
|
-
onChangeWrapper();
|
|
15487
|
-
props.onKeyDown?.(event);
|
|
15488
|
-
}
|
|
15489
|
-
},
|
|
15490
|
-
"data-checked": !indeterminate ? value : "indeterminate",
|
|
15491
|
-
"data-size": size ?? void 0,
|
|
15492
|
-
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
15493
|
-
role: "checkbox",
|
|
15494
|
-
tabIndex: disabled ? -1 : 0,
|
|
15495
|
-
"aria-checked": indeterminate ? "mixed" : value,
|
|
15496
|
-
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15497
|
-
className: (0, import_clsx36.default)("checkbox", props.className),
|
|
15498
|
-
children: [
|
|
15499
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Minus, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15500
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Check, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
15501
|
-
]
|
|
15502
|
-
}
|
|
15503
|
-
);
|
|
15504
|
-
};
|
|
15505
|
-
var CheckboxUncontrolled = ({
|
|
15506
|
-
value: initialValue,
|
|
15507
|
-
onValueChange,
|
|
15508
|
-
...props
|
|
15509
|
-
}) => {
|
|
15510
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15511
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15512
|
-
Checkbox,
|
|
15513
|
-
{
|
|
15514
|
-
...props,
|
|
15515
|
-
value,
|
|
15516
|
-
onValueChange: setValue
|
|
15517
|
-
}
|
|
15518
|
-
);
|
|
15935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { ...props, className: (0, import_clsx36.default)("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
|
|
15936
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TablePaginationMenu, {}),
|
|
15937
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "h-10 min-w-24 max-w-24" } }) })
|
|
15938
|
+
] });
|
|
15519
15939
|
};
|
|
15520
15940
|
|
|
15521
15941
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
@@ -15531,6 +15951,7 @@ var TableWithSelectionProvider = ({
|
|
|
15531
15951
|
onRowClick,
|
|
15532
15952
|
...props
|
|
15533
15953
|
}) => {
|
|
15954
|
+
const translation = useHightideTranslation();
|
|
15534
15955
|
const columnDef = (0, import_react71.useMemo)(() => [
|
|
15535
15956
|
{
|
|
15536
15957
|
id: selectionRowId,
|
|
@@ -15563,10 +15984,13 @@ var TableWithSelectionProvider = ({
|
|
|
15563
15984
|
enableResizing: false,
|
|
15564
15985
|
enableSorting: false,
|
|
15565
15986
|
enableHiding: false,
|
|
15566
|
-
enableColumnFilter: false
|
|
15987
|
+
enableColumnFilter: false,
|
|
15988
|
+
meta: {
|
|
15989
|
+
columnLabel: translation("selection")
|
|
15990
|
+
}
|
|
15567
15991
|
},
|
|
15568
15992
|
...props.columns ?? []
|
|
15569
|
-
], [selectionRowId, props.columns]);
|
|
15993
|
+
], [selectionRowId, props.columns, translation]);
|
|
15570
15994
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15571
15995
|
TableProvider,
|
|
15572
15996
|
{
|
|
@@ -15785,6 +16209,10 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
15785
16209
|
};
|
|
15786
16210
|
const getColumnHeader = (columnId) => {
|
|
15787
16211
|
const column = table.getColumn(columnId);
|
|
16212
|
+
const columnLabel = column?.columnDef.meta?.columnLabel;
|
|
16213
|
+
if (columnLabel) {
|
|
16214
|
+
return columnLabel;
|
|
16215
|
+
}
|
|
15788
16216
|
const header = column?.columnDef.header;
|
|
15789
16217
|
if (typeof header === "string") {
|
|
15790
16218
|
return header;
|
|
@@ -16984,9 +17412,9 @@ var import_lucide_react29 = require("lucide-react");
|
|
|
16984
17412
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16985
17413
|
var NumberProperty = ({
|
|
16986
17414
|
value,
|
|
16987
|
-
onRemove,
|
|
16988
17415
|
onValueChange,
|
|
16989
17416
|
onEditComplete,
|
|
17417
|
+
onValueClear,
|
|
16990
17418
|
readOnly,
|
|
16991
17419
|
suffix,
|
|
16992
17420
|
...baseProps
|
|
@@ -16997,7 +17425,7 @@ var NumberProperty = ({
|
|
|
16997
17425
|
PropertyBase,
|
|
16998
17426
|
{
|
|
16999
17427
|
...baseProps,
|
|
17000
|
-
|
|
17428
|
+
onValueClear,
|
|
17001
17429
|
hasValue,
|
|
17002
17430
|
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react29.Binary, { size: 24 }),
|
|
17003
17431
|
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
@@ -17019,7 +17447,7 @@ var NumberProperty = ({
|
|
|
17019
17447
|
onValueChange: (value2) => {
|
|
17020
17448
|
const numberValue = parseFloat(value2);
|
|
17021
17449
|
if (isNaN(numberValue)) {
|
|
17022
|
-
|
|
17450
|
+
onValueClear();
|
|
17023
17451
|
} else {
|
|
17024
17452
|
onValueChange?.(numberValue);
|
|
17025
17453
|
}
|
|
@@ -17027,7 +17455,7 @@ var NumberProperty = ({
|
|
|
17027
17455
|
onEditComplete: (value2) => {
|
|
17028
17456
|
const numberValue = parseFloat(value2);
|
|
17029
17457
|
if (isNaN(numberValue)) {
|
|
17030
|
-
|
|
17458
|
+
onValueClear();
|
|
17031
17459
|
} else {
|
|
17032
17460
|
onEditComplete?.(numberValue);
|
|
17033
17461
|
}
|
|
@@ -17098,7 +17526,6 @@ var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
|
17098
17526
|
var TextProperty = ({
|
|
17099
17527
|
value,
|
|
17100
17528
|
readOnly,
|
|
17101
|
-
onRemove,
|
|
17102
17529
|
onValueChange,
|
|
17103
17530
|
onEditComplete,
|
|
17104
17531
|
...baseProps
|
|
@@ -17109,7 +17536,6 @@ var TextProperty = ({
|
|
|
17109
17536
|
PropertyBase,
|
|
17110
17537
|
{
|
|
17111
17538
|
...baseProps,
|
|
17112
|
-
onRemove,
|
|
17113
17539
|
hasValue,
|
|
17114
17540
|
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react31.Text, { size: 24 }),
|
|
17115
17541
|
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
@@ -17122,20 +17548,8 @@ var TextProperty = ({
|
|
|
17122
17548
|
value: value ?? "",
|
|
17123
17549
|
readOnly,
|
|
17124
17550
|
placeholder: translation("text"),
|
|
17125
|
-
onValueChange: (value2) =>
|
|
17126
|
-
|
|
17127
|
-
onRemove?.();
|
|
17128
|
-
} else {
|
|
17129
|
-
onValueChange?.(value2);
|
|
17130
|
-
}
|
|
17131
|
-
},
|
|
17132
|
-
onEditComplete: (value2) => {
|
|
17133
|
-
if (!value2) {
|
|
17134
|
-
onRemove?.();
|
|
17135
|
-
} else {
|
|
17136
|
-
onEditComplete?.(value2);
|
|
17137
|
-
}
|
|
17138
|
-
}
|
|
17551
|
+
onValueChange: (value2) => onValueChange?.(value2),
|
|
17552
|
+
onEditComplete: (value2) => onEditComplete?.(value2)
|
|
17139
17553
|
}
|
|
17140
17554
|
)
|
|
17141
17555
|
}
|
|
@@ -17745,6 +18159,7 @@ var PromiseUtils = {
|
|
|
17745
18159
|
DateTimePickerDialog,
|
|
17746
18160
|
DateTimePickerUncontrolled,
|
|
17747
18161
|
DateUtils,
|
|
18162
|
+
DatetimeFilter,
|
|
17748
18163
|
DayPicker,
|
|
17749
18164
|
DayPickerUncontrolled,
|
|
17750
18165
|
Dialog,
|
|
@@ -17880,6 +18295,7 @@ var PromiseUtils = {
|
|
|
17880
18295
|
TableWithSelectionProvider,
|
|
17881
18296
|
TagIcon,
|
|
17882
18297
|
TagsFilter,
|
|
18298
|
+
TagsSingleFilter,
|
|
17883
18299
|
TextFilter,
|
|
17884
18300
|
TextImage,
|
|
17885
18301
|
TextProperty,
|
|
@@ -17909,6 +18325,14 @@ var PromiseUtils = {
|
|
|
17909
18325
|
createLoopingList,
|
|
17910
18326
|
createLoopingListWithIndex,
|
|
17911
18327
|
equalSizeGroups,
|
|
18328
|
+
filterBoolean,
|
|
18329
|
+
filterDate,
|
|
18330
|
+
filterDatetime,
|
|
18331
|
+
filterGeneric,
|
|
18332
|
+
filterNumber,
|
|
18333
|
+
filterTags,
|
|
18334
|
+
filterTagsSingle,
|
|
18335
|
+
filterText,
|
|
17912
18336
|
formatDate,
|
|
17913
18337
|
formatDateTime,
|
|
17914
18338
|
getBetweenDuration,
|