ngx-kit 6.0.0 → 6.0.2

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 (39) hide show
  1. package/angle-selector/README.md +11 -11
  2. package/box-shadow/README.md +10 -10
  3. package/color-picker/README.md +20 -23
  4. package/data-table/README.md +34 -41
  5. package/date-picker/README.md +21 -26
  6. package/dialog/README.md +31 -33
  7. package/drawer-menu/README.md +51 -50
  8. package/dropzone/README.md +27 -26
  9. package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
  10. package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
  11. package/fesm2022/ngx-kit-color-picker.mjs +2 -2
  12. package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
  13. package/fesm2022/ngx-kit-data-table.mjs +68 -26
  14. package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
  15. package/fesm2022/ngx-kit-dropzone.mjs +3 -3
  16. package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
  17. package/fesm2022/ngx-kit-form-field.mjs +129 -64
  18. package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
  19. package/fesm2022/ngx-kit-gallery.mjs +2 -2
  20. package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
  21. package/fesm2022/ngx-kit-gradient-picker.mjs +2 -2
  22. package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
  23. package/fesm2022/ngx-kit-image-editor.mjs +5 -5
  24. package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
  25. package/fesm2022/ngx-kit-time-picker.mjs +136 -83
  26. package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
  27. package/gallery/README.md +29 -29
  28. package/gradient-picker/README.md +16 -16
  29. package/image-editor/README.md +19 -19
  30. package/menu/README.md +27 -27
  31. package/message/README.md +34 -34
  32. package/notify/README.md +25 -23
  33. package/package.json +1 -1
  34. package/shared/README.md +32 -32
  35. package/time-picker/README.md +95 -0
  36. package/types/ngx-kit-data-table.d.ts +25 -5
  37. package/types/ngx-kit-form-field.d.ts +65 -27
  38. package/types/ngx-kit-image-editor.d.ts +1 -1
  39. package/types/ngx-kit-time-picker.d.ts +28 -24
@@ -1,20 +1,20 @@
1
1
  # ngx-kit/angle-selector
2
2
 
3
- انتخاب‌گر زاویه (۰ تا ۳۶۰ درجه) با یه دستگیره‌ی قابل‌درگِ دایره‌ای — برای تنظیمِ جهتِ گرادیان، چرخشِ سایه، یا هر مقدارِ زاویه‌ای دیگه.
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
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## استفاده
11
+ ## Usage
12
12
 
13
13
  ```html
14
14
  <ngx-input-angle [(ngModel)]="angle"></ngx-input-angle>
15
15
  ```
16
16
 
17
- یا روی یه input معمولی:
17
+ Or on a plain input:
18
18
 
19
19
  ```html
20
20
  <input type="number" [ngxInputAngle]="angle" (change)="angle = $event" />
@@ -22,13 +22,13 @@ npm install ngx-kit
22
22
 
23
23
  ## API
24
24
 
25
- | ورودی | نوع | پیش‌فرض | توضیح |
26
- | --------------------- | ----------------------------- | -------- | -------------------------- |
27
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | تمِ کامپوننت |
28
- | `change` _(دایرکتیو)_ | `EventEmitter<number>` | | زاویه‌ی جدید (بر حسب درجه) |
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
29
 
30
- مقدار همیشه یه عددِ بین `0` تا `360` هست.
30
+ The value is always a number between `0` and `360`.
31
31
 
32
- ## دارک‌مود و RTL
32
+ ## Dark mode and RTL
33
33
 
34
- خودکار پشتیبانی می‌شه. دستگیره با RxJS (`switchMap` + `takeUntil` + `takeUntilDestroyed`) پیاده شده، پس listenerهای درگ فقط دقیقاً حین یه درگِ واقعی فعالن.
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
1
  # ngx-kit/box-shadow
2
2
 
3
- ابزار بصریِ ساختِ `box-shadow`: جابه‌جاییِ سایه با درگِ ماوس/تاچ روی یه صفحه‌ی دوبعدی، به‌همراه کنترلِ بلور، پخش (spread)، و رنگ.
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
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## استفاده
11
+ ## Usage
12
12
 
13
13
  ```html
14
14
  <ngx-box-shadow [(ngModel)]="shadowCss"></ngx-box-shadow>
15
15
  ```
16
16
 
17
- یا روی یه input معمولی:
17
+ Or on a plain input:
18
18
 
19
19
  ```html
20
20
  <input type="text" [ngxInputBoxShadow]="shadowCss" (change)="shadowCss = $event" />
