ngx-kit 7.1.0 → 7.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.
Files changed (73) hide show
  1. package/angle-selector/README.md +34 -34
  2. package/box-shadow/README.md +33 -33
  3. package/color-picker/README.md +52 -52
  4. package/{shared → core}/README.md +117 -117
  5. package/data-table/README.md +120 -120
  6. package/date-picker/README.md +74 -74
  7. package/dialog/README.md +122 -92
  8. package/drag-resize/README.md +53 -55
  9. package/fesm2022/ngx-kit-angle-selector.mjs +9 -26
  10. package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
  11. package/fesm2022/ngx-kit-box-shadow.mjs +330 -356
  12. package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
  13. package/fesm2022/ngx-kit-color-picker.mjs +132 -272
  14. package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
  15. package/fesm2022/{ngx-kit-shared.mjs → ngx-kit-core.mjs} +908 -277
  16. package/fesm2022/ngx-kit-core.mjs.map +1 -0
  17. package/fesm2022/ngx-kit-data-table.mjs +1 -1
  18. package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
  19. package/fesm2022/ngx-kit-date-picker.mjs +34 -22
  20. package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
  21. package/fesm2022/ngx-kit-dialog.mjs +430 -331
  22. package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
  23. package/fesm2022/ngx-kit-drag-resize.mjs +193 -140
  24. package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -1
  25. package/fesm2022/ngx-kit-drawer-menu.mjs +3 -3
  26. package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
  27. package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
  28. package/fesm2022/ngx-kit-form-field.mjs +9 -3
  29. package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
  30. package/fesm2022/ngx-kit-gallery.mjs +3 -3
  31. package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
  32. package/fesm2022/ngx-kit-gradient-picker.mjs +20 -38
  33. package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
  34. package/fesm2022/ngx-kit-grid-layout.mjs +32 -30
  35. package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -1
  36. package/fesm2022/ngx-kit-image-editor.mjs +3 -3
  37. package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
  38. package/fesm2022/ngx-kit-menu.mjs +1 -1
  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 +1 -1
  43. package/fesm2022/ngx-kit-notify.mjs.map +1 -1
  44. package/fesm2022/ngx-kit-time-picker.mjs +1 -1
  45. package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
  46. package/fesm2022/ngx-kit-virtual-scroll.mjs +2 -2
  47. package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -1
  48. package/gallery/README.md +71 -71
  49. package/gradient-picker/README.md +41 -41
  50. package/grid-layout/README.md +64 -64
  51. package/image-editor/README.md +44 -44
  52. package/menu/README.md +85 -85
  53. package/message/README.md +70 -70
  54. package/notify/README.md +56 -56
  55. package/package.json +5 -9
  56. package/time-picker/README.md +89 -89
  57. package/types/ngx-kit-angle-selector.d.ts +13 -16
  58. package/types/ngx-kit-box-shadow.d.ts +37 -95
  59. package/types/ngx-kit-color-picker.d.ts +61 -58
  60. package/types/{ngx-kit-shared.d.ts → ngx-kit-core.d.ts} +194 -34
  61. package/types/ngx-kit-data-table.d.ts +2 -2
  62. package/types/ngx-kit-date-picker.d.ts +15 -12
  63. package/types/ngx-kit-dialog.d.ts +208 -107
  64. package/types/ngx-kit-drag-resize.d.ts +74 -47
  65. package/types/ngx-kit-form-field.d.ts +26 -23
  66. package/types/ngx-kit-gradient-picker.d.ts +4 -7
  67. package/types/ngx-kit-menu.d.ts +1 -1
  68. package/types/ngx-kit-time-picker.d.ts +1 -1
  69. package/virtual-scroll/README.md +199 -199
  70. package/fesm2022/ngx-kit-shared.mjs.map +0 -1
  71. package/fesm2022/ngx-kit-webflow.mjs +0 -709
  72. package/fesm2022/ngx-kit-webflow.mjs.map +0 -1
  73. package/types/ngx-kit-webflow.d.ts +0 -286
