@nubisco/ui 1.53.0 → 1.53.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.
- package/dist/components/AiLabel.d.ts +19 -0
- package/dist/components/Badge.d.ts +23 -0
- package/dist/components/BlueprintControls.d.ts +21 -0
- package/dist/components/BlueprintMinimap.d.ts +17 -0
- package/dist/components/Board.d.ts +64 -0
- package/dist/components/BottomPanel.d.ts +13 -0
- package/dist/components/Button.d.ts +34 -0
- package/dist/components/Button.vue.d.ts +1 -1
- package/dist/components/Calendar.d.ts +32 -0
- package/dist/components/Charts/BarChart.d.ts +12 -0
- package/dist/components/Charts/GanttChart.d.ts +81 -0
- package/dist/components/Charts/InterpolationChart.d.ts +33 -0
- package/dist/components/Charts/LineChart.d.ts +15 -0
- package/dist/components/Charts/PieChart.d.ts +11 -0
- package/dist/components/Charts/Sparkline.d.ts +11 -0
- package/dist/components/Charts/shared/types.d.ts +53 -0
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/CheckboxGroup.d.ts +17 -0
- package/dist/components/ColorStrip.d.ts +22 -0
- package/dist/components/CommandPalette.d.ts +40 -0
- package/dist/components/DataTable.d.ts +131 -0
- package/dist/components/DatePicker.d.ts +52 -0
- package/dist/components/Field.d.ts +33 -0
- package/dist/components/FileUploader.d.ts +27 -0
- package/dist/components/FileUploader.vue.d.ts +1 -1
- package/dist/components/Flag.d.ts +9 -0
- package/dist/components/Form.d.ts +5 -0
- package/dist/components/Grid.d.ts +345 -0
- package/dist/components/Icon.d.ts +59 -0
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/ImageCropper.d.ts +27 -0
- package/dist/components/JsonTree.d.ts +33 -0
- package/dist/components/Label.d.ts +14 -0
- package/dist/components/Menu.d.ts +53 -0
- package/dist/components/Message.d.ts +17 -0
- package/dist/components/Modal.d.ts +10 -0
- package/dist/components/Modal.vue.d.ts +1 -1
- package/dist/components/NumberInput.vue.d.ts +1 -1
- package/dist/components/Pagination.d.ts +38 -0
- package/dist/components/Pagination.vue.d.ts +1 -1
- package/dist/components/ProgressBar.d.ts +27 -0
- package/dist/components/Radio.d.ts +28 -0
- package/dist/components/Select.d.ts +23 -0
- package/dist/components/Shell.d.ts +60 -0
- package/dist/components/ShellPanel.d.ts +33 -0
- package/dist/components/SidebarBrand.d.ts +14 -0
- package/dist/components/SidebarLink.d.ts +24 -0
- package/dist/components/SidebarMenu.d.ts +10 -0
- package/dist/components/SidebarMenuGroup.d.ts +16 -0
- package/dist/components/SidebarMenuItem.d.ts +42 -0
- package/dist/components/Slider.d.ts +26 -0
- package/dist/components/Switch.d.ts +20 -0
- package/dist/components/TextInput.vue.d.ts +1 -1
- package/dist/components/Tree.d.ts +68 -0
- package/dist/components/TreeNode.vue.d.ts.map +1 -1
- package/dist/components/UserMenu.d.ts +43 -0
- package/dist/components/labs/Spreadsheet.d.ts +104 -0
- package/dist/directives/ToolTip.directive.d.ts +1 -1
- package/dist/global.d.ts +135 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/Decoration.d.ts +6 -0
- package/dist/types/Option.d.ts +29 -0
- package/dist/types/Props.d.ts +121 -0
- package/dist/types/Size.d.ts +33 -0
- package/dist/types/Variants.d.ts +12 -0
- package/dist/types/Vite.d.ts +3 -0
- package/dist/ui.css +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface ICropRect {
|
|
2
|
+
x: number
|
|
3
|
+
y: number
|
|
4
|
+
width: number
|
|
5
|
+
height: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
enum EHandleName {
|
|
9
|
+
TopLeft = 'top-left',
|
|
10
|
+
Top = 'top',
|
|
11
|
+
TopRight = 'top-right',
|
|
12
|
+
Right = 'right',
|
|
13
|
+
BottomRight = 'bottom-right',
|
|
14
|
+
Bottom = 'bottom',
|
|
15
|
+
BottomLeft = 'bottom-left',
|
|
16
|
+
Left = 'left',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface IImageCropperProps {
|
|
20
|
+
image?: File
|
|
21
|
+
cropAsCircle?: boolean
|
|
22
|
+
outputAsCircle?: boolean
|
|
23
|
+
lockAspectRatio?: boolean
|
|
24
|
+
showPreview?: boolean
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { ICropRect, EHandleName, IImageCropperProps }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Primitive JSON values
|
|
2
|
+
type TJsonPrimitive = string | number | boolean | null
|
|
3
|
+
|
|
4
|
+
// Recursive JSON values
|
|
5
|
+
type TJsonValue = TJsonPrimitive | IJsonObject | TJsonArray
|
|
6
|
+
interface IJsonObject {
|
|
7
|
+
[key: string]: TJsonValue
|
|
8
|
+
}
|
|
9
|
+
type TJsonArray = TJsonValue[]
|
|
10
|
+
|
|
11
|
+
// Runtime-friendly node kind enum for component consumers
|
|
12
|
+
enum EJsonNodeKind {
|
|
13
|
+
Object = 'object',
|
|
14
|
+
Array = 'array',
|
|
15
|
+
Primitive = 'primitive',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface IJsonTreeProps {
|
|
19
|
+
title?: string | null
|
|
20
|
+
modelValue?: TJsonValue
|
|
21
|
+
root?: boolean
|
|
22
|
+
editable?: boolean
|
|
23
|
+
startCollapsed?: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
TJsonPrimitive,
|
|
28
|
+
TJsonValue,
|
|
29
|
+
IJsonObject,
|
|
30
|
+
TJsonArray,
|
|
31
|
+
EJsonNodeKind,
|
|
32
|
+
IJsonTreeProps,
|
|
33
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type TMenuItemSize = 'xs' | 'sm' | 'md' | 'lg'
|
|
2
|
+
|
|
3
|
+
export interface IMenuProps {
|
|
4
|
+
/** Controls visibility of the menu */
|
|
5
|
+
open?: boolean
|
|
6
|
+
/** Item height: xs=24, sm=32, md=40, lg=48 */
|
|
7
|
+
size?: TMenuItemSize
|
|
8
|
+
/** Minimum width in px */
|
|
9
|
+
minWidth?: number
|
|
10
|
+
/** Maximum width in px */
|
|
11
|
+
maxWidth?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IMenuItemProps {
|
|
15
|
+
/** Phosphor icon name */
|
|
16
|
+
icon?: string
|
|
17
|
+
/** Display label */
|
|
18
|
+
label: string
|
|
19
|
+
/** Keyboard shortcut display text (e.g. "Cmd+C"), display only */
|
|
20
|
+
shortcut?: string
|
|
21
|
+
/** Disables the item */
|
|
22
|
+
disabled?: boolean
|
|
23
|
+
/** Renders with danger/destructive styling */
|
|
24
|
+
danger?: boolean
|
|
25
|
+
/** Makes this a checkbox-style selectable item */
|
|
26
|
+
selectable?: boolean
|
|
27
|
+
/** Whether selectable item is checked */
|
|
28
|
+
selected?: boolean
|
|
29
|
+
/** Radio group name, makes item part of a radio group */
|
|
30
|
+
radioGroup?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ISubmenuProps {
|
|
34
|
+
/** Phosphor icon name */
|
|
35
|
+
icon?: string
|
|
36
|
+
/** Display label */
|
|
37
|
+
label: string
|
|
38
|
+
/** Disables the submenu trigger */
|
|
39
|
+
disabled?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IMenuBarProps {
|
|
43
|
+
/** Optional max-width constraint */
|
|
44
|
+
maxWidth?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IMenuContext {
|
|
48
|
+
size: TMenuItemSize
|
|
49
|
+
close: () => void
|
|
50
|
+
highlightedIndex: number
|
|
51
|
+
registerItem: (el: HTMLElement) => number
|
|
52
|
+
unregisterItem: (el: HTMLElement) => void
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
enum EMessageVariant {
|
|
2
|
+
Error = 'error',
|
|
3
|
+
Warning = 'warning',
|
|
4
|
+
Helper = 'helper',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface IMessageProps {
|
|
8
|
+
variant?: `${EMessageVariant}`
|
|
9
|
+
/**
|
|
10
|
+
* Icon-only mode: hides the text and shows only an icon.
|
|
11
|
+
* On hover, the message text appears via a CSS tooltip.
|
|
12
|
+
* Used in the TextInput `fluid` variant.
|
|
13
|
+
*/
|
|
14
|
+
iconOnly?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { EMessageVariant, IMessageProps }
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ESizeShort } from '../types/Size.d'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* NbPagination: footer companion for `NbDataTable` (usable standalone). Fully
|
|
5
|
+
* controlled: it emits `update:page` / `update:pageSize` and renders whatever
|
|
6
|
+
* `page`, `pageSize` and `total` you pass back, so it works for server-side
|
|
7
|
+
* paging without change.
|
|
8
|
+
*/
|
|
9
|
+
export interface IPaginationProps {
|
|
10
|
+
/** Current 1-based page number. */
|
|
11
|
+
page: number
|
|
12
|
+
/** Rows shown per page. */
|
|
13
|
+
pageSize: number
|
|
14
|
+
/** Total number of rows across all pages. */
|
|
15
|
+
total: number
|
|
16
|
+
/** Selectable page sizes. Default `[10, 20, 30, 40, 50]`. */
|
|
17
|
+
pageSizeOptions?: number[]
|
|
18
|
+
/** Control density. Matches the shared `ESizeShort` scale. Default `md`. */
|
|
19
|
+
size?: ESizeShort | 'sm' | 'md' | 'lg'
|
|
20
|
+
/** Disables all controls. */
|
|
21
|
+
disabled?: boolean
|
|
22
|
+
/** Label before the page-size select. Default `Items per page:`. */
|
|
23
|
+
pageSizeLabel?: string
|
|
24
|
+
/** Noun used in the range read-out, e.g. `... of 240 items`. Default `items`. */
|
|
25
|
+
itemLabel?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IPaginationEmits {
|
|
29
|
+
/** New 1-based page (`v-model:page`). */
|
|
30
|
+
'update:page': [page: number]
|
|
31
|
+
/** New page size (`v-model:pageSize`). Page resets to 1 alongside. */
|
|
32
|
+
'update:pageSize': [pageSize: number]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type {
|
|
36
|
+
IPaginationProps as NbPaginationProps,
|
|
37
|
+
IPaginationEmits as NbPaginationEmits,
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ESizeShort } from '
|
|
1
|
+
import { ESizeShort } from '../types/Size.d';
|
|
2
2
|
import { IPaginationProps } from './Pagination.d';
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<IPaginationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
4
|
"update:page": (page: number) => any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IDefaultProps, IWithLabel } from '../types/Props.d'
|
|
2
|
+
|
|
3
|
+
enum EProgressBarSize {
|
|
4
|
+
Small = 'sm',
|
|
5
|
+
Medium = 'md',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
enum EProgressBarStatus {
|
|
9
|
+
Active = 'active',
|
|
10
|
+
Finished = 'finished',
|
|
11
|
+
Error = 'error',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface IProgressBarProps extends IDefaultProps, IWithLabel {
|
|
15
|
+
/** Current progress against `max`. Omit for an indeterminate bar. */
|
|
16
|
+
value?: number
|
|
17
|
+
/** Upper bound the progress is measured against. */
|
|
18
|
+
max?: number
|
|
19
|
+
/** Contextual hint below the bar. Rendered in the error style when `status` is `error`. */
|
|
20
|
+
helper?: string
|
|
21
|
+
/** Track thickness: `md` is 8px, `sm` is 4px. */
|
|
22
|
+
size?: EProgressBarSize
|
|
23
|
+
/** Semantic state. `finished` and `error` fill the bar and recolor it. */
|
|
24
|
+
status?: EProgressBarStatus
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { EProgressBarSize, EProgressBarStatus, IProgressBarProps }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IHumanInputComponent,
|
|
3
|
+
IWithLabel,
|
|
4
|
+
IWithMessages,
|
|
5
|
+
} from '../types/Props.d'
|
|
6
|
+
|
|
7
|
+
interface IRadioOption {
|
|
8
|
+
label: string
|
|
9
|
+
value: string
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
enum ERadioDirection {
|
|
14
|
+
Horizontal = 'horizontal',
|
|
15
|
+
Vertical = 'vertical',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface IRadioProps extends IHumanInputComponent, IWithLabel, IWithMessages {
|
|
19
|
+
modelValue?: string
|
|
20
|
+
options: IRadioOption[]
|
|
21
|
+
/** Required for native radio-button grouping via the HTML `name` attribute. */
|
|
22
|
+
name: string
|
|
23
|
+
direction?: ERadioDirection
|
|
24
|
+
/** Makes options visible but non-interactive. */
|
|
25
|
+
readonly?: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { IRadioOption, ERadioDirection, IRadioProps }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IFieldComponent } from '../types/Props.d'
|
|
2
|
+
|
|
3
|
+
interface ISelectOption {
|
|
4
|
+
label: string
|
|
5
|
+
value: string | number
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ISelectProps extends IFieldComponent {
|
|
10
|
+
modelValue?: string | number | Array<string | number> | null
|
|
11
|
+
options?: ISelectOption[]
|
|
12
|
+
/** Allows selecting multiple options simultaneously. */
|
|
13
|
+
multiple?: boolean
|
|
14
|
+
/** Shows a text input at the bottom of the dropdown so users can create new options. Emits `create` with the entered value. */
|
|
15
|
+
creatable?: boolean
|
|
16
|
+
/** Placeholder text for the create input when `creatable` is true. */
|
|
17
|
+
createPlaceholder?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { ISelectOption, ISelectProps }
|
|
21
|
+
|
|
22
|
+
// Clean aliases — prefer these in new code.
|
|
23
|
+
export type { ISelectOption as NbSelectOption, ISelectProps as NbSelectProps }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type TInspectorSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
2
|
+
type TSidebarVariant = 'compact' | 'verbose'
|
|
3
|
+
|
|
4
|
+
interface IShellProps {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the inspector column is visible.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
inspectorVisible?: boolean
|
|
10
|
+
/**
|
|
11
|
+
* When true the inspector takes ~50 % of the viewport width instead of the
|
|
12
|
+
* default fixed width. Has no effect when `inspectorVisible` is false.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
inspectorExpanded?: boolean
|
|
16
|
+
/**
|
|
17
|
+
* Controls the width of the inspector panel.
|
|
18
|
+
* - xs: 288px
|
|
19
|
+
* - sm: 360px
|
|
20
|
+
* - md: 560px (current default, backwards compatible)
|
|
21
|
+
* - lg: 50vw
|
|
22
|
+
* - xl: 75vw
|
|
23
|
+
* @default 'md'
|
|
24
|
+
*/
|
|
25
|
+
inspectorSize?: TInspectorSize
|
|
26
|
+
/**
|
|
27
|
+
* Allow the user to resize the inspector by dragging its left edge, clamped
|
|
28
|
+
* between the `inspectorSize` width (the floor) and 50% of the viewport.
|
|
29
|
+
* Double-clicking the handle resets to the `inspectorSize` default. Pair with
|
|
30
|
+
* `v-model:inspector-width` to persist the chosen width.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
resizable?: boolean
|
|
34
|
+
/**
|
|
35
|
+
* The user-chosen inspector width in pixels when `resizable` is on, as a
|
|
36
|
+
* v-model (`v-model:inspector-width`). `null` (the default / reset state)
|
|
37
|
+
* means "use the `inspectorSize` width". The component emits
|
|
38
|
+
* `update:inspectorWidth` on drag and on double-click reset; the consumer
|
|
39
|
+
* owns persistence.
|
|
40
|
+
*/
|
|
41
|
+
inspectorWidth?: number | null
|
|
42
|
+
/**
|
|
43
|
+
* Whether the main content area has padding.
|
|
44
|
+
* Set to false for full-bleed content like viewports/canvases.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
mainPadding?: boolean
|
|
48
|
+
/**
|
|
49
|
+
* Sidebar presentation mode.
|
|
50
|
+
* - 'compact': narrow icon-only rail (56px). Use with NbSidebarLink. This is
|
|
51
|
+
* the default and matches the legacy behaviour.
|
|
52
|
+
* - 'verbose': wider sidebar (240px) with full-width rows. Use with
|
|
53
|
+
* NbSidebarMenu, NbSidebarMenuGroup and NbSidebarMenuItem to render
|
|
54
|
+
* grouped, multi-level navigation with icons and labels.
|
|
55
|
+
* @default 'compact'
|
|
56
|
+
*/
|
|
57
|
+
sidebarVariant?: TSidebarVariant
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { IShellProps, TInspectorSize, TSidebarVariant }
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type TShellPanelSize = 'collapsed' | 'default' | 'full'
|
|
2
|
+
|
|
3
|
+
export interface IShellPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Current panel size. Use v-model:size for two-way binding.
|
|
6
|
+
*
|
|
7
|
+
* - collapsed: header only, no content, does not grow
|
|
8
|
+
* - default: content visible. Sizing follows the `fluid` prop —
|
|
9
|
+
* `false` (the back-compat default) shares column space equally
|
|
10
|
+
* with sibling panels via `flex: 1 1 0%`; `true` uses `flex: 0 0
|
|
11
|
+
* auto` so the panel takes only the height its content needs.
|
|
12
|
+
* - full: content visible, flex: 1, sibling panels collapse automatically
|
|
13
|
+
*
|
|
14
|
+
* @default 'default'
|
|
15
|
+
*/
|
|
16
|
+
size?: TShellPanelSize
|
|
17
|
+
/**
|
|
18
|
+
* Panel title shown in the header.
|
|
19
|
+
*/
|
|
20
|
+
title?: string
|
|
21
|
+
/**
|
|
22
|
+
* When true, a `default`-sized panel sizes to its content instead of
|
|
23
|
+
* sharing column space equally with siblings. Right for inspectors
|
|
24
|
+
* with multiple unrelated sections — a panel with two rows shouldn't
|
|
25
|
+
* eat the same height as a panel with twenty.
|
|
26
|
+
*
|
|
27
|
+
* The `collapsed` and `full` sizes are unaffected (collapsed is
|
|
28
|
+
* always header-only; full always fills).
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
fluid?: boolean
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ISidebarBrandProps {
|
|
2
|
+
/** Primary brand name (top line, prominent). */
|
|
3
|
+
title: string
|
|
4
|
+
/** Optional secondary line below the title (smaller, muted). */
|
|
5
|
+
subtitle?: string
|
|
6
|
+
/**
|
|
7
|
+
* Optional icon rendered to the left of the title. Uses NbIcon when provided
|
|
8
|
+
* as a string; for fully custom marks (logo, gradient block) use the
|
|
9
|
+
* `icon` slot instead.
|
|
10
|
+
*/
|
|
11
|
+
icon?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { ISidebarBrandProps }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface ISidebarLinkProps {
|
|
2
|
+
/**
|
|
3
|
+
* Target route. When vue-router is installed, the link renders as a
|
|
4
|
+
* `<RouterLink>` and accepts any value valid for its `to` prop (string path or
|
|
5
|
+
* location object). Without vue-router, a string `to` falls back to a plain
|
|
6
|
+
* `<a>` and an object `to` falls back to a `<button>` that emits `click`.
|
|
7
|
+
*/
|
|
8
|
+
to?: string | Record<string, unknown>
|
|
9
|
+
/** External href — renders as a plain `<a>`. Used when `to` is not set. */
|
|
10
|
+
href?: string
|
|
11
|
+
/** Tooltip text shown to the right of the sidebar on hover. */
|
|
12
|
+
tooltip?: string
|
|
13
|
+
/** Marks the link as the currently active route. */
|
|
14
|
+
active?: boolean
|
|
15
|
+
/** Prevents interaction. */
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* Applies a danger (red) hover style — use for destructive actions like
|
|
19
|
+
* sign-out.
|
|
20
|
+
*/
|
|
21
|
+
danger?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ISidebarLinkProps }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ISidebarMenuProps {
|
|
2
|
+
/**
|
|
3
|
+
* Visual density of menu rows.
|
|
4
|
+
* - 'comfortable' (default): generous vertical padding
|
|
5
|
+
* - 'compact': tighter rows for navigation-heavy apps
|
|
6
|
+
*/
|
|
7
|
+
density?: 'comfortable' | 'compact'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ISidebarMenuProps }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface ISidebarMenuGroupProps {
|
|
2
|
+
/** Section heading displayed above the items. */
|
|
3
|
+
label: string
|
|
4
|
+
/**
|
|
5
|
+
* When true, the group can be collapsed by clicking its heading.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
collapsible?: boolean
|
|
9
|
+
/**
|
|
10
|
+
* Initial collapsed state when `collapsible` is true. Ignored otherwise.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
defaultCollapsed?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { ISidebarMenuGroupProps }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface ISidebarMenuItemProps {
|
|
2
|
+
/** Visible row label. */
|
|
3
|
+
label: string
|
|
4
|
+
/**
|
|
5
|
+
* Optional icon name (uses NbIcon). Recommended for top-level items in
|
|
6
|
+
* verbose sidebars; child items typically omit it.
|
|
7
|
+
*/
|
|
8
|
+
icon?: string
|
|
9
|
+
/**
|
|
10
|
+
* Target route. When vue-router is installed (the app called
|
|
11
|
+
* `app.use(router)`), the row renders as a `<RouterLink>` and accepts any
|
|
12
|
+
* value valid for its `to` prop (a string path or a location object). When
|
|
13
|
+
* vue-router is not present, a string `to` falls back to a plain anchor
|
|
14
|
+
* (`href`) and an object `to` falls back to a button that emits `click`.
|
|
15
|
+
* Ignored for items that have sub-items (those toggle/expand instead).
|
|
16
|
+
*/
|
|
17
|
+
to?: string | Record<string, unknown>
|
|
18
|
+
/** External href, used when `to` is not set. Always renders a plain anchor. */
|
|
19
|
+
href?: string
|
|
20
|
+
/** Marks the row as the currently active route. */
|
|
21
|
+
active?: boolean
|
|
22
|
+
/** Prevents interaction. */
|
|
23
|
+
disabled?: boolean
|
|
24
|
+
/**
|
|
25
|
+
* Initial expanded state when the item has sub-items. Ignored when there
|
|
26
|
+
* are no children.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
defaultExpanded?: boolean
|
|
30
|
+
/** Small badge text displayed on the right (counts, status). */
|
|
31
|
+
badge?: string | number
|
|
32
|
+
/**
|
|
33
|
+
* Visual variant of the badge.
|
|
34
|
+
* - 'neutral' (default): muted, blends with sidebar
|
|
35
|
+
* - 'accent': uses the sidebar active colour, ideal for feature flags
|
|
36
|
+
* like "AI", "BETA", "NEW"
|
|
37
|
+
* - 'success' | 'warning' | 'danger': semantic colours
|
|
38
|
+
*/
|
|
39
|
+
badgeVariant?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger'
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { ISidebarMenuItemProps }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IHumanInputComponent,
|
|
3
|
+
IWithLabel,
|
|
4
|
+
IWithMessages,
|
|
5
|
+
IWithFieldAppearance,
|
|
6
|
+
} from '../types/Props.d'
|
|
7
|
+
|
|
8
|
+
interface ISliderProps
|
|
9
|
+
extends
|
|
10
|
+
IHumanInputComponent,
|
|
11
|
+
IWithLabel,
|
|
12
|
+
IWithMessages,
|
|
13
|
+
IWithFieldAppearance {
|
|
14
|
+
modelValue?: number | [number, number] | null
|
|
15
|
+
min?: number
|
|
16
|
+
max?: number
|
|
17
|
+
step?: number
|
|
18
|
+
/** Enables a two-handle range selector instead of a single-value slider. */
|
|
19
|
+
range?: boolean
|
|
20
|
+
/** Shows a `NbNumberInput` alongside the track for direct value entry. */
|
|
21
|
+
showInput?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type TActiveHandle = 'low' | 'high' | null
|
|
25
|
+
|
|
26
|
+
export { ISliderProps, TActiveHandle }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IHumanInputComponent, IWithLabel } from '../types/Props.d'
|
|
2
|
+
|
|
3
|
+
enum ESwitchSize {
|
|
4
|
+
Small = 'sm',
|
|
5
|
+
Medium = 'md',
|
|
6
|
+
Large = 'lg',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
enum ESwitchVariant {
|
|
10
|
+
Primary = 'primary',
|
|
11
|
+
Secondary = 'secondary',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ISwitchProps extends IHumanInputComponent, IWithLabel {
|
|
15
|
+
modelValue?: boolean
|
|
16
|
+
variant?: ESwitchVariant
|
|
17
|
+
size?: ESwitchSize
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { ESwitchSize, ESwitchVariant, ISwitchProps }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IReadableFieldComponent } from '
|
|
1
|
+
import type { IReadableFieldComponent } from '../types/Props.d';
|
|
2
2
|
export interface ITextInputProps extends IReadableFieldComponent {
|
|
3
3
|
/** Native input type forwarded to the `<input>` element. */
|
|
4
4
|
type?: string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree component types.
|
|
3
|
+
*
|
|
4
|
+
* Carbon Design System-inspired tree view with layer system integration.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type TTreeDropPosition = 'before' | 'after' | 'inside'
|
|
8
|
+
|
|
9
|
+
export interface ITreeDropEvent {
|
|
10
|
+
/** ID of the node being dragged */
|
|
11
|
+
sourceId: string
|
|
12
|
+
/** ID of the node being dropped onto */
|
|
13
|
+
targetId: string
|
|
14
|
+
/** Where relative to the target the drop occurred */
|
|
15
|
+
position: TTreeDropPosition
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ITreeProps {
|
|
19
|
+
/** Currently selected node ID (v-model) */
|
|
20
|
+
modelValue?: string | null
|
|
21
|
+
/** Compact mode: 24px rows instead of 32px */
|
|
22
|
+
compact?: boolean
|
|
23
|
+
/** Size variant */
|
|
24
|
+
size?: 'sm' | 'md'
|
|
25
|
+
/** Enable drag and drop reordering */
|
|
26
|
+
draggable?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ITreeNodeProps {
|
|
30
|
+
/** Unique node identifier */
|
|
31
|
+
id: string
|
|
32
|
+
/** Display label */
|
|
33
|
+
label: string
|
|
34
|
+
/** Icon name (from NbIcon) */
|
|
35
|
+
icon?: string
|
|
36
|
+
/** Whether the node is disabled */
|
|
37
|
+
disabled?: boolean
|
|
38
|
+
/** Depth level (auto-computed from nesting, override to set manually) */
|
|
39
|
+
depth?: number | null
|
|
40
|
+
/** Override tree-level draggable for this node (opt-in or opt-out) */
|
|
41
|
+
draggable?: boolean | null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ITreeDragState {
|
|
45
|
+
/** ID of the node currently being dragged, or null */
|
|
46
|
+
dragId: string | null
|
|
47
|
+
/** ID of the current drop target node, or null */
|
|
48
|
+
dropTargetId: string | null
|
|
49
|
+
/** Drop position relative to the target */
|
|
50
|
+
dropPosition: TTreeDropPosition | null
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ITreeContext {
|
|
54
|
+
selectedId: string | null
|
|
55
|
+
select: (id: string) => void
|
|
56
|
+
toggle: (id: string) => void
|
|
57
|
+
expandedIds: Set<string>
|
|
58
|
+
compact: boolean
|
|
59
|
+
draggable: boolean
|
|
60
|
+
drag: ITreeDragState
|
|
61
|
+
onDragStart: (id: string) => void
|
|
62
|
+
onDragOver: (id: string, position: TTreeDropPosition) => void
|
|
63
|
+
onDragLeave: (id: string) => void
|
|
64
|
+
onDrop: () => void
|
|
65
|
+
onDragEnd: () => void
|
|
66
|
+
registerNode: (id: string, el: HTMLElement) => void
|
|
67
|
+
unregisterNode: (id: string) => void
|
|
68
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNode.vue.d.ts","sourceRoot":"","sources":["../../src/components/TreeNode.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeNode.vue.d.ts","sourceRoot":"","sources":["../../src/components/TreeNode.vue"],"names":[],"mappings":"AAocA,OAAO,KAAK,EAAE,cAAc,EAAmC,MAAM,UAAU,CAAA;AAsU/E,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|