@deviceinsight/ng-ui-basic-components 7.16.0 → 7.18.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,866 @@
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 ? __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
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
309
+ className: `di spinner-wrapper ${className ? className : ""}`,
310
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
311
+ className: `di spinner-container ${show ? "visible" : ""}`,
312
+ "data-testid": this.props["data-testid"],
313
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, {
314
+ size,
315
+ center: true
316
+ })
317
+ }), children]
318
+ });
319
+ }
330
320
  };
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
- );
321
+ //#endregion
322
+ //#region src/components/input/Checkbox.tsx
323
+ var getWrapperClassName = (type, small) => {
324
+ switch (type) {
325
+ case "checkbox":
326
+ case "radio": return "di checkbox";
327
+ case "toggle": return small ? "di toggle toggle-small" : "di toggle";
328
+ default: throw Error(`type not support: ${type}`);
329
+ }
381
330
  };
382
- const Checkbox_default = reactI18next.withTranslation()(Checkbox);
331
+ var getCheckboxClassName = (type, small) => {
332
+ switch (type) {
333
+ case "checkbox": return "box";
334
+ case "radio": return "radio";
335
+ case "toggle": return small ? "switch switch-small" : "switch";
336
+ default: throw Error(`type not support: ${type}`);
337
+ }
338
+ };
339
+ /**
340
+ * Checkbox for enabling user interaction can have one of multiple types which are defined via the `type` prop.
341
+ */
342
+ var Checkbox = ({ type = "checkbox", value, onChange, title, label, disabled = false, toggleSmall = false, toggleColor = "#259b23", t, ...other }) => {
343
+ const style = type === "toggle" ? { backgroundColor: value ? toggleColor : "gray" } : {};
344
+ const tooltip = title ? t(title.id, { defaultValue: title.defaultValue }) : void 0;
345
+ const labelText = label ? t(label.id, { defaultValue: label.defaultValue }) : null;
346
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
347
+ title: tooltip,
348
+ className: getWrapperClassName(type, toggleSmall),
349
+ "data-testid": other["wrapper-data-testid"],
350
+ children: [
351
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
352
+ type: "checkbox",
353
+ checked: value,
354
+ disabled,
355
+ onChange: () => onChange(!value),
356
+ "data-testid": other["data-testid"]
357
+ }),
358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
359
+ className: getCheckboxClassName(type, toggleSmall),
360
+ style,
361
+ "data-testid": other["innerdiv-data-testid"]
362
+ }),
363
+ label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
364
+ className: "textlabel",
365
+ children: labelText
366
+ })
367
+ ]
368
+ });
369
+ };
370
+ var Checkbox_default = (0, react_i18next.withTranslation)()(Checkbox);
371
+ //#endregion
372
+ //#region src/components/confirm/utils.ts
383
373
  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;
374
+ const result = typeof arg === "object" && typeof arg.id === "string" && typeof arg.defaultValue === "string";
375
+ if (result) console.warn("Please use strings instead of TranslationDescriptors to initialize the Confirm modal, because TranslationDescriptors are deprecated");
376
+ return result;
391
377
  }
378
+ //#endregion
379
+ //#region src/components/confirm/Confirm.tsx
392
380
  function transformTextToElement(message) {
393
- if (isTranslationDescriptor(message)) {
394
- return /* @__PURE__ */ jsxRuntime.jsx(reactI18next.Trans, { i18nKey: message.id, children: message.defaultValue });
395
- }
396
- return message;
381
+ if (isTranslationDescriptor(message)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
382
+ i18nKey: message.id,
383
+ children: message.defaultValue
384
+ });
385
+ return message;
397
386
  }
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
- );
387
+ /**
388
+ * Confirm enables the possibility to open up a dialog within a modal, requiring additional user actions.
389
+ * This component should not be used directly, instead use `@withConfirm` to inject a promise based confirm method
390
+ */
391
+ function Confirm({ title, message, onAccept, onDecline, acceptButtonLabel, declineButtonLabel, acceptButtonStyle = "primary" }) {
392
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Modal, {
393
+ header: transformTextToElement(title),
394
+ content: transformTextToElement(message),
395
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
396
+ primary: acceptButtonStyle === "primary",
397
+ danger: acceptButtonStyle === "danger",
398
+ onClick: onAccept,
399
+ children: acceptButtonLabel ? transformTextToElement(acceptButtonLabel) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
400
+ i18nKey: "form.accept",
401
+ children: "Accept"
402
+ })
403
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
404
+ onClick: onDecline,
405
+ children: declineButtonLabel ? transformTextToElement(declineButtonLabel) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
406
+ i18nKey: "form.decline",
407
+ children: "Decline"
408
+ })
409
+ })] }),
410
+ width: 500
411
+ });
427
412
  }