21
21
  ```
22
22
 
23
- خروجی یه رشته‌ی معتبرِ CSS مثل `0px 4px 12px 0px rgba(0,0,0,0.25)` هست.
23
+ The output is a valid CSS string like `0px 4px 12px 0px rgba(0,0,0,0.25)`.
24
24
 
25
25
  ## API
26
26
 
27
- | ورودی | نوع | پیش‌فرض | توضیح |
28
- | --------------------------------- | --------- | ------- | ----------------------------------------- |
29
- | `setInputBackground` _(دایرکتیو)_ | `boolean` | `true` | نمایش رنگِ سایه به‌عنوان پس‌زمینه‌ی input |
27
+ | Input | Type | Default | Description |
28
+ | --- | --- | --- | --- |
29
+ | `setInputBackground` *(directive)* | `boolean` | `true` | Shows the shadow color as the input's background |
30
30
 
31
- ## دارک‌مود و RTL
31
+ ## Dark mode and RTL
32
32
 
33
- خودکار پشتیبانی می‌شه. صفحه‌ی درگِ سایه با Pointer Capture پیاده شده (بدون نیاز به listener سراسری روی document)، پس روی موبایل هم روون کار می‌کنه.
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,25 +1,22 @@
1
1
  # ngx-kit/color-picker
2
2
 
3
- انتخاب‌گر رنگ کامل: پیکر بصری (اشباع/فام)، ورودی RGB/HSL/CMYK/HEX، کانال آلفا، و پشتیبانی از EyeDropper API مرورگر برای برداشتن رنگ از هرجای صفحه.
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
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## استفاده به‌عنوان کامپوننت
11
+ ## Usage as a component
12
12
 
13
13
  ```html
14
- <ngx-input-color
15
- [(ngModel)]="color"
16
- [outputType]="'HEX'"
17
- [defaultInspector]="ColorInspector.Picker"></ngx-input-color>
14
+ <ngx-input-color [(ngModel)]="color" [outputType]="'HEX'" [defaultInspector]="ColorInspector.Picker"></ngx-input-color>
18
15
  ```
19
16
 
20
- `NgxInputColorComponent` یه `ControlValueAccessor` کامله، پس با `ngModel`، `formControl`، `formControlName` همه کار می‌کنه.
17
+ `NgxInputColorComponent` is a full `ControlValueAccessor`, so it works with `ngModel`, `formControl`, and `formControlName`.
21
18
 
22
- ## استفاده به‌عنوان دایرکتیو (روی یه input معمولی)
19
+ ## Usage as a directive (on a plain input)
23
20
 
24
21
  ```html
25
22
  <input type="text" [ngxInputColor]="color" (change)="color = $event" [outputType]="'RGB'" />
@@ -29,24 +26,24 @@ npm install ngx-kit
29
26
 
30
27
  ### `<ngx-input-color>` / `[ngxInputColor]`
31
28
 
32
- | ورودی | نوع | پیش‌فرض | توضیح |
33
- | ------------------------------------------ | ------------------------------------------------- | -------- | ----------------------------------------------------------- |
34
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | `'auto'` یعنی از `prefers-color-scheme` مرورگر پیروی می‌کنه |
35
- | `simpleMode` | `boolean` | `false` | حالت جمع‌وجورتر UI |
36
- | `outputType` | `'HEX' \| 'RGB' \| 'HSL' \| 'HSV' \| 'CMYK'` | `'HEX'` | فرمتِ رشته‌ی خروجی |
37
- | `defaultInspector` | `ColorInspector` (`Picker \| RGB \| HSL \| CMYK`) | `Picker` | تبِ پیش‌فرضِ باز |
38
- | `useAlphaChannel` | `boolean` | `true` | نمایش/عدم‌نمایش کانال شفافیت |
39
- | `setInputBackgroundColor` _(فقط دایرکتیو)_ | `boolean` | `true` | پس‌زمینه‌ی خودِ input رو به رنگ انتخاب‌شده تنظیم می‌کنه |
40
- | `change` _(خروجی، فقط دایرکتیو)_ | `EventEmitter<string>` | | مقدار جدید هر بار که رنگ عوض بشه |
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 |
41
38
 
42
- ### فرمت‌های ورودی/خروجی
39
+ ### Input/output formats
43
40
 
