@hortiview/shared-components 0.0.4540 → 0.0.4721

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.
Files changed (62) hide show
  1. package/README.md +101 -29
  2. package/dist/{ListAreaService-CFOmATRF.js → ListAreaService-BQCdQv7a.js} +5 -5
  3. package/dist/assets/{main.css → DeleteModal.css} +2 -2
  4. package/dist/assets/Disclaimer.css +1 -0
  5. package/dist/assets/HeaderFilter.css +1 -0
  6. package/dist/assets/Scrollbar.css +1 -0
  7. package/dist/{component-D1YrRAXe.js → component-DCtofpGS.js} +61 -54
  8. package/dist/components/BaseView/BaseView.js +2 -2
  9. package/dist/components/BaseView/BaseView.test.js +15 -14
  10. package/dist/components/BasicHeading/BasicHeading.d.ts +2 -5
  11. package/dist/components/BasicHeading/BasicHeading.js +2 -2
  12. package/dist/components/BasicHeading/BasicHeading.test.js +33 -333
  13. package/dist/components/BlockView/BlockView.js +5 -5
  14. package/dist/components/BlockView/BlockView.test.js +15 -14
  15. package/dist/components/DeleteModal/DeleteModal.d.ts +65 -0
  16. package/dist/components/DeleteModal/DeleteModal.js +4721 -0
  17. package/dist/components/DeleteModal/DeleteModal.test.d.ts +1 -0
  18. package/dist/components/DeleteModal/DeleteModal.test.js +85 -0
  19. package/dist/components/Disclaimer/Disclaimer.d.ts +33 -0
  20. package/dist/components/Disclaimer/Disclaimer.js +24 -0
  21. package/dist/components/Disclaimer/Disclaimer.test.d.ts +1 -0
  22. package/dist/components/Disclaimer/Disclaimer.test.js +13 -0
  23. package/dist/components/EmptyView/EmptyView.js +4 -4
  24. package/dist/components/EmptyView/EmptyView.test.js +14 -13
  25. package/dist/components/HashTabView/HashTabView.js +5 -5
  26. package/dist/components/HashTabView/HashTabView.test.js +9 -8
  27. package/dist/components/HeaderFilter/HeaderFilter.d.ts +33 -0
  28. package/dist/components/HeaderFilter/HeaderFilter.js +7606 -0
  29. package/dist/components/HeaderFilter/HeaderFilter.test.d.ts +1 -0
  30. package/dist/components/HeaderFilter/HeaderFilter.test.js +46 -0
  31. package/dist/components/Iconify/Iconify.js +1 -1
  32. package/dist/components/Iconify/Iconify.test.js +8 -7
  33. package/dist/components/ListArea/ListArea.js +298 -5351
  34. package/dist/components/ListArea/ListArea.test.js +4 -3
  35. package/dist/components/ListArea/ListAreaService.js +3 -3
  36. package/dist/components/Scrollbar/Scrollbar.d.ts +2 -0
  37. package/dist/components/Scrollbar/Scrollbar.js +9 -0
  38. package/dist/components/Scrollbar/scrollbar.test.d.ts +1 -0
  39. package/dist/components/Scrollbar/scrollbar.test.js +15 -0
  40. package/dist/components/SearchBar/SearchBar.js +2052 -3
  41. package/dist/components/SearchBar/SearchBar.test.js +16 -15
  42. package/dist/components/VerticalDivider/VerticalDivider.test.js +8 -7
  43. package/dist/{index.es-Cv6meSAn.js → index.es-3I3oam0G.js} +1 -1
  44. package/dist/{index.es-WZ1mqvGz.js → index.es-BahjEG5L.js} +104 -97
  45. package/dist/index.es-BcHAMD5J.js +5068 -0
  46. package/dist/index.es-C3EKMb0J.js +305 -0
  47. package/dist/{index.es-CUWXKh7P.js → index.es-CcfZlo4c.js} +8 -8
  48. package/dist/index.es-DVNdCQvl.js +1192 -0
  49. package/dist/{index.es-mBp_Btvi.js → index.es-STyHqa-8.js} +2 -2
  50. package/dist/{index.es-DYsXox--.js → index.es-hAl7Wxm5.js} +1 -1
  51. package/dist/{index.es-BD4kFWFx.js → index.es-z8RCxF8n.js} +3 -3
  52. package/dist/main.d.ts +5 -1
  53. package/dist/main.js +33 -23
  54. package/dist/react.esm-BeDwcQWb.js +12741 -0
  55. package/dist/services/UtilService.d.ts +6 -0
  56. package/dist/services/UtilService.js +4 -0
  57. package/dist/services/services.test.d.ts +1 -0
  58. package/dist/services/services.test.js +22 -0
  59. package/dist/vi.JYQecGiw-BbUbJcT8.js +9795 -0
  60. package/package.json +1 -1
  61. package/dist/SearchBar-CY2zfu6B.js +0 -3232
  62. package/dist/vi.JYQecGiw-8gz0k16C.js +0 -22532
