@deviceinsight/ng-ui-basic-components 7.17.0 → 7.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,897 +1,871 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const cx = require("classnames");
6
- const reactI18next = require("react-i18next");
7
- const ReactDOM = require("react-dom");
8
- const Draggable = require("react-draggable");
9
- const react = require("@floating-ui/react");
10
- function _interopNamespaceDefault(e) {
11
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
- if (e) {
13
- for (const k in e) {
14
- if (k !== "default") {
15
- const d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: () => e[k]
19
- });
20
- }
21
- }
22
- }
23
- n.default = e;
24
- return Object.freeze(n);
25
- }
26
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
27
- class Accordion extends React__namespace.Component {
28
- state = {
29
- currentPageIndex: -1
30
- };
31
- componentDidMount() {
32
- const { defaultOpenPageIndex } = this.props;
33
- if (defaultOpenPageIndex !== null && defaultOpenPageIndex !== void 0) {
34
- this.handleAccordionToggle(defaultOpenPageIndex);
35
- }
36
- }
37
- handleAccordionToggle = (index) => {
38
- const { onPageChange } = this.props;
39
- const newPageIndex = this.state.currentPageIndex !== index ? index : -1;
40
- this.setState({
41
- currentPageIndex: newPageIndex
42
- });
43
- if (onPageChange) {
44
- onPageChange(newPageIndex);
45
- }
46
- };
47
- render() {
48
- const { children, accordionClass } = this.props;
49
- const { currentPageIndex } = this.state;
50
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: accordionClass ? `di accordion ${accordionClass}` : "di accordion", children: children && children.map(
51
- (child, index) => child ? /* @__PURE__ */ jsxRuntime.jsx(
52
- child.type,
53
- {
54
- index,
55
- isOpen: currentPageIndex === index,
56
- toggle: () => this.handleAccordionToggle(index),
57
- ...child.props
58
- },
59
- index
60
- ) : null
61
- ) });
62
- }
63
- }
64
- class AccordionItem extends React__namespace.PureComponent {
65
- render() {
66
- const { badge, children, isOpen, info1, itemClasses, title, titleTooltip, toggle, tools, ...rest } = this.props;
67
- const accordionItemClasses = ["item"];
68
- if (itemClasses) accordionItemClasses.push(itemClasses);
69
- if (isOpen) accordionItemClasses.push("open");
70
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: accordionItemClasses.join(" "), children: [
71
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "head", children: [
72
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "title", onClick: toggle, "data-testid": rest["data-testid"], children: [
73
- /* @__PURE__ */ jsxRuntime.jsx("h1", { title: titleTooltip, children: title }),
74
- badge && /* @__PURE__ */ jsxRuntime.jsx(
75
- "span",
76
- {
77
- className: "di label",
78
- style: {
79
- margin: "0 0 0 10px",
80
- backgroundColor: "#ddd",
81
- borderColor: "transparent"
82
- },
83
- children: badge
84
- }
85
- ),
86
- info1 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: info1.cssStyle, children: info1.text })
87
- ] }),
88
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tools", children: tools && tools.map((toolComponent, index) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tool", children: toolComponent }, index)) })
89
- ] }),
90
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cont", children })
91
- ] });
92
- }
93
- }
94
- function Button$1({
95
- children,
96
- title,
97
- type,
98
- disabled,
99
- onClick,
100
- style,
101
- tabIndex,
102
- t,
103
- primary,
104
- danger,
105
- naked,
106
- className,
107
- small,
108
- ...rest
109
- }) {
110
- let btnTitle = title;
111
- if (title && typeof title !== "string") {
112
- btnTitle = t(title.id, {
113
- defaultValue: title.defaultValue
114
- });
115
- }
116
- return /* @__PURE__ */ jsxRuntime.jsx(
117
- "button",
118
- {
119
- "data-testid": rest["data-testid"],
120
- type: type || "button",
121
- className: cx("di button", className, { small, primary, danger, link: naked }),
122
- title: typeof btnTitle === "string" ? btnTitle : void 0,
123
- disabled,
124
- onClick,
125
- style,
126
- tabIndex,
127
- children
128
- }
129
- );
130
- }
131
- const Button = reactI18next.withTranslation()(Button$1);
132
- const ButtonRow = ({ children, dividing, className, style }) => /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: `di button-row ${dividing ? "dividing" : ""} ${className || ""}`, children });
133
- ButtonRow.defaultProps = {
134
- dividing: false
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
135
18
  };
136
- const isTouchEvent = (event) => {
137
- return !!event.touches;
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let react = require("react");
25
+ react = __toESM(react, 1);
26
+ let react_jsx_runtime = require("react/jsx-runtime");
27
+ let classnames = require("classnames");
28
+ classnames = __toESM(classnames, 1);
29
+ let react_i18next = require("react-i18next");
30
+ let react_dom = require("react-dom");
31
+ react_dom = __toESM(react_dom, 1);
32
+ let react_draggable = require("react-draggable");
33
+ react_draggable = __toESM(react_draggable, 1);
34
+ let _floating_ui_react = require("@floating-ui/react");
35
+ //#region src/components/accordion/Accordion.tsx
36
+ /**
37
+ * Accordions are best used to display homogenous information, e.g. multiple configurations which would take up a lot of space otherwise.
38
+ */
39
+ var Accordion = class extends react.Component {
40
+ state = { currentPageIndex: -1 };
41
+ componentDidMount() {
42
+ const { defaultOpenPageIndex } = this.props;
43
+ if (defaultOpenPageIndex !== null && defaultOpenPageIndex !== void 0) this.handleAccordionToggle(defaultOpenPageIndex);
44
+ }
45
+ handleAccordionToggle = (index) => {
46
+ const { onPageChange } = this.props;
47
+ const newPageIndex = this.state.currentPageIndex !== index ? index : -1;
48
+ this.setState({ currentPageIndex: newPageIndex });
49
+ if (onPageChange) onPageChange(newPageIndex);
50
+ };
51
+ render() {
52
+ const { children, accordionClass } = this.props;
53
+ const { currentPageIndex } = this.state;
54
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
55
+ className: accordionClass ? `di accordion ${accordionClass}` : "di accordion",
56
+ children: children && children.map((child, index) => child ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(child.type, {
57
+ index,
58
+ isOpen: currentPageIndex === index,
59
+ toggle: () => this.handleAccordionToggle(index),
60
+ ...child.props
61
+ }, index) : null)
62
+ });
63
+ }
138
64
  };
139
- const isInsideBoundingRect = (element, event) => {
140
- const rect = element.getBoundingClientRect();
141
- let x, y;
142
- if (isTouchEvent(event)) {
143
- x = event.touches[0].pageX;
144
- y = event.touches[0].pageY;
145
- } else {
146
- x = event.pageX;
147
- y = event.pageY;
148
- }
149
- return rect.left <= x && rect.right >= x && rect.top <= y && rect.bottom >= y;
65
+ //#endregion
66
+ //#region src/components/accordionComponents/AccordionItem.tsx
67
+ var AccordionItem = class extends react.PureComponent {
68
+ render() {
69
+ const { badge, children, isOpen, info1, itemClasses, title, titleTooltip, toggle, tools, ...rest } = this.props;
70
+ const accordionItemClasses = ["item"];
71
+ if (itemClasses) accordionItemClasses.push(itemClasses);
72
+ if (isOpen) accordionItemClasses.push("open");
73
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
74
+ className: accordionItemClasses.join(" "),
75
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
76
+ className: "head",
77
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
78
+ className: "title",
79
+ onClick: toggle,
80
+ "data-testid": rest["data-testid"],
81
+ children: [
82
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
83
+ title: titleTooltip,
84
+ children: title
85
+ }),
86
+ badge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
87
+ className: "di label",
88
+ style: {
89
+ margin: "0 0 0 10px",
90
+ backgroundColor: "#ddd",
91
+ borderColor: "transparent"
92
+ },
93
+ children: badge
94
+ }),
95
+ info1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
96
+ style: info1.cssStyle,
97
+ children: info1.text
98
+ })
99
+ ]
100
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
101
+ className: "tools",
102
+ children: tools && tools.map((toolComponent, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
103
+ className: "tool",
104
+ children: toolComponent
105
+ }, index))
106
+ })]
107
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
108
+ className: "cont",
109
+ children
110
+ })]
111
+ });
112
+ }
150
113
  };
151
- const useOutsideClick = (elements, callback) => {
152
- const callbackRef = React.useRef(callback);
153
- React.useEffect(() => {
154
- callbackRef.current = callback;
155
- }, [callback]);
156
- React.useEffect(() => {
157
- const listener = (event) => {
158
- const elementsNonNull = elements.filter((element) => element != null);
159
- if (elementsNonNull.every(
160
- (element) => element !== event.target && !element.contains(event.target) && !isInsideBoundingRect(element, event)
161
- )) {
162
- callbackRef.current(event);
163
- }
164
- };
165
- document.addEventListener("mousedown", listener, true);
166
- document.addEventListener("touchstart", listener, true);
167
- return () => {
168
- document.removeEventListener("mousedown", listener, true);
169
- document.removeEventListener("touchstart", listener, true);
170
- };
171
- }, [elements]);
114
+ //#endregion
115
+ //#region src/components/button/Button.tsx
116
+ /**
117
+ * Buttons are used to inform the user about a potential user interaction, which then on interaction causes an action.
118
+ * To create a standardized look and feel, different props can be passed to the Button.
119
+ */
120
+ function Button({ children, title, type, disabled, onClick, style, tabIndex, t, primary, danger, naked, className, small, ...rest }) {
121
+ let btnTitle = title;
122
+ if (title && typeof title !== "string") btnTitle = t(title.id, { defaultValue: title.defaultValue });
123
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
124
+ "data-testid": rest["data-testid"],
125
+ type: type || "button",
126
+ className: (0, classnames.default)("di button", className, {
127
+ small,
128
+ primary,
129
+ danger,
130
+ link: naked
131
+ }),
132
+ title: typeof btnTitle === "string" ? btnTitle : void 0,
133
+ disabled,
134
+ onClick,
135
+ style,
136
+ tabIndex,
137
+ children
138
+ });
139
+ }
140
+ var Button_default = (0, react_i18next.withTranslation)()(Button);
141
+ //#endregion
142
+ //#region src/components/button/ButtonRow.tsx
143
+ /**
144
+ * ButtonRows align Buttons nicely for all relevant and/or related user actions such as saving or canceling changes.
145
+ * To separate the ButtonRow from the content, the extra property `dividing` can be used.
146
+ */
147
+ var ButtonRow = ({ children, dividing, className, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
148
+ style,
149
+ className: `di button-row ${dividing ? "dividing" : ""} ${className || ""}`,
150
+ children
151
+ });
152
+ ButtonRow.defaultProps = { dividing: false };
153
+ //#endregion
154
+ //#region src/hooks/useOutsideClick.ts
155
+ var isTouchEvent = (event) => {
156
+ return !!event.touches;
172
157
  };
