@libs-ui/components-inputs-input 0.2.357-1 → 0.2.357-10
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/README.md
CHANGED
|
@@ -283,6 +283,23 @@ async handlerSelectAll(): Promise<void> {
|
|
|
283
283
|
|
|
284
284
|
---
|
|
285
285
|
|
|
286
|
+
### IFrame Textarea Cơ Bản
|
|
287
|
+
|
|
288
|
+
```html
|
|
289
|
+
<libs_ui-components-inputs-input
|
|
290
|
+
[tagInput]="'iframe-textarea'"
|
|
291
|
+
[(value)]="iframeBasicValue"
|
|
292
|
+
[defaultHeight]="80"
|
|
293
|
+
[maxHeightTextArea]="300"
|
|
294
|
+
[placeholder]="'Nhập nội dung...'" />
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
protected iframeBasicValue = signal('');
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
286
303
|
### IFrame Textarea với Custom Style
|
|
287
304
|
|
|
288
305
|
```html
|
|
@@ -322,6 +339,46 @@ handlerIframeFunctionsControl(control: IInputFunctionControlEvent): void {
|
|
|
322
339
|
|
|
323
340
|
---
|
|
324
341
|
|
|
342
|
+
### IFrame Textarea với FunctionsControl (Focus/Insert/Reset)
|
|
343
|
+
|
|
344
|
+
```html
|
|
345
|
+
<libs_ui-components-inputs-input
|
|
346
|
+
[tagInput]="'iframe-textarea'"
|
|
347
|
+
[(value)]="iframeControlValue"
|
|
348
|
+
[defaultHeight]="80"
|
|
349
|
+
(outFunctionsControl)="handlerIframeControl($event)" />
|
|
350
|
+
|
|
351
|
+
<button (click)="handlerFocusIframe()">Focus</button>
|
|
352
|
+
<button (click)="handlerInsertIframeText()">Insert "Hello World"</button>
|
|
353
|
+
<button (click)="handlerResetIframe()">Reset</button>
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
import { signal } from '@angular/core';
|
|
358
|
+
import { IInputFunctionControlEvent } from '@libs-ui/components-inputs-input';
|
|
359
|
+
|
|
360
|
+
protected iframeControlValue = signal('');
|
|
361
|
+
private iframeFunctionControl = signal<IInputFunctionControlEvent | null>(null);
|
|
362
|
+
|
|
363
|
+
handlerIframeControl(control: IInputFunctionControlEvent): void {
|
|
364
|
+
this.iframeFunctionControl.set(control);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
async handlerFocusIframe(): Promise<void> {
|
|
368
|
+
await this.iframeFunctionControl()?.focus();
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
async handlerInsertIframeText(): Promise<void> {
|
|
372
|
+
await this.iframeFunctionControl()?.insertContent('Hello World');
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async handlerResetIframe(): Promise<void> {
|
|
376
|
+
await this.iframeFunctionControl()?.resetValue();
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
325
382
|
### Number Input với Nút Up/Down
|
|
326
383
|
|
|
327
384
|
```html
|
|
@@ -569,11 +626,3 @@ interface IIframeTextareaCustomStyle {
|
|
|
569
626
|
⚠️ **textAreaEnterNotNewLine với Shift+Enter**: Khi `[textAreaEnterNotNewLine]="true"`, nhấn `Enter` không xuống dòng và emit `outEnterEvent`. Dùng `Shift+Enter` để xuống dòng bình thường.
|
|
570
627
|
|
|
571
628
|
⚠️ **emitEmptyInDataTypeNumber**: Mặc định khi xóa hết giá trị number, component emit `0`. Bật `[emitEmptyInDataTypeNumber]="true"` để emit `undefined` thay vì `0`.
|
|
572
|
-
|
|
573
|
-
## Demo
|
|
574
|
-
|
|
575
|
-
```bash
|
|
576
|
-
npx nx serve core-ui
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
Truy cập: `http://localhost:4500/inputs/input`
|