@cuby-ui/cdk 0.0.485 → 0.0.487

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 (211) hide show
  1. package/README.md +380 -13
  2. package/package.json +4 -1
  3. package/constants/empty.d.ts +0 -10
  4. package/constants/handlers.d.ts +0 -8
  5. package/constants/index.d.ts +0 -4
  6. package/constants/svg-node-filter.d.ts +0 -1
  7. package/constants/units.d.ts +0 -17
  8. package/date-time/index.d.ts +0 -1
  9. package/date-time/time.d.ts +0 -14
  10. package/directives/active-zone/active-zone.directive.d.ts +0 -22
  11. package/directives/active-zone/index.d.ts +0 -1
  12. package/directives/auto-resizing.directive.d.ts +0 -18
  13. package/directives/click-outside.directive.d.ts +0 -9
  14. package/directives/content-editable-value-accessor.directive.d.ts +0 -17
  15. package/directives/dimensions-observer.directive.d.ts +0 -13
  16. package/directives/drag-drop/drag-drop.directive.d.ts +0 -42
  17. package/directives/drag-drop/drag-drop.options.d.ts +0 -11
  18. package/directives/drag-drop/drag-list.directive.d.ts +0 -10
  19. package/directives/drag-drop/drag-pointer.directive.d.ts +0 -8
  20. package/directives/drag-drop/index.d.ts +0 -4
  21. package/directives/element.directive.d.ts +0 -8
  22. package/directives/focus-trap.directive.d.ts +0 -14
  23. package/directives/handle-scroll.directive.d.ts +0 -23
  24. package/directives/hovered/hovered.directive.d.ts +0 -7
  25. package/directives/hovered/hovered.service.d.ts +0 -12
  26. package/directives/hovered/index.d.ts +0 -2
  27. package/directives/index.d.ts +0 -17
  28. package/directives/item.directive.d.ts +0 -5
  29. package/directives/ladder-list.directive.d.ts +0 -13
  30. package/directives/let.context.d.ts +0 -9
  31. package/directives/let.directive.d.ts +0 -9
  32. package/directives/target.directive.d.ts +0 -14
  33. package/directives/typed-template.directive.d.ts +0 -13
  34. package/directives/typed-template.options.d.ts +0 -3
  35. package/esm2022/constants/empty.mjs +0 -24
  36. package/esm2022/constants/handlers.mjs +0 -11
  37. package/esm2022/constants/index.mjs +0 -5
  38. package/esm2022/constants/svg-node-filter.mjs +0 -6
  39. package/esm2022/constants/units.mjs +0 -64
  40. package/esm2022/cuby-ui-cdk.mjs +0 -5
  41. package/esm2022/date-time/index.mjs +0 -2
  42. package/esm2022/date-time/time.mjs +0 -72
  43. package/esm2022/directives/active-zone/active-zone.directive.mjs +0 -75
  44. package/esm2022/directives/active-zone/index.mjs +0 -2
  45. package/esm2022/directives/auto-resizing.directive.mjs +0 -64
  46. package/esm2022/directives/click-outside.directive.mjs +0 -29
  47. package/esm2022/directives/content-editable-value-accessor.directive.mjs +0 -44
  48. package/esm2022/directives/dimensions-observer.directive.mjs +0 -32
  49. package/esm2022/directives/drag-drop/drag-drop.directive.mjs +0 -184
  50. package/esm2022/directives/drag-drop/drag-drop.options.mjs +0 -2
  51. package/esm2022/directives/drag-drop/drag-list.directive.mjs +0 -22
  52. package/esm2022/directives/drag-drop/drag-pointer.directive.mjs +0 -20
  53. package/esm2022/directives/drag-drop/index.mjs +0 -4
  54. package/esm2022/directives/element.directive.mjs +0 -19
  55. package/esm2022/directives/focus-trap.directive.mjs +0 -50
  56. package/esm2022/directives/handle-scroll.directive.mjs +0 -81
  57. package/esm2022/directives/hovered/hovered.directive.mjs +0 -21
  58. package/esm2022/directives/hovered/hovered.service.mjs +0 -32
  59. package/esm2022/directives/hovered/index.mjs +0 -3
  60. package/esm2022/directives/index.mjs +0 -18
  61. package/esm2022/directives/item.directive.mjs +0 -14
  62. package/esm2022/directives/ladder-list.directive.mjs +0 -42
  63. package/esm2022/directives/let.context.mjs +0 -12
  64. package/esm2022/directives/let.directive.mjs +0 -23
  65. package/esm2022/directives/target.directive.mjs +0 -36
  66. package/esm2022/directives/typed-template.directive.mjs +0 -27
  67. package/esm2022/directives/typed-template.options.mjs +0 -2
  68. package/esm2022/index.mjs +0 -12
  69. package/esm2022/interfaces/dimensions.mjs +0 -2
  70. package/esm2022/interfaces/index.mjs +0 -4
  71. package/esm2022/interfaces/on-change.mjs +0 -2
  72. package/esm2022/interfaces/on-touched.mjs +0 -2
  73. package/esm2022/models/consumption-units.mjs +0 -2
  74. package/esm2022/models/index.mjs +0 -2
  75. package/esm2022/observables/if-map.mjs +0 -5
  76. package/esm2022/observables/index.mjs +0 -5
  77. package/esm2022/observables/typed-from-event.mjs +0 -9
  78. package/esm2022/observables/watch.mjs +0 -6
  79. package/esm2022/observables/zone.mjs +0 -34
  80. package/esm2022/pipes/filter.pipe.mjs +0 -17
  81. package/esm2022/pipes/index.mjs +0 -2
  82. package/esm2022/services/consumption-units.service.mjs +0 -67
  83. package/esm2022/services/destroy.service.mjs +0 -15
  84. package/esm2022/services/id.service.mjs +0 -21
  85. package/esm2022/services/index.mjs +0 -5
  86. package/esm2022/services/popover.service.mjs +0 -41
  87. package/esm2022/tokens/active-element.mjs +0 -52
  88. package/esm2022/tokens/animation-frame.mjs +0 -21
  89. package/esm2022/tokens/environment.mjs +0 -47
  90. package/esm2022/tokens/history.mjs +0 -5
  91. package/esm2022/tokens/index.mjs +0 -11
  92. package/esm2022/tokens/local-storage.mjs +0 -5
  93. package/esm2022/tokens/navigator.mjs +0 -6
  94. package/esm2022/tokens/removed-element.mjs +0 -19
  95. package/esm2022/tokens/session-storage.mjs +0 -5
  96. package/esm2022/tokens/user-agent.mjs +0 -6
  97. package/esm2022/tokens/window.mjs +0 -11
  98. package/esm2022/types/context.mjs +0 -2
  99. package/esm2022/types/date-time.mjs +0 -2
  100. package/esm2022/types/handler.mjs +0 -2
  101. package/esm2022/types/index.mjs +0 -9
  102. package/esm2022/types/input-type.mjs +0 -2
  103. package/esm2022/types/mapper.mjs +0 -2
  104. package/esm2022/types/matcher.mjs +0 -2
  105. package/esm2022/types/nullable.mjs +0 -2
  106. package/esm2022/types/value-of.mjs +0 -2
  107. package/esm2022/utils/dom/contains-or-after.mjs +0 -9
  108. package/esm2022/utils/dom/element-checks.mjs +0 -20
  109. package/esm2022/utils/dom/get-actual-target.mjs +0 -7
  110. package/esm2022/utils/dom/get-document-or-shadow-root.mjs +0 -6
  111. package/esm2022/utils/dom/get-element-obscurers.mjs +0 -42
  112. package/esm2022/utils/dom/index.mjs +0 -8
  113. package/esm2022/utils/dom/inject-element.mjs +0 -5
  114. package/esm2022/utils/dom/point-to-client-rect.mjs +0 -17
  115. package/esm2022/utils/files/files.uploader.mjs +0 -19
  116. package/esm2022/utils/files/index.mjs +0 -3
  117. package/esm2022/utils/files/take-capture-from-video.mjs +0 -25
  118. package/esm2022/utils/focus/blur-native-focused.mjs +0 -9
  119. package/esm2022/utils/focus/get-closest-focusable.mjs +0 -22
  120. package/esm2022/utils/focus/get-native-focused.mjs +0 -11
  121. package/esm2022/utils/focus/index.mjs +0 -7
  122. package/esm2022/utils/focus/is-native-focused.mjs +0 -13
  123. package/esm2022/utils/focus/is-native-keyboard-focusable.mjs +0 -26
  124. package/esm2022/utils/focus/is-native-mouse-focusable.mjs +0 -6
  125. package/esm2022/utils/index.mjs +0 -8
  126. package/esm2022/utils/math/clamp.mjs +0 -11
  127. package/esm2022/utils/math/index.mjs +0 -2
  128. package/esm2022/utils/miscellaneous/array-remove.mjs +0 -4
  129. package/esm2022/utils/miscellaneous/index.mjs +0 -6
  130. package/esm2022/utils/miscellaneous/is-present.mjs +0 -4
  131. package/esm2022/utils/miscellaneous/move-item-in-array.mjs +0 -10
  132. package/esm2022/utils/miscellaneous/pure.mjs +0 -81
  133. package/esm2022/utils/miscellaneous/px.mjs +0 -7
  134. package/esm2022/utils/platform/index.mjs +0 -2
  135. package/esm2022/utils/platform/is-ios.mjs +0 -6
  136. package/esm2022/utils/token/create-token.mjs +0 -8
  137. package/esm2022/utils/token/index.mjs +0 -3
  138. package/esm2022/utils/token/provide.mjs +0 -4
  139. package/fesm2022/cuby-ui-cdk.mjs +0 -1644
  140. package/fesm2022/cuby-ui-cdk.mjs.map +0 -1
  141. package/index.d.ts +0 -11
  142. package/interfaces/dimensions.d.ts +0 -4
  143. package/interfaces/index.d.ts +0 -3
  144. package/interfaces/on-change.d.ts +0 -3
  145. package/interfaces/on-touched.d.ts +0 -3
  146. package/models/consumption-units.d.ts +0 -14
  147. package/models/index.d.ts +0 -1
  148. package/observables/if-map.d.ts +0 -3
  149. package/observables/index.d.ts +0 -4
  150. package/observables/typed-from-event.d.ts +0 -16
  151. package/observables/watch.d.ts +0 -3
  152. package/observables/zone.d.ts +0 -7
  153. package/pipes/filter.pipe.d.ts +0 -8
  154. package/pipes/index.d.ts +0 -1
  155. package/services/consumption-units.service.d.ts +0 -13
  156. package/services/destroy.service.d.ts +0 -8
  157. package/services/id.service.d.ts +0 -8
  158. package/services/index.d.ts +0 -4
  159. package/services/popover.service.d.ts +0 -23
  160. package/tokens/active-element.d.ts +0 -5
  161. package/tokens/animation-frame.d.ts +0 -3
  162. package/tokens/environment.d.ts +0 -19
  163. package/tokens/history.d.ts +0 -1
  164. package/tokens/index.d.ts +0 -10
  165. package/tokens/local-storage.d.ts +0 -1
  166. package/tokens/navigator.d.ts +0 -2
  167. package/tokens/removed-element.d.ts +0 -4
  168. package/tokens/session-storage.d.ts +0 -1
  169. package/tokens/user-agent.d.ts +0 -2
  170. package/tokens/window.d.ts +0 -1
  171. package/types/context.d.ts +0 -3
  172. package/types/date-time.d.ts +0 -1
  173. package/types/handler.d.ts +0 -4
  174. package/types/index.d.ts +0 -8
  175. package/types/input-type.d.ts +0 -1
  176. package/types/mapper.d.ts +0 -1
  177. package/types/matcher.d.ts +0 -2
  178. package/types/nullable.d.ts +0 -1
  179. package/types/value-of.d.ts +0 -1
  180. package/utils/dom/contains-or-after.d.ts +0 -1
  181. package/utils/dom/element-checks.d.ts +0 -6
  182. package/utils/dom/get-actual-target.d.ts +0 -4
  183. package/utils/dom/get-document-or-shadow-root.d.ts +0 -1
  184. package/utils/dom/get-element-obscurers.d.ts +0 -9
  185. package/utils/dom/index.d.ts +0 -7
  186. package/utils/dom/inject-element.d.ts +0 -1
  187. package/utils/dom/point-to-client-rect.d.ts +0 -1
  188. package/utils/files/files.uploader.d.ts +0 -5
  189. package/utils/files/index.d.ts +0 -2
  190. package/utils/files/take-capture-from-video.d.ts +0 -1
  191. package/utils/focus/blur-native-focused.d.ts +0 -1
  192. package/utils/focus/get-closest-focusable.d.ts +0 -7
  193. package/utils/focus/get-native-focused.d.ts +0 -1
  194. package/utils/focus/index.d.ts +0 -6
  195. package/utils/focus/is-native-focused.d.ts +0 -9
  196. package/utils/focus/is-native-keyboard-focusable.d.ts +0 -1
  197. package/utils/focus/is-native-mouse-focusable.d.ts +0 -1
  198. package/utils/index.d.ts +0 -7
  199. package/utils/math/clamp.d.ts +0 -8
  200. package/utils/math/index.d.ts +0 -1
  201. package/utils/miscellaneous/array-remove.d.ts +0 -1
  202. package/utils/miscellaneous/index.d.ts +0 -5
  203. package/utils/miscellaneous/is-present.d.ts +0 -1
  204. package/utils/miscellaneous/move-item-in-array.d.ts +0 -1
  205. package/utils/miscellaneous/pure.d.ts +0 -21
  206. package/utils/miscellaneous/px.d.ts +0 -4
  207. package/utils/platform/index.d.ts +0 -1
  208. package/utils/platform/is-ios.d.ts +0 -3
  209. package/utils/token/create-token.d.ts +0 -3
  210. package/utils/token/index.d.ts +0 -2
  211. package/utils/token/provide.d.ts +0 -3
