@aseansc/ui 5.7.1 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/fesm2022/aseansc-ui.mjs +190 -63
- package/fesm2022/aseansc-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/aseansc-ui.d.ts +62 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aseansc/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "ASC Internal UI Component Library — Angular 22 + PrimeNG 21 + TailwindCSS 4 (PrimeNG capped at 21.x — 22.x requires a paid PrimeUI license key, xem README.md)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ASC Team",
|
package/types/aseansc-ui.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { EnvironmentProviders, InjectionToken, OnInit, OnDestroy, PipeTransform,
|
|
|
3
3
|
import { MenuItem, FilterMetadata, SortEvent, SortMeta } from 'primeng/api';
|
|
4
4
|
import * as _primeuix_themes_types from '@primeuix/themes/types';
|
|
5
5
|
import { ControlValueAccessor, NgControl, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
6
|
-
import { ButtonSeverity } from 'primeng/button';
|
|
7
6
|
import * as _aseansc_ui from '@aseansc/ui';
|
|
7
|
+
import { ButtonSeverity } from 'primeng/button';
|
|
8
8
|
import { MultiSelectFocusEvent, MultiSelectBlurEvent } from 'primeng/multiselect';
|
|
9
9
|
import { InputNumberInputEvent } from 'primeng/inputnumber';
|
|
10
10
|
import { FileSelectEvent } from 'primeng/fileupload';
|
|
@@ -518,6 +518,15 @@ declare class AscMessageErrorPipe implements PipeTransform {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
type AscAutoCompleteItem = Record<string, any> | string;
|
|
521
|
+
/** Payload của (lazyLoad) — vùng đang hiển thị trong danh sách cuộn ảo */
|
|
522
|
+
interface AscAutoCompleteLazyLoadEvent {
|
|
523
|
+
/** Từ khoá đang tìm (lần completeMethod gần nhất) */
|
|
524
|
+
query: string;
|
|
525
|
+
/** Index đầu của vùng đang render */
|
|
526
|
+
first: number;
|
|
527
|
+
/** Index cuối (không gồm) của vùng đang render */
|
|
528
|
+
last: number;
|
|
529
|
+
}
|
|
521
530
|
/**
|
|
522
531
|
* AscAutoCompleteComponent — input với gợi ý thời gian thực.
|
|
523
532
|
*
|
|
@@ -539,6 +548,18 @@ type AscAutoCompleteItem = Record<string, any> | string;
|
|
|
539
548
|
* e.fullName.toLowerCase().includes(query.toLowerCase())
|
|
540
549
|
* );
|
|
541
550
|
* }
|
|
551
|
+
*
|
|
552
|
+
* Dữ liệu lớn (vd. 100k bản ghi): tìm phía server (completeMethod → API ?q=&limit=),
|
|
553
|
+
* huỷ request cũ bằng switchMap. Cần cuộn xem hết kết quả → bật [virtualScroll] +
|
|
554
|
+
* [lazy], nghe (lazyLoad) và nối thêm trang kế tiếp khi `last` gần cuối danh sách:
|
|
555
|
+
*
|
|
556
|
+
* <asc-auto-complete
|
|
557
|
+
* [suggestions]="items()" [virtualScroll]="true" [lazy]="true" [loading]="loading()"
|
|
558
|
+
* (completeMethod)="search($event)" (lazyLoad)="loadMore($event)" />
|
|
559
|
+
*
|
|
560
|
+
* loadMore(e: AscAutoCompleteLazyLoadEvent) {
|
|
561
|
+
* if (e.last >= this.items().length - 5 && this.hasMore && !this.loading()) this.fetchPage(e.query);
|
|
562
|
+
* }
|
|
542
563
|
*/
|
|
543
564
|
declare class AscAutoCompleteComponent extends BaseControlAccessor<AscAutoCompleteItem | AscAutoCompleteItem[] | null> {
|
|
544
565
|
readonly id: _angular_core.InputSignal<string>;
|
|
@@ -562,11 +583,49 @@ declare class AscAutoCompleteComponent extends BaseControlAccessor<AscAutoComple
|
|
|
562
583
|
showClear: _angular_core.InputSignal<boolean>;
|
|
563
584
|
/** Placeholder */
|
|
564
585
|
placeholder: _angular_core.InputSignal<string>;
|
|
586
|
+
/** Kích thước — cùng thang với asc-input / asc-select. @default 'md' */
|
|
587
|
+
size: _angular_core.InputSignal<AscSize | undefined>;
|
|
588
|
+
/** Ép trạng thái lỗi (ngoài trạng thái lỗi tự lấy từ FormControl) */
|
|
589
|
+
invalid: _angular_core.InputSignal<boolean>;
|
|
590
|
+
/** Disable khi không dùng FormControl */
|
|
591
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
592
|
+
/** Text khi không có gợi ý — fallback i18n "Không có kết quả" */
|
|
593
|
+
emptyMessage: _angular_core.InputSignal<string | undefined>;
|
|
594
|
+
/** Chiều cao tối đa của danh sách gợi ý. @default '200px' */
|
|
595
|
+
scrollHeight: _angular_core.InputSignal<string>;
|
|
596
|
+
/** Cuộn ảo — chỉ render các dòng đang thấy, bắt buộc khi danh sách hàng nghìn dòng */
|
|
597
|
+
virtualScroll: _angular_core.InputSignal<boolean>;
|
|
598
|
+
/** Chiều cao 1 dòng (px) cho cuộn ảo — phải khớp chiều cao thật của option. @default 36 */
|
|
599
|
+
virtualScrollItemSize: _angular_core.InputSignal<number>;
|
|
600
|
+
/** Bật (lazyLoad) khi cuộn — dùng cùng virtualScroll để tải thêm trang */
|
|
601
|
+
lazy: _angular_core.InputSignal<boolean>;
|
|
602
|
+
/** Đang tải trang kế tiếp → hiện dòng "Đang tải..." cuối danh sách */
|
|
603
|
+
loading: _angular_core.InputSignal<boolean>;
|
|
565
604
|
/** Emit text user đang gõ — consumer lọc và cập nhật [suggestions] */
|
|
566
605
|
completeMethod: _angular_core.OutputEmitterRef<string>;
|
|
606
|
+
/** Cuộn danh sách (lazy) — consumer tải thêm khi `last` gần cuối [suggestions] */
|
|
607
|
+
lazyLoad: _angular_core.OutputEmitterRef<AscAutoCompleteLazyLoadEvent>;
|
|
608
|
+
private readonly localeService;
|
|
609
|
+
protected get msg(): _aseansc_ui.AscUIMessages;
|
|
610
|
+
/** Từ khoá của lần tìm gần nhất — gắn vào payload (lazyLoad) */
|
|
611
|
+
private lastQuery;
|
|
612
|
+
protected readonly resolvedEmptyMessage: _angular_core.Signal<string>;
|
|
613
|
+
protected handleComplete(query: string): void;
|
|
614
|
+
protected handleLazyLoad(event: {
|
|
615
|
+
first?: unknown;
|
|
616
|
+
last?: unknown;
|
|
617
|
+
}): void;
|
|
618
|
+
protected readonly resolvedSize: _angular_core.Signal<AscSize>;
|
|
619
|
+
get controlSize(): AscSize;
|
|
620
|
+
protected readonly isInvalidState: _angular_core.Signal<boolean>;
|
|
621
|
+
protected readonly effectiveDisabled: _angular_core.Signal<boolean>;
|
|
622
|
+
get controlDisabled(): boolean;
|
|
623
|
+
protected readonly innerCls: _angular_core.Signal<string>;
|
|
624
|
+
/** mode="view": label của giá trị (multiple → nối bằng dấu phẩy) */
|
|
625
|
+
protected readonly viewText: _angular_core.Signal<string>;
|
|
567
626
|
protected _hostCls: _angular_core.Signal<string>;
|
|
568
627
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AscAutoCompleteComponent, never>;
|
|
569
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AscAutoCompleteComponent, "asc-auto-complete", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "forceSelection": { "alias": "forceSelection"; "required": false; "isSignal": true; }; "dropdown": { "alias": "dropdown"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, { "completeMethod": "completeMethod"; }, never, never, true, never>;
|
|
628
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AscAutoCompleteComponent, "asc-auto-complete", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "forceSelection": { "alias": "forceSelection"; "required": false; "isSignal": true; }; "dropdown": { "alias": "dropdown"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, { "completeMethod": "completeMethod"; "lazyLoad": "lazyLoad"; }, never, never, true, never>;
|
|
570
629
|
}
|
|
571
630
|
|
|
572
631
|
/**
|
|
@@ -3260,4 +3319,4 @@ declare class AscTrimSpaceDirective {
|
|
|
3260
3319
|
}
|
|
3261
3320
|
|
|
3262
3321
|
export { ASC_BASE_CONTROL, ASC_BUILTIN_ICONS, ASC_MESSAGES_EN_US, ASC_MESSAGES_VI_VN, ASC_PRESET, ASC_UI_CONFIG, ASC_UI_DEFAULT_CONFIG, ASC_UI_MESSAGES, AscAccordionComponent, AscAccordionItemComponent, AscAlertComponent, AscAutoCompleteComponent, AscAvatarComponent, AscAvatarGroupComponent, AscBadgeComponent, AscBoxDirective, AscBreadcrumb, AscButtonComponent, AscCardComponent, AscCardFooterDirective, AscCardHeaderDirective, AscCheckboxComponent, AscConfirmDialog, AscConfirmPopup, AscConfirmService, AscDatepickerComponent, AscDialogComponent, AscDialogFooterDirective, AscDialogHeaderDirective, AscDividerComponent, AscEmptyStateComponent, AscFormFieldComponent, AscIconComponent, AscIconService, AscInputComponent, AscInputMaskComponent, AscInputNumberComponent, AscLayout, AscLoadingBarComponent, AscLoadingOverlayComponent, AscLocaleService, AscMessageErrorPipe, AscPaginatorComponent, AscPasswordComponent, AscPicklistComponent, AscPopoverComponent, AscProgressBarComponent, AscRadioComponent, AscSelectButtonComponent, AscSelectComponent, AscSidebarComponent, AscSidebarFooterDirective, AscSidebarHeaderDirective, AscSkeletonComponent, AscSpinnerComponent, AscStepComponent, AscStepContentDirective, AscStepperComponent, AscSvgIconComponent, AscTabComponent, AscTableCaptionDirective, AscTableCellDirective, AscTableComponent, AscTableEmptyDirective, AscTableExpandDirective, AscTabsComponent, AscTextDirective, AscTextareaComponent, AscThemeService, AscTimelineComponent, AscToast, AscToastService, AscToggleSwitchComponent, AscTooltipDirective, AscTrimSpaceDirective, AscTypographyDirective, AscUpload, BaseControlAccessor, ascCls, ascUniqueId, coerceArray, coerceBooleanProperty, coerceNumberProperty, coerceStringProperty, isAscSeverity, isAscSize, provideAscUI, resolveAscBuiltinIcon };
|
|
3263
|
-
export type { AscAlertSeverity, AscAutoCompleteItem, AscAvatarShape, AscAvatarSize, AscBadgeConfig, AscBadgeSeverity, AscBgColor, AscBorderColor, AscBorderStyle, AscBorderWidth, AscBoxHeight, AscBoxRadius, AscBoxWidth, AscBuiltinIconName, AscButtonVariant, AscCardRadius, AscCardShadow, AscCheckboxOption, AscColumnFormat, AscColumnVisibility, AscConfirmOptions, AscConfirmPopupOptions, AscDateSelectionMode, AscDateValue, AscDateView, AscDividerAlign, AscDividerLayout, AscDividerType, AscFontWeight, AscFormLayout, AscHourFormat, AscIconPosition, AscInputVariant, AscLeading, AscLocale, AscMenuItem, AscNumberType, AscProgressBarMode, AscSelectOption, AscSelectionMode, AscSeverity, AscSize, AscSkeletonPreset, AscSkeletonShape, AscSpinnerSize, AscTableAction, AscTableCellContext, AscTableColumn, AscTableColumnType, AscTableExpandContext, AscTableFilterMeta, AscTableLazyLoadEvent, AscTablePageEvent, AscTableSortEvent, AscTableSortMeta, AscTabsOrientation, AscTextAlign, AscTextColor, AscTextSize, AscTimelineAlign, AscTimelineItem, AscTimelineLayout, AscTimelineStatus, AscToastOptions, AscToastSeverity, AscTooltipPosition, AscTypographyToken, AscTypographyType, AscUIButtonConfig, AscUIConfig, AscUIInputConfig, AscUILayoutConfig, AscUIMessages, AscUITableConfig, AscUIThemeConfig, AscUIToastConfig, AscUIValidationConfig, AscValidationMessageFn, AscValidationMessages };
|
|
3322
|
+
export type { AscAlertSeverity, AscAutoCompleteItem, AscAutoCompleteLazyLoadEvent, AscAvatarShape, AscAvatarSize, AscBadgeConfig, AscBadgeSeverity, AscBgColor, AscBorderColor, AscBorderStyle, AscBorderWidth, AscBoxHeight, AscBoxRadius, AscBoxWidth, AscBuiltinIconName, AscButtonVariant, AscCardRadius, AscCardShadow, AscCheckboxOption, AscColumnFormat, AscColumnVisibility, AscConfirmOptions, AscConfirmPopupOptions, AscDateSelectionMode, AscDateValue, AscDateView, AscDividerAlign, AscDividerLayout, AscDividerType, AscFontWeight, AscFormLayout, AscHourFormat, AscIconPosition, AscInputVariant, AscLeading, AscLocale, AscMenuItem, AscNumberType, AscProgressBarMode, AscSelectOption, AscSelectionMode, AscSeverity, AscSize, AscSkeletonPreset, AscSkeletonShape, AscSpinnerSize, AscTableAction, AscTableCellContext, AscTableColumn, AscTableColumnType, AscTableExpandContext, AscTableFilterMeta, AscTableLazyLoadEvent, AscTablePageEvent, AscTableSortEvent, AscTableSortMeta, AscTabsOrientation, AscTextAlign, AscTextColor, AscTextSize, AscTimelineAlign, AscTimelineItem, AscTimelineLayout, AscTimelineStatus, AscToastOptions, AscToastSeverity, AscTooltipPosition, AscTypographyToken, AscTypographyType, AscUIButtonConfig, AscUIConfig, AscUIInputConfig, AscUILayoutConfig, AscUIMessages, AscUITableConfig, AscUIThemeConfig, AscUIToastConfig, AscUIValidationConfig, AscValidationMessageFn, AscValidationMessages };
|