@helpwave/hightide 0.1.8 → 0.1.9
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 +117 -13
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +117 -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 +121 -37
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +121 -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 +155 -23
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +155 -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 +150 -10
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +150 -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 +145 -13
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +145 -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 +149 -11
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +149 -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 +145 -15
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +145 -15
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +145 -13
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +145 -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 +153 -19
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +153 -19
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +48 -8
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +48 -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 +147 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +147 -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 +145 -13
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +145 -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 +156 -26
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +156 -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 +160 -46
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +160 -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 +156 -26
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +156 -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 +161 -23
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +161 -23
- 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 +169 -29
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +169 -29
- 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 +147 -25
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +147 -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 +145 -13
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +145 -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 +160 -42
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +160 -42
- 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 +147 -15
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +147 -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 +145 -13
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +145 -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 +150 -28
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +150 -28
- 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 +149 -17
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +149 -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 +215 -51
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +215 -51
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +4 -8
- package/dist/components/user-action/MultiSelect.d.ts +4 -8
- package/dist/components/user-action/MultiSelect.js +156 -22
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +156 -22
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.js +149 -11
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +149 -11
- 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 +332 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -300
- 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 +30 -6
- package/dist/localization/useTranslation.d.ts +30 -6
- package/dist/localization/useTranslation.js +46 -6
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +46 -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,55 @@ var LanguageContext = createContext({
|
|
|
30
30
|
var useLanguage = () => useContext(LanguageContext);
|
|
31
31
|
|
|
32
32
|
// src/localization/useTranslation.ts
|
|
33
|
-
var useTranslation = (
|
|
34
|
-
const { language: languageProp, translation: overwrite } =
|
|
33
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
34
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
35
35
|
const { language: inferredLanguage } = useLanguage();
|
|
36
36
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
37
|
-
|
|
38
|
-
if (overwrite
|
|
39
|
-
|
|
37
|
+
const usedTranslations = [...translations];
|
|
38
|
+
if (overwrite) {
|
|
39
|
+
usedTranslations.push(overwrite);
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return (key, options) => {
|
|
42
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
43
|
+
try {
|
|
44
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
45
|
+
const translation = translations[i];
|
|
46
|
+
const localizedTranslation = translation[usedLanguage];
|
|
47
|
+
if (!localizedTranslation) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const value = localizedTranslation[key];
|
|
51
|
+
if (!value) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
let forProcessing;
|
|
55
|
+
if (typeof value !== "string") {
|
|
56
|
+
if (count <= 0 && value?.zero) {
|
|
57
|
+
forProcessing = value.zero;
|
|
58
|
+
} else if (count === 1 && value?.one) {
|
|
59
|
+
forProcessing = value.one;
|
|
60
|
+
} else if (count === 2 && value?.two) {
|
|
61
|
+
forProcessing = value.two;
|
|
62
|
+
} else if (count <= 10 && value?.few) {
|
|
63
|
+
forProcessing = value.few;
|
|
64
|
+
} else if (count > 10 && value?.many) {
|
|
65
|
+
forProcessing = value.many;
|
|
66
|
+
} else {
|
|
67
|
+
forProcessing = value.other;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
forProcessing = value;
|
|
71
|
+
}
|
|
72
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
73
|
+
return replacements[placeholder] ?? `{{${placeholder}}}`;
|
|
74
|
+
});
|
|
75
|
+
return forProcessing;
|
|
76
|
+
}
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.error(e);
|
|
79
|
+
}
|
|
80
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
81
|
+
};
|
|
42
82
|
};
|
|
43
83
|
|
|
44
84
|
// src/components/user-action/MultiSelect.tsx
|
|
@@ -436,15 +476,113 @@ var useSearch = ({
|
|
|
436
476
|
};
|
|
437
477
|
};
|
|
438
478
|
|
|
479
|
+
// src/localization/defaults/form.ts
|
|
480
|
+
var formTranslation = {
|
|
481
|
+
en: {
|
|
482
|
+
all: "All",
|
|
483
|
+
back: "Back",
|
|
484
|
+
cancel: "Cancel",
|
|
485
|
+
change: "Change",
|
|
486
|
+
clear: "Clear",
|
|
487
|
+
close: "Close",
|
|
488
|
+
confirm: "Confirm",
|
|
489
|
+
decline: "Decline",
|
|
490
|
+
delete: "Delete",
|
|
491
|
+
discard: "Discard",
|
|
492
|
+
discardChanges: "Discard Changes",
|
|
493
|
+
done: "Done",
|
|
494
|
+
edit: "Edit",
|
|
495
|
+
enterText: "Enter text here",
|
|
496
|
+
error: "Error",
|
|
497
|
+
exit: "Exit",
|
|
498
|
+
fieldRequiredError: "This field is required.",
|
|
499
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
500
|
+
less: "Less",
|
|
501
|
+
loading: "Loading",
|
|
502
|
+
maxLengthError: "Maximum length exceeded.",
|
|
503
|
+
minLengthError: "Minimum length not met.",
|
|
504
|
+
more: "More",
|
|
505
|
+
next: "Next",
|
|
506
|
+
no: "No",
|
|
507
|
+
none: "None",
|
|
508
|
+
of: "of",
|
|
509
|
+
optional: "Optional",
|
|
510
|
+
pleaseWait: "Please wait...",
|
|
511
|
+
previous: "Previous",
|
|
512
|
+
remove: "Remove",
|
|
513
|
+
required: "Required",
|
|
514
|
+
reset: "Reset",
|
|
515
|
+
save: "Save",
|
|
516
|
+
search: "Search",
|
|
517
|
+
select: "Select",
|
|
518
|
+
selectOption: "Select an option",
|
|
519
|
+
show: "Show",
|
|
520
|
+
showMore: "Show more",
|
|
521
|
+
showLess: "Show less",
|
|
522
|
+
submit: "Submit",
|
|
523
|
+
success: "Success",
|
|
524
|
+
update: "Update",
|
|
525
|
+
unsavedChanges: "Unsaved Changes",
|
|
526
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
527
|
+
yes: "Yes"
|
|
528
|
+
},
|
|
529
|
+
de: {
|
|
530
|
+
all: "Alle",
|
|
531
|
+
back: "Zur\xFCck",
|
|
532
|
+
cancel: "Abbrechen",
|
|
533
|
+
change: "\xC4ndern",
|
|
534
|
+
clear: "L\xF6schen",
|
|
535
|
+
close: "Schlie\xDFen",
|
|
536
|
+
confirm: "Best\xE4tigen",
|
|
537
|
+
decline: "Ablehnen",
|
|
538
|
+
delete: "L\xF6schen",
|
|
539
|
+
discard: "Verwerfen",
|
|
540
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
541
|
+
done: "Fertig",
|
|
542
|
+
edit: "Bearbeiten",
|
|
543
|
+
enterText: "Text hier eingeben",
|
|
544
|
+
error: "Fehler",
|
|
545
|
+
exit: "Beenden",
|
|
546
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
547
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
548
|
+
less: "Weniger",
|
|
549
|
+
loading: "L\xE4dt",
|
|
550
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
551
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
552
|
+
more: "Mehr",
|
|
553
|
+
next: "Weiter",
|
|
554
|
+
no: "Nein",
|
|
555
|
+
none: "Nichts",
|
|
556
|
+
of: "von",
|
|
557
|
+
optional: "Optional",
|
|
558
|
+
pleaseWait: "Bitte warten...",
|
|
559
|
+
previous: "Vorherige",
|
|
560
|
+
remove: "Entfernen",
|
|
561
|
+
required: "Erforderlich",
|
|
562
|
+
reset: "Zur\xFCcksetzen",
|
|
563
|
+
save: "Speichern",
|
|
564
|
+
search: "Suche",
|
|
565
|
+
select: "Select",
|
|
566
|
+
selectOption: "Option ausw\xE4hlen",
|
|
567
|
+
show: "Anzeigen",
|
|
568
|
+
showMore: "Mehr anzeigen",
|
|
569
|
+
showLess: "Weniger anzeigen",
|
|
570
|
+
submit: "Abschicken",
|
|
571
|
+
success: "Erfolg",
|
|
572
|
+
update: "Update",
|
|
573
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
574
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
575
|
+
yes: "Ja"
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
|
|
439
579
|
// src/components/layout-and-navigation/SearchableList.tsx
|
|
440
580
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
441
581
|
var defaultSearchableListTranslation = {
|
|
442
582
|
en: {
|
|
443
|
-
search: "Search",
|
|
444
583
|
nothingFound: "Nothing found"
|
|
445
584
|
},
|
|
446
585
|
de: {
|
|
447
|
-
search: "Suche",
|
|
448
586
|
nothingFound: "Nichts gefunden"
|
|
449
587
|
}
|
|
450
588
|
};
|
|
@@ -459,7 +597,7 @@ var SearchableList = ({
|
|
|
459
597
|
className,
|
|
460
598
|
resultListClassName
|
|
461
599
|
}) => {
|
|
462
|
-
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
600
|
+
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
463
601
|
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
464
602
|
return /* @__PURE__ */ jsxs3("div", { className: clsx4("col gap-y-2", className), children: [
|
|
465
603
|
list.length > minimumItemsForSearch && /* @__PURE__ */ jsxs3("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
@@ -468,14 +606,14 @@ var SearchableList = ({
|
|
|
468
606
|
{
|
|
469
607
|
value: search,
|
|
470
608
|
onChangeText: setSearch,
|
|
471
|
-
placeholder: translation
|
|
609
|
+
placeholder: translation("search"),
|
|
472
610
|
autoFocus,
|
|
473
611
|
className: "w-full"
|
|
474
612
|
}
|
|
475
613
|
),
|
|
476
614
|
/* @__PURE__ */ jsx5(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ jsx5(Search, { className: "w-full h-full" }) })
|
|
477
615
|
] }),
|
|
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
|
|
616
|
+
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
617
|
] });
|
|
480
618
|
};
|
|
481
619
|
|
|
@@ -610,14 +748,10 @@ var useOutsideClick = (refs, handler) => {
|
|
|
610
748
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
611
749
|
var defaultMultiSelectTranslation = {
|
|
612
750
|
en: {
|
|
613
|
-
|
|
614
|
-
search: "Search",
|
|
615
|
-
selected: "selected"
|
|
751
|
+
selected: `{{amount}} selected`
|
|
616
752
|
},
|
|
617
753
|
de: {
|
|
618
|
-
|
|
619
|
-
search: "Suche",
|
|
620
|
-
selected: "ausgew\xE4hlt"
|
|
754
|
+
selected: `{{amount}} ausgew\xE4hlt`
|
|
621
755
|
}
|
|
622
756
|
};
|
|
623
757
|
var MultiSelect = ({
|
|
@@ -632,7 +766,7 @@ var MultiSelect = ({
|
|
|
632
766
|
useChipDisplay = false,
|
|
633
767
|
className = ""
|
|
634
768
|
}) => {
|
|
635
|
-
const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
|
|
769
|
+
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
636
770
|
const triggerRef = useRef2(null);
|
|
637
771
|
const menuRef = useRef2(null);
|
|
638
772
|
const [isOpen, setIsOpen] = useState6(false);
|
|
@@ -665,8 +799,8 @@ var MultiSelect = ({
|
|
|
665
799
|
onClick: () => setIsOpen(!isOpen),
|
|
666
800
|
disabled: isDisabled,
|
|
667
801
|
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
|
|
802
|
+
!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() } })) }),
|
|
803
|
+
isShowingHint && /* @__PURE__ */ jsx8("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
670
804
|
isOpen ? /* @__PURE__ */ jsx8(ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ jsx8(ChevronDown, { className: "min-w-6" })
|
|
671
805
|
]
|
|
672
806
|
}
|
|
@@ -716,7 +850,7 @@ var MultiSelect = ({
|
|
|
716
850
|
})));
|
|
717
851
|
},
|
|
718
852
|
disabled: options.every((value) => value.selected || value.disabled),
|
|
719
|
-
children: "
|
|
853
|
+
children: translation("all")
|
|
720
854
|
}
|
|
721
855
|
),
|
|
722
856
|
/* @__PURE__ */ jsx8(
|
|
@@ -730,7 +864,7 @@ var MultiSelect = ({
|
|
|
730
864
|
selected: false
|
|
731
865
|
})));
|
|
732
866
|
},
|
|
733
|
-
children: "
|
|
867
|
+
children: translation("none")
|
|
734
868
|
}
|
|
735
869
|
)
|
|
736
870
|
] }),
|
|
@@ -747,14 +881,6 @@ var MultiSelect = ({
|
|
|
747
881
|
import { AlertTriangle } from "lucide-react";
|
|
748
882
|
import clsx8 from "clsx";
|
|
749
883
|
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
884
|
var PropertyBase = ({
|
|
759
885
|
overwriteTranslation,
|
|
760
886
|
name,
|
|
@@ -766,7 +892,7 @@ var PropertyBase = ({
|
|
|
766
892
|
onRemove,
|
|
767
893
|
className = ""
|
|
768
894
|
}) => {
|
|
769
|
-
const translation = useTranslation(
|
|
895
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
770
896
|
const requiredAndNoValue = softRequired && !hasValue;
|
|
771
897
|
return /* @__PURE__ */ jsxs7("div", { className: clsx8("row gap-x-0 group", className), children: [
|
|
772
898
|
/* @__PURE__ */ jsxs7(
|
|
@@ -799,7 +925,7 @@ var PropertyBase = ({
|
|
|
799
925
|
color: "negative",
|
|
800
926
|
className: clsx8("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
801
927
|
disabled: !hasValue || readOnly,
|
|
802
|
-
children: translation
|
|
928
|
+
children: translation("remove")
|
|
803
929
|
}
|
|
804
930
|
)
|
|
805
931
|
]
|
|
@@ -810,14 +936,6 @@ var PropertyBase = ({
|
|
|
810
936
|
|
|
811
937
|
// src/components/properties/MultiSelectProperty.tsx
|
|
812
938
|
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
939
|
var MultiSelectProperty = ({
|
|
822
940
|
overwriteTranslation,
|
|
823
941
|
options,
|
|
@@ -827,7 +945,7 @@ var MultiSelectProperty = ({
|
|
|
827
945
|
onRemove,
|
|
828
946
|
...multiSelectProps
|
|
829
947
|
}) => {
|
|
830
|
-
const translation = useTranslation(
|
|
948
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
831
949
|
const hasValue = options.some((value) => value.selected);
|
|
832
950
|
return /* @__PURE__ */ jsx10(
|
|
833
951
|
PropertyBase,
|
|
@@ -850,7 +968,7 @@ var MultiSelectProperty = ({
|
|
|
850
968
|
options,
|
|
851
969
|
isDisabled: readOnly,
|
|
852
970
|
useChipDisplay: true,
|
|
853
|
-
hintText: `${translation
|
|
971
|
+
hintText: `${translation("select")}...`
|
|
854
972
|
}
|
|
855
973
|
)
|
|
856
974
|
}
|