ngx-kit 6.3.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 (67) 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/dropzone/README.md +422 -422
  10. package/fesm2022/ngx-kit-angle-selector.mjs +2 -2
  11. package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
  12. package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
  13. package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
  14. package/fesm2022/ngx-kit-color-picker.mjs +265 -73
  15. package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
  16. package/fesm2022/ngx-kit-data-table.mjs +2 -2
  17. package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
  18. package/fesm2022/ngx-kit-date-picker.mjs +7 -9
  19. package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
  20. package/fesm2022/ngx-kit-dialog.mjs +3 -3
  21. package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
  22. package/fesm2022/ngx-kit-drag-resize.mjs +1664 -0
  23. package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -0
  24. package/fesm2022/ngx-kit-drawer-menu.mjs +389 -285
  25. package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
  26. package/fesm2022/ngx-kit-dropzone.mjs +2 -2
  27. package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
  28. package/fesm2022/ngx-kit-form-field.mjs +3 -5
  29. package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
  30. package/fesm2022/ngx-kit-gallery.mjs +2 -2
  31. package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
  32. package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
  33. package/fesm2022/ngx-kit-grid-layout.mjs +927 -0
  34. package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -0
  35. package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
  36. package/fesm2022/ngx-kit-menu.mjs +8 -8
  37. package/fesm2022/ngx-kit-menu.mjs.map +1 -1
  38. package/fesm2022/ngx-kit-message.mjs.map +1 -1
  39. package/fesm2022/ngx-kit-notify.mjs +2 -2
  40. package/fesm2022/ngx-kit-notify.mjs.map +1 -1
  41. package/fesm2022/ngx-kit-shared.mjs +54 -3
  42. package/fesm2022/ngx-kit-shared.mjs.map +1 -1
  43. package/fesm2022/ngx-kit-time-picker.mjs +2 -2
  44. package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
  45. package/fesm2022/ngx-kit-virtual-scroll.mjs +392 -0
  46. package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -0
  47. package/fesm2022/ngx-kit-webflow.mjs +709 -0
  48. package/fesm2022/ngx-kit-webflow.mjs.map +1 -0
  49. package/gallery/README.md +71 -71
  50. package/gradient-picker/README.md +41 -41
  51. package/grid-layout/README.md +64 -0
  52. package/image-editor/README.md +12 -12
  53. package/menu/README.md +85 -85
  54. package/message/README.md +70 -70
  55. package/notify/README.md +56 -58
  56. package/package.json +17 -1
  57. package/shared/README.md +117 -117
  58. package/time-picker/README.md +89 -95
  59. package/types/ngx-kit-color-picker.d.ts +72 -16
  60. package/types/ngx-kit-drag-resize.d.ts +368 -0
  61. package/types/ngx-kit-drawer-menu.d.ts +135 -86
  62. package/types/ngx-kit-grid-layout.d.ts +310 -0
  63. package/types/ngx-kit-image-editor.d.ts +1 -1
  64. package/types/ngx-kit-shared.d.ts +12 -1
  65. package/types/ngx-kit-virtual-scroll.d.ts +179 -0
  66. package/types/ngx-kit-webflow.d.ts +286 -0
  67. package/virtual-scroll/README.md +199 -0
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # NgxInput
2
-
3
- ## Comming Soon...
1
+ # NgxInput
2
+
3
+ ## Comming Soon...
@@ -1,34 +1,34 @@
1
- # ngx-kit/angle-selector
2
-
3
- An angle picker (0 to 360 degrees) with a draggable circular handle — for setting a gradient's direction, a shadow's rotation, or any other angular value.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <ngx-input-angle [(ngModel)]="angle"></ngx-input-angle>
15
- ```
16
-
17
- Or on a plain input:
18
-
19
- ```html
20
- <input type="number" [ngxInputAngle]="angle" (change)="angle = $event" />
21
- ```
22
-
23
- ## API
24
-
25
- | Input | Type | Default | Description |
26
- | --- | --- | --- | --- |
27
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Component theme |
28
- | `change` *(directive)* | `EventEmitter<number>` | | The new angle (in degrees) |
29
-
30
- The value is always a number between `0` and `360`.
31
-
32
- ## Dark mode and RTL
33
-
34
- Supported automatically. The handle is implemented with RxJS (`switchMap` + `takeUntil` + `takeUntilDestroyed`), so drag listeners are only ever active during an actual drag.
1
+ # ngx-kit/angle-selector
2
+
3
+ An angle picker (0 to 360 degrees) with a draggable circular handle — for setting a gradient's direction, a shadow's rotation, or any other angular value.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <ngx-input-angle [(ngModel)]="angle"></ngx-input-angle>
15
+ ```
16
+
17
+ Or on a plain input:
18
+
19
+ ```html
20
+ <input type="number" [ngxInputAngle]="angle" (change)="angle = $event" />
21
+ ```
22
+
23
+ ## API
24
+
25
+ | Input | Type | Default | Description |
26
+ | ---------------------- | ----------------------------- | -------- | -------------------------- |
27
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Component theme |
28
+ | `change` _(directive)_ | `EventEmitter<number>` | | The new angle (in degrees) |
29
+
30
+ The value is always a number between `0` and `360`.
31
+
32
+ ## Dark mode and RTL
33
+
34
+ Supported automatically. The handle is implemented with RxJS (`switchMap` + `takeUntil` + `takeUntilDestroyed`), so drag listeners are only ever active during an actual drag.
@@ -1,33 +1,33 @@
1
- # ngx-kit/box-shadow
2
-
3
- A visual `box-shadow` builder: drag the shadow's offset on a 2D pad with mouse/touch, plus controls for blur, spread, and color.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage
12
-
13
- ```html
14
- <ngx-box-shadow [(ngModel)]="shadowCss"></ngx-box-shadow>
15
- ```
16
-
17
- Or on a plain input:
18
-
19
- ```html
20
- <input type="text" [ngxInputBoxShadow]="shadowCss" (change)="shadowCss = $event" />
21
- ```
22
-
23
- The output is a valid CSS string like `0px 4px 12px 0px rgba(0,0,0,0.25)`.
24
-
25
- ## API
26
-
27
- | Input | Type | Default | Description |
28
- | --- | --- | --- | --- |
29
- | `setInputBackground` *(directive)* | `boolean` | `true` | Shows the shadow color as the input's background |
30
-
31
- ## Dark mode and RTL
32
-
33
- Supported automatically. The shadow-offset pad is implemented with Pointer Capture (no global `document` listener needed), so it works smoothly on mobile too.
1
+ # ngx-kit/box-shadow
2
+
3
+ A visual `box-shadow` builder: drag the shadow's offset on a 2D pad with mouse/touch, plus controls for blur, spread, and color.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <ngx-box-shadow [(ngModel)]="shadowCss"></ngx-box-shadow>
15
+ ```
16
+
17
+ Or on a plain input:
18
+
19
+ ```html
20
+ <input type="text" [ngxInputBoxShadow]="shadowCss" (change)="shadowCss = $event" />
21
+ ```
22
+
23
+ The output is a valid CSS string like `0px 4px 12px 0px rgba(0,0,0,0.25)`.
24
+
25
+ ## API
26
+
27
+ | Input | Type | Default | Description |
28
+ | ---------------------------------- | --------- | ------- | ------------------------------------------------ |
29
+ | `setInputBackground` _(directive)_ | `boolean` | `true` | Shows the shadow color as the input's background |
30
+
31
+ ## Dark mode and RTL
32
+
33
+ Supported automatically. The shadow-offset pad is implemented with Pointer Capture (no global `document` listener needed), so it works smoothly on mobile too.
@@ -1,49 +1,52 @@
1
- # ngx-kit/color-picker
2
-
3
- A complete color picker: a visual picker (saturation/hue), RGB/HSL/CMYK/HEX inputs, an alpha channel, and support for the browser's EyeDropper API to pick a color from anywhere on the screen.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Usage as a component
12
-
13
- ```html
14
- <ngx-input-color [(ngModel)]="color" [outputType]="'HEX'" [defaultInspector]="ColorInspector.Picker"></ngx-input-color>
15
- ```
16
-
17
- `NgxInputColorComponent` is a full `ControlValueAccessor`, so it works with `ngModel`, `formControl`, and `formControlName`.
18
-
19
- ## Usage as a directive (on a plain input)
20
-
21
- ```html
22
- <input type="text" [ngxInputColor]="color" (change)="color = $event" [outputType]="'RGB'" />
23
- ```
24
-
25
- ## API
26
-
27
- ### `<ngx-input-color>` / `[ngxInputColor]`
28
-
29
- | Input | Type | Default | Description |
30
- | --- | --- | --- | --- |
31
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | `'auto'` follows the browser's `prefers-color-scheme` |
32
- | `simpleMode` | `boolean` | `false` | A more compact UI |
33
- | `outputType` | `'HEX' \| 'RGB' \| 'HSL' \| 'HSV' \| 'CMYK'` | `'HEX'` | Output string format |
34
- | `defaultInspector` | `ColorInspector` (`Picker \| RGB \| HSL \| CMYK`) | `Picker` | Which tab is open by default |
35
- | `useAlphaChannel` | `boolean` | `true` | Show/hide the alpha (transparency) channel |
36
- | `setInputBackgroundColor` *(directive only)* | `boolean` | `true` | Sets the input's own background to the selected color |
37
- | `change` *(output, directive only)* | `EventEmitter<string>` | | The new value whenever the color changes |
38
-
39
- ### Input/output formats
40
-
41
- The value can be any of: `#rrggbb`, `#rrggbbaa` (including 3- and 4-character shorthand with alpha), `rgb()`/`rgba()`, `hsl()`/`hsla()`.
42
-
43
- ## EyeDropper
44
-
45
- If the user's browser supports the [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper) (recent Chrome/Edge), the eyedropper button is enabled automatically and the user can pick a color from anywhere on the page (even outside the browser). On browsers without support, the button stays hidden.
46
-
47
- ## Dark mode and RTL
48
-
49
- Supported automatically.
1
+ # ngx-kit/color-picker
2
+
3
+ A complete color picker: a visual picker (saturation/hue), RGB/HSL/CMYK/HEX inputs, an alpha channel, and support for the browser's EyeDropper API to pick a color from anywhere on the screen.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Usage as a component
12
+
13
+ ```html
14
+ <ngx-input-color
15
+ [(ngModel)]="color"
16
+ [outputType]="'HEX'"
17
+ [defaultInspector]="ColorInspector.Picker"></ngx-input-color>
18
+ ```
19
+
20
+ `NgxInputColorComponent` is a full `ControlValueAccessor`, so it works with `ngModel`, `formControl`, and `formControlName`.
21
+
22
+ ## Usage as a directive (on a plain input)
23
+
24
+ ```html
25
+ <input type="text" [ngxInputColor]="color" (change)="color = $event" [outputType]="'RGB'" />
26
+ ```
27
+
28
+ ## API
29
+
30
+ ### `<ngx-input-color>` / `[ngxInputColor]`
31
+
32
+ | Input | Type | Default | Description |
33
+ | -------------------------------------------- | ------------------------------------------------- | -------- | ----------------------------------------------------- |
34
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | `'auto'` follows the browser's `prefers-color-scheme` |
35
+ | `simpleMode` | `boolean` | `false` | A more compact UI |
36
+ | `outputType` | `'HEX' \| 'RGB' \| 'HSL' \| 'HSV' \| 'CMYK'` | `'HEX'` | Output string format |
37
+ | `defaultInspector` | `ColorInspector` (`Picker \| RGB \| HSL \| CMYK`) | `Picker` | Which tab is open by default |
38
+ | `useAlphaChannel` | `boolean` | `true` | Show/hide the alpha (transparency) channel |
39
+ | `setInputBackgroundColor` _(directive only)_ | `boolean` | `true` | Sets the input's own background to the selected color |
40
+ | `change` _(output, directive only)_ | `EventEmitter<string>` | | The new value whenever the color changes |
41
+
42
+ ### Input/output formats
43
+
44
+ The value can be any of: `#rrggbb`, `#rrggbbaa` (including 3- and 4-character shorthand with alpha), `rgb()`/`rgba()`, `hsl()`/`hsla()`.
45
+
46
+ ## EyeDropper
47
+
48
+ If the user's browser supports the [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper) (recent Chrome/Edge), the eyedropper button is enabled automatically and the user can pick a color from anywhere on the page (even outside the browser). On browsers without support, the button stays hidden.
49
+
50
+ ## Dark mode and RTL
51
+
52
+ Supported automatically.
@@ -1,113 +1,120 @@
1
- # ngx-kit/data-table
2
-
3
- A signal-based data table with full type-safety: column and custom renderer definitions are typed so TypeScript itself catches invalid columns or a wrong `rendererInputs`. Single/multi-column sorting, pagination, lazy (server-side) mode, and column resizing via Pointer Capture.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Registering renderers (optional, but recommended)
12
-
13
- ```ts
14
- // app.config.ts
15
- import { provideTable, defineRenderers } from 'ngx-kit/data-table';
16
- import { AvatarCellRenderer, BooleanCellRenderer } from './cell-renderers';
17
-
18
- export const appConfig: ApplicationConfig = {
19
- providers: [
20
- provideTable({
21
- renderers: defineRenderers({ avatar: AvatarCellRenderer, boolean: BooleanCellRenderer }),
22
- column: { minWidth: 80, maxWidth: 480, defaultWidth: 160 },
23
- }),
24
- ],
25
- };
26
- ```
27
-
28
- ## Type-safe column definitions
29
-
30
- ```ts
31
- interface Tenant {
32
- avatarUrl: string;
33
- name: string;
34
- isActive: boolean;
35
- }
36
-
37
- const renderers = defineRenderers({ avatar: AvatarCellRenderer, boolean: BooleanCellRenderer });
38
-
39
- const fields = defineFields<Tenant, typeof renderers>(renderers, [
40
- { column: 'avatarUrl', title: 'User', renderer: 'avatar', rendererInputs: { showName: true } }, // ✅ type-checked
41
- { column: 'name', title: 'Name', sortable: true },
42
- { column: 'isActive', title: 'Active', renderer: 'boolean', align: 'center' },
43
- ]);
44
- ```
45
-
46
- If `column` isn't a real field of `Tenant`, or `renderer` isn't a real key of the registry, or `rendererInputs` doesn't match that renderer's actual inputs — it's a compile error, not a runtime one.
47
-
48
- ## Usage in a template
49
-
50
- ```html
51
- <ngx-table
52
- [fields]="fields"
53
- [data]="tenants"
54
- [totalRecords]="tenants.length"
55
- [pageSize]="20"
56
- (sortChange)="onSortChange($event)"
57
- ></ngx-table>
58
- ```
59
-
60
- ### Lazy mode (server-side pagination/sorting)
61
-
62
- ```html
63
- <ngx-table [fields]="fields" [data]="page" [totalRecords]="total" [lazy]="true" (lazyLoad)="fetchPage($event)"></ngx-table>
64
- ```
65
-
66
- ```ts
67
- fetchPage(ev: LazyLoadEvent<Tenant>) {
68
- // ev.pageIndex, ev.pageSize, ev.first, ev.sorts
69
- this.api.getTenants(ev).subscribe((res) => { this.page = res.data; this.total = res.total; });
70
- }
71
- ```
72
-
73
- ## API
74
-
75
- ### `<ngx-table>` inputs
76
-
77
- | Input | Type | Description |
78
- | --- | --- | --- |
79
- | `fields` | `TableField<T, R>[]` **(required)** | Column definitions (from `defineFields`) |
80
- | `data` | `readonly T[]` **(required)** | Current page's data |
81
- | `totalRecords` | `number` **(required)** | Total row count (for pagination) |
82
- | `pageSize` | `number` | Defaults from `provideTable` |
83
- | `lazy` | `boolean` | If `true`, your app manages sorting/pagination (not the table) |
84
- | `loading` | `boolean` | Shows a loading state |
85
- | `showRecordNumber` | `boolean` | Shows a row-number column |
86
-
87
- ### Outputs
88
-
89
- | Output | Type | Description |
90
- | --- | --- | --- |
91
- | `sortChange` | `SortMeta<T>[]` | Sort change (non-lazy mode) |
92
- | `lazyLoad` | `LazyLoadEvent<T>` | New page/sort (lazy mode) — includes `pageIndex`, `pageSize`, `first`, `sorts` |
93
- | `columnResize` | `{ field: string; width: number }` | A column's width changed |
94
-
95
- ### Defining a custom renderer
96
-
97
- ```ts
98
- @Component({
99
- standalone: true,
100
- selector: 'app-avatar-cell',
101
- template: `<img [src]="value()" /><span *ngIf="showName()">{{ row().name }}</span>`,
102
- })
103
- export class AvatarCellRenderer implements CellRendererComponent<string, Tenant> {
104
- value = input.required<string>();
105
- row = input.required<Tenant>();
106
- field = input.required<TableFieldBase<Tenant>>();
107
- showName = input(false); // automatically usable in rendererInputs for this column
108
- }
109
- ```
110
-
111
- ## Dark mode and RTL
112
-
113
- Supported automatically.
1
+ # ngx-kit/data-table
2
+
3
+ A signal-based data table with full type-safety: column and custom renderer definitions are typed so TypeScript itself catches invalid columns or a wrong `rendererInputs`. Single/multi-column sorting, pagination, lazy (server-side) mode, and column resizing via Pointer Capture.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Registering renderers (optional, but recommended)
12
+
13
+ ```ts
14
+ // app.config.ts
15
+ import { provideTable, defineRenderers } from 'ngx-kit/data-table';
16
+ import { AvatarCellRenderer, BooleanCellRenderer } from './cell-renderers';
17
+
18
+ export const appConfig: ApplicationConfig = {
19
+ providers: [
20
+ provideTable({
21
+ renderers: defineRenderers({ avatar: AvatarCellRenderer, boolean: BooleanCellRenderer }),
22
+ column: { minWidth: 80, maxWidth: 480, defaultWidth: 160 },
23
+ }),
24
+ ],
25
+ };
26
+ ```
27
+
28
+ ## Type-safe column definitions
29
+
30
+ ```ts
31
+ interface Tenant {
32
+ avatarUrl: string;
33
+ name: string;
34
+ isActive: boolean;
35
+ }
36
+
37
+ const renderers = defineRenderers({ avatar: AvatarCellRenderer, boolean: BooleanCellRenderer });
38
+
39
+ const fields = defineFields<Tenant, typeof renderers>(renderers, [
40
+ { column: 'avatarUrl', title: 'User', renderer: 'avatar', rendererInputs: { showName: true } }, // ✅ type-checked
41
+ { column: 'name', title: 'Name', sortable: true },
42
+ { column: 'isActive', title: 'Active', renderer: 'boolean', align: 'center' },
43
+ ]);
44
+ ```
45
+
46
+ If `column` isn't a real field of `Tenant`, or `renderer` isn't a real key of the registry, or `rendererInputs` doesn't match that renderer's actual inputs — it's a compile error, not a runtime one.
47
+
48
+ ## Usage in a template
49
+
50
+ ```html
51
+ <ngx-table
52
+ [fields]="fields"
53
+ [data]="tenants"
54
+ [totalRecords]="tenants.length"
55
+ [pageSize]="20"
56
+ (sortChange)="onSortChange($event)"></ngx-table>
57
+ ```
58
+
59
+ ### Lazy mode (server-side pagination/sorting)
60
+
61
+ ```html
62
+ <ngx-table
63
+ [fields]="fields"
64
+ [data]="page"
65
+ [totalRecords]="total"
66
+ [lazy]="true"
67
+ (lazyLoad)="fetchPage($event)"></ngx-table>
68
+ ```
69
+
70
+ ```ts
71
+ fetchPage(ev: LazyLoadEvent<Tenant>) {
72
+ // ev.pageIndex, ev.pageSize, ev.first, ev.sorts
73
+ this.api.getTenants(ev).subscribe((res) => { this.page = res.data; this.total = res.total; });
74
+ }
75
+ ```
76
+
77
+ ## API
78
+
79
+ ### `<ngx-table>` inputs
80
+
81
+ | Input | Type | Description |
82
+ | ------------------ | ----------------------------------- | -------------------------------------------------------------- |
83
+ | `fields` | `TableField<T, R>[]` **(required)** | Column definitions (from `defineFields`) |
84
+ | `data` | `readonly T[]` **(required)** | Current page's data |
85
+ | `totalRecords` | `number` **(required)** | Total row count (for pagination) |
86
+ | `pageSize` | `number` | Defaults from `provideTable` |
87
+ | `lazy` | `boolean` | If `true`, your app manages sorting/pagination (not the table) |
88
+ | `loading` | `boolean` | Shows a loading state |
89
+ | `showRecordNumber` | `boolean` | Shows a row-number column |
90
+
91
+ ### Outputs
92
+
93
+ | Output | Type | Description |
94
+ | -------------- | ---------------------------------- | ------------------------------------------------------------------------------ |
95
+ | `sortChange` | `SortMeta<T>[]` | Sort change (non-lazy mode) |
96
+ | `lazyLoad` | `LazyLoadEvent<T>` | New page/sort (lazy mode) — includes `pageIndex`, `pageSize`, `first`, `sorts` |
97
+ | `columnResize` | `{ field: string; width: number }` | A column's width changed |
98
+
99
+ ### Defining a custom renderer
100
+
101
+ ```ts
102
+ @Component({
103
+ standalone: true,
104
+ selector: 'app-avatar-cell',
105
+ template: `
106
+ <img [src]="value()" />
107
+ <span *ngIf="showName()">{{ row().name }}</span>
108
+ `,
109
+ })
110
+ export class AvatarCellRenderer implements CellRendererComponent<string, Tenant> {
111
+ value = input.required<string>();
112
+ row = input.required<Tenant>();
113
+ field = input.required<TableFieldBase<Tenant>>();
114
+ showName = input(false); // automatically usable in rendererInputs for this column
115
+ }
116
+ ```
117
+
118
+ ## Dark mode and RTL
119
+
120
+ Supported automatically.
@@ -1,69 +1,74 @@
1
- # ngx-kit/date-picker
2
-
3
- A date picker supporting four calendar systems: Gregorian, Jalali (Persian), Hijri (Islamic), and Chinese — built on an adapter-based architecture that also makes it possible to add other calendars. It also ships a standalone calendar component (`ngx-calendar`) usable without any inputs.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngx-kit
9
- ```
10
-
11
- ## Setup
12
-
13
- Calendar adapters need to be provided (the default provides all four; if you only need some of them, the bundle stays smaller since each is lazily imported):
14
-
15
- ```ts
16
- // app.config.ts
17
- import { provideDateAdapters } from 'ngx-kit/date-picker';
18
-
19
- export const appConfig: ApplicationConfig = {
20
- providers: [provideDateAdapters()],
21
- };
22
- ```
23
-
24
- ## Usage
25
-
26
- ```html
27
- <input type="text" [ngxInputDatePicker]="date" (change)="date = $event" [locale]="'fa'" [displayFormat]="'yyyy/MM/dd'" />
28
- ```
29
-
30
- ```html
31
- <ngx-calendar [locale]="'fa'" [theme]="'auto'"></ngx-calendar>
32
- ```
33
-
34
- ## API
35
-
36
- ### `[ngxInputDatePicker]`
37
-
38
- | Input | Type | Default | Description |
39
- | --- | --- | --- | --- |
40
- | `locale` | `string` (`'en'`, `'fa'`, `'hi'`, `'zh'`, or any custom registered locale) | `'en'` | Which calendar to use |
41
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | |
42
- | `displayFormat` | `string` | `'yyyy/MM/dd'` | Text display format for the date |
43
- | `min` / `max` | `Date` | | Allowed range |
44
- | `config` | `NgxDatePickerConfig` | | Show/hide and text for the "today"/"clear" buttons, custom icon templates |
45
- | `change` *(output)* | `EventEmitter<Date>` | | The selected date (always a standard JavaScript `Date`, regardless of the displayed calendar) |
46
-
47
- ### `getLocals()`
48
-
49
- Returns the list of currently registered locales (e.g. to populate a language `<select>`):
50
-
51
- ```ts
52
- availableLocals = getLocals(); // ['en', 'fa', 'hi', 'zh']
53
- ```
54
-
55
- ### Adding a custom calendar
56
-
57
- ```ts
58
- provideDateAdapters({ locale: 'ja', useClass: MyJapaneseAdapter });
59
- ```
60
-
61
- `MyJapaneseAdapter` must implement the `IDateAdapter` interface.
62
-
63
- ## Performance note
64
-
65
- The Hijri and Chinese calendars (which are table/astronomical-based, unlike the formulaic Gregorian/Jalali ones) cache their computation results internally — since rendering a calendar month calls the date computation separately for every day cell, without caching this could take several hundred milliseconds for years far from today.
66
-
67
- ## Dark mode and RTL
68
-
69
- Supported automatically (the Jalali/Hijri calendars are naturally RTL too).
1
+ # ngx-kit/date-picker
2
+
3
+ A date picker supporting four calendar systems: Gregorian, Jalali (Persian), Hijri (Islamic), and Chinese — built on an adapter-based architecture that also makes it possible to add other calendars. It also ships a standalone calendar component (`ngx-calendar`) usable without any inputs.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install ngx-kit
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ Calendar adapters need to be provided (the default provides all four; if you only need some of them, the bundle stays smaller since each is lazily imported):
14
+
15
+ ```ts
16
+ // app.config.ts
17
+ import { provideDateAdapters } from 'ngx-kit/date-picker';
18
+
19
+ export const appConfig: ApplicationConfig = {
20
+ providers: [provideDateAdapters()],
21
+ };
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```html
27
+ <input
28
+ type="text"
29
+ [ngxInputDatePicker]="date"
30
+ (change)="date = $event"
31
+ [locale]="'fa'"
32
+ [displayFormat]="'yyyy/MM/dd'" />
33
+ ```
34
+
35
+ ```html
36
+ <ngx-calendar [locale]="'fa'" [theme]="'auto'"></ngx-calendar>
37
+ ```
38
+
39
+ ## API
40
+
41
+ ### `[ngxInputDatePicker]`
42
+
43
+ | Input | Type | Default | Description |
44
+ | ------------------- | -------------------------------------------------------------------------- | -------------- | --------------------------------------------------------------------------------------------- |
45
+ | `locale` | `string` (`'en'`, `'fa'`, `'hi'`, `'zh'`, or any custom registered locale) | `'en'` | Which calendar to use |
46
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | |
47
+ | `displayFormat` | `string` | `'yyyy/MM/dd'` | Text display format for the date |
48
+ | `min` / `max` | `Date` | | Allowed range |
49
+ | `config` | `NgxDatePickerConfig` | | Show/hide and text for the "today"/"clear" buttons, custom icon templates |
50
+ | `change` _(output)_ | `EventEmitter<Date>` | | The selected date (always a standard JavaScript `Date`, regardless of the displayed calendar) |
51
+
52
+ ### `getLocals()`
53
+
54
+ Returns the list of currently registered locales (e.g. to populate a language `<select>`):
55
+
56
+ ```ts
57
+ availableLocals = getLocals(); // ['en', 'fa', 'hi', 'zh']
58
+ ```
59
+
60
+ ### Adding a custom calendar
61
+
62
+ ```ts
63
+ provideDateAdapters({ locale: 'ja', useClass: MyJapaneseAdapter });
64
+ ```
65
+
66
+ `MyJapaneseAdapter` must implement the `IDateAdapter` interface.
67
+
68
+ ## Performance note
69
+
70
+ The Hijri and Chinese calendars (which are table/astronomical-based, unlike the formulaic Gregorian/Jalali ones) cache their computation results internally — since rendering a calendar month calls the date computation separately for every day cell, without caching this could take several hundred milliseconds for years far from today.
71
+
72
+ ## Dark mode and RTL
73
+
74
+ Supported automatically (the Jalali/Hijri calendars are naturally RTL too).