ngx-kit 6.2.0 → 7.0.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.
Files changed (71) hide show
  1. package/README.md +3 -3
  2. package/angle-selector/README.md +34 -34
  3. package/box-shadow/README.md +33 -33
  4. package/color-picker/README.md +52 -49
  5. package/data-table/README.md +120 -113
  6. package/date-picker/README.md +74 -69
  7. package/dialog/README.md +92 -92
  8. package/drag-resize/README.md +55 -0
  9. package/drawer-menu/README.md +125 -77
  10. package/dropzone/README.md +422 -422
  11. package/fesm2022/ngx-kit-angle-selector.mjs +2 -2
  12. package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
  13. package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
  14. package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
  15. package/fesm2022/ngx-kit-color-picker.mjs +265 -73
  16. package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
  17. package/fesm2022/ngx-kit-data-table.mjs +2 -2
  18. package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
  19. package/fesm2022/ngx-kit-date-picker.mjs +11 -11
  20. package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
  21. package/fesm2022/ngx-kit-dialog.mjs +3 -3
  22. package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
  23. package/fesm2022/ngx-kit-drag-resize.mjs +1664 -0
  24. package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -0
  25. package/fesm2022/ngx-kit-drawer-menu.mjs +424 -158
  26. package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
  27. package/fesm2022/ngx-kit-dropzone.mjs +2 -2
  28. package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
  29. package/fesm2022/ngx-kit-form-field.mjs +3 -5
  30. package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
  31. package/fesm2022/ngx-kit-gallery.mjs +2 -2
  32. package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
  33. package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
  34. package/fesm2022/ngx-kit-grid-layout.mjs +927 -0
  35. package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -0
  36. package/fesm2022/ngx-kit-image-editor.mjs +2 -2
  37. package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
  38. package/fesm2022/ngx-kit-menu.mjs +8 -8
  39. package/fesm2022/ngx-kit-menu.mjs.map +1 -1
  40. package/fesm2022/ngx-kit-message.mjs +2 -2
  41. package/fesm2022/ngx-kit-message.mjs.map +1 -1
  42. package/fesm2022/ngx-kit-notify.mjs +2 -2
  43. package/fesm2022/ngx-kit-notify.mjs.map +1 -1
  44. package/fesm2022/ngx-kit-shared.mjs +54 -3
  45. package/fesm2022/ngx-kit-shared.mjs.map +1 -1
  46. package/fesm2022/ngx-kit-time-picker.mjs +2 -2
  47. package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
  48. package/fesm2022/ngx-kit-virtual-scroll.mjs +392 -0
  49. package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -0
  50. package/fesm2022/ngx-kit-webflow.mjs +709 -0
  51. package/fesm2022/ngx-kit-webflow.mjs.map +1 -0
  52. package/gallery/README.md +71 -71
  53. package/gradient-picker/README.md +41 -41
  54. package/grid-layout/README.md +64 -0
  55. package/image-editor/README.md +12 -12
  56. package/menu/README.md +85 -85
  57. package/message/README.md +70 -70
  58. package/notify/README.md +56 -58
  59. package/package.json +17 -1
  60. package/shared/README.md +117 -117
  61. package/time-picker/README.md +89 -95
  62. package/types/ngx-kit-color-picker.d.ts +72 -16
  63. package/types/ngx-kit-date-picker.d.ts +2 -1
  64. package/types/ngx-kit-drag-resize.d.ts +368 -0
  65. package/types/ngx-kit-drawer-menu.d.ts +148 -88
  66. package/types/ngx-kit-grid-layout.d.ts +310 -0
  67. package/types/ngx-kit-image-editor.d.ts +1 -1
  68. package/types/ngx-kit-shared.d.ts +12 -1
  69. package/types/ngx-kit-virtual-scroll.d.ts +179 -0
  70. package/types/ngx-kit-webflow.d.ts +286 -0
  71. package/virtual-scroll/README.md +199 -0
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).
@@ -0,0 +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,77 +1,125 @@
1
- # ngx-kit/drawer-menu
2
-
3
- A side drawer menu with 7 different opening/closing effects (from simple to 3D/jelly), 3 behaviors for the page content (overlay/push/reveal), and a responsive default open/closed state based on screen size.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Basic usage
12
-
13
- ```html
14
- <ngx-drawer-menu
15
- side="start"
16
- effect="jelly"
17
- contentBehavior="push"
18
- [width]="280"
19
- [openOnDesktop]="true"
20
- [openOnMobile]="false"
21
- [(open)]="isOpen"
22
- >
23
- <div drawerContent>
24
- <!-- menu content -->
25
- <a routerLink="/home">Home</a>
26
- <a routerLink="/settings">Settings</a>
27
- </div>
28
-
29
- <!-- main page content (default, no select) -->
30
- <router-outlet />
31
- </ngx-drawer-menu>
32
- ```
33
-
34
- ## API
35
-
36
- | Input | Type | Default | Description |
37
- | --- | --- | --- | --- |
38
- | `side` | `'start' \| 'end'` | `'start'` | Logical — automatically flips under RTL |
39
- | `effect` | `'slide' \| 'curtain' \| 'jelly' \| 'pull' \| 'rotate3d' \| 'flip3d' \| 'scale'` | `'slide'` | The panel's own open/close effect (described below) |
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.
1
+ # ngx-kit/drawer-menu
2
+
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
23
+
24
+ ```html
25
+ <ngx-drawer-menu
26
+ side="start"
27
+ mode="push"
28
+ effect="fabric"
29
+ [width]="300"
30
+ [openOnDesktop]="true"
31
+ [openOnMobile]="false"
32
+ [mobileBreakpoint]="960"
33
+ [(open)]="drawerOpen"
34
+ [(pinned)]="drawerPinned">
35
+ <router-outlet />
36
+
37
+ <div drawerContent>
38
+ <!-- navigation -->
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. |
74
+
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">
115
+ <router-outlet />
116
+ <nav drawerContent>...</nav>
117
+ </ngx-drawer-menu>
118
+ ```
119
+
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.