428
- const ConfirmContext = React.createContext({
429
- confirm: () => Promise.reject(new Error("ConfirmProvider is missing!"))
430
- });
413
+ //#endregion
414
+ //#region src/components/confirm/ConfirmProvider.tsx
415
+ var ConfirmContext = (0, react.createContext)({ confirm: () => Promise.reject(/* @__PURE__ */ new Error("ConfirmProvider is missing!")) });
431
416
  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
- ] });
417
+ const [visible, setVisible] = (0, react.useState)(false);
418
+ const [confirmProps, setConfirmProps] = (0, react.useState)({
419
+ title: "",
420
+ message: "",
421
+ onAccept: () => {},
422
+ onDecline: () => {}
423
+ });
424
+ async function confirm(options) {
425
+ return new Promise((resolve) => {
426
+ setVisible(true);
427
+ setConfirmProps({
428
+ ...options,
429
+ onAccept: () => {
430
+ setVisible(false);
431
+ resolve(true);
432
+ },
433
+ onDecline: () => {
434
+ setVisible(false);
435
+ resolve(false);
436
+ }
437
+ });
438
+ });
439
+ }
440
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ConfirmContext.Provider, {
441
+ value: { confirm },
442
+ children: [children, visible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Confirm, { ...confirmProps })]
443
+ });
461
444
  }
445
+ //#endregion
446
+ //#region src/components/confirm/useConfirm.ts
462
447
  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;
448
+ const context = (0, react.useContext)(ConfirmContext);
449
+ if (!context) throw new Error("ConfirmProvider is missing");
450
+ const { confirm } = context;
451
+ return confirm;
469
452
  }
453
+ //#endregion
454
+ //#region src/components/confirm/withConfirm.tsx
470
455
  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
- };
456
+ function WithConfirm(props) {
457
+ const confirm = useConfirm();
458
+ const { t } = (0, react_i18next.useTranslation)();
459
+ function trans(arg) {
460
+ if (isTranslationDescriptor(arg)) return t(arg.id, { defaultValue: arg.defaultValue });
461
+ return arg;
462
+ }
463
+ async function deprecatedConfirm(title, message, acceptButtonLabel, declineButtonLabel, resolveWithConfirmation, acceptButtonStyle) {
464
+ const accepted = await confirm({
465
+ title: trans(title),
466
+ message: isTranslationDescriptor(message) ? trans(message) : message,
467
+ acceptButtonLabel: acceptButtonLabel ? trans(acceptButtonLabel) : void 0,
468
+ declineButtonLabel: declineButtonLabel ? trans(declineButtonLabel) : void 0,
469
+ acceptButtonStyle
470
+ });
471
+ if (resolveWithConfirmation) return accepted;
472
+ else if (!accepted) return new Promise(() => {});
473
+ }
474
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WrappedComponent, {
475
+ ...props,
476
+ confirm: deprecatedConfirm
477
+ });
478
+ }
479
+ return function WithConfirmWrapper(props) {
480
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConfirmProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WithConfirm, { ...props }) });
481
+ };
500
482
  }
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";
483
+ //#endregion
484
+ //#region src/assets/svg/icon_add.svg
485
+ 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";
486
+ //#endregion
487
+ //#region src/assets/svg/icon_cross.svg
488
+ 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";
489
+ //#endregion
490
+ //#region src/assets/svg/icon_edit.svg
491
+ 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";
492
+ //#endregion
493
+ //#region src/assets/svg/icon_gear.svg
494
+ 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";
495
+ //#endregion
496
+ //#region src/assets/svg/icon_duplicate.svg
497
+ 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";
498
+ //#endregion
499
+ //#region src/assets/svg/icon_download.svg
500
+ 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";
501
+ //#endregion
502
+ //#region src/assets/svg/icon_lupe.svg
503
+ 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";
504
+ //#endregion
505
+ //#region src/assets/svg/icon_key.svg
506
+ 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";
507
+ //#endregion
508
+ //#region src/assets/svg/icon_reload.svg
509
+ 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";
510
+ //#endregion
511
+ //#region src/assets/svg/icon_fullscreen.svg
512
+ 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";
513
+ //#endregion
514
+ //#region src/assets/svg/icon_help_light.svg
515
+ 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";
516
+ //#endregion
517
+ //#region src/assets/svg/icon_star.svg
518
+ 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";
519
+ //#endregion
520
+ //#region src/components/icon/Icon.tsx
513
521
  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
