ngx-tethys 20.0.1 → 20.0.3
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.
- package/CHANGELOG.md +35 -0
- package/action/index.d.ts +3 -3
- package/affix/index.d.ts +1 -1
- package/alert/index.d.ts +3 -3
- package/anchor/index.d.ts +12 -6
- package/arrow-switcher/index.d.ts +6 -6
- package/autocomplete/index.d.ts +7 -7
- package/avatar/index.d.ts +9 -9
- package/back-top/index.d.ts +3 -3
- package/badge/index.d.ts +6 -6
- package/breadcrumb/index.d.ts +7 -7
- package/button/index.d.ts +19 -19
- package/calendar/index.d.ts +8 -8
- package/card/index.d.ts +6 -6
- package/carousel/index.d.ts +4 -4
- package/cascader/index.d.ts +24 -24
- package/collapse/index.d.ts +4 -4
- package/color-picker/index.d.ts +16 -16
- package/comment/index.d.ts +3 -3
- package/copy/index.d.ts +2 -2
- package/core/index.d.ts +22 -22
- package/date-picker/index.d.ts +111 -111
- package/date-range/index.d.ts +5 -5
- package/dialog/index.d.ts +18 -18
- package/divider/index.d.ts +3 -3
- package/drag-drop/index.d.ts +7 -7
- package/dropdown/index.d.ts +10 -10
- package/empty/index.d.ts +12 -12
- package/fesm2022/ngx-tethys-action.mjs +14 -12
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-affix.mjs +7 -7
- package/fesm2022/ngx-tethys-affix.mjs.map +1 -1
- package/fesm2022/ngx-tethys-alert.mjs +10 -10
- package/fesm2022/ngx-tethys-anchor.mjs +65 -28
- package/fesm2022/ngx-tethys-anchor.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +7 -7
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +19 -18
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-avatar.mjs +23 -22
- package/fesm2022/ngx-tethys-avatar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-back-top.mjs +7 -7
- package/fesm2022/ngx-tethys-badge.mjs +7 -7
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +10 -10
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +16 -16
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-calendar.mjs +16 -16
- package/fesm2022/ngx-tethys-calendar.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +13 -13
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-carousel.mjs +15 -15
- package/fesm2022/ngx-tethys-carousel.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +41 -34
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-checkbox.mjs +7 -7
- package/fesm2022/ngx-tethys-collapse.mjs +10 -10
- package/fesm2022/ngx-tethys-color-picker.mjs +65 -57
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-comment.mjs +13 -13
- package/fesm2022/ngx-tethys-copy.mjs +10 -10
- package/fesm2022/ngx-tethys-copy.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs +30 -25
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +184 -174
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-range.mjs +16 -16
- package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +24 -24
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +7 -7
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dot.mjs +7 -7
- package/fesm2022/ngx-tethys-drag-drop.mjs +24 -24
- package/fesm2022/ngx-tethys-drag-drop.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +48 -47
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-empty.mjs +13 -13
- package/fesm2022/ngx-tethys-empty.mjs.map +1 -1
- package/fesm2022/ngx-tethys-flexible-text.mjs +7 -7
- package/fesm2022/ngx-tethys-flexible-text.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +64 -61
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-fullscreen.mjs +18 -15
- package/fesm2022/ngx-tethys-fullscreen.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +34 -33
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-guider.mjs +25 -24
- package/fesm2022/ngx-tethys-guider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-i18n.mjs +3 -3
- package/fesm2022/ngx-tethys-i18n.mjs.map +1 -1
- package/fesm2022/ngx-tethys-icon.mjs +15 -13
- package/fesm2022/ngx-tethys-icon.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +31 -29
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +17 -10
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +27 -26
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs +63 -63
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-list.mjs +21 -18
- package/fesm2022/ngx-tethys-list.mjs.map +1 -1
- package/fesm2022/ngx-tethys-loading.mjs +7 -7
- package/fesm2022/ngx-tethys-mention.mjs +35 -31
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +26 -26
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-message.mjs +24 -24
- package/fesm2022/ngx-tethys-message.mjs.map +1 -1
- package/fesm2022/ngx-tethys-native-table.mjs +1119 -0
- package/fesm2022/ngx-tethys-native-table.mjs.map +1 -0
- package/fesm2022/ngx-tethys-nav.mjs +27 -27
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +20 -20
- package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +18 -18
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs +22 -21
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +17 -17
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property-operation.mjs +11 -11
- package/fesm2022/ngx-tethys-property-operation.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs +15 -12
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +17 -17
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-rate.mjs +12 -12
- package/fesm2022/ngx-tethys-rate.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +21 -18
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-result.mjs +11 -11
- package/fesm2022/ngx-tethys-result.mjs.map +1 -1
- package/fesm2022/ngx-tethys-segment.mjs +19 -16
- package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +95 -46
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +85 -81
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-skeleton.mjs +32 -32
- package/fesm2022/ngx-tethys-skeleton.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +37 -36
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +11 -11
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +10 -10
- package/fesm2022/ngx-tethys-statistic.mjs +7 -7
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +22 -22
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +7 -7
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +7 -7
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +28 -28
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +13 -13
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tag.mjs +11 -11
- package/fesm2022/ngx-tethys-tag.mjs.map +1 -1
- package/fesm2022/ngx-tethys-testing.mjs +1 -1
- package/fesm2022/ngx-tethys-testing.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +22 -22
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +14 -14
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tooltip.mjs +36 -29
- package/fesm2022/ngx-tethys-tooltip.mjs.map +1 -1
- package/fesm2022/ngx-tethys-transfer.mjs +15 -15
- package/fesm2022/ngx-tethys-transfer.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +17 -17
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs +50 -43
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +16 -16
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys-upload.mjs +26 -25
- package/fesm2022/ngx-tethys-upload.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs +11 -5
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-vote.mjs +7 -7
- package/fesm2022/ngx-tethys-watermark.mjs +18 -15
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/flexible-text/index.d.ts +5 -5
- package/form/index.d.ts +26 -22
- package/fullscreen/index.d.ts +4 -4
- package/grid/index.d.ts +12 -12
- package/guider/index.d.ts +10 -10
- package/i18n/index.d.ts +1 -1
- package/icon/index.d.ts +3 -3
- package/image/index.d.ts +12 -12
- package/input/index.d.ts +23 -23
- package/input-number/index.d.ts +4 -4
- package/layout/index.d.ts +16 -16
- package/list/index.d.ts +16 -15
- package/mention/index.d.ts +4 -4
- package/menu/index.d.ts +7 -7
- package/message/index.d.ts +5 -5
- package/native-table/index.d.ts +305 -0
- package/native-table/styles/native-table.scss +174 -0
- package/nav/index.d.ts +12 -12
- package/notify/index.d.ts +1 -1
- package/package.json +5 -1
- package/pagination/index.d.ts +21 -17
- package/popover/index.d.ts +8 -8
- package/progress/index.d.ts +18 -18
- package/property/index.d.ts +6 -6
- package/property-operation/index.d.ts +3 -3
- package/radio/index.d.ts +6 -6
- package/rate/index.d.ts +5 -5
- package/resizable/index.d.ts +2 -2
- package/result/index.d.ts +8 -8
- package/schematics/testing/test-workspace.js +1 -0
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/segment/index.d.ts +9 -9
- package/select/index.d.ts +28 -22
- package/shared/index.d.ts +31 -30
- package/shared/option/styles/select-dropdown.scss +5 -2
- package/skeleton/index.d.ts +52 -52
- package/slide/index.d.ts +5 -5
- package/slider/index.d.ts +6 -6
- package/space/index.d.ts +1 -1
- package/statistic/index.d.ts +18 -18
- package/stepper/index.d.ts +8 -8
- package/styles/index.scss +1 -0
- package/switch/index.d.ts +2 -2
- package/table/index.d.ts +24 -24
- package/tabs/index.d.ts +6 -6
- package/testing/index.d.ts +1 -1
- package/time-picker/index.d.ts +21 -21
- package/timeline/index.d.ts +8 -8
- package/tooltip/index.d.ts +12 -12
- package/transfer/index.d.ts +16 -16
- package/tree/index.d.ts +28 -28
- package/tree-select/index.d.ts +13 -13
- package/typography/index.d.ts +3 -3
- package/upload/index.d.ts +4 -4
- package/util/index.d.ts +17 -7
- package/vote/index.d.ts +2 -2
- package/watermark/index.d.ts +2 -2
package/dialog/index.d.ts
CHANGED
|
@@ -149,11 +149,11 @@ declare class ThyDialogHeader implements OnInit {
|
|
|
149
149
|
/**
|
|
150
150
|
* 自定义头部模板
|
|
151
151
|
*/
|
|
152
|
-
readonly headerTemplate: Signal<TemplateRef<any
|
|
152
|
+
readonly headerTemplate: Signal<TemplateRef<any> | undefined>;
|
|
153
153
|
/**
|
|
154
154
|
* 标题
|
|
155
155
|
*/
|
|
156
|
-
readonly thyTitle: i0.InputSignal<string>;
|
|
156
|
+
readonly thyTitle: i0.InputSignal<string | undefined>;
|
|
157
157
|
/**
|
|
158
158
|
* 大小,只有大的详情页场景会使用 lg,左右 padding 缩小至 20px
|
|
159
159
|
* @type lg | md
|
|
@@ -166,16 +166,16 @@ declare class ThyDialogHeader implements OnInit {
|
|
|
166
166
|
/**
|
|
167
167
|
* 标题的多语言 Key
|
|
168
168
|
*/
|
|
169
|
-
readonly thyTitleTranslationKey: i0.InputSignal<string>;
|
|
169
|
+
readonly thyTitleTranslationKey: i0.InputSignal<string | undefined>;
|
|
170
170
|
readonly title: Signal<string>;
|
|
171
171
|
/**
|
|
172
172
|
* 头部图标
|
|
173
173
|
*/
|
|
174
|
-
readonly thyIcon: i0.InputSignal<string>;
|
|
174
|
+
readonly thyIcon: i0.InputSignal<string | undefined>;
|
|
175
175
|
/**
|
|
176
176
|
* 关闭事件
|
|
177
177
|
*/
|
|
178
|
-
readonly thyOnClose: i0.OutputEmitterRef<Event>;
|
|
178
|
+
readonly thyOnClose: i0.OutputEmitterRef<Event | undefined>;
|
|
179
179
|
ngOnInit(): void;
|
|
180
180
|
close(event?: Event): void;
|
|
181
181
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThyDialogHeader, never>;
|
|
@@ -209,19 +209,19 @@ declare class ThyDialogFooter implements OnInit {
|
|
|
209
209
|
* 自定义弹出框底部的描述模板
|
|
210
210
|
* @type TemplateRef
|
|
211
211
|
*/
|
|
212
|
-
readonly description: i0.Signal<TemplateRef<any
|
|
212
|
+
readonly description: i0.Signal<TemplateRef<any> | undefined>;
|
|
213
213
|
/**
|
|
214
214
|
* 底部是否有分割线,可全局配置默认值
|
|
215
215
|
* @type boolean
|
|
216
216
|
*/
|
|
217
|
-
readonly thyDivided: i0.InputSignalWithTransform<boolean, unknown>;
|
|
218
|
-
divided: i0.Signal<boolean>;
|
|
217
|
+
readonly thyDivided: i0.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
218
|
+
divided: i0.Signal<boolean | undefined>;
|
|
219
219
|
/**
|
|
220
220
|
* 对齐方式,可全局配置默认值
|
|
221
221
|
* @type left | right | center
|
|
222
222
|
*/
|
|
223
|
-
readonly thyAlign: i0.InputSignal<ThyDialogFooterAlign>;
|
|
224
|
-
readonly align: i0.Signal<ThyDialogFooterAlign>;
|
|
223
|
+
readonly thyAlign: i0.InputSignal<ThyDialogFooterAlign | undefined>;
|
|
224
|
+
readonly align: i0.Signal<ThyDialogFooterAlign | undefined>;
|
|
225
225
|
private hostRenderer;
|
|
226
226
|
constructor();
|
|
227
227
|
ngOnInit(): void;
|
|
@@ -305,14 +305,14 @@ declare class ThyConfirm implements OnInit, OnDestroy {
|
|
|
305
305
|
private defaultConfig;
|
|
306
306
|
private locale;
|
|
307
307
|
loading: boolean;
|
|
308
|
-
readonly options: i0.InputSignal<ThyConfirmConfig>;
|
|
309
|
-
title: string;
|
|
308
|
+
readonly options: i0.InputSignal<ThyConfirmConfig | undefined>;
|
|
309
|
+
title: string | undefined;
|
|
310
310
|
content: string;
|
|
311
|
-
okText: string;
|
|
312
|
-
okType: string;
|
|
313
|
-
cancelText: string;
|
|
314
|
-
okLoadingText: string;
|
|
315
|
-
footerAlign: ThyFormGroupFooterAlign;
|
|
311
|
+
okText: string | undefined;
|
|
312
|
+
okType: string | undefined;
|
|
313
|
+
cancelText: string | undefined;
|
|
314
|
+
okLoadingText: string | undefined;
|
|
315
|
+
footerAlign: ThyFormGroupFooterAlign | undefined;
|
|
316
316
|
constructor();
|
|
317
317
|
ngOnInit(): void;
|
|
318
318
|
confirm(): void;
|
|
@@ -371,7 +371,7 @@ declare class ThyDialog extends ThyAbstractOverlayService<ThyDialogConfig, ThyDi
|
|
|
371
371
|
* @description.en-us Finds the closest ThyDialogRef to an element by looking at the DOM.
|
|
372
372
|
* @description 获取与指定元素最接近的 ThyDialogRef
|
|
373
373
|
*/
|
|
374
|
-
getClosestDialog(element: HTMLElement): ThyDialogRef<any> | undefined;
|
|
374
|
+
getClosestDialog(element: HTMLElement): ThyDialogRef<any> | undefined | null;
|
|
375
375
|
/**
|
|
376
376
|
* Update dialog to top
|
|
377
377
|
*/
|
package/divider/index.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ declare class ThyDivider implements OnInit {
|
|
|
30
30
|
/**
|
|
31
31
|
* 中间文本内容,支持文字和模板
|
|
32
32
|
*/
|
|
33
|
-
readonly thyText: _angular_core.InputSignal<string | TemplateRef<HTMLElement
|
|
34
|
-
readonly templateContent: Signal<TemplateRef<HTMLElement
|
|
35
|
-
readonly textContent: Signal<string>;
|
|
33
|
+
readonly thyText: _angular_core.InputSignal<string | TemplateRef<HTMLElement> | undefined>;
|
|
34
|
+
readonly templateContent: Signal<TemplateRef<HTMLElement> | undefined>;
|
|
35
|
+
readonly textContent: Signal<string | undefined>;
|
|
36
36
|
/**
|
|
37
37
|
* 中间内容的方向
|
|
38
38
|
* @type left | right | center
|
package/drag-drop/index.d.ts
CHANGED
|
@@ -73,12 +73,12 @@ declare class ThyDragDropService<T = any> {
|
|
|
73
73
|
/**
|
|
74
74
|
* 当前拖拽项,dragEnd 后重置为 undefined
|
|
75
75
|
*/
|
|
76
|
-
previousDrag
|
|
76
|
+
previousDrag?: IThyDragDirective<T>;
|
|
77
77
|
/**
|
|
78
78
|
* 拖拽的时候,针对 dragOver 的节点有三种情况,即拖拽到节点之上 before ,拖拽到节点上 in ,拖拽到节点之下 after
|
|
79
79
|
* @type ThyDropPosition
|
|
80
80
|
*/
|
|
81
|
-
dropPosition
|
|
81
|
+
dropPosition?: ThyDropPosition;
|
|
82
82
|
/**
|
|
83
83
|
* 用于拖动过程对 dragover 的元素设置相应的样式
|
|
84
84
|
* @type Map<Element, string>
|
|
@@ -99,7 +99,7 @@ declare class DragRef<T = any> {
|
|
|
99
99
|
private rootElement;
|
|
100
100
|
private contentElement;
|
|
101
101
|
private target;
|
|
102
|
-
private handles
|
|
102
|
+
private handles?;
|
|
103
103
|
private ngUnsubscribe$;
|
|
104
104
|
started: Subject<ThyDragStartEvent<any>>;
|
|
105
105
|
ended: Subject<ThyDragEndEvent<any>>;
|
|
@@ -240,19 +240,19 @@ declare class ThyDropContainerDirective<T = any> implements OnInit, AfterContent
|
|
|
240
240
|
/**
|
|
241
241
|
* 开始拖拽时调用
|
|
242
242
|
*/
|
|
243
|
-
started: EventEmitter<ThyDragStartEvent<ThyDragDirective<any>>>;
|
|
243
|
+
readonly started: EventEmitter<ThyDragStartEvent<ThyDragDirective<any>>>;
|
|
244
244
|
/**
|
|
245
245
|
* dragend 触发时调用
|
|
246
246
|
*/
|
|
247
|
-
ended: EventEmitter<ThyDragEndEvent<ThyDragDirective<any>>>;
|
|
247
|
+
readonly ended: EventEmitter<ThyDragEndEvent<ThyDragDirective<any>>>;
|
|
248
248
|
/**
|
|
249
249
|
* dragover 触发时调用
|
|
250
250
|
*/
|
|
251
|
-
overed: EventEmitter<ThyDragOverEvent<ThyDragDirective<any>>>;
|
|
251
|
+
readonly overed: EventEmitter<ThyDragOverEvent<ThyDragDirective<any>>>;
|
|
252
252
|
/**
|
|
253
253
|
* drop 触发时调用
|
|
254
254
|
*/
|
|
255
|
-
dropped: EventEmitter<ThyDragDropEvent<ThyDragDirective<any>>>;
|
|
255
|
+
readonly dropped: EventEmitter<ThyDragDropEvent<ThyDragDirective<any>>>;
|
|
256
256
|
/**
|
|
257
257
|
* @internal
|
|
258
258
|
*/
|
package/dropdown/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare class ThyDropdownMenuGroup {
|
|
|
46
46
|
/**
|
|
47
47
|
* 分组标题
|
|
48
48
|
*/
|
|
49
|
-
readonly thyTitle: i0.InputSignal<string>;
|
|
49
|
+
readonly thyTitle: i0.InputSignal<string | undefined>;
|
|
50
50
|
constructor();
|
|
51
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThyDropdownMenuGroup, never>;
|
|
52
52
|
static ɵcmp: i0.ɵɵComponentDeclaration<ThyDropdownMenuGroup, "thy-dropdown-menu-group", never, { "thyTitle": { "alias": "thyTitle"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
@@ -72,16 +72,16 @@ declare class ThyDropdownDirective extends ThyOverlayDirectiveBase implements On
|
|
|
72
72
|
private viewContainerRef;
|
|
73
73
|
private popover;
|
|
74
74
|
readonly menu: Signal<ThyDropdownMenu>;
|
|
75
|
-
private popoverRef
|
|
75
|
+
private popoverRef?;
|
|
76
76
|
popoverOpened: boolean;
|
|
77
77
|
/**
|
|
78
78
|
* Dropdown 下拉菜单,支持 thy-dropdown-menu 组件、TemplateRef 和自定义菜单组件
|
|
79
79
|
*/
|
|
80
|
-
readonly thyDropdownMenu: i0.InputSignal<ThyDropdownMenu>;
|
|
80
|
+
readonly thyDropdownMenu: i0.InputSignal<ThyDropdownMenu | undefined>;
|
|
81
81
|
/**
|
|
82
82
|
* Dropdown 下拉菜单组件,和 thyDropdownMenu 参与相同,快捷传下拉菜单组件参数
|
|
83
83
|
*/
|
|
84
|
-
readonly thyDropdown: i0.InputSignal<ThyDropdownMenu>;
|
|
84
|
+
readonly thyDropdown: i0.InputSignal<ThyDropdownMenu | undefined>;
|
|
85
85
|
/**
|
|
86
86
|
* 下拉菜单触发方式
|
|
87
87
|
* @type 'hover' | 'focus' | 'click' | string
|
|
@@ -103,16 +103,16 @@ declare class ThyDropdownDirective extends ThyOverlayDirectiveBase implements On
|
|
|
103
103
|
/**
|
|
104
104
|
* 弹出框的参数,底层使用 Popover 组件, 默认为`{ placement: "bottomLeft", insideClosable: true, minWidth: "240px", outsideClosable: true }`
|
|
105
105
|
*/
|
|
106
|
-
readonly thyPopoverOptions: i0.InputSignal<Pick<ThyPopoverConfig<unknown>, "height" | "minWidth" | "placement" | "insideClosable" | "outsideClosable"
|
|
106
|
+
readonly thyPopoverOptions: i0.InputSignal<Pick<ThyPopoverConfig<unknown>, "height" | "minWidth" | "placement" | "insideClosable" | "outsideClosable"> | undefined>;
|
|
107
107
|
/**
|
|
108
108
|
* 弹出框的显示位置,会覆盖 thyPopoverOptions 中的 placement,`top` | `topLeft` | `topRight` | `bottom` | `bottomLeft` | `bottomRight` | `left` | `leftTop` | `leftBottom` | `right` | `rightTop` | `rightBottom`
|
|
109
109
|
* @default bottomLeft
|
|
110
110
|
*/
|
|
111
|
-
readonly thyPlacement: i0.InputSignal<ThyPlacement>;
|
|
111
|
+
readonly thyPlacement: i0.InputSignal<ThyPlacement | undefined>;
|
|
112
112
|
/**
|
|
113
113
|
* 点击 dropdown-menu 内部是否关闭弹出框,会覆盖 thyPopoverOptions 中的 insideClosable
|
|
114
114
|
*/
|
|
115
|
-
readonly thyMenuInsideClosable: i0.InputSignalWithTransform<boolean, unknown>;
|
|
115
|
+
readonly thyMenuInsideClosable: i0.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
116
116
|
/**
|
|
117
117
|
* 弹出框 overlay panel 的类名
|
|
118
118
|
* @type string | string[]
|
|
@@ -125,8 +125,8 @@ declare class ThyDropdownDirective extends ThyOverlayDirectiveBase implements On
|
|
|
125
125
|
constructor();
|
|
126
126
|
ngOnInit(): void;
|
|
127
127
|
createOverlay(): OverlayRef;
|
|
128
|
-
show(delay?: number): void;
|
|
129
|
-
hide(delay?: number): void;
|
|
128
|
+
show(delay?: number | undefined): void;
|
|
129
|
+
hide(delay?: number | undefined): void;
|
|
130
130
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThyDropdownDirective, never>;
|
|
131
131
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ThyDropdownDirective, "[thyDropdown]", never, { "thyDropdownMenu": { "alias": "thyDropdownMenu"; "required": false; "isSignal": true; }; "thyDropdown": { "alias": "thyDropdown"; "required": false; "isSignal": true; }; "thyTrigger": { "alias": "thyTrigger"; "required": false; "isSignal": true; }; "thyShowDelay": { "alias": "thyShowDelay"; "required": false; "isSignal": true; }; "thyHideDelay": { "alias": "thyHideDelay"; "required": false; "isSignal": true; }; "thyActiveClass": { "alias": "thyActiveClass"; "required": false; "isSignal": true; }; "thyPopoverOptions": { "alias": "thyPopoverOptions"; "required": false; "isSignal": true; }; "thyPlacement": { "alias": "thyPlacement"; "required": false; "isSignal": true; }; "thyMenuInsideClosable": { "alias": "thyMenuInsideClosable"; "required": false; "isSignal": true; }; "thyPanelClass": { "alias": "thyPanelClass"; "required": false; "isSignal": true; }; }, { "thyActiveChange": "thyActiveChange"; }, never, never, true, never>;
|
|
132
132
|
}
|
|
@@ -144,7 +144,7 @@ declare class ThyDropdownActiveDirective implements OnInit, AfterContentInit {
|
|
|
144
144
|
* 设置 Active 样式类,可以是一个或多个CSS类
|
|
145
145
|
* @type string[] | string
|
|
146
146
|
*/
|
|
147
|
-
readonly thyDropdownActive: i0.InputSignal<string | string[]>;
|
|
147
|
+
readonly thyDropdownActive: i0.InputSignal<string | string[] | undefined>;
|
|
148
148
|
/**
|
|
149
149
|
* @private
|
|
150
150
|
*/
|
package/empty/index.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ declare class ThyEmpty implements AfterViewInit {
|
|
|
25
25
|
* 显示文本提示信息。同时传入 thyMessage,thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
|
|
26
26
|
* @default 暂无数据
|
|
27
27
|
*/
|
|
28
|
-
readonly thyMessage: _angular_core.InputSignal<string>;
|
|
28
|
+
readonly thyMessage: _angular_core.InputSignal<string | undefined>;
|
|
29
29
|
/**
|
|
30
30
|
* 已废弃。显示文本提示信息多语言 Key。同时传入 thyTranslationKey,thyEntityName,thyEntityNameTranslateKey 时优先级最高
|
|
31
31
|
* @deprecated
|
|
32
32
|
*/
|
|
33
|
-
readonly thyTranslationKey: _angular_core.InputSignal<string>;
|
|
33
|
+
readonly thyTranslationKey: _angular_core.InputSignal<string | undefined>;
|
|
34
34
|
/**
|
|
35
35
|
* 已废弃。显示文本提示信息多语言 Key 的 Values。传入 thyTranslationKey 后,传入这个才会生效
|
|
36
36
|
* @deprecated
|
|
@@ -40,16 +40,16 @@ declare class ThyEmpty implements AfterViewInit {
|
|
|
40
40
|
* 已废弃。显示默认提示信息,替换默认提示信息的目标对象,比如:没有 {thyEntityName}。同时传入 thyEntityName,thyEntityNameTranslateKey 时优先级较高
|
|
41
41
|
* @deprecated
|
|
42
42
|
*/
|
|
43
|
-
readonly thyEntityName: _angular_core.InputSignal<string>;
|
|
43
|
+
readonly thyEntityName: _angular_core.InputSignal<string | undefined>;
|
|
44
44
|
/**
|
|
45
45
|
* 已废弃。thyEntityName 的多语言 Key。thyMessage,thyTranslationKey,thyEntityName 均未传入时才会生效
|
|
46
46
|
* @deprecated
|
|
47
47
|
*/
|
|
48
|
-
readonly thyEntityNameTranslateKey: _angular_core.InputSignal<string>;
|
|
48
|
+
readonly thyEntityNameTranslateKey: _angular_core.InputSignal<string | undefined>;
|
|
49
49
|
/**
|
|
50
50
|
* 提示图标名
|
|
51
51
|
*/
|
|
52
|
-
readonly thyIconName: _angular_core.InputSignal<string>;
|
|
52
|
+
readonly thyIconName: _angular_core.InputSignal<string | undefined>;
|
|
53
53
|
/**
|
|
54
54
|
* 大小
|
|
55
55
|
* @type sm | md | lg
|
|
@@ -59,7 +59,7 @@ declare class ThyEmpty implements AfterViewInit {
|
|
|
59
59
|
/**
|
|
60
60
|
* 距上距离
|
|
61
61
|
*/
|
|
62
|
-
readonly thyMarginTop: _angular_core.InputSignal<string | number>;
|
|
62
|
+
readonly thyMarginTop: _angular_core.InputSignal<string | number | undefined>;
|
|
63
63
|
/**
|
|
64
64
|
* 是否自动根据父容器计算高度,垂直居中
|
|
65
65
|
* @default false
|
|
@@ -68,23 +68,23 @@ declare class ThyEmpty implements AfterViewInit {
|
|
|
68
68
|
/**
|
|
69
69
|
* 自动计算高度垂直居中(即 thyTopAuto 为 true)时,支持传入自定义父容器
|
|
70
70
|
*/
|
|
71
|
-
readonly thyContainer: _angular_core.InputSignal<ElementRef<any
|
|
71
|
+
readonly thyContainer: _angular_core.InputSignal<ElementRef<any> | undefined>;
|
|
72
72
|
/**
|
|
73
73
|
* 提示图片链接
|
|
74
74
|
*/
|
|
75
|
-
readonly thyImageUrl: _angular_core.InputSignal<string>;
|
|
76
|
-
readonly thyImageLoading: _angular_core.InputSignal<ThyEmptyImageLoading>;
|
|
77
|
-
readonly thyImageFetchPriority: _angular_core.InputSignal<ThyEmptyImageFetchPriority>;
|
|
75
|
+
readonly thyImageUrl: _angular_core.InputSignal<string | undefined>;
|
|
76
|
+
readonly thyImageLoading: _angular_core.InputSignal<ThyEmptyImageLoading | undefined>;
|
|
77
|
+
readonly thyImageFetchPriority: _angular_core.InputSignal<ThyEmptyImageFetchPriority | undefined>;
|
|
78
78
|
/**
|
|
79
79
|
* 显示文本描述
|
|
80
80
|
*/
|
|
81
|
-
readonly thyDescription: _angular_core.InputSignal<string>;
|
|
81
|
+
readonly thyDescription: _angular_core.InputSignal<string | undefined>;
|
|
82
82
|
private hostRenderer;
|
|
83
83
|
/**
|
|
84
84
|
* 除提示图片,文本外的其他信息传入模板
|
|
85
85
|
* @type TemplateRef
|
|
86
86
|
*/
|
|
87
|
-
readonly extraTemplateRef: Signal<TemplateRef<any
|
|
87
|
+
readonly extraTemplateRef: Signal<TemplateRef<any> | undefined>;
|
|
88
88
|
protected readonly presetSvg: Signal<_angular_platform_browser.SafeHtml>;
|
|
89
89
|
protected readonly displayText: _angular_core.WritableSignal<any>;
|
|
90
90
|
setMessage(text: string): void;
|
|
@@ -36,8 +36,10 @@ class ThyAction {
|
|
|
36
36
|
this.cdr = inject(ChangeDetectorRef);
|
|
37
37
|
this.icon = computed(() => this.thyActionIcon() || this.thyIcon(), ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
38
38
|
this.feedback = null;
|
|
39
|
+
this.feedbackOptions = null;
|
|
39
40
|
this.active = computed(() => this.thyActionActive() || this.thyActive(), ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
40
41
|
this.hostRenderer = useHostRenderer();
|
|
42
|
+
this.feedbackTimer = null;
|
|
41
43
|
/**
|
|
42
44
|
* 操作图标的类型
|
|
43
45
|
* @type primary | success | danger | warning
|
|
@@ -124,7 +126,7 @@ class ThyAction {
|
|
|
124
126
|
});
|
|
125
127
|
}
|
|
126
128
|
updateClasses() {
|
|
127
|
-
|
|
129
|
+
const classNames = [];
|
|
128
130
|
classNames.push(`action-${this.thyType()}`);
|
|
129
131
|
if (this.thyTheme() === 'lite') {
|
|
130
132
|
classNames.push('thy-action-lite');
|
|
@@ -134,10 +136,10 @@ class ThyAction {
|
|
|
134
136
|
ngOnDestroy() {
|
|
135
137
|
this.feedbackTimer?.unsubscribe();
|
|
136
138
|
}
|
|
137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
138
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAction, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ThyAction, isStandalone: true, selector: "thy-action, [thyAction]", inputs: { thyType: { classPropertyName: "thyType", publicName: "thyType", isSignal: true, isRequired: false, transformFunction: null }, thyIcon: { classPropertyName: "thyIcon", publicName: "thyIcon", isSignal: true, isRequired: false, transformFunction: null }, thyActionIcon: { classPropertyName: "thyActionIcon", publicName: "thyActionIcon", isSignal: true, isRequired: false, transformFunction: null }, thyActive: { classPropertyName: "thyActive", publicName: "thyActive", isSignal: true, isRequired: false, transformFunction: null }, thyActionActive: { classPropertyName: "thyActionActive", publicName: "thyActionActive", isSignal: true, isRequired: false, transformFunction: null }, thyTheme: { classPropertyName: "thyTheme", publicName: "thyTheme", isSignal: true, isRequired: false, transformFunction: null }, thyHoverIcon: { classPropertyName: "thyHoverIcon", publicName: "thyHoverIcon", isSignal: true, isRequired: false, transformFunction: null }, thyDisabled: { classPropertyName: "thyDisabled", publicName: "thyDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.active": "active()", "class.thy-action-hover-icon": "thyHoverIcon()", "class.thy-action-has-feedback": "!!feedback", "class.disabled": "thyDisabled()" }, classAttribute: "thy-action" }, ngImport: i0, template: "@if (icon() && !feedback) {\n <thy-icon [thyIconName]=\"icon()\"></thy-icon>\n}\n@if (feedbackOptions?.icon) {\n <thy-icon [class]=\"feedbackOptions.class\" [thyIconName]=\"feedbackOptions.icon\"></thy-icon>\n}\n@if (thyHoverIcon()) {\n <thy-icon class=\"hover-icon\" [thyIconName]=\"thyHoverIcon()\"></thy-icon>\n}\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
139
141
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAction, decorators: [{
|
|
141
143
|
type: Component,
|
|
142
144
|
args: [{ selector: 'thy-action, [thyAction]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
143
145
|
class: 'thy-action',
|
|
@@ -170,14 +172,14 @@ class ThyActions {
|
|
|
170
172
|
actions.forEach((action, index) => {
|
|
171
173
|
// can't set marginRight value for last item
|
|
172
174
|
if (index !== actions.length - 1) {
|
|
173
|
-
action.setMarginRight(getNumericSize(this.thySize(), 'md')
|
|
175
|
+
action.setMarginRight(`${getNumericSize(this.thySize(), 'md')}px`);
|
|
174
176
|
}
|
|
175
177
|
});
|
|
176
178
|
}
|
|
177
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
179
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyActions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
180
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.15", type: ThyActions, isStandalone: true, selector: "thy-actions", inputs: { thySize: { classPropertyName: "thySize", publicName: "thySize", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "thy-actions" }, queries: [{ propertyName: "actions", predicate: ThyAction, isSignal: true }], ngImport: i0, template: ` <ng-content></ng-content> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
179
181
|
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyActions, decorators: [{
|
|
181
183
|
type: Component,
|
|
182
184
|
args: [{
|
|
183
185
|
selector: 'thy-actions',
|
|
@@ -190,11 +192,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
190
192
|
}], ctorParameters: () => [], propDecorators: { actions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ThyAction), { isSignal: true }] }], thySize: [{ type: i0.Input, args: [{ isSignal: true, alias: "thySize", required: false }] }] } });
|
|
191
193
|
|
|
192
194
|
class ThyActionModule {
|
|
193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
194
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
195
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
195
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
196
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ThyActionModule, imports: [CommonModule, ThyIconModule, ThyAction, ThyActions], exports: [ThyAction, ThyActions] }); }
|
|
197
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyActionModule, imports: [CommonModule, ThyIconModule, ThyAction] }); }
|
|
196
198
|
}
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyActionModule, decorators: [{
|
|
198
200
|
type: NgModule,
|
|
199
201
|
args: [{
|
|
200
202
|
imports: [CommonModule, ThyIconModule, ThyAction, ThyActions],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-action.mjs","sources":["../../../src/action/action.component.ts","../../../src/action/action.component.html","../../../src/action/actions.component.ts","../../../src/action/action.module.ts","../../../src/action/ngx-tethys-action.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n Signal,\n computed,\n effect,\n inject,\n input\n} from '@angular/core';\nimport { useHostRenderer } from '@tethys/cdk/dom';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { Subscription, timer } from 'rxjs';\n\nexport type ThyActionType = 'primary' | 'success' | 'danger' | 'warning';\n\nexport type ThyActionFeedback = 'success' | 'error';\n\nexport interface ThyActionFeedbackOptions {\n icon?: string;\n class?: string;\n duration?: number;\n}\n\nconst defaultFeedbackOptions: Record<ThyActionFeedback, ThyActionFeedbackOptions> = {\n success: {\n icon: 'check-circle-fill',\n class: 'text-success',\n duration: 3000\n },\n error: {\n icon: 'close-circle-fill',\n class: 'text-danger',\n duration: 3000\n }\n};\n/**\n * 立即操作组件\n * @name thy-action,[thyAction]\n */\n@Component({\n selector: 'thy-action, [thyAction]',\n templateUrl: './action.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-action',\n '[class.active]': 'active()',\n '[class.thy-action-hover-icon]': 'thyHoverIcon()',\n '[class.thy-action-has-feedback]': '!!feedback',\n '[class.disabled]': 'thyDisabled()'\n },\n imports: [ThyIcon]\n})\nexport class ThyAction implements OnInit, AfterViewInit, OnDestroy {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private renderer = inject(Renderer2);\n private cdr = inject(ChangeDetectorRef);\n\n public readonly icon: Signal<string> = computed(() => this.thyActionIcon() || this.thyIcon());\n\n feedback: ThyActionFeedback = null;\n\n feedbackOptions: ThyActionFeedbackOptions;\n\n readonly active: Signal<boolean> = computed(() => this.thyActionActive() || this.thyActive());\n\n private hostRenderer = useHostRenderer();\n\n private feedbackTimer: Subscription;\n\n /**\n * 操作图标的类型\n * @type primary | success | danger | warning\n */\n readonly thyType = input<ThyActionType, ThyActionType>('primary', {\n transform: (value: ThyActionType) => value || 'primary'\n });\n\n /**\n * 操作图标,支持传参同时也支持在投影中写 thy-icon 组件\n */\n readonly thyIcon = input<string>('');\n\n /**\n * 操作图标,当 thyIcon 和其他指令参数名有冲突时使用 thyActionIcon\n */\n readonly thyActionIcon = input<string>('');\n\n /**\n * 操作的图标 Active 状态,设置为 true 时会在 Item 上添加 active class\n */\n readonly thyActive = input(false, { transform: coerceBooleanProperty });\n\n /**\n * 操作的图标 Active 状态,当 thyActive 和其他指令参数名有冲突时使用 thyActionActive\n */\n readonly thyActionActive = input(false, { transform: coerceBooleanProperty });\n\n /**\n * 操作图标的主题\n * @type fill(背景色填充) | lite(简单文本颜色变化)\n */\n readonly thyTheme = input<'fill' | 'lite'>('fill');\n\n /**\n * Hover 展示的图标\n */\n readonly thyHoverIcon = input<string>();\n\n /**\n * 是否处于禁用状态\n */\n readonly thyDisabled = input(false, { transform: coerceBooleanProperty });\n\n ngOnInit(): void {\n this.updateClasses();\n }\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n }\n\n constructor() {\n effect(() => {\n this.updateClasses();\n });\n }\n\n setMarginRight(marginRight: string) {\n this.elementRef.nativeElement.style.marginRight = marginRight;\n }\n\n /**\n * 触发成功反馈操作\n */\n success(options?: ThyActionFeedbackOptions) {\n this.setFeedback('success', options);\n }\n\n /**\n * 触发失败反馈操作\n */\n error(options?: ThyActionFeedbackOptions) {\n this.setFeedback('error', options);\n }\n\n private setFeedback(feedback: ThyActionFeedback, options: ThyActionFeedbackOptions) {\n if (this.thyDisabled()) {\n return;\n }\n options = Object.assign({}, defaultFeedbackOptions[feedback], options);\n this.feedback = feedback;\n this.feedbackOptions = options;\n this.cdr.markForCheck();\n if (options.duration) {\n if (this.feedbackTimer) {\n this.feedbackTimer.unsubscribe();\n }\n this.feedbackTimer = timer(options.duration).subscribe(() => {\n this.feedback = null;\n this.feedbackOptions = null;\n this.cdr.markForCheck();\n });\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n // this.renderer.addClass(span, 'thy-action-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n\n private updateClasses() {\n let classNames: string[] = [];\n classNames.push(`action-${this.thyType()}`);\n if (this.thyTheme() === 'lite') {\n classNames.push('thy-action-lite');\n }\n this.hostRenderer.updateClass(classNames);\n }\n\n ngOnDestroy(): void {\n this.feedbackTimer?.unsubscribe();\n }\n}\n","@if (icon() && !feedback) {\n <thy-icon [thyIconName]=\"icon()\"></thy-icon>\n}\n@if (feedbackOptions?.icon) {\n <thy-icon [class]=\"feedbackOptions.class\" [thyIconName]=\"feedbackOptions.icon\"></thy-icon>\n}\n@if (thyHoverIcon()) {\n <thy-icon class=\"hover-icon\" [thyIconName]=\"thyHoverIcon()\"></thy-icon>\n}\n<ng-content></ng-content>\n","import { ChangeDetectionStrategy, Component, OnInit, contentChildren, effect, input } from '@angular/core';\nimport { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';\nimport { ThyAction } from './action.component';\n\n/**\n * Actions 组件\n * @name thy-actions\n */\n@Component({\n selector: 'thy-actions',\n template: ` <ng-content></ng-content> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-actions'\n }\n})\nexport class ThyActions implements OnInit {\n readonly actions = contentChildren<ThyAction>(ThyAction);\n\n /**\n * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小\n * @type string | number\n */\n readonly thySize = input<ThySpacingSize>('md');\n\n constructor() {\n effect(() => {\n this.setActionsSize();\n });\n }\n\n ngOnInit(): void {}\n\n private setActionsSize() {\n const actions: ThyAction[] = Array.from(this.actions());\n actions.forEach((action: ThyAction, index) => {\n // can't set marginRight value for last item\n if (index !== actions.length - 1) {\n action.setMarginRight(getNumericSize(this.thySize(), 'md') + 'px');\n }\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyAction } from './action.component';\nimport { ThyActions } from './actions.component';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyAction, ThyActions],\n exports: [ThyAction, ThyActions]\n})\nexport class ThyActionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+BA,MAAM,sBAAsB,GAAwD;AAChF,IAAA,OAAO,EAAE;AACL,QAAA,IAAI,EAAE,mBAAmB;AACzB,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,QAAQ,EAAE;AACb,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,IAAI,EAAE,mBAAmB;AACzB,QAAA,KAAK,EAAE,aAAa;AACpB,QAAA,QAAQ,EAAE;AACb;CACJ;AACD;;;AAGG;MAcU,SAAS,CAAA;IA6DlB,QAAQ,GAAA;QACJ,IAAI,CAAC,aAAa,EAAE;IACxB;IAEA,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;IAClE;AAEA,IAAA,WAAA,GAAA;AApEQ,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,C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,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MCN9C,eAAe,CAAA;+GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAf,eAAe,EAAA,OAAA,EAAA,CAHd,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAA,EAAA,OAAA,EAAA,CAClD,SAAS,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;AAEtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAAA,OAAA,EAAA,CAHd,YAAY,EAAE,aAAa,EAAE,SAAS,CAAA,EAAA,CAAA,CAAA;;4FAGvC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC;AAC7D,oBAAA,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU;AAClC,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-tethys-action.mjs","sources":["../../../src/action/action.component.ts","../../../src/action/action.component.html","../../../src/action/actions.component.ts","../../../src/action/action.module.ts","../../../src/action/ngx-tethys-action.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n Signal,\n computed,\n effect,\n inject,\n input\n} from '@angular/core';\nimport { useHostRenderer } from '@tethys/cdk/dom';\nimport { ThyIcon } from 'ngx-tethys/icon';\n\nimport { coerceBooleanProperty } from 'ngx-tethys/util';\nimport { Subscription, timer } from 'rxjs';\n\nexport type ThyActionType = 'primary' | 'success' | 'danger' | 'warning';\n\nexport type ThyActionFeedback = 'success' | 'error';\n\nexport interface ThyActionFeedbackOptions {\n icon?: string;\n class?: string;\n duration?: number;\n}\n\nconst defaultFeedbackOptions: Record<ThyActionFeedback, ThyActionFeedbackOptions> = {\n success: {\n icon: 'check-circle-fill',\n class: 'text-success',\n duration: 3000\n },\n error: {\n icon: 'close-circle-fill',\n class: 'text-danger',\n duration: 3000\n }\n};\n/**\n * 立即操作组件\n * @name thy-action,[thyAction]\n */\n@Component({\n selector: 'thy-action, [thyAction]',\n templateUrl: './action.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-action',\n '[class.active]': 'active()',\n '[class.thy-action-hover-icon]': 'thyHoverIcon()',\n '[class.thy-action-has-feedback]': '!!feedback',\n '[class.disabled]': 'thyDisabled()'\n },\n imports: [ThyIcon]\n})\nexport class ThyAction implements OnInit, AfterViewInit, OnDestroy {\n private elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private renderer = inject(Renderer2);\n private cdr = inject(ChangeDetectorRef);\n\n public readonly icon: Signal<string> = computed(() => this.thyActionIcon() || this.thyIcon());\n\n feedback: ThyActionFeedback | null = null;\n\n feedbackOptions: ThyActionFeedbackOptions | null = null;\n\n readonly active: Signal<boolean> = computed(() => this.thyActionActive() || this.thyActive());\n\n private hostRenderer = useHostRenderer();\n\n private feedbackTimer: Subscription | null = null;\n\n /**\n * 操作图标的类型\n * @type primary | success | danger | warning\n */\n readonly thyType = input<ThyActionType, ThyActionType>('primary', {\n transform: (value: ThyActionType) => value || 'primary'\n });\n\n /**\n * 操作图标,支持传参同时也支持在投影中写 thy-icon 组件\n */\n readonly thyIcon = input<string>('');\n\n /**\n * 操作图标,当 thyIcon 和其他指令参数名有冲突时使用 thyActionIcon\n */\n readonly thyActionIcon = input<string>('');\n\n /**\n * 操作的图标 Active 状态,设置为 true 时会在 Item 上添加 active class\n */\n readonly thyActive = input(false, { transform: coerceBooleanProperty });\n\n /**\n * 操作的图标 Active 状态,当 thyActive 和其他指令参数名有冲突时使用 thyActionActive\n */\n readonly thyActionActive = input(false, { transform: coerceBooleanProperty });\n\n /**\n * 操作图标的主题\n * @type fill(背景色填充) | lite(简单文本颜色变化)\n */\n readonly thyTheme = input<'fill' | 'lite'>('fill');\n\n /**\n * Hover 展示的图标\n */\n readonly thyHoverIcon = input<string>();\n\n /**\n * 是否处于禁用状态\n */\n readonly thyDisabled = input(false, { transform: coerceBooleanProperty });\n\n ngOnInit(): void {\n this.updateClasses();\n }\n\n ngAfterViewInit() {\n this.wrapSpanForText(this.elementRef.nativeElement.childNodes);\n }\n\n constructor() {\n effect(() => {\n this.updateClasses();\n });\n }\n\n setMarginRight(marginRight: string) {\n this.elementRef.nativeElement.style.marginRight = marginRight;\n }\n\n /**\n * 触发成功反馈操作\n */\n success(options?: ThyActionFeedbackOptions) {\n this.setFeedback('success', options);\n }\n\n /**\n * 触发失败反馈操作\n */\n error(options?: ThyActionFeedbackOptions) {\n this.setFeedback('error', options);\n }\n\n private setFeedback(feedback: ThyActionFeedback, options: ThyActionFeedbackOptions | undefined) {\n if (this.thyDisabled()) {\n return;\n }\n options = Object.assign({}, defaultFeedbackOptions[feedback], options);\n this.feedback = feedback;\n this.feedbackOptions = options;\n this.cdr.markForCheck();\n if (options.duration) {\n if (this.feedbackTimer) {\n this.feedbackTimer.unsubscribe();\n }\n this.feedbackTimer = timer(options.duration).subscribe(() => {\n this.feedback = null;\n this.feedbackOptions = null;\n this.cdr.markForCheck();\n });\n }\n }\n\n private wrapSpanForText(nodes: NodeList): void {\n nodes.forEach(node => {\n if (node.nodeName === '#text') {\n const span = this.renderer.createElement('span');\n const parent = this.renderer.parentNode(node);\n // this.renderer.addClass(span, 'thy-action-wrap-span');\n this.renderer.insertBefore(parent, span, node);\n this.renderer.appendChild(span, node);\n }\n });\n }\n\n private updateClasses() {\n const classNames: string[] = [];\n classNames.push(`action-${this.thyType()}`);\n if (this.thyTheme() === 'lite') {\n classNames.push('thy-action-lite');\n }\n this.hostRenderer.updateClass(classNames);\n }\n\n ngOnDestroy(): void {\n this.feedbackTimer?.unsubscribe();\n }\n}\n","@if (icon() && !feedback) {\n <thy-icon [thyIconName]=\"icon()\"></thy-icon>\n}\n@if (feedbackOptions?.icon) {\n <thy-icon [class]=\"feedbackOptions.class\" [thyIconName]=\"feedbackOptions.icon\"></thy-icon>\n}\n@if (thyHoverIcon()) {\n <thy-icon class=\"hover-icon\" [thyIconName]=\"thyHoverIcon()\"></thy-icon>\n}\n<ng-content></ng-content>\n","import { ChangeDetectionStrategy, Component, OnInit, contentChildren, effect, input } from '@angular/core';\nimport { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';\nimport { ThyAction } from './action.component';\n\n/**\n * Actions 组件\n * @name thy-actions\n */\n@Component({\n selector: 'thy-actions',\n template: ` <ng-content></ng-content> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-actions'\n }\n})\nexport class ThyActions implements OnInit {\n readonly actions = contentChildren<ThyAction>(ThyAction);\n\n /**\n * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小\n * @type string | number\n */\n readonly thySize = input<ThySpacingSize>('md');\n\n constructor() {\n effect(() => {\n this.setActionsSize();\n });\n }\n\n ngOnInit(): void {}\n\n private setActionsSize() {\n const actions: ThyAction[] = Array.from(this.actions());\n actions.forEach((action: ThyAction, index) => {\n // can't set marginRight value for last item\n if (index !== actions.length - 1) {\n action.setMarginRight(`${getNumericSize(this.thySize(), 'md') }px`);\n }\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThyIconModule } from 'ngx-tethys/icon';\nimport { ThyAction } from './action.component';\nimport { ThyActions } from './actions.component';\n\n@NgModule({\n imports: [CommonModule, ThyIconModule, ThyAction, ThyActions],\n exports: [ThyAction, ThyActions]\n})\nexport class ThyActionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+BA,MAAM,sBAAsB,GAAwD;AAChF,IAAA,OAAO,EAAE;AACL,QAAA,IAAI,EAAE,mBAAmB;AACzB,QAAA,KAAK,EAAE,cAAc;AACrB,QAAA,QAAQ,EAAE;AACb,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,IAAI,EAAE,mBAAmB;AACzB,QAAA,KAAK,EAAE,aAAa;AACpB,QAAA,QAAQ,EAAE;AACb;CACJ;AACD;;;AAGG;MAcU,SAAS,CAAA;IA6DlB,QAAQ,GAAA;QACJ,IAAI,CAAC,aAAa,EAAE;IACxB;IAEA,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;IAClE;AAEA,IAAA,WAAA,GAAA;AApEQ,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEvB,QAAA,IAAA,CAAA,IAAI,GAAmB,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,gDAAC;QAE7F,IAAA,CAAA,QAAQ,GAA6B,IAAI;QAEzC,IAAA,CAAA,eAAe,GAAoC,IAAI;AAE9C,QAAA,IAAA,CAAA,MAAM,GAAoB,QAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,kDAAC;Q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CAAA;;MCN9C,eAAe,CAAA;+GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAf,eAAe,EAAA,OAAA,EAAA,CAHd,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAA,EAAA,OAAA,EAAA,CAClD,SAAS,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;AAEtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAAA,OAAA,EAAA,CAHd,YAAY,EAAE,aAAa,EAAE,SAAS,CAAA,EAAA,CAAA,CAAA;;4FAGvC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC;AAC7D,oBAAA,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU;AAClC,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -228,14 +228,14 @@ class ThyAffix {
|
|
|
228
228
|
this.syncPlaceholderStyle(e);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
232
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAffix, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
232
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.15", type: ThyAffix, isStandalone: true, selector: "thy-affix", inputs: { thyContainer: { classPropertyName: "thyContainer", publicName: "thyContainer", isSignal: true, isRequired: false, transformFunction: null }, thyOffsetTop: { classPropertyName: "thyOffsetTop", publicName: "thyOffsetTop", isSignal: true, isRequired: false, transformFunction: null }, thyOffsetBottom: { classPropertyName: "thyOffsetBottom", publicName: "thyOffsetBottom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { thyChange: "thyChange" }, viewQueries: [{ propertyName: "fixedElement", first: true, predicate: ["fixedElement"], descendants: true, isSignal: true }], exportAs: ["thyAffix"], ngImport: i0, template: `
|
|
233
233
|
<div #fixedElement>
|
|
234
234
|
<ng-content></ng-content>
|
|
235
235
|
</div>
|
|
236
236
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
237
237
|
}
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAffix, decorators: [{
|
|
239
239
|
type: Component,
|
|
240
240
|
args: [{
|
|
241
241
|
selector: 'thy-affix',
|
|
@@ -251,11 +251,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
251
251
|
}], ctorParameters: () => [], propDecorators: { fixedElement: [{ type: i0.ViewChild, args: ['fixedElement', { isSignal: true }] }], thyContainer: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyContainer", required: false }] }], thyOffsetTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyOffsetTop", required: false }] }], thyOffsetBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "thyOffsetBottom", required: false }] }], thyChange: [{ type: i0.Output, args: ["thyChange"] }] } });
|
|
252
252
|
|
|
253
253
|
class ThyAffixModule {
|
|
254
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
255
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
256
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
254
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
255
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ThyAffixModule, imports: [CommonModule, PlatformModule, ThyAffix], exports: [ThyAffix] }); }
|
|
256
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAffixModule, imports: [CommonModule, PlatformModule] }); }
|
|
257
257
|
}
|
|
258
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ThyAffixModule, decorators: [{
|
|
259
259
|
type: NgModule,
|
|
260
260
|
args: [{
|
|
261
261
|
exports: [ThyAffix],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-affix.mjs","sources":["../../../src/affix/respond-events.ts","../../../src/affix/affix.component.ts","../../../src/affix/affix.module.ts","../../../src/affix/ngx-tethys-affix.ts"],"sourcesContent":["export enum AffixRespondEvents {\n resize = 'resize',\n scroll = 'scroll',\n touchstart = 'touchstart',\n touchmove = 'touchmove',\n touchend = 'touchend',\n pageshow = 'pageshow',\n load = 'LOAD'\n}\n","import { ThyScrollService } from 'ngx-tethys/core';\nimport { dom, shallowEqual, SimpleRect } from 'ngx-tethys/util';\nimport { fromEvent, merge, ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { auditTime, map, takeUntil } from 'rxjs/operators';\n\nimport { Platform } from '@angular/cdk/platform';\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n NgZone,\n numberAttribute,\n OnDestroy,\n output,\n Renderer2,\n Signal,\n viewChild,\n ViewEncapsulation,\n DOCUMENT\n} from '@angular/core';\n\nimport { AffixRespondEvents } from './respond-events';\n\nconst THY_AFFIX_CLS_PREFIX = 'thy-affix';\nconst THY_AFFIX_DEFAULT_SCROLL_TIME = 20;\n\n/**\n * 固钉组件\n * @name thy-affix\n * @order 10\n */\n@Component({\n selector: 'thy-affix',\n exportAs: 'thyAffix',\n template: `\n <div #fixedElement>\n <ng-content></ng-content>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class ThyAffix implements AfterViewInit, OnDestroy {\n private scrollService = inject(ThyScrollService);\n private ngZone = inject(NgZone);\n private platform = inject(Platform);\n private renderer = inject(Renderer2);\n\n private readonly fixedElement = viewChild.required<ElementRef<HTMLDivElement>>('fixedElement');\n\n /**\n * 设置 thy-affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数\n * @default window\n * @type string | Element | Window\n */\n readonly thyContainer = input<string | Element | Window>();\n\n /**\n * 距离窗口顶部缓冲的偏移量阈值\n */\n readonly thyOffsetTop = input<number, unknown>(0, { transform: numberAttribute });\n\n /**\n * 距离窗口底部缓冲的偏移量阈值\n */\n readonly thyOffsetBottom = input<number, unknown>(0, { transform: numberAttribute });\n\n /**\n * 固定状态改变时触发的回调函数\n */\n readonly thyChange = output<boolean>();\n\n private readonly placeholderNode: HTMLElement;\n\n private affixStyle?: any;\n private placeholderStyle?: any;\n private positionChangeSubscription: Subscription = Subscription.EMPTY;\n private offsetChanged$ = new ReplaySubject(1);\n private destroy$ = new Subject<void>();\n private timeout?: any;\n private document: any;\n\n private readonly container: Signal<Element | Window> = computed(() => {\n const el = this.thyContainer();\n return (typeof el === 'string' ? this.document.querySelector(el) : el) || window;\n });\n\n constructor() {\n const el = inject(ElementRef);\n const document = inject(DOCUMENT);\n\n // The wrapper would stay at the original position as a placeholder.\n this.placeholderNode = el.nativeElement;\n this.document = document;\n effect(() => {\n if (this.thyOffsetBottom() || this.thyOffsetTop()) {\n this.offsetChanged$.next(undefined);\n }\n });\n }\n\n ngAfterViewInit(): void {\n this.registerListeners();\n }\n\n ngOnDestroy(): void {\n this.removeListeners();\n }\n\n private registerListeners(): void {\n this.removeListeners();\n this.positionChangeSubscription = this.ngZone.runOutsideAngular(() => {\n return merge(\n ...Object.keys(AffixRespondEvents).map(evName => fromEvent(this.container(), evName)),\n this.offsetChanged$.pipe(\n takeUntil(this.destroy$),\n map(() => ({}))\n )\n )\n .pipe(auditTime(THY_AFFIX_DEFAULT_SCROLL_TIME))\n .subscribe(e => this.updatePosition(e as Event));\n });\n this.timeout = setTimeout(() => this.updatePosition({} as Event));\n }\n\n private removeListeners(): void {\n clearTimeout(this.timeout);\n this.positionChangeSubscription.unsubscribe();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n getOffset(element: Element, target: Element | Window | undefined): SimpleRect {\n const elemRect = element.getBoundingClientRect();\n const containerRect = dom.getContainerRect(target);\n\n const scrollTop = this.scrollService.getScroll(target, true);\n const scrollLeft = this.scrollService.getScroll(target, false);\n\n const docElem = this.document.body;\n const clientTop = docElem.clientTop || 0;\n const clientLeft = docElem.clientLeft || 0;\n\n return {\n top: elemRect.top - containerRect.top + scrollTop - clientTop,\n left: elemRect.left - containerRect.left + scrollLeft - clientLeft,\n width: elemRect.width,\n height: elemRect.height\n };\n }\n\n private setAffixStyle(e: Event, affixStyle?: any): void {\n const originalAffixStyle = this.affixStyle;\n const isWindow = this.container() === window;\n if (e.type === 'scroll' && originalAffixStyle && affixStyle && isWindow) {\n return;\n }\n if (shallowEqual(originalAffixStyle, affixStyle)) {\n return;\n }\n\n const fixed = !!affixStyle;\n const wrapElement = this.fixedElement().nativeElement;\n this.renderer.setStyle(wrapElement, 'cssText', dom.getStyleAsText(affixStyle));\n this.affixStyle = affixStyle;\n if (fixed) {\n wrapElement.classList.add(THY_AFFIX_CLS_PREFIX);\n } else {\n wrapElement.classList.remove(THY_AFFIX_CLS_PREFIX);\n }\n\n if ((affixStyle && !originalAffixStyle) || (!affixStyle && originalAffixStyle)) {\n this.thyChange.emit(fixed);\n }\n }\n\n private setPlaceholderStyle(placeholderStyle?: any): void {\n const originalPlaceholderStyle = this.placeholderStyle;\n if (shallowEqual(placeholderStyle, originalPlaceholderStyle)) {\n return;\n }\n this.renderer.setStyle(this.placeholderNode, 'cssText', dom.getStyleAsText(placeholderStyle));\n this.placeholderStyle = placeholderStyle;\n }\n\n private syncPlaceholderStyle(e: Event): void {\n if (!this.affixStyle) {\n return;\n }\n this.renderer.setStyle(this.placeholderNode, 'cssText', '');\n this.placeholderStyle = undefined;\n const styleObj = {\n width: this.placeholderNode.offsetWidth,\n height: this.fixedElement().nativeElement.offsetHeight\n };\n this.setAffixStyle(e, {\n ...this.affixStyle,\n ...styleObj\n });\n this.setPlaceholderStyle(styleObj);\n }\n\n updatePosition(e: Event): void {\n if (!this.platform.isBrowser) {\n return;\n }\n\n const containerNode = this.container();\n let offsetTop = this.thyOffsetTop();\n const scrollTop = this.scrollService.getScroll(containerNode, true);\n const elementOffset = this.getOffset(this.placeholderNode, containerNode);\n const fixedNode = this.fixedElement().nativeElement;\n const elemSize = {\n width: fixedNode.offsetWidth,\n height: fixedNode.offsetHeight\n };\n const offsetMode = {\n top: false,\n bottom: false\n };\n // Default to `offsetTop=0`.\n const thyOffsetBottom = this.thyOffsetBottom();\n if (typeof offsetTop !== 'number' && typeof thyOffsetBottom !== 'number') {\n offsetMode.top = true;\n offsetTop = 0;\n } else {\n offsetMode.top = typeof offsetTop === 'number';\n offsetMode.bottom = typeof thyOffsetBottom === 'number';\n }\n const containerRect = dom.getContainerRect(containerNode as Window);\n const targetInnerHeight = (containerNode as Window).innerHeight || (containerNode as HTMLElement).clientHeight;\n if (scrollTop >= elementOffset.top - (offsetTop as number) && offsetMode.top) {\n const width = elementOffset.width;\n const top = containerRect.top + (offsetTop as number);\n this.setAffixStyle(e, {\n position: 'fixed',\n top,\n left: containerRect.left + elementOffset.left,\n width\n });\n this.setPlaceholderStyle({\n width,\n height: elemSize.height\n });\n } else if (\n scrollTop <= elementOffset.top + elemSize.height + (thyOffsetBottom as number) - targetInnerHeight &&\n offsetMode.bottom\n ) {\n const targetBottomOffset = containerNode === window ? 0 : window.innerHeight - containerRect.bottom;\n const width = elementOffset.width;\n this.setAffixStyle(e, {\n position: 'fixed',\n bottom: targetBottomOffset + (thyOffsetBottom as number),\n left: containerRect.left + elementOffset.left,\n width\n });\n this.setPlaceholderStyle({\n width,\n height: elementOffset.height\n });\n } else {\n if (\n e.type === AffixRespondEvents.resize &&\n this.affixStyle &&\n this.affixStyle.position === 'fixed' &&\n this.placeholderNode.offsetWidth\n ) {\n this.setAffixStyle(e, {\n ...this.affixStyle,\n width: this.placeholderNode.offsetWidth\n });\n } else {\n this.setAffixStyle(e);\n }\n this.setPlaceholderStyle();\n }\n\n if (e.type === 'resize') {\n this.syncPlaceholderStyle(e);\n }\n }\n}\n","import { PlatformModule } from '@angular/cdk/platform';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThyAffix } from './affix.component';\n\n@NgModule({\n exports: [ThyAffix],\n imports: [CommonModule, PlatformModule, ThyAffix]\n})\nexport class ThyAffixModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAY,kBAQX;AARD,CAAA,UAAY,kBAAkB,EAAA;AAC1B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,kBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,kBAA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GT,cAAc,EAAA,OAAA,EAAA,CAFb,YAAY,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA;;4FAE7B,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,QAAQ;AACnD,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-tethys-affix.mjs","sources":["../../../src/affix/respond-events.ts","../../../src/affix/affix.component.ts","../../../src/affix/affix.module.ts","../../../src/affix/ngx-tethys-affix.ts"],"sourcesContent":["export enum AffixRespondEvents {\n resize = 'resize',\n scroll = 'scroll',\n touchstart = 'touchstart',\n touchmove = 'touchmove',\n touchend = 'touchend',\n pageshow = 'pageshow',\n load = 'LOAD'\n}\n","import { ThyScrollService } from 'ngx-tethys/core';\nimport { dom, shallowEqual, SimpleRect } from 'ngx-tethys/util';\nimport { fromEvent, merge, ReplaySubject, Subject, Subscription } from 'rxjs';\nimport { auditTime, map, takeUntil } from 'rxjs/operators';\n\nimport { Platform } from '@angular/cdk/platform';\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n NgZone,\n numberAttribute,\n OnDestroy,\n output,\n Renderer2,\n Signal,\n viewChild,\n ViewEncapsulation,\n DOCUMENT\n} from '@angular/core';\n\nimport { AffixRespondEvents } from './respond-events';\n\nconst THY_AFFIX_CLS_PREFIX = 'thy-affix';\nconst THY_AFFIX_DEFAULT_SCROLL_TIME = 20;\n\n/**\n * 固钉组件\n * @name thy-affix\n * @order 10\n */\n@Component({\n selector: 'thy-affix',\n exportAs: 'thyAffix',\n template: `\n <div #fixedElement>\n <ng-content></ng-content>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class ThyAffix implements AfterViewInit, OnDestroy {\n private scrollService = inject(ThyScrollService);\n private ngZone = inject(NgZone);\n private platform = inject(Platform);\n private renderer = inject(Renderer2);\n\n private readonly fixedElement = viewChild.required<ElementRef<HTMLDivElement>>('fixedElement');\n\n /**\n * 设置 thy-affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数\n * @default window\n * @type string | Element | Window\n */\n readonly thyContainer = input<string | Element | Window>();\n\n /**\n * 距离窗口顶部缓冲的偏移量阈值\n */\n readonly thyOffsetTop = input<number, unknown>(0, { transform: numberAttribute });\n\n /**\n * 距离窗口底部缓冲的偏移量阈值\n */\n readonly thyOffsetBottom = input<number, unknown>(0, { transform: numberAttribute });\n\n /**\n * 固定状态改变时触发的回调函数\n */\n readonly thyChange = output<boolean>();\n\n private readonly placeholderNode: HTMLElement;\n\n private affixStyle?: any;\n private placeholderStyle?: any;\n private positionChangeSubscription: Subscription = Subscription.EMPTY;\n private offsetChanged$ = new ReplaySubject(1);\n private destroy$ = new Subject<void>();\n private timeout?: any;\n private document: any;\n\n private readonly container: Signal<Element | Window> = computed(() => {\n const el = this.thyContainer();\n return (typeof el === 'string' ? this.document.querySelector(el) : el) || window;\n });\n\n constructor() {\n const el = inject(ElementRef);\n const document = inject(DOCUMENT);\n\n // The wrapper would stay at the original position as a placeholder.\n this.placeholderNode = el.nativeElement;\n this.document = document;\n effect(() => {\n if (this.thyOffsetBottom() || this.thyOffsetTop()) {\n this.offsetChanged$.next(undefined);\n }\n });\n }\n\n ngAfterViewInit(): void {\n this.registerListeners();\n }\n\n ngOnDestroy(): void {\n this.removeListeners();\n }\n\n private registerListeners(): void {\n this.removeListeners();\n this.positionChangeSubscription = this.ngZone.runOutsideAngular(() => {\n return merge(\n ...Object.keys(AffixRespondEvents).map(evName => fromEvent(this.container(), evName)),\n this.offsetChanged$.pipe(\n takeUntil(this.destroy$),\n map(() => ({}))\n )\n )\n .pipe(auditTime(THY_AFFIX_DEFAULT_SCROLL_TIME))\n .subscribe(e => this.updatePosition(e as Event));\n });\n this.timeout = setTimeout(() => this.updatePosition({} as Event));\n }\n\n private removeListeners(): void {\n clearTimeout(this.timeout);\n this.positionChangeSubscription.unsubscribe();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n getOffset(element: Element, target: Element | Window | undefined): SimpleRect {\n const elemRect = element.getBoundingClientRect();\n const containerRect = dom.getContainerRect(target!);\n\n const scrollTop = this.scrollService.getScroll(target, true);\n const scrollLeft = this.scrollService.getScroll(target, false);\n\n const docElem = this.document.body;\n const clientTop = docElem.clientTop || 0;\n const clientLeft = docElem.clientLeft || 0;\n\n return {\n top: elemRect.top - containerRect.top + scrollTop - clientTop,\n left: elemRect.left - containerRect.left + scrollLeft - clientLeft,\n width: elemRect.width,\n height: elemRect.height\n };\n }\n\n private setAffixStyle(e: Event, affixStyle?: any): void {\n const originalAffixStyle = this.affixStyle;\n const isWindow = this.container() === window;\n if (e.type === 'scroll' && originalAffixStyle && affixStyle && isWindow) {\n return;\n }\n if (shallowEqual(originalAffixStyle, affixStyle)) {\n return;\n }\n\n const fixed = !!affixStyle;\n const wrapElement = this.fixedElement().nativeElement;\n this.renderer.setStyle(wrapElement, 'cssText', dom.getStyleAsText(affixStyle));\n this.affixStyle = affixStyle;\n if (fixed) {\n wrapElement.classList.add(THY_AFFIX_CLS_PREFIX);\n } else {\n wrapElement.classList.remove(THY_AFFIX_CLS_PREFIX);\n }\n\n if ((affixStyle && !originalAffixStyle) || (!affixStyle && originalAffixStyle)) {\n this.thyChange.emit(fixed);\n }\n }\n\n private setPlaceholderStyle(placeholderStyle?: any): void {\n const originalPlaceholderStyle = this.placeholderStyle;\n if (shallowEqual(placeholderStyle, originalPlaceholderStyle)) {\n return;\n }\n this.renderer.setStyle(this.placeholderNode, 'cssText', dom.getStyleAsText(placeholderStyle));\n this.placeholderStyle = placeholderStyle;\n }\n\n private syncPlaceholderStyle(e: Event): void {\n if (!this.affixStyle) {\n return;\n }\n this.renderer.setStyle(this.placeholderNode, 'cssText', '');\n this.placeholderStyle = undefined;\n const styleObj = {\n width: this.placeholderNode.offsetWidth,\n height: this.fixedElement().nativeElement.offsetHeight\n };\n this.setAffixStyle(e, {\n ...this.affixStyle,\n ...styleObj\n });\n this.setPlaceholderStyle(styleObj);\n }\n\n updatePosition(e: Event): void {\n if (!this.platform.isBrowser) {\n return;\n }\n\n const containerNode = this.container();\n let offsetTop = this.thyOffsetTop();\n const scrollTop = this.scrollService.getScroll(containerNode, true);\n const elementOffset = this.getOffset(this.placeholderNode, containerNode);\n const fixedNode = this.fixedElement().nativeElement;\n const elemSize = {\n width: fixedNode.offsetWidth,\n height: fixedNode.offsetHeight\n };\n const offsetMode = {\n top: false,\n bottom: false\n };\n // Default to `offsetTop=0`.\n const thyOffsetBottom = this.thyOffsetBottom();\n if (typeof offsetTop !== 'number' && typeof thyOffsetBottom !== 'number') {\n offsetMode.top = true;\n offsetTop = 0;\n } else {\n offsetMode.top = typeof offsetTop === 'number';\n offsetMode.bottom = typeof thyOffsetBottom === 'number';\n }\n const containerRect = dom.getContainerRect(containerNode as Window);\n const targetInnerHeight = (containerNode as Window).innerHeight || (containerNode as HTMLElement).clientHeight;\n if (scrollTop >= elementOffset.top - (offsetTop as number) && offsetMode.top) {\n const width = elementOffset.width;\n const top = containerRect.top + (offsetTop as number);\n this.setAffixStyle(e, {\n position: 'fixed',\n top,\n left: containerRect.left + elementOffset.left,\n width\n });\n this.setPlaceholderStyle({\n width,\n height: elemSize.height\n });\n } else if (\n scrollTop <= elementOffset.top + elemSize.height + (thyOffsetBottom as number) - targetInnerHeight &&\n offsetMode.bottom\n ) {\n const targetBottomOffset = containerNode === window ? 0 : window.innerHeight - containerRect.bottom!;\n const width = elementOffset.width;\n this.setAffixStyle(e, {\n position: 'fixed',\n bottom: targetBottomOffset + (thyOffsetBottom as number),\n left: containerRect.left + elementOffset.left,\n width\n });\n this.setPlaceholderStyle({\n width,\n height: elementOffset.height\n });\n } else {\n if (\n e.type === AffixRespondEvents.resize &&\n this.affixStyle &&\n this.affixStyle.position === 'fixed' &&\n this.placeholderNode.offsetWidth\n ) {\n this.setAffixStyle(e, {\n ...this.affixStyle,\n width: this.placeholderNode.offsetWidth\n });\n } else {\n this.setAffixStyle(e);\n }\n this.setPlaceholderStyle();\n }\n\n if (e.type === 'resize') {\n this.syncPlaceholderStyle(e);\n }\n }\n}\n","import { PlatformModule } from '@angular/cdk/platform';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThyAffix } from './affix.component';\n\n@NgModule({\n exports: [ThyAffix],\n imports: [CommonModule, PlatformModule, ThyAffix]\n})\nexport class ThyAffixModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAY,kBAQX;AARD,CAAA,UAAY,kBAAkB,EAAA;AAC1B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,kBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,kBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,kBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EARW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;;AC6B9B,MAAM,oBAAoB,GAAG,WAAW;AACxC,MAAM,6BAA6B,GAAG,EAAE;AAExC;;;;AAIG;MAYU,QAAQ,CAAA;AA6CjB,IAAA,WAAA,GAAA;AA5CQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,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