44
- مقدار می‌تونه هر کدوم از این‌ها باشه: `#rrggbb`, `#rrggbbaa` (شامل مخفف ۳ و ۴ کاراکتری با آلفا)، `rgb()`/`rgba()`، `hsl()`/`hsla()`.
41
+ The value can be any of: `#rrggbb`, `#rrggbbaa` (including 3- and 4-character shorthand with alpha), `rgb()`/`rgba()`, `hsl()`/`hsla()`.
45
42
 
46
43
  ## EyeDropper
47
44
 
48
- اگه مرورگر کاربر از [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper) پشتیبانی کنه (کروم/اج جدید)، دکمه‌ی قطره‌چکان خودکار فعال می‌شه و کاربر می‌تونه رنگ رو از هرجای صفحه (حتی بیرون از مرورگر) بردارد. در مرورگرهایی که پشتیبانی نمی‌کنن، این دکمه مخفی می‌مونه.
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.
49
46
 
50
- ## دارک‌مود و RTL
47
+ ## Dark mode and RTL
51
48
 
52
- خودکار پشتیبانی می‌شه.
49
+ Supported automatically.
@@ -1,14 +1,14 @@
1
1
  # ngx-kit/data-table
2
2
 
3
- جدول داده‌ی سیگنال‌محور با تایپ‌سیفتیِ کامل: تعریف ستون‌ها و رندررهای سفارشی طوری تایپ شدن که TypeScript خودش جلوی ستون‌های نامعتبر یا `rendererInputs` غلط رو می‌گیره. سورت (تک/چندستونه)، صفحه‌بندی، حالت lazy (سمت سرور)، و ریسایز ستون با Pointer Capture.
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
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## راه‌اندازی رندررها (اختیاری، ولی توصیه‌شده)
11
+ ## Registering renderers (optional, but recommended)
12
12
 
13
13
  ```ts
14
14
  // app.config.ts
@@ -25,7 +25,7 @@ export const appConfig: ApplicationConfig = {
25
25
  };
26
26
  ```
27
27
 
28
- ## تعریفِ type-safe ستون‌ها
28
+ ## Type-safe column definitions
29
29
 
30
30
  ```ts
31
31
  interface Tenant {
@@ -37,15 +37,15 @@ interface Tenant {
37
37
  const renderers = defineRenderers({ avatar: AvatarCellRenderer, boolean: BooleanCellRenderer });
38
38
 
39
39
  const fields = defineFields<Tenant, typeof renderers>(renderers, [
40
- { column: 'avatarUrl', title: 'کاربر', renderer: 'avatar', rendererInputs: { showName: true } }, // ✅ تایپ‌چک می‌شه
41
- { column: 'name', title: 'نام', sortable: true },
42
- { column: 'isActive', title: 'فعال', renderer: 'boolean', align: 'center' },
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
43
  ]);
44
44
  ```
45
45
 
46
- اگه `column` یه فیلدِ واقعیِ `Tenant` نباشه، یا `renderer` یه کلیدِ واقعیِ رجیستری نباشه، یا `rendererInputs` با ورودی‌های واقعیِ اون رندرر هم‌خونی نداشته باشه — کامپایل خطا می‌ده، نه فقط runtime.
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
47
 
48
- ## استفاده در تمپلیت
48
+ ## Usage in a template
49
49
 
50
50
  ```html
51
51
  <ngx-table
@@ -53,18 +53,14 @@ const fields = defineFields<Tenant, typeof renderers>(renderers, [
53
53
  [data]="tenants"
54
54
  [totalRecords]="tenants.length"
55
55
  [pageSize]="20"
56
- (sortChange)="onSortChange($event)"></ngx-table>
56
+ (sortChange)="onSortChange($event)"
57
+ ></ngx-table>
57
58
  ```
58
59
 
59
- ### حالت lazy (صفحه‌بندی/سورت سمت سرور)
60
+ ### Lazy mode (server-side pagination/sorting)
60
61
 
61
62
  ```html
62
- <ngx-table
63
- [fields]="fields"
64
- [data]="page"
65
- [totalRecords]="total"
66
- [lazy]="true"
67
- (lazyLoad)="fetchPage($event)"></ngx-table>
63
+ <ngx-table [fields]="fields" [data]="page" [totalRecords]="total" [lazy]="true" (lazyLoad)="fetchPage($event)"></ngx-table>
68
64
  ```
69
65
 