package/README.md CHANGED
@@ -1,25 +1,392 @@
1
- # Cdk
1
+ # Cuby UI - агентская документация (RU)
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
3
+ Документ для кодовых агентов. Описывает публичный API пакета `@cuby-ui/cdk`, а также примеры использования.
4
4
 
5
- ## Code scaffolding
5
+ ## Оглавление
6
+ - [CDK: директивы](#cdk-директивы)
7
+ - [CDK: пайпы](#cdk-пайпы)
8
+ - [CDK: сервисы](#cdk-сервисы)
9
+ - [CDK: токены](#cdk-токены)
10
+ - [CDK: интерфейсы и типы](#cdk-интерфейсы-и-типы)
11
+ - [CDK: утилиты и константы](#cdk-утилиты-и-константы)
12
+ - [Анти-паттерны](#анти-паттерны)
13
+ - [Линт и форматирование](#линт-и-форматирование)
14
+ - [Версии и совместимость](#версии-и-совместимость)
6
15
 
7
- Run `ng generate component component-name --project cdk` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project cdk`.
16
+ ## CDK: директивы
8
17
 
9
- > Note: Don't forget to add `--project cdk` or else it will be added to the default project in your `angular.json` file.
18
+ ### Feature: CuiAutoResizingDirective (`textarea[cuiAutoResizing]`)
19
+ Описание: автоматический ресайз textarea по контенту.
20
+ Публичный API:
21
+ - Standalone: да
22
+ Пример:
23
+ ```html
24
+ <textarea cuiAutoResizing [formControl]="notesControl" style="max-height: 200px;"></textarea>
25
+ ```
10
26
 
11
- ## Build
27
+ ### Feature: CuiClickOutsideDirective (`(cuiClickOutside)`)
28
+ Описание: эмитит событие при клике вне элемента.
29
+ Публичный API:
30
+ - Standalone: да
31
+ - Output: `cuiClickOutside: EventEmitter<HTMLElement>`
32
+ Пример:
33
+ ```html
34
+ <div (cuiClickOutside)="onOutside()">
35
+ ...
36
+ </div>
37
+ ```
12
38
 
13
- Run `ng build cdk` to build the project. The build artifacts will be stored in the `dist/` directory.
39
+ ### Feature: CuiContentEditableValueAccessorDirective
40
+ Описание: связывает contenteditable с Angular формами.
41
+ Публичный API:
42
+ - Standalone: да
43
+ - Селектор: `[contenteditable][formControlName|formControl|ngModel]`
44
+ Пример:
45
+ ```html
46
+ <div contenteditable [formControl]="bioControl"></div>
47
+ ```
14
48
 
15
- ## Publishing
49
+ ### Feature: CuiDimensionsObserverDirective (`[cuiResizeObserver]`)
50
+ Описание: отдаёт размеры элемента при изменениях.
51
+ Публичный API:
52
+ - Standalone: да
53
+ - Output: `cuiResizeObserver: EventEmitter<CuiDimensions>`
54
+ Пример:
55
+ ```html
56
+ <div cuiResizeObserver (cuiResizeObserver)="onResize($event)"></div>
57
+ ```
16
58
 
17
- After building your library with `ng build cdk`, go to the dist folder `cd dist/cdk` and run `npm publish`.
59
+ ### Feature: CuiElementDirective (`[cuiElement]`)
60
+ Описание: экспортирует `ElementRef` как `elementRef` в шаблоне.
61
+ Публичный API:
62
+ - Standalone: да
63
+ - exportAs: `elementRef`
64
+ Пример:
65
+ ```html
66
+ <button cuiElement #btn="elementRef">Open</button>
67
+ <cui-context-menu [target]="btn.nativeElement" [items]="items"></cui-context-menu>
68
+ ```
18
69
 
19
- ## Running unit tests
70
+ ### Feature: CuiFocusTrapDirective (`[cuiFocusTrap]`)
71
+ Описание: запирает фокус внутри контейнера.
72
+ Публичный API:
73
+ - Standalone: да
74
+ Пример:
75
+ ```html
76
+ <div cuiFocusTrap>
77
+ <input />
78
+ <button>OK</button>
79
+ </div>
80
+ ```
20
81
 
21
- Run `ng test cdk` to execute the unit tests via [Karma](https://karma-runner.github.io).
82
+ ### Feature: CuiItemDirective (`[cuiItem]`)
83
+ Описание: метка элемента коллекции, используется в `cui-breadcrumbs`.
84
+ Публичный API:
85
+ - Standalone: да
86
+ Пример:
87
+ ```html
88
+ <a cuiBreadcrumb *cuiItem>Раздел</a>
89
+ ```
22
90
 
23
- ## Further help
91
+ ### Feature: CuiLetDirective (`*cuiLet`)
92
+ Описание: структурная директива для удобного alias значения.
93
+ Публичный API:
94
+ - Standalone: да
95
+ Пример:
96
+ ```html
97
+ <ng-container *cuiLet="user$ | async as user">
98
+ {{ user?.name }}
99
+ </ng-container>
100
+ ```
24
101
 
25
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
102
+ ### Feature: CuiLetContext
103
+ Описание: контекст для `cuiLet`, полезен для типизации.
104
+ Публичный API:
105
+ - Класс: `CuiLetContext<T>`
106
+ Пример:
107
+ ```ts
108
+ type Ctx = CuiLetContext<User>;
109
+ ```
110
+
111
+ ### Feature: CuiTargetDirective (`[ccTarget]`)
112
+ Описание: слушает клики на внешнем DOM-элементе.
113
+ Публичный API:
114
+ - Standalone: да
115
+ - Input: `ccTarget: HTMLElement`
116
+ - Output: `clicked: EventEmitter<MouseEvent>`
117
+ Пример:
118
+ ```html
119
+ <div [ccTarget]="buttonRef.nativeElement" (clicked)="onTargetClick($event)"></div>
120
+ ```
121
+
122
+ ## CDK: пайпы
123
+
124
+ ### Feature: CuiFilterPipe (`| cuiFilter`)
125
+ Описание: фильтрация массива по matcher функции.
126
+ Публичный API:
127
+ - Standalone: да
128
+ Пример:
129
+ ```html
130
+ <li *ngFor="let item of items | cuiFilter: isVisible: filterValue">
131
+ {{ item.label }}
132
+ </li>
133
+ ```
134
+
135
+ ## CDK: сервисы
136
+
137
+ ### Feature: CuiDestroyService
138
+ Описание: Subject, который автоматически завершает подписки в `ngOnDestroy`.
139
+ Публичный API:
140
+ - Использование: `takeUntil(destroy$)`
141
+ Пример:
142
+ ```ts
143
+ @Component({ providers: [CuiDestroyService] })
144
+ export class ExampleComponent {
145
+ private destroy$ = inject(CuiDestroyService);
146
+
147
+ ngOnInit() {
148
+ this.stream$.pipe(takeUntil(this.destroy$)).subscribe();
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### Feature: CuiIdService
154
+ Описание: генератор уникальных id.
155
+ Публичный API:
156
+ - Метод: `generate(): string`
157
+ Пример:
158
+ ```ts
159
+ const id = inject(CuiIdService).generate();
160
+ ```
161
+
162
+ ### Feature: CuiPopoverService
163
+ Описание: абстрактный сервис для поповеров/оверлеев.
164
+ Публичный API:
165
+ - Метод: `open(content, options?) -> Observable`
166
+ - Типы: `CuiPopoverContext`, `CuiPopover<T>`
167
+ Пример:
168
+ ```ts
169
+ class MyPopoverService extends CuiPopoverService<MyOptions> {
170
+ constructor() {
171
+ super(MY_ITEMS_TOKEN, MyPopoverComponent, MY_DEFAULT_OPTIONS);
172
+ }
173
+ }
174
+ ```
175
+
176
+ ### Feature: CuiPopoverContext
177
+ Описание: контекст поповера (`id`, `component`, `content`, `completeWith`).
178
+ Публичный API:
179
+ - Поля: `$implicit`, `id`, `component`, `content`, `completeWith`
180
+ Пример:
181
+ ```ts
182
+ const ctx: CuiPopoverContext = {
183
+ $implicit: observer,
184
+ id: 'id',
185
+ component: MyComponent,
186
+ content: 'text',
187
+ completeWith: () => {}
188
+ };
189
+ ```
190
+
191
+ ### Feature: CuiPopover
192
+ Описание: тип поповера (опции + контекст).
193
+ Пример:
194
+ ```ts
195
+ type AlertPopover = CuiPopover<CuiAlertOptions>;
196
+ ```
197
+
198
+ ## CDK: токены
199
+
200
+ ### Feature: CUI_WINDOW
201
+ Описание: DI токен для `window`.
202
+ Пример:
203
+ ```ts
204
+ const win = inject(CUI_WINDOW);
205
+ ```
206
+
207
+ ### Feature: CUI_LOCAL_STORAGE
208
+ Описание: DI токен для `localStorage`.
209
+ Пример:
210
+ ```ts
211
+ const storage = inject(CUI_LOCAL_STORAGE);
212
+ ```
213
+
214
+ ### Feature: CUI_SESSION_STORAGE
215
+ Описание: DI токен для `sessionStorage`.
216
+ Пример:
217
+ ```ts
218
+ const storage = inject(CUI_SESSION_STORAGE);
219
+ ```
220
+
221
+ ### Feature: CUI_HISTORY
222
+ Описание: DI токен для `history`.
223
+ Пример:
224
+ ```ts
225
+ const history = inject(CUI_HISTORY);
226
+ ```
227
+
228
+ ## CDK: интерфейсы и типы
229
+
230
+ ### Feature: CuiDimensions
231
+ Описание: размеры элемента.
232
+ Публичный API:
233
+ - Поля: `width`, `height`
234
+ Пример:
235
+ ```ts
236
+ function onResize(dim: CuiDimensions) { console.log(dim.width); }
237
+ ```
238
+
239
+ ### Feature: CuiOnChange
240
+ Описание: сигнатура функции onChange для ControlValueAccessor.
241
+ Пример:
242
+ ```ts
243
+ const onChange: CuiOnChange<string> = (value) => console.log(value);
244
+ ```
245
+
246
+ ### Feature: CuiOnTouched
247
+ Описание: сигнатура функции onTouched.
248
+ Пример:
249
+ ```ts
250
+ const onTouched: CuiOnTouched = () => console.log('touched');
251
+ ```
252
+
253
+ ### Feature: CuiTimeMode
254
+ Описание: формат времени для `CuiTime`.
255
+ Публичный API:
256
+ - Значения: `HH:MM`, `HH:MM:SS`, `HH:MM:SS.MSS`
257
+ Пример:
258
+ ```ts
259
+ const mode: CuiTimeMode = 'HH:MM:SS';
260
+ ```
261
+
262
+ ### Feature: CuiInputType
263
+ Описание: типы инпутов, используемые в core.
264
+ Публичный API:
265
+ - Значения: `text | password`
266
+ Пример:
267
+ ```ts
268
+ const type: CuiInputType = 'password';
269
+ ```
270
+
271
+ ### Feature: Mapper
272
+ Описание: тип функции-отображения.
273
+ Пример:
274
+ ```ts
275
+ const map: Mapper<[number, number], number> = (a, b) => a + b;
276
+ ```
277
+
278
+ ### Feature: CuiMatcher
279
+ Описание: тип функции-предиката для фильтрации.
280
+ Пример:
281
+ ```ts
282
+ const matcher: CuiMatcher<[number, number]> = (item, min) => item > min;
283
+ ```
284
+
285
+ ### Feature: CuiNullable
286
+ Описание: `T | null | undefined`.
287
+ Пример:
288
+ ```ts
289
+ const value: CuiNullable<string> = null;
290
+ ```
291
+
292
+ ### Feature: CuiValueOf
293
+ Описание: значение union по ключам объекта.
294
+ Пример:
295
+ ```ts
296
+ type Modes = CuiValueOf<{ a: 'x'; b: 'y' }>;
297
+ ```
298
+
299
+ ### Feature: CuiTime
300
+ Описание: класс времени с парсингом и форматированием.
301
+ Публичный API:
302
+ - Методы: `fromString`, `fromPT`, `toString`, `toPT`
303
+ Пример:
304
+ ```ts
305
+ const time = CuiTime.fromString('12:30');
306
+ time.toString('HH:MM'); // "12:30"
307
+ ```
308
+
309
+ ## CDK: утилиты и константы
310
+
311
+ ### Feature: svgNodeFilter
312
+ Описание: фильтр узлов для TreeWalker, исключает SVG.
313
+ Пример:
314
+ ```ts
315
+ document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, svgNodeFilter);
316
+ ```
317
+
318
+ ### Feature: cuiContainsOrAfter
319
+ Описание: проверка, что узел внутри или после другого.
320
+ Пример:
321
+ ```ts
322
+ cuiContainsOrAfter(container, node);
323
+ ```
324
+
325
+ ### Feature: cuiIsHTMLElement
326
+ Описание: type guard для HTMLElement.
327
+ Пример:
328
+ ```ts
329
+ if (cuiIsHTMLElement(node)) node.focus();
330
+ ```
331
+
332
+ ### Feature: cuiBlurNativeFocused
333
+ Описание: blur активного элемента.
334
+ Пример:
335
+ ```ts
336
+ cuiBlurNativeFocused(document);
337
+ ```
338
+
339
+ ### Feature: cuiGetClosestFocusable
340
+ Описание: поиск ближайшего фокусируемого элемента.
341
+ Пример:
342
+ ```ts
343
+ const next = cuiGetClosestFocusable({ initial, root });
344
+ ```
345
+
346
+ ### Feature: cuiGetNativeFocused
347
+ Описание: получение активного элемента с учетом shadow DOM.
348
+ Пример:
349
+ ```ts
350
+ const active = cuiGetNativeFocused(document);
351
+ ```
352
+
353
+ ### Feature: cuiIsNativeKeyboardFocusable
354
+ Описание: проверка фокуса по клавиатуре.
355
+ Пример:
356
+ ```ts
357
+ cuiIsNativeKeyboardFocusable(element);
358
+ ```
359
+
360
+ ### Feature: cuiIsNativeMouseFocusable
361
+ Описание: проверка фокуса по клику мыши.
362
+ Пример:
363
+ ```ts
364
+ cuiIsNativeMouseFocusable(element);
365
+ ```
366
+
367
+ ### Feature: cuiCreateToken / cuiCreateTokenFromFactory
368
+ Описание: хелперы для создания `InjectionToken`.
369
+ Пример:
370
+ ```ts
371
+ export const MY_TOKEN = cuiCreateToken({ enabled: true });
372
+ ```
373
+
374
+ ### Feature: cuiProvide
375
+ Описание: хелпер для `ExistingProvider`.
376
+ Пример:
377
+ ```ts
378
+ providers: [cuiProvide(NG_VALUE_ACCESSOR, MyComponent, true)]
379
+ ```
380
+
381
+ ## Анти-паттерны
382
+ - Анти-паттерн: передавать строку вместо `CuiTime` в `cui-input-time`. Описание: компонент ожидает `CuiTime`.
383
+
384
+ ## Линт и форматирование
385
+ - Явных конфигураций ESLint/Prettier в репозитории нет. Ориентируйтесь на текущий стиль файлов и типичные правила Angular/TypeScript.
386
+
387
+ ## Версии и совместимость
388
+ - Angular: `>=18.0.0`
389
+ - RxJS: `>=7.0.0`
390
+ - `@maskito/*`: `^2.5.0` (input number/time)
391
+ - `@tinkoff/ng-polymorpheus`: `^4.3.0` (dialog header)
392
+ - Пакеты `@cuby-ui/*`: версия `0.0.177` (см. `projects/*/package.json`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuby-ui/cdk",
3
- "version": "0.0.485",
3
+ "version": "0.0.487",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -11,6 +11,9 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "sideEffects": false,
14
+ "files": [
15
+ "README.md"
16
+ ],
14
17
  "module": "fesm2022/cuby-ui-cdk.mjs",
15
18
  "typings": "index.d.ts",
16
19
  "exports": {
@@ -1,10 +0,0 @@
1
- import { QueryList } from '@angular/core';
2
- /**
3
- * For type safety when using @ContentChildren and @ViewChildren
4
- *
5
- * NOTE: Be careful subscribing to 'changes'
6
- */
7
- export declare const EMPTY_QUERY: QueryList<any>;
8
- export declare const EMPTY_ARRAY: [];
9
- export declare const EMPTY_FUNCTION: (...args: any[]) => void;
10
- export declare const EMPTY_CLIENT_RECT: DOMRect;
@@ -1,8 +0,0 @@
1
- /**
2
- * Handler that always returns `false`.
3
- */
4
- export declare const CUI_FALSE_HANDLER: () => false;
5
- /**
6
- * Handler that always returns `true`.
7
- */
8
- export declare const CUI_TRUE_HANDLER: () => true;
@@ -1,4 +0,0 @@
1
- export * from './empty';
2
- export * from './handlers';
3
- export * from './units';
4
- export * from './svg-node-filter';
@@ -1 +0,0 @@
1
- export declare const svgNodeFilter: Exclude<NodeFilter, (node: Node) => number>;
@@ -1,17 +0,0 @@
1
- import { Consumption, Unit } from '../models';
2
- export declare const UnitsMetricWeight: Unit[];
3
- export declare const UnitsImperialWeight: Unit[];
4
- export declare const UnitsMetricLength: Unit[];
5
- export declare const UnitsImperialLength: Unit[];
6
- export declare const UnitsMetricVolume: Unit[];
7
- export declare const UnitsImperialVolume: Unit[];
8
- export declare const UnitsMetricSquare: Unit[];
9
- export declare const UnitsImperialSquare: Unit[];
10
- export declare const UnitsAmount: Unit[];
11
- export declare const UnitsMetric: Partial<Record<Consumption, Unit[]>>;
12
- export declare const UnitsImperial: Partial<Record<Consumption, Unit[]>>;
13
- export declare const enum UnitsSystem {
14
- Metric = "METRIC",
15
- Imperial = "IMPERIAL"
16
- }
17
- export declare const SystemUnits: Record<UnitsSystem, Partial<Record<Consumption, Unit[]>>>;
@@ -1 +0,0 @@
1
- export * from './time';
@@ -1,14 +0,0 @@
1
- import type { CuiTimeMode } from '../types';
2
- export declare class CuiTime {
3
- readonly hours: number;
4
- readonly minutes: number;
5
- readonly seconds: number;
6
- readonly ms: number;
7
- constructor(hours: number, minutes: number, seconds?: number, ms?: number);
8
- static fromString(time: string): CuiTime;
9
- static fromPT(time: string): CuiTime;
10
- private static parseHours;
11
- toString(mode?: CuiTimeMode): string;
12
- toPT(mode?: CuiTimeMode): string;
13
- private formatTime;
14
- }
@@ -1,22 +0,0 @@
1
- import type { OnDestroy } from '@angular/core';
2
- import type { Observable } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- export declare class CuiActiveZone implements OnDestroy {
5
- private readonly control;
6
- private readonly active$;
7
- private readonly zone;
8
- private readonly el;
9
- private cuiActiveZoneParent;
10
- private subActiveZones;
11
- private readonly directParentActiveZone;
12
- readonly cuiActiveZoneChange: Observable<boolean>;
13
- constructor();
14
- set cuiActiveZoneParentSetter(zone: CuiActiveZone | null);
15
- ngOnDestroy(): void;
16
- contains(node: Node): boolean;
17
- private setZone;
18
- private addSubActiveZone;
19
- private removeSubActiveZone;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiActiveZone, never>;
21
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiActiveZone, "[cuiActiveZone]:not(ng-container), [cuiActiveZoneChange]:not(ng-container), [cuiActiveZoneParent]:not(ng-container)", ["cuiActiveZone"], { "cuiActiveZoneParentSetter": { "alias": "cuiActiveZoneParent"; "required": false; }; }, { "cuiActiveZoneChange": "cuiActiveZoneChange"; }, never, never, true, never>;
22
- }
@@ -1 +0,0 @@
1
- export * from './active-zone.directive';
@@ -1,18 +0,0 @@
1
- import type { AfterViewChecked, OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class CuiAutoResizingDirective implements OnInit, AfterViewChecked {
4
- private readonly window;
5
- private readonly element;
6
- private readonly ngControl;
7
- private readonly ngModel;
8
- private readonly destroy$;
9
- private readonly elementStyles;
10
- ngOnInit(): void;
11
- ngAfterViewChecked(): void;
12
- protected onInput(): void;
13
- private initNgControlValueChangeSubscription;
14
- private initNgModelValueChangeSubscription;
15
- private resize;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiAutoResizingDirective, never>;
17
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiAutoResizingDirective, "textarea[cuiAutoResizing]", never, {}, {}, never, never, true, never>;
18
- }
@@ -1,9 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class CuiClickOutsideDirective {
4
- private readonly element;
5
- cuiClickOutside: EventEmitter<HTMLElement>;
6
- protected onClickOutside(target: HTMLElement): void;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiClickOutsideDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiClickOutsideDirective, "(cuiClickOutside)", never, {}, { "cuiClickOutside": "cuiClickOutside"; }, never, never, true, never>;
9
- }
@@ -1,17 +0,0 @@
1
- import type { ControlValueAccessor } from '@angular/forms';
2
- import type { CuiNullable } from '../types';
3
- import type { CuiOnChange, CuiOnTouched } from '../interfaces';
4
- import * as i0 from "@angular/core";
5
- export declare class CuiContentEditableValueAccessorDirective implements ControlValueAccessor {
6
- private readonly element;
7
- protected onChange: CuiOnChange<string>;
8
- protected onTouched: CuiOnTouched;
9
- writeValue(value: CuiNullable<string>): void;
10
- registerOnChange(fn: CuiOnChange<string>): void;
11
- registerOnTouched(fn: CuiOnTouched): void;
12
- setDisabledState(isDisabled: boolean): void;
13
- protected onInput(): void;
14
- protected onBlur(): void;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiContentEditableValueAccessorDirective, never>;
16
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiContentEditableValueAccessorDirective, "[contenteditable][formControlName], [contenteditable][formControl], [contenteditable][ngModel]", never, {}, {}, never, never, true, never>;
17
- }
@@ -1,13 +0,0 @@
1
- import type { OnInit, OnDestroy } from '@angular/core';
2
- import { EventEmitter } from '@angular/core';
3
- import type { CuiDimensions } from '../interfaces';
4
- import * as i0 from "@angular/core";
5
- export declare class CuiDimensionsObserverDirective implements OnInit, OnDestroy {
6
- private readonly element;
7
- private readonly observer;
8
- cuiResizeObserver: EventEmitter<CuiDimensions>;
9
- ngOnInit(): void;
10
- ngOnDestroy(): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiDimensionsObserverDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiDimensionsObserverDirective, "[cuiResizeObserver]", never, {}, { "cuiResizeObserver": "cuiResizeObserver"; }, never, never, true, never>;
13
- }
@@ -1,42 +0,0 @@
1
- import type { OnDestroy } from '@angular/core';
2
- import type { CuiNullable } from '../../types';
3
- import type { CuiDragData, CuiDragDropData } from './drag-drop.options';
4
- import * as i0 from "@angular/core";
5
- export declare class CuiDragDropDirective implements OnDestroy {
6
- private readonly zone;
7
- private readonly document;
8
- private readonly renderer;
9
- private readonly element;
10
- private readonly dragListDirective;
11
- private readonly PLACEHOLDER_CLASS;
12
- private readonly listId;
13
- private readonly itemAttribute;
14
- private index;
15
- private prevIndex;
16
- private abortController;
17
- private hostAbortController;
18
- protected readonly draggingElement: import("@angular/core").WritableSignal<CuiNullable<HTMLElement>>;
19
- protected readonly placeholderElement: import("@angular/core").WritableSignal<CuiNullable<HTMLElement>>;
20
- protected readonly dragData: import("@angular/core").WritableSignal<CuiDragData>;
21
- readonly disabled: import("@angular/core").InputSignal<boolean>;
22
- readonly elementDragged: import("@angular/core").OutputEmitterRef<CuiDragDropData>;
23
- constructor();
24
- ngOnDestroy(): void;
25
- changePointerEvents(element: HTMLElement): void;
26
- private onDrag;
27
- private onDragStart;
28
- private onDragEnd;
29
- private initDragItem;
30
- private initPointerEvents;
31
- private destroyEvents;
32
- private prepareMoving;
33
- private configurateDragData;
34
- private createDragElement;
35
- private createPlaceholderElement;
36
- private removeDragElement;
37
- private removePlaceholder;
38
- private calculateIndex;
39
- private calculatePreviousIndex;
40
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiDragDropDirective, never>;
41
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiDragDropDirective, "[cuiDragDrop]", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "elementDragged": "elementDragged"; }, never, never, true, never>;
42
- }
@@ -1,11 +0,0 @@
1
- export interface CuiDragDropData {
2
- readonly index: number;
3
- readonly prevIndex: number;
4
- readonly pointer: CuiDropPointer;
5
- readonly targetElement: HTMLElement;
6
- }
7
- export interface CuiDragData {
8
- readonly pointer?: CuiDropPointer;
9
- readonly targetElement?: HTMLElement;
10
- }
11
- export type CuiDropPointer = 'BEFORE' | 'AFTER';
@@ -1,10 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class CuiDragListDirective {
3
- private readonly renderer;
4
- private readonly element;
5
- readonly id: string;
6
- readonly listId: string;
7
- constructor();
8
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiDragListDirective, never>;
9
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiDragListDirective, "[cuiDragList]", never, {}, {}, never, never, true, never>;
10
- }
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class CuiDragPointerDirective {
3
- private readonly dragDropDirective;
4
- private readonly element;
5
- constructor();
6
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiDragPointerDirective, never>;
7
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiDragPointerDirective, "[cuiDragPointer]", never, {}, {}, never, never, true, never>;
8
- }
@@ -1,4 +0,0 @@
1
- export { CuiDragDropData, CuiDragData, CuiDropPointer } from './drag-drop.options';
2
- export { CuiDragDropDirective } from './drag-drop.directive';
3
- export { CuiDragListDirective } from './drag-list.directive';
4
- export { CuiDragPointerDirective } from './drag-pointer.directive';
@@ -1,8 +0,0 @@
1
- import { ElementRef } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class CuiElementDirective<T extends Element = HTMLElement> implements ElementRef<T> {
4
- nativeElement: any;
5
- constructor();
6
- static ɵfac: i0.ɵɵFactoryDeclaration<CuiElementDirective<any>, never>;
7
- static ɵdir: i0.ɵɵDirectiveDeclaration<CuiElementDirective<any>, "[cuiElement]", ["elementRef"], {}, {}, never, never, true, never>;
8
- }