158
+ var isInsideBoundingRect = (element, event) => {
159
+ const rect = element.getBoundingClientRect();
160
+ let x, y;
161
+ if (isTouchEvent(event)) {
162
+ x = event.touches[0].pageX;
163
+ y = event.touches[0].pageY;
164
+ } else {
165
+ x = event.pageX;
166
+ y = event.pageY;
167
+ }
168
+ return rect.left <= x && rect.right >= x && rect.top <= y && rect.bottom >= y;
169
+ };
170
+ var useOutsideClick = (elements, callback) => {
171
+ const callbackRef = (0, react.useRef)(callback);
172
+ (0, react.useEffect)(() => {
173
+ callbackRef.current = callback;
174
+ }, [callback]);
175
+ (0, react.useEffect)(() => {
176
+ const listener = (event) => {
177
+ if (elements.filter((element) => element != null).every((element) => element !== event.target && !element.contains(event.target) && !isInsideBoundingRect(element, event))) callbackRef.current(event);
178
+ };
179
+ document.addEventListener("mousedown", listener, true);
180
+ document.addEventListener("touchstart", listener, true);
181
+ return () => {
182
+ document.removeEventListener("mousedown", listener, true);
183
+ document.removeEventListener("touchstart", listener, true);
184
+ };
185
+ }, [elements]);
186
+ };
187
+ //#endregion
188
+ //#region src/components/modalComponents/ModalWindow.tsx
173
189
  function ModalWindow({ className, width, header, content, footer, onOutsideClick }) {
174
- const ref = React.useRef(null);
175
- const [rootElement, setRootElement] = React.useState(null);
176
- React.useEffect(() => {
177
- setRootElement(ref.current);
178
- }, []);
179
- useOutsideClick([rootElement], () => {
180
- if (onOutsideClick) onOutsideClick();
181
- });
182
- return /* @__PURE__ */ jsxRuntime.jsx(Draggable, { handle: ".modal-header", nodeRef: ref, children: /* @__PURE__ */ jsxRuntime.jsxs(
183
- "div",
184
- {
185
- ref,
186
- className: `modal-window ${className || ""}`,
187
- style: {
188
- maxWidth: width
189
- },
190
- children: [
191
- header && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-header", children: header }),
192
- content && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-content", children: content }),
193
- footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-footer", children: footer })
194
- ]
195
- }
196
- ) });
197
- }
198
- class Modal extends React.Component {
199
- static defaultProps = {
200
- width: "60%"
201
- };
202
- container;
203
- modalRoot;
204
- timeoutId;
205
- constructor(props) {
206
- super(props);
207
- this.state = {
208
- className: "di modal"
209
- };
210
- }
211
- componentDidMount() {
212
- this.container = document.createElement("div");
213
- this.modalRoot = document.getElementById("modal-root");
214
- if (this.modalRoot) {
215
- this.modalRoot.appendChild(this.container);
216
- } else if (document.body) {
217
- document.body.appendChild(this.container);
218
- }
219
- if (this.props.onOutsideClick) {
220
- window.addEventListener("keydown", this.keyEventHandler);
221
- }
222
- this.timeoutId = setTimeout(
223
- () => this.setState({
224
- className: `di modal show ${this.props.className || ""}`
225
- }),
226
- 10
227
- );
228
- }
229
- componentWillUnmount() {
230
- if (this.container) {
231
- if (this.modalRoot) {
232
- this.modalRoot.removeChild(this.container);
233
- } else if (document.body) {
234
- document.body.removeChild(this.container);
235
- }
236
- }
237
- if (this.props.onOutsideClick) {
238
- window.removeEventListener("keydown", this.keyEventHandler);
239
- }
240
- if (this.timeoutId) {
241
- clearTimeout(this.timeoutId);
242
- }
243
- }
244
- keyEventHandler = (event) => {
245
- if (event.key === "Escape" && this.props.onOutsideClick) {
246
- this.props.onOutsideClick(event);
247
- }
248
- };
249
- render() {
250
- if (!this.container) {
251
- return null;
252
- }
253
- return ReactDOM.createPortal(
254
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: this.state.className, onMouseDown: this.props.onMouseDown, children: /* @__PURE__ */ jsxRuntime.jsx(ModalWindow, { ...this.props }) }),
255
- this.container
256
- );
257
- }
258
- }
259
- class ModalContainer extends React.PureComponent {
260
- render() {
261
- return /* @__PURE__ */ jsxRuntime.jsx("div", { id: "modal-root" });
262
- }
263
- }
264
- class Spinner extends React.Component {
265
- static defaultProps = {
266
- size: 56,
267
- center: false
268
- };
269
- render() {
270
- const { size = 56, center, ...dataAttrs } = this.props;
271
- let style = {
272
- width: size,
273
- height: size
274
- };
275
- if (center) {
276
- style = {
277
- ...style,
278
- position: "absolute",
279
- top: "50%",
280
- left: "50%",
281
- marginTop: -size / 2,
282
- marginLeft: -size / 2
283
- };
284
- }
285
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "di spinner", style, ...dataAttrs });
286
- }
190
+ const ref = (0, react.useRef)(null);
191
+ const [rootElement, setRootElement] = (0, react.useState)(null);
192
+ (0, react.useEffect)(() => {
193
+ setRootElement(ref.current);
194
+ }, []);
195
+ useOutsideClick([rootElement], () => {
196
+ if (onOutsideClick) onOutsideClick();
197
+ });
198
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_draggable.default, {
199
+ handle: ".modal-header",
200
+ nodeRef: ref,
201
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
202
+ ref,
203
+ className: `modal-window ${className || ""}`,
204
+ style: { maxWidth: width },
205
+ children: [
206
+ header && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
207
+ className: "modal-header",
208
+ children: header
209
+ }),
210
+ content && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
211
+ className: "modal-content",
212
+ children: content
213
+ }),
214
+ footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
215
+ className: "modal-footer",
216
+ children: footer
217
+ })
218
+ ]
219
+ })
220
+ });
287
221
  }
288
- class SpinnerContainer extends React.Component {
289
- static defaultProps = {
290
- size: 56
291
- };
292
- render() {
293
- const { show, size, children, className } = this.props;
294
- const classNames = `di spinner-wrapper ${className ? className : ""}`;
295
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames, children: [
296
- /* @__PURE__ */ jsxRuntime.jsx(
297
- "div",
298
- {
299
- className: `di spinner-container ${show ? "visible" : ""}`,
300
- "data-testid": this.props["data-testid"],
301
- children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size, center: true })
302
- }
303
- ),
304
- children
305
- ] });
306
- }
307
- }
308
- const getWrapperClassName = (type, small) => {
309
- switch (type) {
310
- case "checkbox":
311
- case "radio":
312
- return "di checkbox";
313
- case "toggle":
314
- return small ? "di toggle toggle-small" : "di toggle";
315
- default:
316
- throw Error(`type not support: ${type}`);
317
- }
222
+ //#endregion
223
+ //#region src/components/modal/Modal.tsx
224
+ var Modal = class extends react.default.Component {
225
+ static defaultProps = { width: "60%" };
226
+ container;
227
+ modalRoot;
228
+ timeoutId;
229
+ constructor(props) {
230
+ super(props);
231
+ this.state = { className: "di modal" };
232
+ }
233
+ componentDidMount() {
234
+ this.container = document.createElement("div");
235
+ this.modalRoot = document.getElementById("modal-root");
236
+ if (this.modalRoot) this.modalRoot.appendChild(this.container);
237
+ else if (document.body) document.body.appendChild(this.container);
238
+ if (this.props.onOutsideClick) window.addEventListener("keydown", this.keyEventHandler);
239
+ this.timeoutId = setTimeout(() => this.setState({ className: `di modal show ${this.props.className || ""}` }), 10);
240
+ }
241
+ componentWillUnmount() {
242
+ if (this.container) {
243
+ if (this.modalRoot) this.modalRoot.removeChild(this.container);
244
+ else if (document.body) document.body.removeChild(this.container);
245
+ }
246
+ if (this.props.onOutsideClick) window.removeEventListener("keydown", this.keyEventHandler);
247
+ if (this.timeoutId) clearTimeout(this.timeoutId);
248
+ }
249
+ keyEventHandler = (event) => {
250
+ if (event.key === "Escape" && this.props.onOutsideClick) this.props.onOutsideClick(event);
251
+ };
252
+ render() {
253
+ if (!this.container) return null;
254
+ return react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
255
+ className: this.state.className,
256
+ onMouseDown: this.props.onMouseDown,
257
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalWindow, { ...this.props })
258
+ }), this.container);
259
+ }
260
+ };
261
+ //#endregion
262
+ //#region src/components/modalComponents/ModalContainer.tsx
263
+ var ModalContainer = class extends react.default.PureComponent {
264
+ render() {
265
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { id: "modal-root" });
266
+ }
267
+ };
268
+ //#endregion
269
+ //#region src/components/spinner/Spinner.tsx
270
+ /**
271
+ * Spinners usually show a loading indication.
272
+ */
273
+ var Spinner = class extends react.default.Component {
274
+ static defaultProps = {
275
+ size: 56,
276
+ center: false
277
+ };
278
+ render() {
279
+ const { size = 56, center, ...dataAttrs } = this.props;
280
+ let style = {
281
+ width: size,
282
+ height: size
283
+ };
284
+ if (center) style = {
285
+ ...style,
286
+ position: "absolute",
287
+ top: "50%",
288
+ left: "50%",
289
+ marginTop: -size / 2,
290
+ marginLeft: -size / 2
291
+ };
292
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
293
+ className: "di spinner",
294
+ style,
295
+ ...dataAttrs
296
+ });
297
+ }
318
298
  };
