@softwareone/spi-sv5-library 1.7.1 → 1.7.2
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.
|
@@ -4,6 +4,7 @@ type BaseMenu = {
|
|
|
4
4
|
};
|
|
5
5
|
export type MenuItem = BaseMenu & {
|
|
6
6
|
icon?: string;
|
|
7
|
+
roles?: string[];
|
|
7
8
|
};
|
|
8
9
|
export type HomeItem = BaseMenu & {
|
|
9
10
|
homeIcon?: string;
|
|
@@ -12,11 +13,11 @@ export type HomeItem = BaseMenu & {
|
|
|
12
13
|
export type MainMenu = HomeItem & {
|
|
13
14
|
icon?: string;
|
|
14
15
|
roles?: string[];
|
|
15
|
-
children?:
|
|
16
|
+
children?: SubMenuItem[];
|
|
16
17
|
};
|
|
17
|
-
export interface
|
|
18
|
+
export interface SubMenuItem {
|
|
18
19
|
category: string;
|
|
19
20
|
menuItems: MenuItem[];
|
|
20
21
|
}
|
|
21
|
-
export declare const
|
|
22
|
+
export declare const getSubMenuItemsFromMenu: (items: MainMenu[], url: string, excludedRoutes?: string[]) => SubMenuItem[];
|
|
22
23
|
export {};
|
package/dist/Menu/Sidebar.svelte
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import { page } from '$app/state';
|
|
3
3
|
import { fade } from 'svelte/transition';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import type { MenuItem,
|
|
5
|
+
import SidebarMenuItem from './MenuItem.svelte';
|
|
6
|
+
import type { MenuItem, SubMenuItem } from './MenuState.svelte.js';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
|
-
|
|
9
|
+
subMenuItems: SubMenuItem[];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
let {
|
|
12
|
+
let { subMenuItems = [] }: Props = $props();
|
|
13
13
|
|
|
14
|
-
let hasItems: boolean = $derived(!!
|
|
14
|
+
let hasItems: boolean = $derived(!!subMenuItems.length);
|
|
15
15
|
let isCollapsed: boolean = $state(true);
|
|
16
16
|
let selectedItem: MenuItem | undefined = $derived(
|
|
17
|
-
|
|
17
|
+
subMenuItems
|
|
18
18
|
.flatMap((item) => item.menuItems)
|
|
19
19
|
.find(
|
|
20
20
|
(menuItem) =>
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
</header>
|
|
52
52
|
|
|
53
53
|
<section class="content">
|
|
54
|
-
{#each
|
|
54
|
+
{#each subMenuItems as subMenuItem}
|
|
55
55
|
<section class="category-content">
|
|
56
|
-
<h2 class="category-span" class:hidden={isCollapsed}>{
|
|
56
|
+
<h2 class="category-span" class:hidden={isCollapsed}>{subMenuItem.category}</h2>
|
|
57
57
|
<menu class="category-items-details">
|
|
58
|
-
{#if
|
|
59
|
-
{#each
|
|
60
|
-
<
|
|
58
|
+
{#if subMenuItem.menuItems}
|
|
59
|
+
{#each subMenuItem.menuItems as menuItem}
|
|
60
|
+
<SidebarMenuItem
|
|
61
61
|
item={menuItem}
|
|
62
62
|
{isCollapsed}
|
|
63
63
|
activeItem={selectedItem?.text === menuItem.text}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SubMenuItem } from './MenuState.svelte.js';
|
|
2
2
|
interface Props {
|
|
3
|
-
|
|
3
|
+
subMenuItems: SubMenuItem[];
|
|
4
4
|
}
|
|
5
5
|
declare const Sidebar: import("svelte").Component<Props, {}, "">;
|
|
6
6
|
type Sidebar = ReturnType<typeof Sidebar>;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,12 +43,12 @@ import { addToast } from './Toast/toastState.svelte';
|
|
|
43
43
|
import { setFormContext, getFormContext } from './Form/FormController/context.js';
|
|
44
44
|
import { validateSchema } from './Form/FormController/helper.js';
|
|
45
45
|
import { createZodString } from './Form/FormController/zod-validations.js';
|
|
46
|
-
import {
|
|
46
|
+
import { getSubMenuItemsFromMenu } from './Menu/MenuState.svelte';
|
|
47
47
|
import type { BreadcrumbsNameMap } from './Breadcrumbs/breadcrumbsState.svelte.js';
|
|
48
48
|
import type { FormError, FormContext } from './Form/FormController/types.js';
|
|
49
49
|
import type { HighlightPanelColumn } from './HighlightPanel/highlightPanelState.svelte.js';
|
|
50
50
|
import type { HomeItem } from './Menu/MenuState.svelte.js';
|
|
51
|
-
import type { MainMenu, MenuItem,
|
|
51
|
+
import type { MainMenu, MenuItem, SubMenuItem } from './Menu/MenuState.svelte.js';
|
|
52
52
|
import type { ModalProps } from './Modal/modalState.svelte.js';
|
|
53
53
|
import type { ProgressWizardStep } from './ProgressWizard/progressWizardState.svelte.js';
|
|
54
54
|
import type { SwitcherOption } from './Switcher/switcherState.svelte.js';
|
|
@@ -58,4 +58,4 @@ import type { Toast } from './Toast/toastState.svelte';
|
|
|
58
58
|
import type { WaffleItem } from './Waffle/waffleState.svelte.js';
|
|
59
59
|
import type { AttachFileFormConfig, FileValidationCallback } from './Form/AttachFile/attachFile.svelte.js';
|
|
60
60
|
import type { NotificationProps } from './Notification/notificationState.svelte.js';
|
|
61
|
-
export { Accordion, Avatar, Breadcrumbs, Button, Card, Chips, DeleteConfirmationModal, ErrorPage, Footer, Form, Header, HeaderAccount, HeaderLoader, HeaderLogo, HighlightPanel, Home, Input, Link, Menu, Modal, Notification, Processing, ProgressPage, ProgressWizard, Search, Select, Sidebar, Spinner, Switcher, Tabs, TextArea, Toaster, Toggle, Tooltip, Waffle, AttachFile, addBreadcrumbsNameMap, addToast, getProgressWizardContext, setProgressWizardStepsContext, setStepValidity, setFormContext, getFormContext, validateSchema, createZodString,
|
|
61
|
+
export { Accordion, Avatar, Breadcrumbs, Button, Card, Chips, DeleteConfirmationModal, ErrorPage, Footer, Form, Header, HeaderAccount, HeaderLoader, HeaderLogo, HighlightPanel, Home, Input, Link, Menu, Modal, Notification, Processing, ProgressPage, ProgressWizard, Search, Select, Sidebar, Spinner, Switcher, Tabs, TextArea, Toaster, Toggle, Tooltip, Waffle, AttachFile, addBreadcrumbsNameMap, addToast, getProgressWizardContext, setProgressWizardStepsContext, setStepValidity, setFormContext, getFormContext, validateSchema, createZodString, getSubMenuItemsFromMenu, ChipType, ColumnType, ImageType, type BreadcrumbsNameMap, type HighlightPanelColumn, type HomeItem, type MainMenu, type MenuItem, type ModalProps, type ProgressWizardStep, type SelectOption, type SwitcherOption, type Tab, type Toast, type WaffleItem, type FormError, type FormContext, type SubMenuItem, type AttachFileFormConfig, type FileValidationCallback, type NotificationProps };
|
package/dist/index.js
CHANGED
|
@@ -45,11 +45,11 @@ import { addToast } from './Toast/toastState.svelte';
|
|
|
45
45
|
import { setFormContext, getFormContext } from './Form/FormController/context.js';
|
|
46
46
|
import { validateSchema } from './Form/FormController/helper.js';
|
|
47
47
|
import { createZodString } from './Form/FormController/zod-validations.js';
|
|
48
|
-
import {
|
|
48
|
+
import { getSubMenuItemsFromMenu } from './Menu/MenuState.svelte';
|
|
49
49
|
export {
|
|
50
50
|
// Components
|
|
51
51
|
Accordion, Avatar, Breadcrumbs, Button, Card, Chips, DeleteConfirmationModal, ErrorPage, Footer, Form, Header, HeaderAccount, HeaderLoader, HeaderLogo, HighlightPanel, Home, Input, Link, Menu, Modal, Notification, Processing, ProgressPage, ProgressWizard, Search, Select, Sidebar, Spinner, Switcher, Tabs, TextArea, Toaster, Toggle, Tooltip, Waffle, AttachFile,
|
|
52
52
|
// Functions and helpers
|
|
53
|
-
addBreadcrumbsNameMap, addToast, getProgressWizardContext, setProgressWizardStepsContext, setStepValidity, setFormContext, getFormContext, validateSchema, createZodString,
|
|
53
|
+
addBreadcrumbsNameMap, addToast, getProgressWizardContext, setProgressWizardStepsContext, setStepValidity, setFormContext, getFormContext, validateSchema, createZodString, getSubMenuItemsFromMenu,
|
|
54
54
|
// Enums
|
|
55
55
|
ChipType, ColumnType, ImageType };
|