@@ -1,336 +1,36 @@
1
- import { jsx as g, Fragment as st } from "react/jsx-runtime";
2
- import { BasicHeading as w } from "./BasicHeading.js";
3
- import { d as ut, t as T, r as k, s as p, g as a } from "../../vi.JYQecGiw-8gz0k16C.js";
4
- import { d as s, P as t, b as ct, e as W, _ as J, c as X } from "../../index.es-WZ1mqvGz.js";
5
- import m, { forwardRef as F, useRef as mt, useImperativeHandle as bt, useCallback as G } from "react";
6
- import { R as ft } from "../../index.es-mBp_Btvi.js";
7
- import { I as z } from "../../index.es-Cv6meSAn.js";
8
- const pt = {
9
- /**
10
- * @deprecated _Use `themeColor='secondary'` instead._
11
- *
12
- * Preview feature, this may change. Apply alternative button color scheme (defined by the individual theme).
13
- *
14
- * Defaults to **undefined**.
15
- */
16
- altColor: s(t.bool, "Button", 'Use `themeColor="secondary"` instead.'),
17
- /**
18
- * One of 'xsmall', 'small', 'medium', 'large' and 'xlarge' will change the size of the button. Defaults according to your theme.
19
- *
20
- * Defaults to **'themeDefault'**.
21
- */
22
- buttonSize: t.oneOf(["xsmall", "small", "medium", "large", "xlarge", "themeDefault"]),
23
- /**
24
- * Content to be rendered inside the button. Can be used instead `label` of to provide more flexibility. Accepts any valid markup. _Warning, if Label is set, it will be used instead of child content._
25
- *
26
- * Defaults to **null**.
27
- */
28
- children: t.node,
29
- /**
30
- * The css class name to be passed through to the component markup.
31
- *
32
- * Defaults to **undefined**.
33
- */
34
- className: t.string,
35
- /**
36
- * @deprecated _forwardRef has been implemented for Button._
37
- *
38
- * Reference to the DOM button. This enables a greater level of integration.
39
- *
40
- * Defaults to **undefined**.
41
- */
42
- customRef: s(t.oneOfType([
43
- t.func,
44
- // eslint-disable-next-line react/forbid-prop-types
45
- t.shape({
46
- current: t.any
47
- })
48
- ]), "Button", "forwardRef has been implemented for Button."),
49
- /**
50
- * @deprecated _Use `variant='danger'` instead._
51
- *
52
- * Apply danger style to the button.
53
- *
54
- * Defaults to **undefined**.
55
- */
56
- danger: s(t.bool, "Button", 'Use `variant="danger"` instead.'),
57
- /**
58
- * Prevent the user from interacting with the component.
59
- *
60
- * Defaults to **false**.
61
- */
62
- disabled: t.bool,
63
- /**
64
- * Sets elevation of the button. Default will be the theme default.
65
- *
66
- * Defaults to **'default'**.
67
- */
68
- elevation: t.oneOf(["default", "elevated", "flat"]),
69
- /**
70
- * @deprecated _Use `variant='filled'` instead._
71
- *
72
- * Apply a filled-in style. Previously called `primary`.
73
- *
74
- * Defaults to **undefined**.
75
- */
76
- filled: s(t.bool, "Button", 'Use `variant="filled"` instead.'),
77
- /**
78
- * Applies a full-width style where the textfield will fill it's container.
79
- *
80
- * Defaults to **false**.
81
- */
82
- fullWidth: t.bool,
83
- /**
84
- * The button will render as an anchor tag. If the tag prop is set, that prop will take precedence.
85
- *
86
- * Defaults to **null**.
87
- */
88
- href: t.string,
89
- /**
90
- * The displayed text. Expects a valid string. If label and children are both set, label will take priority.
91
- *
92
- * Defaults to **null**.
93
- */
94
- label: t.string,
95
- /**
96
- * Adds the given Icon to the left of the button text. May not be used with `trailingIcon` - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control,
97
- *
98
- * Defaults to **undefined**.
99
- */
100
- leadingIcon: t.oneOfType([t.string, t.func, t.node]),
101
- /**
102
- * The primary interaction event for button.
103
- *
104
- * Defaults to **null**.
105
- */
106
- onClick: t.func,
107
- /**
108
- * @deprecated _Use `variant='outlined'`._
109
- *
110
- * Apply outlined style to the button. Previously called `secondary`.
111
- *
112
- * Defaults to **undefined**.
113
- */
114
- outlined: s(t.bool, "Button", 'Use `variant="outlined"`.'),
115
- /**
116
- * @deprecated _Use `variant='filled'` instead._
117
- *
118
- * Apply primary style to the Button.
119
- *
120
- * Defaults to **undefined**.
121
- */
122
- primary: s(t.bool, "Button", 'Use `variant="filled"` instead.'),
123
- /**
124
- * @deprecated _Use `'variant=outlined'` instead._
125
- *
126
- * Apply secondary style to the Button.
127
- *
128
- * Defaults to **undefined**.
129
- */
130
- secondary: s(t.bool, "Button", 'Use `"variant=outlined"` instead.'),
131
- /**
132
- * By default a button or anchor tag will be rendered, this allows another tag/component to be used instead. A block type element/component is suggested.
133
- *
134
- * Defaults to **null**.
135
- */
136
- tag: t.oneOfType([t.string, t.elementType, t.instanceOf(m.Component)]),
137
- /**
138
- * @deprecated _Use `variant='embedded'` instead._
139
- *
140
- * Apply tertiary style to the Button.
141
- *
142
- * Defaults to **undefined**.
143
- */
144
- tertiary: s(t.bool, "Button", 'Use `variant="embedded"` instead.'),
145
- /**
146
- * @deprecated _Use `variant='text'` instead._
147
- *
148
- * Apply unfilled, un-outlined style to the Button. Previously called `tertiary`.
149
- *
150
- * Defaults to **undefined**.
151
- */
152
- text: s(t.bool, "Button", 'Use `variant="text"` instead.'),
153
- /**
154
- * Sets the theme color for the button. Most commonly used when the control is placed on a darker surface.
155
- *
156
- * Defaults to **'primary'**.
157
- */
158
- themeColor: ct(t.oneOf(["primary", "secondary", "danger", "success", "on-unknown-black", "on-unknown-white", "on-primary", "on-secondary", "on-success", "on-danger"]), ["onUnknownBlack", "onUnknownWhite"], "Button", "Please use one of 'primary','secondary','danger','success','on-unknown-black','on-unknown-white','on-primary','on-secondary','on-success','on-danger'."),
159
- /**
160
- * Adds the given Icon to the right of the button text. May not be used with `leadingIcon` - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control.
161
- *
162
- * Defaults to **undefined**.
163
- */
164
- trailingIcon: t.oneOfType([t.string, t.func, t.node]),
165
- /**
166
- * This applies the html button type (button, submit, reset) or the anchor media type when used with the href property.
167
- *
168
- * Defaults to **'button'**.
169
- */
170
- type: t.oneOf(["button", "submit", "reset"]),
171
- /**
172
- * @deprecated _Use `elevation='flat' instead._
173
- *
174
- * Remove elevation.
175
- *
176
- * Defaults to **undefined**.
177
- */
178
- unelevated: s(t.bool, "Button", 'Use `elevation="flat" instead.'),
179
- /**
180
- * Applies the selected style to the button. `rounded-small` and `rounded-micro` are only available on select themes.
181
- *
182
- * Defaults to **'filled'**.
183
- */
184
- variant: t.oneOf(["filled", "outlined", "danger", "text", "success", "rounded-small", "rounded-micro"])
185
- }, yt = {
186
- altColor: void 0,
187
- buttonSize: "themeDefault",
188
- children: null,
189
- className: void 0,
190
- customRef: void 0,
191
- danger: void 0,
192
- disabled: !1,
193
- elevation: "default",
194
- filled: void 0,
195
- fullWidth: !1,
196
- href: null,
197
- label: null,
198
- leadingIcon: void 0,
199
- outlined: void 0,
200
- primary: void 0,
201
- secondary: void 0,
202
- tag: null,
203
- tertiary: void 0,
204
- text: void 0,
205
- themeColor: "primary",
206
- trailingIcon: void 0,
207
- type: "button",
208
- unelevated: void 0,
209
- variant: "filled"
210
- }, gt = {
211
- /**
212
- * Children to be rendered. Expects multiple Element Buttons
213
- *
214
- * Defaults to **null**.
215
- */
216
- children: t.node,
217
- /**
218
- * How much spacing between buttons. Dense is 8p, standard is 16px and airy is 24px.
219
- *
220
- * Defaults to **'standard'**.
221
- */
222
- variant: t.oneOf(["dense", "standard", "airy"])
223
- }, ht = {
224
- children: null,
225
- variant: "standard"
226
- }, C = /* @__PURE__ */ F((r, u) => {
227
- const {
228
- altColor: b,
229
- buttonSize: P,
230
- children: x,
231
- className: O,
232
- customRef: L,
233
- disabled: j,
234
- elevation: H,
235
- primary: q,
236
- secondary: M,
237
- tertiary: $,
238
- text: A,
239
- danger: K,
240
- filled: Q,
241
- fullWidth: V,
242
- href: R,
243
- label: Y,
244
- leadingIcon: d,
245
- onClick: Z,
246
- outlined: tt,
247
- tag: nt,
248
- themeColor: e,
249
- trailingIcon: h,
250
- type: et,
251
- unelevated: n,
252
- variant: c,
253
- ...ot
254
- } = r, N = mt(L || null);
255
- bt(u, () => N.current, []);
256
- const at = Y || x, rt = nt || (R ? "a" : "button"), l = c === "outlined" || tt || M, S = c === "rounded-small" || c === "rounded-micro", i = c === "text" || A || $, y = c === "danger" || K || e === "danger", _ = c === "success" || e === "success", o = !l && !i && (c === "filled" || Q || q), B = b || e === "secondary", f = e === "primary", dt = h && !d, v = e === "onUnknownBlack" || e === "on-unknown-black", I = e === "onUnknownWhite" || e === "on-unknown-white", U = e === "onPrimary" || e === "on-primary", E = e === "onSecondary" || e === "on-secondary", lt = G(() => typeof d == "string" ? /* @__PURE__ */ m.createElement(z, {
257
- tabIndex: 0,
258
- role: "button",
259
- className: "mdc-button__icon lmnt-button__icon--leading",
260
- icon: d
261
- }) : typeof d == "function" ? d({
262
- className: "mdc-button__icon lmnt-button__icon--leading"
263
- }) : W(d, "mdc-button__icon lmnt-button__icon--leading"), [d]), it = G(() => typeof h == "string" ? /* @__PURE__ */ m.createElement(z, {
264
- tabIndex: 0,
265
- role: "button",
266
- className: "mdc-button__icon lmnt-button__icon--trailing",
267
- icon: h
268
- }) : typeof d == "function" ? h({
269
- className: "mdc-button__icon lmnt-button__icon--trailing"
270
- }) : W(h, "mdc-button__icon lmnt-button__icon--trailing"), [d, h]);
271
- return /* @__PURE__ */ m.createElement(ft, {
272
- componentRef: N
273
- }, /* @__PURE__ */ m.createElement(rt, J({
274
- ref: N,
275
- href: R,
276
- onClick: Z,
277
- type: et,
278
- disabled: j,
279
- className: X("lmnt", "mdc-button", "lmnt-button", o && n && f && "lmnt-button--filled-primary", o && y && "lmnt-button--filled-danger", o && _ && "lmnt-button--filled-success", o && n && B && "lmnt-button--filled-secondary", o && !n && f && ["lmnt-button--filled-primary", "mdc-button--raised"], o && !n && B && ["lmnt-button--filled-secondary", "mdc-button--raised"], o && !n && e === "on-primary" && ["lmnt-button--filled-on-primary", "mdc-button--raised"], o && !n && e === "on-secondary" && ["lmnt-button--filled-on-secondary", "mdc-button--raised"], o && !n && e === "on-success" && ["lmnt-button--filled-on-success", "mdc-button--raised"], o && !n && e === "on-danger" && ["lmnt-button--filled-on-danger", "mdc-button--raised"], o && !n && v && ["lmnt-button--filled-on-unknown-black", "mdc-button--raised"], o && !n && I && ["lmnt-button--filled-on-unknown-white", "mdc-button--raised"], l && f && ["lmnt-button--outlined-primary", "mdc-button--outlined"], o && !n && U && ["lmnt-button--filled-on-primary", "mdc-button--raised"], l && B && ["lmnt-button--outlined-secondary", "mdc-button--outlined"], l && U && "lmnt-button--outlined-on-primary mdc-button--outlined", l && E && "lmnt-button--outlined-on-secondary mdc-button--outlined", l && I && "lmnt-button--outlined-on-unknown-white mdc-button--outlined", l && v && "lmnt-button--outlined-on-unknown-black mdc-button--outlined", i && U && "lmnt-button--text-on-primary mdc-button__text", i && E && "lmnt-button--text-on-secondary mdc-button__text", i && I && "lmnt-button--text-on-unknown-white mdc-button__text", i && v && "lmnt-button--text-on-unknown-black mdc-button__text", S && I && "lmnt-button--text-on-unknown-white mdc-button__text", S && v && "lmnt-button--text-on-unknown-black mdc-button__text", i && f && "lmnt-button--text-primary", i && B && "lmnt-button--text-secondary", i && y && "lmnt-button--text-danger", i && _ && "lmnt-button--text-success", y && n && B && "lmnt-button--danger-secondary", y && !n && B && ["lmnt-button--danger-secondary", "mdc-button--raised"], y && n && f && "lmnt-button--danger-primary", y && !n && f && ["lmnt-button--danger-primary", "mdc-button--raised"], y && l && ["lmnt-button--danger-primary", "mdc-button--outlined"], _ && n && f && "lmnt-button--success-primary", _ && !n && f && ["lmnt-button--success-primary", "mdc-button--raised"], _ && l && ["lmnt-button--success-primary", "mdc-button--outlined"], _ && l && ["lmnt-button--success-primary", "mdc-button--outlined"], V && "lmnt-button--full-width", n && !i && "mdc-button--unelevated", H === "flat" && "lmnt-button--flat", H === "elevated" && "lmnt-button--elevated", `lmnt-button--${P}`, c === "rounded-small" && "lmnt-button--rounded lmnt-button--rounded-small mdc-button__text lmnt-button--text-primary", c === "rounded-micro" && "lmnt-button--rounded lmnt-button--rounded-micro mdc-button__text lmnt-button--text-primary", O, "mdc-touch-target-wrapper")
280
- }, ot), /* @__PURE__ */ m.createElement("span", {
281
- className: "mdc-button__ripple"
282
- }), d && lt(), /* @__PURE__ */ m.createElement("span", {
283
- className: "mdc-button__label"
284
- }, at), dt && it(), /* @__PURE__ */ m.createElement("span", {
285
- className: "mdc-button__touch"
286
- })));
287
- });
288
- C.displayName = "Button";
289
- C.propTypes = pt;
290
- C.defaultProps = yt;
291
- const D = /* @__PURE__ */ F((r, u) => {
292
- const {
293
- children: b,
294
- className: P,
295
- variant: x,
296
- ...O
297
- } = r;
298
- return /* @__PURE__ */ m.createElement("div", J({
299
- ref: u,
300
- className: X("lmnt", "lmnt-button-group", x === "dense" && "lmnt-button-group--dense", x === "standard" && "lmnt-button-group--standard", x === "airy" && "lmnt-button-group--airy", P)
301
- }, O), b);
302
- });
303
- D.displayName = "ButtonGroup";
304
- D.propTypes = gt;
305
- D.defaultProps = ht;
306
- ut("BasicHeading-Test", () => {
307
- T("render small container without content", () => {
308
- k(/* @__PURE__ */ g(w, { heading: "Test" }));
309
- const r = p.getByTestId("HeaderContainer");
310
- a(r).toBeDefined(), a(r).toHaveClass(/pageHeader/);
311
- const u = p.getByTestId("Header");
312
- a(u).toBeDefined(), a(u).toHaveTextContent("Test");
313
- const b = p.getByTestId("RightPart");
314
- a(b).toBeDefined();
315
- }), T("render large container with children", () => {
316
- k(
317
- /* @__PURE__ */ g(w, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ g(C, { children: "Extracontent" }) })
1
+ import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
+ import { BasicHeading as a } from "./BasicHeading.js";
3
+ import { r as i, s as n } from "../../react.esm-BeDwcQWb.js";
4
+ import { d as g, t as s, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ import { B as h } from "../../index.es-C3EKMb0J.js";
6
+ g("BasicHeading-Test", () => {
7
+ s("render small container without content", () => {
8
+ i(/* @__PURE__ */ o(a, { heading: "Test" }));
9
+ const t = n.getByTestId("HeaderContainer");
10
+ e(t).toBeDefined(), e(t).toHaveClass(/pageHeader/);
11
+ const r = n.getByTestId("Header");
12
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
13
+ const d = n.getByTestId("RightPart");
14
+ e(d).toBeDefined();
15
+ }), s("render large container with children", () => {
16
+ i(
17
+ /* @__PURE__ */ o(a, { heading: "Test", marginBottom: "large", children: /* @__PURE__ */ o(h, { children: "Extracontent" }) })
318
18
  );
319
- const r = p.getByTestId("HeaderContainer");
320
- a(r).toBeDefined();
321
- const u = p.getByTestId("Header");
322
- a(u).toBeDefined(), a(u).toHaveTextContent("Test");
323
- const b = p.getByTestId("RightPart");
324
- a(b).toBeDefined(), a(b).toContainHTML("<button");
325
- }), T("render with available custom icon", () => {
326
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: "farm" }));
327
- const r = p.getByTestId("farm");
328
- a(r).toBeInTheDocument();
329
- }), T("render with JSX element as icon", () => {
330
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: /* @__PURE__ */ g(st, { children: "JSX" }) })), a(p.getByText("JSX")).toBeInTheDocument();
331
- }), T("render with other icon", () => {
332
- k(/* @__PURE__ */ g(w, { heading: "Test", icon: "contact_support" }));
333
- const r = document.querySelector("i");
334
- a(r).toHaveTextContent("contact_support");
19
+ const t = n.getByTestId("HeaderContainer");
20
+ e(t).toBeDefined();
21
+ const r = n.getByTestId("Header");
22
+ e(r).toBeDefined(), e(r).toHaveTextContent("Test");
23
+ const d = n.getByTestId("RightPart");
24
+ e(d).toBeDefined(), e(d).toContainHTML("<button");
25
+ }), s("render with available custom icon", () => {
26
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "farm" }));
27
+ const t = n.getByTestId("farm");
28
+ e(t).toBeInTheDocument();
29
+ }), s("render with JSX element as icon", () => {
30
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: /* @__PURE__ */ o(c, { children: "JSX" }) })), e(n.getByText("JSX")).toBeInTheDocument();
31
+ }), s("render with other icon", () => {
32
+ i(/* @__PURE__ */ o(a, { heading: "Test", icon: "contact_support" }));
33
+ const t = document.querySelector("i");
34
+ e(t).toHaveTextContent("contact_support");
335
35
  });