70
66
  ```ts
@@ -76,45 +72,42 @@ fetchPage(ev: LazyLoadEvent<Tenant>) {
76
72
 
77
73
  ## API
78
74
 
79
- ### ورودی‌های `<ngx-table>`
75
+ ### `<ngx-table>` inputs
80
76
 
81
- | ورودی | نوع | توضیح |
82
- | ------------------ | --------------------------------- | ------------------------------------------------------------- |
83
- | `fields` | `TableField<T, R>[]` **(اجباری)** | تعریفِ ستون‌ها (از `defineFields`) |
84
- | `data` | `readonly T[]` **(اجباری)** | دیتای صفحه‌ی جاری |
85
- | `totalRecords` | `number` **(اجباری)** | تعداد کل ردیف‌ها (برای صفحه‌بندی) |
86
- | `pageSize` | `number` | پیش‌فرض از `provideTable` |
87
- | `lazy` | `boolean` | اگه `true`، سورت/صفحه‌بندی رو خودِ اپ مدیریت می‌کنه (نه جدول) |
88
- | `loading` | `boolean` | نمایش وضعیتِ بارگذاری |
89
- | `showRecordNumber` | `boolean` | نمایش ستونِ شماره‌ی ردیف |
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 |
90
86
 
91
- ### خروجی‌ها
87
+ ### Outputs
92
88
 
93
- | خروجی | نوع | توضیح |
94
- | -------------- | ---------------------------------- | ----------------------------------------------------------------------------- |
95
- | `sortChange` | `SortMeta<T>[]` | تغییرِ سورت (حالت غیر-lazy) |
96
- | `lazyLoad` | `LazyLoadEvent<T>` | صفحه/سورتِ جدید (حالت lazy) — شاملِ `pageIndex`, `pageSize`, `first`, `sorts` |
97
- | `columnResize` | `{ field: string; width: number }` | تغییرِ عرضِ ستون |
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 |
98
94
 
99
- ### تعریفِ یه رندررِ سفارشی
95
+ ### Defining a custom renderer
100
96
 
101
97
  ```ts
102
98
  @Component({
103
99
  standalone: true,
104
100
  selector: 'app-avatar-cell',
105
- template: `
106
- <img [src]="value()" />
107
- <span *ngIf="showName()">{{ row().name }}</span>
108
- `,
101
+ template: `<img [src]="value()" /><span *ngIf="showName()">{{ row().name }}</span>`,
109
102
  })
110
103
  export class AvatarCellRenderer implements CellRendererComponent<string, Tenant> {
111
104
  value = input.required<string>();
112
105
  row = input.required<Tenant>();
113
106
  field = input.required<TableFieldBase<Tenant>>();
114
- showName = input(false); // این خودکار به rendererInputs اضافه می‌شه
107
+ showName = input(false); // automatically usable in rendererInputs for this column
115
108
  }
116
109
  ```
117
110
 
118
- ## دارک‌مود و RTL
111
+ ## Dark mode and RTL
119
112
 
120
- خودکار پشتیبانی می‌شه.
113
+ Supported automatically.
@@ -1,16 +1,16 @@
1
1
  # ngx-kit/date-picker
2
2
 
3
- انتخاب‌گر تاریخ با پشتیبانی از چهار تقویم: میلادی، جلالی (شمسی)، هجری قمری، و چینی — با یه معماریِ آداپترمحور که اضافه‌کردنِ تقویم‌های دیگه رو هم ممکن می‌کنه. یه کامپوننتِ تقویمِ مستقل (`ngx-calendar`) هم داره که بدون input قابل‌استفاده‌ست.
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
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## راه‌اندازی
11
+ ## Setup
12
12
 
13
- آداپترهای تقویم باید provide بشن (پیش‌فرض هر چهارتاش رو با هم می‌ده؛ اگه فقط بعضی‌هاشون رو لازم دارید، bundle سبک‌تر می‌مونه چون هرکدوم لازی import می‌شن):
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
14
 
15
15
  ```ts
16
16
  // app.config.ts
@@ -21,15 +21,10 @@ export const appConfig: ApplicationConfig = {
21
21
  };
22
22
  ```
23
23
 
24
- ## استفاده
24
+ ## Usage
25
25
 
26
26
  ```html
27
- <input
28
- type="text"
29
- [ngxInputDatePicker]="date"
30
- (change)="date = $event"
31
- [locale]="'fa'"
32
- [displayFormat]="'yyyy/MM/dd'" />
27
+ <input type="text" [ngxInputDatePicker]="date" (change)="date = $event" [locale]="'fa'" [displayFormat]="'yyyy/MM/dd'" />
33
28
  ```
34
29
 
35
30
  ```html