package/gallery/README.md CHANGED
@@ -1,71 +1,71 @@
1
- # ngx-kit/gallery
2
-
3
- A professional image viewer: takes a list of images, navigates them with ‹ › buttons (like a carousel), has a fully configurable toolbar (zoom, rotate, download, print, fullscreen), zoom via mouse scroll or two-finger pinch, and panning via drag once zoomed in.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage — directly in the page
12
-
13
- ```html
14
- <ngx-image-viewer [images]="images" [toolbar]="{ print: false }" />
15
- ```
16
-
17
- ```ts
18
- images: NgxImageViewerItem[] = [
19
- { src: '/img/1.jpg', alt: 'Image 1', caption: 'Alborz mountains' },
20
- { src: '/img/2.jpg', alt: 'Image 2' },
21
- ];
22
- ```
23
-
24
- ## Usage — inside a fullscreen dialog
25
-
26
- ```ts
27
- import { NgxImageViewerService } from 'ngx-kit/gallery';
28
-
29
- constructor(private viewer: NgxImageViewerService) {}
30
-
31
- openGallery() {
32
- this.viewer.open(this.images, { startIndex: 0 });
33
- }
34
- ```
35
-
36
- `NgxImageViewerComponent` doesn't depend on any dialog (it only has a `closed` output) — if you want to put it inside your own dialog (e.g. `ngx-kit/dialog`), use the component directly; the service is just a convenience shortcut.
37
-
38
- ## API
39
-
40
- ### `<ngx-image-viewer>`
41
-
42
- | Input | Type | Default | Description |
43
- | ---------------------------------- | ------------------------------------- | ----------------- | --------------------------------------------------- |
44
- | `images` | `NgxImageViewerItem[]` **(required)** | | `{ src, alt?, caption?, downloadFileName? }` |
45
- | `startIndex` | `number` | `0` | |
46
- | `toolbar` | `NgxImageViewerToolbarConfig` | all `true` | Each button can be toggled individually (see below) |
47
- | `minZoom` / `maxZoom` / `zoomStep` | `number` | `1` / `6` / `0.4` | |
48
-
49
- | Output | Type | Description |
50
- | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
51
- | `indexChange` | `number` | The active image changed |
52
- | `closed` | `void` | The user clicked the close button or pressed Esc (the component itself doesn't close anything; that's left to the consumer) |
53
-
54
- ### `NgxImageViewerToolbarConfig`
55
-
56
- `prevNext`, `counter`, `zoomIn`, `zoomOut`, `resetZoom`, `rotateLeft`, `rotateRight`, `download`, `print`, `fullscreen`, `close` — all `boolean`, all default to `true` except `close` (`false`).
57
-
58
- ## Interactions
59
-
60
- | Gesture | Result |
61
- | ------------------------------------------- | ------------------------------------------------------------------- |
62
- | Mouse scroll | Zoom, relative to the point under the cursor (not the image center) |
63
- | Two-finger pinch (touch) | Zoom |
64
- | Drag with mouse or one finger (when zoomed) | Pan |
65
- | ← / → | Previous/next image |
66
- | + / - | Zoom in/out |
67
- | Esc | Emits `closed` |
68
-
69
- ## Dark mode and RTL
70
-
71
- Supported automatically.
1
+ # ngx-kit/gallery
2
+
3
+ A professional image viewer: takes a list of images, navigates them with ‹ › buttons (like a carousel), has a fully configurable toolbar (zoom, rotate, download, print, fullscreen), zoom via mouse scroll or two-finger pinch, and panning via drag once zoomed in.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage — directly in the page
12
+
13
+ ```html
14
+ <ngx-image-viewer [images]="images" [toolbar]="{ print: false }" />
15
+ ```
16
+
17
+ ```ts
18
+ images: NgxImageViewerItem[] = [
19
+ { src: '/img/1.jpg', alt: 'Image 1', caption: 'Alborz mountains' },
20
+ { src: '/img/2.jpg', alt: 'Image 2' },
21
+ ];
22
+ ```
23
+
24
+ ## Usage — inside a fullscreen dialog
25
+
26
+ ```ts
27
+ import { NgxImageViewerService } from 'ngx-kit/gallery';
28
+
29
+ constructor(private viewer: NgxImageViewerService) {}
30
+
31
+ openGallery() {
32
+ this.viewer.open(this.images, { startIndex: 0 });
33
+ }
34
+ ```
35
+
36
+ `NgxImageViewerComponent` doesn't depend on any dialog (it only has a `closed` output) — if you want to put it inside your own dialog (e.g. `ngx-kit/dialog`), use the component directly; the service is just a convenience shortcut.
37
+
38
+ ## API
39
+
40
+ ### `<ngx-image-viewer>`
41
+
42
+ | Input | Type | Default | Description |
43
+ | ---------------------------------- | ------------------------------------- | ----------------- | --------------------------------------------------- |
44
+ | `images` | `NgxImageViewerItem[]` **(required)** | | `{ src, alt?, caption?, downloadFileName? }` |
45
+ | `startIndex` | `number` | `0` | |
46
+ | `toolbar` | `NgxImageViewerToolbarConfig` | all `true` | Each button can be toggled individually (see below) |
47
+ | `minZoom` / `maxZoom` / `zoomStep` | `number` | `1` / `6` / `0.4` | |
48
+
49
+ | Output | Type | Description |
50
+ | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
51
+ | `indexChange` | `number` | The active image changed |
52
+ | `closed` | `void` | The user clicked the close button or pressed Esc (the component itself doesn't close anything; that's left to the consumer) |
53
+
54
+ ### `NgxImageViewerToolbarConfig`
55
+
56
+ `prevNext`, `counter`, `zoomIn`, `zoomOut`, `resetZoom`, `rotateLeft`, `rotateRight`, `download`, `print`, `fullscreen`, `close` — all `boolean`, all default to `true` except `close` (`false`).
57
+
58
+ ## Interactions
59
+
60
+ | Gesture | Result |
61
+ | ------------------------------------------- | ------------------------------------------------------------------- |
62
+ | Mouse scroll | Zoom, relative to the point under the cursor (not the image center) |
63
+ | Two-finger pinch (touch) | Zoom |
64
+ | Drag with mouse or one finger (when zoomed) | Pan |
65
+ | ← / → | Previous/next image |
66
+ | + / - | Zoom in/out |
67
+ | Esc | Emits `closed` |
68
+
69
+ ## Dark mode and RTL
70
+
71
+ Supported automatically.
@@ -1,41 +1,41 @@
1
- # ngx-kit/gradient-picker
2
-
3
- A linear/radial gradient picker with multiple draggable color stops, outputting a ready-to-use CSS string.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <ngx-input-gradient [(ngModel)]="gradientCss"></ngx-input-gradient>
15
- ```
16
-
17
- Or as a directive on a plain input:
18
-
19
- ```html
20
- <input type="text" [ngxInputGradient]="gradientCss" (change)="gradientCss = $event" />
21
- ```
22
-
23
- The output is a valid CSS string like `linear-gradient(90deg, #ff0000 0%, #0000ff 100%)`, ready to use directly in `background`/`background-image`.
24
-
25
- ## API
26
-
27
- | Input | Type | Default | Description |
28
- | ---------------------------------- | ----------------------------- | -------- | ---------------------------------------------------- |
29
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Panel theme |
30
- | `setInputBackground` _(directive)_ | `boolean` | `true` | Sets the input's background to the selected gradient |
31
- | `change` _(directive)_ | `EventEmitter<string>` | | The new gradient string |
32
-
33
- ## UI notes
34
-
35
- - Add a color stop by clicking on the gradient bar; drag to move it.
36
- - Double-click a stop to remove it (or use the delete button if shown).
37
- - Each stop's color is edited with the same `ngx-kit/color-picker` panel (this package depends on it).
38
-
39
- ## Dark mode and RTL
40
-
41
- Supported automatically.
1
+ # ngx-kit/gradient-picker
2
+
3
+ A linear/radial gradient picker with multiple draggable color stops, outputting a ready-to-use CSS string.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <ngx-input-gradient [(ngModel)]="gradientCss"></ngx-input-gradient>
15
+ ```
16
+
17
+ Or as a directive on a plain input:
18
+
19
+ ```html
20
+ <input type="text" [ngxInputGradient]="gradientCss" (change)="gradientCss = $event" />
21
+ ```
22
+
23
+ The output is a valid CSS string like `linear-gradient(90deg, #ff0000 0%, #0000ff 100%)`, ready to use directly in `background`/`background-image`.
24
+
25
+ ## API
26
+
27
+ | Input | Type | Default | Description |
28
+ | ---------------------------------- | ----------------------------- | -------- | ---------------------------------------------------- |
29
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Panel theme |
30
+ | `setInputBackground` _(directive)_ | `boolean` | `true` | Sets the input's background to the selected gradient |
31
+ | `change` _(directive)_ | `EventEmitter<string>` | | The new gradient string |
32
+
33
+ ## UI notes
34
+
35
+ - Add a color stop by clicking on the gradient bar; drag to move it.
36
+ - Double-click a stop to remove it (or use the delete button if shown).
37
+ - Each stop's color is edited with the same `ngx-kit/color-picker` panel (this package depends on it).
38
+
39
+ ## Dark mode and RTL
40
+
41
+ Supported automatically.
@@ -1,64 +1,64 @@
1
- # ngx-kit grid-layout
2
-
3
- ## Angular 22 API
4
-
5
- The rewrite is intentionally signal-first. Inputs use Angular signal inputs, outputs use `output()`, and the grid engine exposes `signal()`/`computed()` state. There is no RxJS-driven layout loop.
6
-
7
- ### Layout modes
8
-
9
- - `flow: 'free'` — the user can place items anywhere in the grid.
10
- - `flow: 'horizontal'` — horizontal-first placement.
11
- - `flow: 'vertical'` — vertical-first placement.
12
- - `compact: 'none'` — preserve empty cells.
13
- - `compact: 'vertical'` — pack upward.
14
- - `compact: 'horizontal'` — pack toward the start edge.
15
- - `compact: 'both'` — perform both passes.
16
-
17
- ### RTL
18
-
19
- Use `[dir]="'rtl'"` or `options.rtl = 'auto'`. Logical `x=0` is always the start-most column. The rendering layer maps that logical coordinate to the physical left/right edge. This keeps persisted layouts direction-independent.
20
-
21
- ### Collision behavior
22
-
23
- `allowOverlap` disables collision resolution. `pushItems` controls whether a dragged/resized item pushes colliding siblings during interaction. The final layout is normalized again when the pointer is released.
24
-
25
- ### Example
26
-
27
- ```html
28
- <ngx-grid-layout
29
- [dir]="direction()"
30
- [options]="{ cols: 12, rowHeight: 48, gap: 8, compact: 'vertical', pushItems: true }"
31
- (layoutChange)="saveLayout($event)">
32
- @for (item of layout(); track item.id) {
33
- <ngx-grid-item [id]="item.id!" [config]="item">
34
- <div class="widget">{{ item.id }}</div>
35
- </ngx-grid-item>
36
- }
37
- </ngx-grid-layout>
38
- ```
39
-
40
- `ngx-grid-item` installs drag and resize behavior on its host. Resize recognizes all eight edges/corners and uses grid snapping supplied by the grid engine.
41
-
42
- > **Note on `[config]="item"` above:** `layout()` is a `computed()` that maps the
43
- > internal item list to a fresh array of fresh objects on every recompute, so
44
- > each item gets a *new* config object reference whenever anything in the grid
45
- > changes — even if the values are identical. `NgxGridItemComponent` and
46
- > `GridLayoutService` are written to tolerate this (they compare configs by
47
- > value before writing to any signal), so this pattern is safe to use as-is.
48
- > If you maintain your own item list instead, prefer keeping a stable object
49
- > reference per item and only replacing it when its values actually change —
50
- > it's cheaper and avoids relying on the library's internal guards.
51
-
52
- # Grid layout API reference
53
-
54
- | Option | Meaning |
55
- | -------------- | ------------------------------------------------- |
56
- | `cols` | Number of logical columns. |
57
- | `rowHeight` | Pixel row height or `fit`. |
58
- | `gap` | Gap between cells in pixels. |
59
- | `flow` | Free, horizontal-first, or vertical-first intent. |
60
- | `compact` | Compaction direction. |
61
- | `allowOverlap` | Allow items to occupy the same cells. |
62
- | `pushItems` | Push siblings away during interaction. |
63
- | `rtl` | `true`, `false`, or `auto`. |
64
- | `animate` | Reserved for the visual animation layer. |
1
+ # ngx-kit grid-layout
2
+
3
+ ## Angular 22 API
4
+
5
+ The rewrite is intentionally signal-first. Inputs use Angular signal inputs, outputs use `output()`, and the grid engine exposes `signal()`/`computed()` state. There is no RxJS-driven layout loop.
6
+
7
+ ### Layout modes
8
+
9
+ - `flow: 'free'` — the user can place items anywhere in the grid.
10
+ - `flow: 'horizontal'` — horizontal-first placement.
11
+ - `flow: 'vertical'` — vertical-first placement.
12
+ - `compact: 'none'` — preserve empty cells.
13
+ - `compact: 'vertical'` — pack upward.
14
+ - `compact: 'horizontal'` — pack toward the start edge.
15
+ - `compact: 'both'` — perform both passes.
16
+
17
+ ### RTL
18
+
19
+ Use `[dir]="'rtl'"` or `options.rtl = 'auto'`. Logical `x=0` is always the start-most column. The rendering layer maps that logical coordinate to the physical left/right edge. This keeps persisted layouts direction-independent.
20
+
21
+ ### Collision behavior
22
+
23
+ `allowOverlap` disables collision resolution. `pushItems` controls whether a dragged/resized item pushes colliding siblings during interaction. The final layout is normalized again when the pointer is released.
24
+
25
+ ### Example
26
+
27
+ ```html
28
+ <ngx-grid-layout
29
+ [dir]="direction()"
30
+ [options]="{ cols: 12, rowHeight: 48, gap: 8, compact: 'vertical', pushItems: true }"
31
+ (layoutChange)="saveLayout($event)">
32
+ @for (item of layout(); track item.id) {
33
+ <ngx-grid-item [id]="item.id!" [config]="item">
34
+ <div class="widget">{{ item.id }}</div>
35
+ </ngx-grid-item>
36
+ }
37
+ </ngx-grid-layout>
38
+ ```
39
+
40
+ `ngx-grid-item` installs drag and resize behavior on its host. Resize recognizes all eight edges/corners and uses grid snapping supplied by the grid engine.
41
+
42
+ > **Note on `[config]="item"` above:** `layout()` is a `computed()` that maps the
43
+ > internal item list to a fresh array of fresh objects on every recompute, so
44
+ > each item gets a _new_ config object reference whenever anything in the grid
45
+ > changes — even if the values are identical. `NgxGridItemComponent` and
46
+ > `GridLayoutService` are written to tolerate this (they compare configs by
47
+ > value before writing to any signal), so this pattern is safe to use as-is.
48
+ > If you maintain your own item list instead, prefer keeping a stable object
49
+ > reference per item and only replacing it when its values actually change —
50
+ > it's cheaper and avoids relying on the library's internal guards.
51
+
52
+ # Grid layout API reference
53
+
54
+ | Option | Meaning |
55
+ | -------------- | ------------------------------------------------- |
56
+ | `cols` | Number of logical columns. |
57
+ | `rowHeight` | Pixel row height or `fit`. |
58
+ | `gap` | Gap between cells in pixels. |
59
+ | `flow` | Free, horizontal-first, or vertical-first intent. |
60
+ | `compact` | Compaction direction. |
61
+ | `allowOverlap` | Allow items to occupy the same cells. |
62
+ | `pushItems` | Push siblings away during interaction. |
63
+ | `rtl` | `true`, `false`, or `auto`. |
64
+ | `animate` | Reserved for the visual animation layer. |
@@ -1,44 +1,44 @@
1
- # ngx-kit/image-editor
2
-
3
- An image editor built on raw Canvas: crop with draggable corner handles, rotation (quick 90° and free), brightness/contrast/saturation, built-in filters (grayscale, sepia, invert), a **real cartoon filter** (posterize + Sobel edge detection, hand-implemented since there's no native equivalent), and output compression with adjustable quality.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <ngx-image-editor [source]="selectedFile" (saved)="onSaved($event)" (cancelled)="onCancelled()" />
15
- ```
16
-
17
- ```ts
18
- onSaved(result: NgxImageEditorResult) {
19
- // result.blob (for uploading), result.dataUrl (for an instant preview), result.width/height
20
- }
21
- ```
22
-
23
- ## API
24
-
25
- | Input | Type | Default | Description |
26
- | ------------------------------------ | ----------------------------------------------- | -------------- | ----------------------------------------------------------- |
27
- | `source` | `File \| Blob \| string \| null` **(required)** | | The source file/blob/data URL |
28
- | `aspectRatio` | `number` | free | Lock the crop's aspect ratio (e.g. `1` for a square avatar) |
29
- | `outputMaxWidth` / `outputMaxHeight` | `number` | unlimited | Resize the final output's dimensions |
30
- | `outputType` | `'image/jpeg' \| 'image/png' \| 'image/webp'` | `'image/jpeg'` | |
31
- | `displayMaxWidth` | `number` | `420` | Max display width for the crop area on screen |
32
-
33
- | Output | Type | Description |
34
- | ----------- | ----------------------------------------------------------- | ----------- |
35
- | `saved` | `NgxImageEditorResult` (`{ blob, dataUrl, width, height }`) | |
36
- | `cancelled` | `void` | |
37
-
38
- ## Internal architecture (why it's fast)
39
-
40
- All live interaction (rotating, moving/resizing the crop box, previewing filters including cartoon) happens on a downscaled copy of the image (max 1200px) — only when you call `save()` is the final render done from the full-resolution original. `brightness`/`contrast`/`saturate`/`grayscale`/`sepia`/`invert` are all implemented with Canvas 2D's native `ctx.filter` (browser-accelerated); only the cartoon filter (which has no native equivalent) is done with separate pixel processing.
41
-
42
- ## Dark mode and RTL
43
-
44
- Supported automatically.
1
+ # ngx-kit/image-editor
2
+
3
+ An image editor built on raw Canvas: crop with draggable corner handles, rotation (quick 90° and free), brightness/contrast/saturation, built-in filters (grayscale, sepia, invert), a **real cartoon filter** (posterize + Sobel edge detection, hand-implemented since there's no native equivalent), and output compression with adjustable quality.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <ngx-image-editor [source]="selectedFile" (saved)="onSaved($event)" (cancelled)="onCancelled()" />
15
+ ```
16
+
17
+ ```ts
18
+ onSaved(result: NgxImageEditorResult) {
19
+ // result.blob (for uploading), result.dataUrl (for an instant preview), result.width/height
20
+ }
21
+ ```
22
+
23
+ ## API
24
+
25
+ | Input | Type | Default | Description |
26
+ | ------------------------------------ | ----------------------------------------------- | -------------- | ----------------------------------------------------------- |
27
+ | `source` | `File \| Blob \| string \| null` **(required)** | | The source file/blob/data URL |
28
+ | `aspectRatio` | `number` | free | Lock the crop's aspect ratio (e.g. `1` for a square avatar) |
29
+ | `outputMaxWidth` / `outputMaxHeight` | `number` | unlimited | Resize the final output's dimensions |
30
+ | `outputType` | `'image/jpeg' \| 'image/png' \| 'image/webp'` | `'image/jpeg'` | |
31
+ | `displayMaxWidth` | `number` | `420` | Max display width for the crop area on screen |
32
+
33
+ | Output | Type | Description |
34
+ | ----------- | ----------------------------------------------------------- | ----------- |
35
+ | `saved` | `NgxImageEditorResult` (`{ blob, dataUrl, width, height }`) | |
36
+ | `cancelled` | `void` | |
37
+
38
+ ## Internal architecture (why it's fast)
39
+
40
+ All live interaction (rotating, moving/resizing the crop box, previewing filters including cartoon) happens on a downscaled copy of the image (max 1200px) — only when you call `save()` is the final render done from the full-resolution original. `brightness`/`contrast`/`saturate`/`grayscale`/`sepia`/`invert` are all implemented with Canvas 2D's native `ctx.filter` (browser-accelerated); only the cartoon filter (which has no native equivalent) is done with separate pixel processing.
41
+
42
+ ## Dark mode and RTL
43
+
44
+ Supported automatically.
package/menu/README.md CHANGED
@@ -1,85 +1,85 @@
1
- # ngx-kit/menu
2
-
3
- Dropdown menu and context (right-click) menu, with smart positioning relative to an anchor (via `ngx-kit/shared`'s `OverlayService`).
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Basic usage (dropdown menu)
12
-
13
- ```ts
14
- import { NgxMenuModule } from 'ngx-kit/menu';
15
-
16
- @Component({
17
- standalone: true,
18
- imports: [NgxMenuModule],
19
- template: `
20
- <button [ngxMenu]="userMenu">Open menu</button>
21
-
22
- <ngx-menu #userMenu="ngxMenu">
23
- <ngx-menu-item (click)="editProfile()">Edit profile</ngx-menu-item>
24
- <ngx-menu-item (click)="logout()">Sign out</ngx-menu-item>
25
- <ngx-menu-divider></ngx-menu-divider>
26
- <ngx-menu-item [ngxMenu]="subMenu">More settings ›</ngx-menu-item>
27
- </ngx-menu>
28
-
29
- <ngx-menu #subMenu="ngxMenu">
30
- <ngx-menu-item>Option A</ngx-menu-item>
31
- <ngx-menu-item>Option B</ngx-menu-item>
32
- </ngx-menu>
33
- `,
34
- })
35
- export class MyComponent {}
36
- ```
37
-
38
- Important: `<ngx-menu>`'s content isn't rendered until it's triggered via `[ngxMenu]` (or `[ngxContextMenu]`) — so you can't use `<ngx-menu>` directly, without a trigger, as an always-visible list (like a sidebar). For that, use a regular list styled similarly.
39
-
40
- Nested menus (submenus) work exactly as shown above, just by putting `[ngxMenu]` on the `<ngx-menu-item>` itself.
41
-
42
- ## Right-click (context) menu
43
-
44
- ```html
45
- <div [ngxContextMenu]="rightClickMenu">Right-click me</div>
46
-
47
- <ngx-menu #rightClickMenu="ngxMenu">
48
- <ngx-menu-item>Copy</ngx-menu-item>
49
- <ngx-menu-item>Paste</ngx-menu-item>
50
- </ngx-menu>
51
- ```
52
-
53
- ## API
54
-
55
- ### `[ngxMenu]` directive
56
-
57
- | Input | Type | Description |
58
- | ----------- | ----------------------------- | ----------------------------------------------------------------------------------------- |
59
- | `ngxMenu` | `NgxMenu \| TemplateRef` | Reference to the menu to open |
60
- | `placement` | `'top' \| 'bottom' \| 'auto'` | Opening direction; defaults to `'auto'` (picked automatically if there isn't enough room) |
61
-
62
- ### `<ngx-menu>`
63
-
64
- | Input | Type | Description |
65
- | ------- | -------- | ---------------------------- |
66
- | `class` | `string` | Extra CSS class on the panel |
67
-
68
- ### Styling
69
-
70
- Via CSS custom properties:
71
-
72
- ```css
73
- ngx-menu {
74
- --ngx-menu-bg: light-dark(#fff, #252425);
75
- --ngx-menu-fg: light-dark(#000, #fff);
76
- --ngx-menu-radius: 10px;
77
- --ngx-menu-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
78
- --ngx-menu-item-padding: 8px 14px;
79
- --ngx-menu-item-hover-bg: #9bc6ff68;
80
- }
81
- ```
82
-
83
- ## Dark mode and RTL
84
-
85
- Both are supported automatically (via `ngx-kit/shared`'s `OverlayService`/`DirectionService` and `light-dark()`); no extra work needed.
1
+ # ngx-kit/menu
2
+
3
+ Dropdown menu and context (right-click) menu, with smart positioning relative to an anchor (via `ngx-kit/core`'s `OverlayService`).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Basic usage (dropdown menu)
12
+
13
+ ```ts
14
+ import { NgxMenuModule } from 'ngx-kit/menu';
15
+
16
+ @Component({
17
+ standalone: true,
18
+ imports: [NgxMenuModule],
19
+ template: `
20
+ <button [ngxMenu]="userMenu">Open menu</button>
21
+
22
+ <ngx-menu #userMenu="ngxMenu">
23
+ <ngx-menu-item (click)="editProfile()">Edit profile</ngx-menu-item>
24
+ <ngx-menu-item (click)="logout()">Sign out</ngx-menu-item>
25
+ <ngx-menu-divider></ngx-menu-divider>
26
+ <ngx-menu-item [ngxMenu]="subMenu">More settings ›</ngx-menu-item>
27
+ </ngx-menu>
28
+
29
+ <ngx-menu #subMenu="ngxMenu">
30
+ <ngx-menu-item>Option A</ngx-menu-item>
31
+ <ngx-menu-item>Option B</ngx-menu-item>
32
+ </ngx-menu>
33
+ `,
34
+ })
35
+ export class MyComponent {}
36
+ ```
37
+
38
+ Important: `<ngx-menu>`'s content isn't rendered until it's triggered via `[ngxMenu]` (or `[ngxContextMenu]`) — so you can't use `<ngx-menu>` directly, without a trigger, as an always-visible list (like a sidebar). For that, use a regular list styled similarly.
39
+
40
+ Nested menus (submenus) work exactly as shown above, just by putting `[ngxMenu]` on the `<ngx-menu-item>` itself.
41
+
42
+ ## Right-click (context) menu
43
+
44
+ ```html
45
+ <div [ngxContextMenu]="rightClickMenu">Right-click me</div>
46
+
47
+ <ngx-menu #rightClickMenu="ngxMenu">
48
+ <ngx-menu-item>Copy</ngx-menu-item>
49
+ <ngx-menu-item>Paste</ngx-menu-item>
50
+ </ngx-menu>
51
+ ```
52
+
53
+ ## API
54
+
55
+ ### `[ngxMenu]` directive
56
+
57
+ | Input | Type | Description |
58
+ | ----------- | ----------------------------- | ----------------------------------------------------------------------------------------- |
59
+ | `ngxMenu` | `NgxMenu \| TemplateRef` | Reference to the menu to open |
60
+ | `placement` | `'top' \| 'bottom' \| 'auto'` | Opening direction; defaults to `'auto'` (picked automatically if there isn't enough room) |
61
+
62
+ ### `<ngx-menu>`
63
+
64
+ | Input | Type | Description |
65
+ | ------- | -------- | ---------------------------- |
66
+ | `class` | `string` | Extra CSS class on the panel |
67
+
68
+ ### Styling
69
+
70
+ Via CSS custom properties:
71
+
72
+ ```css
73
+ ngx-menu {
74
+ --ngx-menu-bg: light-dark(#fff, #252425);
75
+ --ngx-menu-fg: light-dark(#000, #fff);
76
+ --ngx-menu-radius: 10px;
77
+ --ngx-menu-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
78
+ --ngx-menu-item-padding: 8px 14px;
79
+ --ngx-menu-item-hover-bg: #9bc6ff68;
80
+ }
81
+ ```
82
+
83
+ ## Dark mode and RTL
84
+
85
+ Both are supported automatically (via `ngx-kit/core`'s `OverlayService`/`DirectionService` and `light-dark()`); no extra work needed.