@ng-nest/ui 20.2.9 → 20.3.1
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/attachments/index.d.ts +4 -5
- package/auto-complete/index.d.ts +11 -12
- package/base-form/index.d.ts +8 -9
- package/bubble/index.d.ts +12 -7
- package/cascade/index.d.ts +12 -13
- package/checkbox/index.d.ts +5 -6
- package/color-picker/index.d.ts +12 -13
- package/contextmenu/index.d.ts +176 -0
- package/core/index.d.ts +36 -1
- package/coversations/index.d.ts +4 -5
- package/date-picker/index.d.ts +23 -25
- package/dialog/index.d.ts +182 -102
- package/divider/index.d.ts +113 -0
- package/dropdown/index.d.ts +12 -2
- package/fesm2022/ng-nest-ui-auto-complete.mjs +11 -3
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-base-form.mjs +27 -46
- package/fesm2022/ng-nest-ui-base-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-bubble.mjs +141 -129
- package/fesm2022/ng-nest-ui-bubble.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +10 -2
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +10 -2
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-contextmenu.mjs +445 -0
- package/fesm2022/ng-nest-ui-contextmenu.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-core.mjs +2 -2
- package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-date-picker.mjs +20 -4
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +51 -46
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-divider.mjs +124 -0
- package/fesm2022/ng-nest-ui-divider.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-dropdown.mjs +17 -5
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +26 -20
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-i18n.mjs +19 -18
- package/fesm2022/ng-nest-ui-i18n.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +108 -69
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input.mjs +80 -12
- package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-list.mjs +3 -0
- package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-menu.mjs +16 -4
- package/fesm2022/ng-nest-ui-menu.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message-box.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-notification.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-scrollable.mjs +81 -9
- package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +67 -17
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider-select.mjs +0 -1
- package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-splitter.mjs +407 -0
- package/fesm2022/ng-nest-ui-splitter.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-table-view.mjs +277 -248
- package/fesm2022/ng-nest-ui-table-view.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table.mjs +18 -6
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-textarea.mjs +1 -1
- package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-picker.mjs +40 -21
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-select.mjs +12 -4
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree.mjs +16 -4
- package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-watermark.mjs +378 -0
- package/fesm2022/ng-nest-ui-watermark.mjs.map +1 -0
- package/fesm2022/ng-nest-ui.mjs +4 -0
- package/fesm2022/ng-nest-ui.mjs.map +1 -1
- package/find/index.d.ts +6 -7
- package/form/index.d.ts +24 -13
- package/i18n/index.d.ts +29 -28
- package/image/index.d.ts +30 -14
- package/index.d.ts +4 -0
- package/input/index.d.ts +37 -10
- package/input-number/index.d.ts +8 -9
- package/list/index.d.ts +35 -25
- package/menu/index.d.ts +15 -3
- package/message/index.d.ts +15 -3
- package/message-box/index.d.ts +18 -5
- package/notification/index.d.ts +15 -3
- package/package.json +65 -49
- package/radio/index.d.ts +5 -6
- package/rate/index.d.ts +4 -5
- package/scrollable/index.d.ts +14 -2
- package/select/index.d.ts +51 -12
- package/sender/index.d.ts +6 -7
- package/slider-select/index.d.ts +4 -6
- package/splitter/index.d.ts +163 -0
- package/switch/index.d.ts +4 -5
- package/table/index.d.ts +60 -5
- package/table-view/index.d.ts +99 -65
- package/textarea/index.d.ts +8 -9
- package/theme/index.d.ts +4 -5
- package/time-picker/index.d.ts +15 -14
- package/transfer/index.d.ts +4 -5
- package/tree/index.d.ts +29 -3
- package/tree-select/index.d.ts +12 -13
- package/upload/index.d.ts +4 -5
- package/watermark/index.d.ts +267 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import { XPropertyFunction, XToNumber, XToBoolean } from '@ng-nest/ui/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Watermark
|
|
7
|
+
* @selector x-watermark
|
|
8
|
+
* @decorator component
|
|
9
|
+
*/
|
|
10
|
+
const XWatermarkPrefix = 'x-watermark';
|
|
11
|
+
const X_WATERMARK_CONFIG_NAME = 'watermark';
|
|
12
|
+
/**
|
|
13
|
+
* Watermark Property
|
|
14
|
+
*/
|
|
15
|
+
class XWatermarkProperty extends XPropertyFunction(X_WATERMARK_CONFIG_NAME) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/**
|
|
19
|
+
* @zh_CN 水印内容
|
|
20
|
+
* @en_US Watermark content
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <x-watermark content="NG-NEST"></x-watermark>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
this.content = input('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
29
|
+
/**
|
|
30
|
+
* @zh_CN 水印宽度
|
|
31
|
+
* @en_US Watermark width
|
|
32
|
+
* @example
|
|
33
|
+
*
|
|
34
|
+
* ```html
|
|
35
|
+
* <x-watermark [width]="120"></x-watermark>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
this.width = input(this.config?.width ?? 120, ...(ngDevMode ? [{ debugName: "width", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
40
|
+
/**
|
|
41
|
+
* @zh_CN 水印高度
|
|
42
|
+
* @en_US Watermark height
|
|
43
|
+
* @example
|
|
44
|
+
*
|
|
45
|
+
* ```html
|
|
46
|
+
* <x-watermark [height]="60"></x-watermark>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
this.height = input(this.config?.height ?? 60, ...(ngDevMode ? [{ debugName: "height", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
51
|
+
/**
|
|
52
|
+
* @zh_CN 旋转角度
|
|
53
|
+
* @en_US Rotation angle
|
|
54
|
+
* @example
|
|
55
|
+
*
|
|
56
|
+
* ```html
|
|
57
|
+
* <x-watermark [rotate]="-22"></x-watermark>
|
|
58
|
+
* <x-watermark [rotate]="0"></x-watermark>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
this.rotate = input(this.config?.rotate ?? -22, ...(ngDevMode ? [{ debugName: "rotate", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
63
|
+
/**
|
|
64
|
+
* @zh_CN 字体大小
|
|
65
|
+
* @en_US Font size
|
|
66
|
+
* @example
|
|
67
|
+
*
|
|
68
|
+
* ```html
|
|
69
|
+
* <x-watermark [fontSize]="14"></x-watermark>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
this.fontSize = input(this.config?.fontSize ?? 14, ...(ngDevMode ? [{ debugName: "fontSize", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
74
|
+
/**
|
|
75
|
+
* @zh_CN 字体
|
|
76
|
+
* @en_US Font family
|
|
77
|
+
* @example
|
|
78
|
+
*
|
|
79
|
+
* ```html
|
|
80
|
+
* <x-watermark fontFamily="Varela Round"></x-watermark>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
this.fontFamily = input(this.config?.fontFamily ?? 'Varela Round', ...(ngDevMode ? [{ debugName: "fontFamily" }] : []));
|
|
85
|
+
/**
|
|
86
|
+
* @zh_CN 字体颜色
|
|
87
|
+
* @en_US Font color
|
|
88
|
+
* @example
|
|
89
|
+
*
|
|
90
|
+
* ```html
|
|
91
|
+
* <x-watermark color="rgba(0, 0, 0, 0.12)"></x-watermark>
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
this.color = input(this.config?.color ?? 'rgba(0, 0, 0, 0.12)', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
96
|
+
/**
|
|
97
|
+
* @zh_CN 层级
|
|
98
|
+
* @en_US Z-index
|
|
99
|
+
* @example
|
|
100
|
+
*
|
|
101
|
+
* ```html
|
|
102
|
+
* <x-watermark [zIndex]="9999"></x-watermark>
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
this.zIndex = input(this.config?.zIndex ?? 9999, ...(ngDevMode ? [{ debugName: "zIndex", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
107
|
+
/**
|
|
108
|
+
* @zh_CN 透明度
|
|
109
|
+
* @en_US Opacity
|
|
110
|
+
* @example
|
|
111
|
+
*
|
|
112
|
+
* ```html
|
|
113
|
+
* <x-watermark [alpha]="1"></x-watermark>
|
|
114
|
+
* <x-watermark [alpha]="0.5"></x-watermark>
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
this.alpha = input(this.config?.alpha ?? 1, ...(ngDevMode ? [{ debugName: "alpha", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
119
|
+
/**
|
|
120
|
+
* @zh_CN 水平间距
|
|
121
|
+
* @en_US Horizontal gap
|
|
122
|
+
* @example
|
|
123
|
+
*
|
|
124
|
+
* ```html
|
|
125
|
+
* <x-watermark [gapX]="100"></x-watermark>
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
this.gapX = input(this.config?.gapX ?? 100, ...(ngDevMode ? [{ debugName: "gapX", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
130
|
+
/**
|
|
131
|
+
* @zh_CN 垂直间距
|
|
132
|
+
* @en_US Vertical gap
|
|
133
|
+
* @example
|
|
134
|
+
*
|
|
135
|
+
* ```html
|
|
136
|
+
* <x-watermark [gapY]="100"></x-watermark>
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
this.gapY = input(this.config?.gapY ?? 100, ...(ngDevMode ? [{ debugName: "gapY", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
141
|
+
/**
|
|
142
|
+
* @zh_CN 水平偏移
|
|
143
|
+
* @en_US Horizontal offset
|
|
144
|
+
* @example
|
|
145
|
+
*
|
|
146
|
+
* ```html
|
|
147
|
+
* <x-watermark [offsetLeft]="0"></x-watermark>
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
this.offsetLeft = input(this.config?.offsetLeft ?? 0, ...(ngDevMode ? [{ debugName: "offsetLeft", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
152
|
+
/**
|
|
153
|
+
* @zh_CN 垂直偏移
|
|
154
|
+
* @en_US Vertical offset
|
|
155
|
+
* @example
|
|
156
|
+
*
|
|
157
|
+
* ```html
|
|
158
|
+
* <x-watermark [offsetTop]="0"></x-watermark>
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
this.offsetTop = input(this.config?.offsetTop ?? 0, ...(ngDevMode ? [{ debugName: "offsetTop", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
163
|
+
/**
|
|
164
|
+
* @zh_CN 是否交错显示
|
|
165
|
+
* @en_US Whether to stagger display
|
|
166
|
+
* @example
|
|
167
|
+
*
|
|
168
|
+
* ```html
|
|
169
|
+
* <x-watermark [striped]="true"></x-watermark>
|
|
170
|
+
* <x-watermark [striped]="false"></x-watermark>
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
this.striped = input(this.config?.striped ?? false, ...(ngDevMode ? [{ debugName: "striped", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
175
|
+
/**
|
|
176
|
+
* @zh_CN 是否禁用
|
|
177
|
+
* @en_US Whether to disable
|
|
178
|
+
* @example
|
|
179
|
+
*
|
|
180
|
+
* ```html
|
|
181
|
+
* <x-watermark [disabled]="true"></x-watermark>
|
|
182
|
+
* <x-watermark [disabled]="false"></x-watermark>
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
*/
|
|
186
|
+
this.disabled = input(this.config?.disabled ?? false, ...(ngDevMode ? [{ debugName: "disabled", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
187
|
+
/**
|
|
188
|
+
* @zh_CN 图片/图标 URL
|
|
189
|
+
* @en_US Image/icon URL
|
|
190
|
+
* @example
|
|
191
|
+
*
|
|
192
|
+
* ```html
|
|
193
|
+
* <x-watermark imageSrc="/assets/logo.png"></x-watermark>
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
197
|
+
this.imageSrc = input('', ...(ngDevMode ? [{ debugName: "imageSrc" }] : []));
|
|
198
|
+
/**
|
|
199
|
+
* @zh_CN 图片宽度
|
|
200
|
+
* @en_US Image width
|
|
201
|
+
* @example
|
|
202
|
+
*
|
|
203
|
+
* ```html
|
|
204
|
+
* <x-watermark [imageWidth]="40"></x-watermark>
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
*/
|
|
208
|
+
this.imageWidth = input(0, ...(ngDevMode ? [{ debugName: "imageWidth", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
209
|
+
/**
|
|
210
|
+
* @zh_CN 图片高度
|
|
211
|
+
* @en_US Image height
|
|
212
|
+
* @example
|
|
213
|
+
*
|
|
214
|
+
* ```html
|
|
215
|
+
* <x-watermark [imageHeight]="40"></x-watermark>
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
*/
|
|
219
|
+
this.imageHeight = input(0, ...(ngDevMode ? [{ debugName: "imageHeight", transform: XToNumber }] : [{ transform: XToNumber }]));
|
|
220
|
+
/**
|
|
221
|
+
* @zh_CN 图片相对文本的位置
|
|
222
|
+
* @en_US Image position relative to text
|
|
223
|
+
* @example
|
|
224
|
+
*
|
|
225
|
+
* ```html
|
|
226
|
+
* <x-watermark imagePosition="top"></x-watermark>
|
|
227
|
+
* <x-watermark imagePosition="center"></x-watermark>
|
|
228
|
+
* <x-watermark imagePosition="bottom"></x-watermark>
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
this.imagePosition = input('center', ...(ngDevMode ? [{ debugName: "imagePosition" }] : []));
|
|
233
|
+
}
|
|
234
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
235
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.5", type: XWatermarkProperty, isStandalone: true, selector: "x-watermark-property", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, rotate: { classPropertyName: "rotate", publicName: "rotate", isSignal: true, isRequired: false, transformFunction: null }, fontSize: { classPropertyName: "fontSize", publicName: "fontSize", isSignal: true, isRequired: false, transformFunction: null }, fontFamily: { classPropertyName: "fontFamily", publicName: "fontFamily", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, alpha: { classPropertyName: "alpha", publicName: "alpha", isSignal: true, isRequired: false, transformFunction: null }, gapX: { classPropertyName: "gapX", publicName: "gapX", isSignal: true, isRequired: false, transformFunction: null }, gapY: { classPropertyName: "gapY", publicName: "gapY", isSignal: true, isRequired: false, transformFunction: null }, offsetLeft: { classPropertyName: "offsetLeft", publicName: "offsetLeft", isSignal: true, isRequired: false, transformFunction: null }, offsetTop: { classPropertyName: "offsetTop", publicName: "offsetTop", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null }, imageWidth: { classPropertyName: "imageWidth", publicName: "imageWidth", isSignal: true, isRequired: false, transformFunction: null }, imageHeight: { classPropertyName: "imageHeight", publicName: "imageHeight", isSignal: true, isRequired: false, transformFunction: null }, imagePosition: { classPropertyName: "imagePosition", publicName: "imagePosition", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
236
|
+
}
|
|
237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkProperty, decorators: [{
|
|
238
|
+
type: Component,
|
|
239
|
+
args: [{ selector: `${XWatermarkPrefix}-property`, template: '' }]
|
|
240
|
+
}], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], rotate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rotate", required: false }] }], fontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontSize", required: false }] }], fontFamily: [{ type: i0.Input, args: [{ isSignal: true, alias: "fontFamily", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], zIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "zIndex", required: false }] }], alpha: [{ type: i0.Input, args: [{ isSignal: true, alias: "alpha", required: false }] }], gapX: [{ type: i0.Input, args: [{ isSignal: true, alias: "gapX", required: false }] }], gapY: [{ type: i0.Input, args: [{ isSignal: true, alias: "gapY", required: false }] }], offsetLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsetLeft", required: false }] }], offsetTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsetTop", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], imageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSrc", required: false }] }], imageWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageWidth", required: false }] }], imageHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageHeight", required: false }] }], imagePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "imagePosition", required: false }] }] } });
|
|
241
|
+
|
|
242
|
+
class XWatermarkComponent extends XWatermarkProperty {
|
|
243
|
+
constructor() {
|
|
244
|
+
super();
|
|
245
|
+
this.backgroundImage = signal('', ...(ngDevMode ? [{ debugName: "backgroundImage" }] : []));
|
|
246
|
+
this.font = computed(() => {
|
|
247
|
+
return `${this.fontSize()}px ${this.fontFamily()}`;
|
|
248
|
+
}, ...(ngDevMode ? [{ debugName: "font" }] : []));
|
|
249
|
+
this.textWidth = computed(() => {
|
|
250
|
+
const canvas = document.createElement('canvas');
|
|
251
|
+
const ctx = canvas.getContext('2d');
|
|
252
|
+
if (ctx) {
|
|
253
|
+
ctx.font = this.font();
|
|
254
|
+
return ctx.measureText(this.content()).width;
|
|
255
|
+
}
|
|
256
|
+
return this.width();
|
|
257
|
+
}, ...(ngDevMode ? [{ debugName: "textWidth" }] : []));
|
|
258
|
+
this.watermarkWidth = computed(() => {
|
|
259
|
+
const imgW = this.imageSrc() && this.imageWidth() ? this.imageWidth() : this.textWidth();
|
|
260
|
+
return Math.max(imgW, this.textWidth()) + this.gapX();
|
|
261
|
+
}, ...(ngDevMode ? [{ debugName: "watermarkWidth" }] : []));
|
|
262
|
+
this.watermarkHeight = computed(() => {
|
|
263
|
+
const imgH = this.imageSrc() && this.imageHeight() ? this.imageHeight() : this.height();
|
|
264
|
+
return Math.max(imgH, this.height()) + this.gapY();
|
|
265
|
+
}, ...(ngDevMode ? [{ debugName: "watermarkHeight" }] : []));
|
|
266
|
+
}
|
|
267
|
+
ngAfterViewInit() {
|
|
268
|
+
this.createWatermark();
|
|
269
|
+
}
|
|
270
|
+
ngOnDestroy() { }
|
|
271
|
+
createWatermark() {
|
|
272
|
+
if (this.imageSrc()) {
|
|
273
|
+
this.drawWatermarkWithImage();
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
this.drawWatermarkText();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
loadImage(src) {
|
|
280
|
+
return new Promise((resolve, reject) => {
|
|
281
|
+
const img = new Image();
|
|
282
|
+
img.crossOrigin = 'anonymous';
|
|
283
|
+
img.onload = () => resolve(img);
|
|
284
|
+
img.onerror = reject;
|
|
285
|
+
img.src = src;
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
async drawWatermarkWithImage() {
|
|
289
|
+
const w = this.watermarkWidth();
|
|
290
|
+
const h = this.watermarkHeight();
|
|
291
|
+
const canvas = document.createElement('canvas');
|
|
292
|
+
canvas.width = w;
|
|
293
|
+
canvas.height = h;
|
|
294
|
+
const ctx = canvas.getContext('2d');
|
|
295
|
+
if (!ctx)
|
|
296
|
+
return;
|
|
297
|
+
try {
|
|
298
|
+
const img = await this.loadImage(this.imageSrc());
|
|
299
|
+
const imgW = this.imageWidth() || this.width();
|
|
300
|
+
const imgH = this.imageHeight() || this.height();
|
|
301
|
+
ctx.save();
|
|
302
|
+
ctx.rotate((this.rotate() * Math.PI) / 180);
|
|
303
|
+
ctx.globalAlpha = this.alpha();
|
|
304
|
+
// 绘制图片
|
|
305
|
+
const imgX = (w - imgW) / 2;
|
|
306
|
+
const imgY = (h - imgH) / 2;
|
|
307
|
+
ctx.drawImage(img, imgX, imgY, imgW, imgH);
|
|
308
|
+
// 绘制文本
|
|
309
|
+
if (this.content()) {
|
|
310
|
+
ctx.font = this.font();
|
|
311
|
+
ctx.fillStyle = this.color();
|
|
312
|
+
ctx.textAlign = 'center';
|
|
313
|
+
ctx.textBaseline = 'middle';
|
|
314
|
+
let textY = h / 2;
|
|
315
|
+
if (this.imagePosition() === 'top') {
|
|
316
|
+
textY = imgY - 10;
|
|
317
|
+
}
|
|
318
|
+
else if (this.imagePosition() === 'bottom') {
|
|
319
|
+
textY = imgY + imgH + 10;
|
|
320
|
+
}
|
|
321
|
+
ctx.fillText(this.content(), w / 2, textY);
|
|
322
|
+
}
|
|
323
|
+
ctx.restore();
|
|
324
|
+
this.backgroundImage.set(canvas.toDataURL());
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// 图片加载失败,降级为纯文本
|
|
328
|
+
this.drawWatermarkText();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
drawWatermarkText() {
|
|
332
|
+
const w = this.watermarkWidth();
|
|
333
|
+
const h = this.watermarkHeight();
|
|
334
|
+
const canvas = document.createElement('canvas');
|
|
335
|
+
canvas.width = w;
|
|
336
|
+
canvas.height = h;
|
|
337
|
+
const ctx = canvas.getContext('2d');
|
|
338
|
+
if (!ctx)
|
|
339
|
+
return;
|
|
340
|
+
ctx.save();
|
|
341
|
+
ctx.rotate((this.rotate() * Math.PI) / 180);
|
|
342
|
+
ctx.font = this.font();
|
|
343
|
+
ctx.fillStyle = this.color();
|
|
344
|
+
ctx.globalAlpha = this.alpha();
|
|
345
|
+
ctx.textAlign = 'center';
|
|
346
|
+
ctx.textBaseline = 'middle';
|
|
347
|
+
ctx.fillText(this.content(), w / 2, h / 2);
|
|
348
|
+
ctx.restore();
|
|
349
|
+
const dataUrl = canvas.toDataURL();
|
|
350
|
+
this.backgroundImage.set(dataUrl);
|
|
351
|
+
}
|
|
352
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
353
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: XWatermarkComponent, isStandalone: true, selector: "x-watermark", usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-watermark\"\r\n [class.x-watermark-disabled]=\"disabled()\"\r\n [style.z-index]=\"zIndex()\"\r\n [style.background-image]=\"backgroundImage() ? 'url(' + backgroundImage() + ')' : 'none'\"\r\n [style.background-repeat]=\"'repeat'\"\r\n [style.background-size]=\"watermarkWidth() + 'px ' + watermarkHeight() + 'px'\"\r\n [style.background-position]=\"offsetLeft() + 'px ' + offsetTop() + 'px'\"\r\n>\r\n <ng-content></ng-content>\r\n</div>", styles: [".x-watermark{margin:0;padding:0}.x-watermark{font-size:var(--x-font-size);display:inline-block;box-sizing:border-box;position:relative}.x-watermark-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
354
|
+
}
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkComponent, decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{ selector: XWatermarkPrefix, imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"x-watermark\"\r\n [class.x-watermark-disabled]=\"disabled()\"\r\n [style.z-index]=\"zIndex()\"\r\n [style.background-image]=\"backgroundImage() ? 'url(' + backgroundImage() + ')' : 'none'\"\r\n [style.background-repeat]=\"'repeat'\"\r\n [style.background-size]=\"watermarkWidth() + 'px ' + watermarkHeight() + 'px'\"\r\n [style.background-position]=\"offsetLeft() + 'px ' + offsetTop() + 'px'\"\r\n>\r\n <ng-content></ng-content>\r\n</div>", styles: [".x-watermark{margin:0;padding:0}.x-watermark{font-size:var(--x-font-size);display:inline-block;box-sizing:border-box;position:relative}.x-watermark-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
|
|
358
|
+
}], ctorParameters: () => [] });
|
|
359
|
+
|
|
360
|
+
class XWatermarkModule {
|
|
361
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
362
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkModule, imports: [XWatermarkComponent], exports: [XWatermarkComponent] }); }
|
|
363
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkModule }); }
|
|
364
|
+
}
|
|
365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XWatermarkModule, decorators: [{
|
|
366
|
+
type: NgModule,
|
|
367
|
+
args: [{
|
|
368
|
+
exports: [XWatermarkComponent],
|
|
369
|
+
imports: [XWatermarkComponent]
|
|
370
|
+
}]
|
|
371
|
+
}] });
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Generated bundle index. Do not edit.
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
export { XWatermarkComponent, XWatermarkModule, XWatermarkPrefix, XWatermarkProperty };
|
|
378
|
+
//# sourceMappingURL=ng-nest-ui-watermark.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-watermark.mjs","sources":["../../../../lib/ng-nest/ui/watermark/watermark.property.ts","../../../../lib/ng-nest/ui/watermark/watermark.component.ts","../../../../lib/ng-nest/ui/watermark/watermark.component.html","../../../../lib/ng-nest/ui/watermark/watermark.module.ts","../../../../lib/ng-nest/ui/watermark/ng-nest-ui-watermark.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\r\nimport { XToNumber, XToBoolean, XPropertyFunction } from '@ng-nest/ui/core';\r\nimport type { XNumber, XBoolean } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Watermark\r\n * @selector x-watermark\r\n * @decorator component\r\n */\r\nexport const XWatermarkPrefix = 'x-watermark';\r\nconst X_WATERMARK_CONFIG_NAME = 'watermark';\r\n\r\n/**\r\n * Watermark Property\r\n */\r\n@Component({ selector: `${XWatermarkPrefix}-property`, template: '' })\r\nexport class XWatermarkProperty extends XPropertyFunction(X_WATERMARK_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 水印内容\r\n * @en_US Watermark content\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark content=\"NG-NEST\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly content = input<string>('');\r\n /**\r\n * @zh_CN 水印宽度\r\n * @en_US Watermark width\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [width]=\"120\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly width = input<number, XNumber>(this.config?.width ?? 120, { transform: XToNumber });\r\n /**\r\n * @zh_CN 水印高度\r\n * @en_US Watermark height\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [height]=\"60\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly height = input<number, XNumber>(this.config?.height ?? 60, { transform: XToNumber });\r\n /**\r\n * @zh_CN 旋转角度\r\n * @en_US Rotation angle\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [rotate]=\"-22\"></x-watermark>\r\n * <x-watermark [rotate]=\"0\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly rotate = input<number, XNumber>(this.config?.rotate ?? -22, { transform: XToNumber });\r\n /**\r\n * @zh_CN 字体大小\r\n * @en_US Font size\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [fontSize]=\"14\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly fontSize = input<number, XNumber>(this.config?.fontSize ?? 14, { transform: XToNumber });\r\n /**\r\n * @zh_CN 字体\r\n * @en_US Font family\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark fontFamily=\"Varela Round\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly fontFamily = input<string>(this.config?.fontFamily ?? 'Varela Round');\r\n /**\r\n * @zh_CN 字体颜色\r\n * @en_US Font color\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark color=\"rgba(0, 0, 0, 0.12)\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly color = input<string>(this.config?.color ?? 'rgba(0, 0, 0, 0.12)');\r\n /**\r\n * @zh_CN 层级\r\n * @en_US Z-index\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [zIndex]=\"9999\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly zIndex = input<number, XNumber>(this.config?.zIndex ?? 9999, { transform: XToNumber });\r\n /**\r\n * @zh_CN 透明度\r\n * @en_US Opacity\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [alpha]=\"1\"></x-watermark>\r\n * <x-watermark [alpha]=\"0.5\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly alpha = input<number, XNumber>(this.config?.alpha ?? 1, { transform: XToNumber });\r\n /**\r\n * @zh_CN 水平间距\r\n * @en_US Horizontal gap\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [gapX]=\"100\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly gapX = input<number, XNumber>(this.config?.gapX ?? 100, { transform: XToNumber });\r\n /**\r\n * @zh_CN 垂直间距\r\n * @en_US Vertical gap\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [gapY]=\"100\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly gapY = input<number, XNumber>(this.config?.gapY ?? 100, { transform: XToNumber });\r\n /**\r\n * @zh_CN 水平偏移\r\n * @en_US Horizontal offset\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [offsetLeft]=\"0\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly offsetLeft = input<number, XNumber>(this.config?.offsetLeft ?? 0, { transform: XToNumber });\r\n /**\r\n * @zh_CN 垂直偏移\r\n * @en_US Vertical offset\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [offsetTop]=\"0\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly offsetTop = input<number, XNumber>(this.config?.offsetTop ?? 0, { transform: XToNumber });\r\n /**\r\n * @zh_CN 是否交错显示\r\n * @en_US Whether to stagger display\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [striped]=\"true\"></x-watermark>\r\n * <x-watermark [striped]=\"false\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly striped = input<boolean, XBoolean>(this.config?.striped ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 是否禁用\r\n * @en_US Whether to disable\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [disabled]=\"true\"></x-watermark>\r\n * <x-watermark [disabled]=\"false\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly disabled = input<boolean, XBoolean>(this.config?.disabled ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 图片/图标 URL\r\n * @en_US Image/icon URL\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark imageSrc=\"/assets/logo.png\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly imageSrc = input<string>('');\r\n /**\r\n * @zh_CN 图片宽度\r\n * @en_US Image width\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [imageWidth]=\"40\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly imageWidth = input<number, XNumber>(0, { transform: XToNumber });\r\n /**\r\n * @zh_CN 图片高度\r\n * @en_US Image height\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark [imageHeight]=\"40\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly imageHeight = input<number, XNumber>(0, { transform: XToNumber });\r\n /**\r\n * @zh_CN 图片相对文本的位置\r\n * @en_US Image position relative to text\r\n * @example\r\n *\r\n * ```html\r\n * <x-watermark imagePosition=\"top\"></x-watermark>\r\n * <x-watermark imagePosition=\"center\"></x-watermark>\r\n * <x-watermark imagePosition=\"bottom\"></x-watermark>\r\n * ```\r\n *\r\n */\r\n readonly imagePosition = input<XWatermarkImagePosition>('center');\r\n}\r\n\r\n/**\r\n * @zh_CN 图片相对文本的位置\r\n * @en_US Image position relative to text\r\n */\r\nexport type XWatermarkImagePosition = 'top' | 'center' | 'bottom';\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n computed,\r\n signal,\r\n AfterViewInit,\r\n OnDestroy\r\n} from '@angular/core';\r\nimport { XWatermarkProperty, XWatermarkPrefix } from './watermark.property';\r\n\r\n@Component({\r\n selector: XWatermarkPrefix,\r\n imports: [],\r\n templateUrl: './watermark.component.html',\r\n styleUrls: ['./watermark.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class XWatermarkComponent extends XWatermarkProperty implements AfterViewInit, OnDestroy {\r\n backgroundImage = signal<string>('');\r\n\r\n private font = computed(() => {\r\n return `${this.fontSize()}px ${this.fontFamily()}`;\r\n });\r\n\r\n private textWidth = computed(() => {\r\n const canvas = document.createElement('canvas');\r\n const ctx = canvas.getContext('2d');\r\n if (ctx) {\r\n ctx.font = this.font();\r\n return ctx.measureText(this.content()).width;\r\n }\r\n return this.width();\r\n });\r\n\r\n watermarkWidth = computed(() => {\r\n const imgW = this.imageSrc() && this.imageWidth() ? this.imageWidth() : this.textWidth();\r\n return Math.max(imgW, this.textWidth()) + this.gapX();\r\n });\r\n \r\n watermarkHeight = computed(() => {\r\n const imgH = this.imageSrc() && this.imageHeight() ? this.imageHeight() : this.height();\r\n return Math.max(imgH, this.height()) + this.gapY();\r\n });\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.createWatermark();\r\n }\r\n\r\n ngOnDestroy() {}\r\n\r\n private createWatermark() {\r\n if (this.imageSrc()) {\r\n this.drawWatermarkWithImage();\r\n } else {\r\n this.drawWatermarkText();\r\n }\r\n }\r\n\r\n private loadImage(src: string): Promise<HTMLImageElement> {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image();\r\n img.crossOrigin = 'anonymous';\r\n img.onload = () => resolve(img);\r\n img.onerror = reject;\r\n img.src = src;\r\n });\r\n }\r\n\r\n private async drawWatermarkWithImage() {\r\n const w = this.watermarkWidth();\r\n const h = this.watermarkHeight();\r\n const canvas = document.createElement('canvas');\r\n canvas.width = w;\r\n canvas.height = h;\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx) return;\r\n\r\n try {\r\n const img = await this.loadImage(this.imageSrc());\r\n const imgW = this.imageWidth() || this.width();\r\n const imgH = this.imageHeight() || this.height();\r\n \r\n ctx.save();\r\n ctx.rotate((this.rotate() * Math.PI) / 180);\r\n ctx.globalAlpha = this.alpha();\r\n \r\n // 绘制图片\r\n const imgX = (w - imgW) / 2;\r\n const imgY = (h - imgH) / 2;\r\n ctx.drawImage(img, imgX, imgY, imgW, imgH);\r\n \r\n // 绘制文本\r\n if (this.content()) {\r\n ctx.font = this.font();\r\n ctx.fillStyle = this.color();\r\n ctx.textAlign = 'center';\r\n ctx.textBaseline = 'middle';\r\n \r\n let textY = h / 2;\r\n if (this.imagePosition() === 'top') {\r\n textY = imgY - 10;\r\n } else if (this.imagePosition() === 'bottom') {\r\n textY = imgY + imgH + 10;\r\n }\r\n \r\n ctx.fillText(this.content(), w / 2, textY);\r\n }\r\n \r\n ctx.restore();\r\n this.backgroundImage.set(canvas.toDataURL());\r\n } catch {\r\n // 图片加载失败,降级为纯文本\r\n this.drawWatermarkText();\r\n }\r\n }\r\n\r\n private drawWatermarkText() {\r\n const w = this.watermarkWidth();\r\n const h = this.watermarkHeight();\r\n\r\n const canvas = document.createElement('canvas');\r\n canvas.width = w;\r\n canvas.height = h;\r\n\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx) return;\r\n\r\n ctx.save();\r\n ctx.rotate((this.rotate() * Math.PI) / 180);\r\n ctx.font = this.font();\r\n ctx.fillStyle = this.color();\r\n ctx.globalAlpha = this.alpha();\r\n ctx.textAlign = 'center';\r\n ctx.textBaseline = 'middle';\r\n ctx.fillText(this.content(), w / 2, h / 2);\r\n ctx.restore();\r\n\r\n const dataUrl = canvas.toDataURL();\r\n this.backgroundImage.set(dataUrl);\r\n }\r\n}\r\n","<div\r\n class=\"x-watermark\"\r\n [class.x-watermark-disabled]=\"disabled()\"\r\n [style.z-index]=\"zIndex()\"\r\n [style.background-image]=\"backgroundImage() ? 'url(' + backgroundImage() + ')' : 'none'\"\r\n [style.background-repeat]=\"'repeat'\"\r\n [style.background-size]=\"watermarkWidth() + 'px ' + watermarkHeight() + 'px'\"\r\n [style.background-position]=\"offsetLeft() + 'px ' + offsetTop() + 'px'\"\r\n>\r\n <ng-content></ng-content>\r\n</div>","import { NgModule } from '@angular/core';\r\nimport { XWatermarkComponent } from './watermark.component';\r\n\r\n@NgModule({\r\n exports: [XWatermarkComponent],\r\n imports: [XWatermarkComponent]\r\n})\r\nexport class XWatermarkModule {}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACI,MAAM,gBAAgB,GAAG;AAChC,MAAM,uBAAuB,GAAG,WAAW;AAE3C;;AAEG;MAEU,kBAAmB,SAAQ,iBAAiB,CAAC,uBAAuB,CAAC,CAAA;AADlF,IAAA,WAAA,GAAA;;AAEE;;;;;;;;;AASG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,EAAE,mDAAC;AACpC;;;;;;;;;AASG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,GAAG,yCAAI,SAAS,EAAE,SAAS,EAAA,CAAA,GAAA,CAAtB,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA,CAAA,CAAC;AAC5F;;;;;;;;;AASG;QACM,IAAA,CAAA,MAAM,GAAG,KAA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|
export * from '@ng-nest/ui/crumb';
|
|
74
|
+
export * from '@ng-nest/ui/contextmenu';
|
|
74
75
|
export * from '@ng-nest/ui/dropdown';
|
|
75
76
|
export * from '@ng-nest/ui/menu';
|
|
76
77
|
export * from '@ng-nest/ui/page-header';
|
|
@@ -85,6 +86,7 @@ export * from '@ng-nest/ui/attachments';
|
|
|
85
86
|
export * from '@ng-nest/ui/suggestion';
|
|
86
87
|
export * from '@ng-nest/ui/thought-chain';
|
|
87
88
|
export * from '@ng-nest/ui/doc';
|
|
89
|
+
export * from '@ng-nest/ui/divider';
|
|
88
90
|
export * from '@ng-nest/ui/examples';
|
|
89
91
|
export * from '@ng-nest/ui/api';
|
|
90
92
|
export * from '@ng-nest/ui/pattern';
|
|
@@ -92,6 +94,8 @@ export * from '@ng-nest/ui/slider';
|
|
|
92
94
|
export * from '@ng-nest/ui/scrollable';
|
|
93
95
|
export * from '@ng-nest/ui/highlight';
|
|
94
96
|
export * from '@ng-nest/ui/inner';
|
|
97
|
+
export * from '@ng-nest/ui/watermark';
|
|
98
|
+
export * from '@ng-nest/ui/splitter';
|
|
95
99
|
|
|
96
100
|
/**
|
|
97
101
|
* Core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui.mjs","sources":["../../../../lib/ng-nest/ui/index.ts","../../../../lib/ng-nest/ui/ng-nest-ui.ts"],"sourcesContent":["/**\r\n * Core\r\n */\r\nexport * from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Basic\r\n */\r\nexport * from '@ng-nest/ui/button';\r\nexport * from '@ng-nest/ui/color';\r\nexport * from '@ng-nest/ui/container';\r\nexport * from '@ng-nest/ui/layout';\r\nexport * from '@ng-nest/ui/icon';\r\nexport * from '@ng-nest/ui/i18n';\r\nexport * from '@ng-nest/ui/link';\r\nexport * from '@ng-nest/ui/theme';\r\n\r\n/**\r\n * Data\r\n */\r\nexport * from '@ng-nest/ui/avatar';\r\nexport * from '@ng-nest/ui/badge';\r\nexport * from '@ng-nest/ui/card';\r\nexport * from '@ng-nest/ui/carousel';\r\nexport * from '@ng-nest/ui/collapse';\r\nexport * from '@ng-nest/ui/calendar';\r\nexport * from '@ng-nest/ui/comment';\r\nexport * from '@ng-nest/ui/description';\r\nexport * from '@ng-nest/ui/empty';\r\nexport * from '@ng-nest/ui/image';\r\nexport * from '@ng-nest/ui/outlet';\r\nexport * from '@ng-nest/ui/pagination';\r\nexport * from '@ng-nest/ui/progress';\r\nexport * from '@ng-nest/ui/ripple';\r\nexport * from '@ng-nest/ui/resizable';\r\nexport * from '@ng-nest/ui/drag';\r\nexport * from '@ng-nest/ui/statistic';\r\nexport * from '@ng-nest/ui/table';\r\nexport * from '@ng-nest/ui/table-view';\r\nexport * from '@ng-nest/ui/tag';\r\nexport * from '@ng-nest/ui/text-retract';\r\nexport * from '@ng-nest/ui/time-ago';\r\nexport * from '@ng-nest/ui/time-range';\r\nexport * from '@ng-nest/ui/timeline';\r\nexport * from '@ng-nest/ui/tree';\r\nexport * from '@ng-nest/ui/tree-file';\r\nexport * from '@ng-nest/ui/keyword';\r\n\r\n/**\r\n * Feedback\r\n */\r\nexport * from '@ng-nest/ui/alert';\r\nexport * from '@ng-nest/ui/dialog';\r\nexport * from '@ng-nest/ui/drawer';\r\nexport * from '@ng-nest/ui/loading';\r\nexport * from '@ng-nest/ui/message';\r\nexport * from '@ng-nest/ui/message-box';\r\nexport * from '@ng-nest/ui/notification';\r\nexport * from '@ng-nest/ui/popconfirm';\r\nexport * from '@ng-nest/ui/popover';\r\nexport * from '@ng-nest/ui/result';\r\nexport * from '@ng-nest/ui/skeleton';\r\nexport * from '@ng-nest/ui/tooltip';\r\n\r\n/**\r\n * Form\r\n */\r\nexport * from '@ng-nest/ui/auto-complete';\r\nexport * from '@ng-nest/ui/base-form';\r\nexport * from '@ng-nest/ui/cascade';\r\nexport * from '@ng-nest/ui/checkbox';\r\nexport * from '@ng-nest/ui/color-picker';\r\nexport * from '@ng-nest/ui/date-picker';\r\nexport * from '@ng-nest/ui/form';\r\nexport * from '@ng-nest/ui/find';\r\nexport * from '@ng-nest/ui/input';\r\nexport * from '@ng-nest/ui/input-number';\r\nexport * from '@ng-nest/ui/list';\r\nexport * from '@ng-nest/ui/radio';\r\nexport * from '@ng-nest/ui/rate';\r\nexport * from '@ng-nest/ui/select';\r\nexport * from '@ng-nest/ui/slider-select';\r\nexport * from '@ng-nest/ui/switch';\r\nexport * from '@ng-nest/ui/time-picker';\r\nexport * from '@ng-nest/ui/transfer';\r\nexport * from '@ng-nest/ui/tree-select';\r\nexport * from '@ng-nest/ui/textarea';\r\nexport * from '@ng-nest/ui/upload';\r\n\r\n/**\r\n * Navigation\r\n */\r\nexport * from '@ng-nest/ui/affix';\r\nexport * from '@ng-nest/ui/anchor';\r\nexport * from '@ng-nest/ui/back-top';\r\nexport * from '@ng-nest/ui/crumb';\r\nexport * from '@ng-nest/ui/dropdown';\r\nexport * from '@ng-nest/ui/menu';\r\nexport * from '@ng-nest/ui/page-header';\r\nexport * from '@ng-nest/ui/steps';\r\nexport * from '@ng-nest/ui/tabs';\r\n\r\n/**\r\n * AI\r\n */\r\nexport * from '@ng-nest/ui/bubble';\r\nexport * from '@ng-nest/ui/sender';\r\nexport * from '@ng-nest/ui/coversations';\r\nexport * from '@ng-nest/ui/welcome';\r\nexport * from '@ng-nest/ui/prompts';\r\nexport * from '@ng-nest/ui/attachments';\r\nexport * from '@ng-nest/ui/suggestion';\r\nexport * from '@ng-nest/ui/thought-chain';\r\n\r\n/**\r\n * Others\r\n */\r\nexport * from '@ng-nest/ui/doc';\r\nexport * from '@ng-nest/ui/examples';\r\nexport * from '@ng-nest/ui/api';\r\nexport * from '@ng-nest/ui/pattern';\r\nexport * from '@ng-nest/ui/slider';\r\nexport * from '@ng-nest/ui/scrollable';\r\nexport * from '@ng-nest/ui/highlight';\r\nexport * from '@ng-nest/ui/inner';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-nest-ui.mjs","sources":["../../../../lib/ng-nest/ui/index.ts","../../../../lib/ng-nest/ui/ng-nest-ui.ts"],"sourcesContent":["/**\r\n * Core\r\n */\r\nexport * from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Basic\r\n */\r\nexport * from '@ng-nest/ui/button';\r\nexport * from '@ng-nest/ui/color';\r\nexport * from '@ng-nest/ui/container';\r\nexport * from '@ng-nest/ui/layout';\r\nexport * from '@ng-nest/ui/icon';\r\nexport * from '@ng-nest/ui/i18n';\r\nexport * from '@ng-nest/ui/link';\r\nexport * from '@ng-nest/ui/theme';\r\n\r\n/**\r\n * Data\r\n */\r\nexport * from '@ng-nest/ui/avatar';\r\nexport * from '@ng-nest/ui/badge';\r\nexport * from '@ng-nest/ui/card';\r\nexport * from '@ng-nest/ui/carousel';\r\nexport * from '@ng-nest/ui/collapse';\r\nexport * from '@ng-nest/ui/calendar';\r\nexport * from '@ng-nest/ui/comment';\r\nexport * from '@ng-nest/ui/description';\r\nexport * from '@ng-nest/ui/empty';\r\nexport * from '@ng-nest/ui/image';\r\nexport * from '@ng-nest/ui/outlet';\r\nexport * from '@ng-nest/ui/pagination';\r\nexport * from '@ng-nest/ui/progress';\r\nexport * from '@ng-nest/ui/ripple';\r\nexport * from '@ng-nest/ui/resizable';\r\nexport * from '@ng-nest/ui/drag';\r\nexport * from '@ng-nest/ui/statistic';\r\nexport * from '@ng-nest/ui/table';\r\nexport * from '@ng-nest/ui/table-view';\r\nexport * from '@ng-nest/ui/tag';\r\nexport * from '@ng-nest/ui/text-retract';\r\nexport * from '@ng-nest/ui/time-ago';\r\nexport * from '@ng-nest/ui/time-range';\r\nexport * from '@ng-nest/ui/timeline';\r\nexport * from '@ng-nest/ui/tree';\r\nexport * from '@ng-nest/ui/tree-file';\r\nexport * from '@ng-nest/ui/keyword';\r\n\r\n/**\r\n * Feedback\r\n */\r\nexport * from '@ng-nest/ui/alert';\r\nexport * from '@ng-nest/ui/dialog';\r\nexport * from '@ng-nest/ui/drawer';\r\nexport * from '@ng-nest/ui/loading';\r\nexport * from '@ng-nest/ui/message';\r\nexport * from '@ng-nest/ui/message-box';\r\nexport * from '@ng-nest/ui/notification';\r\nexport * from '@ng-nest/ui/popconfirm';\r\nexport * from '@ng-nest/ui/popover';\r\nexport * from '@ng-nest/ui/result';\r\nexport * from '@ng-nest/ui/skeleton';\r\nexport * from '@ng-nest/ui/tooltip';\r\n\r\n/**\r\n * Form\r\n */\r\nexport * from '@ng-nest/ui/auto-complete';\r\nexport * from '@ng-nest/ui/base-form';\r\nexport * from '@ng-nest/ui/cascade';\r\nexport * from '@ng-nest/ui/checkbox';\r\nexport * from '@ng-nest/ui/color-picker';\r\nexport * from '@ng-nest/ui/date-picker';\r\nexport * from '@ng-nest/ui/form';\r\nexport * from '@ng-nest/ui/find';\r\nexport * from '@ng-nest/ui/input';\r\nexport * from '@ng-nest/ui/input-number';\r\nexport * from '@ng-nest/ui/list';\r\nexport * from '@ng-nest/ui/radio';\r\nexport * from '@ng-nest/ui/rate';\r\nexport * from '@ng-nest/ui/select';\r\nexport * from '@ng-nest/ui/slider-select';\r\nexport * from '@ng-nest/ui/switch';\r\nexport * from '@ng-nest/ui/time-picker';\r\nexport * from '@ng-nest/ui/transfer';\r\nexport * from '@ng-nest/ui/tree-select';\r\nexport * from '@ng-nest/ui/textarea';\r\nexport * from '@ng-nest/ui/upload';\r\n\r\n/**\r\n * Navigation\r\n */\r\nexport * from '@ng-nest/ui/affix';\r\nexport * from '@ng-nest/ui/anchor';\r\nexport * from '@ng-nest/ui/back-top';\r\nexport * from '@ng-nest/ui/crumb';\r\nexport * from '@ng-nest/ui/contextmenu';\r\nexport * from '@ng-nest/ui/dropdown';\r\nexport * from '@ng-nest/ui/menu';\r\nexport * from '@ng-nest/ui/page-header';\r\nexport * from '@ng-nest/ui/steps';\r\nexport * from '@ng-nest/ui/tabs';\r\n\r\n/**\r\n * AI\r\n */\r\nexport * from '@ng-nest/ui/bubble';\r\nexport * from '@ng-nest/ui/sender';\r\nexport * from '@ng-nest/ui/coversations';\r\nexport * from '@ng-nest/ui/welcome';\r\nexport * from '@ng-nest/ui/prompts';\r\nexport * from '@ng-nest/ui/attachments';\r\nexport * from '@ng-nest/ui/suggestion';\r\nexport * from '@ng-nest/ui/thought-chain';\r\n\r\n/**\r\n * Others\r\n */\r\nexport * from '@ng-nest/ui/doc';\r\nexport * from '@ng-nest/ui/divider';\r\nexport * from '@ng-nest/ui/examples';\r\nexport * from '@ng-nest/ui/api';\r\nexport * from '@ng-nest/ui/pattern';\r\nexport * from '@ng-nest/ui/slider';\r\nexport * from '@ng-nest/ui/scrollable';\r\nexport * from '@ng-nest/ui/highlight';\r\nexport * from '@ng-nest/ui/inner';\r\nexport * from '@ng-nest/ui/watermark';\r\nexport * from '@ng-nest/ui/splitter';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
|
package/find/index.d.ts
CHANGED
|
@@ -29,19 +29,18 @@ declare const XFindProperty_base: new () => {
|
|
|
29
29
|
invalidPattern: _angular_core.Signal<boolean>;
|
|
30
30
|
requiredIsEmpty: _angular_core.Signal<boolean>;
|
|
31
31
|
invalidMessage: _angular_core.Signal<string>;
|
|
32
|
-
invalidIndex: _angular_core.Signal<number>;
|
|
33
32
|
value: _angular_core.WritableSignal<any>;
|
|
34
33
|
valueObservable: rxjs.Observable<any>;
|
|
35
34
|
validatorSignal: _angular_core.WritableSignal<boolean>;
|
|
36
35
|
disabledSignal: _angular_core.WritableSignal<boolean>;
|
|
37
36
|
requiredSignal: _angular_core.WritableSignal<boolean>;
|
|
38
37
|
patternSignal: _angular_core.WritableSignal<any>;
|
|
39
|
-
messageSignal: _angular_core.WritableSignal<string
|
|
38
|
+
messageSignal: _angular_core.WritableSignal<string>;
|
|
40
39
|
requiredComputed: _angular_core.Signal<boolean>;
|
|
41
40
|
disabledComputed: _angular_core.Signal<boolean>;
|
|
42
41
|
validatorComputed: _angular_core.Signal<boolean>;
|
|
43
42
|
patternComputed: _angular_core.Signal<any>;
|
|
44
|
-
messageComputed: _angular_core.Signal<string
|
|
43
|
+
messageComputed: _angular_core.Signal<string>;
|
|
45
44
|
invalidInputValidator: _angular_core.WritableSignal<boolean>;
|
|
46
45
|
onChange: (value: any) => void;
|
|
47
46
|
onTouched: () => void;
|
|
@@ -66,8 +65,8 @@ declare const XFindProperty_base: new () => {
|
|
|
66
65
|
readonly valueTplContext: _angular_core.InputSignal<unknown>;
|
|
67
66
|
readonly before: _angular_core.InputSignal<XTemplate | undefined>;
|
|
68
67
|
readonly after: _angular_core.InputSignal<XTemplate | undefined>;
|
|
69
|
-
readonly pattern: _angular_core.InputSignal<RegExp |
|
|
70
|
-
readonly message: _angular_core.InputSignal<string
|
|
68
|
+
readonly pattern: _angular_core.InputSignal<RegExp | null>;
|
|
69
|
+
readonly message: _angular_core.InputSignal<string>;
|
|
71
70
|
readonly active: _angular_core.ModelSignal<boolean>;
|
|
72
71
|
readonly pointer: _angular_core.InputSignalWithTransform<boolean, XBoolean>;
|
|
73
72
|
readonly inputValidator: _angular_core.InputSignal<((value: any) => boolean) | undefined>;
|
|
@@ -549,12 +548,12 @@ interface XFindOption extends XFormOption {
|
|
|
549
548
|
* @zh_CN 正则验证规则
|
|
550
549
|
* @en_US Regular verification rules
|
|
551
550
|
*/
|
|
552
|
-
pattern?: RegExp
|
|
551
|
+
pattern?: RegExp;
|
|
553
552
|
/**
|
|
554
553
|
* @zh_CN 验证不通过提示文字
|
|
555
554
|
* @en_US Verify not pass the prompt text
|
|
556
555
|
*/
|
|
557
|
-
message?: string
|
|
556
|
+
message?: string;
|
|
558
557
|
/**
|
|
559
558
|
* @zh_CN 激活状态
|
|
560
559
|
* @en_US Activation state
|
package/form/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, OnChanges, AfterViewInit, SimpleChanges, OnInit, OnDestroy, ComponentRef } from '@angular/core';
|
|
2
|
+
import { TemplateRef, InputSignal, InputSignalWithTransform, OnChanges, AfterViewInit, SimpleChanges, OnInit, OnDestroy, ComponentRef } from '@angular/core';
|
|
3
3
|
import * as rxjs from 'rxjs';
|
|
4
4
|
import * as _ng_nest_ui_core from '@ng-nest/ui/core';
|
|
5
5
|
import { XBoolean, XNumber, XIdentity } from '@ng-nest/ui/core';
|
|
@@ -43,19 +43,18 @@ declare const XFormProperty_base: new () => {
|
|
|
43
43
|
invalidPattern: _angular_core.Signal<boolean>;
|
|
44
44
|
requiredIsEmpty: _angular_core.Signal<boolean>;
|
|
45
45
|
invalidMessage: _angular_core.Signal<string>;
|
|
46
|
-
invalidIndex: _angular_core.Signal<number>;
|
|
47
46
|
value: _angular_core.WritableSignal<any>;
|
|
48
47
|
valueObservable: rxjs.Observable<any>;
|
|
49
48
|
validatorSignal: _angular_core.WritableSignal<boolean>;
|
|
50
49
|
disabledSignal: _angular_core.WritableSignal<boolean>;
|
|
51
50
|
requiredSignal: _angular_core.WritableSignal<boolean>;
|
|
52
51
|
patternSignal: _angular_core.WritableSignal<any>;
|
|
53
|
-
messageSignal: _angular_core.WritableSignal<string
|
|
52
|
+
messageSignal: _angular_core.WritableSignal<string>;
|
|
54
53
|
requiredComputed: _angular_core.Signal<boolean>;
|
|
55
54
|
disabledComputed: _angular_core.Signal<boolean>;
|
|
56
55
|
validatorComputed: _angular_core.Signal<boolean>;
|
|
57
56
|
patternComputed: _angular_core.Signal<any>;
|
|
58
|
-
messageComputed: _angular_core.Signal<string
|
|
57
|
+
messageComputed: _angular_core.Signal<string>;
|
|
59
58
|
invalidInputValidator: _angular_core.WritableSignal<boolean>;
|
|
60
59
|
onChange: (value: any) => void;
|
|
61
60
|
onTouched: () => void;
|
|
@@ -80,8 +79,8 @@ declare const XFormProperty_base: new () => {
|
|
|
80
79
|
readonly valueTplContext: _angular_core.InputSignal<unknown>;
|
|
81
80
|
readonly before: _angular_core.InputSignal<_ng_nest_ui_core.XTemplate | undefined>;
|
|
82
81
|
readonly after: _angular_core.InputSignal<_ng_nest_ui_core.XTemplate | undefined>;
|
|
83
|
-
readonly pattern: _angular_core.InputSignal<RegExp |
|
|
84
|
-
readonly message: _angular_core.InputSignal<string
|
|
82
|
+
readonly pattern: _angular_core.InputSignal<RegExp | null>;
|
|
83
|
+
readonly message: _angular_core.InputSignal<string>;
|
|
85
84
|
readonly active: _angular_core.ModelSignal<boolean>;
|
|
86
85
|
readonly pointer: _angular_core.InputSignalWithTransform<boolean, XBoolean>;
|
|
87
86
|
readonly inputValidator: _angular_core.InputSignal<((value: any) => boolean) | undefined>;
|
|
@@ -198,12 +197,12 @@ interface XControlOption {
|
|
|
198
197
|
* @zh_CN 正则验证规则
|
|
199
198
|
* @en_US Regular validation rules
|
|
200
199
|
*/
|
|
201
|
-
pattern?: RegExp
|
|
200
|
+
pattern?: RegExp;
|
|
202
201
|
/**
|
|
203
202
|
* @zh_CN 验证不通过提示文字
|
|
204
203
|
* @en_US Verification failed prompt text
|
|
205
204
|
*/
|
|
206
|
-
message?: string
|
|
205
|
+
message?: string;
|
|
207
206
|
/**
|
|
208
207
|
* @zh_CN 输入框的验证函数
|
|
209
208
|
* @en_US Validation function of input box
|
|
@@ -269,12 +268,12 @@ declare class XControl extends XIdentity implements XControlOption {
|
|
|
269
268
|
* @zh_CN 正则验证规则
|
|
270
269
|
* @en_US Regular validation rules
|
|
271
270
|
*/
|
|
272
|
-
pattern?: RegExp
|
|
271
|
+
pattern?: RegExp;
|
|
273
272
|
/**
|
|
274
273
|
* @zh_CN 验证不通过提示文字
|
|
275
274
|
* @en_US Verification failed prompt text
|
|
276
275
|
*/
|
|
277
|
-
message?: string
|
|
276
|
+
message?: string;
|
|
278
277
|
/**
|
|
279
278
|
* @zh_CN 输入框的验证函数
|
|
280
279
|
* @en_US Validation function of input box
|
|
@@ -497,7 +496,19 @@ declare class XAutoCompleteControl extends XControl {
|
|
|
497
496
|
interface XTemplateControlOption extends XControlOption, XFormOption {
|
|
498
497
|
}
|
|
499
498
|
|
|
500
|
-
|
|
499
|
+
interface XFormContext {
|
|
500
|
+
formGroup: InputSignal<UntypedFormGroup>;
|
|
501
|
+
controlComponents: {
|
|
502
|
+
[property: string]: XFormControlComponent;
|
|
503
|
+
};
|
|
504
|
+
controlTypes: {
|
|
505
|
+
[property: string]: XControl;
|
|
506
|
+
};
|
|
507
|
+
disabled: InputSignalWithTransform<boolean, XBoolean>;
|
|
508
|
+
labelSuffix: InputSignal<string>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
declare class XFormComponent extends XFormProperty implements OnChanges, AfterViewInit, XFormContext {
|
|
501
512
|
controlsType: _angular_core.Signal<"rows" | "controls">;
|
|
502
513
|
controlComponents: {
|
|
503
514
|
[property: string]: XFormControlComponent;
|
|
@@ -528,7 +539,7 @@ declare class XControlComponent extends XControlProperty implements OnInit, Afte
|
|
|
528
539
|
private formControl;
|
|
529
540
|
private _unSubject;
|
|
530
541
|
value: _angular_core.WritableSignal<any>;
|
|
531
|
-
form:
|
|
542
|
+
form: XFormContext;
|
|
532
543
|
locale: _angular_core.Signal<XI18nForm | {
|
|
533
544
|
required: string;
|
|
534
545
|
}>;
|
|
@@ -543,7 +554,7 @@ declare class XControlComponent extends XControlProperty implements OnInit, Afte
|
|
|
543
554
|
setValidators(): void;
|
|
544
555
|
setOption(): void;
|
|
545
556
|
setPattern(): void;
|
|
546
|
-
getPatternMsg(
|
|
557
|
+
getPatternMsg(_pattern: string): string | undefined;
|
|
547
558
|
setMessages(state: FormControlStatus): void;
|
|
548
559
|
createComponentPortal(option: XFormControlOption): ComponentPortal<XInputComponent> | ComponentPortal<XSelectComponent> | ComponentPortal<XCheckboxComponent> | ComponentPortal<XRadioComponent> | ComponentPortal<XSwitchComponent> | ComponentPortal<XRateComponent> | ComponentPortal<XDatePickerComponent> | ComponentPortal<XTimePickerComponent> | ComponentPortal<XInputNumberComponent> | ComponentPortal<XSliderSelectComponent> | ComponentPortal<XCascadeComponent> | ComponentPortal<XColorPickerComponent> | ComponentPortal<XTextareaComponent> | ComponentPortal<XFindComponent> | ComponentPortal<XAutoCompleteComponent>;
|
|
549
560
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<XControlComponent, never>;
|