319
- const getCheckboxClassName = (type, small) => {
320
- switch (type) {
321
- case "checkbox":
322
- return "box";
323
- case "radio":
324
- return "radio";
325
- case "toggle":
326
- return small ? "switch switch-small" : "switch";
327
- default:
328
- throw Error(`type not support: ${type}`);
329
- }
299
+ //#endregion
300
+ //#region src/components/spinner/SpinnerContainer.tsx
301
+ /**
302
+ * SpinnerContainer wraps the entire content and displays a loading indicator until the loading is done.
303
+ */
304
+ var SpinnerContainer = class extends react.default.Component {
305
+ static defaultProps = { size: 56 };
306
+ render() {
307
+ const { show, size, children, className } = this.props;
308
+ const classNames = `di spinner-wrapper ${className ? className : ""}`;
309
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
310
+ className: classNames,
311
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
312
+ className: `di spinner-container ${show ? "visible" : ""}`,
313
+ "data-testid": this.props["data-testid"],
314
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, {
315
+ size,
316
+ center: true
317
+ })
318
+ }), children]
319
+ });
320
+ }
330
321
  };
331
- const Checkbox = ({
332
- type = "checkbox",
333
- value,
334
- onChange,
335
- title,
336
- label,
337
- disabled = false,
338
- toggleSmall = false,
339
- toggleColor = "#259b23",
340
- t,
341
- ...other
342
- }) => {
343
- const style = type === "toggle" ? {
344
- backgroundColor: value ? toggleColor : "gray"
345
- } : {};
346
- const tooltip = title ? t(title.id, {
347
- defaultValue: title.defaultValue
348
- }) : void 0;
349
- const labelText = label ? t(label.id, {
350
- defaultValue: label.defaultValue
351
- }) : null;
352
- return /* @__PURE__ */ jsxRuntime.jsxs(
353
- "label",
354
- {
355
- title: tooltip,
356
- className: getWrapperClassName(type, toggleSmall),
357
- "data-testid": other["wrapper-data-testid"],
358
- children: [
359
- /* @__PURE__ */ jsxRuntime.jsx(
360
- "input",
361
- {
362
- type: "checkbox",
363
- checked: value,
364
- disabled,
365
- onChange: () => onChange(!value),
366
- "data-testid": other["data-testid"]
367
- }
368
- ),
369
- /* @__PURE__ */ jsxRuntime.jsx(
370
- "div",
371
- {
372
- className: getCheckboxClassName(type, toggleSmall),
373
- style,
374
- "data-testid": other["innerdiv-data-testid"]
375
- }
376
- ),
377
- label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "textlabel", children: labelText })
378
- ]
379
- }
380
- );
322
+ //#endregion
323
+ //#region src/components/input/Checkbox.tsx
324
+ var getWrapperClassName = (type, small) => {
325
+ switch (type) {
326
+ case "checkbox":
327
+ case "radio": return "di checkbox";
328
+ case "toggle": return small ? "di toggle toggle-small" : "di toggle";
329
+ default: throw Error(`type not support: ${type}`);
330
+ }
381
331
  };
382
- const Checkbox_default = reactI18next.withTranslation()(Checkbox);
332
+ var getCheckboxClassName = (type, small) => {
333
+ switch (type) {
334
+ case "checkbox": return "box";
335
+ case "radio": return "radio";
336
+ case "toggle": return small ? "switch switch-small" : "switch";
337
+ default: throw Error(`type not support: ${type}`);
338
+ }
339
+ };
340
+ /**
341
+ * Checkbox for enabling user interaction can have one of multiple types which are defined via the `type` prop.
342
+ */
343
+ var Checkbox = ({ type = "checkbox", value, onChange, title, label, disabled = false, toggleSmall = false, toggleColor = "#259b23", t, ...other }) => {
344
+ const style = type === "toggle" ? { backgroundColor: value ? toggleColor : "gray" } : {};
345
+ const tooltip = title ? t(title.id, { defaultValue: title.defaultValue }) : void 0;
346
+ const labelText = label ? t(label.id, { defaultValue: label.defaultValue }) : null;
347
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
348
+ title: tooltip,
349
+ className: getWrapperClassName(type, toggleSmall),
350
+ "data-testid": other["wrapper-data-testid"],
351
+ children: [
352
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
353
+ type: "checkbox",
354
+ checked: value,
355
+ disabled,
356
+ onChange: () => onChange(!value),
357
+ "data-testid": other["data-testid"]
358
+ }),
359
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
360
+ className: getCheckboxClassName(type, toggleSmall),
361
+ style,
362
+ "data-testid": other["innerdiv-data-testid"]
363
+ }),
364
+ label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
365
+ className: "textlabel",
366
+ children: labelText
367
+ })
368
+ ]
369
+ });
370
+ };
371
+ var Checkbox_default = (0, react_i18next.withTranslation)()(Checkbox);
372
+ //#endregion
373
+ //#region src/components/confirm/utils.ts
383
374
  function isTranslationDescriptor(arg) {
384
- const result = typeof arg === "object" && typeof arg.id === "string" && typeof arg.defaultValue === "string";
385
- if (result) {
386
- console.warn(
387
- "Please use strings instead of TranslationDescriptors to initialize the Confirm modal, because TranslationDescriptors are deprecated"
388
- );
389
- }
390
- return result;
375
+ const result = typeof arg === "object" && typeof arg.id === "string" && typeof arg.defaultValue === "string";
376
+ if (result) console.warn("Please use strings instead of TranslationDescriptors to initialize the Confirm modal, because TranslationDescriptors are deprecated");
377
+ return result;
391
378
  }
379
+ //#endregion
380
+ //#region src/components/confirm/Confirm.tsx
392
381
  function transformTextToElement(message) {
393
- if (isTranslationDescriptor(message)) {
394
- return /* @__PURE__ */ jsxRuntime.jsx(reactI18next.Trans, { i18nKey: message.id, children: message.defaultValue });
395
- }
396
- return message;
382
+ if (isTranslationDescriptor(message)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
383
+ i18nKey: message.id,
384
+ children: message.defaultValue
385
+ });
386
+ return message;
397
387
  }
398
- function Confirm({
399
- title,
400
- message,
401
- onAccept,
402
- onDecline,
403
- acceptButtonLabel,
404
- declineButtonLabel,
405
- acceptButtonStyle = "primary"
406
- }) {
407
- return /* @__PURE__ */ jsxRuntime.jsx(
408
- Modal,
409
- {
410
- header: transformTextToElement(title),
411
- content: transformTextToElement(message),
412
- footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
413
- /* @__PURE__ */ jsxRuntime.jsx(
414
- Button,
415
- {
416
- primary: acceptButtonStyle === "primary",
417
- danger: acceptButtonStyle === "danger",
418
- onClick: onAccept,
419
- children: acceptButtonLabel ? transformTextToElement(acceptButtonLabel) : /* @__PURE__ */ jsxRuntime.jsx(reactI18next.Trans, { i18nKey: "form.accept", children: "Accept" })
420
- }
421
- ),
422
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onDecline, children: declineButtonLabel ? transformTextToElement(declineButtonLabel) : /* @__PURE__ */ jsxRuntime.jsx(reactI18next.Trans, { i18nKey: "form.decline", children: "Decline" }) })
423
- ] }),
424
- width: 500
425
- }
426
- );
388
+ /**
389
+ * Confirm enables the possibility to open up a dialog within a modal, requiring additional user actions.
390
+ * This component should not be used directly, instead use `@withConfirm` to inject a promise based confirm method
391
+ */
392
+ function Confirm({ title, message, onAccept, onDecline, acceptButtonLabel, declineButtonLabel, acceptButtonStyle = "primary" }) {
393
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Modal, {
394
+ header: transformTextToElement(title),
395
+ content: transformTextToElement(message),
396
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
397
+ primary: acceptButtonStyle === "primary",
398
+ danger: acceptButtonStyle === "danger",
399
+ onClick: onAccept,
400
+ children: acceptButtonLabel ? transformTextToElement(acceptButtonLabel) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
401
+ i18nKey: "form.accept",
402
+ children: "Accept"
403
+ })
404
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
405
+ onClick: onDecline,
406
+ children: declineButtonLabel ? transformTextToElement(declineButtonLabel) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
407
+ i18nKey: "form.decline",
408
+ children: "Decline"
409
+ })
410
+ })] }),
411
+ width: 500
412
+ });
427
413
  }
428
- const ConfirmContext = React.createContext({
429
- confirm: () => Promise.reject(new Error("ConfirmProvider is missing!"))
430
- });
414
+ //#endregion
415
+ //#region src/components/confirm/ConfirmProvider.tsx
416
+ var ConfirmContext = (0, react.createContext)({ confirm: () => Promise.reject(/* @__PURE__ */ new Error("ConfirmProvider is missing!")) });
431
417
  function ConfirmProvider({ children }) {
432
- const [visible, setVisible] = React.useState(false);
433
- const [confirmProps, setConfirmProps] = React.useState({
434
- title: "",
435
- message: "",
436
- onAccept: () => {
437
- },
438
- onDecline: () => {
439
- }
440
- });
441
- async function confirm(options) {
442
- return new Promise((resolve) => {
443
- setVisible(true);
444
- setConfirmProps({
445
- ...options,
446
- onAccept: () => {
447
- setVisible(false);
448
- resolve(true);
449
- },
450
- onDecline: () => {
451
- setVisible(false);
452
- resolve(false);
453
- }
454
- });
455
- });
456
- }
457
- return /* @__PURE__ */ jsxRuntime.jsxs(ConfirmContext.Provider, { value: { confirm }, children: [
458
- children,
459
- visible && /* @__PURE__ */ jsxRuntime.jsx(Confirm, { ...confirmProps })
460
- ] });
418
+ const [visible, setVisible] = (0, react.useState)(false);
419
+ const [confirmProps, setConfirmProps] = (0, react.useState)({
420
+ title: "",
421
+ message: "",
422
+ onAccept: () => {},
423
+ onDecline: () => {}
424
+ });
425
+ async function confirm(options) {
426
+ return new Promise((resolve) => {
427
+ setVisible(true);
428
+ setConfirmProps({
429
+ ...options,
430
+ onAccept: () => {
431
+ setVisible(false);
432
+ resolve(true);
433
+ },
434
+ onDecline: () => {
435
+ setVisible(false);
436
+ resolve(false);
437
+ }
438
+ });
439
+ });
440
+ }
441
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ConfirmContext.Provider, {
442
+ value: { confirm },
443
+ children: [children, visible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Confirm, { ...confirmProps })]
444
+ });
461
445
  }
