ngx-kit 7.0.0 → 7.1.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/angle-selector/README.md +34 -34
- package/box-shadow/README.md +33 -33
- package/color-picker/README.md +52 -52
- package/data-table/README.md +120 -120
- package/date-picker/README.md +74 -74
- package/dialog/README.md +92 -92
- package/drag-resize/README.md +55 -55
- package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -1
- package/fesm2022/ngx-kit-drawer-menu.mjs +2 -2
- package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
- 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-grid-layout.mjs +108 -41
- package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -1
- package/fesm2022/ngx-kit-infinite-scroll.mjs +467 -0
- package/fesm2022/ngx-kit-infinite-scroll.mjs.map +1 -0
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/fesm2022/ngx-kit-virtual-scroll.mjs +2 -2
- package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngx-kit-webflow.mjs +38 -38
- package/fesm2022/ngx-kit-webflow.mjs.map +1 -1
- package/gallery/README.md +71 -71
- package/gradient-picker/README.md +41 -41
- package/grid-layout/README.md +64 -64
- package/image-editor/README.md +44 -44
- package/infinite-scroll/README.md +252 -0
- package/menu/README.md +85 -85
- package/message/README.md +70 -70
- package/notify/README.md +56 -56
- package/package.json +5 -1
- package/shared/README.md +117 -117
- package/time-picker/README.md +89 -89
- package/types/ngx-kit-grid-layout.d.ts +21 -20
- package/types/ngx-kit-infinite-scroll.d.ts +86 -0
- package/virtual-scroll/README.md +199 -199
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/drag-resize/README.md
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# ngx-kit drag-resize
|
|
2
|
-
|
|
3
|
-
## Design goals
|
|
4
|
-
|
|
5
|
-
The package uses Angular 22 signals and Pointer Events. Dragging and resizing remain transform/pointer based, while drop-list sorting uses live DOM geometry.
|
|
6
|
-
|
|
7
|
-
### Professional drop-list behavior
|
|
8
|
-
|
|
9
|
-
When a drag starts inside a drop list:
|
|
10
|
-
|
|
11
|
-
- the real item remains in its original DOM position as a hidden layout anchor;
|
|
12
|
-
- exactly one placeholder preserves the item's layout space;
|
|
13
|
-
- a fully styled visual clone is moved to `document.body`, so overflow/scroll containers cannot clip the drag;
|
|
14
|
-
- the body preview copies computed styles recursively, including CSS custom properties and descendant styles;
|
|
15
|
-
- entering, leaving and switching lists always disposes the previous placeholder before creating the next one;
|
|
16
|
-
- sorting uses current DOM geometry instead of stale start-of-drag rectangles;
|
|
17
|
-
- `previousIndex` is captured from the origin list and `currentIndex` is the final placeholder position;
|
|
18
|
-
- dropping outside every connected list cancels the drag instead of accidentally committing it;
|
|
19
|
-
- auto-scroll follows the currently hovered drop list.
|
|
20
|
-
|
|
21
|
-
## Basic drop list
|
|
22
|
-
|
|
23
|
-
```html
|
|
24
|
-
<div NgxDropList (drop)="onDrop($event)">
|
|
25
|
-
@for (item of items; track item.id) {
|
|
26
|
-
<article NgxDraggable [data]="item">
|
|
27
|
-
{{ item.name }}
|
|
28
|
-
</article>
|
|
29
|
-
}
|
|
30
|
-
</div>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
For most UIs, wrap related lists in `NgxDropListGroup` so they are connected automatically:
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<div NgxDropListGroup>
|
|
37
|
-
<div NgxDropList>...</div>
|
|
38
|
-
<div NgxDropList>...</div>
|
|
39
|
-
<div NgxDropList>...</div>
|
|
40
|
-
</div>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
The emitted event follows the familiar `previousIndex/currentIndex` model, making it suitable for `moveItemInArray` / `transferArrayItem` style data updates.
|
|
44
|
-
|
|
45
|
-
## Resize
|
|
46
|
-
|
|
47
|
-
```html
|
|
48
|
-
<article
|
|
49
|
-
NgxResizable
|
|
50
|
-
[minWidth]="120"
|
|
51
|
-
[minHeight]="80"
|
|
52
|
-
[directions]="['n','e','s','w','ne','se','sw','nw']"></article>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Resize is pointer based, supports all eight directions, minimum/maximum constraints and optional pixel snapping.
|
|
1
|
+
# ngx-kit drag-resize
|
|
2
|
+
|
|
3
|
+
## Design goals
|
|
4
|
+
|
|
5
|
+
The package uses Angular 22 signals and Pointer Events. Dragging and resizing remain transform/pointer based, while drop-list sorting uses live DOM geometry.
|
|
6
|
+
|
|
7
|
+
### Professional drop-list behavior
|
|
8
|
+
|
|
9
|
+
When a drag starts inside a drop list:
|
|
10
|
+
|
|
11
|
+
- the real item remains in its original DOM position as a hidden layout anchor;
|
|
12
|
+
- exactly one placeholder preserves the item's layout space;
|
|
13
|
+
- a fully styled visual clone is moved to `document.body`, so overflow/scroll containers cannot clip the drag;
|
|
14
|
+
- the body preview copies computed styles recursively, including CSS custom properties and descendant styles;
|
|
15
|
+
- entering, leaving and switching lists always disposes the previous placeholder before creating the next one;
|
|
16
|
+
- sorting uses current DOM geometry instead of stale start-of-drag rectangles;
|
|
17
|
+
- `previousIndex` is captured from the origin list and `currentIndex` is the final placeholder position;
|
|
18
|
+
- dropping outside every connected list cancels the drag instead of accidentally committing it;
|
|
19
|
+
- auto-scroll follows the currently hovered drop list.
|
|
20
|
+
|
|
21
|
+
## Basic drop list
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<div NgxDropList (drop)="onDrop($event)">
|
|
25
|
+
@for (item of items; track item.id) {
|
|
26
|
+
<article NgxDraggable [data]="item">
|
|
27
|
+
{{ item.name }}
|
|
28
|
+
</article>
|
|
29
|
+
}
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For most UIs, wrap related lists in `NgxDropListGroup` so they are connected automatically:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<div NgxDropListGroup>
|
|
37
|
+
<div NgxDropList>...</div>
|
|
38
|
+
<div NgxDropList>...</div>
|
|
39
|
+
<div NgxDropList>...</div>
|
|
40
|
+
</div>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The emitted event follows the familiar `previousIndex/currentIndex` model, making it suitable for `moveItemInArray` / `transferArrayItem` style data updates.
|
|
44
|
+
|
|
45
|
+
## Resize
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<article
|
|
49
|
+
NgxResizable
|
|
50
|
+
[minWidth]="120"
|
|
51
|
+
[minHeight]="80"
|
|
52
|
+
[directions]="['n','e','s','w','ne','se','sw','nw']"></article>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Resize is pointer based, supports all eight directions, minimum/maximum constraints and optional pixel snapping.
|