@nice2dev/ui 1.3.12 → 1.3.13
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/CHANGELOG.md +72 -0
- package/dist/NiceModuleLifecyclePanel-BakQIZ5c.js +8418 -0
- package/dist/NiceModuleLifecyclePanel-ui6mzXQS.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/index.cjs +238 -238
- package/dist/index.css +1 -1
- package/dist/index.d.ts +697 -3
- package/dist/index.mjs +21737 -19198
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +81 -0
- package/dist/navigation.mjs +97 -96
- package/dist/style.css +2 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -761,6 +761,9 @@ declare interface ActionParam {
|
|
|
761
761
|
required?: boolean;
|
|
762
762
|
}
|
|
763
763
|
|
|
764
|
+
/** The list the Favourites view shows — the default one when the chosen list is gone. */
|
|
765
|
+
export declare function activeSidebarFavoriteList(prefs: FavoritePrefs): string;
|
|
766
|
+
|
|
764
767
|
export declare interface AdapterCLIArgs {
|
|
765
768
|
source: string;
|
|
766
769
|
target: AdapterFramework;
|
|
@@ -804,6 +807,19 @@ export declare type AdaptiveStreamType = 'hls' | 'dash' | 'smooth';
|
|
|
804
807
|
|
|
805
808
|
export { AdaptiveVariant }
|
|
806
809
|
|
|
810
|
+
/**
|
|
811
|
+
* Adds the catalog pages `pageIds` (a branch: `catalogPagesOf(catalog, [branchId])`), each under
|
|
812
|
+
* the groups of its catalog path — made when missing, found anywhere in the menu when the user
|
|
813
|
+
* moved them. Pages already in the menu stay where they are.
|
|
814
|
+
*/
|
|
815
|
+
export declare function addCatalogPages(menu: readonly NiceMenuBuilderItem[], catalog: readonly NiceMenuCatalogNode[], pageIds: readonly string[], options?: NiceMenuAddOptions): NiceMenuBuilderItem[];
|
|
816
|
+
|
|
817
|
+
/** Adds a group of the user's own at `target` (default: the end of the top level). */
|
|
818
|
+
export declare function addMenuGroup(menu: readonly NiceMenuBuilderItem[], label: string, target?: TreeDropTarget): {
|
|
819
|
+
menu: NiceMenuBuilderItem[];
|
|
820
|
+
id: string;
|
|
821
|
+
};
|
|
822
|
+
|
|
807
823
|
/** Address field definition within a NiceAddressInput. */
|
|
808
824
|
export declare interface AddressValue {
|
|
809
825
|
street?: string;
|
|
@@ -2268,6 +2284,12 @@ declare interface CashRunwayConfig {
|
|
|
2268
2284
|
showDate?: boolean;
|
|
2269
2285
|
}
|
|
2270
2286
|
|
|
2287
|
+
/** A catalog from NiceSidebarNav data — the "All" tree: sources → modules → views. */
|
|
2288
|
+
export declare function catalogFromSidebarData(data: readonly SidebarNavDataNode[], options?: NiceCatalogFromSidebarOptions): NiceMenuCatalogNode[];
|
|
2289
|
+
|
|
2290
|
+
/** The pages at or below the catalog nodes `ids`, in catalog order, each once. */
|
|
2291
|
+
export declare function catalogPagesOf(catalog: readonly NiceMenuCatalogNode[], ids: readonly string[]): string[];
|
|
2292
|
+
|
|
2271
2293
|
/** Cell position for keyboard navigation and selection. */
|
|
2272
2294
|
declare interface CellPosition {
|
|
2273
2295
|
rowKey: string;
|
|
@@ -3236,6 +3258,9 @@ export { createReactQueryAdapter }
|
|
|
3236
3258
|
|
|
3237
3259
|
export { createRestDataSource }
|
|
3238
3260
|
|
|
3261
|
+
/** An id for a new role from its label: `sales-rep`, `sales-rep-2`… */
|
|
3262
|
+
export declare function createRoleId(label: string, roles: readonly NiceRoleDef[]): string;
|
|
3263
|
+
|
|
3239
3264
|
export { createSignalRDataSource }
|
|
3240
3265
|
|
|
3241
3266
|
export declare function createSignalRLiveChartSource(config: SignalRLiveChartSourceConfig): LiveChartDataSource;
|
|
@@ -4225,6 +4250,9 @@ export declare interface DualVisibilityProps {
|
|
|
4225
4250
|
showTextInMenu?: boolean;
|
|
4226
4251
|
}
|
|
4227
4252
|
|
|
4253
|
+
/** A copy of a role (its codes and what it inherits) right after it; never a system role. */
|
|
4254
|
+
export declare function duplicateRole(roles: readonly NiceRoleDef[], roleId: string, label: string, id?: string): NiceRoleDef[];
|
|
4255
|
+
|
|
4228
4256
|
export declare const Dynamics365Connector: ConnectorDefinition;
|
|
4229
4257
|
|
|
4230
4258
|
export declare interface Dynamics365ConnectorConfig extends ConnectorConfig {
|
|
@@ -5050,6 +5078,8 @@ export declare interface FAQSearchResult {
|
|
|
5050
5078
|
}[];
|
|
5051
5079
|
}
|
|
5052
5080
|
|
|
5081
|
+
declare type FavoritePrefs = Pick<SidebarNavUserPrefs, 'favorites' | 'favoriteLists' | 'activeFavoriteListId'>;
|
|
5082
|
+
|
|
5053
5083
|
/**
|
|
5054
5084
|
* Fetch design tokens from a Figma file's local styles.
|
|
5055
5085
|
*/
|
|
@@ -5174,9 +5204,15 @@ export { FilterToSqlOptions }
|
|
|
5174
5204
|
|
|
5175
5205
|
export declare type FilterType = 'brightness' | 'contrast' | 'saturation' | 'hue' | 'blur' | 'sharpen' | 'grayscale' | 'sepia' | 'invert' | 'vignette' | 'chromaKey' | 'colorCorrection';
|
|
5176
5206
|
|
|
5207
|
+
/** The catalog node with `id`. */
|
|
5208
|
+
export declare function findMenuCatalogNode(catalog: readonly NiceMenuCatalogNode[], id: string): NiceMenuCatalogNode | undefined;
|
|
5209
|
+
|
|
5177
5210
|
/** The first view with `route`, searched in every tree unless `options.trees` says otherwise. */
|
|
5178
5211
|
export declare function findSidebarItemByRoute(data: readonly SidebarNavDataNode[], route: string, options?: WalkSidebarNavOptions): SidebarNavVisit<SidebarNavView> | undefined;
|
|
5179
5212
|
|
|
5213
|
+
/** The node with `id`, or `undefined`. */
|
|
5214
|
+
export declare function findTreeNode<T>(tree: readonly T[], id: string, options?: TreeEditOptions): T | undefined;
|
|
5215
|
+
|
|
5180
5216
|
/**
|
|
5181
5217
|
* Heraldically-correct flag icon rendered from `country-flag-icons` SVGs
|
|
5182
5218
|
* (3:2 aspect ratio). Falls back to a coloured stripe swatch when the
|
|
@@ -6028,10 +6064,25 @@ export declare type InboxPriority = 'low' | 'normal' | 'high' | 'urgent';
|
|
|
6028
6064
|
/** Sort field options for inbox. */
|
|
6029
6065
|
declare type InboxSortField = 'date' | 'from' | 'subject' | 'priority';
|
|
6030
6066
|
|
|
6067
|
+
/** Makes the node with `id` the last child of its previous sibling; the first sibling stays. */
|
|
6068
|
+
export declare function indentTreeNode<T>(tree: readonly T[], id: string, options?: TreeEditOptions): T[];
|
|
6069
|
+
|
|
6031
6070
|
export { IndexedDBAdapter }
|
|
6032
6071
|
|
|
6033
6072
|
export { InputStyleVariant }
|
|
6034
6073
|
|
|
6074
|
+
/**
|
|
6075
|
+
* Places the catalog nodes `ids` at `target` (a drag from the catalog): a page as an item, a
|
|
6076
|
+
* branch as a group with its pages. Pages already in the menu move there. `asPage` places a page
|
|
6077
|
+
* with pages below it as the page alone.
|
|
6078
|
+
*/
|
|
6079
|
+
export declare function insertCatalogNodes(menu: readonly NiceMenuBuilderItem[], catalog: readonly NiceMenuCatalogNode[], ids: readonly string[], target: TreeDropTarget, options?: {
|
|
6080
|
+
asPage?: boolean;
|
|
6081
|
+
}): NiceMenuBuilderItem[];
|
|
6082
|
+
|
|
6083
|
+
/** Inserts `node` at `target`; the index is clamped to the parent's children. */
|
|
6084
|
+
export declare function insertTreeNode<T>(tree: readonly T[], node: T, target: TreeDropTarget, options?: TreeEditOptions): T[];
|
|
6085
|
+
|
|
6035
6086
|
export declare interface InstanceActivity {
|
|
6036
6087
|
id: string;
|
|
6037
6088
|
activityId: string;
|
|
@@ -6145,6 +6196,9 @@ export declare function isAllowed(resolved: NiceResolvedPermissions, resource: s
|
|
|
6145
6196
|
|
|
6146
6197
|
export { isRecordValid }
|
|
6147
6198
|
|
|
6199
|
+
/** Whether the node with `id` is somewhere below the node with `ancestorId` (not itself). */
|
|
6200
|
+
export declare function isTreeDescendant<T>(tree: readonly T[], id: string, ancestorId: string, options?: TreeEditOptions): boolean;
|
|
6201
|
+
|
|
6148
6202
|
/** Check if a version satisfies min/max constraints. */
|
|
6149
6203
|
export declare function isVersionCompatible(version: SemVer, min?: SemVer, max?: SemVer): boolean;
|
|
6150
6204
|
|
|
@@ -6877,8 +6931,35 @@ export declare interface MediaFile {
|
|
|
6877
6931
|
format?: string;
|
|
6878
6932
|
}
|
|
6879
6933
|
|
|
6934
|
+
/** The catalog path above a node: its ancestors' labels. */
|
|
6935
|
+
export declare function menuCatalogPath(catalog: readonly NiceMenuCatalogNode[], id: string): string[];
|
|
6936
|
+
|
|
6937
|
+
/** The catalog pages the menu holds — the checked rows of the catalog. */
|
|
6938
|
+
export declare function menuCheckedPages(menu: readonly NiceMenuBuilderItem[]): string[];
|
|
6939
|
+
|
|
6940
|
+
/** An item's label: its own, else the catalog's (page, then branch). */
|
|
6941
|
+
export declare function menuItemLabel(item: NiceMenuBuilderItem, catalog: readonly NiceMenuCatalogNode[]): string;
|
|
6942
|
+
|
|
6943
|
+
/** The catalog node an item stands for — its page, else the branch it was made from. */
|
|
6944
|
+
export declare function menuItemSource(item: NiceMenuBuilderItem, catalog: readonly NiceMenuCatalogNode[]): NiceMenuCatalogNode | undefined;
|
|
6945
|
+
|
|
6946
|
+
/** Ids of the items whose page is not in the catalog (removed, or no longer allowed). */
|
|
6947
|
+
export declare function menuOrphans(menu: readonly NiceMenuBuilderItem[], catalog: readonly NiceMenuCatalogNode[]): string[];
|
|
6948
|
+
|
|
6880
6949
|
export { MenuStyleVariant }
|
|
6881
6950
|
|
|
6951
|
+
/**
|
|
6952
|
+
* The menu as NiceSidebarNav data with one source: groups at the top level become modules,
|
|
6953
|
+
* pages at the top level go to a module of their own (`otherLabel`).
|
|
6954
|
+
*/
|
|
6955
|
+
export declare function menuToSidebarData(menu: readonly NiceMenuBuilderItem[], catalog: readonly NiceMenuCatalogNode[], options?: NiceMenuToSidebarOptions & {
|
|
6956
|
+
source?: SidebarNavDataNode['source'];
|
|
6957
|
+
otherLabel?: string;
|
|
6958
|
+
}): SidebarNavDataNode[];
|
|
6959
|
+
|
|
6960
|
+
/** The menu as NiceSidebarNav views, at any depth; items whose page is gone and empty groups are left out. */
|
|
6961
|
+
export declare function menuToSidebarViews(menu: readonly NiceMenuBuilderItem[], catalog: readonly NiceMenuCatalogNode[], options?: NiceMenuToSidebarOptions): SidebarNavView[];
|
|
6962
|
+
|
|
6882
6963
|
export declare interface MergeConfig {
|
|
6883
6964
|
sourceId: string;
|
|
6884
6965
|
targetId: string;
|
|
@@ -7198,6 +7279,16 @@ declare interface ModuleViewPreferences {
|
|
|
7198
7279
|
displayDensity?: 'compact' | 'normal' | 'comfortable';
|
|
7199
7280
|
}
|
|
7200
7281
|
|
|
7282
|
+
/**
|
|
7283
|
+
* Moves the node with `id` (with its subtree) to `target`. `target.index` counts the target's
|
|
7284
|
+
* children as they are now, the moved node still in place — what a drop line between two rows
|
|
7285
|
+
* gives. Moving a node into its own subtree, or to where it already is, changes nothing.
|
|
7286
|
+
*/
|
|
7287
|
+
export declare function moveTreeNode<T>(tree: readonly T[], id: string, target: TreeDropTarget, options?: TreeEditOptions): T[];
|
|
7288
|
+
|
|
7289
|
+
/** Moves the node with `id` `delta` places among its siblings (clamped). */
|
|
7290
|
+
export declare function moveTreeNodeBy<T>(tree: readonly T[], id: string, delta: number, options?: TreeEditOptions): T[];
|
|
7291
|
+
|
|
7201
7292
|
/** A breadcrumb item. */
|
|
7202
7293
|
export declare interface NavbarBreadcrumb {
|
|
7203
7294
|
label: string;
|
|
@@ -9193,6 +9284,14 @@ export declare interface NiceCascadeSelectProps extends NiceStandardProps {
|
|
|
9193
9284
|
disabled?: boolean;
|
|
9194
9285
|
}
|
|
9195
9286
|
|
|
9287
|
+
/** Options of {@link catalogFromSidebarData}. */
|
|
9288
|
+
export declare interface NiceCatalogFromSidebarOptions {
|
|
9289
|
+
/** A view's catalog id: its `id` (default), its `route`, or your own (e.g. `package/view`). */
|
|
9290
|
+
key?: 'id' | 'route' | ((view: SidebarNavView, module: SidebarNavModule) => string);
|
|
9291
|
+
/** Keep the sources as the top level (default: when there is more than one). */
|
|
9292
|
+
includeSources?: boolean;
|
|
9293
|
+
}
|
|
9294
|
+
|
|
9196
9295
|
export declare interface NiceCategoryPref {
|
|
9197
9296
|
categoryId: string;
|
|
9198
9297
|
channels: Record<string, boolean>;
|
|
@@ -14500,6 +14599,44 @@ export { NiceIconProvider }
|
|
|
14500
14599
|
|
|
14501
14600
|
export { NiceIconProviderProps }
|
|
14502
14601
|
|
|
14602
|
+
/**
|
|
14603
|
+
* {@link NiceIconRail} — a bar of buttons, each an icon with its caption under it, vertical or
|
|
14604
|
+
* horizontal.
|
|
14605
|
+
*/
|
|
14606
|
+
export declare const NiceIconRail: default_2.FC<NiceIconRailProps>;
|
|
14607
|
+
|
|
14608
|
+
/** A button of {@link NiceIconRail}. */
|
|
14609
|
+
export declare interface NiceIconRailItem {
|
|
14610
|
+
id: string;
|
|
14611
|
+
/** The caption under the icon. */
|
|
14612
|
+
label: string;
|
|
14613
|
+
icon: default_2.ReactNode;
|
|
14614
|
+
/** Hover text; default the caption. */
|
|
14615
|
+
title?: string;
|
|
14616
|
+
/** A count or a short mark on the icon. */
|
|
14617
|
+
badge?: string | number;
|
|
14618
|
+
disabled?: boolean;
|
|
14619
|
+
/** A route the host opens when the button is pressed (no `onClick`). */
|
|
14620
|
+
route?: string;
|
|
14621
|
+
onClick?: () => void;
|
|
14622
|
+
}
|
|
14623
|
+
|
|
14624
|
+
/** Props for the {@link NiceIconRail} component — a bar of icon buttons with captions. */
|
|
14625
|
+
export declare interface NiceIconRailProps extends NiceBaseProps {
|
|
14626
|
+
/** The buttons. */
|
|
14627
|
+
items?: NiceIconRailItem[];
|
|
14628
|
+
/** A column (default) or a row. */
|
|
14629
|
+
orientation?: 'vertical' | 'horizontal';
|
|
14630
|
+
/** The button of the page in view. */
|
|
14631
|
+
activeId?: string;
|
|
14632
|
+
/** Called with the pressed button (after its own `onClick`). */
|
|
14633
|
+
onSelect?: (item: NiceIconRailItem) => void;
|
|
14634
|
+
/** Accessible name of the bar. */
|
|
14635
|
+
'aria-label'?: string;
|
|
14636
|
+
/** Size of the buttons (default `'md'`). */
|
|
14637
|
+
size?: NiceSize;
|
|
14638
|
+
}
|
|
14639
|
+
|
|
14503
14640
|
export { NiceIconResolver }
|
|
14504
14641
|
|
|
14505
14642
|
export { NiceIconSize }
|
|
@@ -16466,8 +16603,90 @@ export declare interface NiceMentionSuggestion {
|
|
|
16466
16603
|
|
|
16467
16604
|
export declare const NiceMenu: default_2.FC<NiceMenuProps>;
|
|
16468
16605
|
|
|
16606
|
+
export declare interface NiceMenuAddOptions {
|
|
16607
|
+
/** Catalog levels above a page that are not recreated as groups (e.g. 1 skips the database). */
|
|
16608
|
+
skipLevels?: number;
|
|
16609
|
+
}
|
|
16610
|
+
|
|
16469
16611
|
export declare type NiceMenuAlign = 'start' | 'center' | 'end';
|
|
16470
16612
|
|
|
16613
|
+
/**
|
|
16614
|
+
* {@link NiceMenuBuilder} — builds a menu from a catalog of views: check views on the left,
|
|
16615
|
+
* arrange and nest them on the right, rename them and change their icons, see the result.
|
|
16616
|
+
*/
|
|
16617
|
+
export declare const NiceMenuBuilder: default_2.FC<NiceMenuBuilderProps>;
|
|
16618
|
+
|
|
16619
|
+
/** What `renderIconPicker` gets. */
|
|
16620
|
+
export declare interface NiceMenuBuilderIconPickerProps {
|
|
16621
|
+
/** The item's own icon name; `undefined` while it shows the catalog's. */
|
|
16622
|
+
value?: string;
|
|
16623
|
+
/** Sets the icon (`undefined`: back to the catalog's). */
|
|
16624
|
+
onChange: (icon: string | undefined) => void;
|
|
16625
|
+
}
|
|
16626
|
+
|
|
16627
|
+
/** An item of a menu built with NiceMenuBuilder. */
|
|
16628
|
+
export declare interface NiceMenuBuilderItem {
|
|
16629
|
+
/** Unique in the menu. */
|
|
16630
|
+
id: string;
|
|
16631
|
+
/** The catalog page it opens; without it the item is a group. */
|
|
16632
|
+
ref?: string;
|
|
16633
|
+
/** The catalog branch a group was recreated from. */
|
|
16634
|
+
from?: string;
|
|
16635
|
+
/** Own label; default the catalog's. */
|
|
16636
|
+
label?: string;
|
|
16637
|
+
/** Own icon name; default the catalog's icon. */
|
|
16638
|
+
icon?: string;
|
|
16639
|
+
children?: NiceMenuBuilderItem[];
|
|
16640
|
+
}
|
|
16641
|
+
|
|
16642
|
+
/** Props for the {@link NiceMenuBuilder} component — builds a menu from a catalog of views. */
|
|
16643
|
+
export declare interface NiceMenuBuilderProps extends NiceBaseProps {
|
|
16644
|
+
/** Every view a menu can show, as a tree — `catalogFromSidebarData(sidebarData)` turns sidebar data into one. */
|
|
16645
|
+
catalog?: NiceMenuCatalogNode[];
|
|
16646
|
+
/** The menu (controlled). */
|
|
16647
|
+
value?: NiceMenuBuilderItem[];
|
|
16648
|
+
/** The menu at mount (uncontrolled). */
|
|
16649
|
+
defaultValue?: NiceMenuBuilderItem[];
|
|
16650
|
+
/** Called with the new menu. */
|
|
16651
|
+
onChange?: (menu: NiceMenuBuilderItem[]) => void;
|
|
16652
|
+
/** Catalog levels above a view that are not recreated as groups when it is checked (1 skips the database). */
|
|
16653
|
+
skipLevels?: number;
|
|
16654
|
+
/** Levels the menu may have. */
|
|
16655
|
+
maxDepth?: number;
|
|
16656
|
+
/** Draws an icon name (default `<NiceIcon name>`, so an icon resolver of the host applies). */
|
|
16657
|
+
renderIcon?: (name: string) => default_2.ReactNode;
|
|
16658
|
+
/** Your icon picker for the item panel — e.g. NiceIconPicker of @nice2dev/icons. Default: a grid of the built-in icons. */
|
|
16659
|
+
renderIconPicker?: (props: NiceMenuBuilderIconPickerProps) => default_2.ReactNode;
|
|
16660
|
+
/** Show the menu as the sidebar will (default true). */
|
|
16661
|
+
showPreview?: boolean;
|
|
16662
|
+
/** More props for the preview's NiceSidebarNav. */
|
|
16663
|
+
previewProps?: Partial<NiceSidebarNavProps>;
|
|
16664
|
+
/** Your content in the menu column's header — e.g. Save. */
|
|
16665
|
+
toolbar?: default_2.ReactNode;
|
|
16666
|
+
/** Height of the builder (default 600px; the columns scroll inside it). */
|
|
16667
|
+
height?: number | string;
|
|
16668
|
+
/** Density of the trees (default `'md'`). */
|
|
16669
|
+
size?: NiceSize;
|
|
16670
|
+
/** Look only: nothing is added, moved or renamed. */
|
|
16671
|
+
readOnly?: boolean;
|
|
16672
|
+
/** Dimmed and inert. */
|
|
16673
|
+
disabled?: boolean;
|
|
16674
|
+
}
|
|
16675
|
+
|
|
16676
|
+
/** A node of the catalog — a page (with `route`) or a branch. */
|
|
16677
|
+
export declare interface NiceMenuCatalogNode {
|
|
16678
|
+
id: string;
|
|
16679
|
+
label: string;
|
|
16680
|
+
/** An icon, or the name of one (drawn by NiceMenuBuilder's `renderIcon`). */
|
|
16681
|
+
icon?: ReactNode;
|
|
16682
|
+
/** A node with a route is a page and can be placed in a menu. */
|
|
16683
|
+
route?: string;
|
|
16684
|
+
description?: string;
|
|
16685
|
+
children?: NiceMenuCatalogNode[];
|
|
16686
|
+
/** Shown, but cannot be placed (no permission, not installed…). */
|
|
16687
|
+
disabled?: boolean;
|
|
16688
|
+
}
|
|
16689
|
+
|
|
16471
16690
|
export declare type NiceMenuDensity = 'compact' | 'normal' | 'comfortable';
|
|
16472
16691
|
|
|
16473
16692
|
/**
|
|
@@ -16601,6 +16820,12 @@ export declare interface NiceMenuProps extends NiceBaseProps {
|
|
|
16601
16820
|
maxDepth?: number;
|
|
16602
16821
|
}
|
|
16603
16822
|
|
|
16823
|
+
/** Options of {@link menuToSidebarViews} and {@link menuToSidebarData}. */
|
|
16824
|
+
export declare interface NiceMenuToSidebarOptions {
|
|
16825
|
+
/** Draws an icon name (an item's own icon, or a catalog icon given as a name). */
|
|
16826
|
+
renderIcon?: (name: string) => ReactNode;
|
|
16827
|
+
}
|
|
16828
|
+
|
|
16604
16829
|
/**
|
|
16605
16830
|
* Visual style for top-level triggers.
|
|
16606
16831
|
* - `separated` — soft buttons with gap (default-ish)
|
|
@@ -17242,6 +17467,17 @@ export declare interface NiceNavShellApi {
|
|
|
17242
17467
|
closeAll: () => void;
|
|
17243
17468
|
pinTab: (id: string, pinned?: boolean) => void;
|
|
17244
17469
|
setDirty: (id: string, dirty?: boolean) => void;
|
|
17470
|
+
/**
|
|
17471
|
+
* Merges tabs into one that shows their pages together (1.3.13); merged tabs among them give
|
|
17472
|
+
* their pages. The merged tab becomes the active one.
|
|
17473
|
+
*/
|
|
17474
|
+
mergeTabs: (ids: string[], layout?: NiceNavShellSplitLayout) => void;
|
|
17475
|
+
/** Splits a merged tab back into a tab per page (1.3.13). */
|
|
17476
|
+
splitTab: (id: string) => void;
|
|
17477
|
+
/** The extra row of buttons under the top bar is shown (1.3.13; `topBarItems`). */
|
|
17478
|
+
topBarOpen: boolean;
|
|
17479
|
+
/** Shows or hides that row — the button for it in a `topNav` slot of your own. */
|
|
17480
|
+
setTopBarOpen: (open: boolean) => void;
|
|
17245
17481
|
}
|
|
17246
17482
|
|
|
17247
17483
|
export declare function NiceNavShellHome({ userName, userId, openTabs, routes, routeLabels, routeIcons, shortcuts, onNavigate, showGreeting, showOpenTabs, showShortcuts, showRoutes, maxItemsPerSection, header, footer, className, style, }: NiceNavShellHomeProps): default_2.ReactElement;
|
|
@@ -17438,8 +17674,29 @@ export declare interface NiceNavShellProps {
|
|
|
17438
17674
|
closableTabs?: boolean;
|
|
17439
17675
|
/** Allow pin/unpin via context menu. Default `true`. */
|
|
17440
17676
|
pinnableTabs?: boolean;
|
|
17441
|
-
/**
|
|
17677
|
+
/**
|
|
17678
|
+
* Reorder by dragging (opt-in): the tab follows the pointer and the others make room (1.3.13;
|
|
17679
|
+
* before, plain HTML5 drag). Also Ctrl+Shift+← / → and the tab menu. Default `false`.
|
|
17680
|
+
*/
|
|
17442
17681
|
reorderableTabs?: boolean;
|
|
17682
|
+
/**
|
|
17683
|
+
* Select tabs with Shift+click (a range) or Ctrl+click and merge them from the tab menu: side by
|
|
17684
|
+
* side, one under another or in a grid, all shown in the body at once (1.3.13). Default `true`.
|
|
17685
|
+
*/
|
|
17686
|
+
mergeableTabs?: boolean;
|
|
17687
|
+
/**
|
|
17688
|
+
* An extra row of buttons — icon, caption under it — under the top bar, across the shell
|
|
17689
|
+
* (1.3.13). Hidden until opened: the built-in top bar gets a button for it, a `topNav` slot of
|
|
17690
|
+
* your own calls `api.setTopBarOpen`. A button with a `route` opens it. Without items there is
|
|
17691
|
+
* no row and no button.
|
|
17692
|
+
*/
|
|
17693
|
+
topBarItems?: NiceIconRailItem[];
|
|
17694
|
+
/** The row is shown (controlled). */
|
|
17695
|
+
topBarOpen?: boolean;
|
|
17696
|
+
/** The row is shown at mount (uncontrolled; default `false`). */
|
|
17697
|
+
defaultTopBarOpen?: boolean;
|
|
17698
|
+
/** Called when the row is shown or hidden. */
|
|
17699
|
+
onTopBarOpenChange?: (open: boolean) => void;
|
|
17443
17700
|
/** Persistence backend for tab list. Default `'memory'`. */
|
|
17444
17701
|
persistTabs?: NiceNavShellPersistence;
|
|
17445
17702
|
/** Storage key for persistence. Default `'nice-nav-shell:tabs'`. */
|
|
@@ -17541,6 +17798,9 @@ export declare interface NiceNavShellProps {
|
|
|
17541
17798
|
focusContentOnNavigate?: boolean;
|
|
17542
17799
|
}
|
|
17543
17800
|
|
|
17801
|
+
/** How a merged tab lays out its pages (1.3.13): side by side, one under another, or a grid. */
|
|
17802
|
+
export declare type NiceNavShellSplitLayout = 'columns' | 'rows' | 'grid';
|
|
17803
|
+
|
|
17544
17804
|
export declare interface NiceNavShellTab {
|
|
17545
17805
|
/** Unique stable id. Defaults to `route` if omitted at openRoute call. */
|
|
17546
17806
|
id: string;
|
|
@@ -17562,6 +17822,13 @@ export declare interface NiceNavShellTab {
|
|
|
17562
17822
|
* persisted tabs.
|
|
17563
17823
|
*/
|
|
17564
17824
|
color?: string;
|
|
17825
|
+
/**
|
|
17826
|
+
* The pages of a merged tab (1.3.13): shown together in the body, laid out by `layout`. The
|
|
17827
|
+
* tab's `route` is the page focused in it last. Set by merging tabs from the tab menu.
|
|
17828
|
+
*/
|
|
17829
|
+
panes?: NiceNavShellTab[];
|
|
17830
|
+
/** How a merged tab lays out its `panes` (1.3.13). Default `'columns'`. */
|
|
17831
|
+
layout?: NiceNavShellSplitLayout;
|
|
17565
17832
|
}
|
|
17566
17833
|
|
|
17567
17834
|
/**
|
|
@@ -18352,6 +18619,25 @@ export declare interface NicePDFViewerProps extends NiceStandardProps {
|
|
|
18352
18619
|
|
|
18353
18620
|
export { NicePendingChange }
|
|
18354
18621
|
|
|
18622
|
+
/**
|
|
18623
|
+
* roleModel — the data of NiceRoleEditor: roles that hold permission codes and may inherit other
|
|
18624
|
+
* roles, the users holding roles, and the permission catalog grouped into a tree. Pure functions.
|
|
18625
|
+
*
|
|
18626
|
+
* The shape follows how ERPs keep it: a permission is a code (`CRM.Account.View`), a role is a
|
|
18627
|
+
* named set of codes (a permission group), a user holds roles. Codes group by their dots —
|
|
18628
|
+
* CRM › Account › View — unless a permission brings its own `path`.
|
|
18629
|
+
*/
|
|
18630
|
+
/** A permission of the catalog. */
|
|
18631
|
+
export declare interface NicePermissionDef {
|
|
18632
|
+
/** The code a role holds, e.g. `CRM.Account.View`. */
|
|
18633
|
+
code: string;
|
|
18634
|
+
/** Its name; default the last part of the code. */
|
|
18635
|
+
label?: string;
|
|
18636
|
+
description?: string;
|
|
18637
|
+
/** Own place in the tree (group labels from the top); default the code's parts before the last. */
|
|
18638
|
+
path?: string[];
|
|
18639
|
+
}
|
|
18640
|
+
|
|
18355
18641
|
/**
|
|
18356
18642
|
* {@link NicePermissionMatrix} — A table-based permission matrix showing roles (rows) × actions (columns).
|
|
18357
18643
|
* Supports tristate (granted / denied / inherited) and bulk toggles.
|
|
@@ -18391,6 +18677,23 @@ export declare interface NicePermissionMatrixProps {
|
|
|
18391
18677
|
id?: string;
|
|
18392
18678
|
}
|
|
18393
18679
|
|
|
18680
|
+
/** A node of {@link permissionTree}: a group (with children) or a permission (with `code`). */
|
|
18681
|
+
export declare interface NicePermissionTreeNode {
|
|
18682
|
+
[field: string]: unknown;
|
|
18683
|
+
key: string;
|
|
18684
|
+
label: string;
|
|
18685
|
+
code?: string;
|
|
18686
|
+
description?: string;
|
|
18687
|
+
children?: NicePermissionTreeNode[];
|
|
18688
|
+
}
|
|
18689
|
+
|
|
18690
|
+
export declare interface NicePermissionTreeOptions {
|
|
18691
|
+
/** A permission's place: the group labels from the top. Default `path`, else the code's parts before the last. */
|
|
18692
|
+
groupBy?: (permission: NicePermissionDef) => string[];
|
|
18693
|
+
/** The label of a group part — e.g. a module's display name for `CRM`. */
|
|
18694
|
+
segmentLabel?: (segment: string, depth: number, path: readonly string[]) => string;
|
|
18695
|
+
}
|
|
18696
|
+
|
|
18394
18697
|
export declare const NicePickList: (<T = unknown>(props: NicePickListProps<T> & default_2.RefAttributes<HTMLDivElement>) => default_2.ReactElement | null) & {
|
|
18395
18698
|
displayName: string;
|
|
18396
18699
|
};
|
|
@@ -19963,11 +20266,91 @@ export declare interface NiceRibbonProps extends NiceStandardProps {
|
|
|
19963
20266
|
placement?: NiceRibbonPlacement;
|
|
19964
20267
|
}
|
|
19965
20268
|
|
|
20269
|
+
/** A role: a named set of permission codes, optionally inheriting other roles. */
|
|
20270
|
+
export declare interface NiceRoleDef {
|
|
20271
|
+
id: string;
|
|
20272
|
+
label: string;
|
|
20273
|
+
description?: string;
|
|
20274
|
+
/** A CSS colour for its dot. */
|
|
20275
|
+
color?: string;
|
|
20276
|
+
/** Built in: cannot be renamed, removed or changed. */
|
|
20277
|
+
system?: boolean;
|
|
20278
|
+
/** Roles whose permissions it has too. */
|
|
20279
|
+
inherits?: string[];
|
|
20280
|
+
/** Its own permission codes. */
|
|
20281
|
+
permissions: string[];
|
|
20282
|
+
}
|
|
20283
|
+
|
|
20284
|
+
/**
|
|
20285
|
+
* {@link NiceRoleEditor} — edits roles: their permissions as a tree with cascading checkboxes,
|
|
20286
|
+
* the roles they inherit, the users holding them, and all roles compared side by side.
|
|
20287
|
+
*/
|
|
20288
|
+
export declare const NiceRoleEditor: default_2.FC<NiceRoleEditorProps>;
|
|
20289
|
+
|
|
20290
|
+
/** Props for the {@link NiceRoleEditor} component — edits roles, their permissions and their users. */
|
|
20291
|
+
export declare interface NiceRoleEditorProps extends NiceBaseProps {
|
|
20292
|
+
/** The permission catalog — codes like `CRM.Account.View`, grouped by their dots (or `path`). */
|
|
20293
|
+
permissions?: NicePermissionDef[];
|
|
20294
|
+
/** The roles (controlled). */
|
|
20295
|
+
value?: NiceRoleDef[];
|
|
20296
|
+
/** The roles at mount (uncontrolled). */
|
|
20297
|
+
defaultValue?: NiceRoleDef[];
|
|
20298
|
+
/** Called with the new roles. */
|
|
20299
|
+
onChange?: (roles: NiceRoleDef[]) => void;
|
|
20300
|
+
/** The users and their roles (controlled); without users the Users part is not shown. */
|
|
20301
|
+
users?: NiceRoleUser[];
|
|
20302
|
+
/** The users at mount (uncontrolled). */
|
|
20303
|
+
defaultUsers?: NiceRoleUser[];
|
|
20304
|
+
/** Called with the users when a role is given or taken away. */
|
|
20305
|
+
onUsersChange?: (users: NiceRoleUser[]) => void;
|
|
20306
|
+
/** The selected role (controlled). */
|
|
20307
|
+
selectedRoleId?: string | null;
|
|
20308
|
+
/** The selected role at mount (uncontrolled; default the first). */
|
|
20309
|
+
defaultSelectedRoleId?: string | null;
|
|
20310
|
+
/** Called when a role is selected. */
|
|
20311
|
+
onSelectedRoleChange?: (id: string | null) => void;
|
|
20312
|
+
/** One role, or every role compared (controlled). */
|
|
20313
|
+
view?: NiceRoleEditorView;
|
|
20314
|
+
/** The view at mount (uncontrolled; default `'role'`). */
|
|
20315
|
+
defaultView?: NiceRoleEditorView;
|
|
20316
|
+
/** Called when the view changes. */
|
|
20317
|
+
onViewChange?: (view: NiceRoleEditorView) => void;
|
|
20318
|
+
/** Roles can inherit other roles (default true). Off: no "inherits from", own codes only. */
|
|
20319
|
+
inheritance?: boolean;
|
|
20320
|
+
/** A permission's place in the tree (group labels from the top); default `path`, else the code's parts. */
|
|
20321
|
+
groupPermission?: (permission: NicePermissionDef) => string[];
|
|
20322
|
+
/** The label of a group part — e.g. a module's display name for `CRM`. */
|
|
20323
|
+
segmentLabel?: (segment: string, depth: number, path: readonly string[]) => string;
|
|
20324
|
+
/** Whether a role can be changed (default: not `system`). */
|
|
20325
|
+
canEditRole?: (role: NiceRoleDef) => boolean;
|
|
20326
|
+
/** The id of a new role (default from its label: `sales-rep`). */
|
|
20327
|
+
createRoleId?: (label: string, roles: readonly NiceRoleDef[]) => string;
|
|
20328
|
+
/** Height of the editor (default 600px). */
|
|
20329
|
+
height?: number | string;
|
|
20330
|
+
/** Density (default `'md'`). */
|
|
20331
|
+
size?: NiceSize;
|
|
20332
|
+
/** Look only. */
|
|
20333
|
+
readOnly?: boolean;
|
|
20334
|
+
/** Dimmed and inert. */
|
|
20335
|
+
disabled?: boolean;
|
|
20336
|
+
}
|
|
20337
|
+
|
|
20338
|
+
/** Which side of the editor shows: one role, or every role compared. */
|
|
20339
|
+
export declare type NiceRoleEditorView = 'role' | 'compare';
|
|
20340
|
+
|
|
19966
20341
|
export declare interface NiceRoleInfo {
|
|
19967
20342
|
id: string;
|
|
19968
20343
|
name: string;
|
|
19969
20344
|
}
|
|
19970
20345
|
|
|
20346
|
+
/** A user and the roles they hold. */
|
|
20347
|
+
export declare interface NiceRoleUser {
|
|
20348
|
+
id: string;
|
|
20349
|
+
label: string;
|
|
20350
|
+
email?: string;
|
|
20351
|
+
roleIds: string[];
|
|
20352
|
+
}
|
|
20353
|
+
|
|
19971
20354
|
export declare const NiceRoomGrid: default_2.FC<NiceRoomGridProps>;
|
|
19972
20355
|
|
|
19973
20356
|
export declare interface NiceRoomGridProps extends NiceBaseProps {
|
|
@@ -21114,6 +21497,41 @@ export declare interface NiceSidebarNavProps {
|
|
|
21114
21497
|
* in collapsed mode (legacy behaviour).
|
|
21115
21498
|
*/
|
|
21116
21499
|
expandableWhenCollapsed?: boolean;
|
|
21500
|
+
/**
|
|
21501
|
+
* A second level (1.3.13): a column of buttons — icon, caption under it — on the outer side of
|
|
21502
|
+
* the sidebar. With items the footer has two buttons: the left one goes a level back (bar →
|
|
21503
|
+
* sidebar → icons), the right one a level on (icons → sidebar → bar). Without them the footer
|
|
21504
|
+
* is the one collapse button it always was.
|
|
21505
|
+
*/
|
|
21506
|
+
railItems?: NiceIconRailItem[];
|
|
21507
|
+
/** The bar is shown (controlled). */
|
|
21508
|
+
railOpen?: boolean;
|
|
21509
|
+
/** The bar is shown at mount (uncontrolled; default `false`). */
|
|
21510
|
+
defaultRailOpen?: boolean;
|
|
21511
|
+
/** Called when the bar is shown or hidden. */
|
|
21512
|
+
onRailOpenChange?: (open: boolean) => void;
|
|
21513
|
+
/** Width of the bar in px (default 76). */
|
|
21514
|
+
railWidth?: number;
|
|
21515
|
+
/** The bar's button of the page in view; default the one whose `route` is `activeRoute`. */
|
|
21516
|
+
railActiveId?: string;
|
|
21517
|
+
/**
|
|
21518
|
+
* By role / By unit with two or more roles / units (1.3.13): a bar under the mode icons picks
|
|
21519
|
+
* one and the tree shows its modules (`activeGroupId` in the preferences). `false` lists them
|
|
21520
|
+
* all, each a group, as before. Default `true`.
|
|
21521
|
+
*/
|
|
21522
|
+
groupPicker?: boolean;
|
|
21523
|
+
/**
|
|
21524
|
+
* How the Favourites view shows a list (1.3.13): `'list'` (default) — the items one under
|
|
21525
|
+
* another; `'tree'` — under their parents as the other tabs show them (source, role / unit,
|
|
21526
|
+
* module, the groups above), shared parents merged.
|
|
21527
|
+
*/
|
|
21528
|
+
favoritesLayout?: 'list' | 'tree';
|
|
21529
|
+
/**
|
|
21530
|
+
* Where a favourite sits in the `'tree'` layout: the items above it, from the top down; `[]` puts
|
|
21531
|
+
* it at the top. Default: the path it was added from (`favorite.path`), else where its view is in
|
|
21532
|
+
* `data` (By module first). Labels and icons of the parents come from `data` when they are in it.
|
|
21533
|
+
*/
|
|
21534
|
+
getFavoritePath?: (favorite: SidebarNavFavorite) => SidebarNavPathEntry[] | undefined;
|
|
21117
21535
|
/** Extra CSS class on the root element */
|
|
21118
21536
|
className?: string;
|
|
21119
21537
|
/** Size variant */
|
|
@@ -21400,6 +21818,114 @@ export declare interface NiceSortableProps<T = unknown> extends NiceBaseProps {
|
|
|
21400
21818
|
disabled?: boolean;
|
|
21401
21819
|
}
|
|
21402
21820
|
|
|
21821
|
+
/**
|
|
21822
|
+
* {@link NiceSortableTree} — a tree to arrange: drag nodes before, after or into others, move,
|
|
21823
|
+
* indent and outdent them from the keyboard, rename and remove them.
|
|
21824
|
+
*/
|
|
21825
|
+
export declare const NiceSortableTree: (<T extends object = NiceSortableTreeNode>(props: NiceSortableTreeProps<T>) => default_2.ReactElement | null) & {
|
|
21826
|
+
displayName: string;
|
|
21827
|
+
};
|
|
21828
|
+
|
|
21829
|
+
/** A built-in entry of the node menu. */
|
|
21830
|
+
export declare type NiceSortableTreeAction = 'moveUp' | 'moveDown' | 'indent' | 'outdent' | 'rename' | 'remove';
|
|
21831
|
+
|
|
21832
|
+
/** What changed — the second argument of `onChange`. */
|
|
21833
|
+
export declare type NiceSortableTreeChange = {
|
|
21834
|
+
type: 'move' | 'indent' | 'outdent';
|
|
21835
|
+
id: string;
|
|
21836
|
+
from: TreeDropTarget;
|
|
21837
|
+
to: TreeDropTarget;
|
|
21838
|
+
} | {
|
|
21839
|
+
type: 'rename';
|
|
21840
|
+
id: string;
|
|
21841
|
+
label: string;
|
|
21842
|
+
} | {
|
|
21843
|
+
type: 'remove';
|
|
21844
|
+
id: string;
|
|
21845
|
+
from: TreeDropTarget;
|
|
21846
|
+
};
|
|
21847
|
+
|
|
21848
|
+
/** A node of {@link NiceSortableTree}: any object with a key and, optionally, children. */
|
|
21849
|
+
export declare interface NiceSortableTreeNode {
|
|
21850
|
+
[field: string]: unknown;
|
|
21851
|
+
}
|
|
21852
|
+
|
|
21853
|
+
/** Props for the {@link NiceSortableTree} component — a tree to arrange by dragging and keyboard. */
|
|
21854
|
+
export declare interface NiceSortableTreeProps<T extends object = NiceSortableTreeNode> extends NiceBaseProps {
|
|
21855
|
+
/** The tree (controlled). */
|
|
21856
|
+
value?: T[];
|
|
21857
|
+
/** The tree at mount (uncontrolled). */
|
|
21858
|
+
defaultValue?: T[];
|
|
21859
|
+
/** Called with the new tree and what changed. */
|
|
21860
|
+
onChange?: (value: T[], change: NiceSortableTreeChange) => void;
|
|
21861
|
+
/** Field with the node's key (default `'id'`). */
|
|
21862
|
+
keyField?: string;
|
|
21863
|
+
/** Field with the node's children (default `'children'`). */
|
|
21864
|
+
childrenField?: string;
|
|
21865
|
+
/** Field a rename writes, and the default label (default `'label'`). */
|
|
21866
|
+
labelField?: string;
|
|
21867
|
+
/** A node's name as text — for the rename field, announcements and type-ahead. */
|
|
21868
|
+
getLabel?: (node: T) => string;
|
|
21869
|
+
/** Own content of a row's label. */
|
|
21870
|
+
renderLabel?: (node: T, state: NiceSortableTreeRowState) => default_2.ReactNode;
|
|
21871
|
+
/** A row's icon. */
|
|
21872
|
+
getIcon?: (node: T, state: NiceSortableTreeRowState) => default_2.ReactNode;
|
|
21873
|
+
/** Content at the end of a row — badges, markers. */
|
|
21874
|
+
renderRowEnd?: (node: T, state: NiceSortableTreeRowState) => default_2.ReactNode;
|
|
21875
|
+
/** The selected node (controlled; `null` for none). */
|
|
21876
|
+
selectedId?: string | null;
|
|
21877
|
+
/** The selected node at mount (uncontrolled). */
|
|
21878
|
+
defaultSelectedId?: string | null;
|
|
21879
|
+
/** Called when a node is selected (a click, Enter, Space). */
|
|
21880
|
+
onSelect?: (id: string | null, node: T | null) => void;
|
|
21881
|
+
/** Closed nodes (controlled) — nodes are open unless listed here. */
|
|
21882
|
+
collapsedIds?: string[];
|
|
21883
|
+
/** Closed nodes at mount (uncontrolled). */
|
|
21884
|
+
defaultCollapsedIds?: string[];
|
|
21885
|
+
/** Called when a node opens or closes. */
|
|
21886
|
+
onCollapsedChange?: (ids: string[]) => void;
|
|
21887
|
+
/** Whether a node takes children — dropped into, indented into (default: every node). */
|
|
21888
|
+
canHaveChildren?: (node: T) => boolean;
|
|
21889
|
+
/** Whether a node can be dragged and moved (default: every node). */
|
|
21890
|
+
canDrag?: (node: T) => boolean;
|
|
21891
|
+
/** Last word on a drop: `dragId` for a node of the tree, `payload` for a drop from outside. */
|
|
21892
|
+
canDrop?: (dragId: string | null, target: TreeDropTarget, payload?: unknown) => boolean;
|
|
21893
|
+
/** Levels the tree may have (1 = a flat list). */
|
|
21894
|
+
maxDepth?: number;
|
|
21895
|
+
/** Nodes can be renamed (F2, double-click, the menu). */
|
|
21896
|
+
editable?: boolean | ((node: T) => boolean);
|
|
21897
|
+
/** Nodes can be removed (Delete, the menu). */
|
|
21898
|
+
removable?: boolean | ((node: T) => boolean);
|
|
21899
|
+
/** Built-in entries of the node menu: `true` (default) for all that apply, or a list. */
|
|
21900
|
+
actions?: boolean | NiceSortableTreeAction[];
|
|
21901
|
+
/** More entries for a node's menu, after the built-in ones. */
|
|
21902
|
+
contextMenuItems?: (node: T) => NiceMenuItem[];
|
|
21903
|
+
/** A drag from outside (NiceMenuBuilder's catalog) dropped at `target`. */
|
|
21904
|
+
onExternalDrop?: (payload: unknown, target: TreeDropTarget) => void;
|
|
21905
|
+
/** Shown when the tree is empty. */
|
|
21906
|
+
emptyText?: default_2.ReactNode;
|
|
21907
|
+
/** Accessible name of the tree. */
|
|
21908
|
+
'aria-label'?: string;
|
|
21909
|
+
/** Height of the scrolling list (default: as tall as its rows). */
|
|
21910
|
+
height?: number | string;
|
|
21911
|
+
/** Row density (default `'md'`). */
|
|
21912
|
+
size?: NiceSize;
|
|
21913
|
+
/** Nothing moves, renames or goes away; selecting and opening still work. */
|
|
21914
|
+
readOnly?: boolean;
|
|
21915
|
+
/** Dimmed and inert. */
|
|
21916
|
+
disabled?: boolean;
|
|
21917
|
+
}
|
|
21918
|
+
|
|
21919
|
+
/** How a row is drawn — what `renderLabel`, `getIcon` and `renderRowEnd` get. */
|
|
21920
|
+
export declare interface NiceSortableTreeRowState {
|
|
21921
|
+
/** 0 for the roots. */
|
|
21922
|
+
depth: number;
|
|
21923
|
+
hasChildren: boolean;
|
|
21924
|
+
expanded: boolean;
|
|
21925
|
+
selected: boolean;
|
|
21926
|
+
dragging: boolean;
|
|
21927
|
+
}
|
|
21928
|
+
|
|
21403
21929
|
export { NiceSortDirection }
|
|
21404
21930
|
|
|
21405
21931
|
export { NiceSortExpression }
|
|
@@ -25601,6 +26127,9 @@ export declare interface OpenAPISpec {
|
|
|
25601
26127
|
};
|
|
25602
26128
|
}
|
|
25603
26129
|
|
|
26130
|
+
/** Moves the node with `id` out of its parent, right after it; a root stays. */
|
|
26131
|
+
export declare function outdentTreeNode<T>(tree: readonly T[], id: string, options?: TreeEditOptions): T[];
|
|
26132
|
+
|
|
25604
26133
|
/** Overlay position */
|
|
25605
26134
|
export declare type OverlayPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
25606
26135
|
|
|
@@ -25789,6 +26318,9 @@ export declare interface PermissionRole {
|
|
|
25789
26318
|
icon?: default_2.ReactNode;
|
|
25790
26319
|
}
|
|
25791
26320
|
|
|
26321
|
+
/** The permission catalog as a tree: groups from the codes (or `path`), permissions as leaves. */
|
|
26322
|
+
export declare function permissionTree(permissions: readonly NicePermissionDef[], options?: NicePermissionTreeOptions): NicePermissionTreeNode[];
|
|
26323
|
+
|
|
25792
26324
|
declare interface PersistConfig {
|
|
25793
26325
|
enabled: boolean;
|
|
25794
26326
|
key: string;
|
|
@@ -26563,8 +27095,23 @@ declare interface ReferenceLine {
|
|
|
26563
27095
|
dashArray?: string;
|
|
26564
27096
|
}
|
|
26565
27097
|
|
|
27098
|
+
/**
|
|
27099
|
+
* Takes out the pages `pageIds` (also ones the catalog no longer has). A page with items below it
|
|
27100
|
+
* stays as their group; groups recreated from the catalog that are left empty go too.
|
|
27101
|
+
*/
|
|
27102
|
+
export declare function removeCatalogPages(menu: readonly NiceMenuBuilderItem[], pageIds: readonly string[]): NiceMenuBuilderItem[];
|
|
27103
|
+
|
|
27104
|
+
/** Removes a role, takes it out of what other roles inherit and out of the users' roles. */
|
|
27105
|
+
export declare function removeRole(roles: readonly NiceRoleDef[], users: readonly NiceRoleUser[], roleId: string): {
|
|
27106
|
+
roles: NiceRoleDef[];
|
|
27107
|
+
users: NiceRoleUser[];
|
|
27108
|
+
};
|
|
27109
|
+
|
|
26566
27110
|
export { removeTheme }
|
|
26567
27111
|
|
|
27112
|
+
/** Removes the node with `id` and its subtree. */
|
|
27113
|
+
export declare function removeTreeNode<T>(tree: readonly T[], id: string, options?: TreeEditOptions): T[];
|
|
27114
|
+
|
|
26568
27115
|
export { RenderStats }
|
|
26569
27116
|
|
|
26570
27117
|
export { RenderTiming }
|
|
@@ -26676,12 +27223,25 @@ export declare function resolveExportRows(view: NiceViewDefinition, data: unknow
|
|
|
26676
27223
|
/** Resolve permissions for a set of user roles. */
|
|
26677
27224
|
export declare function resolvePermissions(userRoleIds: string[], policy: NiceRbacPolicy): NiceResolvedPermissions;
|
|
26678
27225
|
|
|
27226
|
+
/**
|
|
27227
|
+
* Every code a role has, with the roles it comes from: the role itself for its own codes, the
|
|
27228
|
+
* inherited roles (nearest first) for the rest. `inheritance: false` counts its own codes only.
|
|
27229
|
+
*/
|
|
27230
|
+
export declare function resolveRolePermissions(roleId: string, roles: readonly NiceRoleDef[], options?: {
|
|
27231
|
+
inheritance?: boolean;
|
|
27232
|
+
}): Map<string, string[]>;
|
|
27233
|
+
|
|
26679
27234
|
export { resolveStepsI18n }
|
|
26680
27235
|
|
|
26681
27236
|
export { resolveTracelessPolicy }
|
|
26682
27237
|
|
|
26683
27238
|
export { resolveTutorial }
|
|
26684
27239
|
|
|
27240
|
+
/** Every code a user has through their roles, with the roles it comes from. */
|
|
27241
|
+
export declare function resolveUserPermissions(user: NiceRoleUser, roles: readonly NiceRoleDef[], options?: {
|
|
27242
|
+
inheritance?: boolean;
|
|
27243
|
+
}): Map<string, string[]>;
|
|
27244
|
+
|
|
26685
27245
|
export declare interface Resource {
|
|
26686
27246
|
id: string;
|
|
26687
27247
|
name: string;
|
|
@@ -26763,6 +27323,12 @@ export declare function rgbToHsl({ r, g, b }: RGB): HSL;
|
|
|
26763
27323
|
|
|
26764
27324
|
export declare function rgbToHsv({ r, g, b }: RGB): HSV;
|
|
26765
27325
|
|
|
27326
|
+
/** The roles above `roleId` through `inherits`, nearest first, each once (cycles are cut). */
|
|
27327
|
+
export declare function roleAncestors(roleId: string, roles: readonly NiceRoleDef[]): string[];
|
|
27328
|
+
|
|
27329
|
+
/** The loops in `inherits`, each as the role ids around it. */
|
|
27330
|
+
export declare function roleInheritanceCycles(roles: readonly NiceRoleDef[]): string[][];
|
|
27331
|
+
|
|
26766
27332
|
export declare type RoomGridLayout = 'grid' | 'list';
|
|
26767
27333
|
|
|
26768
27334
|
export { RovingFocusControls }
|
|
@@ -27363,9 +27929,38 @@ export declare type ShapeType = 'rectangle' | 'ellipse' | 'polygon' | 'freehand'
|
|
|
27363
27929
|
|
|
27364
27930
|
export declare const ShopifyConnector: ConnectorDefinition;
|
|
27365
27931
|
|
|
27932
|
+
/** The id of the default favourites list — the one `favorites` holds (1.3.13). */
|
|
27933
|
+
export declare const SIDEBAR_DEFAULT_FAVORITE_LIST = "favorites";
|
|
27934
|
+
|
|
27366
27935
|
/** Route keys produced by {@link buildSidebarPrefsRoutes}. */
|
|
27367
27936
|
export declare const SIDEBAR_PREFS_ROUTE_KEYS: ReadonlyArray<string>;
|
|
27368
27937
|
|
|
27938
|
+
/** The items of a list; an unknown list has none. */
|
|
27939
|
+
export declare function sidebarFavoriteItems(prefs: FavoritePrefs, listId: string): SidebarNavFavorite[];
|
|
27940
|
+
|
|
27941
|
+
/** Every favourites list, the default one first (labelled `defaultLabel`). */
|
|
27942
|
+
export declare function sidebarFavoriteLists(prefs: FavoritePrefs, defaultLabel: string): SidebarNavFavoriteList[];
|
|
27943
|
+
|
|
27944
|
+
/** The ids of the lists an item is on. */
|
|
27945
|
+
export declare function sidebarFavoriteListsOf(prefs: FavoritePrefs, itemId: string): string[];
|
|
27946
|
+
|
|
27947
|
+
/**
|
|
27948
|
+
* The favourites under their parents (`pathOf`, from the top down), parents met twice merged.
|
|
27949
|
+
* Rows stand in the order `rank` gives (e.g. where they are in the data); rows it does not know, or
|
|
27950
|
+
* all without it, in the order the favourites come.
|
|
27951
|
+
*/
|
|
27952
|
+
export declare function sidebarFavoriteTree(favorites: readonly SidebarNavFavorite[], pathOf: (fav: SidebarNavFavorite) => readonly SidebarNavPathEntry[], rank?: (id: string) => number | undefined): SidebarFavoriteTreeNode[];
|
|
27953
|
+
|
|
27954
|
+
/** A row of the favourites tree: a favourite, a parent of favourites, or both. */
|
|
27955
|
+
export declare interface SidebarFavoriteTreeNode {
|
|
27956
|
+
id: string;
|
|
27957
|
+
label: string;
|
|
27958
|
+
icon?: ReactNode;
|
|
27959
|
+
/** Set on the row of a favourite. */
|
|
27960
|
+
favorite?: SidebarNavFavorite;
|
|
27961
|
+
children: SidebarFavoriteTreeNode[];
|
|
27962
|
+
}
|
|
27963
|
+
|
|
27369
27964
|
declare type SidebarLevelShading = 'tint' | 'shade';
|
|
27370
27965
|
|
|
27371
27966
|
/**
|
|
@@ -27425,9 +28020,23 @@ export declare interface SidebarNavFavorite {
|
|
|
27425
28020
|
/** Branch colour of the item when it was added (1.3.2) — the favorites list shows it and passes it
|
|
27426
28021
|
* on in `onNavigate`. */
|
|
27427
28022
|
color?: string;
|
|
28023
|
+
/**
|
|
28024
|
+
* The items above it in the tab it was added from, from the source down (1.3.13) — where
|
|
28025
|
+
* `favoritesLayout="tree"` puts it. Plain data: an icon only as an icon name.
|
|
28026
|
+
*/
|
|
28027
|
+
path?: SidebarNavPathEntry[];
|
|
27428
28028
|
addedAt: number;
|
|
27429
28029
|
}
|
|
27430
28030
|
|
|
28031
|
+
/** A favourites list of the user's own (1.3.13); the default list stays in `favorites`. */
|
|
28032
|
+
export declare interface SidebarNavFavoriteList {
|
|
28033
|
+
id: string;
|
|
28034
|
+
label: string;
|
|
28035
|
+
/** Its items; an icon is kept only as an icon name (a string), so the list stores as JSON. */
|
|
28036
|
+
items: SidebarNavFavorite[];
|
|
28037
|
+
createdAt: number;
|
|
28038
|
+
}
|
|
28039
|
+
|
|
27431
28040
|
export declare interface SidebarNavHelpers {
|
|
27432
28041
|
setMode: (mode: SidebarNavMode) => void;
|
|
27433
28042
|
setEnableModeIcons: (enabled: boolean) => void;
|
|
@@ -27436,8 +28045,22 @@ export declare interface SidebarNavHelpers {
|
|
|
27436
28045
|
unpinSource: (mode: SidebarNavMode, sourceId: string) => void;
|
|
27437
28046
|
hideItem: (item: SidebarNavHiddenItem) => void;
|
|
27438
28047
|
restoreItem: (id: string) => void;
|
|
27439
|
-
|
|
27440
|
-
|
|
28048
|
+
/** Puts an item on a favourites list (default: the default list). */
|
|
28049
|
+
addFavorite: (fav: SidebarNavFavorite, listId?: string) => void;
|
|
28050
|
+
/** Takes an item off a favourites list (default: the default list). */
|
|
28051
|
+
removeFavorite: (id: string, listId?: string) => void;
|
|
28052
|
+
/** Puts an item on a list, or takes it off when it is there (1.3.13). */
|
|
28053
|
+
toggleFavoriteInList: (fav: SidebarNavFavorite, listId: string) => void;
|
|
28054
|
+
/** Makes a favourites list of the user's (1.3.13), with a first item if given; returns its id. */
|
|
28055
|
+
createFavoriteList: (label: string, firstItem?: SidebarNavFavorite) => string;
|
|
28056
|
+
/** Renames a list of the user's (1.3.13). */
|
|
28057
|
+
renameFavoriteList: (id: string, label: string) => void;
|
|
28058
|
+
/** Removes a list of the user's (1.3.13); the default list stays. */
|
|
28059
|
+
removeFavoriteList: (id: string) => void;
|
|
28060
|
+
/** The list the Favourites view shows (1.3.13). */
|
|
28061
|
+
setActiveFavoriteList: (id: string) => void;
|
|
28062
|
+
/** The role / unit By role / By unit shows (1.3.13). */
|
|
28063
|
+
setActiveGroup: (mode: 'by-role' | 'by-unit', id: string) => void;
|
|
27441
28064
|
setMaxDepth: (mode: SidebarNavMode, depth: number) => void;
|
|
27442
28065
|
toggleCollapse: (nodeId: string) => void;
|
|
27443
28066
|
setCollapsed: (ids: string[], collapsed: boolean) => void;
|
|
@@ -27549,7 +28172,20 @@ export declare interface SidebarNavUserPrefs {
|
|
|
27549
28172
|
*/
|
|
27550
28173
|
pinnedSources: Partial<Record<SidebarNavMode, string[]>>;
|
|
27551
28174
|
hiddenItems: SidebarNavHiddenItem[];
|
|
28175
|
+
/** The default favourites list ("Favourites"). */
|
|
27552
28176
|
favorites: SidebarNavFavorite[];
|
|
28177
|
+
/**
|
|
28178
|
+
* More favourites lists, made by the user (1.3.13). The Favourites view picks one with the bar
|
|
28179
|
+
* under the mode icons; an item's star puts it on any of them.
|
|
28180
|
+
*/
|
|
28181
|
+
favoriteLists?: SidebarNavFavoriteList[];
|
|
28182
|
+
/** The list the Favourites view shows (1.3.13); default the default list. */
|
|
28183
|
+
activeFavoriteListId?: string;
|
|
28184
|
+
/**
|
|
28185
|
+
* The role / unit the By role / By unit view shows (1.3.13), chosen with the bar under the mode
|
|
28186
|
+
* icons when there are two or more; default the first.
|
|
28187
|
+
*/
|
|
28188
|
+
activeGroupId?: Partial<Record<'by-role' | 'by-unit', string>>;
|
|
27553
28189
|
/**
|
|
27554
28190
|
* How many levels to show per mode: 1 = sources only, 2 = sources + first level, 3 = … Absent or
|
|
27555
28191
|
* 10 and more = every level (1.3.2; it was 4 before levels could nest).
|
|
@@ -29186,6 +29822,31 @@ declare type TransformType = 'direct' | 'format' | 'convert' | 'concat' | 'split
|
|
|
29186
29822
|
|
|
29187
29823
|
export declare type TransitionType = 'fade' | 'dissolve' | 'wipe' | 'slide' | 'zoom' | 'none';
|
|
29188
29824
|
|
|
29825
|
+
/** A place in a tree: a parent (`null` for the roots) and a position among its children. */
|
|
29826
|
+
export declare interface TreeDropTarget {
|
|
29827
|
+
parentId: string | null;
|
|
29828
|
+
index: number;
|
|
29829
|
+
}
|
|
29830
|
+
|
|
29831
|
+
/**
|
|
29832
|
+
* treeEdit — pure edits of a nested tree (arrays of nodes with children arrays), shared by
|
|
29833
|
+
* NiceSortableTree and NiceMenuBuilder.
|
|
29834
|
+
*
|
|
29835
|
+
* - Nodes are found by their key (`keyField`, default `'id'`) and nest in `childrenField`
|
|
29836
|
+
* (default `'children'`), the same options NiceTreeGrid takes.
|
|
29837
|
+
* - Every edit returns a new array and copies only the nodes on the path to the change; the input
|
|
29838
|
+
* is never mutated. An edit that changes nothing returns the input array itself, so
|
|
29839
|
+
* `next === tree` tells a no-op.
|
|
29840
|
+
* - A node never moves into its own subtree.
|
|
29841
|
+
*/
|
|
29842
|
+
/** Where the nodes keep their key and their children. */
|
|
29843
|
+
export declare interface TreeEditOptions {
|
|
29844
|
+
/** Field with the node's key (default `'id'`). */
|
|
29845
|
+
keyField?: string;
|
|
29846
|
+
/** Field with the node's children (default `'children'`). */
|
|
29847
|
+
childrenField?: string;
|
|
29848
|
+
}
|
|
29849
|
+
|
|
29189
29850
|
export declare interface TreeMapNode {
|
|
29190
29851
|
id: string;
|
|
29191
29852
|
name: string;
|
|
@@ -29194,6 +29855,27 @@ export declare interface TreeMapNode {
|
|
|
29194
29855
|
children?: TreeMapNode[];
|
|
29195
29856
|
}
|
|
29196
29857
|
|
|
29858
|
+
/** Levels in a node's subtree: 1 for a node without children. */
|
|
29859
|
+
export declare function treeNodeHeight<T>(node: T, options?: TreeEditOptions): number;
|
|
29860
|
+
|
|
29861
|
+
/** Where a node is. */
|
|
29862
|
+
export declare interface TreeNodeLocation<T> {
|
|
29863
|
+
node: T;
|
|
29864
|
+
parent: T | null;
|
|
29865
|
+
parentId: string | null;
|
|
29866
|
+
/** Position among its siblings. */
|
|
29867
|
+
index: number;
|
|
29868
|
+
/** Its siblings, itself included. */
|
|
29869
|
+
siblings: readonly T[];
|
|
29870
|
+
/** Its ancestors, from the root down to the parent. */
|
|
29871
|
+
ancestors: readonly T[];
|
|
29872
|
+
/** 0 for the roots. */
|
|
29873
|
+
depth: number;
|
|
29874
|
+
}
|
|
29875
|
+
|
|
29876
|
+
/** Where the node with `id` is, or `undefined`. */
|
|
29877
|
+
export declare function treeNodeLocation<T>(tree: readonly T[], id: string, options?: TreeEditOptions): TreeNodeLocation<T> | undefined;
|
|
29878
|
+
|
|
29197
29879
|
export { triggerHaptic }
|
|
29198
29880
|
|
|
29199
29881
|
export { triggerNiceAction }
|
|
@@ -29256,6 +29938,9 @@ export declare interface UndoEntry<T = unknown> {
|
|
|
29256
29938
|
/** Update operation types */
|
|
29257
29939
|
export declare type UpdateOperation = 'insert' | 'update' | 'delete' | 'upsert';
|
|
29258
29940
|
|
|
29941
|
+
/** Replaces the node with `id` by `update(node)`, or merges `update` into it. */
|
|
29942
|
+
export declare function updateTreeNode<T>(tree: readonly T[], id: string, update: Partial<T> | ((node: T) => T), options?: TreeEditOptions): T[];
|
|
29943
|
+
|
|
29259
29944
|
export declare type UploadHandler = (request: UploadRequest) => Promise<UploadResponse>;
|
|
29260
29945
|
|
|
29261
29946
|
export declare interface UploadRequest {
|
|
@@ -30569,6 +31254,12 @@ export declare interface WalkSidebarNavOptions {
|
|
|
30569
31254
|
shading?: SidebarLevelShading;
|
|
30570
31255
|
}
|
|
30571
31256
|
|
|
31257
|
+
/**
|
|
31258
|
+
* Visits every node, depth first in display order. Returning `false` from `visit` skips the
|
|
31259
|
+
* node's children.
|
|
31260
|
+
*/
|
|
31261
|
+
export declare function walkTreeNodes<T>(tree: readonly T[], visit: (node: T, location: TreeNodeLocation<T>) => void | false, options?: TreeEditOptions): void;
|
|
31262
|
+
|
|
30572
31263
|
/** Watermark settings */
|
|
30573
31264
|
export declare interface WatermarkSettings {
|
|
30574
31265
|
enabled: boolean;
|
|
@@ -30697,6 +31388,9 @@ export declare interface WorkflowTask {
|
|
|
30697
31388
|
parentTaskId?: string;
|
|
30698
31389
|
}
|
|
30699
31390
|
|
|
31391
|
+
/** Whether `roleId` inheriting `parentId` would close a loop. */
|
|
31392
|
+
export declare function wouldCreateRoleCycle(roles: readonly NiceRoleDef[], roleId: string, parentId: string): boolean;
|
|
31393
|
+
|
|
30700
31394
|
export declare const XeroConnector: ConnectorDefinition;
|
|
30701
31395
|
|
|
30702
31396
|
export { ZustandAdapterConfig }
|