@hortiview/shared-components 2.24.2 → 2.25.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +30 -32
  3. package/dist/assets/ContextMenu.css +1 -0
  4. package/dist/assets/stepper.css +1 -1
  5. package/dist/components/AllowedButton/AllowedButton.js +7 -7
  6. package/dist/components/AllowedIconButton/AllowedIconButton.d.ts +5 -18
  7. package/dist/components/AllowedIconButton/AllowedIconButton.js +21 -56
  8. package/dist/components/BaseView/BaseView.d.ts +9 -1
  9. package/dist/components/BaseView/BaseView.js +94 -89
  10. package/dist/components/ContextMenu/ContextMenu.d.ts +24 -57
  11. package/dist/components/ContextMenu/ContextMenu.js +72 -111
  12. package/dist/components/EmptyView/EmptyView.js +1 -1
  13. package/dist/components/Filter/Filter.js +1 -1
  14. package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +76 -0
  15. package/dist/components/FloatingActionButton/FloatingActionButton.js +150 -0
  16. package/dist/components/ModulePadding/ModulePadding.js +1 -1
  17. package/dist/components/Stepper/Stepper.js +1 -1
  18. package/dist/components/Stepper/components/StepperButton.js +34 -33
  19. package/dist/components/Stepper/components/StepperHeader.js +1 -1
  20. package/dist/components/Stepper/components/StepperItem.js +1 -1
  21. package/dist/main.d.ts +1 -0
  22. package/dist/main.js +115 -113
  23. package/dist/services/UtilService.js +1 -1
  24. package/dist/stepper.module-C_EMu-Fl.js +22 -0
  25. package/dist/types/ListElement.d.ts +13 -3
  26. package/package.json +1 -1
  27. package/dist/contextMenu.module-RWPDK7Ds.js +0 -17
  28. package/dist/stepper.module-DR_FbENS.js +0 -23
  29. /package/dist/assets/{contextMenu.css → FloatingActionButton.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [2.25.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.3...v2.25.0) (2026-05-07)
2
+
3
+ ### Features
4
+
5
+ * add standalone FloatingActionButton and adjust existing components ([6164fa7](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/6164fa763e7943ae58d33179ab791dee823900d2)), closes [#20679](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/issues/20679)
6
+
7
+ ## [2.24.3](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.2...v2.24.3) (2026-05-07)
8
+
9
+ ### Bug Fixes
10
+
11
+ * prevent unwanted prop overriding in AllowedButton ([a150166](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/a150166d841ee4c8f89298c2f2234380a3af4e7f))
12
+
13
+ ### Styles
14
+
15
+ * show loading spinner on next button in stepper ([47b8dda](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/47b8dda08a8c93f4036ed4aaec734e1265f4fedf))
16
+
1
17
  ## [2.24.2](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.24.1...v2.24.2) (2026-05-06)
2
18
 
3
19
  ### Bug Fixes
package/README.md CHANGED
@@ -33,6 +33,7 @@ Additionally the library provides form components using [react-hook-form](https:
33
33
  1. [EmptyView](#emptyview)
34
34
  1. [ErrorBanner] (#errorbanner)
35
35
  1. [Filter](#filter)
36
+ 1. [FloatingActionButton](#floatingactionbutton)
36
37
  1. [FormattedNumberDisplay](#formattednumberdisplay)
37
38
  1. [FormComponents](#formcomponents)
38
39
  1. [FormCheckBox](#formcheckbox)
@@ -202,32 +203,6 @@ const actions = [
202
203
  <ContextMenu actions={actions} />;
203
204
  ```
204
205
 
205
- #### Render ContextMenu as a Floating Action Button (FAB)
206
-
207
- On mobile and tablet devices, you can display the context menu as a floating action button (FAB) by setting
208
- `isFloatingActionButtonOnMobile` to true. This removes the context menu from the DOM and positions it
209
- statically in the bottom right corner of the screen.
210
-
211
- You can control the offset from the screen edges using `floatingButtonScreenOffsetType`, which includes
212
- presets for full-screen implementations and screens with a BottomAppBar.
213
-
214
- To prevent the FAB from blocking any elements in the rendered view, provide a DOM element selector to
215
- `floatingButtonPaddingInsertTarget`. A spacer element will be attached to this target, increasing its
216
- height by the appropriate amount.
217
-
218
- ```jsx
219
- import { ContextMenu } from '@hortiview/shared-components';
220
-
221
- const actions = [...];
222
-
223
- <ContextMenu
224
- actions={actions}
225
- isFloatingActionButtonOnMobile={true}
226
- floatingButtonScreenOffsetType={'buttonAppBar'}
227
- floatingButtonPaddingInsertTarget={'#layout-container'}
228
- />;
229
- ```
230
-
231
206
  ### DeleteModal
232
207
 
233
208
  A modal to confirm a deletion.
@@ -374,6 +349,35 @@ const MyComponent = () => {
374
349
  export default MyComponent;
375
350
  ```
376
351
 
352
+ ### FloatingActionButton
353
+
354
+ A component to show a floating action button for mobile and tablet views, giving users quick access to one or
355
+ more contextual actions without taking permanent space in layout.
356
+
357
+ It automatically hides when no visible/allowed actions exist,
358
+ can trigger a single action directly or open a menu for multiple actions,
359
+ supports an offline fallback view.
360
+
361
+ You can control the offset from the screen edges using `floatingButtonScreenOffsetType`, which includes
362
+ presets for full-screen implementations and screens with a BottomAppBar.
363
+
364
+ To prevent the FAB from blocking any elements in the rendered view, provide a DOM element selector to
365
+ `floatingButtonPaddingInsertTarget`. A spacer element will be attached to this target, increasing its
366
+ height by the appropriate amount.
367
+
368
+ ```jsx
369
+ import { FloatingActionButton } from '@hortiview/shared-components';
370
+
371
+ const actions = [...];
372
+
373
+ <FloatingActionButton
374
+ actions={actions}
375
+ floatingButtonPaddingInsertTarget={'#fab-padding-target'}
376
+ isSingleActionTriggeredOnClick={false}
377
+ hasActionIconForSingleAction={false}
378
+ />;
379
+ ```
380
+
377
381
  ### FormattedNumberDisplay
378
382
 
379
383
  A component to display a formatted number based on the given language code, wrapped in a given typography component to style it as needed.
@@ -1124,12 +1128,6 @@ function BlockActions({ blockId, farmId }) {
1124
1128
  }
1125
1129
  ```
1126
1130
 
1127
- #### Render AllowedIconButton as Floating Action Button (FAB)
1128
-
1129
- On mobile and tablet devices, you can display the AllowedIconButton as a floating action button (FAB).
1130
- For more information, see the [Context Menu documentation](#render-contextmenu-as-a-floating-action-button-fab),
1131
- as both implementations are identical.
1132
-
1133
1131
  ### SafeForm
1134
1132
 
1135
1133
  A wrapper around a form that prevents accidental submission when pressing Enter in input fields.
@@ -0,0 +1 @@
1
+ ._menu_x6qd9_1{width:15.875rem;border-radius:.5rem!important}._icon_x6qd9_6{color:var(--lmnt-theme-on-secondary-inactive)}._listItem_x6qd9_10 [class*=mdc-list-item__start]{color:var(--lmnt-theme-on-secondary-inactive);align-self:center!important;margin:0 1rem!important}._listItem_x6qd9_10 [class*=mdc-list-item__end]{color:var(--lmnt-theme-on-secondary-inactive)}._offlineViewMargin_x6qd9_20{margin:.5rem}
@@ -1 +1 @@
1
- ._stepperIndicatorItem_1tz4b_1{height:var(--lmnt-stepper-indicator__size);width:var(--lmnt-stepper-indicator__size);background-color:#c7c7c7;border-radius:50%}._stepperIndicatorItemActive_1tz4b_8{background-color:var(--lmnt-theme-primary)}._stepperIndicatorItemOptional_1tz4b_12{border:1.5px dashed #7e7e7e}._stepperContainer_1tz4b_16{background-color:var(--lmnt-theme-primary-50);border:1px solid var(--lmnt-theme-on-surface-stroke);border-radius:.25rem;padding:.75rem 1rem}._stepperTitle_1tz4b_23{text-align:center;color:var(--lmnt-theme-on-secondary-inactive)}._stepperButton_1tz4b_28{margin-bottom:0}._stepperButtonLoading_1tz4b_32{padding-top:.375rem!important;padding-bottom:.375rem!important}._stepperButtonLoading_1tz4b_32 svg{stroke:var(--lmnt-theme-white)!important}._stepperDescriptionContainer_1tz4b_43{border-radius:.2rem;background-color:var(--lmnt-theme-primary-50);border:1px solid var(--lmnt-theme-on-surface-stroke)}._stepperDescriptionProgress_1tz4b_49{padding:0 1rem;min-width:3.5rem;background:var(--lmnt-theme-primary);color:var(--lmnt-theme-on-primary);border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}._stepperDescriptionText_1tz4b_60{padding:.7rem}._stepperDesktopHeaderContainer_1tz4b_66{border-radius:.5rem;padding:1rem;background-color:#ecf4f4}._stepperItem_1tz4b_73 ._stepperItemNumber_1tz4b_73{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;border-radius:50%;background-color:var(--lmnt-theme-surface-variant);color:var(--lmnt-theme-on-surface-inactive);transition:background-color .6s ease}._stepperItem_1tz4b_73 ._stepperItemNumberActive_1tz4b_91{background-color:var(--lmnt-theme-primary);color:var(--lmnt-theme-on-primary)}._stepperItem_1tz4b_73 ._itemText_1tz4b_96{transition:color .6s ease;color:var(--lmnt-theme-on-surface-inactive)}._stepperItem_1tz4b_73 ._itemTextActive_1tz4b_101{color:var(--lmnt-theme-on-surface-active)}._stepperItemConnector_1tz4b_105{flex:1;height:4px;border:none;border-radius:2px;background:linear-gradient(90deg,var(--lmnt-theme-primary) 0%,var(--lmnt-theme-primary) 50%,var(--lmnt-theme-on-surface-stroke) 50%,var(--lmnt-theme-on-surface-stroke) 100%);background-size:200% 100%;background-position:100% 0;transition:background-position .6s cubic-bezier(.4,0,.2,1)}._stepperItemConnectorCompleted_1tz4b_125{background-position:0% 0}
1
+ ._stepperIndicatorItem_y9y8z_1{height:var(--lmnt-stepper-indicator__size);width:var(--lmnt-stepper-indicator__size);background-color:#c7c7c7;border-radius:50%}._stepperIndicatorItemActive_y9y8z_8{background-color:var(--lmnt-theme-primary)}._stepperIndicatorItemOptional_y9y8z_12{border:1.5px dashed #7e7e7e}._stepperContainer_y9y8z_16{background-color:var(--lmnt-theme-primary-50);border:1px solid var(--lmnt-theme-on-surface-stroke);border-radius:.25rem;padding:.75rem 1rem}._stepperTitle_y9y8z_23{text-align:center;color:var(--lmnt-theme-on-secondary-inactive)}._stepperButton_y9y8z_28{margin-bottom:0}._stepperDescriptionContainer_y9y8z_34{border-radius:.2rem;background-color:var(--lmnt-theme-primary-50);border:1px solid var(--lmnt-theme-on-surface-stroke)}._stepperDescriptionProgress_y9y8z_40{padding:0 1rem;min-width:3.5rem;background:var(--lmnt-theme-primary);color:var(--lmnt-theme-on-primary);border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}._stepperDescriptionText_y9y8z_51{padding:.7rem}._stepperDesktopHeaderContainer_y9y8z_57{border-radius:.5rem;padding:1rem;background-color:#ecf4f4}._stepperItem_y9y8z_64 ._stepperItemNumber_y9y8z_64{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;border-radius:50%;background-color:var(--lmnt-theme-surface-variant);color:var(--lmnt-theme-on-surface-inactive);transition:background-color .6s ease}._stepperItem_y9y8z_64 ._stepperItemNumberActive_y9y8z_82{background-color:var(--lmnt-theme-primary);color:var(--lmnt-theme-on-primary)}._stepperItem_y9y8z_64 ._itemText_y9y8z_87{transition:color .6s ease;color:var(--lmnt-theme-on-surface-inactive)}._stepperItem_y9y8z_64 ._itemTextActive_y9y8z_92{color:var(--lmnt-theme-on-surface-active)}._stepperItemConnector_y9y8z_96{flex:1;height:4px;border:none;border-radius:2px;background:linear-gradient(90deg,var(--lmnt-theme-primary) 0%,var(--lmnt-theme-primary) 50%,var(--lmnt-theme-on-surface-stroke) 50%,var(--lmnt-theme-on-surface-stroke) 100%);background-size:200% 100%;background-position:100% 0;transition:background-position .6s cubic-bezier(.4,0,.2,1)}._stepperItemConnectorCompleted_y9y8z_116{background-position:0% 0}
@@ -1,26 +1,26 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { B as r } from "../../index.es-B19PQgzU.js";
2
+ import { B as l } from "../../index.es-B19PQgzU.js";
3
3
  import { Allowed as s } from "../Allowed/Allowed.js";
4
4
  import { LoadingSpinner as a } from "../LoadingSpinner/Default/LoadingSpinner.js";
5
5
  const c = ({
6
6
  buttonType: d = "button",
7
7
  variant: n = "filled",
8
8
  "data-testid": o,
9
- label: m,
10
- size: l = "medium",
9
+ label: r,
10
+ size: m = "medium",
11
11
  isLoading: i = !1,
12
12
  ...t
13
13
  }) => /* @__PURE__ */ e(s, { neededPermissions: t.permissions, entityIds: t.entityIds, children: /* @__PURE__ */ e(
14
- r,
14
+ l,
15
15
  {
16
- buttonSize: l,
16
+ ...t,
17
+ buttonSize: m,
17
18
  "data-testid": `allowed-button-${o}`,
18
19
  disabled: t.disabled || i,
19
20
  form: t.formId,
20
21
  type: d,
21
22
  variant: n,
22
- ...t,
23
- children: i ? /* @__PURE__ */ e(a, { size: "sm", spinnerOnly: !0 }) : m
23
+ children: i ? /* @__PURE__ */ e(a, { size: "sm", spinnerOnly: !0 }) : r
24
24
  }
25
25
  ) });
26
26
  export {
@@ -1,7 +1,5 @@
1
1
  import { IconButtonProps } from '@element-public/react-icon-button';
2
- import { FloatingActionButtonProps } from '../ContextMenu/ContextMenu';
3
2
  import { IsAllowedProps } from '../PermissionChecks/PermissionService';
4
- import { default as React } from 'react';
5
3
 
6
4
  export type AllowedIconButtonProps = Omit<IconButtonProps & React.HTMLProps<HTMLButtonElement>, 'variant' | 'iconType' | 'iconSize' | 'size'> & {
7
5
  /**
@@ -36,21 +34,10 @@ export type AllowedIconButtonProps = Omit<IconButtonProps & React.HTMLProps<HTML
36
34
  * Default: 'medium'
37
35
  */
38
36
  size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
39
- } & FloatingActionButtonProps;
37
+ };
40
38
  /**
41
- * Renders an icon button only when the required permissions are granted.
42
- *
43
- * Supports optional mobile floating action button behavior through
44
- * `FloatingActionButtonProps` -> {@link FloatingActionButtonProps}
45
- *
46
- * @param props Component props.
47
- * @param props.data-testid Test id suffix used to generate the rendered button test id.
48
- * @param props.entityIds Entity id or ids used for permission evaluation.
49
- * @param props.formId Optional form id used to associate the button with a form.
50
- * @param props.variant Visual variant of the icon button.
51
- * @param props.iconType Icon style variant.
52
- * @param props.permissions Permissions required to render the button.
53
- * @param props.size Size of the icon button.
54
- * @returns The rendered icon button, or `null` when access is not allowed.
39
+ * A permission-gated icon button component that only renders when the user has the required permissions.
40
+ * @param {AllowedIconButtonProps} props - Component properties
41
+ * @returns {JSX.Element | null} The icon button component or null if permissions are not met
55
42
  */
56
- export declare const AllowedIconButton: (props: AllowedIconButtonProps) => import("react/jsx-runtime").JSX.Element;
43
+ export declare const AllowedIconButton: ({ "data-testid": testId, variant, iconType, size, ...props }: AllowedIconButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,58 +1,23 @@
1
- import { jsx as e, jsxs as A, Fragment as S } from "react/jsx-runtime";
2
- import { I as x } from "../../index.es-CkB4776y.js";
3
- import { c as i } from "../../index-Df2FYN-K.js";
4
- import { createPortal as d } from "react-dom";
5
- import { useBreakpoints as P } from "../../hooks/useBreakpoints.js";
6
- import { Allowed as T } from "../Allowed/Allowed.js";
7
- import { s as t } from "../../contextMenu.module-RWPDK7Ds.js";
8
- import { useMemo as h } from "react";
9
- const O = (c) => {
10
- const {
11
- "data-testid": l,
12
- variant: m = "filled-primary",
13
- iconType: f = "filled",
14
- size: p = "medium",
15
- permissions: u,
16
- entityIds: b,
17
- formId: B,
18
- isFloatingActionButtonOnMobile: g = !1,
19
- floatingButtonPaddingInsertTarget: o,
20
- floatingButtonScreenOffsetType: n = "buttonAppBar",
21
- ...I
22
- } = c, { isDesktop: y } = P(), r = g && !y, a = /* @__PURE__ */ e(
23
- x,
24
- {
25
- className: i(r && t.fabIcon),
26
- "data-testid": `allowed-icon-button-${l}`,
27
- form: B,
28
- iconSize: r ? "xlarge" : p,
29
- iconType: f,
30
- variant: m,
31
- ...I
32
- }
33
- ), s = h(() => o ? document.querySelector(o) : null, [o]);
34
- return /* @__PURE__ */ e(T, { neededPermissions: u, entityIds: b, children: r ? /* @__PURE__ */ A(S, { children: [
35
- d(
36
- /* @__PURE__ */ e(
37
- "div",
38
- {
39
- className: i(
40
- t.fabContainer,
41
- n === "buttonAppBar" && t.buttonAppBar,
42
- n === "fullScreen" && t.fullScreen
43
- ),
44
- "data-testid": "fab-container",
45
- children: a
46
- }
47
- ),
48
- document.body
49
- ),
50
- s && d(
51
- /* @__PURE__ */ e("div", { className: t.fabSpacer, "data-testid": "fab-spacer" }),
52
- s
53
- )
54
- ] }) : a });
55
- };
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { I as m } from "../../index.es-CkB4776y.js";
3
+ import { Allowed as l } from "../Allowed/Allowed.js";
4
+ const f = ({
5
+ "data-testid": o,
6
+ variant: e = "filled-primary",
7
+ iconType: d = "filled",
8
+ size: n = "medium",
9
+ ...t
10
+ }) => /* @__PURE__ */ i(l, { neededPermissions: t.permissions, entityIds: t.entityIds, children: /* @__PURE__ */ i(
11
+ m,
12
+ {
13
+ "data-testid": `allowed-icon-button-${o}`,
14
+ form: t.formId,
15
+ iconSize: n,
16
+ iconType: d,
17
+ variant: e,
18
+ ...t
19
+ }
20
+ ) });
56
21
  export {
57
- O as AllowedIconButton
22
+ f as AllowedIconButton
58
23
  };
@@ -1,6 +1,7 @@
1
1
  import { BaseListElement } from '../../types/ListElement';
2
2
  import { LinkProps } from '../../types/internal/ReactRouterTypes';
3
3
  import { OfflineViewProps } from '../OfflineView/OfflineView';
4
+ import { FloatingActionButton } from '../FloatingActionButton/FloatingActionButton.tsx';
4
5
 
5
6
  type BaseViewProps = {
6
7
  /**
@@ -32,6 +33,13 @@ type BaseViewProps = {
32
33
  * action to be displayed in the headings ActionButton
33
34
  */
34
35
  action?: JSX.Element;
36
+ /**
37
+ * An additional action element that is rendered outside conditional wrappers, so it is always visible
38
+ * Only rendered on mobile devices.
39
+ *
40
+ * @Used to render FloatingActionButtons when the header is hidden (which hides the action)
41
+ */
42
+ floatingActionButton?: React.ReactElement<typeof FloatingActionButton>;
35
43
  /**
36
44
  * hint to be displayed below the heading
37
45
  */
@@ -96,5 +104,5 @@ type BaseViewProps = {
96
104
  /**
97
105
  * `BaseView` is a layout component that displays a main (a list) and a detail section.
98
106
  */
99
- export declare const BaseView: ({ heading, action, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, titleLevel, detailTitleLevel, pathname, basicHeadingIcon, isOnline, offlineViewProps, noRoundedListItemEdges, routerLinkElement, searchPlaceholder, isGrouped, isHeaderVisibleOnMobile, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
107
+ export declare const BaseView: ({ heading, action, floatingActionButton, hint, elements, emptyText, hasSearch, isSorted, className, withAvatar, listMaxHeight, titleLevel, detailTitleLevel, pathname, basicHeadingIcon, isOnline, offlineViewProps, noRoundedListItemEdges, routerLinkElement, searchPlaceholder, isGrouped, isHeaderVisibleOnMobile, }: BaseViewProps) => import("react/jsx-runtime").JSX.Element;
100
108
  export {};
@@ -1,133 +1,138 @@
1
- import { jsx as e, Fragment as d, jsxs as c } from "react/jsx-runtime";
1
+ import { jsx as e, Fragment as l, jsxs as n } from "react/jsx-runtime";
2
2
  import { D as $ } from "../../index.es-C27R5Xae.js";
3
- import { G as s } from "../../index.es-Z0aF-7Cn.js";
4
- import { P as F } from "../../index.es-DgncYOqO.js";
3
+ import { G as a } from "../../index.es-Z0aF-7Cn.js";
4
+ import { P as M } from "../../index.es-DgncYOqO.js";
5
5
  import { c as v } from "../../index-Df2FYN-K.js";
6
- import { useMemo as l } from "react";
6
+ import { useMemo as d } from "react";
7
7
  import { BasicHeading as D } from "../BasicHeading/BasicHeading.js";
8
- import { EmptyView as M } from "../EmptyView/EmptyView.js";
9
- import { ListArea as P } from "../ListArea/ListArea.js";
10
- import { useBreakpoints as T } from "../../hooks/useBreakpoints.js";
11
- import { OfflineView as q } from "../OfflineView/OfflineView.js";
12
- import { useScrollableInfo as z } from "./BaseView.service.js";
13
- import '../../assets/BaseView.css';const J = "_fullHeight_1yui7_1", K = "_fullWidth_1yui7_5", O = "_heading_1yui7_9", Q = "_list_1yui7_18", U = "_desktopList_1yui7_27", X = "_noRoundedCorners_1yui7_32", Y = "_detail_1yui7_36", Z = "_desktopDetail_1yui7_44", i = {
14
- fullHeight: J,
15
- fullWidth: K,
16
- heading: O,
17
- list: Q,
18
- desktopList: U,
19
- noRoundedCorners: X,
20
- detail: Y,
21
- desktopDetail: Z
22
- }, mt = ({
23
- heading: u,
24
- action: m = /* @__PURE__ */ e(d, {}),
25
- hint: k = /* @__PURE__ */ e(d, {}),
26
- elements: f,
27
- emptyText: h,
28
- hasSearch: y = !0,
29
- isSorted: L = !0,
30
- className: b,
8
+ import { EmptyView as P } from "../EmptyView/EmptyView.js";
9
+ import { ListArea as T } from "../ListArea/ListArea.js";
10
+ import { useBreakpoints as q } from "../../hooks/useBreakpoints.js";
11
+ import { OfflineView as z } from "../OfflineView/OfflineView.js";
12
+ import { useScrollableInfo as J } from "./BaseView.service.js";
13
+ import '../../assets/BaseView.css';const K = "_fullHeight_1yui7_1", O = "_fullWidth_1yui7_5", Q = "_heading_1yui7_9", U = "_list_1yui7_18", X = "_desktopList_1yui7_27", Y = "_noRoundedCorners_1yui7_32", Z = "_detail_1yui7_36", tt = "_desktopDetail_1yui7_44", i = {
14
+ fullHeight: K,
15
+ fullWidth: O,
16
+ heading: Q,
17
+ list: U,
18
+ desktopList: X,
19
+ noRoundedCorners: Y,
20
+ detail: Z,
21
+ desktopDetail: tt
22
+ }, ft = ({
23
+ heading: m,
24
+ action: f = /* @__PURE__ */ e(l, {}),
25
+ floatingActionButton: k,
26
+ hint: y = /* @__PURE__ */ e(l, {}),
27
+ elements: h,
28
+ emptyText: p,
29
+ hasSearch: L = !0,
30
+ isSorted: b = !0,
31
+ className: B,
31
32
  withAvatar: H = !1,
32
33
  listMaxHeight: N = "calc(100vh - 220px)",
33
34
  titleLevel: W = 5,
34
- detailTitleLevel: B,
35
+ detailTitleLevel: x,
35
36
  pathname: r,
36
- basicHeadingIcon: x,
37
- isOnline: p = !0,
38
- offlineViewProps: _,
39
- noRoundedListItemEdges: g = !0,
37
+ basicHeadingIcon: A,
38
+ isOnline: _ = !0,
39
+ offlineViewProps: g,
40
+ noRoundedListItemEdges: w = !0,
40
41
  routerLinkElement: R,
41
- searchPlaceholder: A,
42
- isGrouped: C = !1,
43
- isHeaderVisibleOnMobile: I = !0
42
+ searchPlaceholder: C,
43
+ isGrouped: I = !1,
44
+ isHeaderVisibleOnMobile: S = !0
44
45
  }) => {
45
- const { isDesktopNavbar: o, isDesktop: w } = T(), n = l(() => f.filter((a) => a.isAllowed !== !1), [f]), t = l(() => n.find((a) => a.route === r), [r, n]), S = l(() => p ? t?.component ? t.component : o ? /* @__PURE__ */ e(F, { className: i.fullWidth, children: /* @__PURE__ */ e(M, { title: h }) }) : /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(q, { ..._, fullWidth: !0 }), [t?.component, h, o, p, _]), { showList: E, showDetail: j } = l(() => o ? { showList: !0, showDetail: !0 } : { showList: !t, showDetail: !!t }, [t, o]), { ref: G, hasScrolled: V } = z([
46
+ const { isDesktopNavbar: o, isDesktop: s } = q(), c = d(() => h.filter((u) => u.isAllowed !== !1), [h]), t = d(() => c.find((u) => u.route === r), [r, c]), E = d(() => _ ? t?.component ? t.component : o ? /* @__PURE__ */ e(M, { className: i.fullWidth, children: /* @__PURE__ */ e(P, { title: p }) }) : /* @__PURE__ */ e(l, {}) : /* @__PURE__ */ e(z, { ...g, fullWidth: !0 }), [t?.component, p, o, _, g]), { showList: j, showDetail: F } = d(() => o ? { showList: !0, showDetail: !0 } : { showList: !t, showDetail: !!t }, [t, o]), { ref: G, hasScrolled: V } = J([
46
47
  r,
47
48
  o
48
49
  ]);
49
- return /* @__PURE__ */ c(
50
- s,
50
+ return /* @__PURE__ */ n(
51
+ a,
51
52
  {
52
53
  "data-testid": "base-view-container",
53
- className: `${w ? i.fullHeight : ""} ${b ?? ""}`,
54
+ className: `${s ? i.fullHeight : ""} ${B ?? ""}`,
54
55
  fullWidth: !0,
55
56
  children: [
56
- E && /* @__PURE__ */ c(
57
- s,
58
- {
59
- "data-testid": "show-list-container",
60
- gap: "none",
61
- direction: "vertical",
62
- className: v(
63
- i.list,
64
- o && i.desktopList,
65
- g && i.noRoundedCorners
66
- ),
67
- children: [
68
- u && /* @__PURE__ */ e(
69
- D,
70
- {
71
- icon: x,
72
- "data-testid": "heading",
73
- heading: u,
74
- level: W,
75
- marginBottom: 0,
76
- inList: !0,
77
- children: m
78
- }
57
+ j && /* @__PURE__ */ n(l, { children: [
58
+ /* @__PURE__ */ n(
59
+ a,
60
+ {
61
+ "data-testid": "show-list-container",
62
+ gap: "none",
63
+ direction: "vertical",
64
+ className: v(
65
+ i.list,
66
+ o && i.desktopList,
67
+ w && i.noRoundedCorners
79
68
  ),
80
- k,
81
- /* @__PURE__ */ e(
82
- P,
83
- {
84
- hasLastItemNoRoundedEdges: g,
85
- elements: n,
86
- hasSearch: y,
87
- maxHeight: N,
88
- isSorted: L,
89
- pathname: r,
90
- routerLinkElement: R,
91
- searchPlaceholder: A,
92
- isGrouped: C
93
- }
94
- )
95
- ]
96
- }
97
- ),
98
- j && /* @__PURE__ */ c(
99
- s,
69
+ children: [
70
+ m && /* @__PURE__ */ e(
71
+ D,
72
+ {
73
+ icon: A,
74
+ "data-testid": "heading",
75
+ heading: m,
76
+ level: W,
77
+ marginBottom: 0,
78
+ inList: !0,
79
+ children: f
80
+ }
81
+ ),
82
+ y,
83
+ /* @__PURE__ */ e(
84
+ T,
85
+ {
86
+ hasLastItemNoRoundedEdges: w,
87
+ elements: c,
88
+ hasSearch: L,
89
+ maxHeight: N,
90
+ isSorted: b,
91
+ pathname: r,
92
+ routerLinkElement: R,
93
+ searchPlaceholder: C,
94
+ isGrouped: I
95
+ }
96
+ )
97
+ ]
98
+ }
99
+ ),
100
+ !s && k
101
+ ] }),
102
+ F && /* @__PURE__ */ n(
103
+ a,
100
104
  {
101
105
  "data-testid": "show-details-container",
102
106
  gap: "none",
103
107
  direction: "vertical",
104
108
  className: v(i.detail, o && i.desktopDetail),
105
109
  children: [
106
- (I || w) && /* @__PURE__ */ e(
110
+ (S || s) && /* @__PURE__ */ e(
107
111
  D,
108
112
  {
109
113
  className: i.heading,
110
114
  heading: t?.detailTitle ?? t?.title ?? "",
111
- level: B,
115
+ level: x,
112
116
  icon: t?.hideIconInDetail === !0 ? void 0 : t?.detailIcon ?? t?.icon,
113
117
  marginBottom: 0,
114
118
  invisibleButton: t?.detailAction === void 0,
115
119
  withAvatar: H,
116
120
  subHeading: t?.detailSubTitle,
117
- children: t?.detailAction ?? m
121
+ children: t?.detailAction ?? f
118
122
  }
119
123
  ),
120
124
  V && /* @__PURE__ */ e($, {}),
121
125
  /* @__PURE__ */ e(
122
- s,
126
+ a,
123
127
  {
124
128
  "data-testid": "base-view-show-details-scroll-component-group",
125
129
  fullWidth: !0,
126
130
  direction: "vertical",
127
131
  ref: G,
128
- children: S
132
+ children: E
129
133
  }
130
- )
134
+ ),
135
+ !s && t?.detailFloatingActionButton
131
136
  ]
132
137
  }
133
138
  )
@@ -136,5 +141,5 @@ import '../../assets/BaseView.css';const J = "_fullHeight_1yui7_1", K = "_fullWi
136
141
  );
137
142
  };
138
143
  export {
139
- mt as BaseView
144
+ ft as BaseView
140
145
  };