336
36
  });
@@ -2,7 +2,7 @@ import "../../assets/BlockView.css";
2
2
  import { jsxs as g, jsx as l } from "react/jsx-runtime";
3
3
  import { useState as x, useEffect as T, useMemo as L } from "react";
4
4
  import { getBlockNumberByDto as R } from "../../services/BlockService.js";
5
- import { a as B, b as C } from "../../index.es-BD4kFWFx.js";
5
+ import { a as B, c as C } from "../../index.es-z8RCxF8n.js";
6
6
  const A = "_grid_g18cu_1", D = "_black_g18cu_11", E = "_blockLayout_g18cu_15", S = "_blockRow_g18cu_27", V = "_block_g18cu_15", M = "_active_g18cu_46", j = "_error_g18cu_52", q = "_empty_g18cu_58", F = "_blockText_g18cu_65", o = {
7
7
  grid: A,
8
8
  black: D,
@@ -20,8 +20,8 @@ const A = "_grid_g18cu_1", D = "_black_g18cu_11", E = "_blockLayout_g18cu_15", S
20
20
  errorBlocks: p = [],
21
21
  showNumbers: y = !0,
22
22
  clickable: h = !0,
23
- size: b = 15,
24
- onClick: m = null,
23
+ size: m = 15,
24
+ onClick: b = null,
25
25
  currentBlock: i,
26
26
  blocks: _,
27
27
  blockViewTitle: v,
@@ -35,11 +35,11 @@ const A = "_grid_g18cu_1", D = "_black_g18cu_11", E = "_blockLayout_g18cu_15", S
35
35
  d(c);
36
36
  }, [i, t]);
