dap-design-system 0.52.0 → 0.52.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/common/types.d.ts +2 -1
- package/dist/components/avatar/avatar.component.d.ts +0 -1
- package/dist/components/checkbox/checkbox.component.d.ts +1 -0
- package/dist/components/chip/chip.component.d.ts +4 -3
- package/dist/components/datatable/helpers/angular.d.ts +125 -0
- package/dist/components/datatable/helpers/index.d.ts +4 -0
- package/dist/components/datatable/helpers/svelte.d.ts +87 -0
- package/dist/components/modal/modal.component.d.ts +1 -1
- package/dist/components/overlay/overlay.component.d.ts +2 -2
- package/dist/components/tab/tab-group.component.d.ts +1 -0
- package/dist/components/toc/toc.component.d.ts +6 -0
- package/dist/{components-Dm4sHfpO.js → components-Ch40vN2u.js} +340 -321
- package/dist/components-Ch40vN2u.js.map +1 -0
- package/dist/components.js +1 -1
- package/dist/dds.js +1 -1
- package/dist/helpers/angular.js +57 -0
- package/dist/helpers/angular.js.map +1 -0
- package/dist/helpers/svelte.js +114 -0
- package/dist/helpers/svelte.js.map +1 -0
- package/dist/manifest/types/vue/index.d.ts +141 -140
- package/dist/manifest/vscode.html-custom-data.json +169 -169
- package/dist/manifest/web-types.json +181 -189
- package/dist/react/dap-ds-avatar/index.d.ts +1 -4
- package/dist/react/dap-ds-checkbox/index.d.ts +1 -0
- package/dist/react/dap-ds-chip/index.d.ts +4 -3
- package/dist/react/dap-ds-modal/index.d.ts +1 -1
- package/dist/react/dap-ds-overlay/index.d.ts +2 -2
- package/dist/react/dap-ds-tab-group/index.d.ts +1 -0
- package/dist/react/dap-ds-toc/index.d.ts +6 -0
- package/dist/react/index.d.ts +5 -5
- package/dist/react-types.ts +7 -7
- package/dist/react.js +166 -167
- package/dist/react.js.map +1 -1
- package/package.json +15 -1
- package/dist/components-Dm4sHfpO.js.map +0 -1
package/dist/common/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ButtonVariant } from '../components/button/button.component';
|
|
|
2
2
|
import { default as DapDSFileInputListItem, FileListElement } from '../components/file-input/file-input-list-item.component';
|
|
3
3
|
export type Common<T> = Pick<T, keyof T>;
|
|
4
4
|
export type Size = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
|
|
5
|
-
export type CommonSize = Extract<Size, 'sm' | 'lg'>;
|
|
5
|
+
export type CommonSize = Extract<Size, 'xs' | 'sm' | 'lg'>;
|
|
6
6
|
export type CommonFormElementSize = Extract<Size, 'sm' | 'md' | 'lg'>;
|
|
7
7
|
export type Layout = 'horizontal' | 'vertical';
|
|
8
8
|
export type ElementSpacing = 'top' | 'bottom' | 'both' | 'none';
|
|
@@ -79,3 +79,4 @@ export interface TimePreset {
|
|
|
79
79
|
label: string;
|
|
80
80
|
value: string;
|
|
81
81
|
}
|
|
82
|
+
export type CloseSource = 'ok-button' | 'cancel-button' | 'close-button' | 'esc' | 'overlay';
|
|
@@ -11,7 +11,6 @@ export type AvatarVariant = 'image' | 'initials' | 'icon';
|
|
|
11
11
|
* @slot icon - The icon to display when variant is 'icon'.
|
|
12
12
|
* @slot fallback - Custom fallback content when image fails to load.
|
|
13
13
|
*
|
|
14
|
-
* @event dds-click - Fired when the avatar is clicked (only when interactive).
|
|
15
14
|
* @event dds-load - Fired when the image loads successfully.
|
|
16
15
|
* @event dds-error - Fired when the image fails to load.
|
|
17
16
|
*
|
|
@@ -33,6 +33,7 @@ import { LabeledChoiceElement } from '../../internal/mixin/labeledChoiceElement'
|
|
|
33
33
|
* @csspart input - The input of the checkbox.
|
|
34
34
|
* @csspart control - The control of the checkbox.
|
|
35
35
|
* @csspart icon - The icon of the checkbox.
|
|
36
|
+
* @csspart icon-base - The base icon container.
|
|
36
37
|
* @csspart label-container - The label container of the checkbox.
|
|
37
38
|
* @csspart description - The description of the checkbox.
|
|
38
39
|
* @csspart readonly - The readonly state of the checkbox.
|
|
@@ -12,11 +12,12 @@ export type ChipSize = 'sm' | 'lg';
|
|
|
12
12
|
* @csspart base - The base part
|
|
13
13
|
* @csspart content-container - The container for the content
|
|
14
14
|
* @csspart remove-button - The remove button
|
|
15
|
+
* @csspart remove-icon - The icon of the remove icon
|
|
16
|
+
* @csspart remove-icon-base - The base of the remove icon
|
|
17
|
+
* @csspart remove-icon-base-base - The base of the remove icon base
|
|
15
18
|
*
|
|
16
|
-
* @cssproperty --dds-chip-border
|
|
17
|
-
* @cssproperty --dds-chip-border-style - Border style of the chip (default: solid)
|
|
19
|
+
* @cssproperty --dds-chip-border - Border of the chip (default: var(--dds-border-width-base) solid var(--dds-transparent-black-base))
|
|
18
20
|
* @cssproperty --dds-chip-border-radius - Border radius of the chip (default: var(--dds-radius-small))
|
|
19
|
-
* @cssProperty --dds-chip-border-color - Border color of the chip (default: var(--dds-transparent-black-base))
|
|
20
21
|
* @cssproperty --dds-chip-font-weight - Font weight of the chip (default: var(--dds-font-weight-bold))
|
|
21
22
|
* @cssproperty --dds-chip-line-height - Line height of the chip (default: 1.5)
|
|
22
23
|
* @cssproperty --dds-chip-transition - Transition timing for chip interactions (default: all 0.2s ease-in-out)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { RenderCallbackContent } from '../types/cell-content';
|
|
2
|
+
/**
|
|
3
|
+
* Angular core types - defined locally to avoid requiring @angular/core as a dependency
|
|
4
|
+
*/
|
|
5
|
+
interface Type<T> extends Function {
|
|
6
|
+
new (...args: any[]): T;
|
|
7
|
+
}
|
|
8
|
+
interface ComponentRef<T> {
|
|
9
|
+
instance: T;
|
|
10
|
+
setInput: (name: string, value: unknown) => void;
|
|
11
|
+
changeDetectorRef: {
|
|
12
|
+
detectChanges: () => void;
|
|
13
|
+
};
|
|
14
|
+
destroy: () => void;
|
|
15
|
+
}
|
|
16
|
+
interface EnvironmentInjector {
|
|
17
|
+
get: (token: any) => any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options for creating an Angular cell
|
|
21
|
+
*/
|
|
22
|
+
export interface AngularCellOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Angular component class to render
|
|
25
|
+
* Uses Type<any> to support different Angular component types
|
|
26
|
+
*/
|
|
27
|
+
component: Type<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Input bindings to pass to the component
|
|
30
|
+
* These are set using Angular's setInput() method (Angular 14+)
|
|
31
|
+
*/
|
|
32
|
+
inputs?: Record<string, any>;
|
|
33
|
+
/**
|
|
34
|
+
* Output event handlers to subscribe to
|
|
35
|
+
* Each output is expected to be an EventEmitter that will be subscribed to
|
|
36
|
+
* @example
|
|
37
|
+
* {
|
|
38
|
+
* click: (e) => console.log('clicked', e),
|
|
39
|
+
* change: (value) => console.log('changed', value)
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
outputs?: Record<string, (...args: any[]) => void>;
|
|
43
|
+
/**
|
|
44
|
+
* Content to project into the component (ng-content)
|
|
45
|
+
* Note: Dynamic content projection is limited in Angular
|
|
46
|
+
*/
|
|
47
|
+
content?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional EnvironmentInjector for dependency injection
|
|
50
|
+
* If not provided, component will be created without DI context
|
|
51
|
+
*/
|
|
52
|
+
environmentInjector?: EnvironmentInjector;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Type for Angular's createComponent function
|
|
56
|
+
* Made flexible to support different Angular versions
|
|
57
|
+
*/
|
|
58
|
+
type CreateComponentFn = (component: Type<any>, options: Record<string, any>) => ComponentRef<any>;
|
|
59
|
+
/**
|
|
60
|
+
* Create a datatable cell that renders an Angular component using a factory function.
|
|
61
|
+
*
|
|
62
|
+
* This helper manages the Angular component lifecycle, creating and destroying
|
|
63
|
+
* the component when the cell is added/removed from the table.
|
|
64
|
+
*
|
|
65
|
+
* Note: This helper requires Angular 14+ for the `createComponent` function
|
|
66
|
+
* and `setInput` method support.
|
|
67
|
+
*
|
|
68
|
+
* @param createComponentFn - Angular's createComponent function from @angular/core
|
|
69
|
+
* @param options - Angular cell options
|
|
70
|
+
* @returns Render callback content for the datatable
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { createComponent, EnvironmentInjector, inject } from '@angular/core'
|
|
75
|
+
* import { createAngularCellWithFactory } from 'dap-design-system/helpers/angular'
|
|
76
|
+
* import { StatusBadgeComponent } from './status-badge.component'
|
|
77
|
+
*
|
|
78
|
+
* // Inside a component class
|
|
79
|
+
* private readonly injector = inject(EnvironmentInjector)
|
|
80
|
+
*
|
|
81
|
+
* columns = [
|
|
82
|
+
* {
|
|
83
|
+
* id: 'status',
|
|
84
|
+
* header: 'Status',
|
|
85
|
+
* cell: (info) => createAngularCellWithFactory(createComponent, {
|
|
86
|
+
* component: StatusBadgeComponent,
|
|
87
|
+
* inputs: {
|
|
88
|
+
* status: info.row.original.status,
|
|
89
|
+
* variant: 'success'
|
|
90
|
+
* },
|
|
91
|
+
* outputs: {
|
|
92
|
+
* click: () => console.log('Badge clicked')
|
|
93
|
+
* },
|
|
94
|
+
* environmentInjector: this.injector
|
|
95
|
+
* })
|
|
96
|
+
* }
|
|
97
|
+
* ]
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function createAngularCellWithFactory(createComponentFn: CreateComponentFn, options: AngularCellOptions): RenderCallbackContent;
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use createAngularCellWithFactory instead.
|
|
103
|
+
* This alias is provided for backwards compatibility.
|
|
104
|
+
*/
|
|
105
|
+
export declare const createAngularCell: typeof createAngularCellWithFactory;
|
|
106
|
+
/**
|
|
107
|
+
* Type helper for creating type-safe cell renderers
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* import type { AngularCellRenderer } from 'dap-design-system/helpers/angular'
|
|
112
|
+
*
|
|
113
|
+
* interface User {
|
|
114
|
+
* id: number
|
|
115
|
+
* status: string
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* const statusCell: AngularCellRenderer<User> = (row) => createAngularCellWithFactory(createComponent, {
|
|
119
|
+
* component: StatusBadgeComponent,
|
|
120
|
+
* inputs: { status: row.status }
|
|
121
|
+
* })
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export type AngularCellRenderer<TData = any> = (row: TData) => RenderCallbackContent;
|
|
125
|
+
export {};
|
|
@@ -11,3 +11,7 @@ export type { VueCellOptions, VueCellRenderer } from './vue';
|
|
|
11
11
|
export { createVueCell } from './vue';
|
|
12
12
|
export type { ReactCellOptions, ReactCellRenderer } from './react';
|
|
13
13
|
export { createReactCell } from './react';
|
|
14
|
+
export type { AngularCellOptions, AngularCellRenderer } from './angular';
|
|
15
|
+
export { createAngularCell, createAngularCellWithFactory } from './angular';
|
|
16
|
+
export type { SvelteCellOptions, SvelteCellRenderer } from './svelte';
|
|
17
|
+
export { createSvelteCell } from './svelte';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { RenderCallbackContent } from '../types/cell-content';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a Svelte cell
|
|
4
|
+
*/
|
|
5
|
+
export interface SvelteCellOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Svelte component to render (works with both Svelte 4 and 5)
|
|
8
|
+
* - Svelte 4: Class-based component (SvelteComponent)
|
|
9
|
+
* - Svelte 5: Function-based component (Component)
|
|
10
|
+
*/
|
|
11
|
+
component: any;
|
|
12
|
+
/**
|
|
13
|
+
* Props to pass to the component
|
|
14
|
+
*/
|
|
15
|
+
props?: Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* Event listeners to attach to the component
|
|
18
|
+
* Uses Svelte's event dispatching system ($on for v4, events option for v5)
|
|
19
|
+
* @example
|
|
20
|
+
* {
|
|
21
|
+
* click: (e) => console.log('clicked', e),
|
|
22
|
+
* change: (value) => console.log('changed', value)
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
on?: Record<string, (...args: any[]) => void>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional context to pass to the component
|
|
28
|
+
* Accepts either a Map or a plain object (converted to Map internally)
|
|
29
|
+
*/
|
|
30
|
+
context?: Map<any, any> | Record<string, any>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a datatable cell that renders a Svelte component
|
|
34
|
+
*
|
|
35
|
+
* This helper manages the Svelte component lifecycle, mounting and unmounting
|
|
36
|
+
* the component when the cell is added/removed from the table.
|
|
37
|
+
*
|
|
38
|
+
* Supports both Svelte 4 (class-based) and Svelte 5 (function-based) components
|
|
39
|
+
* with automatic version detection.
|
|
40
|
+
*
|
|
41
|
+
* @param options - Svelte cell options
|
|
42
|
+
* @returns Render callback content for the datatable
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { createSvelteCell } from 'dap-design-system/helpers/svelte'
|
|
47
|
+
* import StatusBadge from './StatusBadge.svelte'
|
|
48
|
+
*
|
|
49
|
+
* const columns = [
|
|
50
|
+
* {
|
|
51
|
+
* id: 'status',
|
|
52
|
+
* header: 'Status',
|
|
53
|
+
* cell: (row) => createSvelteCell({
|
|
54
|
+
* component: StatusBadge,
|
|
55
|
+
* props: {
|
|
56
|
+
* status: row.status,
|
|
57
|
+
* variant: 'success'
|
|
58
|
+
* },
|
|
59
|
+
* on: {
|
|
60
|
+
* click: () => console.log('Badge clicked')
|
|
61
|
+
* }
|
|
62
|
+
* })
|
|
63
|
+
* }
|
|
64
|
+
* ]
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function createSvelteCell(options: SvelteCellOptions): RenderCallbackContent;
|
|
68
|
+
export declare function createSvelteCell(component: any, props?: Record<string, any>): RenderCallbackContent;
|
|
69
|
+
/**
|
|
70
|
+
* Type helper for creating type-safe cell renderers
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import type { SvelteCellRenderer } from 'dap-design-system/helpers/svelte'
|
|
75
|
+
*
|
|
76
|
+
* interface User {
|
|
77
|
+
* id: number
|
|
78
|
+
* status: string
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* const statusCell: SvelteCellRenderer<User> = (row) => createSvelteCell({
|
|
82
|
+
* component: StatusBadge,
|
|
83
|
+
* props: { status: row.status }
|
|
84
|
+
* })
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export type SvelteCellRenderer<TData = any> = (row: TData) => RenderCallbackContent;
|
|
@@ -27,7 +27,7 @@ import { default as ModalBaseElement } from './modal-base-element';
|
|
|
27
27
|
* @property {boolean} hideCancelButton - Whether the Cancel button should be hidden.
|
|
28
28
|
* @property {string} footer - Whether the modal should have a footer. Default is true.
|
|
29
29
|
* @property {string} header - Whether the modal should have a header. Default is true.
|
|
30
|
-
* @property {boolean} useNativeFocus - Whether the modal should use native focus. Default is false.
|
|
30
|
+
* @property {boolean} useNativeFocus - Whether the modal should use native browser handled focus. Default is false.
|
|
31
31
|
*
|
|
32
32
|
* @event {{ void }} dds-before-open - Fires before the modal opens.
|
|
33
33
|
* @event {{ void }} dds-opened - Fires after the modal opens.
|
|
@@ -15,10 +15,10 @@ import { DdsElement } from '../../internal/dds-hu-element';
|
|
|
15
15
|
*
|
|
16
16
|
* @slot - The content of the overlay.
|
|
17
17
|
*
|
|
18
|
-
* @csspart
|
|
18
|
+
* @csspart base - The overlay element
|
|
19
19
|
*
|
|
20
20
|
* @cssproperty --dds-overlay-z-index - Controls the z-index of the overlay (default: 1)
|
|
21
|
-
* @cssproperty --dds-overlay-background
|
|
21
|
+
* @cssproperty --dds-overlay-background - Controls the background of the overlay (default: var(--dds-black-10))
|
|
22
22
|
* @cssproperty --dds-overlay-opacity-closed - Controls the opacity when overlay is closed (default: 0)
|
|
23
23
|
* @cssproperty --dds-overlay-opacity-open - Controls the opacity when overlay is open (default: 1)
|
|
24
24
|
* @cssproperty --dds-overlay-transition-duration - Controls the transition duration (default: var(--dds-transition-fast))
|
|
@@ -16,6 +16,7 @@ import { DdsElement } from '../../internal/dds-hu-element';
|
|
|
16
16
|
* @csspart tab-content - The tab content container.
|
|
17
17
|
*
|
|
18
18
|
* @cssproperty --dds-tab-group-border-radius - Border radius of the tab group container (default: var(--dds-radius-base))
|
|
19
|
+
* @cssproperty --dds-tab-border-radius - Border radius for tab items (default: var(--dds-radius-base) var(--dds-radius-base) 0 0)
|
|
19
20
|
* @cssproperty --dds-tab-group-border-width - Border width of the tab navigation (default: var(--dds-border-width-base))
|
|
20
21
|
* @cssproperty --dds-tab-group-border-color - Border color of the tab navigation (default: var(--dds-border-neutral-subtle))
|
|
21
22
|
* @cssproperty --dds-tab-height-sm - Height of small tabs (default: 40px)
|
|
@@ -32,6 +32,12 @@ declare const DapDSTOC_base: typeof DdsElement & {
|
|
|
32
32
|
* @cssproperty --dds-toc-link-border-color - Border color of the active TOC link. (default: var(--dds-border-brand-base))
|
|
33
33
|
* @cssproperty --dds-toc-link-line-height - Line height of the TOC links. (default: 1.2)
|
|
34
34
|
* @cssproperty --dds-toc-link-padding - Padding of the TOC links. (default: var(--dds-spacing-200))
|
|
35
|
+
* @cssproperty --dds-toc-indent-level-0 - Indent level of the TOC items. (default: var(--dds-spacing-400))
|
|
36
|
+
* @cssproperty --dds-toc-indent-level-1 - Indent level of the TOC items. (default: var(--dds-spacing-800))
|
|
37
|
+
* @cssproperty --dds-toc-indent-level-2 - Indent level of the TOC items. (default: var(--dds-spacing-1200))
|
|
38
|
+
* @cssproperty --dds-toc-indent-level-3 - Indent level of the TOC items. (default: var(--dds-spacing-1600))
|
|
39
|
+
* @cssproperty --dds-toc-indent-level-4 - Indent level of the TOC items. (default: var(--dds-spacing-2000))
|
|
40
|
+
* @cssproperty --dds-toc-indent-level-5 - Indent level of the TOC items. (default: var(--dds-spacing-2400))
|
|
35
41
|
*/
|
|
36
42
|
export default class DapDSTOC extends DapDSTOC_base {
|
|
37
43
|
/** The root element to observe [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#root) */
|