@helpwave/hightide 0.1.7 → 0.1.8
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.js +18 -20
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +18 -20
- 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/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.js +2 -2
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +2 -2
- 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.js +2 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +2 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.d.ts +7 -6
- package/dist/components/layout-and-navigation/SearchableList.js +114 -21
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +114 -21
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +6 -6
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +6 -6
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +1 -1
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +1 -1
- package/dist/components/layout-and-navigation/Table.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/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.js +2 -2
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +2 -2
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +2 -2
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +2 -2
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +2 -2
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +2 -2
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +384 -150
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +383 -149
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +385 -154
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +382 -151
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +1 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +1 -0
- package/dist/components/properties/MultiSelectProperty.js +482 -430
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +478 -426
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +3 -3
- package/dist/components/properties/SelectProperty.d.ts +3 -3
- package/dist/components/properties/SelectProperty.js +404 -263
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +404 -263
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +18 -20
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +18 -20
- 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 +10 -16
- package/dist/components/user-action/MultiSelect.d.ts +10 -16
- package/dist/components/user-action/MultiSelect.js +485 -312
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +482 -310
- 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 +309 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +304 -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 +213 -205
- package/dist/css/uncompiled/globals.css +136 -72
- 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 +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +555 -463
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +517 -427
- package/dist/index.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
|
@@ -32,8 +32,8 @@ __export(SelectProperty_exports, {
|
|
|
32
32
|
SingleSelectProperty: () => SingleSelectProperty
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(SelectProperty_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var import_lucide_react5 = require("lucide-react");
|
|
36
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
37
37
|
|
|
38
38
|
// src/localization/LanguageProvider.tsx
|
|
39
39
|
var import_react2 = require("react");
|
|
@@ -74,15 +74,196 @@ var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
|
74
74
|
return defaultValues;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
// src/components/
|
|
78
|
-
var import_react5 = require("@headlessui/react");
|
|
77
|
+
// src/components/properties/PropertyBase.tsx
|
|
79
78
|
var import_lucide_react = require("lucide-react");
|
|
80
|
-
var
|
|
81
|
-
var import_clsx3 = __toESM(require("clsx"));
|
|
79
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
82
80
|
|
|
83
|
-
// src/components/user-action/
|
|
81
|
+
// src/components/user-action/Button.tsx
|
|
84
82
|
var import_clsx = __toESM(require("clsx"));
|
|
85
83
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
84
|
+
var paddingMapping = {
|
|
85
|
+
small: "btn-sm",
|
|
86
|
+
medium: "btn-md",
|
|
87
|
+
large: "btn-lg"
|
|
88
|
+
};
|
|
89
|
+
var iconPaddingMapping = {
|
|
90
|
+
small: "icon-btn-sm",
|
|
91
|
+
medium: "icon-btn-md",
|
|
92
|
+
large: "icon-btn-lg"
|
|
93
|
+
};
|
|
94
|
+
var ButtonUtil = {
|
|
95
|
+
paddingMapping,
|
|
96
|
+
iconPaddingMapping
|
|
97
|
+
};
|
|
98
|
+
var TextButton = ({
|
|
99
|
+
children,
|
|
100
|
+
disabled = false,
|
|
101
|
+
color = "neutral",
|
|
102
|
+
size = "medium",
|
|
103
|
+
startIcon,
|
|
104
|
+
endIcon,
|
|
105
|
+
onClick,
|
|
106
|
+
className,
|
|
107
|
+
...restProps
|
|
108
|
+
}) => {
|
|
109
|
+
const colorClasses = {
|
|
110
|
+
primary: "bg-transparent text-button-text-primary-text",
|
|
111
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
112
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
113
|
+
}[color];
|
|
114
|
+
const iconColorClasses = {
|
|
115
|
+
primary: "text-button-text-primary-icon",
|
|
116
|
+
negative: "text-button-text-negative-icon",
|
|
117
|
+
neutral: "text-button-text-neutral-icon"
|
|
118
|
+
}[color];
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
onClick: disabled ? void 0 : onClick,
|
|
123
|
+
disabled: disabled || onClick === void 0,
|
|
124
|
+
className: (0, import_clsx.default)(
|
|
125
|
+
{
|
|
126
|
+
"text-disabled-text cursor-not-allowed": disabled,
|
|
127
|
+
[(0, import_clsx.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
|
|
128
|
+
},
|
|
129
|
+
ButtonUtil.paddingMapping[size],
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...restProps,
|
|
133
|
+
children: [
|
|
134
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
className: (0, import_clsx.default)({
|
|
138
|
+
[iconColorClasses]: !disabled,
|
|
139
|
+
[`text-disabled-icon`]: disabled
|
|
140
|
+
}),
|
|
141
|
+
children: startIcon
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
children,
|
|
145
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
146
|
+
"span",
|
|
147
|
+
{
|
|
148
|
+
className: (0, import_clsx.default)({
|
|
149
|
+
[iconColorClasses]: !disabled,
|
|
150
|
+
[`text-disabled-icon`]: disabled
|
|
151
|
+
}),
|
|
152
|
+
children: endIcon
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
var IconButton = ({
|
|
160
|
+
children,
|
|
161
|
+
disabled = false,
|
|
162
|
+
color = "primary",
|
|
163
|
+
size = "medium",
|
|
164
|
+
onClick,
|
|
165
|
+
className,
|
|
166
|
+
...restProps
|
|
167
|
+
}) => {
|
|
168
|
+
const colorClasses = {
|
|
169
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
170
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
171
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
172
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
173
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
174
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
175
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
176
|
+
}[color];
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
178
|
+
"button",
|
|
179
|
+
{
|
|
180
|
+
onClick: disabled ? void 0 : onClick,
|
|
181
|
+
disabled: disabled || onClick === void 0,
|
|
182
|
+
className: (0, import_clsx.default)(
|
|
183
|
+
{
|
|
184
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
185
|
+
[(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
186
|
+
},
|
|
187
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
188
|
+
className
|
|
189
|
+
),
|
|
190
|
+
...restProps,
|
|
191
|
+
children
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// src/components/properties/PropertyBase.tsx
|
|
197
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
198
|
+
var defaultPropertyBaseTranslation = {
|
|
199
|
+
en: {
|
|
200
|
+
remove: "Remove"
|
|
201
|
+
},
|
|
202
|
+
de: {
|
|
203
|
+
remove: "Entfernen"
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
var PropertyBase = ({
|
|
207
|
+
overwriteTranslation,
|
|
208
|
+
name,
|
|
209
|
+
input,
|
|
210
|
+
softRequired = false,
|
|
211
|
+
hasValue,
|
|
212
|
+
icon,
|
|
213
|
+
readOnly,
|
|
214
|
+
onRemove,
|
|
215
|
+
className = ""
|
|
216
|
+
}) => {
|
|
217
|
+
const translation = useTranslation(defaultPropertyBaseTranslation, overwriteTranslation);
|
|
218
|
+
const requiredAndNoValue = softRequired && !hasValue;
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("row gap-x-0 group", className), children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
className: (0, import_clsx2.default)("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
224
|
+
"bg-property-title-background property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
225
|
+
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
226
|
+
}, className),
|
|
227
|
+
children: [
|
|
228
|
+
icon,
|
|
229
|
+
name
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
className: (0, import_clsx2.default)("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
237
|
+
"bg-surface group-hover:border-primary": !requiredAndNoValue,
|
|
238
|
+
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
239
|
+
}, className),
|
|
240
|
+
children: [
|
|
241
|
+
input({ softRequired, hasValue }),
|
|
242
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.AlertTriangle, { size: 24 }) }),
|
|
243
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
244
|
+
TextButton,
|
|
245
|
+
{
|
|
246
|
+
onClick: onRemove,
|
|
247
|
+
color: "negative",
|
|
248
|
+
className: (0, import_clsx2.default)("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
249
|
+
disabled: !hasValue || readOnly,
|
|
250
|
+
children: translation.remove
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] });
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// src/components/user-action/Select.tsx
|
|
260
|
+
var import_lucide_react4 = require("lucide-react");
|
|
261
|
+
var import_react7 = require("react");
|
|
262
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
263
|
+
|
|
264
|
+
// src/components/user-action/Label.tsx
|
|
265
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
266
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
86
267
|
var styleMapping = {
|
|
87
268
|
labelSmall: "textstyle-label-sm",
|
|
88
269
|
labelMedium: "textstyle-label-md",
|
|
@@ -95,20 +276,16 @@ var Label = ({
|
|
|
95
276
|
className,
|
|
96
277
|
...props
|
|
97
278
|
}) => {
|
|
98
|
-
return /* @__PURE__ */ (0,
|
|
279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { ...props, className: (0, import_clsx3.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
99
280
|
};
|
|
100
281
|
|
|
101
|
-
// src/
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
const mappedSearchKeywords = mapping(object).map((value) => value.toLowerCase().trim());
|
|
105
|
-
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
106
|
-
});
|
|
107
|
-
};
|
|
282
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
283
|
+
var import_lucide_react2 = require("lucide-react");
|
|
284
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
108
285
|
|
|
109
286
|
// src/components/user-action/Input.tsx
|
|
110
287
|
var import_react4 = require("react");
|
|
111
|
-
var
|
|
288
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
112
289
|
|
|
113
290
|
// src/hooks/useSaveDelay.ts
|
|
114
291
|
var import_react3 = require("react");
|
|
@@ -154,7 +331,7 @@ function useSaveDelay(setNotificationStatus, delay) {
|
|
|
154
331
|
var noop = () => void 0;
|
|
155
332
|
|
|
156
333
|
// src/components/user-action/Input.tsx
|
|
157
|
-
var
|
|
334
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
158
335
|
var Input = ({
|
|
159
336
|
id,
|
|
160
337
|
type = "text",
|
|
@@ -180,9 +357,9 @@ var Input = ({
|
|
|
180
357
|
ref.current?.focus();
|
|
181
358
|
}
|
|
182
359
|
}, [autoFocus]);
|
|
183
|
-
return /* @__PURE__ */ (0,
|
|
184
|
-
label && /* @__PURE__ */ (0,
|
|
185
|
-
/* @__PURE__ */ (0,
|
|
360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)({ "w-full": expanded }, containerClassName), children: [
|
|
361
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx4.default)("mb-1", label.className) }),
|
|
362
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
186
363
|
"input",
|
|
187
364
|
{
|
|
188
365
|
ref,
|
|
@@ -226,13 +403,13 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
226
403
|
required,
|
|
227
404
|
...restProps
|
|
228
405
|
}, ref) {
|
|
229
|
-
const input = /* @__PURE__ */ (0,
|
|
406
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
230
407
|
"input",
|
|
231
408
|
{
|
|
232
409
|
ref,
|
|
233
410
|
id,
|
|
234
411
|
...restProps,
|
|
235
|
-
className: (0,
|
|
412
|
+
className: (0, import_clsx4.default)(
|
|
236
413
|
{
|
|
237
414
|
"focus:border-primary focus:ring-primary": !errorText,
|
|
238
415
|
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
@@ -241,278 +418,242 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
241
418
|
)
|
|
242
419
|
}
|
|
243
420
|
);
|
|
244
|
-
return /* @__PURE__ */ (0,
|
|
245
|
-
labelText && /* @__PURE__ */ (0,
|
|
421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
422
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { htmlFor: id, className: (0, import_clsx4.default)("textstyle-label-md", labelClassName), children: [
|
|
246
423
|
labelText,
|
|
247
|
-
required && /* @__PURE__ */ (0,
|
|
424
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
248
425
|
] }),
|
|
249
426
|
input,
|
|
250
|
-
errorText && /* @__PURE__ */ (0,
|
|
427
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: id, className: (0, import_clsx4.default)("text-negative", errorClassName), children: errorText })
|
|
251
428
|
] });
|
|
252
429
|
});
|
|
253
430
|
|
|
431
|
+
// src/hooks/useSearch.ts
|
|
432
|
+
var import_react5 = require("react");
|
|
433
|
+
|
|
434
|
+
// src/util/simpleSearch.ts
|
|
435
|
+
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
436
|
+
return objects.filter((object) => {
|
|
437
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
438
|
+
if (!mappedSearchKeywords) {
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
// src/hooks/useSearch.ts
|
|
446
|
+
var useSearch = ({
|
|
447
|
+
list,
|
|
448
|
+
initialSearch,
|
|
449
|
+
searchMapping
|
|
450
|
+
}) => {
|
|
451
|
+
const [items, setItems] = (0, import_react5.useState)(list);
|
|
452
|
+
const [search, setSearch] = (0, import_react5.useState)(initialSearch);
|
|
453
|
+
(0, import_react5.useEffect)(() => {
|
|
454
|
+
setItems(list);
|
|
455
|
+
}, [list]);
|
|
456
|
+
const result = (0, import_react5.useMemo)(
|
|
457
|
+
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
458
|
+
[search, items, searchMapping]
|
|
459
|
+
);
|
|
460
|
+
return {
|
|
461
|
+
result,
|
|
462
|
+
hasResult: result.length > 0,
|
|
463
|
+
allItems: items,
|
|
464
|
+
setItems,
|
|
465
|
+
search,
|
|
466
|
+
setSearch
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
471
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
472
|
+
var defaultSearchableListTranslation = {
|
|
473
|
+
en: {
|
|
474
|
+
search: "Search",
|
|
475
|
+
nothingFound: "Nothing found"
|
|
476
|
+
},
|
|
477
|
+
de: {
|
|
478
|
+
search: "Suche",
|
|
479
|
+
nothingFound: "Nichts gefunden"
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
var SearchableList = ({
|
|
483
|
+
overwriteTranslation,
|
|
484
|
+
list,
|
|
485
|
+
initialSearch = "",
|
|
486
|
+
searchMapping,
|
|
487
|
+
autoFocus,
|
|
488
|
+
minimumItemsForSearch = 6,
|
|
489
|
+
itemMapper,
|
|
490
|
+
className,
|
|
491
|
+
resultListClassName
|
|
492
|
+
}) => {
|
|
493
|
+
const translation = useTranslation(defaultSearchableListTranslation, overwriteTranslation);
|
|
494
|
+
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("col gap-y-2", className), children: [
|
|
496
|
+
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
497
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
498
|
+
Input,
|
|
499
|
+
{
|
|
500
|
+
value: search,
|
|
501
|
+
onChangeText: setSearch,
|
|
502
|
+
placeholder: translation.search,
|
|
503
|
+
autoFocus,
|
|
504
|
+
className: "w-full"
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Search, { className: "w-full h-full" }) })
|
|
508
|
+
] }),
|
|
509
|
+
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_clsx5.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row text-description py-2 px-2", children: translation.nothingFound })
|
|
510
|
+
] });
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
514
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
515
|
+
var import_lucide_react3 = require("lucide-react");
|
|
516
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
517
|
+
var Tile = ({
|
|
518
|
+
title,
|
|
519
|
+
description,
|
|
520
|
+
onClick,
|
|
521
|
+
isSelected = false,
|
|
522
|
+
isDisabled = false,
|
|
523
|
+
prefix,
|
|
524
|
+
suffix,
|
|
525
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
526
|
+
selectedClassName = " bg-primary/20",
|
|
527
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
528
|
+
className
|
|
529
|
+
}) => {
|
|
530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
className: (0, import_clsx6.default)(
|
|
534
|
+
"row gap-x-2 w-full items-center",
|
|
535
|
+
{
|
|
536
|
+
[normalClassName]: !!onClick && !isDisabled,
|
|
537
|
+
[selectedClassName]: isSelected && !isDisabled,
|
|
538
|
+
[disabledClassName]: isDisabled
|
|
539
|
+
},
|
|
540
|
+
className
|
|
541
|
+
),
|
|
542
|
+
onClick: isDisabled ? void 0 : onClick,
|
|
543
|
+
children: [
|
|
544
|
+
prefix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Check, { size: 24 }) : void 0),
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h4", { className: (0, import_clsx6.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
547
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx6.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
548
|
+
] }),
|
|
549
|
+
suffix
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
// src/hooks/useOutsideClick.ts
|
|
556
|
+
var import_react6 = require("react");
|
|
557
|
+
var useOutsideClick = (refs, handler) => {
|
|
558
|
+
(0, import_react6.useEffect)(() => {
|
|
559
|
+
const listener = (event) => {
|
|
560
|
+
if (event.target === null) return;
|
|
561
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
handler();
|
|
565
|
+
};
|
|
566
|
+
document.addEventListener("mousedown", listener);
|
|
567
|
+
document.addEventListener("touchstart", listener);
|
|
568
|
+
return () => {
|
|
569
|
+
document.removeEventListener("mousedown", listener);
|
|
570
|
+
document.removeEventListener("touchstart", listener);
|
|
571
|
+
};
|
|
572
|
+
}, [refs, handler]);
|
|
573
|
+
};
|
|
574
|
+
|
|
254
575
|
// src/components/user-action/Select.tsx
|
|
255
|
-
var
|
|
576
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
256
577
|
var Select = ({
|
|
257
578
|
value,
|
|
258
579
|
label,
|
|
259
580
|
options,
|
|
260
581
|
onChange,
|
|
261
|
-
isHidingCurrentValue = true,
|
|
262
582
|
hintText = "",
|
|
263
|
-
showDisabledOptions = true,
|
|
264
583
|
isDisabled,
|
|
584
|
+
isSearchEnabled = false,
|
|
265
585
|
className,
|
|
266
|
-
textColor = "text-menu-text",
|
|
267
|
-
additionalItems,
|
|
268
586
|
selectedDisplayOverwrite
|
|
269
587
|
}) => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
588
|
+
const triggerRef = (0, import_react7.useRef)(null);
|
|
589
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
590
|
+
const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
|
|
591
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
274
592
|
const selectedOption = options.find((option) => option.value === value);
|
|
275
593
|
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
276
594
|
console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
|
|
277
595
|
}
|
|
278
|
-
const
|
|
279
|
-
return /* @__PURE__ */ (0,
|
|
280
|
-
label && /* @__PURE__ */ (0,
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
282
|
-
/* @__PURE__ */ (0,
|
|
283
|
-
|
|
596
|
+
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)(className), children: [
|
|
598
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx7.default)("mb-1", label.className) }),
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
601
|
+
"button",
|
|
284
602
|
{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
borderColor,
|
|
603
|
+
ref: triggerRef,
|
|
604
|
+
className: (0, import_clsx7.default)(
|
|
605
|
+
"btn-md justify-between w-full border-2",
|
|
289
606
|
{
|
|
290
607
|
"rounded-b-lg": !open,
|
|
291
|
-
"hover:border-primary": !isDisabled,
|
|
292
|
-
"bg-disabled-background cursor-not-allowed
|
|
608
|
+
"bg-menu-background border-menu-border hover:border-primary": !isDisabled,
|
|
609
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
293
610
|
}
|
|
294
611
|
),
|
|
612
|
+
onClick: () => setIsOpen(!isOpen),
|
|
295
613
|
disabled: isDisabled,
|
|
296
614
|
children: [
|
|
297
|
-
/* @__PURE__ */ (0,
|
|
298
|
-
|
|
615
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
616
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText }),
|
|
617
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react4.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react4.ChevronDown, {})
|
|
299
618
|
]
|
|
300
619
|
}
|
|
301
620
|
),
|
|
302
|
-
/* @__PURE__ */ (0,
|
|
303
|
-
|
|
621
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
622
|
+
"div",
|
|
304
623
|
{
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
"px-4 py-2 overflow-hidden whitespace-nowrap text-ellipsis border-2 border-t-0 cursor-pointer",
|
|
322
|
-
option.className,
|
|
323
|
-
borderColor,
|
|
324
|
-
{
|
|
325
|
-
"brightness-90": option.value === value,
|
|
326
|
-
"brightness-95": index % 2 === 1,
|
|
327
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !!option.disabled,
|
|
328
|
-
"bg-menu-background text-menu-text hover:brightness-90 cursor-pointer": !option.disabled,
|
|
329
|
-
"rounded-b-lg": index === filteredOptions.length - 1
|
|
330
|
-
}
|
|
331
|
-
),
|
|
332
|
-
onClick: () => {
|
|
333
|
-
if (!option.disabled) {
|
|
624
|
+
ref: menuRef,
|
|
625
|
+
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-md max-h-[500px] overflow-y-auto p-2",
|
|
626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
627
|
+
SearchableList,
|
|
628
|
+
{
|
|
629
|
+
list: options,
|
|
630
|
+
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
631
|
+
searchMapping: (item) => item.searchTags,
|
|
632
|
+
itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
633
|
+
Tile,
|
|
634
|
+
{
|
|
635
|
+
isSelected: selectedOption?.value === option.value,
|
|
636
|
+
className: "px-2 py-1 rounded-md",
|
|
637
|
+
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
638
|
+
title: { value: option.label, className: "font-semibold" },
|
|
639
|
+
onClick: () => {
|
|
334
640
|
onChange(option.value);
|
|
335
|
-
|
|
641
|
+
setIsOpen(false);
|
|
642
|
+
},
|
|
643
|
+
isDisabled: option.disabled
|
|
336
644
|
},
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
) }, `item${index}`))
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
|
-
)
|
|
343
|
-
] }) })
|
|
344
|
-
] });
|
|
345
|
-
};
|
|
346
|
-
var SearchableSelect = ({
|
|
347
|
-
value,
|
|
348
|
-
options,
|
|
349
|
-
searchMapping,
|
|
350
|
-
...selectProps
|
|
351
|
-
}) => {
|
|
352
|
-
const [search, setSearch] = (0, import_react6.useState)("");
|
|
353
|
-
const filteredOptions = MultiSearchWithMapping(search, options, searchMapping);
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
355
|
-
Select,
|
|
356
|
-
{
|
|
357
|
-
value,
|
|
358
|
-
options: filteredOptions,
|
|
359
|
-
additionalItems: [/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "row gap-x-2 items-center", children: [
|
|
360
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Input, { autoFocus: true, value: search, onChangeText: setSearch, className: "w-full" }),
|
|
361
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Search, { className: "min-w-[1.5rem] min-h-[1.5rem]" })
|
|
362
|
-
] }, "selectSearch")],
|
|
363
|
-
...selectProps
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
// src/components/properties/PropertyBase.tsx
|
|
369
|
-
var import_lucide_react2 = require("lucide-react");
|
|
370
|
-
var import_clsx5 = __toESM(require("clsx"));
|
|
371
|
-
|
|
372
|
-
// src/components/user-action/Button.tsx
|
|
373
|
-
var import_clsx4 = __toESM(require("clsx"));
|
|
374
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
375
|
-
var paddingMapping = {
|
|
376
|
-
small: "btn-sm",
|
|
377
|
-
medium: "btn-md",
|
|
378
|
-
large: "btn-lg"
|
|
379
|
-
};
|
|
380
|
-
var iconPaddingMapping = {
|
|
381
|
-
small: "icon-btn-sm",
|
|
382
|
-
medium: "icon-btn-md",
|
|
383
|
-
large: "icon-btn-lg"
|
|
384
|
-
};
|
|
385
|
-
var ButtonUtil = {
|
|
386
|
-
paddingMapping,
|
|
387
|
-
iconPaddingMapping
|
|
388
|
-
};
|
|
389
|
-
var TextButton = ({
|
|
390
|
-
children,
|
|
391
|
-
disabled = false,
|
|
392
|
-
color = "neutral",
|
|
393
|
-
size = "medium",
|
|
394
|
-
startIcon,
|
|
395
|
-
endIcon,
|
|
396
|
-
onClick,
|
|
397
|
-
className,
|
|
398
|
-
...restProps
|
|
399
|
-
}) => {
|
|
400
|
-
const colorClasses = {
|
|
401
|
-
primary: "bg-transparent text-button-text-primary-text",
|
|
402
|
-
negative: "bg-transparent text-button-text-negative-text",
|
|
403
|
-
neutral: "bg-transparent text-button-text-neutral-text"
|
|
404
|
-
}[color];
|
|
405
|
-
const iconColorClasses = {
|
|
406
|
-
primary: "text-button-text-primary-icon",
|
|
407
|
-
negative: "text-button-text-negative-icon",
|
|
408
|
-
neutral: "text-button-text-neutral-icon"
|
|
409
|
-
}[color];
|
|
410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
411
|
-
"button",
|
|
412
|
-
{
|
|
413
|
-
onClick: disabled ? void 0 : onClick,
|
|
414
|
-
disabled: disabled || onClick === void 0,
|
|
415
|
-
className: (0, import_clsx4.default)(
|
|
416
|
-
{
|
|
417
|
-
"text-disabled-text cursor-not-allowed": disabled,
|
|
418
|
-
[(0, import_clsx4.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
|
|
419
|
-
},
|
|
420
|
-
ButtonUtil.paddingMapping[size],
|
|
421
|
-
className
|
|
422
|
-
),
|
|
423
|
-
...restProps,
|
|
424
|
-
children: [
|
|
425
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
426
|
-
"span",
|
|
427
|
-
{
|
|
428
|
-
className: (0, import_clsx4.default)({
|
|
429
|
-
[iconColorClasses]: !disabled,
|
|
430
|
-
[`text-disabled-icon`]: disabled
|
|
431
|
-
}),
|
|
432
|
-
children: startIcon
|
|
433
|
-
}
|
|
434
|
-
),
|
|
435
|
-
children,
|
|
436
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
437
|
-
"span",
|
|
438
|
-
{
|
|
439
|
-
className: (0, import_clsx4.default)({
|
|
440
|
-
[iconColorClasses]: !disabled,
|
|
441
|
-
[`text-disabled-icon`]: disabled
|
|
442
|
-
}),
|
|
443
|
-
children: endIcon
|
|
444
|
-
}
|
|
445
|
-
)
|
|
446
|
-
]
|
|
447
|
-
}
|
|
448
|
-
);
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
// src/components/properties/PropertyBase.tsx
|
|
452
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
453
|
-
var defaultPropertyBaseTranslation = {
|
|
454
|
-
en: {
|
|
455
|
-
remove: "Remove"
|
|
456
|
-
},
|
|
457
|
-
de: {
|
|
458
|
-
remove: "Entfernen"
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
var PropertyBase = ({
|
|
462
|
-
overwriteTranslation,
|
|
463
|
-
name,
|
|
464
|
-
input,
|
|
465
|
-
softRequired = false,
|
|
466
|
-
hasValue,
|
|
467
|
-
icon,
|
|
468
|
-
readOnly,
|
|
469
|
-
onRemove,
|
|
470
|
-
className = ""
|
|
471
|
-
}) => {
|
|
472
|
-
const translation = useTranslation(defaultPropertyBaseTranslation, overwriteTranslation);
|
|
473
|
-
const requiredAndNoValue = softRequired && !hasValue;
|
|
474
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("row gap-x-0 group", className), children: [
|
|
475
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
476
|
-
"div",
|
|
477
|
-
{
|
|
478
|
-
className: (0, import_clsx5.default)("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
479
|
-
"bg-property-title-background property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
480
|
-
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
481
|
-
}, className),
|
|
482
|
-
children: [
|
|
483
|
-
icon,
|
|
484
|
-
name
|
|
485
|
-
]
|
|
486
|
-
}
|
|
487
|
-
),
|
|
488
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
489
|
-
"div",
|
|
490
|
-
{
|
|
491
|
-
className: (0, import_clsx5.default)("row grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
492
|
-
"bg-surface group-hover:border-primary": !requiredAndNoValue,
|
|
493
|
-
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
494
|
-
}, className),
|
|
495
|
-
children: [
|
|
496
|
-
input({ softRequired, hasValue }),
|
|
497
|
-
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.AlertTriangle, { size: 24 }) }),
|
|
498
|
-
onRemove && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
499
|
-
TextButton,
|
|
500
|
-
{
|
|
501
|
-
onClick: onRemove,
|
|
502
|
-
color: "negative",
|
|
503
|
-
className: (0, import_clsx5.default)("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
504
|
-
disabled: !hasValue || readOnly,
|
|
505
|
-
children: translation.remove
|
|
645
|
+
index
|
|
646
|
+
)
|
|
506
647
|
}
|
|
507
648
|
)
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
)
|
|
649
|
+
}
|
|
650
|
+
)
|
|
651
|
+
] })
|
|
511
652
|
] });
|
|
512
653
|
};
|
|
513
654
|
|
|
514
655
|
// src/components/properties/SelectProperty.tsx
|
|
515
|
-
var
|
|
656
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
516
657
|
var defaultSingleSelectPropertyTranslation = {
|
|
517
658
|
en: {
|
|
518
659
|
select: "Select"
|
|
@@ -529,11 +670,11 @@ var SingleSelectProperty = ({
|
|
|
529
670
|
readOnly = false,
|
|
530
671
|
softRequired,
|
|
531
672
|
onRemove,
|
|
532
|
-
...
|
|
673
|
+
...selectProps
|
|
533
674
|
}) => {
|
|
534
675
|
const translation = useTranslation(defaultSingleSelectPropertyTranslation, overwriteTranslation);
|
|
535
676
|
const hasValue = value !== void 0;
|
|
536
|
-
return /* @__PURE__ */ (0,
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
537
678
|
PropertyBase,
|
|
538
679
|
{
|
|
539
680
|
name,
|
|
@@ -541,19 +682,19 @@ var SingleSelectProperty = ({
|
|
|
541
682
|
readOnly,
|
|
542
683
|
softRequired,
|
|
543
684
|
hasValue,
|
|
544
|
-
icon: /* @__PURE__ */ (0,
|
|
545
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
685
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react5.List, { size: 16 }),
|
|
686
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
546
687
|
"div",
|
|
547
688
|
{
|
|
548
|
-
className: (0,
|
|
549
|
-
children: /* @__PURE__ */ (0,
|
|
550
|
-
|
|
689
|
+
className: (0, import_clsx8.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
691
|
+
Select,
|
|
551
692
|
{
|
|
552
|
-
...
|
|
693
|
+
...selectProps,
|
|
553
694
|
value,
|
|
554
695
|
options,
|
|
555
696
|
isDisabled: readOnly,
|
|
556
|
-
className: (0,
|
|
697
|
+
className: (0, import_clsx8.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
557
698
|
hintText: `${translation.select}...`
|
|
558
699
|
}
|
|
559
700
|
)
|