37
37
  const N = L(() => s * t, [s, t]), $ = (c) => {
38
- m && m(c, i ?? void 0);
38
+ b && b(c, i ?? void 0);
39
39
  }, w = ({ row: c, column: r }) => _.length === 0 ? !0 : _.some((a) => a.position?.row === c && a.position?.column === r);
40
40
  return /* @__PURE__ */ g("div", { className: o.grid, children: [
41
41
  !u && /* @__PURE__ */ l(B, { level: 1, bold: !0, className: o.black, children: v }),
42
- /* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${b}rem`, height: `${b}rem` }, children: Array.from({ length: s }).map((c, r) => /* @__PURE__ */ l("div", { className: o.blockRow, children: Array.from({ length: t }).map((a, n) => {
42
+ /* @__PURE__ */ l("div", { className: o.blockLayout, style: { width: `${m}rem`, height: `${m}rem` }, children: Array.from({ length: s }).map((c, r) => /* @__PURE__ */ l("div", { className: o.blockRow, children: Array.from({ length: t }).map((a, n) => {
43
43
  const e = t * r + n + 1;
44
44
  return /* @__PURE__ */ l(
45
45
  "div",
@@ -1,8 +1,9 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { d as n, v as B, t as s, r as i, g as o, s as t, f as a } from "../../vi.JYQecGiw-8gz0k16C.js";
3
- import { BlockView as k } from "./BlockView.js";
4
- n("BlockView Test", () => {
5
- const c = B.fn(), e = {
2
+ import { r as s, s as o, f as n } from "../../react.esm-BeDwcQWb.js";
3
+ import { BlockView as r } from "./BlockView.js";
4
+ import { d as B, v as a, t as i, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
5
+ B("BlockView Test", () => {
6
+ const c = a.fn(), e = {
6
7
  id: "1",
7
8
  fieldId: "2",
8
9
  position: {
@@ -10,10 +11,10 @@ n("BlockView Test", () => {
10
11
  column: 2
11
12
  }
12
13
  };
13
- s("renders BlockView correctly with 2x3 blocks", () => {
14
- i(
14
+ i("renders BlockView correctly with 2x3 blocks", () => {
15
+ s(
15
16
  /* @__PURE__ */ l(
16
- k,
17
+ r,
17
18
  {
18
19
  blocks: [e],
19
20
  columns: 2,
@@ -23,13 +24,13 @@ n("BlockView Test", () => {
23
24
  blockLabel: "Block"
24
25
  }
25
26
  )
26
- ), o(t.getByText("Layout")).toBeInTheDocument(), o(t.getByText("6 Block")).toBeInTheDocument();
27
- const r = t.getAllByTestId("blockViewBlock");
28
- o(r.length).toBe(6);
29
- }), s("executes onClick method", () => {
30
- i(
27
+ ), t(o.getByText("Layout")).toBeInTheDocument(), t(o.getByText("6 Block")).toBeInTheDocument();
28
+ const k = o.getAllByTestId("blockViewBlock");
29
+ t(k.length).toBe(6);
30
+ }), i("executes onClick method", () => {
31
+ s(
31
32
  /* @__PURE__ */ l(
32
- k,
33
+ r,
33
34
  {
34
35
  blocks: [e],
35
36
  columns: 2,
@@ -41,6 +42,6 @@ n("BlockView Test", () => {
41
42
  blockLabel: "Block"
42
43
  }
43
44
  )
44
- ), a.click(t.getByText("6")), o(c).toHaveBeenCalled();
45
+ ), n.click(o.getByText("6")), t(c).toHaveBeenCalled();
45
46
  });
46
47
  });
@@ -0,0 +1,65 @@
1
+ type DeleteModalProps = {
2
+ /**
3
+ * The title of the modal.
4
+ */
5
+ title: string;
6
+ /**
7
+ * The label of the confirm button.
8
+ */
9
+ confirmButtonLabel: string;
10
+ /**
11
+ * The label of the cancel button.
12
+ */
13
+ cancelButtonLabel: string;
14
+ /**
15
+ * The header text of the delete modal.
16
+ */
17
+ deleteHeader: string;
18
+ /**
19
+ * The body text of the delete modal. Each entry will be displayed as a bullet point.
20
+ */
21
+ deleteBody?: string[];
22
+ /**
23
+ * The header to display in the modal if the {@link isDeletePossible} is false.
24
+ */
25
+ impossibleDeleteHeader: string;
26
+ /**
27
+ * The icon to display in the modal.
28
+ */
29
+ icon?: string;
30
+ /**
31
+ * The state of the modal.
32
+ */
33
+ open: boolean;
34
+ /**
35
+ * The function to set the state of the modal.
36
+ */
37
+ setOpen: (open: boolean) => void;
38
+ /**
39
+ * The function to call when the confirm button is clicked.
40
+ */
41
+ onDelete: () => void;
42
+ /**
43
+ * If true, the delete button will be enabled.
44
+ * If false, the delete button will be disabled and the {@link impossibleDeleteHeader} will be displayed.
45
+ * Default is _true_.
46
+ */
47
+ isDeletePossible?: boolean;
48
+ };
49
+ /**
50
+ * A modal component for deleting items.
51
+ * @prop {string} title - The title of the modal.
52
+ * @prop {string} confirmButtonLabel - The label of the confirm button.
53
+ * @prop {string} cancelButtonLabel - The label of the cancel button.
54
+ * @prop {string} deleteHeader - The header text of the delete modal.
55
+ * @prop {string[]} deleteBody - The body text of the delete modal. Each entry will be displayed as a bullet point.
56
+ * @prop {string} impossibleDeleteHeader - The header to display in the modal if the {@link isDeletePossible} is false.
57
+ * @prop {string} icon - The icon to display in the modal.
58
+ * @prop {boolean} open - The state of the modal.
59
+ * @prop {function} setOpen - The function to set the state of the modal.
60
+ * @prop {function} onDelete - The function to call when the confirm button is clicked.
61
+ * @prop {boolean} isDeletePossible - If true, the delete button will be enabled. If false, the delete button will be disabled and the {@link impossibleDeleteHeader} will be displayed. Default is _true_.
62
+ * @returns {ReactElement} A modal component for deleting items.
63
+ */
64
+ export declare const DeleteModal: ({ title, confirmButtonLabel, cancelButtonLabel, deleteHeader, deleteBody, icon, impossibleDeleteHeader, open, setOpen, onDelete, isDeletePossible, }: DeleteModalProps) => import("react/jsx-runtime").JSX.Element;
65
+ export {};