446
+ //#endregion
447
+ //#region src/components/confirm/useConfirm.ts
462
448
  function useConfirm() {
463
- const context = React.useContext(ConfirmContext);
464
- if (!context) {
465
- throw new Error("ConfirmProvider is missing");
466
- }
467
- const { confirm } = context;
468
- return confirm;
449
+ const context = (0, react.useContext)(ConfirmContext);
450
+ if (!context) throw new Error("ConfirmProvider is missing");
451
+ const { confirm } = context;
452
+ return confirm;
469
453
  }
454
+ //#endregion
455
+ //#region src/components/confirm/withConfirm.tsx
470
456
  function withConfirm(WrappedComponent) {
471
- function WithConfirm(props) {
472
- const confirm = useConfirm();
473
- const { t } = reactI18next.useTranslation();
474
- function trans(arg) {
475
- if (isTranslationDescriptor(arg)) {
476
- return t(arg.id, { defaultValue: arg.defaultValue });
477
- }
478
- return arg;
479
- }
480
- async function deprecatedConfirm(title, message, acceptButtonLabel, declineButtonLabel, resolveWithConfirmation, acceptButtonStyle) {
481
- const accepted = await confirm({
482
- title: trans(title),
483
- message: isTranslationDescriptor(message) ? trans(message) : message,
484
- acceptButtonLabel: acceptButtonLabel ? trans(acceptButtonLabel) : void 0,
485
- declineButtonLabel: declineButtonLabel ? trans(declineButtonLabel) : void 0,
486
- acceptButtonStyle
487
- });
488
- if (resolveWithConfirmation) {
489
- return accepted;
490
- } else if (!accepted) {
491
- return new Promise(() => {
492
- });
493
- }
494
- }
495
- return /* @__PURE__ */ jsxRuntime.jsx(WrappedComponent, { ...props, confirm: deprecatedConfirm });
496
- }
497
- return function WithConfirmWrapper(props) {
498
- return /* @__PURE__ */ jsxRuntime.jsx(ConfirmProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(WithConfirm, { ...props }) });
499
- };
457
+ function WithConfirm(props) {
458
+ const confirm = useConfirm();
459
+ const { t } = (0, react_i18next.useTranslation)();
460
+ function trans(arg) {
461
+ if (isTranslationDescriptor(arg)) return t(arg.id, { defaultValue: arg.defaultValue });
462
+ return arg;
463
+ }
464
+ async function deprecatedConfirm(title, message, acceptButtonLabel, declineButtonLabel, resolveWithConfirmation, acceptButtonStyle) {
465
+ const accepted = await confirm({
466
+ title: trans(title),
467
+ message: isTranslationDescriptor(message) ? trans(message) : message,
468
+ acceptButtonLabel: acceptButtonLabel ? trans(acceptButtonLabel) : void 0,
469
+ declineButtonLabel: declineButtonLabel ? trans(declineButtonLabel) : void 0,
470
+ acceptButtonStyle
471
+ });
472
+ if (resolveWithConfirmation) return accepted;
473
+ else if (!accepted) return new Promise(() => {});
474
+ }
475
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WrappedComponent, {
476
+ ...props,
477
+ confirm: deprecatedConfirm
478
+ });
479
+ }
480
+ return function WithConfirmWrapper(props) {
481
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfirmProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithConfirm, { ...props }) });
482
+ };
500
483
  }
