@helpwave/hightide 0.1.7 → 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/branding/HelpwaveBadge.js +30 -8
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +30 -8
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.d.mts +3 -4
- package/dist/components/date/DatePicker.d.ts +3 -4
- package/dist/components/date/DatePicker.js +135 -33
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +135 -33
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.d.mts +1 -1
- package/dist/components/date/DayPicker.d.ts +1 -1
- package/dist/components/date/DayPicker.js +23 -11
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +23 -11
- package/dist/components/date/DayPicker.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/date/YearMonthPicker.js +106 -22
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +106 -22
- package/dist/components/date/YearMonthPicker.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 +157 -25
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +157 -25
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +86 -28
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
- package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
- package/dist/components/layout-and-navigation/Expandable.js +4 -3
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +4 -3
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
- package/dist/components/layout-and-navigation/FAQSection.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 +152 -12
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +152 -12
- 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 +10 -8
- package/dist/components/layout-and-navigation/SearchableList.d.ts +10 -8
- package/dist/components/layout-and-navigation/SearchableList.js +261 -30
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +261 -30
- 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 +149 -19
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +149 -19
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +146 -14
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +146 -14
- 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/layout-and-navigation/Tile.d.mts +10 -15
- package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
- package/dist/components/layout-and-navigation/Tile.js +30 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +30 -8
- package/dist/components/layout-and-navigation/Tile.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/loading-states/ProgressIndicator.js +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
- package/dist/components/loading-states/ProgressIndicator.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 +158 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +158 -28
- 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 +162 -48
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +162 -48
- 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 +158 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +158 -28
- 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 +538 -166
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +537 -165
- 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 +547 -176
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +544 -173
- 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 +148 -26
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +148 -26
- 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 +146 -14
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +146 -14
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +5 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +5 -5
- package/dist/components/properties/MultiSelectProperty.js +626 -456
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +622 -452
- 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 +148 -16
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +148 -16
- 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 +146 -14
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +146 -14
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +5 -6
- package/dist/components/properties/SelectProperty.d.ts +5 -6
- package/dist/components/properties/SelectProperty.js +542 -279
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +542 -279
- 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 +150 -18
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +150 -18
- 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 +233 -71
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +233 -71
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +14 -8
- package/dist/components/user-action/Menu.d.ts +14 -8
- package/dist/components/user-action/Menu.js +32 -11
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +32 -11
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +13 -23
- package/dist/components/user-action/MultiSelect.d.ts +13 -23
- package/dist/components/user-action/MultiSelect.js +632 -325
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +629 -323
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +5 -18
- package/dist/components/user-action/Select.d.ts +5 -18
- package/dist/components/user-action/Select.js +447 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +442 -107
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.js +2 -2
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs +2 -2
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +224 -207
- package/dist/css/uncompiled/globals.css +138 -74
- package/dist/hooks/useSearch.d.mts +17 -0
- package/dist/hooks/useSearch.d.ts +17 -0
- package/dist/hooks/useSearch.js +66 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSearch.mjs +42 -0
- package/dist/hooks/useSearch.mjs.map +1 -0
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +882 -758
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +836 -717
- 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/dist/util/PropsWithFunctionChildren.d.mts +14 -0
- package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
- package/dist/util/PropsWithFunctionChildren.js +38 -0
- package/dist/util/PropsWithFunctionChildren.js.map +1 -0
- package/dist/util/PropsWithFunctionChildren.mjs +14 -0
- package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +2 -2
- package/dist/util/simpleSearch.d.ts +2 -2
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -2
|
@@ -70,15 +70,55 @@ var useLocale = (overWriteLanguage) => {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// src/localization/useTranslation.ts
|
|
73
|
-
var useTranslation = (
|
|
74
|
-
const { language: languageProp, translation: overwrite } =
|
|
73
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
74
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
75
75
|
const { language: inferredLanguage } = useLanguage();
|
|
76
76
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
77
|
-
|
|
78
|
-
if (overwrite
|
|
79
|
-
|
|
77
|
+
const usedTranslations = [...translations];
|
|
78
|
+
if (overwrite) {
|
|
79
|
+
usedTranslations.push(overwrite);
|
|
80
80
|
}
|
|
81
|
-
return
|
|
81
|
+
return (key, options) => {
|
|
82
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
83
|
+
try {
|
|
84
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
85
|
+
const translation = translations[i];
|
|
86
|
+
const localizedTranslation = translation[usedLanguage];
|
|
87
|
+
if (!localizedTranslation) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const value = localizedTranslation[key];
|
|
91
|
+
if (!value) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
let forProcessing;
|
|
95
|
+
if (typeof value !== "string") {
|
|
96
|
+
if (count <= 0 && value?.zero) {
|
|
97
|
+
forProcessing = value.zero;
|
|
98
|
+
} else if (count === 1 && value?.one) {
|
|
99
|
+
forProcessing = value.one;
|
|
100
|
+
} else if (count === 2 && value?.two) {
|
|
101
|
+
forProcessing = value.two;
|
|
102
|
+
} else if (count <= 10 && value?.few) {
|
|
103
|
+
forProcessing = value.few;
|
|
104
|
+
} else if (count > 10 && value?.many) {
|
|
105
|
+
forProcessing = value.many;
|
|
106
|
+
} else {
|
|
107
|
+
forProcessing = value.other;
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
forProcessing = value;
|
|
111
|
+
}
|
|
112
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
113
|
+
return replacements[placeholder] ?? `{{${placeholder}}}`;
|
|
114
|
+
});
|
|
115
|
+
return forProcessing;
|
|
116
|
+
}
|
|
117
|
+
} catch (e) {
|
|
118
|
+
console.error(e);
|
|
119
|
+
}
|
|
120
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
121
|
+
};
|
|
82
122
|
};
|
|
83
123
|
|
|
84
124
|
// src/util/noop.ts
|
|
@@ -494,8 +534,9 @@ var Expandable = (0, import_react4.forwardRef)(function Expandable2({
|
|
|
494
534
|
onChange = noop,
|
|
495
535
|
clickOnlyOnHeader = true,
|
|
496
536
|
disabled = false,
|
|
497
|
-
className
|
|
498
|
-
headerClassName
|
|
537
|
+
className,
|
|
538
|
+
headerClassName,
|
|
539
|
+
contentClassName
|
|
499
540
|
}, ref) {
|
|
500
541
|
icon ??= DefaultIcon;
|
|
501
542
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
@@ -524,7 +565,7 @@ var Expandable = (0, import_react4.forwardRef)(function Expandable2({
|
|
|
524
565
|
]
|
|
525
566
|
}
|
|
526
567
|
),
|
|
527
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col px-4 pb-2", children })
|
|
568
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx3.default)("col px-4 pb-2", contentClassName), children })
|
|
528
569
|
]
|
|
529
570
|
}
|
|
530
571
|
);
|
|
@@ -589,7 +630,8 @@ var YearMonthPicker = ({
|
|
|
589
630
|
ref: (displayedYearMonth.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()) === year ? ref : void 0,
|
|
590
631
|
label: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: (0, import_clsx4.default)({ "text-primary font-bold": selectedYear }), children: year }),
|
|
591
632
|
isExpanded: showValueOpen && selectedYear,
|
|
592
|
-
|
|
633
|
+
contentClassName: "gap-y-1",
|
|
634
|
+
children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row gap-x-1", children: monthList.map((month) => {
|
|
593
635
|
const monthIndex = monthsList.indexOf(month);
|
|
594
636
|
const newDate = new Date(year, monthIndex);
|
|
595
637
|
const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
|
|
@@ -599,17 +641,12 @@ var YearMonthPicker = ({
|
|
|
599
641
|
const isBeforeEnd = end === void 0 || firstOfMonth <= end;
|
|
600
642
|
const isValid = isAfterStart && isBeforeEnd;
|
|
601
643
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
602
|
-
|
|
644
|
+
SolidButton,
|
|
603
645
|
{
|
|
604
646
|
disabled: !isValid,
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
"bg-gray-50 text-black": !selectedMonth && isValid,
|
|
609
|
-
"bg-primary text-on-primary": selectedMonth && isValid,
|
|
610
|
-
"bg-disabled-background text-disabled-text": !isValid
|
|
611
|
-
}
|
|
612
|
-
),
|
|
647
|
+
color: selectedMonth && isValid ? "primary" : "neutral",
|
|
648
|
+
className: "flex-1",
|
|
649
|
+
size: "small",
|
|
613
650
|
onClick: () => {
|
|
614
651
|
onChange(newDate);
|
|
615
652
|
},
|
|
@@ -653,14 +690,15 @@ var DayPicker = ({
|
|
|
653
690
|
{
|
|
654
691
|
disabled: !isDayValid,
|
|
655
692
|
className: (0, import_clsx5.default)(
|
|
656
|
-
"flex-1 rounded-full border-2
|
|
693
|
+
"flex-1 rounded-full border-2",
|
|
657
694
|
{
|
|
658
|
-
"text-
|
|
659
|
-
"text-
|
|
660
|
-
"text-
|
|
661
|
-
"
|
|
662
|
-
"
|
|
663
|
-
"
|
|
695
|
+
"text-description": !isSameMonth && !isSelected && isDayValid,
|
|
696
|
+
"text-button-solid-neutral-text bg-button-solid-neutral-background": !isSelected && isSameMonth && isDayValid,
|
|
697
|
+
"text-button-solid-primary-text bg-button-solid-primary-background": isSelected && isDayValid,
|
|
698
|
+
"hover:brightness-90 hover:bg-button-solid-primary-background hover:text-button-solid-primary-text": isDayValid,
|
|
699
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": !isDayValid,
|
|
700
|
+
"border-secondary": isToday && markToday,
|
|
701
|
+
"border-transparent": !isToday || !markToday
|
|
664
702
|
}
|
|
665
703
|
),
|
|
666
704
|
onClick: () => onChange(date),
|
|
@@ -672,16 +710,80 @@ var DayPicker = ({
|
|
|
672
710
|
] });
|
|
673
711
|
};
|
|
674
712
|
|
|
675
|
-
// src/
|
|
676
|
-
var
|
|
677
|
-
var defaultDatePickerTranslation = {
|
|
713
|
+
// src/localization/defaults/time.ts
|
|
714
|
+
var monthTranslation = {
|
|
678
715
|
en: {
|
|
679
|
-
|
|
716
|
+
january: "January",
|
|
717
|
+
february: "Febuary",
|
|
718
|
+
march: "March",
|
|
719
|
+
april: "April",
|
|
720
|
+
may: "May",
|
|
721
|
+
june: "June",
|
|
722
|
+
july: "July",
|
|
723
|
+
august: "August",
|
|
724
|
+
september: "September",
|
|
725
|
+
october: "October",
|
|
726
|
+
november: "November",
|
|
727
|
+
december: "December"
|
|
680
728
|
},
|
|
681
729
|
de: {
|
|
682
|
-
|
|
730
|
+
january: "Januar",
|
|
731
|
+
february: "Febuar",
|
|
732
|
+
march: "M\xE4rz",
|
|
733
|
+
april: "April",
|
|
734
|
+
may: "Mai",
|
|
735
|
+
june: "Juni",
|
|
736
|
+
july: "Juli",
|
|
737
|
+
august: "August",
|
|
738
|
+
september: "September",
|
|
739
|
+
october: "October",
|
|
740
|
+
november: "November",
|
|
741
|
+
december: "December"
|
|
683
742
|
}
|
|
684
743
|
};
|
|
744
|
+
var timeTranslation = {
|
|
745
|
+
en: {
|
|
746
|
+
...monthTranslation.en,
|
|
747
|
+
century: { one: "Century", other: "Centuries" },
|
|
748
|
+
decade: { one: "Decade", other: "Decades" },
|
|
749
|
+
year: { one: "Year", other: "Years" },
|
|
750
|
+
month: { one: "Month", other: "Months" },
|
|
751
|
+
day: { one: "Day", other: "Days" },
|
|
752
|
+
hour: { one: "Hour", other: "Hours" },
|
|
753
|
+
minute: { one: "Minute", other: "Minutes" },
|
|
754
|
+
second: { one: "Second", other: "Seconds" },
|
|
755
|
+
millisecond: { one: "Millisecond", other: "Milliseconds" },
|
|
756
|
+
microsecond: { one: "Microsecond", other: "Microseconds" },
|
|
757
|
+
nanosecond: { one: "Nanosecond", other: "Nanoseconds" },
|
|
758
|
+
yesterday: "Yesterday",
|
|
759
|
+
today: "Today",
|
|
760
|
+
tomorrow: "Tomorrow",
|
|
761
|
+
in: "in",
|
|
762
|
+
ago: "ago"
|
|
763
|
+
},
|
|
764
|
+
de: {
|
|
765
|
+
...monthTranslation.de,
|
|
766
|
+
century: { one: "Jahrhundert", other: "Jahrhunderte" },
|
|
767
|
+
decade: { one: "Jahrzehnt", other: "Jahrzehnte" },
|
|
768
|
+
year: { one: "Jahr", other: "Jahre" },
|
|
769
|
+
month: { one: "Monat", other: "Monate" },
|
|
770
|
+
day: { one: "Tag", other: "Tage" },
|
|
771
|
+
hour: { one: "Stunde", other: "Stunden" },
|
|
772
|
+
minute: { one: "Minute", other: "Minuten" },
|
|
773
|
+
second: { one: "Sekunde", other: "Sekunden" },
|
|
774
|
+
millisecond: { one: "Millisekunde", other: "Millisekunden" },
|
|
775
|
+
microsecond: { one: "Mikrosekunde", other: "Mikrosekunden" },
|
|
776
|
+
nanosecond: { one: "Nanosekunde", other: "Nanosekunden" },
|
|
777
|
+
yesterday: "Gestern",
|
|
778
|
+
today: "Heute",
|
|
779
|
+
tomorrow: "Morgen",
|
|
780
|
+
in: "in",
|
|
781
|
+
ago: "vor"
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
// src/components/date/DatePicker.tsx
|
|
786
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
685
787
|
var DatePicker = ({
|
|
686
788
|
overwriteTranslation,
|
|
687
789
|
value = /* @__PURE__ */ new Date(),
|
|
@@ -694,7 +796,7 @@ var DatePicker = ({
|
|
|
694
796
|
className = ""
|
|
695
797
|
}) => {
|
|
696
798
|
const locale = useLocale();
|
|
697
|
-
const translation = useTranslation(
|
|
799
|
+
const translation = useTranslation([timeTranslation], overwriteTranslation);
|
|
698
800
|
const [displayedMonth, setDisplayedMonth] = (0, import_react7.useState)(value);
|
|
699
801
|
const [displayMode, setDisplayMode] = (0, import_react7.useState)(initialDisplay);
|
|
700
802
|
(0, import_react7.useEffect)(() => {
|
|
@@ -777,55 +879,115 @@ var DatePicker = ({
|
|
|
777
879
|
newDate.setHours(value.getHours(), value.getMinutes());
|
|
778
880
|
onChange(newDate);
|
|
779
881
|
},
|
|
780
|
-
children: translation
|
|
882
|
+
children: translation("today")
|
|
781
883
|
}
|
|
782
884
|
) })
|
|
783
885
|
] })
|
|
784
886
|
] });
|
|
785
887
|
};
|
|
786
888
|
|
|
787
|
-
// src/
|
|
788
|
-
var
|
|
789
|
-
var defaultTimeTranslation = {
|
|
889
|
+
// src/localization/defaults/form.ts
|
|
890
|
+
var formTranslation = {
|
|
790
891
|
en: {
|
|
791
|
-
|
|
892
|
+
all: "All",
|
|
893
|
+
back: "Back",
|
|
894
|
+
cancel: "Cancel",
|
|
792
895
|
change: "Change",
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
896
|
+
clear: "Clear",
|
|
897
|
+
close: "Close",
|
|
898
|
+
confirm: "Confirm",
|
|
899
|
+
decline: "Decline",
|
|
900
|
+
delete: "Delete",
|
|
901
|
+
discard: "Discard",
|
|
902
|
+
discardChanges: "Discard Changes",
|
|
903
|
+
done: "Done",
|
|
904
|
+
edit: "Edit",
|
|
905
|
+
enterText: "Enter text here",
|
|
906
|
+
error: "Error",
|
|
907
|
+
exit: "Exit",
|
|
908
|
+
fieldRequiredError: "This field is required.",
|
|
909
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
910
|
+
less: "Less",
|
|
911
|
+
loading: "Loading",
|
|
912
|
+
maxLengthError: "Maximum length exceeded.",
|
|
913
|
+
minLengthError: "Minimum length not met.",
|
|
914
|
+
more: "More",
|
|
915
|
+
next: "Next",
|
|
916
|
+
no: "No",
|
|
917
|
+
none: "None",
|
|
918
|
+
of: "of",
|
|
919
|
+
optional: "Optional",
|
|
920
|
+
pleaseWait: "Please wait...",
|
|
921
|
+
previous: "Previous",
|
|
922
|
+
remove: "Remove",
|
|
923
|
+
required: "Required",
|
|
924
|
+
reset: "Reset",
|
|
925
|
+
save: "Save",
|
|
926
|
+
search: "Search",
|
|
927
|
+
select: "Select",
|
|
928
|
+
selectOption: "Select an option",
|
|
929
|
+
show: "Show",
|
|
930
|
+
showMore: "Show more",
|
|
931
|
+
showLess: "Show less",
|
|
932
|
+
submit: "Submit",
|
|
933
|
+
success: "Success",
|
|
934
|
+
update: "Update",
|
|
935
|
+
unsavedChanges: "Unsaved Changes",
|
|
936
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
937
|
+
yes: "Yes"
|
|
808
938
|
},
|
|
809
939
|
de: {
|
|
810
|
-
|
|
940
|
+
all: "Alle",
|
|
941
|
+
back: "Zur\xFCck",
|
|
942
|
+
cancel: "Abbrechen",
|
|
811
943
|
change: "\xC4ndern",
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
944
|
+
clear: "L\xF6schen",
|
|
945
|
+
close: "Schlie\xDFen",
|
|
946
|
+
confirm: "Best\xE4tigen",
|
|
947
|
+
decline: "Ablehnen",
|
|
948
|
+
delete: "L\xF6schen",
|
|
949
|
+
discard: "Verwerfen",
|
|
950
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
951
|
+
done: "Fertig",
|
|
952
|
+
edit: "Bearbeiten",
|
|
953
|
+
enterText: "Text hier eingeben",
|
|
954
|
+
error: "Fehler",
|
|
955
|
+
exit: "Beenden",
|
|
956
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
957
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
958
|
+
less: "Weniger",
|
|
959
|
+
loading: "L\xE4dt",
|
|
960
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
961
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
962
|
+
more: "Mehr",
|
|
963
|
+
next: "Weiter",
|
|
964
|
+
no: "Nein",
|
|
965
|
+
none: "Nichts",
|
|
966
|
+
of: "von",
|
|
967
|
+
optional: "Optional",
|
|
968
|
+
pleaseWait: "Bitte warten...",
|
|
969
|
+
previous: "Vorherige",
|
|
970
|
+
remove: "Entfernen",
|
|
971
|
+
required: "Erforderlich",
|
|
972
|
+
reset: "Zur\xFCcksetzen",
|
|
973
|
+
save: "Speichern",
|
|
974
|
+
search: "Suche",
|
|
975
|
+
select: "Select",
|
|
976
|
+
selectOption: "Option ausw\xE4hlen",
|
|
977
|
+
show: "Anzeigen",
|
|
978
|
+
showMore: "Mehr anzeigen",
|
|
979
|
+
showLess: "Weniger anzeigen",
|
|
980
|
+
submit: "Abschicken",
|
|
981
|
+
success: "Erfolg",
|
|
982
|
+
update: "Update",
|
|
983
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
984
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
985
|
+
yes: "Ja"
|
|
827
986
|
}
|
|
828
987
|
};
|
|
988
|
+
|
|
989
|
+
// src/components/user-action/DateAndTimePicker.tsx
|
|
990
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
829
991
|
var DateTimePicker = ({
|
|
830
992
|
overwriteTranslation,
|
|
831
993
|
value = /* @__PURE__ */ new Date(),
|
|
@@ -838,7 +1000,7 @@ var DateTimePicker = ({
|
|
|
838
1000
|
timePickerProps,
|
|
839
1001
|
datePickerProps
|
|
840
1002
|
}) => {
|
|
841
|
-
const translation = useTranslation(
|
|
1003
|
+
const translation = useTranslation([formTranslation, timeTranslation], overwriteTranslation);
|
|
842
1004
|
const useDate = mode === "dateTime" || mode === "date";
|
|
843
1005
|
const useTime = mode === "dateTime" || mode === "time";
|
|
844
1006
|
let dateDisplay;
|
|
@@ -875,13 +1037,13 @@ var DateTimePicker = ({
|
|
|
875
1037
|
timeDisplay
|
|
876
1038
|
] }),
|
|
877
1039
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
878
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
879
1041
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
880
1042
|
SolidButton,
|
|
881
1043
|
{
|
|
882
1044
|
size: "medium",
|
|
883
1045
|
onClick: () => onFinish(value),
|
|
884
|
-
children: translation
|
|
1046
|
+
children: translation("change")
|
|
885
1047
|
}
|
|
886
1048
|
)
|
|
887
1049
|
] }) })
|