ngx-kit 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) 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 +395 -32
  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 +274 -29
  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 +33 -10
  24. package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
  25. package/fesm2022/ngx-kit-message.mjs +5 -0
  26. package/fesm2022/ngx-kit-message.mjs.map +1 -1
  27. package/fesm2022/ngx-kit-time-picker.mjs +17 -4
  28. package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
  29. package/gallery/README.md +29 -29
  30. package/gradient-picker/README.md +16 -16
  31. package/image-editor/README.md +19 -19
  32. package/menu/README.md +27 -27
  33. package/message/README.md +34 -34
  34. package/notify/README.md +25 -23
  35. package/package.json +1 -1
  36. package/shared/README.md +32 -32
  37. package/time-picker/README.md +95 -0
  38. package/types/ngx-kit-data-table.d.ts +25 -5
  39. package/types/ngx-kit-dropzone.d.ts +129 -18
  40. package/types/ngx-kit-form-field.d.ts +65 -27
  41. package/types/ngx-kit-image-editor.d.ts +23 -3
  42. package/types/ngx-kit-time-picker.d.ts +19 -14
@@ -1,41 +1,41 @@
1
1
  # ngx-kit/gradient-picker
2
2
 
3
- انتخاب‌گر گرادیانِ خطی/شعاعی با چند color-stop قابل‌درگ، خروجیِ رشته‌ی CSS آماده‌ی استفاده.
3
+ A linear/radial gradient picker with multiple draggable color stops, outputting a ready-to-use CSS string.
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-gradient [(ngModel)]="gradientCss"></ngx-input-gradient>
15
15
  ```
16
16
 
17
- یا به‌عنوان دایرکتیو روی یه input معمولی:
17
+ Or as a directive on a plain input:
18
18
 
19
19
  ```html
20
20
  <input type="text" [ngxInputGradient]="gradientCss" (change)="gradientCss = $event" />