- }
522
+ const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
523
+ if (add) return icon_add_default;
524
+ else if (del) return icon_cross_default;
525
+ else if (edit) return icon_edit_default;
526
+ else if (config) return icon_gear_default;
527
+ else if (duplicate) return icon_duplicate_default;
528
+ else if (search) return icon_lupe_default;
529
+ else if (download) return icon_download_default;
530
+ else if (sync) return icon_reload_default;
531
+ else if (fullscreen) return icon_fullscreen_default;
532
+ else if (iconKey) return icon_key_default;
533
+ else if (documentation) return icon_help_light_default;
534
+ else if (star) return icon_star_default;
535
+ else throw Error("getSrc: no icon type specified");
542
536
  }
543
537
  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
- }
538
+ const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
539
+ if (add) return "icon add";
540
+ else if (del) return "icon delete";
541
+ else if (edit) return "icon edit";
542
+ else if (config) return "icon config";
543
+ else if (duplicate) return "icon duplicate";
544
+ else if (search) return "icon search";
545
+ else if (download) return "icon download";
546
+ else if (sync) return "icon sync";
547
+ else if (fullscreen) return "icon fullscreen";
548
+ else if (iconKey) return "icon iconKey";
549
+ else if (documentation) return "icon documentation";
550
+ else if (star) return "icon star";
551
+ else throw Error("getAlt: no icon type specified");
572
552
  }
573
553
  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 });
554
+ let style;
555
+ if (props.large) style = {
556
+ width: 24,
557
+ height: 24
558
+ };
559
+ else style = {
560
+ width: 16,
561
+ height: 16
562
+ };
563
+ if (props.inverted) style = {
564
+ ...style,
565
+ filter: "invert(1)"
566
+ };
567
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
568
+ src: getSrc(props),
569
+ className: `di icon ${props.className || ""}`,
570
+ alt: getAlt(props),
571
+ style
572
+ });
584
573
  }
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
- );
574
+ //#endregion
575
+ //#region src/components/label/Label.tsx
576
+ /**
577
+ * Label enables an easy way for marking or tagging elements.
578
+ */
579
+ function Label({ text, small = false, large = false, onDelete, className, onClick, children, ...dataTestIds }) {
580
+ function handleDelete(event) {
581
+ event.stopPropagation();
582
+ if (onDelete) onDelete();
583
+ }
584
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
585
+ onClick,
586
+ className: (0, classnames.default)("di label", className, {
587
+ large,
588
+ small,
589
+ removable: onDelete,
590
+ clickable: !!onClick
591
+ }),
592
+ "data-testid": dataTestIds["data-testid"],
593
+ children: [
594
+ typeof text === "string" ? text : text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_i18next.Trans, {
595
+ i18nKey: text.id,
596
+ children: text.defaultValue
597
+ }),
598
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }),
599
+ onDelete && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
600
+ "data-testid": dataTestIds["delete-button-data-testid"],
601
+ className: "remove",
602
+ onClick: handleDelete,
603
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
604
+ del: true,
605
+ inverted: true
606
+ })
607
+ })
608
+ ]
609
+ });
614
610
  }
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
- ] });
611
+ //#endregion
612
+ //#region src/components/popup/Popup.tsx
613
+ var MARGIN = 16;
614
+ /**
615
+ * Popup displays content within a small modal.
616
+ * Its usage is highly flexible and used in several other components.
617
+ */
618
+ function Popup({ placement = "bottom", mode = ["click"], disabled, handler, handlerWrapperClassName, preventDestroyContentOnHide, open, onOpenChange, className, children }) {
619
+ const arrowRef = (0, react.useRef)(null);
620
+ const { elements, update, refs, floatingStyles, context, middlewareData, placement: computedPlacement } = (0, _floating_ui_react.useFloating)({
621
+ placement,
622
+ open,
623
+ onOpenChange,
624
+ whileElementsMounted: !preventDestroyContentOnHide ? _floating_ui_react.autoUpdate : void 0,
625
+ middleware: [
626
+ (0, _floating_ui_react.offset)({ mainAxis: 12 }),
627
+ (0, _floating_ui_react.flip)({
628
+ padding: MARGIN,
629
+ boundary: "clippingAncestors",
630
+ altBoundary: true
631
+ }),
632
+ (0, _floating_ui_react.shift)({
633
+ padding: MARGIN,
634
+ boundary: "clippingAncestors",
635
+ altBoundary: true
636
+ }),
637
+ (0, _floating_ui_react.size)({
638
+ padding: MARGIN,
639
+ boundary: "clippingAncestors",
640
+ altBoundary: true,
641
+ apply({ availableHeight, availableWidth, elements }) {
642
+ const width = `${Math.max(0, availableWidth - MARGIN)}px`;
643
+ const height = `${Math.max(0, availableHeight - MARGIN)}px`;
644
+ elements.floating.style.maxWidth = width;
645
+ elements.floating.style.maxHeight = height;
646
+ }
647
+ }),
648
+ (0, _floating_ui_react.arrow)({ element: arrowRef })
649
+ ]
650
+ });
651
+ (0, react.useEffect)(() => {
652
+ if (preventDestroyContentOnHide && open && elements.reference && elements.floating) return (0, _floating_ui_react.autoUpdate)(elements.reference, elements.floating, update);
653
+ }, [
654
+ elements.floating,
655
+ elements.reference,
656
+ open,
657
+ update,
658
+ preventDestroyContentOnHide
659
+ ]);
660
+ const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
661
+ (0, _floating_ui_react.useClick)(context, {
662
+ enabled: !disabled && mode.includes("click"),
663
+ keyboardHandlers: false
664
+ }),
665
+ (0, _floating_ui_react.useHover)(context, {
666
+ enabled: !disabled && mode.includes("hover"),
667
+ handleClose: (0, _floating_ui_react.safePolygon)()
668
+ }),
669
+ (0, _floating_ui_react.useFocus)(context, { enabled: !disabled && mode.includes("focus") }),
670
+ (0, _floating_ui_react.useDismiss)(context)
671
+ ]);
672
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
673
+ style: { display: "inline-block" },
674
+ className: (0, classnames.default)("popup-handler-wrapper", handlerWrapperClassName),
675
+ ref: refs.setReference,
676
+ ...getReferenceProps(),
677
+ children: handler
678
+ }), (open || preventDestroyContentOnHide) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
679
+ className: (0, classnames.default)("di popup-wrapper", { hidden: preventDestroyContentOnHide && !open }),
680
+ ref: refs.setFloating,
681
+ style: {
682
+ ...floatingStyles,
683
+ zIndex: 1e5
684
+ },
685
+ ...getFloatingProps(),
686
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
687
+ className: (0, classnames.default)("di popup", computedPlacement, className),
688
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
689
+ className: (0, classnames.default)("popup-arrow", computedPlacement),
690
+ ref: arrowRef,
691
+ style: {
692
+ left: middlewareData.arrow?.x,
693
+ top: middlewareData.arrow?.y
694
+ }
695
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
696
+ className: "popup-content",
697
+ children
698
+ })]
699
+ })
700
+ }) })] });
722
701
  }