501
- const iconAdd = "data:image/svg+xml,%3csvg%20id='icon-add_24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpolygon%20id='plus'%20points='20%2010%2014%2010%2014%204%2010%204%2010%2010%204%2010%204%2014%2010%2014%2010%2020%2014%2020%2014%2014%2020%2014%2020%2010'/%3e%3c/svg%3e";
502
- const iconDel = "data:image/svg+xml,%3csvg%20id='icon-cross_24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpolygon%20id='icon-cross_24'%20points='20%206.28%2017.87%204%2012%209.78%206.13%204%204%206.28%209.78%2011.97%204%2017.66%206.13%2019.93%2012%2014.15%2017.87%2019.93%2020%2017.66%2014.22%2011.97%2020%206.28'/%3e%3c/svg%3e";
503
- const iconEdit = "data:image/svg+xml,%3csvg%20id='icon-edit-24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='stift'%3e%3cpath%20d='M7.35,12.65a.5.5,0,0,0,0,.7l3.3,3.3a.5.5,0,0,0,.7,0l8.3-8.3A1.4,1.4,0,0,0,20,7.5v-1a1.4,1.4,0,0,0-.35-.85l-1.3-1.3A1.4,1.4,0,0,0,17.5,4h-1a1.4,1.4,0,0,0-.85.35Z'/%3e%3c/g%3e%3cpath%20d='M5.9,14.49c.06-.27.26-.33.45-.14l3.3,3.3c.19.19.13.39-.14.45l-4,.8a.3.3,0,0,1-.39-.39Z'/%3e%3c/svg%3e";
504
- const iconConfig = "data:image/svg+xml,%3csvg%20id='icon-gear-24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='icon-gear-24_sga-2'%20data-name='icon-gear-24_sga'%3e%3cpath%20d='M22.82,14.06A1.25,1.25,0,0,0,24,13,7.66,7.66,0,0,0,24,12,7.66,7.66,0,0,0,24,11a1.25,1.25,0,0,0-1.13-1l-1.09,0A1.49,1.49,0,0,1,20.44,9c-.15-.47-.44-2-.07-2.37l.74-.81a1.16,1.16,0,0,0,0-1.5L19.7,2.87a1.16,1.16,0,0,0-1.5,0l-.81.74a1.5,1.5,0,0,1-1.54.27c-.44-.23-1.72-1.08-1.74-1.63l0-1.09A1.25,1.25,0,0,0,13,.05a7.66,7.66,0,0,0-1,0,7.66,7.66,0,0,0-1,.05,1.25,1.25,0,0,0-1,1.13l0,1.09A1.52,1.52,0,0,1,9,3.56c-.47.15-2,.44-2.37.07L5.8,2.89a1.16,1.16,0,0,0-1.5,0L2.86,4.3a1.18,1.18,0,0,0,0,1.5l.74.81A1.5,1.5,0,0,1,3.9,8.15c-.23.44-1.08,1.72-1.63,1.74l-1.09,0A1.25,1.25,0,0,0,.05,11a7.66,7.66,0,0,0,0,1,7.66,7.66,0,0,0,.05,1,1.25,1.25,0,0,0,1.13,1l1.09,0A1.47,1.47,0,0,1,3.55,15c.16.48.45,2,.08,2.37l-.74.81a1.16,1.16,0,0,0,0,1.5L4.3,21.13a1.16,1.16,0,0,0,1.5,0l.81-.74a1.5,1.5,0,0,1,1.54-.27c.44.23,1.72,1.08,1.75,1.63l0,1.09A1.25,1.25,0,0,0,11,24,7.66,7.66,0,0,0,12,24,7.66,7.66,0,0,0,13,24a1.25,1.25,0,0,0,1-1.13l0-1.09A1.49,1.49,0,0,1,15,20.44c.47-.15,2-.44,2.37-.07l.81.74a1.16,1.16,0,0,0,1.5,0l1.43-1.43a1.16,1.16,0,0,0,0-1.5l-.74-.81a1.5,1.5,0,0,1-.27-1.54c.23-.44,1.08-1.72,1.63-1.74ZM12,15.5A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z'/%3e%3c/g%3e%3c/svg%3e";
505
- const iconDuplicate = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%3e%3cpath%20d='M22.1,4.91a3,3,0,0,0-3-3H6.44a2.4,2.4,0,0,1,1.34-.4h12.6A2.12,2.12,0,0,1,22.5,3.62V17.26a1.42,1.42,0,0,1-.4,1Z'/%3e%3cpath%20d='M20.38,1H7.78A3,3,0,0,0,5.26,2.4H19.09A2.51,2.51,0,0,1,21.6,4.91V19.12A1.94,1.94,0,0,0,23,17.26V3.62A2.62,2.62,0,0,0,20.38,1Z'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M4,21.5A1.5,1.5,0,0,1,2.5,20V5.8A1.5,1.5,0,0,1,4,4.3H18.2a1.5,1.5,0,0,1,1.5,1.5V20a1.5,1.5,0,0,1-1.5,1.5ZM9.5,18a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V14.5H16a.5.5,0,0,0,.5-.5V12a.5.5,0,0,0-.5-.5H12.5V8a.5.5,0,0,0-.5-.5H10a.5.5,0,0,0-.5.5v3.5H6a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5H9.5Z'/%3e%3cpath%20d='M18.2,4.8a1,1,0,0,1,1,1V20a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V5.8a1,1,0,0,1,1-1H18.2M9,11H6a1,1,0,0,0-1,1v2a1,1,0,0,0,1,1H9v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V15h3a1,1,0,0,0,1-1V12a1,1,0,0,0-1-1H13V8a1,1,0,0,0-1-1H10A1,1,0,0,0,9,8v3m9.2-7.2H4a2,2,0,0,0-2,2V20a2,2,0,0,0,2,2H18.2a2,2,0,0,0,2-2V5.8a2,2,0,0,0-2-2ZM6,14V12h4V8h2v4h4v2H12v4H10V14Z'/%3e%3c/g%3e%3c/svg%3e";
506
- const iconDownload = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpolygon%20points='7.92%2012%202.84%207%2013%207%207.92%2012'/%3e%3crect%20x='5'%20y='2'%20width='6'%20height='5'/%3e%3crect%20x='2'%20y='14'%20width='12'%20height='1'/%3e%3c/svg%3e";
507
- const iconSearch = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23fff;%20}%20%3c/style%3e%3c/defs%3e%3cg%3e%3ccircle%20class='cls-1'%20cx='5.5'%20cy='5.5'%20r='4.5'/%3e%3cpath%20d='M5.5,2A3.5,3.5,0,1,1,2,5.5,3.5,3.5,0,0,1,5.5,2m0-1A4.5,4.5,0,1,0,10,5.5,4.49,4.49,0,0,0,5.5,1Z'/%3e%3c/g%3e%3crect%20x='6.79'%20y='10.04'%20width='7.74'%20height='2.16'%20transform='translate(10.98%20-4.28)%20rotate(45)'/%3e%3c/svg%3e";
508
- const iconIconKey = "data:image/svg+xml,%3csvg%20data-name='icon_key'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027.02%2027'%3e%3cpath%20d='M35.07,16.5a8.52,8.52,0,0,0-7.69,12L17.2,38.8a2.46,2.46,0,0,0,0,3.46,2.41,2.41,0,0,0,3.42,0l1.69-1.7,2.91,2.94L31,37.63l-2.92-3,2.44-2.46a8.31,8.31,0,0,0,4.51,1.33,8.53,8.53,0,0,0,0-17Zm0,3.91A4.62,4.62,0,1,1,30.5,25,4.6,4.6,0,0,1,35.07,20.41Z'%20transform='translate(-16.49%20-16.5)'/%3e%3c/svg%3e";
509
- const iconSync = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='Pfeilende'%3e%3cpath%20d='M24,10H15l9-8.93Z'/%3e%3c/g%3e%3cpath%20d='M18.45,18.78A9.33,9.33,0,0,1,2.62,14.86,9.8,9.8,0,0,1,8.89,2.69,9.42,9.42,0,0,1,20.72,9.14H23A11.72,11.72,0,0,0,11.68,0,11.74,11.74,0,0,0,.34,9.14,12,12,0,0,0,8.89,23.65a11.43,11.43,0,0,0,11.16-3.31Z'/%3e%3c/svg%3e";
510
- const iconFullscreen = "data:image/svg+xml,%3csvg%20data-name='icon_fullscreen_sga'%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cpolygon%20id='ecke'%20points='2%2014%202%2010%200%2010%200%2016%206%2016%206%2014%202%2014'/%3e%3cpolygon%20id='ecke-2'%20data-name='ecke'%20points='2%202%206%202%206%200%200%200%200%206%202%206%202%202'/%3e%3cpolygon%20id='ecke-3'%20data-name='ecke'%20points='14%2014%2010%2014%2010%2016%2016%2016%2016%2010%2014%2010%2014%2014'/%3e%3cpolygon%20id='ecke-4'%20data-name='ecke'%20points='10%200%2010%202%2014%202%2014%206%2016%206%2016%200%2010%200'/%3e%3c/svg%3e";
511
- const iconDocumentation = "data:image/svg+xml,%3csvg%20id='Icon_help'%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20id='icon_help-2'%20data-name='icon_help'%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm1,16H11V15h2Zm1.7-6.26a4.85,4.85,0,0,1-.49.81l-1,1.37a1.36,1.36,0,0,0-.18.34,1,1,0,0,0-.07.38L13,14H11l.1-.49a2,2,0,0,1,.13-.77,3.18,3.18,0,0,1,.4-.69l1-1.33a3.21,3.21,0,0,0,.29-.46,1.19,1.19,0,0,0,.11-.47,1.17,1.17,0,0,0-.3-.82,1.07,1.07,0,0,0-.83-.33A1,1,0,0,0,11.1,9a1.25,1.25,0,0,0-.28.83H9a2.94,2.94,0,0,1,.23-1.17,2.45,2.45,0,0,1,.63-.88,2.9,2.9,0,0,1,.93-.55A3.13,3.13,0,0,1,11.94,7a3.31,3.31,0,0,1,1.13.19,2.82,2.82,0,0,1,.94.54,2.62,2.62,0,0,1,.65.88A3,3,0,0,1,14.9,9.8,2.16,2.16,0,0,1,14.7,10.74Z'%20style='opacity:%200.2'/%3e%3c/svg%3e";
512
- const iconStar = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='icon_star_16'%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cpath%20id='star'%20d='M8,0l2.45,4.97,5.55,.76-4.04,3.83,.99,5.44-4.94-2.61-4.94,2.61,.99-5.44L0,5.73l5.55-.76L8,0Z'/%3e%3c/svg%3e";
484
+ //#endregion
485
+ //#region src/assets/svg/icon_add.svg
486
+ var icon_add_default = "data:image/svg+xml,%3csvg%20id='icon-add_24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpolygon%20id='plus'%20points='20%2010%2014%2010%2014%204%2010%204%2010%2010%204%2010%204%2014%2010%2014%2010%2020%2014%2020%2014%2014%2020%2014%2020%2010'/%3e%3c/svg%3e";
487
+ //#endregion
488
+ //#region src/assets/svg/icon_cross.svg
489
+ var icon_cross_default = "data:image/svg+xml,%3csvg%20id='icon-cross_24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpolygon%20id='icon-cross_24'%20points='20%206.28%2017.87%204%2012%209.78%206.13%204%204%206.28%209.78%2011.97%204%2017.66%206.13%2019.93%2012%2014.15%2017.87%2019.93%2020%2017.66%2014.22%2011.97%2020%206.28'/%3e%3c/svg%3e";
490
+ //#endregion
491
+ //#region src/assets/svg/icon_edit.svg
492
+ var icon_edit_default = "data:image/svg+xml,%3csvg%20id='icon-edit-24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='stift'%3e%3cpath%20d='M7.35,12.65a.5.5,0,0,0,0,.7l3.3,3.3a.5.5,0,0,0,.7,0l8.3-8.3A1.4,1.4,0,0,0,20,7.5v-1a1.4,1.4,0,0,0-.35-.85l-1.3-1.3A1.4,1.4,0,0,0,17.5,4h-1a1.4,1.4,0,0,0-.85.35Z'/%3e%3c/g%3e%3cpath%20d='M5.9,14.49c.06-.27.26-.33.45-.14l3.3,3.3c.19.19.13.39-.14.45l-4,.8a.3.3,0,0,1-.39-.39Z'/%3e%3c/svg%3e";
493
+ //#endregion
494
+ //#region src/assets/svg/icon_gear.svg
495
+ var icon_gear_default = "data:image/svg+xml,%3csvg%20id='icon-gear-24_sga'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='icon-gear-24_sga-2'%20data-name='icon-gear-24_sga'%3e%3cpath%20d='M22.82,14.06A1.25,1.25,0,0,0,24,13,7.66,7.66,0,0,0,24,12,7.66,7.66,0,0,0,24,11a1.25,1.25,0,0,0-1.13-1l-1.09,0A1.49,1.49,0,0,1,20.44,9c-.15-.47-.44-2-.07-2.37l.74-.81a1.16,1.16,0,0,0,0-1.5L19.7,2.87a1.16,1.16,0,0,0-1.5,0l-.81.74a1.5,1.5,0,0,1-1.54.27c-.44-.23-1.72-1.08-1.74-1.63l0-1.09A1.25,1.25,0,0,0,13,.05a7.66,7.66,0,0,0-1,0,7.66,7.66,0,0,0-1,.05,1.25,1.25,0,0,0-1,1.13l0,1.09A1.52,1.52,0,0,1,9,3.56c-.47.15-2,.44-2.37.07L5.8,2.89a1.16,1.16,0,0,0-1.5,0L2.86,4.3a1.18,1.18,0,0,0,0,1.5l.74.81A1.5,1.5,0,0,1,3.9,8.15c-.23.44-1.08,1.72-1.63,1.74l-1.09,0A1.25,1.25,0,0,0,.05,11a7.66,7.66,0,0,0,0,1,7.66,7.66,0,0,0,.05,1,1.25,1.25,0,0,0,1.13,1l1.09,0A1.47,1.47,0,0,1,3.55,15c.16.48.45,2,.08,2.37l-.74.81a1.16,1.16,0,0,0,0,1.5L4.3,21.13a1.16,1.16,0,0,0,1.5,0l.81-.74a1.5,1.5,0,0,1,1.54-.27c.44.23,1.72,1.08,1.75,1.63l0,1.09A1.25,1.25,0,0,0,11,24,7.66,7.66,0,0,0,12,24,7.66,7.66,0,0,0,13,24a1.25,1.25,0,0,0,1-1.13l0-1.09A1.49,1.49,0,0,1,15,20.44c.47-.15,2-.44,2.37-.07l.81.74a1.16,1.16,0,0,0,1.5,0l1.43-1.43a1.16,1.16,0,0,0,0-1.5l-.74-.81a1.5,1.5,0,0,1-.27-1.54c.23-.44,1.08-1.72,1.63-1.74ZM12,15.5A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z'/%3e%3c/g%3e%3c/svg%3e";
496
+ //#endregion
497
+ //#region src/assets/svg/icon_duplicate.svg
498
+ var icon_duplicate_default = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%3e%3cpath%20d='M22.1,4.91a3,3,0,0,0-3-3H6.44a2.4,2.4,0,0,1,1.34-.4h12.6A2.12,2.12,0,0,1,22.5,3.62V17.26a1.42,1.42,0,0,1-.4,1Z'/%3e%3cpath%20d='M20.38,1H7.78A3,3,0,0,0,5.26,2.4H19.09A2.51,2.51,0,0,1,21.6,4.91V19.12A1.94,1.94,0,0,0,23,17.26V3.62A2.62,2.62,0,0,0,20.38,1Z'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M4,21.5A1.5,1.5,0,0,1,2.5,20V5.8A1.5,1.5,0,0,1,4,4.3H18.2a1.5,1.5,0,0,1,1.5,1.5V20a1.5,1.5,0,0,1-1.5,1.5ZM9.5,18a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V14.5H16a.5.5,0,0,0,.5-.5V12a.5.5,0,0,0-.5-.5H12.5V8a.5.5,0,0,0-.5-.5H10a.5.5,0,0,0-.5.5v3.5H6a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5H9.5Z'/%3e%3cpath%20d='M18.2,4.8a1,1,0,0,1,1,1V20a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V5.8a1,1,0,0,1,1-1H18.2M9,11H6a1,1,0,0,0-1,1v2a1,1,0,0,0,1,1H9v3a1,1,0,0,0,1,1h2a1,1,0,0,0,1-1V15h3a1,1,0,0,0,1-1V12a1,1,0,0,0-1-1H13V8a1,1,0,0,0-1-1H10A1,1,0,0,0,9,8v3m9.2-7.2H4a2,2,0,0,0-2,2V20a2,2,0,0,0,2,2H18.2a2,2,0,0,0,2-2V5.8a2,2,0,0,0-2-2ZM6,14V12h4V8h2v4h4v2H12v4H10V14Z'/%3e%3c/g%3e%3c/svg%3e";
499
+ //#endregion
500
+ //#region src/assets/svg/icon_download.svg
501
+ var icon_download_default = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cpolygon%20points='7.92%2012%202.84%207%2013%207%207.92%2012'/%3e%3crect%20x='5'%20y='2'%20width='6'%20height='5'/%3e%3crect%20x='2'%20y='14'%20width='12'%20height='1'/%3e%3c/svg%3e";
502
+ //#endregion
503
+ //#region src/assets/svg/icon_lupe.svg
504
+ var icon_lupe_default = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23fff;%20}%20%3c/style%3e%3c/defs%3e%3cg%3e%3ccircle%20class='cls-1'%20cx='5.5'%20cy='5.5'%20r='4.5'/%3e%3cpath%20d='M5.5,2A3.5,3.5,0,1,1,2,5.5,3.5,3.5,0,0,1,5.5,2m0-1A4.5,4.5,0,1,0,10,5.5,4.49,4.49,0,0,0,5.5,1Z'/%3e%3c/g%3e%3crect%20x='6.79'%20y='10.04'%20width='7.74'%20height='2.16'%20transform='translate(10.98%20-4.28)%20rotate(45)'/%3e%3c/svg%3e";
505
+ //#endregion
506
+ //#region src/assets/svg/icon_key.svg
507
+ var icon_key_default = "data:image/svg+xml,%3csvg%20data-name='icon_key'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2027.02%2027'%3e%3cpath%20d='M35.07,16.5a8.52,8.52,0,0,0-7.69,12L17.2,38.8a2.46,2.46,0,0,0,0,3.46,2.41,2.41,0,0,0,3.42,0l1.69-1.7,2.91,2.94L31,37.63l-2.92-3,2.44-2.46a8.31,8.31,0,0,0,4.51,1.33,8.53,8.53,0,0,0,0-17Zm0,3.91A4.62,4.62,0,1,1,30.5,25,4.6,4.6,0,0,1,35.07,20.41Z'%20transform='translate(-16.49%20-16.5)'/%3e%3c/svg%3e";
508
+ //#endregion
509
+ //#region src/assets/svg/icon_reload.svg
510
+ var icon_reload_default = "data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cg%20id='Pfeilende'%3e%3cpath%20d='M24,10H15l9-8.93Z'/%3e%3c/g%3e%3cpath%20d='M18.45,18.78A9.33,9.33,0,0,1,2.62,14.86,9.8,9.8,0,0,1,8.89,2.69,9.42,9.42,0,0,1,20.72,9.14H23A11.72,11.72,0,0,0,11.68,0,11.74,11.74,0,0,0,.34,9.14,12,12,0,0,0,8.89,23.65a11.43,11.43,0,0,0,11.16-3.31Z'/%3e%3c/svg%3e";
511
+ //#endregion
512
+ //#region src/assets/svg/icon_fullscreen.svg
513
+ var icon_fullscreen_default = "data:image/svg+xml,%3csvg%20data-name='icon_fullscreen_sga'%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cpolygon%20id='ecke'%20points='2%2014%202%2010%200%2010%200%2016%206%2016%206%2014%202%2014'/%3e%3cpolygon%20id='ecke-2'%20data-name='ecke'%20points='2%202%206%202%206%200%200%200%200%206%202%206%202%202'/%3e%3cpolygon%20id='ecke-3'%20data-name='ecke'%20points='14%2014%2010%2014%2010%2016%2016%2016%2016%2010%2014%2010%2014%2014'/%3e%3cpolygon%20id='ecke-4'%20data-name='ecke'%20points='10%200%2010%202%2014%202%2014%206%2016%206%2016%200%2010%200'/%3e%3c/svg%3e";
514
+ //#endregion
515
+ //#region src/assets/svg/icon_help_light.svg
516
+ var icon_help_light_default = "data:image/svg+xml,%3csvg%20id='Icon_help'%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3cpath%20id='icon_help-2'%20data-name='icon_help'%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm1,16H11V15h2Zm1.7-6.26a4.85,4.85,0,0,1-.49.81l-1,1.37a1.36,1.36,0,0,0-.18.34,1,1,0,0,0-.07.38L13,14H11l.1-.49a2,2,0,0,1,.13-.77,3.18,3.18,0,0,1,.4-.69l1-1.33a3.21,3.21,0,0,0,.29-.46,1.19,1.19,0,0,0,.11-.47,1.17,1.17,0,0,0-.3-.82,1.07,1.07,0,0,0-.83-.33A1,1,0,0,0,11.1,9a1.25,1.25,0,0,0-.28.83H9a2.94,2.94,0,0,1,.23-1.17,2.45,2.45,0,0,1,.63-.88,2.9,2.9,0,0,1,.93-.55A3.13,3.13,0,0,1,11.94,7a3.31,3.31,0,0,1,1.13.19,2.82,2.82,0,0,1,.94.54,2.62,2.62,0,0,1,.65.88A3,3,0,0,1,14.9,9.8,2.16,2.16,0,0,1,14.7,10.74Z'%20style='opacity:%200.2'/%3e%3c/svg%3e";
517
+ //#endregion
518
+ //#region src/assets/svg/icon_star.svg
519
+ var icon_star_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='icon_star_16'%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cpath%20id='star'%20d='M8,0l2.45,4.97,5.55,.76-4.04,3.83,.99,5.44-4.94-2.61-4.94,2.61,.99-5.44L0,5.73l5.55-.76L8,0Z'/%3e%3c/svg%3e";
520
+ //#endregion
521
+ //#region src/components/icon/Icon.tsx
513
522
  function getSrc(props) {
514
- const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
515
- if (add) {
516
- return iconAdd;
517
- } else if (del) {
518
- return iconDel;
519
- } else if (edit) {
520
- return iconEdit;
521
- } else if (config) {
522
- return iconConfig;
523
- } else if (duplicate) {
524
- return iconDuplicate;
525
- } else if (search) {
526
- return iconSearch;
527
- } else if (download) {
528
- return iconDownload;
529
- } else if (sync) {
530
- return iconSync;
531
- } else if (fullscreen) {
532
- return iconFullscreen;
533
- } else if (iconKey) {
534
- return iconIconKey;
535
- } else if (documentation) {
536
- return iconDocumentation;
537
- } else if (star) {
538
- return iconStar;
539
- } else {
540
- throw Error("getSrc: no icon type specified");
541
- }
523
+ const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
524
+ if (add) return icon_add_default;
525
+ else if (del) return icon_cross_default;
526
+ else if (edit) return icon_edit_default;
527
+ else if (config) return icon_gear_default;
528
+ else if (duplicate) return icon_duplicate_default;
529
+ else if (search) return icon_lupe_default;
530
+ else if (download) return icon_download_default;
531
+ else if (sync) return icon_reload_default;
532
+ else if (fullscreen) return icon_fullscreen_default;
533
+ else if (iconKey) return icon_key_default;
534
+ else if (documentation) return icon_help_light_default;
535
+ else if (star) return icon_star_default;
536
+ else throw Error("getSrc: no icon type specified");
542
537
  }