@@ -40,35 +35,35 @@ export const appConfig: ApplicationConfig = {
40
35
 
41
36
  ### `[ngxInputDatePicker]`
42
37
 
43
- | ورودی | نوع | پیش‌فرض | توضیح |
44
- | ------------------ | ----------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------- |
45
- | `locale` | `string` (`'en'`, `'fa'`, `'hi'`, `'zh'`, یا هر لوکیلِ سفارشیِ ثبت‌شده) | `'en'` | تقویمی که استفاده می‌شه |
46
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | |
47
- | `displayFormat` | `string` | `'yyyy/MM/dd'` | فرمتِ نمایشِ متنیِ تاریخ |
48
- | `min` / `max` | `Date` | | محدوده‌ی مجاز |
49
- | `config` | `NgxDatePickerConfig` | | نمایش/متنِ دکمه‌های «امروز»/«پاک کردن»، تمپلیت‌های سفارشیِ آیکون‌ها |
50
- | `change` _(خروجی)_ | `EventEmitter<Date>` | | تاریخِ انتخاب‌شده (همیشه یه شیءِ `Date` استاندارد جاوااسکریپت، مستقل از تقویمِ نمایشی) |
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) |
51
46
 
52
47
  ### `getLocals()`
53
48
 
54
- لیستِ لوکیل‌های فعلاً ثبت‌شده رو برمی‌گردونه (برای مثال برای پرکردنِ یه `<select>` انتخابِ زبان):
49
+ Returns the list of currently registered locales (e.g. to populate a language `<select>`):
55
50
 
56
51
  ```ts
57
52
  availableLocals = getLocals(); // ['en', 'fa', 'hi', 'zh']
58
53
  ```
59
54
 
60
- ### افزودن یه تقویمِ سفارشی
55
+ ### Adding a custom calendar
61
56
 
62
57
  ```ts
63
58
  provideDateAdapters({ locale: 'ja', useClass: MyJapaneseAdapter });
64
59
  ```
65
60
 
66
- `MyJapaneseAdapter` باید اینترفیس `IDateAdapter` رو پیاده کنه.
61
+ `MyJapaneseAdapter` must implement the `IDateAdapter` interface.
67
62
 
68
- ## نکته‌ی پرفورمنس
63
+ ## Performance note
69
64
 
70
- تقویم‌های هجری و چینی (که جدولی/نجومی‌ان، نه فرمولی مثلِ میلادی/جلالی) نتایجِ محاسبات‌شون رو داخلی cache می‌کنن — چون رندر یه ماهِ تقویم، برای هر خانه‌ی روز جدا محاسبه‌ی تاریخ رو صدا می‌زنه؛ بدون کش، این می‌تونست برای سال‌های دور از امروز چند صد میلی‌ثانیه طول بکشه.
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.
71
66
 
72
- ## دارک‌مود و RTL
67
+ ## Dark mode and RTL
73
68
 
74
- خودکار پشتیبانی می‌شه (تقویمِ جلالی/هجری به‌طور طبیعی هم RTL هستن).
69
+ Supported automatically (the Jalali/Hijri calendars are naturally RTL too).
package/dialog/README.md CHANGED
@@ -1,16 +1,14 @@
1
1
  # ngx-kit/dialog
2
2
 
3
- مودال/دیالوگ روی پایه‌ی `<dialog>` بومیِ مرورگر — بدون overlay دستی، بدون کتابخونه‌ی جانبی.
3
+ Modal/dialog built on the browser's native `<dialog>` — no manual overlay, no third-party library.
4
4
 
5
- > ⚠️ اگه نسخه‌ی قبلیِ این README رو دیدید که از `DIALOG_REF` یا `ngx-dialog-header` یا پکیج جدای `ngx-dialog` حرف می‌زد — اون مال یه نسخه‌ی خیلی قدیمی‌تر بوده و با API فعلی هم‌خونی نداره. این نسخه به‌روزه.
6
-
7
- ## نصب
5
+ ## Install
8
6
 
9
7
  ```bash
10
8
  npm install ngx-kit
11
9
  ```
12
10
 
13
- ## راه‌اندازی
11
+ ## Setup
14
12
 
15
13
  ```ts
16
14
  // app.config.ts
@@ -22,9 +20,9 @@ export const appConfig: ApplicationConfig = {
22
20
  };
23
21
  ```
24
22
 
25
- ## باز کردن یه دیالوگ
23
+ ## Opening a dialog
26
24
 
27
- با API استاتیک (بدون تزریق دستیِ سرویس):
25
+ With the static API (no manual service injection needed):
28
26
 
