@ngbase/adk 0.1.6 → 0.1.7
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/breadcrumb/breadcrumb-separator.d.ts +1 -5
- package/breadcrumb/breadcrumb.d.ts +1 -0
- package/breadcrumb/breadcrumbs.d.ts +3 -1
- package/breadcrumb/public-api.d.ts +1 -1
- package/fesm2022/ngbase-adk-breadcrumb.mjs +32 -34
- package/fesm2022/ngbase-adk-breadcrumb.mjs.map +1 -1
- package/package.json +13 -13
- package/schematics/components/files/accordion/accordion-llm.md.template +35 -0
- package/schematics/components/files/alert/alert-llm.md.template +34 -0
- package/schematics/components/files/autocomplete/autocomplete-llm.md.template +76 -0
- package/schematics/components/files/avatar/avatar-llm.md.template +37 -0
- package/schematics/components/files/avatar/avatar.ts.template +5 -2
- package/schematics/components/files/badge/badge-llm.md.template +21 -0
- package/schematics/components/files/badge/badge.ts.template +1 -1
- package/schematics/components/files/breadcrumb/breadcrumb-llm.md.template +26 -0
- package/schematics/components/files/breadcrumb/breadcrumb.ts.template +9 -18
- package/schematics/components/files/button/button-llm.md.template +22 -0
- package/schematics/components/files/card/card-llm.md.template +16 -0
- package/schematics/components/files/carousel/carousel-llm.md.template +38 -0
- package/schematics/components/files/checkbox/checkbox-llm.md.template +27 -0
- package/schematics/components/files/chip/chip-llm.md.template +29 -0
- package/schematics/components/files/color-picker/color-picker-llm.md.template +27 -0
- package/schematics/components/files/datepicker/datepicker-llm.md.template +43 -0
- package/schematics/components/files/dialog/dialog-llm.md.template +69 -0
- package/schematics/components/files/drawer/drawer-llm.md.template +54 -0
- package/schematics/components/files/form-field/form-field-llm.md.template +56 -0
- package/schematics/components/files/form-field/form-field.ts.template +1 -1
- package/schematics/components/files/hover-card/hover-card-llm.md.template +26 -0
- package/schematics/components/files/icon/icon-llm.md.template +19 -0
- package/schematics/components/files/inline-edit/inline-edit-llm.md.template +22 -0
- package/schematics/components/files/list/list-llm.md.template +23 -0
- package/schematics/components/files/mask/mask-llm.md.template +19 -0
- package/schematics/components/files/menu/context-menu-llm.md.template +28 -0
- package/schematics/components/files/menu/menu-llm.md.template +37 -0
- package/schematics/components/files/otp/otp-llm.md.template +21 -0
- package/schematics/components/files/pagination/pagination-llm.md.template +29 -0
- package/schematics/components/files/popover/popover-llm.md.template +59 -0
- package/schematics/components/files/progress/progress-llm.md.template +19 -0
- package/schematics/components/files/radio/radio-llm.md.template +36 -0
- package/schematics/components/files/resizable/resizable-llm.md.template +31 -0
- package/schematics/components/files/select/select-llm.md.template +87 -0
- package/schematics/components/files/selectable/selectable-llm.md.template +31 -0
- package/schematics/components/files/sheet/sheet-llm.md.template +54 -0
- package/schematics/components/files/sidenav/sidenav-llm.md.template +37 -0
- package/schematics/components/files/skeleton/skeleton-llm.md.template +22 -0
- package/schematics/components/files/slider/slider-llm.md.template +35 -0
- package/schematics/components/files/sonner/sonner-llm.md.template +34 -0
- package/schematics/components/files/spinner/spinner-llm.md.template +29 -0
- package/schematics/components/files/stepper/stepper-llm.md.template +32 -0
- package/schematics/components/files/switch/switch-llm.md.template +23 -0
- package/schematics/components/files/table/table-llm.md.template +31 -0
- package/schematics/components/files/tabs/tab.ts.template +1 -1
- package/schematics/components/files/tabs/tabs-llm.md.template +48 -0
- package/schematics/components/files/theme/index.ts.template +1 -1
- package/schematics/components/files/theme/theme-button.ts.template +27 -0
- package/schematics/components/files/theme/theme-llm.md.template +23 -0
- package/schematics/components/files/theme/theme.service.ts.template +1 -3
- package/schematics/components/files/toggle/toggle-llm.md.template +19 -0
- package/schematics/components/files/toggle-group/toggle-group-llm.md.template +32 -0
- package/schematics/components/files/tooltip/tooltip-llm.md.template +37 -0
- package/schematics/components/schema.json +2 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Resizable, ResizableGroup } from '@/ui/resizable';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-resizable-group`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `direction`: 'horizontal' | 'vertical' = 'horizontal' - The direction of the resizable group
|
|
13
|
+
- **Exports** - `<%= name %>ResizableGroup`
|
|
14
|
+
|
|
15
|
+
### `<%= name %>-resizable`
|
|
16
|
+
|
|
17
|
+
- **Inputs**
|
|
18
|
+
- `size`: number | string = 'auto' - The size of the resizable
|
|
19
|
+
- `min`: number | string = 0 - The minimum size of the resizable
|
|
20
|
+
- `max`: number | string = undefined - The maximum size of the resizable
|
|
21
|
+
- **Exports** - `<%= name %>Resizable`
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<<%= name %>-resizable-group>
|
|
27
|
+
<<%= name %>-resizable size="100px" />
|
|
28
|
+
<<%= name %>-resizable size="300px" />
|
|
29
|
+
<<%= name %>-resizable />
|
|
30
|
+
</<%= name %>-resizable-group>
|
|
31
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { FormField, Label } from '@/ui/form-field';
|
|
5
|
+
import { Select, Option, OptionGroup, SelectInput } from '@/ui/select';
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Components
|
|
9
|
+
|
|
10
|
+
### `<%= name %>-select`
|
|
11
|
+
|
|
12
|
+
- **Inputs**
|
|
13
|
+
|
|
14
|
+
- `value`: any[] | any - Selected value (2way)
|
|
15
|
+
- `disabled`: boolean = false - Disable the autocomplete (2way)
|
|
16
|
+
- `multiple`: boolean = false - Allow multiple selection
|
|
17
|
+
- `noAutoClose`: boolean = false - Prevent auto close
|
|
18
|
+
- `options`: any[] - Options
|
|
19
|
+
- `placeholder`: string = ' ' - Placeholder text
|
|
20
|
+
- `size`: 'target' | 'free' = 'free' - Size of the autocomplete
|
|
21
|
+
- `filterFn`: (option: any) => boolean = (option: any) => true - Filter function
|
|
22
|
+
- `queryFn`: (query: string, option: any) => boolean = (query: string, option: any) => true - Query function
|
|
23
|
+
- `filterOptions`: FilterOptions<any> - Filter options
|
|
24
|
+
|
|
25
|
+
- **Outputs**
|
|
26
|
+
|
|
27
|
+
- `opened`: boolean - Open state
|
|
28
|
+
- `closed`: boolean - Close state
|
|
29
|
+
|
|
30
|
+
- **Methods**
|
|
31
|
+
|
|
32
|
+
- `open()`: void - Open the select
|
|
33
|
+
- `close()`: void - Close the select
|
|
34
|
+
|
|
35
|
+
- **Export** - `#select="<%= name %>Select"` - Template reference
|
|
36
|
+
|
|
37
|
+
### `<%= name %>-option`
|
|
38
|
+
|
|
39
|
+
- **Inputs**
|
|
40
|
+
|
|
41
|
+
- `value`: any - The value of the option
|
|
42
|
+
- `disabled`: boolean = false - Disable the option
|
|
43
|
+
|
|
44
|
+
- **Export** - `#option="<%= name %>Option"` - Template reference
|
|
45
|
+
|
|
46
|
+
### `<%= name %>-option-group`
|
|
47
|
+
|
|
48
|
+
- **Inputs**
|
|
49
|
+
|
|
50
|
+
- `label`: string - The label of the option group
|
|
51
|
+
|
|
52
|
+
- **Export** - `#optionGroup="<%= name %>OptionGroup"` - Template reference
|
|
53
|
+
|
|
54
|
+
### `<%= name %>-select-input`
|
|
55
|
+
|
|
56
|
+
- **Inputs**
|
|
57
|
+
|
|
58
|
+
- `placeholder`: string = ' ' - Placeholder text
|
|
59
|
+
- `value`: string = '' - Value (2way)
|
|
60
|
+
|
|
61
|
+
- **Export** - `#selectInput="<%= name %>SelectInput"` - Template reference
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<<%= name %>-form-field>
|
|
67
|
+
<label <%= name %>Label>Select</label>
|
|
68
|
+
<<%= name %>-select [(value)]="value">
|
|
69
|
+
<<%= name %>-option value="1">Option 1</<%= name %>-option>
|
|
70
|
+
<<%= name %>-option value="2">Option 2</<%= name %>-option>
|
|
71
|
+
<<%= name %>-option value="3">Option 3</<%= name %>-option>
|
|
72
|
+
</<%= name %>-select>
|
|
73
|
+
</<%= name %>-form-field>
|
|
74
|
+
|
|
75
|
+
<<%= name %>-form-field>
|
|
76
|
+
<<%= name %>-select [(ngModel)]="value">
|
|
77
|
+
<<%= name %>-option-group label="Group 1">
|
|
78
|
+
<<%= name %>-option value="1">Option 1</<%= name %>-option>
|
|
79
|
+
<<%= name %>-option value="2">Option 2</<%= name %>-option>
|
|
80
|
+
</<%= name %>-option-group>
|
|
81
|
+
<<%= name %>-option-group label="Group 2">
|
|
82
|
+
<<%= name %>-option value="3">Option 3</<%= name %>-option>
|
|
83
|
+
<<%= name %>-option value="4">Option 4</<%= name %>-option>
|
|
84
|
+
</<%= name %>-option-group>
|
|
85
|
+
</<%= name %>-select>
|
|
86
|
+
</<%= name %>-form-field>
|
|
87
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Selectable
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Selectable, SelectableItem } from '@/ui/selectable';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-selectable`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `activeIndex`: number - Active index (2way)
|
|
13
|
+
- **Outputs**
|
|
14
|
+
- `activeIndexChange`: EventEmitter<number> - Active index changed event
|
|
15
|
+
- `valueChanged`: EventEmitter<any> - Value changed event
|
|
16
|
+
- **Export** - `<%= name %>Selectable` - Template reference
|
|
17
|
+
|
|
18
|
+
### `<%= name %>-selectable-item, [<%= name %>SelectableItem]`
|
|
19
|
+
|
|
20
|
+
- **Inputs**
|
|
21
|
+
- `value`: any - Value
|
|
22
|
+
- **Export** - `<%= name %>SelectableItem` - Template reference
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<<%= name %>-selectable [(activeIndex)]="activeIndex">
|
|
28
|
+
<<%= name %>-selectable-item value="1">Item 1</<%= name %>-selectable-item>
|
|
29
|
+
<button <%= name %>SelectableItem value="2">Item 2</button>
|
|
30
|
+
</<%= name %>-selectable>
|
|
31
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { sheetPortal } from '@/ui/sheet';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Notes:
|
|
8
|
+
|
|
9
|
+
SheetOptions:
|
|
10
|
+
|
|
11
|
+
- backdrop: boolean - Whether to show a backdrop
|
|
12
|
+
- backdropColor: boolean - Whether to use the backdrop color
|
|
13
|
+
- hideOverlay: boolean - Whether to hide the overlay
|
|
14
|
+
- data: any - The data to pass to the sheet
|
|
15
|
+
- title: string - The title of the sheet
|
|
16
|
+
- fullWindow: boolean - Whether to use the full window
|
|
17
|
+
- minWidth: string - The minimum width of the drawer
|
|
18
|
+
- minHeight: string - The minimum height of the drawer
|
|
19
|
+
- width: string - The width of the drawer
|
|
20
|
+
- height: string - The height of the drawer
|
|
21
|
+
- maxWidth: string - The maximum width of the drawer
|
|
22
|
+
- maxHeight: string - The maximum height of the drawer
|
|
23
|
+
- classNames: string[] - The class names of the drawer
|
|
24
|
+
- header: boolean - Whether to show a header
|
|
25
|
+
- disableClose: boolean - Whether to disable the close button
|
|
26
|
+
- ayId: string - The id of the drawer
|
|
27
|
+
- focusTrap: boolean - Whether to focus the drawer
|
|
28
|
+
- afterFocusEl: HTMLElement - The element to focus after the drawer is opened
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<ng-template #sheetContent>
|
|
34
|
+
<div>
|
|
35
|
+
<h1>Sheet</h1>
|
|
36
|
+
</div>
|
|
37
|
+
</ng-template>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const sheet = sheetPortal();
|
|
42
|
+
|
|
43
|
+
sheet.open(SheetComponent, {
|
|
44
|
+
backdrop: true,
|
|
45
|
+
hideOverlay: false,
|
|
46
|
+
data: {},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
sheet.open(sheetContent, {
|
|
50
|
+
backdrop: true,
|
|
51
|
+
hideOverlay: false,
|
|
52
|
+
data: {},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Sidenav
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Sidenav, SidenavHeader } from '@/ui/sidenav';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-sidenav`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `show`: boolean - Whether to show the sidenav (2way)
|
|
13
|
+
- `mode`: 'side' | 'over' - The mode of the sidenav
|
|
14
|
+
- **Outputs**
|
|
15
|
+
- `showChange`: EventEmitter<boolean> - Show changed event
|
|
16
|
+
- **Export** - `<%= name %>Sidenav` - Template reference
|
|
17
|
+
|
|
18
|
+
### `<%= name %>-sidenav-header`
|
|
19
|
+
|
|
20
|
+
- **Inputs**
|
|
21
|
+
- `width`: string - The width of the sidenav
|
|
22
|
+
- `minWidth`: string - The minimum width of the sidenav
|
|
23
|
+
- **Export** - `<%= name %>SidenavHeader` - Template reference
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<<%= name %>-sidenav [show]="show()" [mode]="mode()">
|
|
29
|
+
<<%= name %>-sidenav-header width="100px" minWidth="50px">
|
|
30
|
+
<div class="p-2">Collapsible content like side menu</div>
|
|
31
|
+
</<%= name %>-sidenav-header>
|
|
32
|
+
<div class="p-2">
|
|
33
|
+
<p>Main content</p>
|
|
34
|
+
<button (click)="toggle()">Toggle</button>
|
|
35
|
+
</div>
|
|
36
|
+
</<%= name %>-sidenav>
|
|
37
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Skeleton } from '@/ui/skeleton';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-skeleton`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `width`: string - The width of the skeleton
|
|
13
|
+
- `height`: string - The height of the skeleton
|
|
14
|
+
- `shape`: 'circle' | 'rectangle' - The shape of the skeleton
|
|
15
|
+
- **Export** - `<%= name %>Skeleton` - Template reference
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<<%= name %>-skeleton width="10px" height="10px" shape="circle"></<%= name %>-skeleton>
|
|
21
|
+
<<%= name %>-skeleton width="25px" height="10px" shape="rectangle"></<%= name %>-skeleton>
|
|
22
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Slider } from '@/ui/slider';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-slider`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `value`: number - The value of the slider (2way)
|
|
13
|
+
- `step`: number - The step of the slider
|
|
14
|
+
- `min`: number - The minimum value of the slider
|
|
15
|
+
- `max`: number - The maximum value of the slider
|
|
16
|
+
- `range`: number - The range of the slider
|
|
17
|
+
- `disabled`: boolean - Whether the slider is disabled
|
|
18
|
+
- `orientation`: 'horizontal' | 'vertical' = 'horizontal' - The orientation of the slider
|
|
19
|
+
- **Export** - `<%= name %>Slider` - Template reference
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<<%= name %>-slider [(ngModel)]="value" />
|
|
25
|
+
<<%= name %>-slider formControlName="value" [step]="10" [max]="200" [range]="3" />
|
|
26
|
+
<<%= name %>-slider
|
|
27
|
+
[(value)]="value()"
|
|
28
|
+
[step]="step()"
|
|
29
|
+
[min]="min()"
|
|
30
|
+
[max]="max()"
|
|
31
|
+
[range]="range()"
|
|
32
|
+
[disabled]="disabled()"
|
|
33
|
+
[orientation]="orientation()"
|
|
34
|
+
></<%= name %>-slider>
|
|
35
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Sonner
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { sonnerPortal } from '@/ui/sonner';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Notes
|
|
8
|
+
|
|
9
|
+
- **Methods**
|
|
10
|
+
- `add(message: string, data?: SonnerData)`: void - Add a message
|
|
11
|
+
- `closeAll()`: void - Close all messages
|
|
12
|
+
- `success(message: string, data?: SonnerData)`: void - Add a success message
|
|
13
|
+
- `error(message: string, data?: SonnerData)`: void - Add an error message
|
|
14
|
+
- `warning(message: string, data?: SonnerData)`: void - Add a warning message
|
|
15
|
+
- `info(message: string, data?: SonnerData)`: void - Add an info message
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<button <%= name %>Button (click)="addMessage()">Add Message</button>
|
|
21
|
+
<button <%= name %>Button (click)="clearMessage()">Clear Message</button>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
sonner = sonnerPortal();
|
|
26
|
+
|
|
27
|
+
addMessage() {
|
|
28
|
+
this.sonner.add('Event has been created', 'Sunday, December 03, 2023 at 9:00 AM');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
clearMessage() {
|
|
32
|
+
this.sonner.closeAll();
|
|
33
|
+
}
|
|
34
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Spinner } from '@/ui/spinner';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-spinner`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `size`: 'small' | 'medium' | 'large' = 'medium' - The size of the spinner
|
|
13
|
+
- `mode`: 'light' | 'dark' | '' = 'light' - The mode of the spinner
|
|
14
|
+
- `diameter`: number = 35 - The diameter of the spinner
|
|
15
|
+
- `strokeWidth`: number = 3 - The stroke width of the spinner
|
|
16
|
+
- `root`: boolean = false - Whether the spinner is the root spinner
|
|
17
|
+
- **Export** - `<%= name %>Spinner` - Template reference
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<<%= name %>-spinner
|
|
23
|
+
[size]="size()"
|
|
24
|
+
[mode]="mode()"
|
|
25
|
+
[diameter]="diameter()"
|
|
26
|
+
[strokeWidth]="strokeWidth()"
|
|
27
|
+
[root]="root()"
|
|
28
|
+
></<%= name %>-spinner>
|
|
29
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Stepper, Step, StepHeader } from '@/ui/stepper';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-stepper`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `activeIndex`: number = 0 - The index of the active step (2way)
|
|
13
|
+
- `direction`: 'horizontal' | 'vertical' = 'horizontal' - The direction of the stepper
|
|
14
|
+
- **Export** - `<%= name %>Stepper` - Template reference
|
|
15
|
+
|
|
16
|
+
### `<%= name %>-step`
|
|
17
|
+
|
|
18
|
+
- **Inputs**
|
|
19
|
+
- `title`: string - The title of the step
|
|
20
|
+
- **Export** - `<%= name %>Step` - Template reference
|
|
21
|
+
|
|
22
|
+
### `[<%= name %>StepHeader]`
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<<%= name %>-stepper [(activeIndex)]="activeIndex" [direction]="direction()">
|
|
28
|
+
<<%= name %>-step title="Step 1"> Step 1 </<%= name %>-step>
|
|
29
|
+
<<%= name %>-step title="Step 2"> Step 2 </<%= name %>-step>
|
|
30
|
+
<<%= name %>-step title="Step 3"> Step 3 </<%= name %>-step>
|
|
31
|
+
</<%= name %>-stepper>
|
|
32
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Switch } from '@/ui/switch';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-switch`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `checked`: boolean = false - Whether the switch is checked (2way)
|
|
13
|
+
- `disabled`: boolean = false - Whether the switch is disabled
|
|
14
|
+
- **Outputs**
|
|
15
|
+
- `checkedChange`: EventEmitter<boolean> - Emits the checked value when it changes
|
|
16
|
+
- `change`: EventEmitter<boolean> - Emits the checked value when it changes
|
|
17
|
+
- **Export** - `<%= name %>Switch` - Template reference
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<<%= name %>-switch [(checked)]="checked" [disabled]="disabled()"></<%= name %>-switch>
|
|
23
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { TableComponents } from '@/ui/table';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### `<%= name %>Table`
|
|
8
|
+
|
|
9
|
+
- **inputs**
|
|
10
|
+
|
|
11
|
+
- `data`: `T[]`
|
|
12
|
+
- `trackBy`: `(index: number, item: T) => string`
|
|
13
|
+
|
|
14
|
+
- **Exports** - `<%= name %>Table`
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<table <%= name %>Table [data]="data" [trackBy]="trackBy">
|
|
20
|
+
<ng-container <%= name %>Column="name">
|
|
21
|
+
<th <%= name %>Head *<%= name %>HeadDef>Name</th>
|
|
22
|
+
<td <%= name %>Cell *<%= name %>CellDef="let row">{{row.name}}</td>
|
|
23
|
+
</ng-container>
|
|
24
|
+
<ng-container <%= name %>Column="age">
|
|
25
|
+
<th <%= name %>Head *<%= name %>HeadDef>Age</th>
|
|
26
|
+
<td <%= name %>Cell *<%= name %>CellDef="let row">{{row.age}}</td>
|
|
27
|
+
</ng-container>
|
|
28
|
+
<tr <%= name %>HeadRow *<%= name %>HeadRowDef="columns()"></tr>
|
|
29
|
+
<tr <%= name %>BodyRow *<%= name %>BodyRowDef="let row; columns: columns()"></tr>
|
|
30
|
+
</table>
|
|
31
|
+
```
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
@for (tab of tabs(); track tab.id) {
|
|
37
37
|
<button
|
|
38
38
|
[ngbTabButton]="tab"
|
|
39
|
-
class="
|
|
39
|
+
class="whitespace-nowrap border-b-2 border-transparent px-4 py-3 font-medium text-muted-foreground aria-[disabled=true]:cursor-not-allowed aria-[selected=true]:!border-primary aria-[disabled=true]:text-muted-foreground aria-[selected=true]:!text-primary aria-[disabled=true]:opacity-50"
|
|
40
40
|
></button>
|
|
41
41
|
}
|
|
42
42
|
</div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## Tabs
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Tabs, Tab, TabHeader, TabLazy } from '@/ui/tabs';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### `<%= name %>-tabs`
|
|
8
|
+
|
|
9
|
+
- **inputs**
|
|
10
|
+
|
|
11
|
+
- `selectedIndex`: number (2way)
|
|
12
|
+
|
|
13
|
+
- **outputs**
|
|
14
|
+
- `selectedTabChange`: `EventEmitter<TabChangeEvent>`
|
|
15
|
+
|
|
16
|
+
### `<%= name %>-tab`
|
|
17
|
+
|
|
18
|
+
- **inputs**
|
|
19
|
+
|
|
20
|
+
- `label`: string
|
|
21
|
+
- `disabled`: boolean
|
|
22
|
+
- `mode`: 'hidden' | 'lazy'
|
|
23
|
+
- `value`: string | number
|
|
24
|
+
|
|
25
|
+
- **exports** - `<%= name %>Tab`
|
|
26
|
+
|
|
27
|
+
### `<%= name %>-tab-header`
|
|
28
|
+
|
|
29
|
+
- **exports** - `<%= name %>TabHeader`
|
|
30
|
+
|
|
31
|
+
### `<%= name %>-tab-lazy`
|
|
32
|
+
|
|
33
|
+
Use it to render the tab every time user visit the tab
|
|
34
|
+
|
|
35
|
+
- **exports** - `<%= name %>TabLazy`
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<<%= name %>-tabs [(selectedIndex)]="selectedIndex">
|
|
41
|
+
<<%= name %>-tab label="Tab 1">Tab 1 Content</<%= name %>-tab>
|
|
42
|
+
<<%= name %>-tab>
|
|
43
|
+
<h4 *<%= name %>TabHeader>Tab 2</h4>
|
|
44
|
+
Tab 2 Content
|
|
45
|
+
</<%= name %>-tab>
|
|
46
|
+
<<%= name %>-tab *<%= name %>TabLazy="let tab"> Tab 3 </<%= name %>-tab>
|
|
47
|
+
</<%= name %>-tabs>
|
|
48
|
+
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { injectTheme } from './theme.service';
|
|
2
|
-
export { ThemeButton } from './theme-button
|
|
2
|
+
export { ThemeButton } from './theme-button';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { Button } from '<%= basepath %>/button';
|
|
3
|
+
import { Icon } from '<%= basepath %>/icon';
|
|
4
|
+
import { provideIcons } from '@ng-icons/core';
|
|
5
|
+
import { lucideMoon, lucideSun } from '@ng-icons/lucide';
|
|
6
|
+
import { injectTheme } from './theme.service';
|
|
7
|
+
// import { keyMap } from '@ngbase/adk/keys';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: '<%= name %>-theme-button',
|
|
11
|
+
imports: [Icon, Button],
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
viewProviders: [provideIcons({ lucideMoon, lucideSun })],
|
|
14
|
+
template: `
|
|
15
|
+
<button <%= name %>Button="icon" class="tour-mode h-9 w-9" (click)="themeService.toggle()">
|
|
16
|
+
<<%= name %>-icon [name]="themeService.mode() === 'dark' ? 'lucideSun' : 'lucideMoon'" />
|
|
17
|
+
<span class="sr-only">Toggle theme</span>
|
|
18
|
+
</button>
|
|
19
|
+
`,
|
|
20
|
+
})
|
|
21
|
+
export class ThemeButton {
|
|
22
|
+
readonly themeService = injectTheme();
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
// keyMap('ctrl+b', () => this.themeService.toggle());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Theme
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { ThemeButton, injectTheme } from '@/ui/theme';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### ThemeButton
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<<%= name %>-theme-button />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const theme = injectTheme();
|
|
19
|
+
|
|
20
|
+
theme.toggle();
|
|
21
|
+
theme.mode(); // 'light' | 'dark' | ''
|
|
22
|
+
theme.mode.set('light');
|
|
23
|
+
```
|
|
@@ -3,14 +3,12 @@ import { isClient } from '@ngbase/adk/utils';
|
|
|
3
3
|
|
|
4
4
|
@Injectable({ providedIn: 'root' })
|
|
5
5
|
export class ThemeService {
|
|
6
|
-
mode = signal<'light' | 'dark' | ''>('light');
|
|
6
|
+
readonly mode = signal<'light' | 'dark' | ''>('light');
|
|
7
7
|
|
|
8
8
|
constructor() {
|
|
9
9
|
if (isClient()) {
|
|
10
10
|
const theme = localStorage.getItem('theme');
|
|
11
11
|
this._update((theme as 'light' | 'dark') || 'light');
|
|
12
|
-
|
|
13
|
-
// registerShortcut('ctrl+h', () => this.open());
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Toggle } from '@/ui/toggle';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### `<%= name %>-toggle`
|
|
8
|
+
|
|
9
|
+
- **inputs**
|
|
10
|
+
|
|
11
|
+
- `value`: boolean (2way)
|
|
12
|
+
|
|
13
|
+
- **exports** - `<%= name %>Toggle`
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<<%= name %>-toggle [(value)]="value" />
|
|
19
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { ToggleGroup, ToggleItem } from '@/ui/toggle-group';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### `<%= name %>-toggle-group`
|
|
8
|
+
|
|
9
|
+
- **inputs**
|
|
10
|
+
|
|
11
|
+
- `value`: boolean (2way)
|
|
12
|
+
- `multiple`: boolean
|
|
13
|
+
|
|
14
|
+
- **exports** - `<%= name %>ToggleGroup`
|
|
15
|
+
|
|
16
|
+
### `<%= name %>-toggle-item`
|
|
17
|
+
|
|
18
|
+
- **inputs**
|
|
19
|
+
|
|
20
|
+
- `value`: boolean
|
|
21
|
+
- `disabled`: boolean
|
|
22
|
+
|
|
23
|
+
- **exports** - `<%= name %>ToggleItem`
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<<%= name %>-toggle-group [(value)]="value" [multiple]="multiple">
|
|
29
|
+
<button <%= name %>ToggleItem value="1">1</button>
|
|
30
|
+
<button <%= name %>ToggleItem value="2">2</button>
|
|
31
|
+
</<%= name %>-toggle-group>
|
|
32
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Tooltip } from '@/ui/tooltip';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
PopoverPosition =
|
|
10
|
+
| 'top'
|
|
11
|
+
| 'bottom'
|
|
12
|
+
| 'left'
|
|
13
|
+
| 'right'
|
|
14
|
+
| 'rs'
|
|
15
|
+
| 're'
|
|
16
|
+
| 'ls'
|
|
17
|
+
| 'le'
|
|
18
|
+
| 'tl'
|
|
19
|
+
| 'tr'
|
|
20
|
+
| 'bl'
|
|
21
|
+
| 'br';
|
|
22
|
+
|
|
23
|
+
### `<%= name %>-tooltip`
|
|
24
|
+
|
|
25
|
+
- **inputs**
|
|
26
|
+
|
|
27
|
+
- `<%= name %>Tooltip`: string
|
|
28
|
+
- `<%= name %>TooltipPosition`: PopoverPosition
|
|
29
|
+
- `delay`: number
|
|
30
|
+
|
|
31
|
+
- **exports** - `<%= name %>Tooltip`
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<<%= name %>-tooltip <%= name %>Tooltip="Tooltip content" [delay]="100" />
|
|
37
|
+
```
|