ngx-kit 6.1.0 → 6.3.0
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/README.md +3 -3
- package/angle-selector/README.md +34 -34
- package/box-shadow/README.md +33 -33
- package/color-picker/README.md +49 -49
- package/data-table/README.md +113 -113
- package/date-picker/README.md +69 -69
- package/dialog/README.md +92 -92
- package/drawer-menu/README.md +110 -62
- package/dropzone/README.md +422 -422
- package/fesm2022/ngx-kit-angle-selector.mjs +2 -2
- package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
- package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
- package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
- package/fesm2022/ngx-kit-color-picker.mjs +4 -4
- package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-data-table.mjs +2 -2
- package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs +1324 -200
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +2 -2
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drawer-menu.mjs +302 -140
- package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-dropzone.mjs +2 -2
- package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
- package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
- package/fesm2022/ngx-kit-gallery.mjs +2 -2
- package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
- package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-image-editor.mjs +75 -11
- package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
- package/fesm2022/ngx-kit-menu.mjs +8 -8
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs +2 -2
- package/fesm2022/ngx-kit-message.mjs.map +1 -1
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-shared.mjs +2 -2
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/fesm2022/ngx-kit-time-picker.mjs +2 -2
- package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
- package/gallery/README.md +71 -71
- package/gradient-picker/README.md +41 -41
- package/menu/README.md +85 -85
- package/message/README.md +70 -70
- package/notify/README.md +58 -58
- package/package.json +1 -1
- package/shared/README.md +117 -117
- package/time-picker/README.md +95 -95
- package/types/ngx-kit-date-picker.d.ts +303 -36
- package/types/ngx-kit-drawer-menu.d.ts +97 -86
- package/types/ngx-kit-dropzone.d.ts +5 -5
- package/types/ngx-kit-image-editor.d.ts +29 -4
package/dialog/README.md
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
# ngx-kit/dialog
|
|
2
|
-
|
|
3
|
-
Modal/dialog built on the browser's native `<dialog>` — no manual overlay, no third-party library.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install ngx-kit
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Setup
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
// app.config.ts
|
|
15
|
-
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
|
|
16
|
-
import { NgxDialogModule } from 'ngx-kit/dialog';
|
|
17
|
-
|
|
18
|
-
export const appConfig: ApplicationConfig = {
|
|
19
|
-
providers: [importProvidersFrom(NgxDialogModule)],
|
|
20
|
-
};
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Opening a dialog
|
|
24
|
-
|
|
25
|
-
With the static API (no manual service injection needed):
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
import { Dialog } from 'ngx-kit/dialog';
|
|
29
|
-
|
|
30
|
-
const ref = Dialog.open(MyDialogComponent, {
|
|
31
|
-
data: { userId: 42 },
|
|
32
|
-
width: '480px',
|
|
33
|
-
allowCloseOnOutsideClick: true,
|
|
34
|
-
header: { enable: true, title: 'Edit user', showCloseButton: true },
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
ref.afterClosed.subscribe((result) => console.log('Result:', result));
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Inside the dialog's component:
|
|
41
|
-
|
|
42
|
-
```ts
|
|
43
|
-
@Component({ ... })
|
|
44
|
-
export class MyDialogComponent {
|
|
45
|
-
private ref = inject(NgxDialogRef);
|
|
46
|
-
data = inject(NGX_DIALOG_DATA); // the data passed via config.data
|
|
47
|
-
|
|
48
|
-
save() {
|
|
49
|
-
this.ref.close({ saved: true });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Layout directives inside a dialog
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
<div *ngxDialogHeader>Custom title</div>
|
|
58
|
-
<div *ngxDialogBody>Main content</div>
|
|
59
|
-
<div *ngxDialogFooter>
|
|
60
|
-
<button (click)="save()">Save</button>
|
|
61
|
-
</div>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## API
|
|
65
|
-
|
|
66
|
-
### `Dialog.open<T>(component, config?)`
|
|
67
|
-
|
|
68
|
-
| `config` field | Type | Default | Description |
|
|
69
|
-
| --- | --- | --- | --- |
|
|
70
|
-
| `data` | `T` | `{}` | Data passed to the component inside the dialog |
|
|
71
|
-
| `allowCloseOnOutsideClick` | `boolean` | `false` | Close when clicking the backdrop |
|
|
72
|
-
| `containerClass` | `string` | `'ngx-kit'` | Extra class on the container |
|
|
73
|
-
| `header.enable` / `header.title` / `header.showCloseButton` | | | Default header settings |
|
|
74
|
-
| `footer.enable` | `boolean` | | Show the default footer |
|
|
75
|
-
| `width` / `minWidth` / `maxWidth` | `string` | | Horizontal sizing |
|
|
76
|
-
| `height` / `minHeight` / `maxHeight` | `string` | | Vertical sizing |
|
|
77
|
-
| `injector` | `Injector` | | Custom injector for the inner component |
|
|
78
|
-
|
|
79
|
-
### `NgxDialogRef`
|
|
80
|
-
|
|
81
|
-
| Member | Description |
|
|
82
|
-
| --- | --- |
|
|
83
|
-
| `close(result?)` | Closes the dialog, optionally passing back a result |
|
|
84
|
-
| `afterClosed: Observable<any>` | Emits `result` after the dialog closes |
|
|
85
|
-
|
|
86
|
-
## SSR note
|
|
87
|
-
|
|
88
|
-
`Dialog.open(...)` is a static/global API that's perfectly safe for a typical browser app. If you're using Angular SSR, this static instance is shared across concurrent server requests — instead of the static API, inject `NgxOverlayService` directly (which is per-injector/per-request safe).
|
|
89
|
-
|
|
90
|
-
## Dark mode and RTL
|
|
91
|
-
|
|
92
|
-
Supported automatically (`light-dark()` + CSS logical properties).
|
|
1
|
+
# ngx-kit/dialog
|
|
2
|
+
|
|
3
|
+
Modal/dialog built on the browser's native `<dialog>` — no manual overlay, no third-party library.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install ngx-kit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// app.config.ts
|
|
15
|
+
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
|
|
16
|
+
import { NgxDialogModule } from 'ngx-kit/dialog';
|
|
17
|
+
|
|
18
|
+
export const appConfig: ApplicationConfig = {
|
|
19
|
+
providers: [importProvidersFrom(NgxDialogModule)],
|
|
20
|
+
};
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Opening a dialog
|
|
24
|
+
|
|
25
|
+
With the static API (no manual service injection needed):
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { Dialog } from 'ngx-kit/dialog';
|
|
29
|
+
|
|
30
|
+
const ref = Dialog.open(MyDialogComponent, {
|
|
31
|
+
data: { userId: 42 },
|
|
32
|
+
width: '480px',
|
|
33
|
+
allowCloseOnOutsideClick: true,
|
|
34
|
+
header: { enable: true, title: 'Edit user', showCloseButton: true },
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
ref.afterClosed.subscribe((result) => console.log('Result:', result));
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Inside the dialog's component:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
@Component({ ... })
|
|
44
|
+
export class MyDialogComponent {
|
|
45
|
+
private ref = inject(NgxDialogRef);
|
|
46
|
+
data = inject(NGX_DIALOG_DATA); // the data passed via config.data
|
|
47
|
+
|
|
48
|
+
save() {
|
|
49
|
+
this.ref.close({ saved: true });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Layout directives inside a dialog
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div *ngxDialogHeader>Custom title</div>
|
|
58
|
+
<div *ngxDialogBody>Main content</div>
|
|
59
|
+
<div *ngxDialogFooter>
|
|
60
|
+
<button (click)="save()">Save</button>
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### `Dialog.open<T>(component, config?)`
|
|
67
|
+
|
|
68
|
+
| `config` field | Type | Default | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `data` | `T` | `{}` | Data passed to the component inside the dialog |
|
|
71
|
+
| `allowCloseOnOutsideClick` | `boolean` | `false` | Close when clicking the backdrop |
|
|
72
|
+
| `containerClass` | `string` | `'ngx-kit'` | Extra class on the container |
|
|
73
|
+
| `header.enable` / `header.title` / `header.showCloseButton` | | | Default header settings |
|
|
74
|
+
| `footer.enable` | `boolean` | | Show the default footer |
|
|
75
|
+
| `width` / `minWidth` / `maxWidth` | `string` | | Horizontal sizing |
|
|
76
|
+
| `height` / `minHeight` / `maxHeight` | `string` | | Vertical sizing |
|
|
77
|
+
| `injector` | `Injector` | | Custom injector for the inner component |
|
|
78
|
+
|
|
79
|
+
### `NgxDialogRef`
|
|
80
|
+
|
|
81
|
+
| Member | Description |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `close(result?)` | Closes the dialog, optionally passing back a result |
|
|
84
|
+
| `afterClosed: Observable<any>` | Emits `result` after the dialog closes |
|
|
85
|
+
|
|
86
|
+
## SSR note
|
|
87
|
+
|
|
88
|
+
`Dialog.open(...)` is a static/global API that's perfectly safe for a typical browser app. If you're using Angular SSR, this static instance is shared across concurrent server requests — instead of the static API, inject `NgxOverlayService` directly (which is per-injector/per-request safe).
|
|
89
|
+
|
|
90
|
+
## Dark mode and RTL
|
|
91
|
+
|
|
92
|
+
Supported automatically (`light-dark()` + CSS logical properties).
|
package/drawer-menu/README.md
CHANGED
|
@@ -1,77 +1,125 @@
|
|
|
1
1
|
# ngx-kit/drawer-menu
|
|
2
2
|
|
|
3
|
-
A
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
A gesture-first Angular navigation drawer designed for desktop and mobile.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Logical `start` / `end` placement with RTL/LTR support.
|
|
8
|
+
- Mouse + touch + pen drag using Pointer Events.
|
|
9
|
+
- Open from the screen edge when closed.
|
|
10
|
+
- Drag the drawer itself to close it.
|
|
11
|
+
- Live 0..1 gesture progress — effects react while dragging.
|
|
12
|
+
- Fabric / curtain / spring / elastic effects.
|
|
13
|
+
- `overlay`, `push`, and `reveal` content modes.
|
|
14
|
+
- Desktop/mobile responsive state.
|
|
15
|
+
- True docked desktop sidebar: open means it occupies layout space and clicking the page never closes it.
|
|
16
|
+
- Mobile overlay behavior with backdrop and edge swipe.
|
|
17
|
+
- Pin/unpin support.
|
|
18
|
+
- Controlled state with `[(open)]`.
|
|
19
|
+
- Reduced-motion support.
|
|
20
|
+
- Escape and backdrop closing.
|
|
21
|
+
|
|
22
|
+
## Recommended configuration
|
|
12
23
|
|
|
13
24
|
```html
|
|
14
25
|
<ngx-drawer-menu
|
|
15
26
|
side="start"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[width]="
|
|
27
|
+
mode="push"
|
|
28
|
+
effect="fabric"
|
|
29
|
+
[width]="300"
|
|
19
30
|
[openOnDesktop]="true"
|
|
20
31
|
[openOnMobile]="false"
|
|
21
|
-
[
|
|
22
|
-
|
|
32
|
+
[mobileBreakpoint]="960"
|
|
33
|
+
[(open)]="drawerOpen"
|
|
34
|
+
[(pinned)]="drawerPinned">
|
|
35
|
+
<router-outlet />
|
|
36
|
+
|
|
23
37
|
<div drawerContent>
|
|
24
|
-
<!--
|
|
25
|
-
<a routerLink="/home">Home</a>
|
|
26
|
-
<a routerLink="/settings">Settings</a>
|
|
38
|
+
<!-- navigation -->
|
|
27
39
|
</div>
|
|
40
|
+
</ngx-drawer-menu>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Behavior model
|
|
44
|
+
|
|
45
|
+
The drawer owns one continuous `progress` value between `0` and `1`.
|
|
46
|
+
|
|
47
|
+
- `0`: fully closed.
|
|
48
|
+
- `1`: fully open.
|
|
49
|
+
- Pointer dragging directly changes progress.
|
|
50
|
+
- On release, velocity and the configured threshold decide the final state.
|
|
51
|
+
|
|
52
|
+
This is the key to getting a physical-feeling drawer instead of a drawer that simply jumps between CSS classes.
|
|
53
|
+
|
|
54
|
+
## Inputs
|
|
55
|
+
|
|
56
|
+
| Input | Default | Purpose |
|
|
57
|
+
| ------------------- | --------- | ------------------------------------------------------------ |
|
|
58
|
+
| `side` | `start` | Logical drawer side. |
|
|
59
|
+
| `mode` | `overlay` | `overlay`, `push`, or `reveal`. |
|
|
60
|
+
| `effect` | `fabric` | `slide`, `spring`, `fabric`, `curtain`, `elastic`, `reveal`. |
|
|
61
|
+
| `width` | `300` | Drawer width in px. |
|
|
62
|
+
| `maxWidth` | `420` | Safety cap for drawer width. |
|
|
63
|
+
| `edgeSize` | `34` | Edge swipe activation area. |
|
|
64
|
+
| `swipeEnabled` | `true` | Enables gesture interaction. |
|
|
65
|
+
| `backdropClose` | `true` | Close on backdrop press. |
|
|
66
|
+
| `escapeClose` | `true` | Close on Escape. |
|
|
67
|
+
| `open` | `true` | Two-way state via `[(open)]`. |
|
|
68
|
+
| `pinned` | `false` | Persistent drawer state via `[(pinned)]`. |
|
|
69
|
+
| `mobileBreakpoint` | `768` | Mobile breakpoint. |
|
|
70
|
+
| `openOnDesktop` | `true` | State on desktop. |
|
|
71
|
+
| `openOnMobile` | `false` | State on mobile/tablet. |
|
|
72
|
+
| `respondToViewport` | `true` | Enables live responsive switching. |
|
|
73
|
+
| `transitionMs` | `420` | Settle animation duration. |
|
|
28
74
|
|
|
29
|
-
|
|
75
|
+
## Responsive behavior
|
|
76
|
+
|
|
77
|
+
By default:
|
|
78
|
+
|
|
79
|
+
- Desktop >= 768px: open.
|
|
80
|
+
- Mobile < 768px: closed.
|
|
81
|
+
- Crossing the breakpoint updates the drawer live.
|
|
82
|
+
- A pinned drawer is not closed by responsive rules.
|
|
83
|
+
|
|
84
|
+
A full `responsive` object is also available when a single config object is preferable:
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<ngx-drawer-menu
|
|
88
|
+
[responsive]="{
|
|
89
|
+
mode: 'auto',
|
|
90
|
+
breakpoint: 960,
|
|
91
|
+
desktopOpen: true,
|
|
92
|
+
mobileOpen: false,
|
|
93
|
+
respectPinned: true
|
|
94
|
+
}"></ngx-drawer-menu>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Recommended responsive behavior
|
|
98
|
+
|
|
99
|
+
When `respondToViewport` is enabled, the drawer uses a real sidebar on desktop and an overlay drawer on mobile by default:
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<ngx-drawer-menu
|
|
103
|
+
side="start"
|
|
104
|
+
[responsive]="{
|
|
105
|
+
mode: 'auto',
|
|
106
|
+
breakpoint: 960,
|
|
107
|
+
desktopOpen: true,
|
|
108
|
+
mobileOpen: false,
|
|
109
|
+
desktopBehavior: 'dock',
|
|
110
|
+
mobileBehavior: 'overlay',
|
|
111
|
+
respectPinned: true
|
|
112
|
+
}"
|
|
113
|
+
effect="fabric"
|
|
114
|
+
[width]="300">
|
|
30
115
|
<router-outlet />
|
|
116
|
+
<nav drawerContent>...</nav>
|
|
31
117
|
</ngx-drawer-menu>
|
|
32
118
|
```
|
|
33
119
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| `contentBehavior` | `'overlay' \| 'push' \| 'reveal'` | `'overlay'` | How the main page content behaves |
|
|
41
|
-
| `width` | `number` | `280` | Panel width in pixels |
|
|
42
|
-
| `swipeEnabled` | `boolean` | `true` | Open by swiping from the screen edge |
|
|
43
|
-
| `swipeEdgeSize` | `number` | `24` | Width of the invisible edge zone that a swipe can start from |
|
|
44
|
-
| `backdropClose` | `boolean` | `true` | Close on backdrop click (or dimming the content in push/reveal) |
|
|
45
|
-
| `curtainStrips` | `number` | `7` | Only for `effect="curtain"` |
|
|
46
|
-
| `open` | `boolean` (model, two-way) | `false` | Controllable via `[(open)]` |
|
|
47
|
-
| `respondToViewport` | `boolean` | `true` | Crossing `mobileBreakpoint` **live** (not just on first load) syncs `open` with `openOnDesktop`/`openOnMobile` |
|
|
48
|
-
| `openOnDesktop` / `openOnMobile` | `boolean` | `true` / `false` | |
|
|
49
|
-
| `mobileBreakpoint` | `number` | `768` | |
|
|
50
|
-
|
|
51
|
-
### Effects (`effect`)
|
|
52
|
-
|
|
53
|
-
| Value | Description |
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| `slide` | Classic simple slide |
|
|
56
|
-
| `curtain` | Several same-colored vertical strips that collapse with a staggered delay, revealing the content |
|
|
57
|
-
| `jelly` | A multi-stage spring oscillation that settles down (inspired by the [Jelly Slide Menu](https://dribbble.com/shots/2307371) effect) |
|
|
58
|
-
| `pull` | A single rubber-band stretch |
|
|
59
|
-
| `rotate3d` | A 3D rotation around a hinge, like a door opening |
|
|
60
|
-
| `flip3d` | Flips with depth on the Z axis, like a book cover |
|
|
61
|
-
| `scale` | Zooms in from the center with a fade |
|
|
62
|
-
|
|
63
|
-
### Content behavior (`contentBehavior`)
|
|
64
|
-
|
|
65
|
-
| Value | Description |
|
|
66
|
-
| --- | --- |
|
|
67
|
-
| `overlay` | Content stays in place, the drawer floats over it (with a backdrop) |
|
|
68
|
-
| `push` | Content is pushed aside by the drawer's width |
|
|
69
|
-
| `reveal` | Content shrinks/recedes slightly, as if the drawer is revealed behind it (the iOS effect) |
|
|
70
|
-
|
|
71
|
-
## Architecture note: embedding inside a bounded area
|
|
72
|
-
|
|
73
|
-
By default, the drawer takes up the full height of the nearest positioned ancestor (which is what you want for a full app shell). If you want to embed it inside a bounded card/area (not the whole page), just give that container `position: relative` and a defined height — the drawer will automatically confine itself to that box (thanks to the `perspective` it uses for 3D effects, which per the CSS spec creates a containing block for `position:fixed` descendants).
|
|
74
|
-
|
|
75
|
-
## Dark mode and RTL
|
|
76
|
-
|
|
77
|
-
Supported automatically; drag math (which, unlike CSS logical properties, needs the real physical direction) uses the shared `DirectionService`, so it works correctly even with a live `dir` change.
|
|
120
|
+
In this setup:
|
|
121
|
+
|
|
122
|
+
- `>= 960px`: the open drawer is a real docked sidebar; it owns layout width and does not create a backdrop.
|
|
123
|
+
- `< 960px`: the drawer is an overlay; the page is dimmed and clicking the backdrop can close it.
|
|
124
|
+
- On desktop the drawer can still be dragged closed from its full-height edge handle.
|
|
125
|
+
- When closed, the screen edge remains a mouse/touch drag target and opens the drawer.
|