@ngbase/adk 0.1.6 → 0.1.8
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/fesm2022/ngbase-adk-tabs.mjs +2 -1
- package/fesm2022/ngbase-adk-tabs.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 +8 -3
- 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/checkbox/focus-style.directive.ts.template +9 -6
- package/schematics/components/files/checkbox/index.ts.template +1 -1
- 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 +2 -2
- package/schematics/components/files/form-field/input-style.directive.ts.template +2 -3
- 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/list/list.ts.template +2 -1
- 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/pagination/pagination.ts.template +11 -12
- 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/option.ts.template +2 -2
- 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/selectable/selectable.ts.template +4 -3
- 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.component.ts.template → theme-button.ts.template} +2 -1
- 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,28 @@
|
|
|
1
|
+
# Menu
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Menu, MenuTrigger, MenuContent } from '@/ui/menu';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `[<%= name %>ContextMenu]`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `<%= name %>ContextMenu`: Menu - Menu reference
|
|
13
|
+
- **Outputs**
|
|
14
|
+
- `ctxOpen`: EventEmitter<void> - Emits when the context menu is opened
|
|
15
|
+
- `ctxClose`: EventEmitter<void> - Emits when the context menu is closed
|
|
16
|
+
- **Exports** - `<%= name %>ContextMenu`
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<button [<%= name %>ContextMenu]="menu">Context Menu</button>
|
|
22
|
+
<<%= name %>-menu #menu>
|
|
23
|
+
<button>Item 1</button>
|
|
24
|
+
<button>Item 2</button>
|
|
25
|
+
</<%= name %>-menu>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Context Menu
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Menu
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Menu, MenuTrigger, MenuContent } from '@/ui/menu';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-menu`
|
|
10
|
+
|
|
11
|
+
- **Exports** - `<%= name %>Menu`
|
|
12
|
+
|
|
13
|
+
### `<%= name %>MenuContent`
|
|
14
|
+
|
|
15
|
+
### `<%= name %>MenuTrigger`
|
|
16
|
+
|
|
17
|
+
- **Inputs**
|
|
18
|
+
- `<%= name %>MenuTrigger`: <%= name %>Menu - Menu reference
|
|
19
|
+
- **Exports** - `<%= name %>MenuTrigger`
|
|
20
|
+
|
|
21
|
+
## Menu Usage
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<button [<%= name %>MenuTrigger]="menu">Menu</button>
|
|
25
|
+
<<%= name %>-menu #menu>
|
|
26
|
+
<button>Item 1</button>
|
|
27
|
+
<button>Item 2</button>
|
|
28
|
+
</<%= name %>-menu>
|
|
29
|
+
|
|
30
|
+
<button [<%= name %>MenuTrigger]="menu1" [<%= name %>MenuTriggerData]="{ data: 'Custom data' }">Menu</button>
|
|
31
|
+
<<%= name %>-menu #menu1>
|
|
32
|
+
<ng-template <%= name %>MenuContent let-data="data">
|
|
33
|
+
<button <%= name %>List>{{ data }}</button>
|
|
34
|
+
<button <%= name %>List>Item 2</button>
|
|
35
|
+
</ng-template>
|
|
36
|
+
</<%= name %>-menu>
|
|
37
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# OTP
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Otp } from '@/ui/otp';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-otp-input`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `size`: number[] - The size of the OTP input
|
|
13
|
+
- `masked`: boolean - Whether the OTP input is masked
|
|
14
|
+
- `disabled`: boolean - Whether the OTP input is disabled
|
|
15
|
+
- **Exports** - `<%= name %>OtpInput`
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<<%= name %>-otp-input [size]="[4, 4, 4]" [masked]="true" [disabled]="false"></<%= name %>-otp-input>
|
|
21
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Pagination } from '@/ui/pagination';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-pagination`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `size`: number - The size of the pagination (2way)
|
|
13
|
+
- `active`: number - The active page (2way)
|
|
14
|
+
- `total`: number - The total number of pages
|
|
15
|
+
- `sizeOptions`: number[] - The options for the size of the pagination
|
|
16
|
+
- **Outputs**
|
|
17
|
+
- `valueChanged`: EventEmitter<number> - Emits when the value changes
|
|
18
|
+
- **Exports** - `<%= name %>Pagination`
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<<%= name %>-pagination
|
|
24
|
+
[size]="10"
|
|
25
|
+
[active]="1"
|
|
26
|
+
[total]="100"
|
|
27
|
+
[sizeOptions]="[10, 20, 50, 100]"
|
|
28
|
+
></<%= name %>-pagination>
|
|
29
|
+
```
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
lucideChevronsLeft,
|
|
11
11
|
lucideChevronsRight,
|
|
12
12
|
} from '@ng-icons/lucide';
|
|
13
|
+
import { FormField } from '<%= basepath %>/form-field';
|
|
13
14
|
|
|
14
15
|
@Component({
|
|
15
16
|
selector: '<%= name %>-pagination',
|
|
@@ -22,21 +23,19 @@ import {
|
|
|
22
23
|
lucideChevronsRight,
|
|
23
24
|
}),
|
|
24
25
|
],
|
|
25
|
-
imports: [Button, Icon, Select, Option, NgbPaginationBtn],
|
|
26
|
+
imports: [Button, Icon, Select, Option, NgbPaginationBtn, FormField],
|
|
26
27
|
template: `
|
|
27
28
|
<div class="flex items-center gap-2">
|
|
28
29
|
<div>Rows per page</div>
|
|
29
|
-
<<%= name %>-
|
|
30
|
-
[value]="size()"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
</<%= name %>-select>
|
|
30
|
+
<<%= name %>-form-field class="!w-auto [&>.mis]:min-h-8 [&>.mis]:py-0">
|
|
31
|
+
<<%= name %>-select [value]="size()" (valueChange)="sizeChanged($event)">
|
|
32
|
+
@for (size of sizeOptions(); track size) {
|
|
33
|
+
<<%= name %>-option [value]="size">
|
|
34
|
+
{{ size }}
|
|
35
|
+
</<%= name %>-option>
|
|
36
|
+
}
|
|
37
|
+
</<%= name %>-select>
|
|
38
|
+
</<%= name %>-form-field>
|
|
40
39
|
</div>
|
|
41
40
|
<div>Page {{ active() }} of {{ totalSnaps() }}</div>
|
|
42
41
|
<div class="flex items-center gap-2">
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { popoverPortal, PopoverTrigger, PopoverClose } from '@/ui/popover';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>PopoverTrigger`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `<%= name %>PopoverTrigger`: Popover - Popover reference
|
|
13
|
+
- `<%= name %>PopoverTriggerData`: any - The data to pass to the popover
|
|
14
|
+
-
|
|
15
|
+
- **Outputs**
|
|
16
|
+
- **Exports** - `<%= name %>PopoverTrigger`
|
|
17
|
+
|
|
18
|
+
### `<%= name %>PopoverClose`
|
|
19
|
+
|
|
20
|
+
- **Inputs**
|
|
21
|
+
- `<%= name %>PopoverClose`: any - The data to pass to the afterClose event
|
|
22
|
+
- **Exports** - `<%= name %>PopoverClose`
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<div [<%= name %>PopoverTrigger]="popoverTemplate"></div>
|
|
28
|
+
|
|
29
|
+
<ng-template #popoverTemplate>
|
|
30
|
+
<div>
|
|
31
|
+
<h1>Popover</h1>
|
|
32
|
+
</div>
|
|
33
|
+
</ng-template>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
class PopoverComponent {
|
|
38
|
+
readonly popover = popoverPortal();
|
|
39
|
+
readonly popoverTemplate = viewChild<TemplateRef<any>>('popoverTemplate');
|
|
40
|
+
|
|
41
|
+
open() {
|
|
42
|
+
const dialogRef = this.dialog.open(Component, {
|
|
43
|
+
data: {
|
|
44
|
+
message: 'Hello, world!',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
or;
|
|
48
|
+
const dialogRef = this.dialog.open(popoverTemplate, {
|
|
49
|
+
data: {
|
|
50
|
+
message: 'Hello, world!',
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
dialogRef.afterClosed.subscribe(data => {
|
|
55
|
+
console.log(data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Progress } from '@/ui/progress';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-progress`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `value`: number - The value of the progress
|
|
13
|
+
- **Exports** - `<%= name %>Progress`
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<<%= name %>-progress [value]="progress"></<%= name %>-progress>
|
|
19
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
```typescript
|
|
4
|
+
import { Radio, RadioGroup } from '@/ui/radio';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### `<%= name %>-radio-group`
|
|
10
|
+
|
|
11
|
+
- **Inputs**
|
|
12
|
+
- `value`: any - The value of the radio group (2way)
|
|
13
|
+
- **Outputs**
|
|
14
|
+
- `valueChange`: EventEmitter<any> - The event emitter for the value change
|
|
15
|
+
- **Exports** - `<%= name %>RadioGroup`
|
|
16
|
+
|
|
17
|
+
### `<%= name %>-radio`
|
|
18
|
+
|
|
19
|
+
- **Inputs**
|
|
20
|
+
- `value`: any - The value of the radio
|
|
21
|
+
- `disabled`: boolean - Whether the radio is disabled
|
|
22
|
+
- **Exports** - `<%= name %>Radio`
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<<%= name %>-radio-group [(value)]="value">
|
|
28
|
+
<<%= name %>-radio value="1">Radio 1</<%= name %>-radio>
|
|
29
|
+
<<%= name %>-radio value="2">Radio 2</<%= name %>-radio>
|
|
30
|
+
</<%= name %>-radio-group>
|
|
31
|
+
|
|
32
|
+
<<%= name %>-radio-group [(ngModel)]="value">
|
|
33
|
+
<<%= name %>-radio value="1">Radio 1</<%= name %>-radio>
|
|
34
|
+
<<%= name %>-radio value="2">Radio 2</<%= name %>-radio>
|
|
35
|
+
</<%= name %>-radio-group>
|
|
36
|
+
```
|
|
@@ -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
|
+
```
|
|
@@ -14,7 +14,7 @@ import { ListStyle } from '<%= basepath %>/list';
|
|
|
14
14
|
<ng-content />`,
|
|
15
15
|
host: {
|
|
16
16
|
class: 'outline-none',
|
|
17
|
-
'[class.bg-muted]': 'option.active() || option.checked()',
|
|
17
|
+
'[class.bg-muted]': 'option.active() || (!option.multiple() && option.checked())',
|
|
18
18
|
},
|
|
19
19
|
})
|
|
20
20
|
export class Option<T> {
|
|
@@ -24,7 +24,7 @@ export class Option<T> {
|
|
|
24
24
|
@Component({
|
|
25
25
|
selector: '<%= name %>-option-group, [<%= name %>OptionGroup]',
|
|
26
26
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
-
template: `<div class="
|
|
27
|
+
template: `<div class="sticky -top-1 z-10 bg-popover px-2 py-1.5 text-sm text-muted-foreground">
|
|
28
28
|
{{ label() }}
|
|
29
29
|
</div>
|
|
30
30
|
<ng-content />`,
|
|
@@ -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
|
+
```
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
2
2
|
import { NgbSelectable, NgbSelectableItem } from '@ngbase/adk/selectable';
|
|
3
|
+
import { ɵFocusStyle as FocusStyle } from '<%= basepath %>/checkbox';
|
|
3
4
|
|
|
4
5
|
@Component({
|
|
5
6
|
selector: '<%= name %>-selectable-item, [<%= name %>SelectableItem]',
|
|
6
7
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
7
|
-
hostDirectives: [{ directive: NgbSelectableItem, inputs: ['value'] }],
|
|
8
|
+
hostDirectives: [{ directive: NgbSelectableItem, inputs: ['value'] }, FocusStyle],
|
|
8
9
|
template: `<ng-content />`,
|
|
9
10
|
host: {
|
|
10
11
|
class:
|
|
11
|
-
'flex-1 flex items-center font-medium justify-center px-3 py-1.5 cursor-pointer transition-colors rounded-md whitespace-nowrap
|
|
12
|
-
'[class]': `selectable.selected() ? 'bg-background text-primary shadow-md
|
|
12
|
+
'flex-1 flex items-center font-medium justify-center px-3 py-1.5 cursor-pointer transition-colors rounded-md whitespace-nowrap border',
|
|
13
|
+
'[class]': `selectable.selected() ? 'bg-background text-primary shadow-md border-border' : 'opacity-60 border-transparent'`,
|
|
13
14
|
},
|
|
14
15
|
})
|
|
15
16
|
export class SelectableItem<T> {
|
|
@@ -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
|
+
```
|