21
21
  ```
22
22
 
23
- مقدار خروجی یه رشته‌ی معتبرِ CSS مثل `linear-gradient(90deg, #ff0000 0%, #0000ff 100%)` هست که مستقیم توی `background`/`background-image` قابل‌استفاده‌ست.
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
24
 
25
25
  ## API
26
26
 
27
- | ورودی | نوع | پیش‌فرض | توضیح |
28
- | --------------------------------- | ----------------------------- | -------- | ------------------------------------------------------- |
29
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | تمِ پنل |
30
- | `setInputBackground` _(دایرکتیو)_ | `boolean` | `true` | پس‌زمینه‌ی input رو به گرادیانِ انتخاب‌شده تنظیم می‌کنه |
31
- | `change` _(دایرکتیو)_ | `EventEmitter<string>` | | رشته‌ی گرادیانِ جدید |
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
32
 
33
- ## نکات UI
33
+ ## UI notes
34
34
 
35
- - هر color-stop با کلیک روی نوارِ گرادیان اضافه می‌شه و با درگ جابه‌جا می‌شه.
36
- - برای حذف یه stop، دوبار کلیک روش کنید (یا دکمه‌ی حذف اگه نمایش داده بشه).
37
- - برای تنظیم رنگِ هر stop، از همون پنلِ `ngx-kit/color-picker` استفاده می‌شه (این پکیج بهش وابسته‌ست).
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
38
 
39
- ## دارک‌مود و RTL
39
+ ## Dark mode and RTL
40
40
 
41
- خودکار پشتیبانی می‌شه.
41
+ Supported automatically.
@@ -1,14 +1,14 @@
1
1
  # ngx-kit/image-editor
2
2
 
3
- ویرایشگر تصویر روی پایه‌ی Canvas خام: کراپ با گوشه‌های قابل‌درگ، چرخش (سریع ۹۰° و آزاد)، روشنایی/کنتراست/اشباع، فیلترهای آماده (سیاه‌وسفید، سپیا، معکوس)، یه فیلترِ **کارتونی واقعی** (Posterize + لبه‌یابی Sobel، دستی پیاده‌سازی‌شده چون معادل بومی نداره)، و فشرده‌سازیِ خروجی با کیفیتِ قابل‌تنظیم.
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
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-image-editor [source]="selectedFile" (saved)="onSaved($event)" (cancelled)="onCancelled()" />
@@ -16,29 +16,29 @@ npm install ngx-kit
16
16
 
17
17
  ```ts
18
18
  onSaved(result: NgxImageEditorResult) {
19
- // result.blob (برای آپلود)، result.dataUrl (برای پیش‌نمایش فوری)، result.width/height
19
+ // result.blob (for uploading), result.dataUrl (for an instant preview), result.width/height
20
20
  }
21
21
  ```
22
22
 
23
23
  ## API
24
24
 
25
- | ورودی | نوع | پیش‌فرض | توضیح |
26
- | ------------------------------------ | --------------------------------------------- | -------------- | --------------------------------------------- |
27
- | `source` | `File \| Blob \| string \| null` **(اجباری)** | | فایل/بلاب/data-URL منبع |
28
- | `aspectRatio` | `number` | آزاد | قفلِ نسبتِ کراپ (مثلاً `1` برای آواتار مربعی) |
29
- | `outputMaxWidth` / `outputMaxHeight` | `number` | بدون محدودیت | فشرده‌سازیِ ابعاد در خروجیِ نهایی |
30
- | `outputType` | `'image/jpeg' \| 'image/png' \| 'image/webp'` | `'image/jpeg'` | |
31
- | `displayMaxWidth` | `number` | `420` | حداکثر عرضِ نمایشِ ناحیه‌ی کراپ روی صفحه |
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
32
 
33
- | خروجی | نوع | توضیح |
34
- | ----------- | ----------------------------------------------------------- | ----- |
35
- | `saved` | `NgxImageEditorResult` (`{ blob, dataUrl, width, height }`) | |
36
- | `cancelled` | `void` | |
33
+ | Output | Type | Description |
34
+ | --- | --- | --- |
35
+ | `saved` | `NgxImageEditorResult` (`{ blob, dataUrl, width, height }`) | |
36
+ | `cancelled` | `void` | |
37
37
 
38
- ## معماریِ داخلی (چرا سریعه)
38
+ ## Internal architecture (why it's fast)
39
39
 
40
- تمام تعاملِ زنده (چرخوندن، جابه‌جا/ریسایزِ کراپ‌باکس، پیش‌نمایشِ فیلترها حتی کارتونی) روی یه کپیِ کوچیک‌شده از تصویر (حداکثر ۱۲۰۰px) انجام می‌شه — فقط لحظه‌ی `save()`، رندرِ نهایی از روی تصویرِ اصلیِ کامل انجام می‌شه. `brightness`/`contrast`/`saturate`/`grayscale`/`sepia`/`invert` همه با `ctx.filter` بومیِ Canvas 2D پیاده شدن (شتاب‌دهی‌شده توسطِ مرورگر)؛ فقط فیلترِ کارتونی (که معادلِ بومی نداره) با پردازشِ پیکسلی جداگانه انجام می‌شه.
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
41
 
42
- ## دارک‌مود و RTL
42
+ ## Dark mode and RTL
43
43
 
44
- خودکار پشتیبانی می‌شه.
44
+ Supported automatically.
package/menu/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # ngx-kit/menu
2
2
 
3
- منوی کشویی و منوی راست‌کلیک (context menu)، با موقعیت‌دهیِ هوشمند نسبت به anchor (از `ngx-kit/shared`'s `OverlayService`).
3
+ Dropdown menu and context (right-click) menu, with smart positioning relative to an anchor (via `ngx-kit/shared`'s `OverlayService`).
4
4
 
5
- ## نصب
5
+ ## Install
6
6
 
7
7
  ```bash
8
8
  npm install ngx-kit
9
9
  ```
10
10
 
11
- ## استفاده‌ی پایه (منوی کشویی)
11
+ ## Basic usage (dropdown menu)
12
12
 
13
13
  ```ts
14
14
  import { NgxMenuModule } from 'ngx-kit/menu';
@@ -17,57 +17,57 @@ import { NgxMenuModule } from 'ngx-kit/menu';
17
17
  standalone: true,
18
18
  imports: [NgxMenuModule],
19
19
  template: `
20
- <button [ngxMenu]="userMenu">باز کردن منو</button>
20
+ <button [ngxMenu]="userMenu">Open menu</button>
21
21
 
22
22
  <ngx-menu #userMenu="ngxMenu">
23
- <ngx-menu-item (click)="editProfile()">ویرایش پروفایل</ngx-menu-item>
24
- <ngx-menu-item (click)="logout()">خروج</ngx-menu-item>
23
+ <ngx-menu-item (click)="editProfile()">Edit profile</ngx-menu-item>
24
+ <ngx-menu-item (click)="logout()">Sign out</ngx-menu-item>
25
25
  <ngx-menu-divider></ngx-menu-divider>
26
- <ngx-menu-item [ngxMenu]="subMenu">تنظیمات بیشتر ›</ngx-menu-item>
26
+ <ngx-menu-item [ngxMenu]="subMenu">More settings ›</ngx-menu-item>
27
27
  </ngx-menu>
28
28
 
29
29
  <ngx-menu #subMenu="ngxMenu">
30
- <ngx-menu-item>گزینه‌ی الف</ngx-menu-item>
31
- <ngx-menu-item>گزینه‌ی ب</ngx-menu-item>
30
+ <ngx-menu-item>Option A</ngx-menu-item>
31
+ <ngx-menu-item>Option B</ngx-menu-item>
32
32
  </ngx-menu>
33
33
  `,
34
34
  })
35
35
  export class MyComponent {}
36
36
  ```
37
37
 
38
- نکته‌ی مهم: محتوای `<ngx-menu>` تا وقتی از طریق `[ngxMenu]` (یا `[ngxContextMenu]`) trigger نشه رندر نمی‌شه — یعنی `<ngx-menu>` رو نمی‌شه مستقیم و بدون یه trigger، به‌عنوان یه لیستِ همیشه-نمایان (مثل یه سایدبار) استفاده کرد؛ برای اون منظور از یه لیست معمولی با استایل مشابه استفاده کنید.
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
39
 
40
- منوی تودرتو (زیرمنو) هم همون‌طور که بالا دیدید، فقط با گذاشتن `[ngxMenu]` روی خودِ `<ngx-menu-item>` کار می‌کنه.
40
+ Nested menus (submenus) work exactly as shown above, just by putting `[ngxMenu]` on the `<ngx-menu-item>` itself.
41
41
 
42
- ## منوی راست‌کلیک
42
+ ## Right-click (context) menu
43
43
 
44
44
  ```html
45
- <div [ngxContextMenu]="rightClickMenu">راست‌کلیک کن روی من</div>
45
+ <div [ngxContextMenu]="rightClickMenu">Right-click me</div>
46
46
 
47
47
  <ngx-menu #rightClickMenu="ngxMenu">
48
- <ngx-menu-item>کپی</ngx-menu-item>
49
- <ngx-menu-item>چسباندن</ngx-menu-item>
48
+ <ngx-menu-item>Copy</ngx-menu-item>
49
+ <ngx-menu-item>Paste</ngx-menu-item>
50
50
  </ngx-menu>
51
51
  ```
52
52
 
53
53
  ## API
54
54
 
55
- ### دایرکتیو `[ngxMenu]`
55
+ ### `[ngxMenu]` directive
56
56
 
57
- | ورودی | نوع | توضیح |
58
- | ----------- | ----------------------------- | -------------------------------------------------------------------- |
59
- | `ngxMenu` | `NgxMenu \| TemplateRef` | رفرنسِ منویی که باید باز بشه |
60
- | `placement` | `'top' \| 'bottom' \| 'auto'` | جهتِ باز شدن؛ پیش‌فرض `'auto'` (خودکار انتخاب می‌شه اگه فضا کم باشه) |
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
61
 
62
62
  ### `<ngx-menu>`
63
63
 
64
- | ورودی | نوع | توضیح |
65
- | ------- | -------- | ----------------------- |
66
- | `class` | `string` | کلاسِ CSS اضافی روی پنل |
64
+ | Input | Type | Description |
65
+ | --- | --- | --- |
66
+ | `class` | `string` | Extra CSS class on the panel |
67
67
 
68
- ### شخصی‌سازی ظاهر
68
+ ### Styling
69
69
 
70
- از طریق CSS custom properties:
70
+ Via CSS custom properties:
71
71
 
72
72
  ```css
73
73
  ngx-menu {
@@ -80,6 +80,6 @@ ngx-menu {
80
80
  }
81
81
  ```
82
82
 
83
- ## دارک‌مود و RTL
83
+ ## Dark mode and RTL
84
84
 
85
- هر دو خودکار پشتیبانی می‌شن (از طریق `ngx-kit/shared`'s `OverlayService`/`DirectionService` و `light-dark()`)؛ کار اضافه‌ای لازم نیست.
85
+ Both are supported automatically (via `ngx-kit/shared`'s `OverlayService`/`DirectionService` and `light-dark()`); no extra work needed.
package/message/README.md CHANGED
@@ -1,70 +1,70 @@
1
1
  # ngx-kit/message
2
2
 
3
- دیالوگ‌های alert/confirm (شبیه SweetAlert)، با API استاتیک قابل‌فراخوانی از هرجای اپ.
3
+ Alert/confirm dialogs (SweetAlert-style), with a static API callable from anywhere in the app.
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
- ``` typescript
13
+ ```ts
14
14
  // app.config.ts
15
15
  import { provideMessage } from 'ngx-kit/message';
16
16
 
17
17
  export const appConfig: ApplicationConfig = {
18
- providers: [provideMessage({ confirmButtonText: 'باشه' /* پیش‌فرض‌های سراسری */ })],
18
+ providers: [provideMessage({ confirmButtonText: 'OK' /* global defaults */ })],
19
19
  };
20
20
  ```
21
21
 
22
- ## استفاده
22
+ ## Usage
23
23
 
24
24
  ```ts
25
25
  import { MSG } from 'ngx-kit/message';
26
26
 
27
- MSG.success('ذخیره شد!', 'تغییرات با موفقیت ثبت شدن.');
28
- MSG.error('خطا', 'مشکلی پیش اومد.');
29
- MSG.warning('هشدار', 'مطمئنید؟');
30
- MSG.info('اطلاع', 'این یه پیامِ اطلاعاتیه.');
31
- MSG.question('سؤال', 'ادامه بدیم؟');
32
- MSG.loading('در حال پردازش…');
27
+ MSG.success('Saved!', 'Your changes were saved successfully.');
28
+ MSG.error('Error', 'Something went wrong.');
29
+ MSG.warning('Warning', 'Are you sure?');
30
+ MSG.info('Heads up', 'This is an informational message.');
31
+ MSG.question('Question', 'Continue?');
32
+ MSG.loading('Processing…');
33
33
 
34
- // کنترلِ کامل روی گزینه‌ها:
34
+ // full control over options:
35
35
  const result = MSG.show({
36
- title: 'حذف شود؟',
37
- text: 'این عمل قابل بازگشت نیست.',
36
+ title: 'Delete this?',
37
+ text: 'This action cannot be undone.',
38
38
  showCancelButton: true,
39
39
  showDenyButton: true,
40
- confirmButtonText: 'بله، حذف کن',
40
+ confirmButtonText: 'Yes, delete it',
41
41
  });
42
42
  result.afterClose.subscribe((r) => console.log(r));
43
43
  ```
44
44
 
45
45
  ## API
46
46
 
47
- ### `MSG` (و alias آن `Modal`)
47
+ ### `MSG` (and its alias `Modal`)
48
48
 
49
- | متد | امضا | توضیح |
50
- | ----------------------------------------------------------------- | -------------------------- | --------------- |
51
- | `show(options?)` | `IMessageOptions` | کنترلِ کامل |
52
- | `info` / `success` / `warning` / `error` / `question` / `loading` | `(title, text?, options?)` | میان‌برهای رایج |
49
+ | Method | Signature | Description |
50
+ | --- | --- | --- |
51
+ | `show(options?)` | `IMessageOptions` | Full control |
52
+ | `info` / `success` / `warning` / `error` / `question` / `loading` | `(title, text?, options?)` | Common shortcuts |
53
53
 
54
- ### `IMessageOptions` (مهم‌ترین فیلدها)
54
+ ### `IMessageOptions` (key fields)
55
55
 
56
- | فیلد | نوع | پیش‌فرض | توضیح |
57
- | ----------------------------------------------------------- | ------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------- |
58
- | `title` / `text` / `html` | `string` | | محتوا (`html` سنیتایز نمی‌شه — مسئولیتِ escape با خودتونه) |
59
- | `icon` | `MessageIcon` | | آیکونِ نمایشی |
60
- | `showConfirmButton` / `showDenyButton` / `showCancelButton` | `boolean` | `true` / `false` / `false` | |
61
- | `confirmButtonText` / `denyButtonText` / `cancelButtonText` | `string` | `'OK'` / `'No'` / `'Cancel'` | |
62
- | `allowOutsideClick` / `allowEscapeKey` / `allowEnterKey` | `boolean` | `true` | نحوه‌ی بستنِ پیام |
63
- | `showCloseButton` | `boolean` | `false` | دکمه‌ی ✕ |
64
- | `useOverlay` | `boolean` | | برای وقتی که داخل یه دیالوگِ دیگه (مثلاً Angular Material) استفاده می‌شه، لایه‌ی نمایشی رو به بالاترین سطح می‌بره |
56
+ | Field | Type | Default | Description |
57
+ | --- | --- | --- | --- |
58
+ | `title` / `text` / `html` | `string` | | Content (`html` is not sanitized — escaping is your responsibility) |
59
+ | `icon` | `MessageIcon` | | Icon shown |
60
+ | `showConfirmButton` / `showDenyButton` / `showCancelButton` | `boolean` | `true` / `false` / `false` | |
61
+ | `confirmButtonText` / `denyButtonText` / `cancelButtonText` | `string` | `'OK'` / `'No'` / `'Cancel'` | |
62
+ | `allowOutsideClick` / `allowEscapeKey` / `allowEnterKey` | `boolean` | `true` | How the message can be dismissed |
63
+ | `showCloseButton` | `boolean` | `false` | The ✕ button |
64
+ | `useOverlay` | `boolean` | | For when it's used inside another dialog (e.g. Angular Material), raises the display layer to the top |
65
65
 
66
- اگه چند پیام هم‌زمان باز باشن، Escape/Enter فقط روی **آخرین (بالاترین) پیام** اثر می‌کنه، نه همه‌شون.
66
+ If several messages are open at once, Escape/Enter only affect the **last (topmost) message**, not all of them.
67
67
 
68
- ## دارک‌مود و RTL
68
+ ## Dark mode and RTL
69
69
 
70
- خودکار پشتیبانی می‌شه.
70
+ Supported automatically.
package/notify/README.md CHANGED
@@ -1,56 +1,58 @@
1
1
  # ngx-kit/notify
2
2
 
3
- نوتیفیکیشن/toast گوشه‌ی صفحه، با API استاتیک، صف‌بندیِ خودکار (وقتی تعداد از حد مجاز بیشتر بشه)، و مکث‌کردنِ تایمر روی هاور.
3
+ Corner toast notifications, with a static API, automatic queueing (once the visible count exceeds the limit), and the timer pausing on hover.
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
13
  ```ts
14
14
  // app.config.ts
15
15
  import { provideNotify } from 'ngx-kit/notify';
16
16
 
17
17
  export const appConfig: ApplicationConfig = {
18
- providers: [provideNotify({ timeout: 4000, position: 'top-center', dismissible: true })],
18
+ providers: [
19
+ provideNotify({ timeout: 4000, position: 'top-center', dismissible: true }),
20
+ ],
19
21
  };
20
22
  ```
21
23
 
22
- ## استفاده
24
+ ## Usage
23
25
 
24
26
  ```ts
25
27
  import { Notify } from 'ngx-kit/notify';
26
28
 
27
- Notify.success('ذخیره شد');
28
- Notify.error('پیام رو نتونستیم ارسال کنیم', 'دوباره تلاش کنید');
29
- Notify.warning('اتصال ضعیف است');
30
- Notify.info('نسخه‌ی جدید موجوده', undefined, { timeout: 8000 });
29
+ Notify.success('Saved');
30
+ Notify.error('We couldn\'t send your message', 'Try again');
31
+ Notify.warning('Weak connection');
32
+ Notify.info('A new version is available', undefined, { timeout: 8000 });
31
33
  ```
32
34
 
33
35
  ## API
34
36
 
35
37
  ### `Notify`
36
38
 
37
- | متد | امضا |
38
- | --------------------------------------------- | --------------------------------------------------- |
39
+ | Method | Signature |
40
+ | --- | --- |
39
41
  | `show(type, message, description?, options?)` | `type: 'info' \| 'success' \| 'warning' \| 'error'` |
40
- | `info` / `success` / `warning` / `error` | `(message, description?, options?)` |
42
+ | `info` / `success` / `warning` / `error` | `(message, description?, options?)` |
41
43
 
42
44
  ### `NgxNotifyOptions`
43
45
 
44
- | فیلد | نوع | پیش‌فرض | توضیح |
45
- | -------------- | ----------------------- | -------------- | ---------------------------------------------------------- |
46
- | `timeout` | `number` (ms) | `3000` | مدتِ نمایش قبل از بسته‌شدنِ خودکار |
47
- | `position` | `NgxNotifyPositionType` | `'top-center'` | گوشه/مرکزِ نمایش |
48
- | `maxVisible` | `number` | `10` | بیشتر از این تعداد صف می‌شن، نه هم‌پوشانی |
49
- | `allowHtml` | `boolean` | `false` | اگه `true`، پیام به‌عنوان HTML رندر می‌شه (سنیتایز نمی‌شه) |
50
- | `pauseOnHover` | `boolean` | `true` | تایمر با هاور موس متوقف می‌شه |
51
- | `dismissible` | `boolean` | `true` | نمایشِ دکمه‌ی بستن |
52
- | `closeOnTap` | `boolean` | `true` | با کلیک روی خودِ نوتیفیکیشن بسته بشه |
46
+ | Field | Type | Default | Description |
47
+ | --- | --- | --- | --- |
48
+ | `timeout` | `number` (ms) | `3000` | How long it's shown before auto-dismissing |
49
+ | `position` | `NgxNotifyPositionType` | `'top-center'` | Corner/center to display in |
50
+ | `maxVisible` | `number` | `10` | Beyond this count, notifications queue instead of overlapping |
51
+ | `allowHtml` | `boolean` | `false` | If `true`, the message is rendered as HTML (not sanitized) |
52
+ | `pauseOnHover` | `boolean` | `true` | The timer pauses while the mouse hovers |
53
+ | `dismissible` | `boolean` | `true` | Show a close button |
54
+ | `closeOnTap` | `boolean` | `true` | Clicking the notification itself closes it |
53
55
 
54
- ## دارک‌مود و RTL
56
+ ## Dark mode and RTL
55
57
 
56
- خودکار پشتیبانی می‌شه.
58
+ Supported automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-kit",
3
- "version": "6.0.1",
3
+ "version": "6.1.0",
4
4
  "description": "Angular input components",
5
5
  "author": "Mohammadreza Samani <mr.samani1368@gmail.com>",
6
6
  "license": "MIT",
package/shared/README.md CHANGED
@@ -1,27 +1,27 @@
1
1
  # ngx-kit/shared
2
2
 
3
- ابزارها و سرویس‌های مشترکی که بقیه‌ی بسته‌های `ngx-kit` روشون بنا شدن: مدیریت اورلی/دیالوگ، تشخیص جهت صفحه (RTL/LTR)، تشخیص تنظیمات مرورگر، و چند کامپوننت پایه‌ی قابل‌استفاده‌ی مجدد (اسلایدر، رنج‌اسلایدر، صفحه‌ی اشباع رنگ).
3
+ Shared utilities and services that the rest of the `ngx-kit` packages are built on: overlay/dialog management, page-direction (RTL/LTR) detection, browser-preference detection, and a few reusable base components (slider, range slider, color-saturation panel).
4
4
 
5
- معمولاً مستقیم به این پکیج نیازی ندارید — بقیه‌ی بسته‌ها به‌صورت خودکار بهش وابسته‌ان. ولی اگه دارید یه کامپوننت سفارشی می‌سازید که باید با بقیه‌ی کتابخونه هم‌خونی داشته باشه (دارک‌مود، RTL، درگ‌وپرفورمنس)، از همین ابزارها استفاده کنید.
5
+ You usually won't need this package directly — the other packages depend on it automatically. But if you're building a custom component that should stay consistent with the rest of the library (dark mode, RTL, drag performance), use these same utilities.
6
6
 
7
- ## نصب
7
+ ## Install
8
8
 
9
9
  ```bash
10
10
  npm install ngx-kit
11
11
  ```
12
12
 
13
- سبک‌های پایه (شامل `color-scheme` که دارک‌مود رو فعال می‌کنه) رو یک‌بار در سراسر اپ ایمپورت کنید:
13
+ Import the base styles (which enable dark mode via `color-scheme`) once, app-wide:
14
14
 
15
15
  ```scss
16
16
  // styles.scss
17
17
  @import 'ngx-kit/styles/all.css';
18
18
  ```
19
19
 
20
- ## سرویس‌ها
20
+ ## Services
21
21
 
22
22
  ### `OverlayService`
23
23
 
24
- موتور اصلی پشتِ همه‌ی چیزهای شناور کتابخونه (منو، دیالوگ، پاپ‌آپ‌های رنگ/گرادیان/زاویه). یک المنت انگولاری رو داخل یک `<dialog>` بومیِ مرورگر (`showModal()`) نمایش می‌ده و نسبت به یک anchor موقعیت‌دهی می‌کنه.
24
+ The engine behind everything floating in the library (menus, dialogs, the color/gradient/angle picker popups). Renders an Angular component inside a native `<dialog>` (`showModal()`) and positions it relative to an anchor.
25
25
 
26
26
  ```ts
27
27
  import { OverlayService } from 'ngx-kit/shared';
@@ -38,20 +38,20 @@ const ref = overlay.open({
38
38
  margin: 8,
39
39
  });
40
40
 
41
- ref.close(); // OverlayRef.close() آرگومان یا afterClosed نداره؛ برای اون‌جور رفتار (نتیجه‌ی بازگشتی، افترکلوز) از ngx-kit/dialog استفاده کنید که روی همین سرویس بنا شده
41
+ ref.close(); // OverlayRef.close() takes no argument and has no afterClosed; for that (return value, afterClosed) use ngx-kit/dialog, which is built on top of this service
42
42
  ```
43
43
 
44
- چیزهایی که به‌صورت خودکار برات مدیریت می‌شه:
44
+ What's handled for you automatically:
45
45
 
46
- - **موقعیت‌دهی هوشمند**: اگه فضای کافی پایین anchor نباشه، خودکار بالا می‌ره (`placement:'auto'`).
47
- - **بستن با کلیک بیرون**: با تشخیص کلیک روی backdrop، نه با listener سراسری روی document.
48
- - **پشته‌بندی درست**: چند اورلیِ هم‌زمان (مثلاً یه منوی زیرمنو‌دار) درست کار می‌کنن؛ Escape فقط آخرین (بالاترین) اورلی رو می‌بنده.
49
- - **بازگشتِ فوکوس**: بعد از بسته‌شدن، فوکوس به همون المنتی که قبلش فوکوس داشت برمی‌گرده (دسترس‌پذیری).
50
- - **RTL خودکار**: alignment و placement بر اساس جهت واقعیِ صفحه (نه فقط یه فرض ثابت) حساب می‌شن.
46
+ - **Smart positioning**: if there isn't enough room below the anchor, it flips above (`placement: 'auto'`).
47
+ - **Click-outside dismissal**: detected via the backdrop click, not a global `document` listener.
48
+ - **Correct stacking**: multiple simultaneous overlays (e.g. a menu with a submenu) work correctly; Escape only closes the last (topmost) overlay.
49
+ - **Focus restoration**: after closing, focus returns to whatever had focus before the overlay opened (accessibility).
50
+ - **Automatic RTL**: alignment and placement are computed against the page's actual direction (not a fixed assumption).
51
51
 
52
52
  ### `DirectionService`
53
53
 
54
- یه سیگنال (`isRtl(): boolean`) که با `MutationObserver` روی attribute-ی `dir` عنصر `<html>` گوش می‌ده و به‌محض تغییرش، ری‌اکتیو آپدیت می‌شه — یعنی اگه اپ شما زبان رو runtime عوض کنه، همه‌چیز خودکار هماهنگ می‌مونه.
54
+ A signal (`isRtl(): boolean`) that watches the `<html>` element's `dir` attribute with a `MutationObserver` and updates reactively the moment it changes — so if your app switches languages at runtime, everything stays in sync automatically.
55
55
 
56
56
  ```ts
57
57
  const direction = inject(DirectionService);
@@ -62,14 +62,14 @@ direction.isRtl(); // signal<boolean>
62
62
 
63
63
  ```ts
64
64
  const browser = inject(BrowserService);
65
- browser.prefersDarkMode; // boolean — یه‌بار در لحظه‌ی ساخت سرویس خونده می‌شه
65
+ browser.prefersDarkMode; // boolean — read once at service construction time
66
66
  ```
67
67
 
68
- ## ابزارهای Utility
68
+ ## Utilities
69
69
 
70
70
  ### `startDragSession(callbacks)`
71
71
 
72
- جایگزینِ الگوی مشکل‌دارِ `@HostListener('document:mousemove', ...)` که listener رو برای کل عمر کامپوننت روی `document` نگه می‌داره (حتی وقتی دراگی در جریان نیست — یه مشکل واقعیِ پرفورمنس روی صفحاتی با چند نمونه‌ی هم‌زمان). این تابع فقط در طول یک درگِ واقعی، listener اضافه می‌کنه و خودش پاک می‌کنه؛ `touchmove` هم با `{passive:false}` مدیریت می‌شه، پس درگ‌کردن روی موبایل صفحه رو اسکرول نمی‌کنه.
72
+ Replaces the problematic `@HostListener('document:mousemove', ...)` pattern, which keeps a listener attached to `document` for the entire lifetime of the component — even when nothing is being dragged (a real performance issue on pages with many simultaneous instances). This function only adds a listener for the duration of an actual drag and removes it itself; `touchmove` is handled with `{passive: false}`, so dragging on mobile doesn't also scroll the page.
73
73
 
74
74
  ```ts
75
75
  import { startDragSession } from 'ngx-kit/shared';
@@ -80,7 +80,7 @@ function onPointerDown(ev: MouseEvent | TouchEvent) {
80
80
  stop?.();
81
81
  stop = startDragSession({
82
82
  onMove: (ev) => {
83
- /* آپدیت موقعیت */
83
+ /* update position */
84
84
  },
85
85
  onEnd: () => {
86
86
  stop = undefined;
@@ -89,29 +89,29 @@ function onPointerDown(ev: MouseEvent | TouchEvent) {
89
89
  }
90
90
  ```
91
91
 
92
- > اگه کامپوننت‌تون `OnPush` هست و از `startDragSession` (به‌جای `@HostListener`) استفاده می‌کنید، حتماً داخل `onMove`/`onEnd` خودتون `ChangeDetectorRef.markForCheck()` رو صدا بزنید — برخلاف `@HostListener` که خودکار view رو dirty می‌کنه، `addEventListener` دستی این کار رو نمی‌کنه.
92
+ > If your component is `OnPush` and uses `startDragSession` (instead of `@HostListener`), make sure to call `ChangeDetectorRef.markForCheck()` inside `onMove`/`onEnd` yourself — unlike `@HostListener`, which automatically marks the view dirty, a manual `addEventListener` does not.
93
93
 
94
94
  ### `getOffsetPosition(event, element)`
95
95
 
96
- موقعیت pointer/touch رو نسبت به گوشه‌ی بالا-چپِ یه المنت مشخص برمی‌گردونه؛ برای پیاده‌سازیِ کامپوننت‌های درگ‌محور (اسلایدر، انتخاب‌گر رنگ و ...) استفاده می‌شه.
96
+ Returns the pointer/touch position relative to an element's top-left corner; used to implement drag-based components (sliders, color pickers, etc.).
97
97
 
98
98
  ### `mergeConfig(base, override)`
99
99
 
100
- ادغام عمیقِ دو آبجکت کانفیگ (برای الگوی `provideXxx({...})` که همه‌ی کتابخونه ازش استفاده می‌کنه).
100
+ Deep-merges two config objects (for the `provideXxx({...})` pattern used throughout the library).
101
101
 
102
- ## کامپوننت‌های پایه
102
+ ## Base components
103
103
 
104
- اینا رو مستقیم هم می‌شه استفاده کرد، ولی بیشتر به‌عنوان بلوک‌های سازنده‌ی کامپوننت‌های دیگه (مثل `color-picker`, `box-shadow`) طراحی شدن:
104
+ These can be used directly, but they're mostly designed as building blocks for other components (like `color-picker`, `box-shadow`):
105
105
 
106
- | کامپوننت | Selector | توضیح |
107
- | ---------------------- | -------------------- | ------------------------------------------------------------------- |
108
- | `SliderComponent` | `slider` | اسلایدر تک‌مقداره، `ControlValueAccessor`، `[min]`/`[max]`/`[step]` |
109
- | `RangeSliderComponent` | `range-slider` | اسلایدر بازه‌ای (دو thumb) |
110
- | `SaturationComponent` | داخلی (color-picker) | صفحه‌ی دوبعدیِ انتخاب اشباع/روشنایی رنگ |
106
+ | Component | Selector | Description |
107
+ | --- | --- | --- |
108
+ | `SliderComponent` | `slider` | Single-value slider, `ControlValueAccessor`, `[min]`/`[max]`/`[step]` |
109
+ | `RangeSliderComponent` | `range-slider` | Range slider (two thumbs) |
110
+ | `SaturationComponent` | internal (color-picker) | 2D saturation/lightness picker panel |
111
111
 
112
- ## دارک‌مود و RTL
112
+ ## Dark mode and RTL
113
113
 
114
- هر دو مستقیماً روی `ngx-kit/shared` تکیه دارن:
114
+ Both rely directly on `ngx-kit/shared`:
115
115
 
116
- - **دارک‌مود**: از تابع CSS بومیِ `light-dark()` استفاده می‌شه. برای این‌که کار کنه، باید `color-scheme: light dark` (یا `only light`/`only dark` برای force کردن دستی) روی `:root` ست بشه — این کار با ایمپورت‌کردن `ngx-kit/styles/all.css` خودکار انجام می‌شه. برای force کردن دستیِ تم (مستقل از `prefers-color-scheme` سیستم)، `data-ngx-theme="dark"` یا `"light"` رو روی `<html>`/`<body>` بذارید.
117
- - **RTL**: با `dir="rtl"` روی `<html>` فعال می‌شه؛ همه‌جای کتابخونه از CSS logical properties (`inset-inline-start` و ...) استفاده شده، پس نیازی به استایل جداگانه نیست.
116
+ - **Dark mode**: uses the native CSS `light-dark()` function. For it to work, `color-scheme: light dark` (or `only light`/`only dark` to force it manually) must be set on `:root` — this happens automatically when you import `ngx-kit/styles/all.css`. To force a theme manually (independent of the OS's `prefers-color-scheme`), set `data-ngx-theme="dark"` or `"light"` on `<html>`/`<body>`.
117
+ - **RTL**: enabled via `dir="rtl"` on `<html>`; the whole library uses CSS logical properties (`inset-inline-start`, etc.), so no separate styling is needed.