543
538
  function getAlt(props) {
544
- const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
545
- if (add) {
546
- return "icon add";
547
- } else if (del) {
548
- return "icon delete";
549
- } else if (edit) {
550
- return "icon edit";
551
- } else if (config) {
552
- return "icon config";
553
- } else if (duplicate) {
554
- return "icon duplicate";
555
- } else if (search) {
556
- return "icon search";
557
- } else if (download) {
558
- return "icon download";
559
- } else if (sync) {
560
- return "icon sync";
561
- } else if (fullscreen) {
562
- return "icon fullscreen";
563
- } else if (iconKey) {
564
- return "icon iconKey";
565
- } else if (documentation) {
566
- return "icon documentation";
567
- } else if (star) {
568
- return "icon star";
569
- } else {
570
- throw Error("getAlt: no icon type specified");
571
- }
539
+ const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
540
+ if (add) return "icon add";
541
+ else if (del) return "icon delete";
542
+ else if (edit) return "icon edit";
543
+ else if (config) return "icon config";
544
+ else if (duplicate) return "icon duplicate";
545
+ else if (search) return "icon search";
546
+ else if (download) return "icon download";
547
+ else if (sync) return "icon sync";
548
+ else if (fullscreen) return "icon fullscreen";
549
+ else if (iconKey) return "icon iconKey";
550
+ else if (documentation) return "icon documentation";
551
+ else if (star) return "icon star";
552
+ else throw Error("getAlt: no icon type specified");
572
553
  }
573
554
  function Icon(props) {
574
- let style;
575
- if (props.large) {
576
- style = { width: 24, height: 24 };
577
- } else {
578
- style = { width: 16, height: 16 };
579
- }
580
- if (props.inverted) {
581
- style = { ...style, filter: "invert(1)" };
582
- }
583
- return /* @__PURE__ */ jsxRuntime.jsx("img", { src: getSrc(props), className: `di icon ${props.className || ""}`, alt: getAlt(props), style });
555
+ let style;
556
+ if (props.large) style = {
557
+ width: 24,
558
+ height: 24
559
+ };
560
+ else style = {
561
+ width: 16,
562
+ height: 16
563
+ };
564
+ if (props.inverted) style = {
565
+ ...style,
566
+ filter: "invert(1)"
567
+ };
568
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
569
+ src: getSrc(props),
570
+ className: `di icon ${props.className || ""}`,
571
+ alt: getAlt(props),
572
+ style
573
+ });
584
574
  }
