@sdcorejs/angular 20.0.0 → 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/README.md +36 -19
- package/assets/scss/core/_inline-edit.scss +105 -0
- package/assets/scss/core/form.scss +15 -0
- package/components/autoid-inspector/index.d.ts +53 -4
- package/components/form-generic/index.d.ts +12 -13
- package/components/index.d.ts +1 -0
- package/components/modal-resizable/index.d.ts +32 -0
- package/components/table/index.d.ts +99 -10
- package/components/view/index.d.ts +33 -0
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +9 -9
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +111 -24
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-base.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-button.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-chart.mjs +12 -12
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-editor.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +288 -375
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +7 -7
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +10 -10
- package/fesm2022/sdcorejs-angular-components-inform.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +158 -0
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-modal.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-operator.mjs +6 -4
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +8 -8
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +60 -106
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-section.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +12 -12
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +18 -18
- package/fesm2022/sdcorejs-angular-components-tab.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-table.mjs +335 -208
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +16 -16
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-view.mjs +45 -13
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +21 -21
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +28 -8
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +11 -6
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +15 -10
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +15 -10
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +21 -12
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +29 -17
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +34 -22
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +12 -12
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs +167 -0
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +7 -5
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +37 -10
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +38 -12
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +3 -3
- package/fesm2022/sdcorejs-angular-forms-models.mjs +32 -2
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +11 -6
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +36 -12
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +11 -6
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +17 -7
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms.mjs +4 -4
- package/fesm2022/sdcorejs-angular-handlers.mjs +3 -3
- package/fesm2022/sdcorejs-angular-i18n.mjs +26 -6
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +6 -6
- package/fesm2022/sdcorejs-angular-modules-auth.mjs +9 -9
- package/fesm2022/sdcorejs-angular-modules-authom.mjs +7 -7
- package/fesm2022/sdcorejs-angular-modules-keycloak.mjs +7 -7
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +73 -73
- package/fesm2022/sdcorejs-angular-modules-permission.mjs +9 -9
- package/fesm2022/sdcorejs-angular-pipes.mjs +14 -14
- package/fesm2022/sdcorejs-angular-services-api.mjs +10 -10
- package/fesm2022/sdcorejs-angular-services-cache.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +6 -6
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-docx.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-excel.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-license.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-loading.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-notify.mjs +23 -10
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +3 -3
- package/forms/autocomplete/index.d.ts +16 -3
- package/forms/checkbox/index.d.ts +5 -1
- package/forms/chip/index.d.ts +5 -2
- package/forms/chip-calendar/index.d.ts +5 -2
- package/forms/date/index.d.ts +14 -5
- package/forms/date-range/index.d.ts +12 -5
- package/forms/datetime/index.d.ts +14 -5
- package/forms/inline-text/index.d.ts +80 -0
- package/forms/input/index.d.ts +14 -2
- package/forms/input-color/index.d.ts +3 -1
- package/forms/input-number/index.d.ts +14 -2
- package/forms/models/index.d.ts +40 -2
- package/forms/radio/index.d.ts +5 -2
- package/forms/select/index.d.ts +23 -5
- package/forms/switch/index.d.ts +5 -2
- package/forms/textarea/index.d.ts +9 -2
- package/i18n/index.d.ts +4 -0
- package/package.json +10 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-services-notify.mjs","sources":["../../../projects/sdcorejs-angular/services/notify/src/components/toast/toast.component.ts","../../../projects/sdcorejs-angular/services/notify/src/components/toast/toast.component.html","../../../projects/sdcorejs-angular/services/notify/src/components/toast-container.component.ts","../../../projects/sdcorejs-angular/services/notify/src/notify.service.ts","../../../projects/sdcorejs-angular/services/notify/sdcorejs-angular-services-notify.ts"],"sourcesContent":["import { Component, Input, signal, HostListener, OnInit, OnDestroy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { ToastData } from '../../notify.model';\nimport { SdNotifyService } from '../../notify.service';\n\n@Component({\n selector: 'toast',\n standalone: true,\n imports: [CommonModule, TranslatePipe],\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('toastAnimation', [\n transition(':enter', [\n style({ transform: 'translateX(100%)', opacity: 0 }),\n animate('300ms ease-out', style({ transform: 'translateX(0)', opacity: 1 }))\n ]),\n transition(':leave', [\n animate('200ms ease-in', style({ transform: 'translateX(100%)', opacity: 0 }))\n ])\n ])\n ],\n host: {\n '[@toastAnimation]': 'true',\n '[class]': '\"bg-white sd-toast\"'\n }\n})\nexport class ToastComponent implements OnInit, OnDestroy {\n @Input({ required: true }) data!: ToastData;\n \n isExpanded = signal(false);\n readonly MAX_SHOW = 2;\n\n // --- Logic Timer ---\n private timer: any;\n private start!: number;\n private remaining!: number;\n\n constructor(private notifyService: SdNotifyService) {}\n\n ngOnInit() {\n // Khởi tạo thời gian còn lại bằng duration ban đầu\n this.remaining = this.data.duration;\n // Bắt đầu đếm ngược ngay khi hiện ra\n this.resumeTimer();\n }\n\n ngOnDestroy() {\n clearTimeout(this.timer);\n }\n\n // --- Logic Pause/Resume ---\n\n @HostListener('mouseenter')\n pauseTimer() {\n if (this.timer) {\n // Xóa timer hiện tại\n clearTimeout(this.timer);\n this.timer = null;\n // Tính toán thời gian đã trôi qua để trừ đi\n this.remaining -= Date.now() - this.start;\n }\n }\n\n @HostListener('mouseleave')\n resumeTimer() {\n // Chỉ chạy tiếp nếu còn thời gian và timer chưa chạy\n if (this.remaining > 0 && !this.timer) {\n this.start = Date.now();\n this.timer = setTimeout(() => {\n this.close();\n }, this.remaining);\n }\n }\n\n // --- Logic cũ ---\n\n close() {\n this.notifyService.remove(this.data.id);\n }\n\n onActionClick() {\n this.data.onAction?.();\n }\n\n toggleExpand() {\n this.isExpanded.update(v => !v);\n }\n\n get isMultiMessage(): boolean {\n return Array.isArray(this.data.message);\n }\n\n get messages(): string[] {\n return this.data.message as string[];\n }\n\n get displayMessages(): string[] {\n const msgs = this.messages;\n if (this.isExpanded()) return msgs;\n return msgs.slice(0, this.MAX_SHOW);\n }\n\n get restCount(): number {\n return this.messages.length - this.MAX_SHOW;\n }\n\n get hasMore(): boolean {\n return this.isMultiMessage && this.messages.length > this.MAX_SHOW;\n }\n}","<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\n\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\n @switch (data.type) {\n @case ('success') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\n }\n @case ('info') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\n }\n @case ('warning') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\n }\n @case ('error') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\n }\n }\n</div>\n\n<div class=\"sd-toast__content\">\n <div class=\"sd-toast__header\">\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\n <button class=\"sd-toast__close\" (click)=\"close()\">✕</button>\n </div>\n\n <div class=\"sd-toast__body\">\n @if (!isMultiMessage) {\n <div [innerHTML]=\"data.message\"></div>\n } \n @else {\n <ul class=\"msg-list\">\n @for (msg of displayMessages; track msg) {\n <li [innerHTML]=\"'- ' + msg\"></li>\n }\n </ul>\n\n @if (hasMore) {\n <button type=\"button\" \n class=\"toggle-more btn-link\" \n [class]=\"'text-' + data.type\" \n (click)=\"toggleExpand()\">\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\n </button>\n }\n }\n </div>\n\n @if (data.actionLabel) {\n <div class=\"sd-toast__actions\">\n <button class=\"btn-action\" \n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\n (click)=\"onActionClick()\">\n {{ data.actionLabel }}\n </button>\n </div>\n }\n</div>","import { Component, signal, WritableSignal } from '@angular/core';\nimport { ToastData } from '../notify.model';\nimport { ToastComponent } from './toast/toast.component';\n\n@Component({\n selector: 'toast-container',\n standalone: true,\n imports: [ToastComponent],\n template: `\n <div class=\"toast-container\">\n @for (toast of toasts(); track toast.id) {\n <toast [data]=\"toast\"> </toast>\n }\n </div>\n `,\n styles: [\n `\n .toast-container {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n pointer-events: none; /* Cho phép click xuyên qua vùng trống */\n }\n sd-toast {\n pointer-events: auto; /* Bật lại click cho toast */\n }\n `,\n ],\n})\nexport class ToastContainerComponent {\n toasts: WritableSignal<ToastData[]> = signal([]);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n Inject,\n Injectable,\n signal\n} from '@angular/core';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { ToastContainerComponent } from './components/toast-container.component';\nimport { NotifyOption, ToastData, ToastType } from './notify.model';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdNotifyService {\n readonly toasts = signal<ToastData[]>([]);\n\n // Constants\n readonly #DEBOUNCE_TIME = 500;\n readonly #DEFAULT_SUCCESS_DURATION = 3000;\n readonly #DEFAULT_BUFFERED_DURATION = 5000;\n readonly #MAX_TOASTS = 5;\n\n // State\n #buffer: Record<string, string[]> = {};\n #timers: Record<string, ReturnType<typeof setTimeout> | null> = {};\n\n constructor(\n private appRef: ApplicationRef,\n private injector: EnvironmentInjector,\n @Inject(DOCUMENT) private document: Document\n ) {\n this.#initContainer();\n }\n\n #initContainer() {\n const componentRef = createComponent(ToastContainerComponent, {\n environmentInjector: this.injector,\n });\n componentRef.instance.toasts = this.toasts;\n this.appRef.attachView(componentRef.hostView);\n const domElem = (componentRef.hostView as any).rootNodes[0] as HTMLElement;\n this.document.body.appendChild(domElem);\n }\n\n // Public API\n success(message: string, option?: NotifyOption) {\n this.#addImmediate('success', message, option);\n }\n\n info(message: string, option?: NotifyOption) {\n this.#addImmediate('info', message, option);\n }\n\n warning(message: string | string[], option?: NotifyOption) {\n this.#addToBuffer('warning', message, option);\n }\n\n error(message: string | string[], option?: NotifyOption) {\n this.#addToBuffer('error', message, option);\n }\n\n remove(id: string) {\n this.toasts.update((current) => current.filter((t) => t.id !== id));\n }\n\n clearAll() {\n this.toasts.set([]);\n this.#clearAllTimers();\n }\n\n clearByType(type: ToastType) {\n this.toasts.update((current) => current.filter((t) => t.type !== type));\n }\n\n // Private helpers\n #addImmediate(type: ToastType, message: string, option?: NotifyOption) {\n const newToast: ToastData = {\n id: Utilities.generateUuid(),\n type,\n message,\n title: option?.title,\n duration: option?.duration ?? this.#DEFAULT_SUCCESS_DURATION,\n actionLabel: option?.actionLabel,\n onAction: option?.onAction\n };\n\n this.toasts.update((current) => {\n const updated = [newToast, ...current];\n return updated.slice(0, this.#MAX_TOASTS);\n });\n }\n\n #addToBuffer(type: ToastType, message: string | string[], option?: NotifyOption) {\n if (!this.#buffer[type]) {\n this.#buffer[type] = [];\n }\n \n const msgs = Array.isArray(message) ? message : [message];\n this.#buffer[type].push(...msgs);\n\n // Clear existing timer and set new one\n if (this.#timers[type]) {\n clearTimeout(this.#timers[type]!);\n }\n\n this.#timers[type] = setTimeout(() => {\n this.#flushBuffer(type, option);\n }, this.#DEBOUNCE_TIME);\n }\n\n #flushBuffer(type: ToastType, option?: NotifyOption) {\n const messages = [...new Set(this.#buffer[type])];\n \n // Cleanup\n this.#buffer[type] = [];\n this.#timers[type] = null;\n\n if (messages.length === 0) return;\n\n const typeLabel = type === 'error' ? 'Error' : 'Warning';\n const title = option?.title ?? typeLabel;\n const finalTitle = messages.length > 1 ? `${title} (${messages.length})` : title;\n\n const newToast: ToastData = {\n id: Utilities.generateUuid(),\n type,\n message: messages.length === 1 ? messages[0] : messages, \n title: finalTitle,\n duration: option?.duration ?? this.#DEFAULT_BUFFERED_DURATION,\n actionLabel: option?.actionLabel,\n onAction: option?.onAction\n };\n\n this.toasts.update((current) => {\n const updated = [newToast, ...current];\n return updated.slice(0, this.#MAX_TOASTS);\n });\n }\n\n #clearAllTimers() {\n Object.values(this.#timers).forEach(timer => {\n if (timer) clearTimeout(timer);\n });\n this.#timers = {};\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.SdNotifyService"],"mappings":";;;;;;;MA6Ba,cAAc,CAAA;AAWL,IAAA,aAAA;AAVO,IAAA,I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WAAW;YAChC,QAAQ,EAAE,MAAM,EAAE;SACnB;QAED,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,KAAI;YAC7B,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC;YACtC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC;AAC3C,QAAA,CAAC,CAAC;IACJ;IAEA,eAAe,GAAA;AACb,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,IAAG;AAC1C,YAAA,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC;AAChC,QAAA,CAAC,CAAC;AACF,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE;IACnB;AAnIW,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,mFAgBhB,QAAQ,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAhBP,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA;;4FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAiBI,MAAM;2BAAC,QAAQ;;;AChCpB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-services-notify.mjs","sources":["../../../projects/sdcorejs-angular/services/notify/src/components/toast/toast.component.ts","../../../projects/sdcorejs-angular/services/notify/src/components/toast/toast.component.html","../../../projects/sdcorejs-angular/services/notify/src/components/toast-container.component.ts","../../../projects/sdcorejs-angular/services/notify/src/notify.service.ts","../../../projects/sdcorejs-angular/services/notify/sdcorejs-angular-services-notify.ts"],"sourcesContent":["import { Component, Input, signal, HostListener, OnInit, OnDestroy } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { ToastData } from '../../notify.model';\nimport { SdNotifyService } from '../../notify.service';\n\n@Component({\n selector: 'toast',\n standalone: true,\n imports: [CommonModule, TranslatePipe],\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n animations: [\n trigger('toastAnimation', [\n transition(':enter', [\n style({ transform: 'translateX(100%)', opacity: 0 }),\n animate('300ms ease-out', style({ transform: 'translateX(0)', opacity: 1 }))\n ]),\n transition(':leave', [\n animate('200ms ease-in', style({ transform: 'translateX(100%)', opacity: 0 }))\n ])\n ])\n ],\n host: {\n '[@toastAnimation]': 'true',\n '[class]': '\"bg-white sd-toast\"',\n // E2E hooks đọc bởi sd-autoid-inspector: autoid theo loại + state type/title/message.\n '[attr.data-autoid]': 'autoId',\n '[attr.data-type]': 'data.type',\n '[attr.data-title]': 'data.title ?? null',\n '[attr.data-message]': 'dataMessage'\n }\n})\nexport class ToastComponent implements OnInit, OnDestroy {\n @Input({ required: true }) data!: ToastData;\n \n isExpanded = signal(false);\n readonly MAX_SHOW = 2;\n\n // --- Logic Timer ---\n private timer: any;\n private start!: number;\n private remaining!: number;\n\n constructor(private notifyService: SdNotifyService) {}\n\n ngOnInit() {\n // Khởi tạo thời gian còn lại bằng duration ban đầu\n this.remaining = this.data.duration;\n // Bắt đầu đếm ngược ngay khi hiện ra\n this.resumeTimer();\n }\n\n ngOnDestroy() {\n clearTimeout(this.timer);\n }\n\n // --- Logic Pause/Resume ---\n\n @HostListener('mouseenter')\n pauseTimer() {\n if (this.timer) {\n // Xóa timer hiện tại\n clearTimeout(this.timer);\n this.timer = null;\n // Tính toán thời gian đã trôi qua để trừ đi\n this.remaining -= Date.now() - this.start;\n }\n }\n\n @HostListener('mouseleave')\n resumeTimer() {\n // Chỉ chạy tiếp nếu còn thời gian và timer chưa chạy\n if (this.remaining > 0 && !this.timer) {\n this.start = Date.now();\n this.timer = setTimeout(() => {\n this.close();\n }, this.remaining);\n }\n }\n\n // --- Logic cũ ---\n\n close() {\n this.notifyService.remove(this.data.id);\n }\n\n onActionClick() {\n this.data.onAction?.();\n }\n\n toggleExpand() {\n this.isExpanded.update(v => !v);\n }\n\n get isMultiMessage(): boolean {\n return Array.isArray(this.data.message);\n }\n\n get messages(): string[] {\n return this.data.message as string[];\n }\n\n get displayMessages(): string[] {\n const msgs = this.messages;\n if (this.isExpanded()) return msgs;\n return msgs.slice(0, this.MAX_SHOW);\n }\n\n get restCount(): number {\n return this.messages.length - this.MAX_SHOW;\n }\n\n get hasMore(): boolean {\n return this.isMultiMessage && this.messages.length > this.MAX_SHOW;\n }\n\n /** autoid theo loại toast để E2E chọn trực tiếp, vd `services-notify-toast-success`. */\n get autoId(): string {\n return `services-notify-toast-${this.data.type}`;\n }\n\n /** Gộp message (mảng nối ' | ') để phơi ra data-message cho E2E. */\n get dataMessage(): string {\n return Array.isArray(this.data.message) ? this.data.message.join(' | ') : this.data.message;\n }\n}","<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\n\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\n @switch (data.type) {\n @case ('success') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\n }\n @case ('info') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\n }\n @case ('warning') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\n }\n @case ('error') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\n }\n }\n</div>\n\n<div class=\"sd-toast__content\">\n <div class=\"sd-toast__header\">\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\n <button class=\"sd-toast__close\" (click)=\"close()\">✕</button>\n </div>\n\n <div class=\"sd-toast__body\">\n @if (!isMultiMessage) {\n <div [innerHTML]=\"data.message\"></div>\n } \n @else {\n <ul class=\"msg-list\">\n @for (msg of displayMessages; track msg) {\n <li [innerHTML]=\"'- ' + msg\"></li>\n }\n </ul>\n\n @if (hasMore) {\n <button type=\"button\" \n class=\"toggle-more btn-link\" \n [class]=\"'text-' + data.type\" \n (click)=\"toggleExpand()\">\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\n </button>\n }\n }\n </div>\n\n @if (data.actionLabel) {\n <div class=\"sd-toast__actions\">\n <button class=\"btn-action\" \n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\n (click)=\"onActionClick()\">\n {{ data.actionLabel }}\n </button>\n </div>\n }\n</div>","import { Component, signal, WritableSignal } from '@angular/core';\nimport { ToastData } from '../notify.model';\nimport { ToastComponent } from './toast/toast.component';\n\n@Component({\n selector: 'toast-container',\n standalone: true,\n imports: [ToastComponent],\n template: `\n <div class=\"toast-container\">\n @for (toast of toasts(); track toast.id) {\n <toast [data]=\"toast\"> </toast>\n }\n </div>\n `,\n styles: [\n `\n .toast-container {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n pointer-events: none; /* Cho phép click xuyên qua vùng trống */\n }\n sd-toast {\n pointer-events: auto; /* Bật lại click cho toast */\n }\n `,\n ],\n})\nexport class ToastContainerComponent {\n toasts: WritableSignal<ToastData[]> = signal([]);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n Inject,\n Injectable,\n signal\n} from '@angular/core';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { ToastContainerComponent } from './components/toast-container.component';\nimport { NotifyOption, ToastData, ToastType } from './notify.model';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdNotifyService {\n readonly toasts = signal<ToastData[]>([]);\n\n // Constants\n readonly #DEBOUNCE_TIME = 500;\n readonly #DEFAULT_SUCCESS_DURATION = 3000;\n readonly #DEFAULT_BUFFERED_DURATION = 5000;\n readonly #MAX_TOASTS = 5;\n\n // State\n #buffer: Record<string, string[]> = {};\n #timers: Record<string, ReturnType<typeof setTimeout> | null> = {};\n\n constructor(\n private appRef: ApplicationRef,\n private injector: EnvironmentInjector,\n @Inject(DOCUMENT) private document: Document\n ) {\n this.#initContainer();\n }\n\n #initContainer() {\n const componentRef = createComponent(ToastContainerComponent, {\n environmentInjector: this.injector,\n });\n componentRef.instance.toasts = this.toasts;\n this.appRef.attachView(componentRef.hostView);\n const domElem = (componentRef.hostView as any).rootNodes[0] as HTMLElement;\n this.document.body.appendChild(domElem);\n }\n\n // Public API\n success(message: string, option?: NotifyOption) {\n this.#addImmediate('success', message, option);\n }\n\n info(message: string, option?: NotifyOption) {\n this.#addImmediate('info', message, option);\n }\n\n warning(message: string | string[], option?: NotifyOption) {\n this.#addToBuffer('warning', message, option);\n }\n\n error(message: string | string[], option?: NotifyOption) {\n this.#addToBuffer('error', message, option);\n }\n\n remove(id: string) {\n this.toasts.update((current) => current.filter((t) => t.id !== id));\n }\n\n clearAll() {\n this.toasts.set([]);\n this.#clearAllTimers();\n }\n\n clearByType(type: ToastType) {\n this.toasts.update((current) => current.filter((t) => t.type !== type));\n }\n\n // Private helpers\n #addImmediate(type: ToastType, message: string, option?: NotifyOption) {\n const newToast: ToastData = {\n id: Utilities.generateUuid(),\n type,\n message,\n title: option?.title,\n duration: option?.duration ?? this.#DEFAULT_SUCCESS_DURATION,\n actionLabel: option?.actionLabel,\n onAction: option?.onAction\n };\n\n this.toasts.update((current) => {\n const updated = [newToast, ...current];\n return updated.slice(0, this.#MAX_TOASTS);\n });\n }\n\n #addToBuffer(type: ToastType, message: string | string[], option?: NotifyOption) {\n if (!this.#buffer[type]) {\n this.#buffer[type] = [];\n }\n \n const msgs = Array.isArray(message) ? message : [message];\n this.#buffer[type].push(...msgs);\n\n // Clear existing timer and set new one\n if (this.#timers[type]) {\n clearTimeout(this.#timers[type]!);\n }\n\n this.#timers[type] = setTimeout(() => {\n this.#flushBuffer(type, option);\n }, this.#DEBOUNCE_TIME);\n }\n\n #flushBuffer(type: ToastType, option?: NotifyOption) {\n const messages = [...new Set(this.#buffer[type])];\n \n // Cleanup\n this.#buffer[type] = [];\n this.#timers[type] = null;\n\n if (messages.length === 0) return;\n\n const typeLabel = type === 'error' ? 'Error' : 'Warning';\n const title = option?.title ?? typeLabel;\n const finalTitle = messages.length > 1 ? `${title} (${messages.length})` : title;\n\n const newToast: ToastData = {\n id: Utilities.generateUuid(),\n type,\n message: messages.length === 1 ? messages[0] : messages, \n title: finalTitle,\n duration: option?.duration ?? this.#DEFAULT_BUFFERED_DURATION,\n actionLabel: option?.actionLabel,\n onAction: option?.onAction\n };\n\n this.toasts.update((current) => {\n const updated = [newToast, ...current];\n return updated.slice(0, this.#MAX_TOASTS);\n });\n }\n\n #clearAllTimers() {\n Object.values(this.#timers).forEach(timer => {\n if (timer) clearTimeout(timer);\n });\n this.#timers = {};\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.SdNotifyService"],"mappings":";;;;;;;MAkCa,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UAAA,EAAA,CAAA;AAhBP,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA;;4FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAiBI,MAAM;2BAAC,QAAQ;;;AChCpB;;AAEG;;;;"}
|
|
@@ -151,10 +151,10 @@ class SdStorageService {
|
|
|
151
151
|
return val;
|
|
152
152
|
return JSON.parse(JSON.stringify(val));
|
|
153
153
|
}
|
|
154
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
155
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: SdStorageService, deps: [{ token: SD_STORAGE_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
155
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: SdStorageService, providedIn: 'root' });
|
|
156
156
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: SdStorageService, decorators: [{
|
|
158
158
|
type: Injectable,
|
|
159
159
|
args: [{
|
|
160
160
|
providedIn: 'root',
|
|
@@ -5,7 +5,7 @@ import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
|
5
5
|
import { ErrorStateMatcher } from '@angular/material/core';
|
|
6
6
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
7
7
|
import { SdItemDefDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
8
|
-
import { SdSearch, SdCustomValidator, SdSelectionData, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
8
|
+
import { SdSearch, SdViewed, SdViewedInput, SdCustomValidator, SdSelectionData, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
9
9
|
import { Size } from '@sdcorejs/utils/models';
|
|
10
10
|
|
|
11
11
|
declare class SdAutocompleteErrotStateMatcher implements ErrorStateMatcher {
|
|
@@ -50,7 +50,18 @@ declare class SdAutocomplete<T = any> implements OnInit, OnDestroy, AfterViewIni
|
|
|
50
50
|
addable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
51
51
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
52
52
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
53
|
-
|
|
53
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` view + click-to-edit (autocomplete panel). */
|
|
54
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
55
|
+
/** In `viewed='inline'`, show a hover clear-× on the text face. Set `false` when the host owns removal (chips). */
|
|
56
|
+
clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
57
|
+
/** `true` when `viewed === 'inline'`. */
|
|
58
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
59
|
+
/** `true` when `viewed === true` (static view, no editor). */
|
|
60
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
61
|
+
/** Open the autocomplete panel from the inline text face. No-op unless `viewed='inline'`. */
|
|
62
|
+
enterInlineEdit: () => void;
|
|
63
|
+
/** View display template: `sdViewDef` overrides the projected `#sdValue` (unified). */
|
|
64
|
+
readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
54
65
|
validator: _angular_core.InputSignal<SdCustomValidator | undefined>;
|
|
55
66
|
inlineError: _angular_core.InputSignal<string | undefined>;
|
|
56
67
|
/**
|
|
@@ -85,11 +96,13 @@ declare class SdAutocomplete<T = any> implements OnInit, OnDestroy, AfterViewIni
|
|
|
85
96
|
onClick: () => void;
|
|
86
97
|
blur: () => void;
|
|
87
98
|
focus: () => void;
|
|
99
|
+
/** Open the autocomplete panel programmatically (anchors to the field input). Used by inline mode. */
|
|
100
|
+
open: () => void;
|
|
88
101
|
clear: ($event?: any) => void;
|
|
89
102
|
onAdd: ($event: Event) => void;
|
|
90
103
|
reValidate: () => void;
|
|
91
104
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdAutocomplete<any>, never>;
|
|
92
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdAutocomplete<any>, "sd-autocomplete", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "valueField": { "alias": "valueField"; "required": false; "isSignal": true; }; "displayField": { "alias": "displayField"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "cacheChecksum": { "alias": "cacheChecksum"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "validator": { "alias": "validator"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; "sdSelection": "sdSelection"; "sdAdd": "sdAdd"; }, ["sdLabelTemplate", "sdValueTemplate", "itemDef", "sdViewDef"], ["[sdLabel]"], true, never>;
|
|
105
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdAutocomplete<any>, "sd-autocomplete", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "valueField": { "alias": "valueField"; "required": false; "isSignal": true; }; "displayField": { "alias": "displayField"; "required": false; "isSignal": true; }; "disabledField": { "alias": "disabledField"; "required": false; "isSignal": true; }; "limit": { "alias": "limit"; "required": false; "isSignal": true; }; "cacheChecksum": { "alias": "cacheChecksum"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "validator": { "alias": "validator"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; "sdSelection": "sdSelection"; "sdAdd": "sdAdd"; }, ["sdLabelTemplate", "sdValueTemplate", "itemDef", "sdViewDef"], ["[sdLabel]"], true, never>;
|
|
93
106
|
}
|
|
94
107
|
|
|
95
108
|
export { SdAutocomplete };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnDestroy, AfterViewInit } from '@angular/core';
|
|
3
3
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
4
|
+
import { SdViewed, SdViewedInput } from '@sdcorejs/angular/forms/models';
|
|
4
5
|
import { Color } from '@sdcorejs/utils/models';
|
|
5
6
|
|
|
6
7
|
declare class SdCheckbox implements OnDestroy, AfterViewInit {
|
|
@@ -13,7 +14,10 @@ declare class SdCheckbox implements OnDestroy, AfterViewInit {
|
|
|
13
14
|
readonly label: _angular_core.InputSignalWithTransform<string | undefined, string | null | undefined>;
|
|
14
15
|
readonly color: _angular_core.InputSignalWithTransform<Color, Color | null | undefined>;
|
|
15
16
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
16
|
-
|
|
17
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
|
|
18
|
+
readonly viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
19
|
+
/** `true` when the static read-only view should render. */
|
|
20
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
17
21
|
readonly inlineError: _angular_core.InputSignalWithTransform<string, string | null | undefined>;
|
|
18
22
|
readonly model: _angular_core.ModelSignal<unknown>;
|
|
19
23
|
readonly sdChange: _angular_core.OutputEmitterRef<unknown>;
|
package/forms/chip/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { MatChipInputEvent } from '@angular/material/chips';
|
|
|
6
6
|
import { ErrorStateMatcher } from '@angular/material/core';
|
|
7
7
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
8
8
|
import { SdViewDefDirective, SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
9
|
-
import { SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
9
|
+
import { SdViewed, SdViewedInput, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
10
10
|
import { Size } from '@sdcorejs/utils/models';
|
|
11
11
|
|
|
12
12
|
declare class SdRemovableChipPipe implements PipeTransform {
|
|
@@ -45,7 +45,10 @@ declare class SdChip implements AfterViewInit {
|
|
|
45
45
|
max: _angular_core.InputSignalWithTransform<number, number | null | undefined>;
|
|
46
46
|
addable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
47
47
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
48
|
-
|
|
48
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
|
|
49
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
50
|
+
/** `true` when the static view should render (`viewed===true`, or disabled `'inline'`). */
|
|
51
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
49
52
|
hyperlink: _angular_core.InputSignalWithTransform<string | undefined, string | null | undefined>;
|
|
50
53
|
model: _angular_core.ModelSignal<(string | number)[] | undefined>;
|
|
51
54
|
sdChange: _angular_core.OutputEmitterRef<any[]>;
|
|
@@ -7,7 +7,7 @@ import { MatCalendar } from '@angular/material/datepicker';
|
|
|
7
7
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
8
8
|
import { MatMenuTrigger } from '@angular/material/menu';
|
|
9
9
|
import { SdViewDefDirective, SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
10
|
-
import { SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
10
|
+
import { SdViewed, SdViewedInput, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
11
11
|
import { Size } from '@sdcorejs/utils/models';
|
|
12
12
|
|
|
13
13
|
declare class SdChipCalendarErrorStateMatcher implements ErrorStateMatcher {
|
|
@@ -40,7 +40,10 @@ declare class SdChipCalendar implements AfterViewInit {
|
|
|
40
40
|
min: _angular_core.InputSignalWithTransform<number, number | null | undefined>;
|
|
41
41
|
max: _angular_core.InputSignalWithTransform<number, number | null | undefined>;
|
|
42
42
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
43
|
-
|
|
43
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
|
|
44
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
45
|
+
/** `true` when the static view should render (`viewed===true`, or disabled `'inline'`). */
|
|
46
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
44
47
|
hyperlink: _angular_core.InputSignalWithTransform<string | undefined, string | null | undefined>;
|
|
45
48
|
model: _angular_core.ModelSignal<(string | number)[] | undefined>;
|
|
46
49
|
sdChange: _angular_core.OutputEmitterRef<any[]>;
|
package/forms/date/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { FormGroup } from '@angular/forms';
|
|
|
4
4
|
import { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
5
5
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
6
6
|
import { SdViewDefDirective, SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
7
|
-
import { SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
7
|
+
import { SdViewed, SdViewedInput, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
8
8
|
import { Size } from '@sdcorejs/utils/models';
|
|
9
9
|
|
|
10
10
|
declare class SdDate implements OnDestroy, OnInit {
|
|
@@ -35,9 +35,18 @@ declare class SdDate implements OnDestroy, OnInit {
|
|
|
35
35
|
hideInlineError: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
36
36
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
37
37
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` view + click-to-edit (calendar). */
|
|
39
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
40
|
+
/** In `viewed='inline'`, show a hover clear-× on the text face. Set `false` when the host owns removal (chips). */
|
|
41
|
+
clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
42
|
+
/** `true` when `viewed === 'inline'`. */
|
|
43
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
44
|
+
/** `true` when `viewed === true` (static view, no editor). */
|
|
45
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
46
|
+
/** Open the calendar from the inline text face. No-op unless `viewed='inline'`. */
|
|
47
|
+
enterInlineEdit: () => void;
|
|
48
|
+
/** View display template: `sdViewDef` overrides the projected `#sdValue` (unified). */
|
|
49
|
+
readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
41
50
|
inlineError: _angular_core.InputSignal<string | undefined>;
|
|
42
51
|
/**
|
|
43
52
|
* Tổng hợp error message để hiển thị trong tooltip khi hideInlineError = true.
|
|
@@ -76,7 +85,7 @@ declare class SdDate implements OnDestroy, OnInit {
|
|
|
76
85
|
onChange: (event: MatDatepickerInputEvent<Date>) => void;
|
|
77
86
|
clear: ($event: any) => void;
|
|
78
87
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdDate, never>;
|
|
79
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDate, "sd-date", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "
|
|
88
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDate, "sd-date", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "minInput": { "alias": "min"; "required": false; "isSignal": true; }; "minDateInput": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxInput": { "alias": "max"; "required": false; "isSignal": true; }; "maxDateInput": { "alias": "maxDate"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; "sdFocus": "sdFocus"; }, ["sdLabelTemplate", "sdValueTemplate", "sdViewDef", "sdLabelDef"], ["[sdLabel]"], true, never>;
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
export { SdDate };
|
|
@@ -4,6 +4,7 @@ import { FormGroup, FormControl } from '@angular/forms';
|
|
|
4
4
|
import { MatDateRangePicker, MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
5
5
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
6
6
|
import { SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
7
|
+
import { SdViewed, SdViewedInput } from '@sdcorejs/angular/forms/models';
|
|
7
8
|
import { Size } from '@sdcorejs/utils/models';
|
|
8
9
|
|
|
9
10
|
interface Daterange {
|
|
@@ -38,10 +39,16 @@ declare class SdDateRange implements OnDestroy, OnInit {
|
|
|
38
39
|
readonly errorMessage: _angular_core.Signal<string | undefined>;
|
|
39
40
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
40
41
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
|
|
42
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` view + click-to-edit (range picker). */
|
|
43
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
44
|
+
/** In `viewed='inline'`, show a hover clear-× on the text face. Set `false` when the host owns removal (chips). */
|
|
45
|
+
clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
46
|
+
/** `true` when `viewed === 'inline'`. */
|
|
47
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
48
|
+
/** `true` when `viewed === true` (static view, no editor). */
|
|
49
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
50
|
+
/** Open the range picker from the inline text face. No-op unless `viewed='inline'`. */
|
|
51
|
+
enterInlineEdit: () => void;
|
|
45
52
|
/** Optional <ng-template #sdValue> projected by consumer to override the viewed text. */
|
|
46
53
|
sdValueTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
47
54
|
/**
|
|
@@ -77,7 +84,7 @@ declare class SdDateRange implements OnDestroy, OnInit {
|
|
|
77
84
|
onClosePicker: () => void;
|
|
78
85
|
onOpenPicker: (event: MouseEvent) => void;
|
|
79
86
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdDateRange, never>;
|
|
80
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDateRange, "sd-date-range", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "
|
|
87
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDateRange, "sd-date-range", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "minInput": { "alias": "min"; "required": false; "isSignal": true; }; "maxInput": { "alias": "max"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; }, ["sdLabelDef", "sdValueTemplate"], never, true, never>;
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
export { SdDateRange };
|
|
@@ -3,7 +3,7 @@ import { OnDestroy, OnInit, ElementRef, TemplateRef } from '@angular/core';
|
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
5
5
|
import { SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
6
|
-
import { SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
6
|
+
import { SdViewed, SdViewedInput, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
7
7
|
import { Size } from '@sdcorejs/utils/models';
|
|
8
8
|
|
|
9
9
|
declare class SdDatetime implements OnDestroy, OnInit {
|
|
@@ -35,11 +35,20 @@ declare class SdDatetime implements OnDestroy, OnInit {
|
|
|
35
35
|
hideInlineError: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
36
36
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
37
37
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
38
|
-
|
|
38
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` view + click-to-edit (datetime overlay). */
|
|
39
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
39
40
|
/** Hiển thị thêm cột giây trong picker. Mặc định: chỉ HH:MM. */
|
|
40
41
|
showSeconds: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
41
|
-
/**
|
|
42
|
-
|
|
42
|
+
/** In `viewed='inline'`, show a hover clear-× on the text face. Set `false` when the host owns removal (chips). */
|
|
43
|
+
clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
44
|
+
/** `true` when `viewed === 'inline'`. */
|
|
45
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
46
|
+
/** `true` when `viewed === true` (static view, no editor). */
|
|
47
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
48
|
+
/** Open the datetime overlay from the inline text face. No-op unless `viewed='inline'`. */
|
|
49
|
+
enterInlineEdit: () => void;
|
|
50
|
+
/** View display template: `sdViewDef` overrides the projected `#sdValue` (unified). */
|
|
51
|
+
readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
43
52
|
inlineError: _angular_core.InputSignal<string | undefined>;
|
|
44
53
|
/**
|
|
45
54
|
* Tổng hợp error message để hiển thị trong tooltip khi hideInlineError = true.
|
|
@@ -86,7 +95,7 @@ declare class SdDatetime implements OnDestroy, OnInit {
|
|
|
86
95
|
onConfirmInput: (event: any) => void;
|
|
87
96
|
clear: ($event: any) => void;
|
|
88
97
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdDatetime, never>;
|
|
89
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDatetime, "sd-datetime", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "
|
|
98
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdDatetime, "sd-datetime", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "hyperlink": { "alias": "hyperlink"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "minInput": { "alias": "min"; "required": false; "isSignal": true; }; "minDateInput": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxInput": { "alias": "max"; "required": false; "isSignal": true; }; "maxDateInput": { "alias": "maxDate"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; "sdFocus": "sdFocus"; }, ["sdLabelTemplate", "sdValueTemplate", "sdViewDef"], ["[sdLabel]"], true, never>;
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
export { SdDatetime };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
3
|
+
|
|
4
|
+
/** Visual / `data-state` of the inline input. `'auto'` derives from focus + value. */
|
|
5
|
+
type SdInlineTextState = 'auto' | 'pending' | 'active' | 'focus' | 'error';
|
|
6
|
+
/** `'standalone'` draws its own affordance (hover bg + focus ring); `'seamless'` defers all chrome to the host. */
|
|
7
|
+
type SdInlineTextChrome = 'standalone' | 'seamless';
|
|
8
|
+
/**
|
|
9
|
+
* Borderless, content-hugging text input — the seamless primitive shared by
|
|
10
|
+
* `sd-input` / `sd-input-number` (`viewed='inline'`) and the query-bar / query-builder chips.
|
|
11
|
+
*
|
|
12
|
+
* why: a native `<input>` inside `mat-form-field` cannot hug its content, so inline-edit
|
|
13
|
+
* looked like a full-width input rather than text. This primitive renders a raw `<input>`
|
|
14
|
+
* sized via the native `size` attribute (clamped) so the click/hover target tracks the value.
|
|
15
|
+
*
|
|
16
|
+
* It is intentionally unopinionated about commit/parse/format: it forwards the raw DOM events
|
|
17
|
+
* (focus / blur / keydown / paste / composition / Enter / Escape) so each consumer keeps its own
|
|
18
|
+
* logic (e.g. sd-input-number's vi-VN formatting). Two binding modes:
|
|
19
|
+
* - **uncontrolled** via `[(value)]` — used by the chips' signal drafts;
|
|
20
|
+
* - **controlled** via `[control]` (an external `SdFormControl`) — used by the form controls.
|
|
21
|
+
*/
|
|
22
|
+
declare class SdInlineText {
|
|
23
|
+
/** Uncontrolled value (two-way). Ignored when `[control]` is provided. */
|
|
24
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
25
|
+
/** Optional external FormControl (controlled mode) — used by sd-input / sd-input-number. */
|
|
26
|
+
readonly control: _angular_core.InputSignal<SdFormControl | undefined>;
|
|
27
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
28
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
29
|
+
/** Show a hover/value-gated clear-× (default `true`). */
|
|
30
|
+
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
31
|
+
/** `'auto'` derives state from focus + value; pass an explicit value (e.g. `'error'`) to override. */
|
|
32
|
+
readonly state: _angular_core.InputSignal<SdInlineTextState>;
|
|
33
|
+
readonly chrome: _angular_core.InputSignal<SdInlineTextChrome>;
|
|
34
|
+
readonly autoId: _angular_core.InputSignal<string | undefined>;
|
|
35
|
+
readonly autofocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
36
|
+
/** Lower bound (chars) so short/empty values keep a clickable target. */
|
|
37
|
+
readonly minSize: _angular_core.InputSignal<number>;
|
|
38
|
+
readonly cleared: _angular_core.OutputEmitterRef<void>;
|
|
39
|
+
readonly keyupEnter: _angular_core.OutputEmitterRef<void>;
|
|
40
|
+
readonly keydownEscape: _angular_core.OutputEmitterRef<void>;
|
|
41
|
+
readonly sdFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
42
|
+
readonly sdBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
43
|
+
readonly sdKeydown: _angular_core.OutputEmitterRef<KeyboardEvent>;
|
|
44
|
+
readonly sdPaste: _angular_core.OutputEmitterRef<ClipboardEvent>;
|
|
45
|
+
readonly sdCompositionStart: _angular_core.OutputEmitterRef<CompositionEvent>;
|
|
46
|
+
readonly sdCompositionEnd: _angular_core.OutputEmitterRef<CompositionEvent>;
|
|
47
|
+
private readonly inputRef;
|
|
48
|
+
/** Bumped on input/blur/composition + bound-control changes so size/state methods re-eval under OnPush. */
|
|
49
|
+
protected readonly tick: _angular_core.WritableSignal<number>;
|
|
50
|
+
protected readonly focused: _angular_core.WritableSignal<boolean>;
|
|
51
|
+
constructor();
|
|
52
|
+
/**
|
|
53
|
+
* Current text — from the bound control in controlled mode, else the value model.
|
|
54
|
+
* why: `tick` is a tracked dependency so the computed re-runs when a bound control's
|
|
55
|
+
* value changes programmatically (control.value itself is not a signal).
|
|
56
|
+
*/
|
|
57
|
+
protected readonly currentText: _angular_core.Signal<string>;
|
|
58
|
+
protected readonly hasValue: _angular_core.Signal<boolean>;
|
|
59
|
+
protected readonly sizeOf: _angular_core.Signal<number>;
|
|
60
|
+
protected readonly showClear: _angular_core.Signal<boolean>;
|
|
61
|
+
protected readonly effectiveState: _angular_core.Signal<SdInlineTextState>;
|
|
62
|
+
protected onInput(ev: Event): void;
|
|
63
|
+
protected onFocus(ev: FocusEvent): void;
|
|
64
|
+
protected onBlur(ev: FocusEvent): void;
|
|
65
|
+
protected onKeyup(ev: KeyboardEvent): void;
|
|
66
|
+
protected onKeydown(ev: KeyboardEvent): void;
|
|
67
|
+
protected onPaste(ev: ClipboardEvent): void;
|
|
68
|
+
protected onCompositionStart(ev: CompositionEvent): void;
|
|
69
|
+
protected onCompositionEnd(ev: CompositionEvent): void;
|
|
70
|
+
protected clear(ev: Event): void;
|
|
71
|
+
/** Focus the native input. */
|
|
72
|
+
focus(): void;
|
|
73
|
+
/** Blur the native input. */
|
|
74
|
+
blur(): void;
|
|
75
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdInlineText, never>;
|
|
76
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdInlineText, "sd-inline-text", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "chrome": { "alias": "chrome"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "minSize": { "alias": "minSize"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "cleared": "cleared"; "keyupEnter": "keyupEnter"; "keydownEscape": "keydownEscape"; "sdFocus": "sdFocus"; "sdBlur": "sdBlur"; "sdKeydown": "sdKeydown"; "sdPaste": "sdPaste"; "sdCompositionStart": "sdCompositionStart"; "sdCompositionEnd": "sdCompositionEnd"; }, never, never, true, never>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { SdInlineText };
|
|
80
|
+
export type { SdInlineTextChrome, SdInlineTextState };
|
package/forms/input/index.d.ts
CHANGED
|
@@ -2,14 +2,17 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { OnDestroy, OnInit, AfterViewInit, ElementRef, TemplateRef, EventEmitter } from '@angular/core';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
5
|
+
import { SdInlineText } from '@sdcorejs/angular/forms/inline-text';
|
|
5
6
|
import { SdSuffixDefDirective, SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
6
|
-
import { SdCustomValidator, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
7
|
+
import { SdViewed, SdViewedInput, SdCustomValidator, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
7
8
|
import { Size } from '@sdcorejs/utils/models';
|
|
8
9
|
|
|
9
10
|
declare class SdInput implements OnDestroy, OnInit, AfterViewInit {
|
|
10
11
|
#private;
|
|
11
12
|
id: string;
|
|
12
13
|
control: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
14
|
+
/** The inline primitive — only present when `viewed='inline'`; drives focus/blur in that mode. */
|
|
15
|
+
inlineRef: _angular_core.Signal<SdInlineText | undefined>;
|
|
13
16
|
sdLabelTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
14
17
|
sdValueTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
15
18
|
sdSuffixDef: _angular_core.Signal<SdSuffixDefDirective | undefined>;
|
|
@@ -40,7 +43,16 @@ declare class SdInput implements OnDestroy, OnInit, AfterViewInit {
|
|
|
40
43
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
41
44
|
readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
42
45
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
43
|
-
|
|
46
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` borderless inline-edit (no panel — the input IS the face). */
|
|
47
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
48
|
+
/** `true` when `viewed === 'inline'`. */
|
|
49
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
50
|
+
/** `true` when `viewed === true` (static view, no input). */
|
|
51
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
52
|
+
/** Focus the inline input. No-op unless `viewed='inline'`. */
|
|
53
|
+
enterInlineEdit: () => void;
|
|
54
|
+
/** View display template: `sdViewDef` overrides the projected `#sdValue` for the static view (unified). */
|
|
55
|
+
readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
44
56
|
minlength: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
45
57
|
maxlength: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
46
58
|
pattern: _angular_core.InputSignal<string | null | undefined>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ElementRef } from '@angular/core';
|
|
3
3
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
4
|
+
import { SdViewed, SdViewedInput } from '@sdcorejs/angular/forms/models';
|
|
4
5
|
import { Size } from '@sdcorejs/utils/models';
|
|
5
6
|
|
|
6
7
|
declare const SD_INPUT_COLOR_HEX_PATTERN = "^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$";
|
|
@@ -18,7 +19,8 @@ declare class SdInputColor {
|
|
|
18
19
|
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
19
20
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
20
21
|
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
21
|
-
|
|
22
|
+
/** Display mode — forwarded to the inner `<sd-input>`. `'inline'` = borderless inline-edit; disabled `'inline'` → static. */
|
|
23
|
+
readonly viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
22
24
|
readonly valueModel: _angular_core.ModelSignal<string | null | undefined>;
|
|
23
25
|
readonly sdChange: _angular_core.OutputEmitterRef<string | null | undefined>;
|
|
24
26
|
readonly picker: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
@@ -3,8 +3,9 @@ import { OnDestroy, OnInit, AfterViewInit, ElementRef, TemplateRef, EventEmitter
|
|
|
3
3
|
import { FormGroup, FormControl, FormGroupDirective, NgForm } from '@angular/forms';
|
|
4
4
|
import { ErrorStateMatcher } from '@angular/material/core';
|
|
5
5
|
import { MatFormFieldAppearance, FloatLabelType } from '@angular/material/form-field';
|
|
6
|
+
import { SdInlineText } from '@sdcorejs/angular/forms/inline-text';
|
|
6
7
|
import { SdViewDefDirective, SdSuffixDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
7
|
-
import { SdCustomValidator, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
8
|
+
import { SdViewed, SdViewedInput, SdCustomValidator, SdFormControl } from '@sdcorejs/angular/forms/models';
|
|
8
9
|
import { Size } from '@sdcorejs/utils/models';
|
|
9
10
|
|
|
10
11
|
declare class SdInputNumberErrotStateMatcher implements ErrorStateMatcher {
|
|
@@ -16,6 +17,8 @@ declare class SdInputNumber implements OnDestroy, OnInit, AfterViewInit {
|
|
|
16
17
|
#private;
|
|
17
18
|
id: string;
|
|
18
19
|
control: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
20
|
+
/** The inline primitive — only present when `viewed='inline'`; drives focus/blur in that mode. */
|
|
21
|
+
inlineRef: _angular_core.Signal<SdInlineText | undefined>;
|
|
19
22
|
sdLabelTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
20
23
|
sdValueTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
21
24
|
sdViewDef: _angular_core.Signal<SdViewDefDirective<any, any> | undefined>;
|
|
@@ -43,7 +46,16 @@ declare class SdInputNumber implements OnDestroy, OnInit, AfterViewInit {
|
|
|
43
46
|
required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
44
47
|
readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
45
48
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
46
|
-
|
|
49
|
+
/** Display mode: `false` edit · `true` static view · `'inline'` borderless inline-edit (input IS the face). */
|
|
50
|
+
viewed: _angular_core.InputSignalWithTransform<SdViewed, SdViewedInput>;
|
|
51
|
+
/** `true` when `viewed === 'inline'`. */
|
|
52
|
+
readonly isInline: _angular_core.Signal<boolean>;
|
|
53
|
+
/** `true` when `viewed === true` (static view, no input). */
|
|
54
|
+
readonly isViewed: _angular_core.Signal<boolean>;
|
|
55
|
+
/** Focus the inline input. No-op unless `viewed='inline'`. */
|
|
56
|
+
enterInlineEdit: () => void;
|
|
57
|
+
/** View display template: `sdViewDef` overrides the projected `#sdValue` for the static view (unified). */
|
|
58
|
+
readonly viewTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
47
59
|
type: _angular_core.InputSignal<"negative" | "positive" | undefined>;
|
|
48
60
|
precision: _angular_core.InputSignal<number>;
|
|
49
61
|
format: _angular_core.InputSignal<"1,234,567.89" | "1.234.567,89" | undefined>;
|