29
27
  ```ts
30
28
  import { Dialog } from 'ngx-kit/dialog';
@@ -33,19 +31,19 @@ const ref = Dialog.open(MyDialogComponent, {
33
31
  data: { userId: 42 },
34
32
  width: '480px',
35
33
  allowCloseOnOutsideClick: true,
36
- header: { enable: true, title: 'ویرایش کاربر', showCloseButton: true },
34
+ header: { enable: true, title: 'Edit user', showCloseButton: true },
37
35
  });
38
36
 
39
- ref.afterClosed.subscribe((result) => console.log('نتیجه:', result));
37
+ ref.afterClosed.subscribe((result) => console.log('Result:', result));
40
38
  ```
41
39
 
42
- داخل کامپوننتِ دیالوگ:
40
+ Inside the dialog's component:
43
41
 
44
42
  ```ts
45
43
  @Component({ ... })
46
44
  export class MyDialogComponent {
47
45
  private ref = inject(NgxDialogRef);
48
- data = inject(NGX_DIALOG_DATA); // دیتایی که با config.data پاس داده شده
46
+ data = inject(NGX_DIALOG_DATA); // the data passed via config.data
49
47
 
50
48
  save() {
51
49
  this.ref.close({ saved: true });
@@ -53,13 +51,13 @@ export class MyDialogComponent {
53
51
  }
54
52
  ```
55
53
 
56
- ### دایرکتیوهای layout داخل دیالوگ
54
+ ### Layout directives inside a dialog
57
55
 
58
56
  ```html
59
- <div *ngxDialogHeader>عنوانِ سفارشی</div>
60
- <div *ngxDialogBody>محتوای اصلی</div>
57
+ <div *ngxDialogHeader>Custom title</div>
58
+ <div *ngxDialogBody>Main content</div>
61
59
  <div *ngxDialogFooter>
62
- <button (click)="save()">ذخیره</button>
60
+ <button (click)="save()">Save</button>
63
61
  </div>
64
62
  ```
65
63
 
@@ -67,28 +65,28 @@ export class MyDialogComponent {
67
65
 
68
66
  ### `Dialog.open<T>(component, config?)`
69
67
 
70
- | فیلدِ `config` | نوع | پیش‌فرض | توضیح |
71
- | ----------------------------------------------------------- | ---------- | ----------- | -------------------------------------------------- |
72
- | `data` | `T` | `{}` | دیتایی که به کامپوننتِ داخلِ دیالوگ پاس داده می‌شه |
73
- | `allowCloseOnOutsideClick` | `boolean` | `false` | بستن با کلیک روی backdrop |
74
- | `containerClass` | `string` | `'ngx-kit'` | کلاسِ اضافی روی container |
75
- | `header.enable` / `header.title` / `header.showCloseButton` | | | تنظیمات هدرِ پیش‌فرض |
76
- | `footer.enable` | `boolean` | | نمایش فوتر پیش‌فرض |
77
- | `width` / `minWidth` / `maxWidth` | `string` | | ابعاد افقی |
78
- | `height` / `minHeight` / `maxHeight` | `string` | | ابعاد عمودی |
79
- | `injector` | `Injector` | | تزریق‌کننده‌ی سفارشی برای کامپوننتِ داخلی |
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 |
80
78
 
81
79
  ### `NgxDialogRef`
82
80
 
83
- | عضو | توضیح |
84
- | ------------------------------ | ----------------------------------------- |
85
- | `close(result?)` | بستن دیالوگ، با ارسال یه نتیجه‌ی اختیاری |
86
- | `afterClosed: Observable<any>` | با `result` صدا زده می‌شه بعد از بسته‌شدن |
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 |
87
85
 
88
- ## نکته‌ی SSR
86
+ ## SSR note
89
87
 
90
- `Dialog.open(...)` یه API استاتیک/سراسریه که برای اپ‌های معمولیِ مرورگری کاملاً امنه. اگه از Angular SSR استفاده می‌کنید، این static instance بینِ درخواست‌های هم‌زمانِ سرور مشترکه — به‌جای API استاتیک، مستقیماً `NgxOverlayService` رو تزریق و ازش استفاده کنید (که per-injector/per-request امنه).
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).
91
89
 
92
- ## دارک‌مود و RTL
90
+ ## Dark mode and RTL
93
91
 
94
- خودکار پشتیبانی می‌شه (`light-dark()` + CSS logical properties).
92
+ Supported automatically (`light-dark()` + CSS logical properties).