585
- function Label({
586
- text,
587
- small = false,
588
- large = false,
589
- onDelete,
590
- className,
591
- onClick,
592
- children,
593
- ...dataTestIds
594
- }) {
595
- function handleDelete(event) {
596
- event.stopPropagation();
597
- if (onDelete) {
598
- onDelete();
599
- }
600
- }
601
- return /* @__PURE__ */ jsxRuntime.jsxs(
602
- "span",
603
- {
604
- onClick,
605
- className: cx("di label", className, { large, small, removable: onDelete, clickable: !!onClick }),
606
- "data-testid": dataTestIds["data-testid"],
607
- children: [
608
- typeof text === "string" ? text : text && /* @__PURE__ */ jsxRuntime.jsx(reactI18next.Trans, { i18nKey: text.id, children: text.defaultValue }),
609
- /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }),
610
- onDelete && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": dataTestIds["delete-button-data-testid"], className: "remove", onClick: handleDelete, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { del: true, inverted: true }) })
611
- ]
612
- }
613
- );
575
+ //#endregion
576
+ //#region src/components/label/Label.tsx
577
+ /**
578
+ * Label enables an easy way for marking or tagging elements.
579
+ */
580
+ function Label({ text, small = false, large = false, onDelete, className, onClick, children, ...dataTestIds }) {
581
+ function handleDelete(event) {
582
+ event.stopPropagation();
583
+ if (onDelete) onDelete();
584
+ }
585
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
586
+ onClick,
587
+ className: (0, classnames.default)("di label", className, {
588
+ large,
589
+ small,
590
+ removable: onDelete,
591
+ clickable: !!onClick
592
+ }),
593
+ "data-testid": dataTestIds["data-testid"],
594
+ children: [
595
+ typeof text === "string" ? text : text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
596
+ i18nKey: text.id,
597
+ children: text.defaultValue
598
+ }),
599
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }),
600
+ onDelete && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
601
+ "data-testid": dataTestIds["delete-button-data-testid"],
602
+ className: "remove",
603
+ onClick: handleDelete,
604
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
605
+ del: true,
606
+ inverted: true
607
+ })
608
+ })
609
+ ]
610
+ });
614
611
  }
615
- const MARGIN = 16;
616
- function Popup({
617
- placement = "bottom",
618
- mode = ["click"],
619
- disabled,
620
- handler,
621
- handlerWrapperClassName,
622
- preventDestroyContentOnHide,
623
- open,
624
- onOpenChange,
625
- className,
626
- children
627
- }) {
628
- const arrowRef = React.useRef(null);
629
- const {
630
- elements,
631
- update,
632
- refs,
633
- floatingStyles,
634
- context,
635
- middlewareData,
636
- placement: computedPlacement
637
- } = react.useFloating({
638
- placement,
639
- open,
640
- onOpenChange,
641
- whileElementsMounted: !preventDestroyContentOnHide ? react.autoUpdate : void 0,
642
- middleware: [
643
- react.offset({
644
- mainAxis: 12
645
- }),
646
- react.flip({
647
- padding: MARGIN,
648
- boundary: "clippingAncestors",
649
- altBoundary: true
650
- }),
651
- react.shift({
652
- padding: MARGIN,
653
- boundary: "clippingAncestors",
654
- altBoundary: true
655
- }),
656
- react.size({
657
- padding: MARGIN,
658
- boundary: "clippingAncestors",
659
- altBoundary: true,
660
- apply({ availableHeight, availableWidth, elements: elements2 }) {
661
- const width = `${Math.max(0, availableWidth - MARGIN)}px`;
662
- const height = `${Math.max(0, availableHeight - MARGIN)}px`;
663
- elements2.floating.style.maxWidth = width;
664
- elements2.floating.style.maxHeight = height;
665
- }
666
- }),
667
- react.arrow({
668
- element: arrowRef
669
- })
670
- ]
671
- });
672
- React.useEffect(() => {
673
- if (preventDestroyContentOnHide && open && elements.reference && elements.floating) {
674
- const cleanup = react.autoUpdate(elements.reference, elements.floating, update);
675
- return cleanup;
676
- }
677
- }, [elements.floating, elements.reference, open, update, preventDestroyContentOnHide]);
678
- const click = react.useClick(context, {
679
- enabled: !disabled && mode.includes("click"),
680
- keyboardHandlers: false
681
- // Prevent space key from being blocked in input fields (floating-ui issue #1812)
682
- });
683
- const hover = react.useHover(context, {
684
- enabled: !disabled && mode.includes("hover"),
685
- handleClose: react.safePolygon()
686
- });
687
- const focus = react.useFocus(context, { enabled: !disabled && mode.includes("focus") });
688
- const dismiss = react.useDismiss(context);
689
- const { getReferenceProps, getFloatingProps } = react.useInteractions([click, hover, focus, dismiss]);
690
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
691
- /* @__PURE__ */ jsxRuntime.jsx(
692
- "span",
693
- {
694
- style: { display: "inline-block" },
695
- className: cx("popup-handler-wrapper", handlerWrapperClassName),
696
- ref: refs.setReference,
697
- ...getReferenceProps(),
698
- children: handler
699
- }
700
- ),
701
- (open || preventDestroyContentOnHide) && /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(
702
- "div",
703
- {
704
- className: cx("di popup-wrapper", { hidden: preventDestroyContentOnHide && !open }),
705
- ref: refs.setFloating,
706
- style: { ...floatingStyles, zIndex: 1e5 },
707
- ...getFloatingProps(),
708
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("di popup", computedPlacement, className), children: [
709
- /* @__PURE__ */ jsxRuntime.jsx(
710
- "div",
711
- {
712
- className: cx("popup-arrow", computedPlacement),
713
- ref: arrowRef,
714
- style: { left: middlewareData.arrow?.x, top: middlewareData.arrow?.y }
715
- }
716
- ),
717
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "popup-content", children })
718
- ] })
719
- }
720
- ) })
721
- ] });
612
+ //#endregion
613
+ //#region src/components/popup/Popup.tsx
614
+ var MARGIN = 16;
615
+ /**
616
+ * Popup displays content within a small modal.
617
+ * Its usage is highly flexible and used in several other components.
618
+ */
619
+ function Popup({ placement = "bottom", mode = ["click"], disabled, handler, handlerWrapperClassName, preventDestroyContentOnHide, open, onOpenChange, className, children }) {
620
+ const arrowRef = (0, react.useRef)(null);
621
+ const { elements, update, refs, floatingStyles, context, middlewareData, placement: computedPlacement } = (0, _floating_ui_react.useFloating)({
622
+ placement,
623
+ open,
624
+ onOpenChange,
625
+ whileElementsMounted: !preventDestroyContentOnHide ? _floating_ui_react.autoUpdate : void 0,
626
+ middleware: [
627
+ (0, _floating_ui_react.offset)({ mainAxis: 12 }),
628
+ (0, _floating_ui_react.flip)({
629
+ padding: MARGIN,
630
+ boundary: "clippingAncestors",
631
+ altBoundary: true
632
+ }),
633
+ (0, _floating_ui_react.shift)({
634
+ padding: MARGIN,
635
+ boundary: "clippingAncestors",
636
+ altBoundary: true
637
+ }),
638
+ (0, _floating_ui_react.size)({
639
+ padding: MARGIN,
640
+ boundary: "clippingAncestors",
641
+ altBoundary: true,
642
+ apply({ availableHeight, availableWidth, elements }) {
643
+ const width = `${Math.max(0, availableWidth - MARGIN)}px`;
644
+ const height = `${Math.max(0, availableHeight - MARGIN)}px`;
645
+ elements.floating.style.maxWidth = width;
646
+ elements.floating.style.maxHeight = height;
647
+ }
648
+ }),
649
+ (0, _floating_ui_react.arrow)({ element: arrowRef })
650
+ ]
651
+ });
652
+ (0, react.useEffect)(() => {
653
+ if (preventDestroyContentOnHide && open && elements.reference && elements.floating) return (0, _floating_ui_react.autoUpdate)(elements.reference, elements.floating, update);
654
+ }, [
655
+ elements.floating,
656
+ elements.reference,
657
+ open,
658
+ update,
659
+ preventDestroyContentOnHide
660
+ ]);
661
+ const click = (0, _floating_ui_react.useClick)(context, {
662
+ enabled: !disabled && mode.includes("click"),
663
+ keyboardHandlers: false
664
+ });
665
+ const hover = (0, _floating_ui_react.useHover)(context, {
666
+ enabled: !disabled && mode.includes("hover"),
667
+ handleClose: (0, _floating_ui_react.safePolygon)()
668
+ });
669
+ const focus = (0, _floating_ui_react.useFocus)(context, { enabled: !disabled && mode.includes("focus") });
670
+ const dismiss = (0, _floating_ui_react.useDismiss)(context);
671
+ const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
672
+ click,
673
+ hover,
674
+ focus,
675
+ dismiss
676
+ ]);
677
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
678
+ style: { display: "inline-block" },
679
+ className: (0, classnames.default)("popup-handler-wrapper", handlerWrapperClassName),
680
+ ref: refs.setReference,
681
+ ...getReferenceProps(),
682
+ children: handler
683
+ }), (open || preventDestroyContentOnHide) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
684
+ className: (0, classnames.default)("di popup-wrapper", { hidden: preventDestroyContentOnHide && !open }),
685
+ ref: refs.setFloating,
686
+ style: {
687
+ ...floatingStyles,
688
+ zIndex: 1e5
689
+ },
690
+ ...getFloatingProps(),
691
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
692
+ className: (0, classnames.default)("di popup", computedPlacement, className),
693
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
694
+ className: (0, classnames.default)("popup-arrow", computedPlacement),
695
+ ref: arrowRef,
696
+ style: {
697
+ left: middlewareData.arrow?.x,
698
+ top: middlewareData.arrow?.y
699
+ }
700
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
701
+ className: "popup-content",
702
+ children
703
+ })]
704
+ })
705
+ }) })] });
722
706
  }
707
+ //#endregion
708
+ //#region src/components/bubble/Bubble.tsx
709
+ /**
710
+ * Bubbles are best used to provide some additional information like short instructions or help texts, which are then going to be displayed on Mouse-Over.
711
+ */
723
712
  function Bubble({ content, inverted, children, disabled, style, direction, className }) {
724
- const [open, setOpen] = React.useState(false);
725
- return /* @__PURE__ */ jsxRuntime.jsx(
726
- Popup,
727
- {
728
- open,
729
- onOpenChange: setOpen,
730
- handler: children,
731
- disabled,
732
- mode: ["hover"],
733
- placement: direction ? direction : "top",
734
- className: `bubble ${inverted ? "inverted" : ""} ${className ? className : ""}`,
735
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: `bubble-content`, style, children: content })
736
- }
737
- );
713
+ const [open, setOpen] = (0, react.useState)(false);
714
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popup, {
715
+ open,
716
+ onOpenChange: setOpen,
717
+ handler: children,
718
+ disabled,
719
+ mode: ["hover"],
720
+ placement: direction ? direction : "top",
721
+ className: `bubble ${inverted ? "inverted" : ""} ${className ? className : ""}`,
722
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
723
+ className: `bubble-content`,
724
+ style,
725
+ children: content
726
+ })
727
+ });
738
728
  }
