@helpwave/hightide 0.1.8 → 0.1.10
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/components/date/DatePicker.d.mts +3 -4
- package/dist/components/date/DatePicker.d.ts +3 -4
- package/dist/components/date/DatePicker.js +125 -13
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +125 -13
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.d.mts +5 -19
- package/dist/components/date/TimeDisplay.d.ts +5 -19
- package/dist/components/date/TimeDisplay.js +129 -37
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +129 -37
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.d.mts +2 -5
- package/dist/components/dialogs/ConfirmDialog.d.ts +2 -5
- package/dist/components/dialogs/ConfirmDialog.js +163 -23
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +163 -23
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.d.mts +2 -3
- package/dist/components/layout-and-navigation/Overlay.d.ts +2 -3
- package/dist/components/layout-and-navigation/Overlay.js +158 -10
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +158 -10
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.d.mts +2 -3
- package/dist/components/layout-and-navigation/Pagination.d.ts +2 -3
- package/dist/components/layout-and-navigation/Pagination.js +153 -13
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +153 -13
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +3 -2
- package/dist/components/layout-and-navigation/SearchableList.d.ts +3 -2
- package/dist/components/layout-and-navigation/SearchableList.js +157 -11
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +157 -11
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.d.mts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.d.ts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.js +153 -15
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +153 -15
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +153 -13
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +153 -13
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.d.mts +3 -4
- package/dist/components/layout-and-navigation/TextImage.d.ts +3 -4
- package/dist/components/layout-and-navigation/TextImage.js +161 -19
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +161 -19
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +56 -8
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +56 -8
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js +155 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +155 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.d.mts +2 -3
- package/dist/components/loading-states/LoadingAnimation.d.ts +2 -3
- package/dist/components/loading-states/LoadingAnimation.js +153 -13
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +153 -13
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.d.mts +2 -5
- package/dist/components/modals/ConfirmModal.d.ts +2 -5
- package/dist/components/modals/ConfirmModal.js +164 -26
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +164 -26
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.d.mts +2 -7
- package/dist/components/modals/DiscardChangesModal.d.ts +2 -7
- package/dist/components/modals/DiscardChangesModal.js +168 -46
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +168 -46
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.d.mts +1 -0
- package/dist/components/modals/InputModal.d.ts +1 -0
- package/dist/components/modals/InputModal.js +164 -26
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +164 -26
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.d.mts +3 -2
- package/dist/components/modals/LanguageModal.d.ts +3 -2
- package/dist/components/modals/LanguageModal.js +170 -24
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +170 -24
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.d.mts +5 -5
- package/dist/components/modals/ThemeModal.d.ts +5 -5
- package/dist/components/modals/ThemeModal.js +178 -30
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +178 -30
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.d.mts +3 -5
- package/dist/components/properties/CheckboxProperty.d.ts +3 -5
- package/dist/components/properties/CheckboxProperty.js +155 -25
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +155 -25
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.d.mts +1 -0
- package/dist/components/properties/DateProperty.d.ts +1 -0
- package/dist/components/properties/DateProperty.js +153 -13
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +153 -13
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +4 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +4 -5
- package/dist/components/properties/MultiSelectProperty.js +169 -43
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +169 -43
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.d.mts +1 -0
- package/dist/components/properties/NumberProperty.d.ts +1 -0
- package/dist/components/properties/NumberProperty.js +155 -15
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +155 -15
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.d.mts +2 -3
- package/dist/components/properties/PropertyBase.d.ts +2 -3
- package/dist/components/properties/PropertyBase.js +153 -13
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +153 -13
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +2 -3
- package/dist/components/properties/SelectProperty.d.ts +2 -3
- package/dist/components/properties/SelectProperty.js +159 -29
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +159 -29
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.d.mts +2 -1
- package/dist/components/properties/TextProperty.d.ts +2 -1
- package/dist/components/properties/TextProperty.js +157 -17
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +157 -17
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.d.mts +4 -20
- package/dist/components/user-action/DateAndTimePicker.d.ts +4 -20
- package/dist/components/user-action/DateAndTimePicker.js +223 -51
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +223 -51
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.js +1 -1
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +1 -1
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +5 -9
- package/dist/components/user-action/MultiSelect.d.ts +5 -9
- package/dist/components/user-action/MultiSelect.js +165 -23
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +165 -23
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.js +158 -12
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +158 -12
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/css/globals.css +13 -4
- package/dist/css/uncompiled/globals.css +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +345 -303
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -303
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +54 -0
- package/dist/localization/defaults/form.d.ts +54 -0
- package/dist/localization/defaults/form.js +127 -0
- package/dist/localization/defaults/form.js.map +1 -0
- package/dist/localization/defaults/form.mjs +103 -0
- package/dist/localization/defaults/form.mjs.map +1 -0
- package/dist/localization/defaults/time.d.mts +39 -0
- package/dist/localization/defaults/time.d.ts +39 -0
- package/dist/localization/defaults/time.js +101 -0
- package/dist/localization/defaults/time.js.map +1 -0
- package/dist/localization/defaults/time.mjs +76 -0
- package/dist/localization/defaults/time.mjs.map +1 -0
- package/dist/localization/useTranslation.d.mts +38 -6
- package/dist/localization/useTranslation.d.ts +38 -6
- package/dist/localization/useTranslation.js +56 -6
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +55 -6
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/theming/useTheme.d.mts +4 -2
- package/dist/theming/useTheme.d.ts +4 -2
- package/dist/theming/useTheme.js +10 -2
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +10 -2
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -30,15 +30,63 @@ var LanguageContext = createContext({
|
|
|
30
30
|
var useLanguage = () => useContext(LanguageContext);
|
|
31
31
|
|
|
32
32
|
// src/localization/useTranslation.ts
|
|
33
|
-
var
|
|
34
|
-
|
|
33
|
+
var TranslationPluralCount = {
|
|
34
|
+
zero: 0,
|
|
35
|
+
one: 1,
|
|
36
|
+
two: 2,
|
|
37
|
+
few: 3,
|
|
38
|
+
many: 11,
|
|
39
|
+
other: -1
|
|
40
|
+
};
|
|
41
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
42
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
35
43
|
const { language: inferredLanguage } = useLanguage();
|
|
36
44
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
37
|
-
|
|
38
|
-
if (overwrite
|
|
39
|
-
|
|
45
|
+
const usedTranslations = [...translations];
|
|
46
|
+
if (overwrite) {
|
|
47
|
+
usedTranslations.push(overwrite);
|
|
40
48
|
}
|
|
41
|
-
return
|
|
49
|
+
return (key, options) => {
|
|
50
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
51
|
+
try {
|
|
52
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
53
|
+
const translation = translations[i];
|
|
54
|
+
const localizedTranslation = translation[usedLanguage];
|
|
55
|
+
if (!localizedTranslation) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const value = localizedTranslation[key];
|
|
59
|
+
if (!value) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
let forProcessing;
|
|
63
|
+
if (typeof value !== "string") {
|
|
64
|
+
if (count === TranslationPluralCount.zero && value?.zero) {
|
|
65
|
+
forProcessing = value.zero;
|
|
66
|
+
} else if (count === TranslationPluralCount.one && value?.one) {
|
|
67
|
+
forProcessing = value.one;
|
|
68
|
+
} else if (count === TranslationPluralCount.two && value?.two) {
|
|
69
|
+
forProcessing = value.two;
|
|
70
|
+
} else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
|
|
71
|
+
forProcessing = value.few;
|
|
72
|
+
} else if (count > TranslationPluralCount.many && value?.many) {
|
|
73
|
+
forProcessing = value.many;
|
|
74
|
+
} else {
|
|
75
|
+
forProcessing = value.other;
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
forProcessing = value;
|
|
79
|
+
}
|
|
80
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
81
|
+
return replacements[placeholder] ?? `{{key:${placeholder}}}`;
|
|
82
|
+
});
|
|
83
|
+
return forProcessing;
|
|
84
|
+
}
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error(e);
|
|
87
|
+
}
|
|
88
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
89
|
+
};
|
|
42
90
|
};
|
|
43
91
|
|
|
44
92
|
// src/components/user-action/MultiSelect.tsx
|
|
@@ -436,15 +484,113 @@ var useSearch = ({
|
|
|
436
484
|
};
|
|
437
485
|
};
|
|
438
486
|
|
|
487
|
+
// src/localization/defaults/form.ts
|
|
488
|
+
var formTranslation = {
|
|
489
|
+
en: {
|
|
490
|
+
all: "All",
|
|
491
|
+
back: "Back",
|
|
492
|
+
cancel: "Cancel",
|
|
493
|
+
change: "Change",
|
|
494
|
+
clear: "Clear",
|
|
495
|
+
close: "Close",
|
|
496
|
+
confirm: "Confirm",
|
|
497
|
+
decline: "Decline",
|
|
498
|
+
delete: "Delete",
|
|
499
|
+
discard: "Discard",
|
|
500
|
+
discardChanges: "Discard Changes",
|
|
501
|
+
done: "Done",
|
|
502
|
+
edit: "Edit",
|
|
503
|
+
enterText: "Enter text here",
|
|
504
|
+
error: "Error",
|
|
505
|
+
exit: "Exit",
|
|
506
|
+
fieldRequiredError: "This field is required.",
|
|
507
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
508
|
+
less: "Less",
|
|
509
|
+
loading: "Loading",
|
|
510
|
+
maxLengthError: "Maximum length exceeded.",
|
|
511
|
+
minLengthError: "Minimum length not met.",
|
|
512
|
+
more: "More",
|
|
513
|
+
next: "Next",
|
|
514
|
+
no: "No",
|
|
515
|
+
none: "None",
|
|
516
|
+
of: "of",
|
|
517
|
+
optional: "Optional",
|
|
518
|
+
pleaseWait: "Please wait...",
|
|
519
|
+
previous: "Previous",
|
|
520
|
+
remove: "Remove",
|
|
521
|
+
required: "Required",
|
|
522
|
+
reset: "Reset",
|
|
523
|
+
save: "Save",
|
|
524
|
+
search: "Search",
|
|
525
|
+
select: "Select",
|
|
526
|
+
selectOption: "Select an option",
|
|
527
|
+
show: "Show",
|
|
528
|
+
showMore: "Show more",
|
|
529
|
+
showLess: "Show less",
|
|
530
|
+
submit: "Submit",
|
|
531
|
+
success: "Success",
|
|
532
|
+
update: "Update",
|
|
533
|
+
unsavedChanges: "Unsaved Changes",
|
|
534
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
535
|
+
yes: "Yes"
|
|
536
|
+
},
|
|
537
|
+
de: {
|
|
538
|
+
all: "Alle",
|
|
539
|
+
back: "Zur\xFCck",
|
|
540
|
+
cancel: "Abbrechen",
|
|
541
|
+
change: "\xC4ndern",
|
|
542
|
+
clear: "L\xF6schen",
|
|
543
|
+
close: "Schlie\xDFen",
|
|
544
|
+
confirm: "Best\xE4tigen",
|
|
545
|
+
decline: "Ablehnen",
|
|
546
|
+
delete: "L\xF6schen",
|
|
547
|
+
discard: "Verwerfen",
|
|
548
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
549
|
+
done: "Fertig",
|
|
550
|
+
edit: "Bearbeiten",
|
|
551
|
+
enterText: "Text hier eingeben",
|
|
552
|
+
error: "Fehler",
|
|
553
|
+
exit: "Beenden",
|
|
554
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
555
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
556
|
+
less: "Weniger",
|
|
557
|
+
loading: "L\xE4dt",
|
|
558
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
559
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
560
|
+
more: "Mehr",
|
|
561
|
+
next: "Weiter",
|
|
562
|
+
no: "Nein",
|
|
563
|
+
none: "Nichts",
|
|
564
|
+
of: "von",
|
|
565
|
+
optional: "Optional",
|
|
566
|
+
pleaseWait: "Bitte warten...",
|
|
567
|
+
previous: "Vorherige",
|
|
568
|
+
remove: "Entfernen",
|
|
569
|
+
required: "Erforderlich",
|
|
570
|
+
reset: "Zur\xFCcksetzen",
|
|
571
|
+
save: "Speichern",
|
|
572
|
+
search: "Suche",
|
|
573
|
+
select: "Select",
|
|
574
|
+
selectOption: "Option ausw\xE4hlen",
|
|
575
|
+
show: "Anzeigen",
|
|
576
|
+
showMore: "Mehr anzeigen",
|
|
577
|
+
showLess: "Weniger anzeigen",
|
|
578
|
+
submit: "Abschicken",
|
|
579
|
+
success: "Erfolg",
|
|
580
|
+
update: "Update",
|
|
581
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
582
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
583
|
+
yes: "Ja"
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
|
|
439
587
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
440
588
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
441
589
|
var defaultSearchableListTranslation = {
|
|
442
590
|
en: {
|
|
443
|
-
search: "Search",
|
|
444
591
|
nothingFound: "Nothing found"
|
|
445
592
|
},
|
|
446
593
|
de: {
|
|
447
|
-
search: "Suche",
|
|
448
594
|
nothingFound: "Nichts gefunden"
|
|
449
595
|
}
|
|
450
596
|
};
|
|
@@ -459,7 +605,7 @@ var SearchableList = ({
|
|
|
459
605
|
className,
|
|
460
606
|
resultListClassName
|
|
461
607
|
}) => {
|
|
462
|
-
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
608
|
+
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
463
609
|
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
464
610
|
return /* @__PURE__ */ jsxs3("div", { className: clsx4("col gap-y-2", className), children: [
|
|
465
611
|
list.length > minimumItemsForSearch && /* @__PURE__ */ jsxs3("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
@@ -468,14 +614,14 @@ var SearchableList = ({
|
|
|
468
614
|
{
|
|
469
615
|
value: search,
|
|
470
616
|
onChangeText: setSearch,
|
|
471
|
-
placeholder: translation
|
|
617
|
+
placeholder: translation("search"),
|
|
472
618
|
autoFocus,
|
|
473
619
|
className: "w-full"
|
|
474
620
|
}
|
|
475
621
|
),
|
|
476
622
|
/* @__PURE__ */ jsx5(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ jsx5(Search, { className: "w-full h-full" }) })
|
|
477
623
|
] }),
|
|
478
|
-
hasResult ? /* @__PURE__ */ jsx5("div", { className: clsx4("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ jsx5("div", { className: "row text-description py-2 px-2", children: translation
|
|
624
|
+
hasResult ? /* @__PURE__ */ jsx5("div", { className: clsx4("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ jsx5("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
479
625
|
] });
|
|
480
626
|
};
|
|
481
627
|
|
|
@@ -610,14 +756,10 @@ var useOutsideClick = (refs, handler) => {
|
|
|
610
756
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
611
757
|
var defaultMultiSelectTranslation = {
|
|
612
758
|
en: {
|
|
613
|
-
|
|
614
|
-
search: "Search",
|
|
615
|
-
selected: "selected"
|
|
759
|
+
selected: `{{amount}} selected`
|
|
616
760
|
},
|
|
617
761
|
de: {
|
|
618
|
-
|
|
619
|
-
search: "Suche",
|
|
620
|
-
selected: "ausgew\xE4hlt"
|
|
762
|
+
selected: `{{amount}} ausgew\xE4hlt`
|
|
621
763
|
}
|
|
622
764
|
};
|
|
623
765
|
var MultiSelect = ({
|
|
@@ -632,7 +774,7 @@ var MultiSelect = ({
|
|
|
632
774
|
useChipDisplay = false,
|
|
633
775
|
className = ""
|
|
634
776
|
}) => {
|
|
635
|
-
const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
|
|
777
|
+
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
636
778
|
const triggerRef = useRef2(null);
|
|
637
779
|
const menuRef = useRef2(null);
|
|
638
780
|
const [isOpen, setIsOpen] = useState6(false);
|
|
@@ -665,8 +807,8 @@ var MultiSelect = ({
|
|
|
665
807
|
onClick: () => setIsOpen(!isOpen),
|
|
666
808
|
disabled: isDisabled,
|
|
667
809
|
children: [
|
|
668
|
-
!isShowingHint && /* @__PURE__ */ jsx8("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ jsx8(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) :
|
|
669
|
-
isShowingHint && /* @__PURE__ */ jsx8("span", { className: "textstyle-description", children: hintText ?? translation
|
|
810
|
+
!isShowingHint && /* @__PURE__ */ jsx8("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ jsx8(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
|
|
811
|
+
isShowingHint && /* @__PURE__ */ jsx8("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
670
812
|
isOpen ? /* @__PURE__ */ jsx8(ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ jsx8(ChevronDown, { className: "min-w-6" })
|
|
671
813
|
]
|
|
672
814
|
}
|
|
@@ -675,7 +817,7 @@ var MultiSelect = ({
|
|
|
675
817
|
"div",
|
|
676
818
|
{
|
|
677
819
|
ref: menuRef,
|
|
678
|
-
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-
|
|
820
|
+
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
|
|
679
821
|
children: [
|
|
680
822
|
/* @__PURE__ */ jsx8(
|
|
681
823
|
SearchableList,
|
|
@@ -716,7 +858,7 @@ var MultiSelect = ({
|
|
|
716
858
|
})));
|
|
717
859
|
},
|
|
718
860
|
disabled: options.every((value) => value.selected || value.disabled),
|
|
719
|
-
children: "
|
|
861
|
+
children: translation("all")
|
|
720
862
|
}
|
|
721
863
|
),
|
|
722
864
|
/* @__PURE__ */ jsx8(
|
|
@@ -730,7 +872,7 @@ var MultiSelect = ({
|
|
|
730
872
|
selected: false
|
|
731
873
|
})));
|
|
732
874
|
},
|
|
733
|
-
children: "
|
|
875
|
+
children: translation("none")
|
|
734
876
|
}
|
|
735
877
|
)
|
|
736
878
|
] }),
|
|
@@ -747,14 +889,6 @@ var MultiSelect = ({
|
|
|
747
889
|
import { AlertTriangle } from "lucide-react";
|
|
748
890
|
import clsx8 from "clsx";
|
|
749
891
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
750
|
-
var defaultPropertyBaseTranslation = {
|
|
751
|
-
en: {
|
|
752
|
-
remove: "Remove"
|
|
753
|
-
},
|
|
754
|
-
de: {
|
|
755
|
-
remove: "Entfernen"
|
|
756
|
-
}
|
|
757
|
-
};
|
|
758
892
|
var PropertyBase = ({
|
|
759
893
|
overwriteTranslation,
|
|
760
894
|
name,
|
|
@@ -766,7 +900,7 @@ var PropertyBase = ({
|
|
|
766
900
|
onRemove,
|
|
767
901
|
className = ""
|
|
768
902
|
}) => {
|
|
769
|
-
const translation = useTranslation(
|
|
903
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
770
904
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
771
905
|
return /* @__PURE__ */ jsxs7("div", { className: clsx8("row gap-x-0 group", className), children: [
|
|
772
906
|
/* @__PURE__ */ jsxs7(
|
|
@@ -799,7 +933,7 @@ var PropertyBase = ({
|
|
|
799
933
|
color: "negative",
|
|
800
934
|
className: clsx8("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
801
935
|
disabled: !hasValue || readOnly,
|
|
802
|
-
children: translation
|
|
936
|
+
children: translation("remove")
|
|
803
937
|
}
|
|
804
938
|
)
|
|
805
939
|
]
|
|
@@ -810,14 +944,6 @@ var PropertyBase = ({
|
|
|
810
944
|
|
|
811
945
|
// src/components/properties/MultiSelectProperty.tsx
|
|
812
946
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
813
|
-
var defaultMultiSelectPropertyTranslation = {
|
|
814
|
-
en: {
|
|
815
|
-
select: "Select"
|
|
816
|
-
},
|
|
817
|
-
de: {
|
|
818
|
-
select: "Ausw\xE4hlen"
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
947
|
var MultiSelectProperty = ({
|
|
822
948
|
overwriteTranslation,
|
|
823
949
|
options,
|
|
@@ -827,7 +953,7 @@ var MultiSelectProperty = ({
|
|
|
827
953
|
onRemove,
|
|
828
954
|
...multiSelectProps
|
|
829
955
|
}) => {
|
|
830
|
-
const translation = useTranslation(
|
|
956
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
831
957
|
const hasValue = options.some((value) => value.selected);
|
|
832
958
|
return /* @__PURE__ */ jsx10(
|
|
833
959
|
PropertyBase,
|
|
@@ -850,7 +976,7 @@ var MultiSelectProperty = ({
|
|
|
850
976
|
options,
|
|
851
977
|
isDisabled: readOnly,
|
|
852
978
|
useChipDisplay: true,
|
|
853
|
-
hintText: `${translation
|
|
979
|
+
hintText: `${translation("select")}...`
|
|
854
980
|
}
|
|
855
981
|
)
|
|
856
982
|
}
|