702
+ //#endregion
703
+ //#region src/components/bubble/Bubble.tsx
704
+ /**
705
+ * 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.
706
+ */
723
707
  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
- );
708
+ const [open, setOpen] = (0, react.useState)(false);
709
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popup, {
710
+ open,
711
+ onOpenChange: setOpen,
712
+ handler: children,
713
+ disabled,
714
+ mode: ["hover"],
715
+ placement: direction ? direction : "top",
716
+ className: `bubble ${inverted ? "inverted" : ""} ${className ? className : ""}`,
717
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
718
+ className: `bubble-content`,
719
+ style,
720
+ children: content
721
+ })
722
+ });
738
723
  }
724
+ //#endregion
725
+ //#region src/components/tooltip/Tooltip.tsx
726
+ /**
727
+ * Tooltip is best used to display some short additional information or description
728
+ */
739
729
  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
- );
730
+ const [open, setOpen] = (0, react.useState)(false);
731
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popup, {
732
+ open,
733
+ disabled,
734
+ mode: ["hover"],
735
+ onOpenChange: setOpen,
736
+ handler: children,
737
+ placement: direction ? direction : "right",
738
+ className: `tooltip inverted ${className ? className : ""}`,
739
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
740
+ className: "tooltip-content",
741
+ children: content
742
+ })
743
+ });
754
744
  }
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);
745
+ //#endregion
746
+ //#region src/components/tabs/Tabs.tsx
747
+ /**
748
+ * Tabs add the possibility to unite several homogeneous pages into one.
749
+ * Unlike RouteTabs, Tabs cannot be accessed directly via the browser's history
750
+ */
751
+ var Tabs = class extends react.Component {
752
+ state = { currentTab: this.props.pages.length ? this.props.pages[0].name : null };
753
+ handleClick = (tab) => {
754
+ if (this.props.onChange) this.props.onChange(tab);
755
+ else if (typeof this.props.currentTab === "undefined") this.setState({ currentTab: tab });
756
+ };
757
+ currentTabPage = () => {
758
+ const currentTab = typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab;
759
+ return this.props.pages.find(({ name }) => currentTab === name);
760
+ };
761
+ isCurrentTab = (tab) => {
762
+ return (typeof this.props.currentTab === "string" ? this.props.currentTab : this.state.currentTab) === tab;
763
+ };
764
+ renderBody = () => {
765
+ const page = this.currentTabPage();
766
+ if (page && typeof page.renderBody === "function") return page.renderBody();
767
+ return null;
768
+ };
769
+ render() {
770
+ const { pages, disabled } = this.props;
771
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
772
+ className: "di tabs",
773
+ children: pages.map(({ name, renderHeading, tabDescription }) => tabDescription ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Bubble, {
774
+ inverted: true,
775
+ content: tabDescription,
776
+ className: "bubble-tab-description",
777
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
778
+ "data-testid": "tab-button",
779
+ className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
780
+ onClick: () => !disabled && this.handleClick(name),
781
+ children: renderHeading()
782
+ })
783
+ }, name) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
784
+ "data-testid": "tab-button",
785
+ className: `item ${disabled ? "disabled" : ""} ${this.isCurrentTab(name) ? "active" : ""}`,
786
+ onClick: () => !disabled && this.handleClick(name),
787
+ children: renderHeading()
788
+ }, name))
789
+ }), this.renderBody()] });
790
+ }
791
+ };
792
+ //#endregion
793
+ //#region src/components/input/SearchBox.tsx
794
+ var ClearButton = ({ onChange, inputElement, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
795
+ naked: true,
796
+ onClick: () => {
797
+ onChange("");
798
+ if (inputElement) inputElement.focus();
799
+ },
800
+ style,
801
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { del: true })
802
+ });
803
+ /**
804
+ * SearchBox is used for searching content and provides a set of `props` for different user experiences
805
+ */
806
+ var SearchBox = class extends react.Component {
807
+ state = { query: this.props.initialValue || "" };
808
+ input;
809
+ printPlaceholder() {
810
+ const { t, placeholder } = this.props;
811
+ if (typeof placeholder === "object") return t(placeholder.id, { defaultValue: placeholder.defaultValue });
812
+ else return placeholder;
813
+ }
814
+ handleChange = (value) => {
815
+ const { onChange } = this.props;
816
+ this.setState({ query: value });
817
+ onChange(value);
818
+ };
819
+ handleKeyUp = ({ key }) => {
820
+ const { onSubmit } = this.props;
821
+ const { query } = this.state;
822
+ if (key === "Enter" && typeof onSubmit === "function") onSubmit(query);
823
+ };
824
+ render() {
825
+ const { onSubmit, style, clearable } = this.props;
826
+ const { query } = this.state;
827
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
828
+ className: "search-box",
829
+ style,
830
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
831
+ ref: (input) => {
832
+ this.input = input;
833
+ },
834
+ type: "text",
835
+ value: query,
836
+ placeholder: this.printPlaceholder(),
837
+ onKeyUp: this.handleKeyUp,
838
+ onChange: ({ target: { value } }) => this.handleChange(value)
839
+ }), typeof onSubmit === "function" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [query && clearable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearButton, {
840
+ onChange: this.handleChange,
841
+ inputElement: this.input,
842
+ style: { right: 30 }
843
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
844
+ naked: true,
845
+ onClick: () => onSubmit(query),
846
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { search: true })
847
+ })] }) : query && clearable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearButton, {
848
+ onChange: this.handleChange,
849
+ inputElement: this.input
850
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button_default, {
851
+ naked: true,
852
+ disabled: true,
853
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { search: true })
854
+ })]
855
+ });
856
+ }
857
+ };
858
+ var SearchBox_default = (0, react_i18next.withTranslation)()(SearchBox);
859
+ //#endregion
891
860
  exports.Accordion = Accordion;
892
861
  exports.AccordionItem = AccordionItem;
893
862
  exports.Bubble = Bubble;
894
- exports.Button = Button;
863
+ exports.Button = Button_default;
895
864
  exports.ButtonRow = ButtonRow;
896
865
  exports.Checkbox = Checkbox_default;
897
866
  exports.ConfirmProvider = ConfirmProvider;
@@ -907,4 +876,5 @@ exports.Tabs = Tabs;
907
876
  exports.Tooltip = Tooltip;
908
877
  exports.useConfirm = useConfirm;
909
878
  exports.withConfirm = withConfirm;
910
- //# sourceMappingURL=index.cjs.map
879
+
880
+ //# sourceMappingURL=index.cjs.map