729
+ //#endregion
730
+ //#region src/components/tooltip/Tooltip.tsx
731
+ /**
732
+ * Tooltip is best used to display some short additional information or description
733
+ */
739
734
  function Tooltip({ content, children, className, direction, disabled }) {
740
- const [open, setOpen] = React.useState(false);
741
- return /* @__PURE__ */ jsxRuntime.jsx(
742
- Popup,
743
- {
744
- open,
745
- disabled,
746
- mode: ["hover"],
747
- onOpenChange: setOpen,
748
- handler: children,
749
- placement: direction ? direction : "right",
750
- className: `tooltip inverted ${className ? className : ""}`,
751
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tooltip-content", children: content })
752
- }
753
- );
735
+ const [open, setOpen] = (0, react.useState)(false);
736
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popup, {
737
+ open,
738
+ disabled,
739
+ mode: ["hover"],
740
+ onOpenChange: setOpen,
741
+ handler: children,
742
+ placement: direction ? direction : "right",
743
+ className: `tooltip inverted ${className ? className : ""}`,
744
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
745
+ className: "tooltip-content",
746
+ children: content
747
+ })
748
+ });
754
749
  }
755
- class Tabs extends React__namespace.Component {
756
- state = {
757
- currentTab: this.props.pages.length ? this.props.pages[0].name : null
758
- };
759
- handleClick = (tab) => {
760
- if (this.props.onChange) {
761
- this.props.onChange(tab);
762
- } else if (typeof this.props.currentTab === "undefined") {
763
- this.setState({
764
- currentTab: tab
765
- });
766
- }
767
- };
768
- currentTabPage = () => {
769
- const currentTab = typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab;
770
- return this.props.pages.find(({ name }) => currentTab === name);
771
- };
772
- isCurrentTab = (tab) => {
773
- const currentTab = typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab;
774
- return currentTab === tab;
775
- };
776
- renderBody = () => {
777
- const page = this.currentTabPage();
778
- if (page && typeof page.renderBody === "function") {
779
- return page.renderBody();
780
- }
781
- return null;
782
- };
783
- render() {
784
- const { pages, disabled } = this.props;
785
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
786
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "di tabs", children: pages.map(
787
- ({ name, renderHeading, tabDescription }) => tabDescription ? /* @__PURE__ */ jsxRuntime.jsx(Bubble, { inverted: true, content: tabDescription, className: "bubble-tab-description", children: /* @__PURE__ */ jsxRuntime.jsx(
788
- "button",
789
- {
790
- "data-testid": "tab-button",
791
- className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
792
- onClick: () => !disabled && this.handleClick(name),
793
- children: renderHeading()
794
- }
795
- ) }, name) : /* @__PURE__ */ jsxRuntime.jsx(
796
- "button",
797
- {
798
- "data-testid": "tab-button",
799
- className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
800
- onClick: () => !disabled && this.handleClick(name),
801
- children: renderHeading()
802
- },
803
- name
804
- )
805
- ) }),
806
- this.renderBody()
807
- ] });
808
- }
809
- }
810
- const ClearButton = ({
811
- onChange,
812
- inputElement,
813
- style
814
- }) => /* @__PURE__ */ jsxRuntime.jsx(
815
- Button,
816
- {
817
- naked: true,
818
- onClick: () => {
819
- onChange("");
820
- if (inputElement) {
821
- inputElement.focus();
822
- }
823
- },
824
- style,
825
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { del: true })
826
- }
827
- );
828
- class SearchBox extends React__namespace.Component {
829
- state = {
830
- query: this.props.initialValue || ""
831
- };
832
- input;
833
- printPlaceholder() {
834
- const { t, placeholder } = this.props;
835
- if (typeof placeholder === "object") {
836
- return t(placeholder.id, {
837
- defaultValue: placeholder.defaultValue
838
- });
839
- } else {
840
- return placeholder;
841
- }
842
- }
843
- handleChange = (value) => {
844
- const { onChange } = this.props;
845
- this.setState({
846
- query: value
847
- });
848
- onChange(value);
849
- };
850
- handleKeyUp = ({ key }) => {
851
- const { onSubmit } = this.props;
852
- const { query } = this.state;
853
- if (key === "Enter" && typeof onSubmit === "function") {
854
- onSubmit(query);
855
- }
856
- };
857
- render() {
858
- const { onSubmit, style, clearable } = this.props;
859
- const { query } = this.state;
860
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "search-box", style, children: [
861
- /* @__PURE__ */ jsxRuntime.jsx(
862
- "input",
863
- {
864
- ref: (input) => {
865
- this.input = input;
866
- },
867
- type: "text",
868
- value: query,
869
- placeholder: this.printPlaceholder(),
870
- onKeyUp: this.handleKeyUp,
871
- onChange: ({ target: { value } }) => this.handleChange(value)
872
- }
873
- ),
874
- typeof onSubmit === "function" ? /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
875
- query && clearable && /* @__PURE__ */ jsxRuntime.jsx(
876
- ClearButton,
877
- {
878
- onChange: this.handleChange,
879
- inputElement: this.input,
880
- style: {
881
- right: 30
882
- }
883
- }
884
- ),
885
- /* @__PURE__ */ jsxRuntime.jsx(Button, { naked: true, onClick: () => onSubmit(query), children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { search: true }) })
886
- ] }) : query && clearable ? /* @__PURE__ */ jsxRuntime.jsx(ClearButton, { onChange: this.handleChange, inputElement: this.input }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { naked: true, disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { search: true }) })
887
- ] });
888
- }
889
- }
890
- const SearchBox_default = reactI18next.withTranslation()(SearchBox);
750
+ //#endregion
751
+ //#region src/components/tabs/Tabs.tsx
752
+ /**
753
+ * Tabs add the possibility to unite several homogeneous pages into one.
754
+ * Unlike RouteTabs, Tabs cannot be accessed directly via the browser's history
755
+ */
756
+ var Tabs = class extends react.Component {
757
+ state = { currentTab: this.props.pages.length ? this.props.pages[0].name : null };
758
+ handleClick = (tab) => {
759
+ if (this.props.onChange) this.props.onChange(tab);
760
+ else if (typeof this.props.currentTab === "undefined") this.setState({ currentTab: tab });
761
+ };
762
+ currentTabPage = () => {
763
+ const currentTab = typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab;
764
+ return this.props.pages.find(({ name }) => currentTab === name);
765
+ };
766
+ isCurrentTab = (tab) => {
767
+ return (typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab) === tab;
768
+ };
769
+ renderBody = () => {
770
+ const page = this.currentTabPage();
771
+ if (page && typeof page.renderBody === "function") return page.renderBody();
772
+ return null;
773
+ };
774
+ render() {
775
+ const { pages, disabled } = this.props;
776
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
777
+ className: "di tabs",
778
+ children: pages.map(({ name, renderHeading, tabDescription }) => tabDescription ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Bubble, {
779
+ inverted: true,
780
+ content: tabDescription,
781
+ className: "bubble-tab-description",
782
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
783
+ "data-testid": "tab-button",
784
+ className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
785
+ onClick: () => !disabled && this.handleClick(name),
786
+ children: renderHeading()
787
+ })
788
+ }, name) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
789
+ "data-testid": "tab-button",
790
+ className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
791
+ onClick: () => !disabled && this.handleClick(name),
792
+ children: renderHeading()
793
+ }, name))
794
+ }), this.renderBody()] });
795
+ }
796
+ };
797
+ //#endregion
798
+ //#region src/components/input/SearchBox.tsx
799
+ var ClearButton = ({ onChange, inputElement, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
800
+ naked: true,
801
+ onClick: () => {
802
+ onChange("");
803
+ if (inputElement) inputElement.focus();
804
+ },
805
+ style,
806
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { del: true })
807
+ });
808
+ /**
809
+ * SearchBox is used for searching content and provides a set of `props` for different user experiences
810
+ */
811
+ var SearchBox = class extends react.Component {
812
+ state = { query: this.props.initialValue || "" };
813
+ input;
814
+ printPlaceholder() {
815
+ const { t, placeholder } = this.props;
816
+ if (typeof placeholder === "object") return t(placeholder.id, { defaultValue: placeholder.defaultValue });
817
+ else return placeholder;
818
+ }
819
+ handleChange = (value) => {
820
+ const { onChange } = this.props;
821
+ this.setState({ query: value });
822
+ onChange(value);
823
+ };
824
+ handleKeyUp = ({ key }) => {
825
+ const { onSubmit } = this.props;
826
+ const { query } = this.state;
827
+ if (key === "Enter" && typeof onSubmit === "function") onSubmit(query);
828
+ };
829
+ render() {
830
+ const { onSubmit, style, clearable } = this.props;
831
+ const { query } = this.state;
832
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
833
+ className: "search-box",
834
+ style,
835
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
836
+ ref: (input) => {
837
+ this.input = input;
838
+ },
839
+ type: "text",
840
+ value: query,
841
+ placeholder: this.printPlaceholder(),
842
+ onKeyUp: this.handleKeyUp,
843
+ onChange: ({ target: { value } }) => this.handleChange(value)
844
+ }), typeof onSubmit === "function" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [query && clearable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearButton, {
845
+ onChange: this.handleChange,
846
+ inputElement: this.input,
847
+ style: { right: 30 }
848
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
849
+ naked: true,
850
+ onClick: () => onSubmit(query),
851
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { search: true })
852
+ })] }) : query && clearable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearButton, {
853
+ onChange: this.handleChange,
854
+ inputElement: this.input
855
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
856
+ naked: true,
857
+ disabled: true,
858
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { search: true })
859
+ })]
860
+ });
861
+ }
862
+ };
863
+ var SearchBox_default = (0, react_i18next.withTranslation)()(SearchBox);
864
+ //#endregion
891
865
  exports.Accordion = Accordion;
892
866
  exports.AccordionItem = AccordionItem;
893
867
  exports.Bubble = Bubble;
894
- exports.Button = Button;
868
+ exports.Button = Button_default;
895
869
  exports.ButtonRow = ButtonRow;
896
870
  exports.Checkbox = Checkbox_default;
897
871
  exports.ConfirmProvider = ConfirmProvider;
@@ -907,4 +881,5 @@ exports.Tabs = Tabs;
907
881
  exports.Tooltip = Tooltip;
908
882
  exports.useConfirm = useConfirm;
909
883
  exports.withConfirm = withConfirm;
910
- //# sourceMappingURL=index.cjs.map
884
+
885
+ //# sourceMappingURL=index.cjs.map