@sdcorejs/angular 20.2.7 → 20.2.9
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 +4 -2
- package/assets/STYLE-GUIDE.md +2 -0
- package/assets/scss/core/form.scss +6 -0
- package/components/form-generic/index.d.ts +1 -0
- package/components/index.d.ts +0 -1
- package/components/query-builder/index.d.ts +3 -0
- package/components/table/index.d.ts +1 -1
- package/components/upload-file/index.d.ts +1 -2
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +35 -2
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +218 -79
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +3 -4
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +0 -1
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +49 -11
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +5 -3
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +5 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +56 -14
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +9 -4
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/forms/switch/index.d.ts +3 -2
- package/i18n/index.d.ts +1 -0
- package/modules/layout/index.d.ts +15 -1
- package/package.json +1 -7
- package/components/chart/index.d.ts +0 -65
- package/fesm2022/sdcorejs-angular-components-chart.mjs +0 -290
- package/fesm2022/sdcorejs-angular-components-chart.mjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, Renderer2, HostListener, Directive, TemplateRef, ViewContainerRef, input, DestroyRef, HostBinding, ChangeDetectorRef, computed, Component } from '@angular/core';
|
|
3
3
|
import { BrowserUtilities } from '@sdcorejs/utils/fns';
|
|
4
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
6
|
+
import { DomPortal, ComponentPortal } from '@angular/cdk/portal';
|
|
4
7
|
import { I18nService } from '@sdcorejs/angular/i18n';
|
|
5
8
|
import { Router } from '@angular/router';
|
|
6
9
|
import { sdIsExternalHttpUrl, sdOpenExternal } from '@sdcorejs/angular/utilities';
|
|
7
|
-
import { Overlay } from '@angular/cdk/overlay';
|
|
8
|
-
import { ComponentPortal } from '@angular/cdk/portal';
|
|
9
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
10
10
|
|
|
11
11
|
class SdScrollDirective {
|
|
12
12
|
elementRef = inject(ElementRef);
|
|
@@ -98,8 +98,13 @@ class SdHoverCopyDirective {
|
|
|
98
98
|
sdHoverCopyDisabled = input(false, ...(ngDevMode ? [{ debugName: "sdHoverCopyDisabled" }] : []));
|
|
99
99
|
#i18n = inject(I18nService);
|
|
100
100
|
#destroyRef = inject(DestroyRef);
|
|
101
|
+
#overlay = inject(Overlay);
|
|
102
|
+
#document = inject(DOCUMENT);
|
|
101
103
|
#copyButton = null;
|
|
102
104
|
#tooltip;
|
|
105
|
+
#tooltipOverlay = null;
|
|
106
|
+
#unlistenCopy = null;
|
|
107
|
+
#onScroll = () => this.#hideTooltip();
|
|
103
108
|
#hideTooltipTimer = null;
|
|
104
109
|
get #defaultTooltip() {
|
|
105
110
|
return this.#i18n.t('core.directive.hover-copy.tooltip');
|
|
@@ -113,7 +118,7 @@ class SdHoverCopyDirective {
|
|
|
113
118
|
// why: timeout 1s ẩn tooltip trước đây không được lưu lại cũng không huỷ, mà directive lại
|
|
114
119
|
// không có teardown nào. Host bị destroy trong vòng 1s đó thì callback vẫn chạy và ghi style
|
|
115
120
|
// lên node đã tháo khỏi DOM (timer sống lâu hơn view).
|
|
116
|
-
this.#destroyRef.onDestroy(() => this.#
|
|
121
|
+
this.#destroyRef.onDestroy(() => this.#removeCopyButton());
|
|
117
122
|
}
|
|
118
123
|
// https://onemount.atlassian.net/browse/SM-2287
|
|
119
124
|
// Hiện tại khi sdHoverCopyDisabled = true, directive chỉ dùng opacity: 0 và pointerEvents: 'none' để ẩn nút, nhưng điều này không hoàn toàn ngăn chặn được việc click trong một số trường hợp.
|
|
@@ -138,6 +143,9 @@ class SdHoverCopyDirective {
|
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
145
|
#createAndAppendCopyButton() {
|
|
146
|
+
// why: ngOnChanges có thể tạo nút trước ngOnInit; chỉ giữ một nút và một overlay owner.
|
|
147
|
+
if (this.#copyButton)
|
|
148
|
+
return;
|
|
141
149
|
const parent = this.el.nativeElement;
|
|
142
150
|
this.renderer.setStyle(parent, 'position', 'relative');
|
|
143
151
|
// Create button
|
|
@@ -171,12 +179,9 @@ class SdHoverCopyDirective {
|
|
|
171
179
|
this.renderer.appendChild(this.#copyButton, svg);
|
|
172
180
|
// Tooltip
|
|
173
181
|
this.#tooltip = this.renderer.createElement('span');
|
|
182
|
+
this.renderer.setAttribute(this.#tooltip, 'role', 'tooltip');
|
|
174
183
|
this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);
|
|
175
|
-
this.renderer.setStyle(this.#tooltip, '
|
|
176
|
-
this.renderer.setStyle(this.#tooltip, 'bottom', '100%');
|
|
177
|
-
this.renderer.setStyle(this.#tooltip, 'left', '50%');
|
|
178
|
-
this.renderer.setStyle(this.#tooltip, 'transform', 'translateX(-50%)');
|
|
179
|
-
this.renderer.setStyle(this.#tooltip, 'marginBottom', '4px');
|
|
184
|
+
this.renderer.setStyle(this.#tooltip, 'display', 'none');
|
|
180
185
|
this.renderer.setStyle(this.#tooltip, 'background', '#333');
|
|
181
186
|
this.renderer.setStyle(this.#tooltip, 'color', '#fff');
|
|
182
187
|
this.renderer.setStyle(this.#tooltip, 'padding', '2px 6px');
|
|
@@ -190,7 +195,7 @@ class SdHoverCopyDirective {
|
|
|
190
195
|
this.renderer.appendChild(this.#copyButton, this.#tooltip);
|
|
191
196
|
this.renderer.appendChild(parent, this.#copyButton);
|
|
192
197
|
// Listen click
|
|
193
|
-
this.renderer.listen(this.#copyButton, 'click', () => {
|
|
198
|
+
this.#unlistenCopy = this.renderer.listen(this.#copyButton, 'click', () => {
|
|
194
199
|
const copyText = this.copyText();
|
|
195
200
|
if (copyText && !this.sdHoverCopyDisabled()) {
|
|
196
201
|
BrowserUtilities.copyToClipboard(String(copyText));
|
|
@@ -210,20 +215,53 @@ class SdHoverCopyDirective {
|
|
|
210
215
|
this.#hideTooltipTimer = null;
|
|
211
216
|
}
|
|
212
217
|
#removeCopyButton() {
|
|
213
|
-
// why: tooltip nằm trong button — bỏ button mà để timer chạy tiếp là ghi style lên node đã gỡ.
|
|
214
218
|
this.#clearHideTooltipTimer();
|
|
219
|
+
this.#document.removeEventListener('scroll', this.#onScroll, true);
|
|
220
|
+
this.#tooltipOverlay?.dispose();
|
|
221
|
+
this.#tooltipOverlay = null;
|
|
222
|
+
this.#unlistenCopy?.();
|
|
223
|
+
this.#unlistenCopy = null;
|
|
215
224
|
if (this.#copyButton) {
|
|
216
225
|
this.renderer.removeChild(this.el.nativeElement, this.#copyButton);
|
|
217
226
|
this.#copyButton = null;
|
|
218
227
|
}
|
|
219
228
|
}
|
|
220
229
|
#showTooltip(message) {
|
|
230
|
+
if (!this.#copyButton)
|
|
231
|
+
return;
|
|
232
|
+
if (!this.#tooltipOverlay) {
|
|
233
|
+
// why: portal thoát khỏi overflow/stacking context của table cell và modal body.
|
|
234
|
+
this.#tooltipOverlay = this.#overlay.create({
|
|
235
|
+
positionStrategy: this.#overlay
|
|
236
|
+
.position()
|
|
237
|
+
.flexibleConnectedTo(this.#copyButton)
|
|
238
|
+
.withPositions([
|
|
239
|
+
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 },
|
|
240
|
+
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 },
|
|
241
|
+
])
|
|
242
|
+
.withFlexibleDimensions(false)
|
|
243
|
+
.withViewportMargin(8)
|
|
244
|
+
.withPush(true),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
221
247
|
this.renderer.setProperty(this.#tooltip, 'innerText', message);
|
|
248
|
+
this.renderer.setStyle(this.#tooltip, 'display', 'block');
|
|
222
249
|
this.renderer.setStyle(this.#tooltip, 'opacity', '1');
|
|
250
|
+
if (!this.#tooltipOverlay.hasAttached()) {
|
|
251
|
+
this.#tooltipOverlay.attach(new DomPortal(this.#tooltip));
|
|
252
|
+
}
|
|
253
|
+
this.renderer.setStyle(this.#tooltipOverlay.overlayElement, 'pointerEvents', 'none');
|
|
254
|
+
this.#tooltipOverlay.updatePosition();
|
|
255
|
+
// why: capture bắt cả scroll ở ancestor không khai cdkScrollable, tránh tooltip trôi khỏi cell.
|
|
256
|
+
this.#document.addEventListener('scroll', this.#onScroll, true);
|
|
223
257
|
}
|
|
224
258
|
#hideTooltip() {
|
|
259
|
+
this.#clearHideTooltipTimer();
|
|
260
|
+
this.#document.removeEventListener('scroll', this.#onScroll, true);
|
|
261
|
+
this.#tooltipOverlay?.detach();
|
|
225
262
|
this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);
|
|
226
263
|
this.renderer.setStyle(this.#tooltip, 'opacity', '0');
|
|
264
|
+
this.renderer.setStyle(this.#tooltip, 'display', 'none');
|
|
227
265
|
}
|
|
228
266
|
onMouseEnter() {
|
|
229
267
|
if (!this.sdHoverCopyDisabled() && this.#copyButton) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-directives.mjs","sources":["../../../projects/sdcorejs-angular/directives/src/sd-scroll.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-desktop.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-mobile.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-hover-copy.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-href.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-tooltip.directive.ts","../../../projects/sdcorejs-angular/directives/sdcorejs-angular-directives.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, OnInit, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[sdScroll]',\n standalone: true,\n})\nexport class SdScrollDirective implements OnInit {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n #overflowX: 'hidden' | 'auto' | 'overlay' = 'hidden';\n #overflowY: 'hidden' | 'auto' | 'overlay' = 'auto';\n @HostListener('mouseover')\n onMouseOver() {\n this.#overflowX = 'auto';\n // this.#overflowY = 'auto';\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n // this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-y', this.#overflowY);\n }\n\n @HostListener('mouseout')\n onMouseOut() {\n this.#overflowX = 'hidden';\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n }\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n constructor() {}\n\n ngOnInit(): void {\n this.renderer.setStyle(this.elementRef.nativeElement, '-webkit-transform', 'translate3d(0, 0, 0)');\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-y', this.#overflowY);\n }\n\n scrollTop = () => {\n setTimeout(() => {\n if (this.elementRef?.nativeElement) {\n this.elementRef.nativeElement.scrollTop = 0;\n }\n }, 1);\n };\n}\n","import { Directive, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\n\n@Directive({\n selector: '[sdDesktop]',\n standalone: true,\n})\nexport class SdDesktopDirective {\n readonly #templateRef: TemplateRef<Record<string, never>> = inject(TemplateRef);\n readonly #viewContainerRef = inject(ViewContainerRef);\n\n constructor() {\n if (!BrowserUtilities.isMobile()) {\n this.#viewContainerRef.createEmbeddedView(this.#templateRef);\n }\n }\n}\n","import { Directive, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\n\n@Directive({\n selector: '[sdMobile]',\n standalone: true,\n})\nexport class SdMobileDirective {\n readonly #templateRef: TemplateRef<Record<string, never>> = inject(TemplateRef);\n readonly #viewContainerRef = inject(ViewContainerRef);\n\n constructor() {\n if (BrowserUtilities.isMobile()) {\n this.#viewContainerRef.createEmbeddedView(this.#templateRef);\n }\n }\n}\n","import { DestroyRef, Directive, ElementRef, inject, Renderer2, HostListener, OnInit, OnChanges, SimpleChanges, input } from '@angular/core';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { I18nService } from '@sdcorejs/angular/i18n';\n\n@Directive({\n selector: '[sdHoverCopy]',\n})\nexport class SdHoverCopyDirective implements OnInit, OnChanges {\n private el = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n readonly copyText = input.required<string>({ alias: 'sdHoverCopy' });\n readonly sdHoverCopyDisabled = input(false);\n\n readonly #i18n = inject(I18nService);\n readonly #destroyRef = inject(DestroyRef);\n\n #copyButton: HTMLElement | null = null;\n #tooltip!: HTMLElement;\n #hideTooltipTimer: ReturnType<typeof setTimeout> | null = null;\n get #defaultTooltip(): string {\n return this.#i18n.t('core.directive.hover-copy.tooltip');\n }\n // why: tooltip mặc định đã đi qua I18nService từ trước, riêng phản hồi sau khi copy vẫn cứng\n // 'Copied' — cùng một tooltip mà hai ngôn ngữ. Đọc lúc hiển thị để bám ngôn ngữ hiện tại.\n get #copiedTooltip(): string {\n return this.#i18n.t('core.directive.hover-copy.copied');\n }\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n // why: timeout 1s ẩn tooltip trước đây không được lưu lại cũng không huỷ, mà directive lại\n // không có teardown nào. Host bị destroy trong vòng 1s đó thì callback vẫn chạy và ghi style\n // lên node đã tháo khỏi DOM (timer sống lâu hơn view).\n this.#destroyRef.onDestroy(() => this.#clearHideTooltipTimer());\n }\n\n // https://onemount.atlassian.net/browse/SM-2287\n // Hiện tại khi sdHoverCopyDisabled = true, directive chỉ dùng opacity: 0 và pointerEvents: 'none' để ẩn nút, nhưng điều này không hoàn toàn ngăn chặn được việc click trong một số trường hợp.\n // Giải pháp: Remove khỏi DOM nếu column không được enable\n ngOnInit(): void {\n if (!this.sdHoverCopyDisabled()) {\n this.#createAndAppendCopyButton();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['sdHoverCopyDisabled']) {\n if (!this.sdHoverCopyDisabled()) {\n // Enable - create and show button if not exists\n if (!this.#copyButton) {\n this.#createAndAppendCopyButton();\n }\n } else {\n // Disable - remove button from DOM\n this.#removeCopyButton();\n }\n }\n }\n\n #createAndAppendCopyButton(): void {\n const parent = this.el.nativeElement;\n this.renderer.setStyle(parent, 'position', 'relative');\n\n // Create button\n this.#copyButton = this.renderer.createElement('button');\n this.renderer.setStyle(this.#copyButton, 'position', 'absolute');\n this.renderer.setStyle(this.#copyButton, 'top', '50%');\n this.renderer.setStyle(this.#copyButton, 'transform', 'translateY(-50%)');\n this.renderer.setStyle(this.#copyButton, 'right', '4px');\n this.renderer.setStyle(this.#copyButton, 'display', 'none');\n this.renderer.setStyle(this.#copyButton, 'z-index', '10');\n this.renderer.setStyle(this.#copyButton, 'background', 'transparent');\n this.renderer.setStyle(this.#copyButton, 'border', 'none');\n this.renderer.setStyle(this.#copyButton, 'cursor', 'pointer');\n this.renderer.setStyle(this.#copyButton, 'padding', '1px');\n this.renderer.setStyle(this.#copyButton, 'border-radius', '3px');\n this.renderer.setStyle(this.#copyButton, 'padding', '5px');\n this.renderer.setStyle(this.#copyButton, 'line-height', '1');\n this.renderer.setStyle(this.#copyButton, 'background-color', 'var(--sd-surface-muted)');\n\n // Add inline SVG icon\n const svg = this.renderer.createElement('svg', 'svg');\n this.renderer.addClass(svg, 'text-secondary');\n this.renderer.setAttribute(svg, 'width', '14');\n this.renderer.setAttribute(svg, 'height', '14');\n this.renderer.setAttribute(svg, 'viewBox', '0 0 24 24');\n this.renderer.setAttribute(svg, 'fill', 'none');\n this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');\n\n const path = this.renderer.createElement('path', 'svg');\n this.renderer.setAttribute(\n path,\n 'd',\n 'M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM20 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H20C21.1 23 22 22.1 22 21V7C22 5.9 21.1 5 20 5ZM20 21H8V7H20V21Z'\n );\n this.renderer.setAttribute(path, 'fill', 'currentColor');\n this.renderer.appendChild(svg, path);\n this.renderer.appendChild(this.#copyButton, svg);\n\n // Tooltip\n this.#tooltip = this.renderer.createElement('span');\n this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);\n this.renderer.setStyle(this.#tooltip, 'position', 'absolute');\n this.renderer.setStyle(this.#tooltip, 'bottom', '100%');\n this.renderer.setStyle(this.#tooltip, 'left', '50%');\n this.renderer.setStyle(this.#tooltip, 'transform', 'translateX(-50%)');\n this.renderer.setStyle(this.#tooltip, 'marginBottom', '4px');\n this.renderer.setStyle(this.#tooltip, 'background', '#333');\n this.renderer.setStyle(this.#tooltip, 'color', '#fff');\n this.renderer.setStyle(this.#tooltip, 'padding', '2px 6px');\n this.renderer.setStyle(this.#tooltip, 'borderRadius', '4px');\n this.renderer.setStyle(this.#tooltip, 'fontSize', '12px');\n this.renderer.setStyle(this.#tooltip, 'whiteSpace', 'nowrap');\n this.renderer.setStyle(this.#tooltip, 'opacity', '0');\n this.renderer.setStyle(this.#tooltip, 'transition', 'opacity 0.2s');\n this.renderer.setStyle(this.#tooltip, 'pointerEvents', 'none');\n this.renderer.setStyle(this.#tooltip, 'userSelect', 'none');\n\n this.renderer.appendChild(this.#copyButton, this.#tooltip);\n this.renderer.appendChild(parent, this.#copyButton);\n\n // Listen click\n this.renderer.listen(this.#copyButton, 'click', () => {\n const copyText = this.copyText();\n if (copyText && !this.sdHoverCopyDisabled()) {\n BrowserUtilities.copyToClipboard(String(copyText));\n this.#showTooltip(this.#copiedTooltip);\n this.#clearHideTooltipTimer();\n this.#hideTooltipTimer = setTimeout(() => {\n this.#hideTooltipTimer = null;\n this.#hideTooltip();\n }, 1000);\n }\n });\n }\n\n #clearHideTooltipTimer(): void {\n if (this.#hideTooltipTimer === null) return;\n clearTimeout(this.#hideTooltipTimer);\n this.#hideTooltipTimer = null;\n }\n\n #removeCopyButton(): void {\n // why: tooltip nằm trong button — bỏ button mà để timer chạy tiếp là ghi style lên node đã gỡ.\n this.#clearHideTooltipTimer();\n if (this.#copyButton) {\n this.renderer.removeChild(this.el.nativeElement, this.#copyButton);\n this.#copyButton = null;\n }\n }\n\n #showTooltip(message: string) {\n this.renderer.setProperty(this.#tooltip, 'innerText', message);\n this.renderer.setStyle(this.#tooltip, 'opacity', '1');\n }\n\n #hideTooltip() {\n this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);\n this.renderer.setStyle(this.#tooltip, 'opacity', '0');\n }\n\n @HostListener('mouseenter')\n onMouseEnter() {\n if (!this.sdHoverCopyDisabled() && this.#copyButton) {\n this.renderer.setStyle(this.#copyButton, 'display', 'block');\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave() {\n if (this.#copyButton) {\n this.renderer.setStyle(this.#copyButton, 'display', 'none');\n this.#hideTooltip();\n }\n }\n}\n","import { Directive, HostBinding, HostListener, inject, input } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { sdIsExternalHttpUrl, sdOpenExternal } from '@sdcorejs/angular/utilities';\n\n@Directive({\n selector: 'a[sdHref]',\n standalone: true,\n})\nexport class SdHrefDirective {\n readonly #router = inject(Router);\n // Nhận vào url đã được xử lý (từ Pipe của bạn)\n readonly url = input.required<string>({ alias: 'sdHref' });\n // Tự động bind giá trị url vào thuộc tính href của thẻ <a>\n // why: fallback cũ là `'javascript:;'` — Angular URL sanitizer chặn giá trị này và log cảnh báo\n // \"sanitizing unsafe URL value\" mỗi lần render. Nhưng bỏ hẳn attribute (`null`) cũng sai: một\n // `<a>` KHÔNG có `href` thì không Tab tới được và không kích hoạt được bằng Enter, trong khi\n // click handler vẫn gắn — chỉ chuột dùng được. `'#'` giữ nguyên ngữ nghĩa link (focusable +\n // Enter) mà sanitizer không đụng tới; `onClick` chặn hành vi mặc định nên không nhảy fragment.\n @HostBinding('attr.href') get href(): string {\n return this.url() || '#';\n }\n\n @HostListener('click', ['$event'])\n onClick(event: Event) {\n const url = this.url();\n if (!url) {\n // why: href fallback là `'#'`. Không chặn thì trình duyệt nhảy tới fragment rỗng và ghi thêm\n // một entry vào history mỗi lần bấm.\n event.preventDefault();\n return;\n }\n // why: điều kiện cũ `url.startsWith('http')` nhận cả `'httpfoo'`, và `window.open(url, '_blank')`\n // thiếu `noopener` nên trang mở ra giữ được `window.opener` (reverse tabnabbing).\n // `sdOpenExternal` chỉ mở khi parse ra scheme http:/https: và luôn truyền `noopener,noreferrer`.\n if (sdIsExternalHttpUrl(url)) {\n // Nếu là link ngoài -> Mở tab mới và ngăn chặn hành vi mặc định của thẻ a (để không chuyển trang hiện tại)\n sdOpenExternal(url);\n event.preventDefault();\n } else {\n // Nếu là link nội bộ -> Ngăn chặn full-page reload, dùng Angular Router để điều hướng\n event.preventDefault();\n const [path, queryString] = url.split('?');\n // Bạn có thể dùng hàm SdUtilities.parseQueryParams của bạn ở đây,\n // hoặc dùng cách native URLSearchParams như sau:\n const params = new URLSearchParams(queryString || '');\n const queryParams: Record<string, string> = {};\n params.forEach((value, key) => (queryParams[key] = value));\n this.#router.navigate([path], { queryParams });\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n HostListener,\n TemplateRef,\n ViewContainerRef,\n inject,\n input,\n DestroyRef,\n ComponentRef,\n Component,\n ChangeDetectorRef,\n computed,\n} from '@angular/core';\nimport { Overlay, OverlayRef, ConnectionPositionPair } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { NgTemplateOutlet } from '@angular/common';\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\n// Component dùng để instance cho overlay\n@Component({\n selector: 'sd-tooltip-container',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <div class=\"c-sd-tooltip-container\" [style.background-color]=\"color()\">\n @if (isTemplate()) {\n <ng-container [ngTemplateOutlet]=\"templateContent()\"></ng-container>\n } @else {\n <span class=\"c-sd-tooltip-text\">{{ textContent() }}</span>\n }\n </div>\n `,\n styles: [\n `\n .c-sd-tooltip-container {\n padding: 6px 8px;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n font-family: Roboto, 'Helvetica Neue', sans-serif;\n box-shadow:\n 0 2px 4px -1px #0003,\n 0 4px 5px #00000024,\n 0 1px 10px #0000001f;\n max-width: 250px;\n word-wrap: break-word;\n pointer-events: auto;\n user-select: text;\n }\n `,\n ],\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n },\n})\nclass SdTooltipComponent {\n private cdr = inject(ChangeDetectorRef);\n\n content = input.required<string | TemplateRef<any>>();\n color = input<string>('#616161');\n\n isTemplate = computed(() => this.content() instanceof TemplateRef);\n templateContent = computed(() => (this.isTemplate() ? (this.content() as TemplateRef<any>) : null));\n textContent = computed(() => (!this.isTemplate() ? (this.content() as string) : ''));\n onMouseEnterCb?: () => void;\n onMouseLeaveCb?: () => void;\n\n onMouseEnter() {\n this.onMouseEnterCb?.();\n }\n\n onMouseLeave() {\n this.onMouseLeaveCb?.();\n }\n\n triggerChangeDetection() {\n this.cdr.detectChanges();\n }\n}\n// End\n\n// Directive\n@Directive({\n selector: '[sdTooltip]',\n standalone: true,\n})\nexport class SdTooltipDirective {\n content = input.required<string | TemplateRef<any>>({ alias: 'sdTooltip' });\n sdTooltipPosition = input<TooltipPosition>('bottom');\n sdTooltipDelay = input<number>(100);\n sdTooltipColor = input<string>('#616161');\n\n private static activeTooltip: SdTooltipDirective | null = null;\n\n private readonly elementRef = inject(ElementRef);\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private overlayRef: OverlayRef | null = null;\n private tooltipComponentRef: ComponentRef<SdTooltipComponent> | null = null;\n private tooltipInstance: SdTooltipComponent | null = null;\n\n private showTimeout: ReturnType<typeof setTimeout> | undefined;\n private hideTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.#cleanup();\n });\n }\n\n @HostListener('mouseenter')\n onMouseEnter() {\n if (SdTooltipDirective.activeTooltip && SdTooltipDirective.activeTooltip !== this) {\n SdTooltipDirective.activeTooltip.forceHide();\n }\n SdTooltipDirective.activeTooltip = this;\n\n this.#clearTimeouts();\n this.showTimeout = setTimeout(() => {\n this.#show();\n }, this.sdTooltipDelay());\n }\n\n @HostListener('mouseleave')\n onMouseLeave() {\n this.#clearTimeouts();\n this.hideTimeout = setTimeout(() => {\n this.#hide();\n }, 300);\n }\n\n forceHide = (): void => {\n this.#clearTimeouts();\n this.#hide();\n };\n\n #show = (): void => {\n const currentContent = this.content();\n\n if (!currentContent) return;\n\n if (!this.overlayRef) {\n this.#createOverlay();\n }\n\n if (this.overlayRef && !this.overlayRef.hasAttached()) {\n const portal = new ComponentPortal(SdTooltipComponent, this.viewContainerRef);\n this.tooltipComponentRef = this.overlayRef.attach(portal);\n this.tooltipInstance = this.tooltipComponentRef.instance;\n\n this.#setupTooltipInstance();\n }\n\n if (this.tooltipComponentRef && this.tooltipInstance) {\n this.tooltipComponentRef.setInput('content', currentContent);\n this.tooltipComponentRef.setInput('color', this.sdTooltipColor());\n this.tooltipInstance.triggerChangeDetection();\n }\n };\n\n #hide = (): void => {\n if (this.tooltipInstance && this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n this.tooltipInstance = null;\n this.tooltipComponentRef = null;\n }\n };\n\n #createOverlay = (): void => {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(this.#getPositions())\n .withViewportMargin(8)\n .withPush(false);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.close(),\n panelClass: 'c-sd-tooltip-panel',\n });\n };\n\n #setupTooltipInstance = (): void => {\n if (!this.tooltipInstance) return;\n\n this.tooltipInstance.onMouseEnterCb = () => {\n clearTimeout(this.hideTimeout);\n };\n\n this.tooltipInstance.onMouseLeaveCb = () => {\n this.hideTimeout = setTimeout(() => {\n this.#hide();\n }, 200);\n };\n };\n\n #clearTimeouts = (): void => {\n clearTimeout(this.showTimeout);\n clearTimeout(this.hideTimeout);\n };\n\n #cleanup = (): void => {\n this.#clearTimeouts();\n\n if (SdTooltipDirective.activeTooltip === this) {\n SdTooltipDirective.activeTooltip = null;\n }\n\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n\n // Xóa mọi tham chiếu\n this.tooltipInstance = null;\n this.tooltipComponentRef = null;\n };\n\n #getPositions = (): ConnectionPositionPair[] => {\n const offset = 8;\n const topPos: ConnectionPositionPair = { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -offset };\n const bottomPos: ConnectionPositionPair = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n };\n const leftPos: ConnectionPositionPair = { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -offset };\n const rightPos: ConnectionPositionPair = { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: offset };\n\n switch (this.sdTooltipPosition()) {\n case 'top':\n return [topPos, bottomPos, rightPos, leftPos];\n case 'bottom':\n return [bottomPos, topPos, rightPos, leftPos];\n case 'left':\n return [leftPos, rightPos, topPos, bottomPos];\n case 'right':\n return [rightPos, leftPos, topPos, bottomPos];\n default:\n return [bottomPos, topPos];\n }\n };\n}\n// End\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAMa,iBAAiB,CAAA;AACpB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;IAEpC,UAAU,GAAkC,QAAQ;IACpD,UAAU,GAAkC,MAAM;IAElD,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM;;AAExB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;;IAEtF;IAGA,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,GAAG,QAAQ;AAC1B,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;IACtF;AAIA,IAAA,WAAA,GAAA,EAAe;IAEf,QAA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,EAAA,gBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBA2BE,YAAY;uBAAC,YAAY;;sBAazB,YAAY;uBAAC,YAAY;;;AChI5B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-directives.mjs","sources":["../../../projects/sdcorejs-angular/directives/src/sd-scroll.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-desktop.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-mobile.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-hover-copy.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-href.directive.ts","../../../projects/sdcorejs-angular/directives/src/sd-tooltip.directive.ts","../../../projects/sdcorejs-angular/directives/sdcorejs-angular-directives.ts"],"sourcesContent":["import { Directive, ElementRef, HostListener, OnInit, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[sdScroll]',\n standalone: true,\n})\nexport class SdScrollDirective implements OnInit {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n #overflowX: 'hidden' | 'auto' | 'overlay' = 'hidden';\n #overflowY: 'hidden' | 'auto' | 'overlay' = 'auto';\n @HostListener('mouseover')\n onMouseOver() {\n this.#overflowX = 'auto';\n // this.#overflowY = 'auto';\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n // this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-y', this.#overflowY);\n }\n\n @HostListener('mouseout')\n onMouseOut() {\n this.#overflowX = 'hidden';\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n }\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n constructor() {}\n\n ngOnInit(): void {\n this.renderer.setStyle(this.elementRef.nativeElement, '-webkit-transform', 'translate3d(0, 0, 0)');\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-x', this.#overflowX);\n this.renderer.setStyle(this.elementRef.nativeElement, 'overflow-y', this.#overflowY);\n }\n\n scrollTop = () => {\n setTimeout(() => {\n if (this.elementRef?.nativeElement) {\n this.elementRef.nativeElement.scrollTop = 0;\n }\n }, 1);\n };\n}\n","import { Directive, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\n\n@Directive({\n selector: '[sdDesktop]',\n standalone: true,\n})\nexport class SdDesktopDirective {\n readonly #templateRef: TemplateRef<Record<string, never>> = inject(TemplateRef);\n readonly #viewContainerRef = inject(ViewContainerRef);\n\n constructor() {\n if (!BrowserUtilities.isMobile()) {\n this.#viewContainerRef.createEmbeddedView(this.#templateRef);\n }\n }\n}\n","import { Directive, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\n\n@Directive({\n selector: '[sdMobile]',\n standalone: true,\n})\nexport class SdMobileDirective {\n readonly #templateRef: TemplateRef<Record<string, never>> = inject(TemplateRef);\n readonly #viewContainerRef = inject(ViewContainerRef);\n\n constructor() {\n if (BrowserUtilities.isMobile()) {\n this.#viewContainerRef.createEmbeddedView(this.#templateRef);\n }\n }\n}\n","import { DestroyRef, Directive, ElementRef, inject, Renderer2, HostListener, OnInit, OnChanges, SimpleChanges, input } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { DomPortal } from '@angular/cdk/portal';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { I18nService } from '@sdcorejs/angular/i18n';\n\n@Directive({\n selector: '[sdHoverCopy]',\n})\nexport class SdHoverCopyDirective implements OnInit, OnChanges {\n private el = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n readonly copyText = input.required<string>({ alias: 'sdHoverCopy' });\n readonly sdHoverCopyDisabled = input(false);\n\n readonly #i18n = inject(I18nService);\n readonly #destroyRef = inject(DestroyRef);\n readonly #overlay = inject(Overlay);\n readonly #document = inject(DOCUMENT);\n\n #copyButton: HTMLElement | null = null;\n #tooltip!: HTMLElement;\n #tooltipOverlay: OverlayRef | null = null;\n #unlistenCopy: (() => void) | null = null;\n readonly #onScroll = () => this.#hideTooltip();\n #hideTooltipTimer: ReturnType<typeof setTimeout> | null = null;\n get #defaultTooltip(): string {\n return this.#i18n.t('core.directive.hover-copy.tooltip');\n }\n // why: tooltip mặc định đã đi qua I18nService từ trước, riêng phản hồi sau khi copy vẫn cứng\n // 'Copied' — cùng một tooltip mà hai ngôn ngữ. Đọc lúc hiển thị để bám ngôn ngữ hiện tại.\n get #copiedTooltip(): string {\n return this.#i18n.t('core.directive.hover-copy.copied');\n }\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n // why: timeout 1s ẩn tooltip trước đây không được lưu lại cũng không huỷ, mà directive lại\n // không có teardown nào. Host bị destroy trong vòng 1s đó thì callback vẫn chạy và ghi style\n // lên node đã tháo khỏi DOM (timer sống lâu hơn view).\n this.#destroyRef.onDestroy(() => this.#removeCopyButton());\n }\n\n // https://onemount.atlassian.net/browse/SM-2287\n // Hiện tại khi sdHoverCopyDisabled = true, directive chỉ dùng opacity: 0 và pointerEvents: 'none' để ẩn nút, nhưng điều này không hoàn toàn ngăn chặn được việc click trong một số trường hợp.\n // Giải pháp: Remove khỏi DOM nếu column không được enable\n ngOnInit(): void {\n if (!this.sdHoverCopyDisabled()) {\n this.#createAndAppendCopyButton();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['sdHoverCopyDisabled']) {\n if (!this.sdHoverCopyDisabled()) {\n // Enable - create and show button if not exists\n if (!this.#copyButton) {\n this.#createAndAppendCopyButton();\n }\n } else {\n // Disable - remove button from DOM\n this.#removeCopyButton();\n }\n }\n }\n\n #createAndAppendCopyButton(): void {\n // why: ngOnChanges có thể tạo nút trước ngOnInit; chỉ giữ một nút và một overlay owner.\n if (this.#copyButton) return;\n const parent = this.el.nativeElement;\n this.renderer.setStyle(parent, 'position', 'relative');\n\n // Create button\n this.#copyButton = this.renderer.createElement('button');\n this.renderer.setStyle(this.#copyButton, 'position', 'absolute');\n this.renderer.setStyle(this.#copyButton, 'top', '50%');\n this.renderer.setStyle(this.#copyButton, 'transform', 'translateY(-50%)');\n this.renderer.setStyle(this.#copyButton, 'right', '4px');\n this.renderer.setStyle(this.#copyButton, 'display', 'none');\n this.renderer.setStyle(this.#copyButton, 'z-index', '10');\n this.renderer.setStyle(this.#copyButton, 'background', 'transparent');\n this.renderer.setStyle(this.#copyButton, 'border', 'none');\n this.renderer.setStyle(this.#copyButton, 'cursor', 'pointer');\n this.renderer.setStyle(this.#copyButton, 'padding', '1px');\n this.renderer.setStyle(this.#copyButton, 'border-radius', '3px');\n this.renderer.setStyle(this.#copyButton, 'padding', '5px');\n this.renderer.setStyle(this.#copyButton, 'line-height', '1');\n this.renderer.setStyle(this.#copyButton, 'background-color', 'var(--sd-surface-muted)');\n\n // Add inline SVG icon\n const svg = this.renderer.createElement('svg', 'svg');\n this.renderer.addClass(svg, 'text-secondary');\n this.renderer.setAttribute(svg, 'width', '14');\n this.renderer.setAttribute(svg, 'height', '14');\n this.renderer.setAttribute(svg, 'viewBox', '0 0 24 24');\n this.renderer.setAttribute(svg, 'fill', 'none');\n this.renderer.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');\n\n const path = this.renderer.createElement('path', 'svg');\n this.renderer.setAttribute(\n path,\n 'd',\n 'M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM20 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H20C21.1 23 22 22.1 22 21V7C22 5.9 21.1 5 20 5ZM20 21H8V7H20V21Z'\n );\n this.renderer.setAttribute(path, 'fill', 'currentColor');\n this.renderer.appendChild(svg, path);\n this.renderer.appendChild(this.#copyButton, svg);\n\n // Tooltip\n this.#tooltip = this.renderer.createElement('span');\n this.renderer.setAttribute(this.#tooltip, 'role', 'tooltip');\n this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);\n this.renderer.setStyle(this.#tooltip, 'display', 'none');\n this.renderer.setStyle(this.#tooltip, 'background', '#333');\n this.renderer.setStyle(this.#tooltip, 'color', '#fff');\n this.renderer.setStyle(this.#tooltip, 'padding', '2px 6px');\n this.renderer.setStyle(this.#tooltip, 'borderRadius', '4px');\n this.renderer.setStyle(this.#tooltip, 'fontSize', '12px');\n this.renderer.setStyle(this.#tooltip, 'whiteSpace', 'nowrap');\n this.renderer.setStyle(this.#tooltip, 'opacity', '0');\n this.renderer.setStyle(this.#tooltip, 'transition', 'opacity 0.2s');\n this.renderer.setStyle(this.#tooltip, 'pointerEvents', 'none');\n this.renderer.setStyle(this.#tooltip, 'userSelect', 'none');\n\n this.renderer.appendChild(this.#copyButton, this.#tooltip);\n this.renderer.appendChild(parent, this.#copyButton);\n\n // Listen click\n this.#unlistenCopy = this.renderer.listen(this.#copyButton, 'click', () => {\n const copyText = this.copyText();\n if (copyText && !this.sdHoverCopyDisabled()) {\n BrowserUtilities.copyToClipboard(String(copyText));\n this.#showTooltip(this.#copiedTooltip);\n this.#clearHideTooltipTimer();\n this.#hideTooltipTimer = setTimeout(() => {\n this.#hideTooltipTimer = null;\n this.#hideTooltip();\n }, 1000);\n }\n });\n }\n\n #clearHideTooltipTimer(): void {\n if (this.#hideTooltipTimer === null) return;\n clearTimeout(this.#hideTooltipTimer);\n this.#hideTooltipTimer = null;\n }\n\n #removeCopyButton(): void {\n this.#clearHideTooltipTimer();\n this.#document.removeEventListener('scroll', this.#onScroll, true);\n this.#tooltipOverlay?.dispose();\n this.#tooltipOverlay = null;\n this.#unlistenCopy?.();\n this.#unlistenCopy = null;\n if (this.#copyButton) {\n this.renderer.removeChild(this.el.nativeElement, this.#copyButton);\n this.#copyButton = null;\n }\n }\n\n #showTooltip(message: string) {\n if (!this.#copyButton) return;\n if (!this.#tooltipOverlay) {\n // why: portal thoát khỏi overflow/stacking context của table cell và modal body.\n this.#tooltipOverlay = this.#overlay.create({\n positionStrategy: this.#overlay\n .position()\n .flexibleConnectedTo(this.#copyButton)\n .withPositions([\n { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 },\n { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 },\n ])\n .withFlexibleDimensions(false)\n .withViewportMargin(8)\n .withPush(true),\n });\n }\n this.renderer.setProperty(this.#tooltip, 'innerText', message);\n this.renderer.setStyle(this.#tooltip, 'display', 'block');\n this.renderer.setStyle(this.#tooltip, 'opacity', '1');\n if (!this.#tooltipOverlay.hasAttached()) {\n this.#tooltipOverlay.attach(new DomPortal(this.#tooltip));\n }\n this.renderer.setStyle(this.#tooltipOverlay.overlayElement, 'pointerEvents', 'none');\n this.#tooltipOverlay.updatePosition();\n // why: capture bắt cả scroll ở ancestor không khai cdkScrollable, tránh tooltip trôi khỏi cell.\n this.#document.addEventListener('scroll', this.#onScroll, true);\n }\n\n #hideTooltip() {\n this.#clearHideTooltipTimer();\n this.#document.removeEventListener('scroll', this.#onScroll, true);\n this.#tooltipOverlay?.detach();\n this.renderer.setProperty(this.#tooltip, 'innerText', this.#defaultTooltip);\n this.renderer.setStyle(this.#tooltip, 'opacity', '0');\n this.renderer.setStyle(this.#tooltip, 'display', 'none');\n }\n\n @HostListener('mouseenter')\n onMouseEnter() {\n if (!this.sdHoverCopyDisabled() && this.#copyButton) {\n this.renderer.setStyle(this.#copyButton, 'display', 'block');\n }\n }\n\n @HostListener('mouseleave')\n onMouseLeave() {\n if (this.#copyButton) {\n this.renderer.setStyle(this.#copyButton, 'display', 'none');\n this.#hideTooltip();\n }\n }\n}\n","import { Directive, HostBinding, HostListener, inject, input } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { sdIsExternalHttpUrl, sdOpenExternal } from '@sdcorejs/angular/utilities';\n\n@Directive({\n selector: 'a[sdHref]',\n standalone: true,\n})\nexport class SdHrefDirective {\n readonly #router = inject(Router);\n // Nhận vào url đã được xử lý (từ Pipe của bạn)\n readonly url = input.required<string>({ alias: 'sdHref' });\n // Tự động bind giá trị url vào thuộc tính href của thẻ <a>\n // why: fallback cũ là `'javascript:;'` — Angular URL sanitizer chặn giá trị này và log cảnh báo\n // \"sanitizing unsafe URL value\" mỗi lần render. Nhưng bỏ hẳn attribute (`null`) cũng sai: một\n // `<a>` KHÔNG có `href` thì không Tab tới được và không kích hoạt được bằng Enter, trong khi\n // click handler vẫn gắn — chỉ chuột dùng được. `'#'` giữ nguyên ngữ nghĩa link (focusable +\n // Enter) mà sanitizer không đụng tới; `onClick` chặn hành vi mặc định nên không nhảy fragment.\n @HostBinding('attr.href') get href(): string {\n return this.url() || '#';\n }\n\n @HostListener('click', ['$event'])\n onClick(event: Event) {\n const url = this.url();\n if (!url) {\n // why: href fallback là `'#'`. Không chặn thì trình duyệt nhảy tới fragment rỗng và ghi thêm\n // một entry vào history mỗi lần bấm.\n event.preventDefault();\n return;\n }\n // why: điều kiện cũ `url.startsWith('http')` nhận cả `'httpfoo'`, và `window.open(url, '_blank')`\n // thiếu `noopener` nên trang mở ra giữ được `window.opener` (reverse tabnabbing).\n // `sdOpenExternal` chỉ mở khi parse ra scheme http:/https: và luôn truyền `noopener,noreferrer`.\n if (sdIsExternalHttpUrl(url)) {\n // Nếu là link ngoài -> Mở tab mới và ngăn chặn hành vi mặc định của thẻ a (để không chuyển trang hiện tại)\n sdOpenExternal(url);\n event.preventDefault();\n } else {\n // Nếu là link nội bộ -> Ngăn chặn full-page reload, dùng Angular Router để điều hướng\n event.preventDefault();\n const [path, queryString] = url.split('?');\n // Bạn có thể dùng hàm SdUtilities.parseQueryParams của bạn ở đây,\n // hoặc dùng cách native URLSearchParams như sau:\n const params = new URLSearchParams(queryString || '');\n const queryParams: Record<string, string> = {};\n params.forEach((value, key) => (queryParams[key] = value));\n this.#router.navigate([path], { queryParams });\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n HostListener,\n TemplateRef,\n ViewContainerRef,\n inject,\n input,\n DestroyRef,\n ComponentRef,\n Component,\n ChangeDetectorRef,\n computed,\n} from '@angular/core';\nimport { Overlay, OverlayRef, ConnectionPositionPair } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { NgTemplateOutlet } from '@angular/common';\n\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\n// Component dùng để instance cho overlay\n@Component({\n selector: 'sd-tooltip-container',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <div class=\"c-sd-tooltip-container\" [style.background-color]=\"color()\">\n @if (isTemplate()) {\n <ng-container [ngTemplateOutlet]=\"templateContent()\"></ng-container>\n } @else {\n <span class=\"c-sd-tooltip-text\">{{ textContent() }}</span>\n }\n </div>\n `,\n styles: [\n `\n .c-sd-tooltip-container {\n padding: 6px 8px;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n font-family: Roboto, 'Helvetica Neue', sans-serif;\n box-shadow:\n 0 2px 4px -1px #0003,\n 0 4px 5px #00000024,\n 0 1px 10px #0000001f;\n max-width: 250px;\n word-wrap: break-word;\n pointer-events: auto;\n user-select: text;\n }\n `,\n ],\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n },\n})\nclass SdTooltipComponent {\n private cdr = inject(ChangeDetectorRef);\n\n content = input.required<string | TemplateRef<any>>();\n color = input<string>('#616161');\n\n isTemplate = computed(() => this.content() instanceof TemplateRef);\n templateContent = computed(() => (this.isTemplate() ? (this.content() as TemplateRef<any>) : null));\n textContent = computed(() => (!this.isTemplate() ? (this.content() as string) : ''));\n onMouseEnterCb?: () => void;\n onMouseLeaveCb?: () => void;\n\n onMouseEnter() {\n this.onMouseEnterCb?.();\n }\n\n onMouseLeave() {\n this.onMouseLeaveCb?.();\n }\n\n triggerChangeDetection() {\n this.cdr.detectChanges();\n }\n}\n// End\n\n// Directive\n@Directive({\n selector: '[sdTooltip]',\n standalone: true,\n})\nexport class SdTooltipDirective {\n content = input.required<string | TemplateRef<any>>({ alias: 'sdTooltip' });\n sdTooltipPosition = input<TooltipPosition>('bottom');\n sdTooltipDelay = input<number>(100);\n sdTooltipColor = input<string>('#616161');\n\n private static activeTooltip: SdTooltipDirective | null = null;\n\n private readonly elementRef = inject(ElementRef);\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private overlayRef: OverlayRef | null = null;\n private tooltipComponentRef: ComponentRef<SdTooltipComponent> | null = null;\n private tooltipInstance: SdTooltipComponent | null = null;\n\n private showTimeout: ReturnType<typeof setTimeout> | undefined;\n private hideTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.#cleanup();\n });\n }\n\n @HostListener('mouseenter')\n onMouseEnter() {\n if (SdTooltipDirective.activeTooltip && SdTooltipDirective.activeTooltip !== this) {\n SdTooltipDirective.activeTooltip.forceHide();\n }\n SdTooltipDirective.activeTooltip = this;\n\n this.#clearTimeouts();\n this.showTimeout = setTimeout(() => {\n this.#show();\n }, this.sdTooltipDelay());\n }\n\n @HostListener('mouseleave')\n onMouseLeave() {\n this.#clearTimeouts();\n this.hideTimeout = setTimeout(() => {\n this.#hide();\n }, 300);\n }\n\n forceHide = (): void => {\n this.#clearTimeouts();\n this.#hide();\n };\n\n #show = (): void => {\n const currentContent = this.content();\n\n if (!currentContent) return;\n\n if (!this.overlayRef) {\n this.#createOverlay();\n }\n\n if (this.overlayRef && !this.overlayRef.hasAttached()) {\n const portal = new ComponentPortal(SdTooltipComponent, this.viewContainerRef);\n this.tooltipComponentRef = this.overlayRef.attach(portal);\n this.tooltipInstance = this.tooltipComponentRef.instance;\n\n this.#setupTooltipInstance();\n }\n\n if (this.tooltipComponentRef && this.tooltipInstance) {\n this.tooltipComponentRef.setInput('content', currentContent);\n this.tooltipComponentRef.setInput('color', this.sdTooltipColor());\n this.tooltipInstance.triggerChangeDetection();\n }\n };\n\n #hide = (): void => {\n if (this.tooltipInstance && this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n this.tooltipInstance = null;\n this.tooltipComponentRef = null;\n }\n };\n\n #createOverlay = (): void => {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(this.#getPositions())\n .withViewportMargin(8)\n .withPush(false);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.close(),\n panelClass: 'c-sd-tooltip-panel',\n });\n };\n\n #setupTooltipInstance = (): void => {\n if (!this.tooltipInstance) return;\n\n this.tooltipInstance.onMouseEnterCb = () => {\n clearTimeout(this.hideTimeout);\n };\n\n this.tooltipInstance.onMouseLeaveCb = () => {\n this.hideTimeout = setTimeout(() => {\n this.#hide();\n }, 200);\n };\n };\n\n #clearTimeouts = (): void => {\n clearTimeout(this.showTimeout);\n clearTimeout(this.hideTimeout);\n };\n\n #cleanup = (): void => {\n this.#clearTimeouts();\n\n if (SdTooltipDirective.activeTooltip === this) {\n SdTooltipDirective.activeTooltip = null;\n }\n\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n\n // Xóa mọi tham chiếu\n this.tooltipInstance = null;\n this.tooltipComponentRef = null;\n };\n\n #getPositions = (): ConnectionPositionPair[] => {\n const offset = 8;\n const topPos: ConnectionPositionPair = { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -offset };\n const bottomPos: ConnectionPositionPair = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n };\n const leftPos: ConnectionPositionPair = { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -offset };\n const rightPos: ConnectionPositionPair = { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: offset };\n\n switch (this.sdTooltipPosition()) {\n case 'top':\n return [topPos, bottomPos, rightPos, leftPos];\n case 'bottom':\n return [bottomPos, topPos, rightPos, leftPos];\n case 'left':\n return [leftPos, rightPos, topPos, bottomPos];\n case 'right':\n return [rightPos, leftPos, topPos, bottomPos];\n default:\n return [bottomPos, topPos];\n }\n };\n}\n// End\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAMa,iBAAiB,CAAA;AACpB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;IAEpC,UAAU,GAAkC,QAAQ;IACpD,UAAU,GAAkC,MAAM;IAElD,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM;;AAExB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;;IAEtF;IAGA,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,UAAU,GAAG,QAAQ;AAC1B,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;IACtF;AAIA,IAAA,WAAA,GAAA,EAAe;IAEf,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,mBAAmB,EAAE,sBAAsB,CAAC;AAClG,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;AACpF,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,YAA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EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBA2BE,YAAY;uBAAC,YAAY;;sBAazB,YAAY;uBAAC,YAAY;;;AChI5B;;AAEG;;;;"}
|
|
@@ -33,6 +33,7 @@ class SdSwitch {
|
|
|
33
33
|
label = input(undefined, ...(ngDevMode ? [{ debugName: "label", transform: (v) => v ?? undefined }] : [{
|
|
34
34
|
transform: (v) => v ?? undefined,
|
|
35
35
|
}]));
|
|
36
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
36
37
|
// why: legacy callers pass `null` to mean "fallback to primary" — keep that contract
|
|
37
38
|
color = input('primary', ...(ngDevMode ? [{ debugName: "color", transform: (v) => v || 'primary' }] : [{
|
|
38
39
|
transform: (v) => v || 'primary',
|
|
@@ -92,11 +93,12 @@ class SdSwitch {
|
|
|
92
93
|
this.#subscription.unsubscribe();
|
|
93
94
|
}
|
|
94
95
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
95
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSwitch, isStandalone: true, selector: "sd-switch", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { properties: { "class.sd-c-primary": "color() === 'primary'", "class.sd-c-secondary": "color() === 'secondary'", "class.sd-c-info": "color() === 'info'", "class.sd-c-success": "color() === 'success'", "class.sd-c-warning": "color() === 'warning'", "class.sd-c-error": "color() === 'error'" } }, ngImport: i0, template: "@if (isViewed()) {\n @if (label()) {\n <div class=\"T14R text-secondary\">{{ label() }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.switch.on' : 'core.form.switch.off') | sdTranslate }}</div>\n} @else {\n <mat-slide-toggle\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n <sd-label [label]=\"label()\" [required]=\"required()\"></sd-label>\n </mat-slide-toggle>\n @let _errorMessage = visibleErrorMessage();\n @if (_errorMessage) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n}\n", styles: [":host ::ng-deep label{margin-bottom:0!important}:host{--sd-c: var(--sd-primary);--sd-switch-handle: var(--sd-surface, #fff);--sd-switch-track-off: var(--sd-surface-muted, #e7e8ed);--sd-switch-track-off-hover: var(--sd-border, #c4c6d0);--sd-switch-handle-off: var(--sd-text-secondary, #44474f)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-slide-toggle,:host ::ng-deep .mdc-switch{--mdc-switch-selected-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-focus-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-hover-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-icon-color: var(--sd-c) !important;--mdc-switch-selected-focus-icon-color: var(--sd-c) !important;--mdc-switch-selected-hover-icon-color: var(--sd-c) !important;--mdc-switch-selected-pressed-icon-color: var(--sd-c) !important;--mdc-switch-selected-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-track-color: var(--sd-c) !important;--mdc-switch-selected-hover-track-color: var(--sd-c) !important;--mdc-switch-selected-pressed-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-hover-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-pressed-state-layer-color: var(--sd-c) !important;--mdc-switch-unselected-track-color: var(--sd-switch-track-off) !important;--mdc-switch-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-selected-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-focus-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-hover-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-unselected-track-color: var(--sd-switch-track-off) !important;--mat-slide-toggle-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-track-outline-color: transparent !important;--mat-slide-toggle-selected-track-outline-color: transparent !important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSwitch, isStandalone: true, selector: "sd-switch", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { properties: { "attr.data-size": "size()", "class.sd-c-primary": "color() === 'primary'", "class.sd-c-secondary": "color() === 'secondary'", "class.sd-c-info": "color() === 'info'", "class.sd-c-success": "color() === 'success'", "class.sd-c-warning": "color() === 'warning'", "class.sd-c-error": "color() === 'error'" } }, ngImport: i0, template: "@let _label = label();\n@if (isViewed()) {\n @if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.switch.on' : 'core.form.switch.off') | sdTranslate }}</div>\n} @else {\n <mat-slide-toggle\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n <sd-label [label]=\"_label\" [required]=\"required()\"></sd-label>\n </mat-slide-toggle>\n @let _errorMessage = visibleErrorMessage();\n @if (_errorMessage) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n}\n", styles: [":host{--sd-switch-width: 52px;--sd-switch-height: 32px;--sd-switch-handle-size: 24px;--sd-switch-off-handle-size: 16px;--sd-switch-pressed-size: 28px;--sd-switch-icon-size: 16px;--sd-switch-state-layer-size: 40px;--sd-switch-selected-margin: 0 24px;--sd-switch-unselected-margin: 0 8px;--sd-switch-unselected-icon-margin: 0 4px;--sd-switch-selected-pressed-margin: 0 22px;--sd-switch-unselected-pressed-margin: 0 2px}:host([data-size=lg]){--sd-switch-width: 60px;--sd-switch-height: 36px;--sd-switch-handle-size: 28px;--sd-switch-off-handle-size: 20px;--sd-switch-pressed-size: 32px;--sd-switch-icon-size: 20px;--sd-switch-state-layer-size: 44px;--sd-switch-selected-margin: 0 28px;--sd-switch-unselected-margin: 0 8px;--sd-switch-unselected-icon-margin: 0 4px;--sd-switch-selected-pressed-margin: 0 26px;--sd-switch-unselected-pressed-margin: 0 2px}:host([data-size=sm]),:host-context(sd-table)[data-size]{--sd-switch-width: 36px;--sd-switch-height: 20px;--sd-switch-handle-size: 16px;--sd-switch-off-handle-size: 12px;--sd-switch-pressed-size: 18px;--sd-switch-icon-size: 12px;--sd-switch-state-layer-size: 28px;--sd-switch-selected-margin: 0 18px;--sd-switch-unselected-margin: 0 4px;--sd-switch-unselected-icon-margin: 0 2px;--sd-switch-selected-pressed-margin: 0 17px;--sd-switch-unselected-pressed-margin: 0 1px}:host ::ng-deep .mat-mdc-slide-toggle,:host ::ng-deep .mdc-switch{--mdc-switch-track-width: var(--sd-switch-width) !important;--mdc-switch-track-height: var(--sd-switch-height) !important;--mdc-switch-track-shape: 999px !important;--mdc-switch-state-layer-size: var(--sd-switch-state-layer-size) !important;--mdc-switch-selected-icon-size: var(--sd-switch-icon-size) !important;--mdc-switch-unselected-icon-size: var(--sd-switch-icon-size) !important;--mat-slide-toggle-track-width: var(--sd-switch-width) !important;--mat-slide-toggle-track-height: var(--sd-switch-height) !important;--mat-slide-toggle-track-shape: 999px !important;--mat-slide-toggle-state-layer-size: var(--sd-switch-state-layer-size) !important;--mat-slide-toggle-selected-icon-size: var(--sd-switch-icon-size) !important;--mat-slide-toggle-unselected-icon-size: var(--sd-switch-icon-size) !important;--mat-switch-selected-handle-size: var(--sd-switch-handle-size) !important;--mat-switch-unselected-handle-size: var(--sd-switch-off-handle-size) !important;--mat-switch-with-icon-handle-size: var(--sd-switch-handle-size) !important;--mat-switch-pressed-handle-size: var(--sd-switch-pressed-size) !important;--mat-switch-selected-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-switch-selected-with-icon-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-switch-unselected-handle-horizontal-margin: var(--sd-switch-unselected-margin) !important;--mat-switch-unselected-with-icon-handle-horizontal-margin: var(--sd-switch-unselected-icon-margin) !important;--mat-switch-selected-pressed-handle-horizontal-margin: var(--sd-switch-selected-pressed-margin) !important;--mat-switch-unselected-pressed-handle-horizontal-margin: var(--sd-switch-unselected-pressed-margin) !important;--mat-slide-toggle-selected-handle-size: var(--sd-switch-handle-size) !important;--mat-slide-toggle-unselected-handle-size: var(--sd-switch-off-handle-size) !important;--mat-slide-toggle-with-icon-handle-size: var(--sd-switch-handle-size) !important;--mat-slide-toggle-pressed-handle-size: var(--sd-switch-pressed-size) !important;--mat-slide-toggle-selected-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-slide-toggle-selected-with-icon-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-slide-toggle-unselected-handle-horizontal-margin: var(--sd-switch-unselected-margin) !important;--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin: var(--sd-switch-unselected-icon-margin) !important;--mat-slide-toggle-selected-pressed-handle-horizontal-margin: var(--sd-switch-selected-pressed-margin) !important;--mat-slide-toggle-unselected-pressed-handle-horizontal-margin: var(--sd-switch-unselected-pressed-margin) !important}:host ::ng-deep .mdc-switch{min-height:max(28px,var(--sd-switch-height))}:host ::ng-deep .mat-mdc-slide-toggle-touch-target{height:max(28px,var(--sd-switch-height))}@media(pointer:coarse){:host ::ng-deep .mdc-switch,:host ::ng-deep .mat-mdc-slide-toggle-touch-target{min-height:44px}}:host ::ng-deep label{margin-bottom:0!important}:host{--sd-c: var(--sd-primary);--sd-switch-handle: var(--sd-surface, #fff);--sd-switch-track-off: var(--sd-surface-muted, #e7e8ed);--sd-switch-track-off-hover: var(--sd-border, #c4c6d0);--sd-switch-handle-off: var(--sd-text-secondary, #44474f)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-slide-toggle,:host ::ng-deep .mdc-switch{--mdc-switch-selected-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-focus-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-hover-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-icon-color: var(--sd-c) !important;--mdc-switch-selected-focus-icon-color: var(--sd-c) !important;--mdc-switch-selected-hover-icon-color: var(--sd-c) !important;--mdc-switch-selected-pressed-icon-color: var(--sd-c) !important;--mdc-switch-selected-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-track-color: var(--sd-c) !important;--mdc-switch-selected-hover-track-color: var(--sd-c) !important;--mdc-switch-selected-pressed-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-hover-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-pressed-state-layer-color: var(--sd-c) !important;--mdc-switch-unselected-track-color: var(--sd-switch-track-off) !important;--mdc-switch-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-selected-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-focus-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-hover-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-unselected-track-color: var(--sd-switch-track-off) !important;--mat-slide-toggle-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-track-outline-color: transparent !important;--mat-slide-toggle-selected-track-outline-color: transparent !important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
96
97
|
}
|
|
97
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSwitch, decorators: [{
|
|
98
99
|
type: Component,
|
|
99
100
|
args: [{ selector: 'sd-switch', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
101
|
+
'[attr.data-size]': 'size()',
|
|
100
102
|
// why: dùng host class .sd-c-<x> (thay vì data-attr) để reactivity host-binding với
|
|
101
103
|
// signal chắc chắn áp dụng + có default fallback `sd-c-primary` khi color() là 'primary'.
|
|
102
104
|
// Test cũ assert data-sd-color đã được thay bằng class assert tương ứng.
|
|
@@ -106,8 +108,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
106
108
|
'[class.sd-c-success]': "color() === 'success'",
|
|
107
109
|
'[class.sd-c-warning]': "color() === 'warning'",
|
|
108
110
|
'[class.sd-c-error]': "color() === 'error'",
|
|
109
|
-
}, imports: [FormsModule, ReactiveFormsModule, MatSlideToggleModule, MatFormFieldModule, SdLabel, SdTranslatePipe], template: "@if (isViewed()) {\n @if (
|
|
110
|
-
}], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
|
|
111
|
+
}, imports: [FormsModule, ReactiveFormsModule, MatSlideToggleModule, MatFormFieldModule, SdLabel, SdTranslatePipe], template: "@let _label = label();\n@if (isViewed()) {\n @if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.switch.on' : 'core.form.switch.off') | sdTranslate }}</div>\n} @else {\n <mat-slide-toggle\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n <sd-label [label]=\"_label\" [required]=\"required()\"></sd-label>\n </mat-slide-toggle>\n @let _errorMessage = visibleErrorMessage();\n @if (_errorMessage) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n}\n", styles: [":host{--sd-switch-width: 52px;--sd-switch-height: 32px;--sd-switch-handle-size: 24px;--sd-switch-off-handle-size: 16px;--sd-switch-pressed-size: 28px;--sd-switch-icon-size: 16px;--sd-switch-state-layer-size: 40px;--sd-switch-selected-margin: 0 24px;--sd-switch-unselected-margin: 0 8px;--sd-switch-unselected-icon-margin: 0 4px;--sd-switch-selected-pressed-margin: 0 22px;--sd-switch-unselected-pressed-margin: 0 2px}:host([data-size=lg]){--sd-switch-width: 60px;--sd-switch-height: 36px;--sd-switch-handle-size: 28px;--sd-switch-off-handle-size: 20px;--sd-switch-pressed-size: 32px;--sd-switch-icon-size: 20px;--sd-switch-state-layer-size: 44px;--sd-switch-selected-margin: 0 28px;--sd-switch-unselected-margin: 0 8px;--sd-switch-unselected-icon-margin: 0 4px;--sd-switch-selected-pressed-margin: 0 26px;--sd-switch-unselected-pressed-margin: 0 2px}:host([data-size=sm]),:host-context(sd-table)[data-size]{--sd-switch-width: 36px;--sd-switch-height: 20px;--sd-switch-handle-size: 16px;--sd-switch-off-handle-size: 12px;--sd-switch-pressed-size: 18px;--sd-switch-icon-size: 12px;--sd-switch-state-layer-size: 28px;--sd-switch-selected-margin: 0 18px;--sd-switch-unselected-margin: 0 4px;--sd-switch-unselected-icon-margin: 0 2px;--sd-switch-selected-pressed-margin: 0 17px;--sd-switch-unselected-pressed-margin: 0 1px}:host ::ng-deep .mat-mdc-slide-toggle,:host ::ng-deep .mdc-switch{--mdc-switch-track-width: var(--sd-switch-width) !important;--mdc-switch-track-height: var(--sd-switch-height) !important;--mdc-switch-track-shape: 999px !important;--mdc-switch-state-layer-size: var(--sd-switch-state-layer-size) !important;--mdc-switch-selected-icon-size: var(--sd-switch-icon-size) !important;--mdc-switch-unselected-icon-size: var(--sd-switch-icon-size) !important;--mat-slide-toggle-track-width: var(--sd-switch-width) !important;--mat-slide-toggle-track-height: var(--sd-switch-height) !important;--mat-slide-toggle-track-shape: 999px !important;--mat-slide-toggle-state-layer-size: var(--sd-switch-state-layer-size) !important;--mat-slide-toggle-selected-icon-size: var(--sd-switch-icon-size) !important;--mat-slide-toggle-unselected-icon-size: var(--sd-switch-icon-size) !important;--mat-switch-selected-handle-size: var(--sd-switch-handle-size) !important;--mat-switch-unselected-handle-size: var(--sd-switch-off-handle-size) !important;--mat-switch-with-icon-handle-size: var(--sd-switch-handle-size) !important;--mat-switch-pressed-handle-size: var(--sd-switch-pressed-size) !important;--mat-switch-selected-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-switch-selected-with-icon-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-switch-unselected-handle-horizontal-margin: var(--sd-switch-unselected-margin) !important;--mat-switch-unselected-with-icon-handle-horizontal-margin: var(--sd-switch-unselected-icon-margin) !important;--mat-switch-selected-pressed-handle-horizontal-margin: var(--sd-switch-selected-pressed-margin) !important;--mat-switch-unselected-pressed-handle-horizontal-margin: var(--sd-switch-unselected-pressed-margin) !important;--mat-slide-toggle-selected-handle-size: var(--sd-switch-handle-size) !important;--mat-slide-toggle-unselected-handle-size: var(--sd-switch-off-handle-size) !important;--mat-slide-toggle-with-icon-handle-size: var(--sd-switch-handle-size) !important;--mat-slide-toggle-pressed-handle-size: var(--sd-switch-pressed-size) !important;--mat-slide-toggle-selected-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-slide-toggle-selected-with-icon-handle-horizontal-margin: var(--sd-switch-selected-margin) !important;--mat-slide-toggle-unselected-handle-horizontal-margin: var(--sd-switch-unselected-margin) !important;--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin: var(--sd-switch-unselected-icon-margin) !important;--mat-slide-toggle-selected-pressed-handle-horizontal-margin: var(--sd-switch-selected-pressed-margin) !important;--mat-slide-toggle-unselected-pressed-handle-horizontal-margin: var(--sd-switch-unselected-pressed-margin) !important}:host ::ng-deep .mdc-switch{min-height:max(28px,var(--sd-switch-height))}:host ::ng-deep .mat-mdc-slide-toggle-touch-target{height:max(28px,var(--sd-switch-height))}@media(pointer:coarse){:host ::ng-deep .mdc-switch,:host ::ng-deep .mat-mdc-slide-toggle-touch-target{min-height:44px}}:host ::ng-deep label{margin-bottom:0!important}:host{--sd-c: var(--sd-primary);--sd-switch-handle: var(--sd-surface, #fff);--sd-switch-track-off: var(--sd-surface-muted, #e7e8ed);--sd-switch-track-off-hover: var(--sd-border, #c4c6d0);--sd-switch-handle-off: var(--sd-text-secondary, #44474f)}:host(.sd-c-secondary){--sd-c: var(--sd-secondary)}:host(.sd-c-info){--sd-c: var(--sd-info)}:host(.sd-c-success){--sd-c: var(--sd-success)}:host(.sd-c-warning){--sd-c: var(--sd-warning)}:host(.sd-c-error){--sd-c: var(--sd-error)}:host ::ng-deep .mat-mdc-slide-toggle,:host ::ng-deep .mdc-switch{--mdc-switch-selected-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-focus-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-hover-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mdc-switch-selected-icon-color: var(--sd-c) !important;--mdc-switch-selected-focus-icon-color: var(--sd-c) !important;--mdc-switch-selected-hover-icon-color: var(--sd-c) !important;--mdc-switch-selected-pressed-icon-color: var(--sd-c) !important;--mdc-switch-selected-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-track-color: var(--sd-c) !important;--mdc-switch-selected-hover-track-color: var(--sd-c) !important;--mdc-switch-selected-pressed-track-color: var(--sd-c) !important;--mdc-switch-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-hover-state-layer-color: var(--sd-c) !important;--mdc-switch-selected-pressed-state-layer-color: var(--sd-c) !important;--mdc-switch-unselected-track-color: var(--sd-switch-track-off) !important;--mdc-switch-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mdc-switch-unselected-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mdc-switch-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-selected-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-focus-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-hover-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-pressed-handle-color: var(--sd-switch-handle) !important;--mat-slide-toggle-selected-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-icon-color: var(--sd-c) !important;--mat-slide-toggle-selected-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-track-color: var(--sd-c) !important;--mat-slide-toggle-selected-focus-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-hover-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-selected-pressed-state-layer-color: var(--sd-c) !important;--mat-slide-toggle-unselected-track-color: var(--sd-switch-track-off) !important;--mat-slide-toggle-unselected-focus-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-hover-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-pressed-track-color: var(--sd-switch-track-off-hover) !important;--mat-slide-toggle-unselected-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-focus-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-hover-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-unselected-pressed-handle-color: var(--sd-switch-handle-off) !important;--mat-slide-toggle-track-outline-color: transparent !important;--mat-slide-toggle-selected-track-outline-color: transparent !important}\n"] }]
|
|
112
|
+
}], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
|
|
111
113
|
|
|
112
114
|
/**
|
|
113
115
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-forms-switch.mjs","sources":["../../../projects/sdcorejs-angular/forms/switch/src/switch.component.ts","../../../projects/sdcorejs-angular/forms/switch/src/switch.component.html","../../../projects/sdcorejs-angular/forms/switch/sdcorejs-angular-forms-switch.ts"],"sourcesContent":["import { Utilities } from '@sdcorejs/utils/fns';\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n inject,\n input,\n model,\n OnDestroy,\n OnInit,\n output,\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { SdLabel } from '@sdcorejs/angular/forms/label';\nimport { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport {\n SdFormControl,\n sdFormControlState,\n SdViewed,\n SdViewedInput,\n sdViewedInline,\n sdViewedTransform,\n ɵsdFormControlConnector,\n ɵSdFormControlParent,\n} from '@sdcorejs/angular/forms/models';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { Color } from '@sdcorejs/utils/models';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'sd-switch',\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // why: dùng host class .sd-c-<x> (thay vì data-attr) để reactivity host-binding với\n // signal chắc chắn áp dụng + có default fallback `sd-c-primary` khi color() là 'primary'.\n // Test cũ assert data-sd-color đã được thay bằng class assert tương ứng.\n '[class.sd-c-primary]': \"color() === 'primary'\",\n '[class.sd-c-secondary]': \"color() === 'secondary'\",\n '[class.sd-c-info]': \"color() === 'info'\",\n '[class.sd-c-success]': \"color() === 'success'\",\n '[class.sd-c-warning]': \"color() === 'warning'\",\n '[class.sd-c-error]': \"color() === 'error'\",\n },\n imports: [FormsModule, ReactiveFormsModule, MatSlideToggleModule, MatFormFieldModule, SdLabel, SdTranslatePipe],\n})\nexport class SdSwitch implements OnInit, OnDestroy {\n readonly #ref = inject(ChangeDetectorRef);\n readonly #i18n = inject(I18nService);\n\n id = `I${Utilities.generateUuid()}`;\n readonly #defaultName = Utilities.generateUuid();\n formControl = new SdFormControl();\n #subscription = new Subscription();\n\n // Inputs — accept null|undefined at boundary, transform to canonical\n readonly autoIdInput = input<string | undefined, string | null | undefined>(undefined, {\n alias: 'autoId',\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly name = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly form = input<ɵSdFormControlParent>(undefined);\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n // why: legacy callers pass `null` to mean \"fallback to primary\" — keep that contract\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */\n readonly viewed = input<SdViewed, SdViewedInput>(false, { transform: sdViewedTransform });\n\n // why: tri-state viewed — `'inline'` keeps the switch interactive; disabled `'inline'` → static.\n readonly #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);\n /** `true` when the static read-only view should render. */\n readonly isViewed = this.#viewedState.isViewed;\n readonly hideInlineError = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n\n // Two-way model\n readonly model = model<boolean | null | undefined>(false);\n\n // Outputs\n readonly sdChange = output<unknown>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-switch-${this.autoIdInput()}` : undefined));\n readonly #state = sdFormControlState(computed(() => this.formControl));\n readonly dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'));\n readonly dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'));\n readonly dataValue = computed(() => sdSerializeDataValue(this.#state().value));\n readonly dataRequired = computed(() => (this.required() ? 'true' : 'false'));\n\n // why: `[required]` gắn Validators.required nhưng template TRƯỚC ĐÂY không render bất kỳ\n // message nào, nên switch bắt buộc để OFF chặn submit mà người dùng không thấy lý do —\n // đúng loại bug \"error invalid nhưng message ẩn\". Dùng lại key `core.form.input.required`\n // ('Vui lòng nhập thông tin') vì catalog i18n chưa có key riêng cho switch.\n readonly errorMessage = computed<string | undefined>(() => {\n void this.#state();\n return this.formControl.errors?.['required'] ? this.#i18n.t('core.form.input.required') : undefined;\n });\n\n readonly #formConnector = ɵsdFormControlConnector<boolean | null | undefined, boolean | null | undefined>({\n form: this.form,\n name: computed(() => this.name() || this.#defaultName),\n control: computed(() => this.formControl),\n model: this.model,\n writeModel: value => {\n this.model.set(value);\n this.sdChange.emit(value);\n },\n validators: computed(() => (this.required() ? Validators.required : null)),\n disabled: this.disabled,\n validationError: this.errorMessage,\n controlEquals: (controlValue, modelValue) => (controlValue === null && modelValue === false) || Object.is(controlValue, modelValue),\n });\n\n /** Shared reactive form policy — `validationError` is already interaction-gated (touched/dirty). */\n readonly connectorState = this.#formConnector.state;\n /** Message to render inline; `undefined` while untouched, or when `hideInlineError` is set. */\n readonly visibleErrorMessage = computed(() => (this.hideInlineError() ? undefined : this.connectorState().validationError));\n\n ngOnInit() {\n this.#subscription.add(\n this.formControl.sdChanges.subscribe(() => {\n this.#ref.markForCheck();\n })\n );\n }\n\n ngOnDestroy() {\n this.#subscription.unsubscribe();\n }\n}\n","@if (isViewed()) {\n @if (label()) {\n <div class=\"T14R text-secondary\">{{ label() }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.switch.on' : 'core.form.switch.off') | sdTranslate }}</div>\n} @else {\n <mat-slide-toggle\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n <sd-label [label]=\"label()\" [required]=\"required()\"></sd-label>\n </mat-slide-toggle>\n @let _errorMessage = visibleErrorMessage();\n @if (_errorMessage) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵsdFormControlConnector"],"mappings":";;;;;;;;;;;;;;;MAoDa,QAAQ,CAAA;AACV,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChC,IAAA,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;AAEpC,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,SAAS,CAAC,YAAY,EAAE,EAAE;AAC1B,IAAA,YAAY,GAAG,SAAS,CAAC,YAAY,EAAE;AAChD,IAAA,WAAW,GAAG,IAAI,aAAa,EAAE;AACjC,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;;AAGzB,IAAA,WAAW,GAAG,KAAK,CAAgD,SAAS,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,aAAA,EACnF,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,EAAA,CAAA,GAAA,CAFiC;AACrF,YAAA,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS;AACrD,SAAA,CAAA,CAAA,CAAC;AACO,IAAA,IAAI,GAAG,KAAK,CAAgD,SAAS,wCAC5E,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,EAAA,CAAA,GAAA,CAD0B;YAC9E,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS;AACrD,SAAA,CAAA,CAAA,CAAC;AACO,IAAA,IAAI,GAAG,KAAK,CAAuB,SAAS,gDAAC;AAC7C,IAAA,KAAK,GAAG,KAAK,CAAgD,SAAS,yCAC7E,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,EAAA,CAAA,G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AAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,oBAAoB,EAAE,qBAAqB;AAC5C,qBAAA,EAAA,OAAA,EACQ,CAAC,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,usBAAA,EAAA,MAAA,EAAA,CAAA,qoIAAA,CAAA,EAAA;;;AElDjH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-forms-switch.mjs","sources":["../../../projects/sdcorejs-angular/forms/switch/src/switch.component.ts","../../../projects/sdcorejs-angular/forms/switch/src/switch.component.html","../../../projects/sdcorejs-angular/forms/switch/sdcorejs-angular-forms-switch.ts"],"sourcesContent":["import { Utilities } from '@sdcorejs/utils/fns';\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n inject,\n input,\n model,\n OnDestroy,\n OnInit,\n output,\n} from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { SdLabel } from '@sdcorejs/angular/forms/label';\nimport { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport {\n SdFormControl,\n sdFormControlState,\n SdViewed,\n SdViewedInput,\n sdViewedInline,\n sdViewedTransform,\n ɵsdFormControlConnector,\n ɵSdFormControlParent,\n} from '@sdcorejs/angular/forms/models';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { Color, Size } from '@sdcorejs/utils/models';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'sd-switch',\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size()',\n // why: dùng host class .sd-c-<x> (thay vì data-attr) để reactivity host-binding với\n // signal chắc chắn áp dụng + có default fallback `sd-c-primary` khi color() là 'primary'.\n // Test cũ assert data-sd-color đã được thay bằng class assert tương ứng.\n '[class.sd-c-primary]': \"color() === 'primary'\",\n '[class.sd-c-secondary]': \"color() === 'secondary'\",\n '[class.sd-c-info]': \"color() === 'info'\",\n '[class.sd-c-success]': \"color() === 'success'\",\n '[class.sd-c-warning]': \"color() === 'warning'\",\n '[class.sd-c-error]': \"color() === 'error'\",\n },\n imports: [FormsModule, ReactiveFormsModule, MatSlideToggleModule, MatFormFieldModule, SdLabel, SdTranslatePipe],\n})\nexport class SdSwitch implements OnInit, OnDestroy {\n readonly #ref = inject(ChangeDetectorRef);\n readonly #i18n = inject(I18nService);\n\n id = `I${Utilities.generateUuid()}`;\n readonly #defaultName = Utilities.generateUuid();\n formControl = new SdFormControl();\n #subscription = new Subscription();\n\n // Inputs — accept null|undefined at boundary, transform to canonical\n readonly autoIdInput = input<string | undefined, string | null | undefined>(undefined, {\n alias: 'autoId',\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly name = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly form = input<ɵSdFormControlParent>(undefined);\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n readonly size = input<Size>('md');\n // why: legacy callers pass `null` to mean \"fallback to primary\" — keep that contract\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */\n readonly viewed = input<SdViewed, SdViewedInput>(false, { transform: sdViewedTransform });\n\n // why: tri-state viewed — `'inline'` keeps the switch interactive; disabled `'inline'` → static.\n readonly #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);\n /** `true` when the static read-only view should render. */\n readonly isViewed = this.#viewedState.isViewed;\n readonly hideInlineError = input(false, { transform: booleanAttribute });\n readonly required = input(false, { transform: booleanAttribute });\n\n // Two-way model\n readonly model = model<boolean | null | undefined>(false);\n\n // Outputs\n readonly sdChange = output<unknown>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-switch-${this.autoIdInput()}` : undefined));\n readonly #state = sdFormControlState(computed(() => this.formControl));\n readonly dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'));\n readonly dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'));\n readonly dataValue = computed(() => sdSerializeDataValue(this.#state().value));\n readonly dataRequired = computed(() => (this.required() ? 'true' : 'false'));\n\n // why: `[required]` gắn Validators.required nhưng template TRƯỚC ĐÂY không render bất kỳ\n // message nào, nên switch bắt buộc để OFF chặn submit mà người dùng không thấy lý do —\n // đúng loại bug \"error invalid nhưng message ẩn\". Dùng lại key `core.form.input.required`\n // ('Vui lòng nhập thông tin') vì catalog i18n chưa có key riêng cho switch.\n readonly errorMessage = computed<string | undefined>(() => {\n void this.#state();\n return this.formControl.errors?.['required'] ? this.#i18n.t('core.form.input.required') : undefined;\n });\n\n readonly #formConnector = ɵsdFormControlConnector<boolean | null | undefined, boolean | null | undefined>({\n form: this.form,\n name: computed(() => this.name() || this.#defaultName),\n control: computed(() => this.formControl),\n model: this.model,\n writeModel: value => {\n this.model.set(value);\n this.sdChange.emit(value);\n },\n validators: computed(() => (this.required() ? Validators.required : null)),\n disabled: this.disabled,\n validationError: this.errorMessage,\n controlEquals: (controlValue, modelValue) => (controlValue === null && modelValue === false) || Object.is(controlValue, modelValue),\n });\n\n /** Shared reactive form policy — `validationError` is already interaction-gated (touched/dirty). */\n readonly connectorState = this.#formConnector.state;\n /** Message to render inline; `undefined` while untouched, or when `hideInlineError` is set. */\n readonly visibleErrorMessage = computed(() => (this.hideInlineError() ? undefined : this.connectorState().validationError));\n\n ngOnInit() {\n this.#subscription.add(\n this.formControl.sdChanges.subscribe(() => {\n this.#ref.markForCheck();\n })\n );\n }\n\n ngOnDestroy() {\n this.#subscription.unsubscribe();\n }\n}\n","@let _label = label();\n@if (isViewed()) {\n @if (_label) {\n <div class=\"T14R text-secondary\">{{ _label }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.switch.on' : 'core.form.switch.off') | sdTranslate }}</div>\n} @else {\n <mat-slide-toggle\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\">\n <sd-label [label]=\"_label\" [required]=\"required()\"></sd-label>\n </mat-slide-toggle>\n @let _errorMessage = visibleErrorMessage();\n @if (_errorMessage) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵsdFormControlConnector"],"mappings":";;;;;;;;;;;;;;;MAqDa,QAAQ,CAAA;AACV,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChC,IAAA,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;AAEpC,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,SAAS,CAAC,YAAY,EAAE,EAAE;AAC1B,IAAA,YAAY,GAAG,SAAS,CAAC,YAAY,EAAE;AAChD,IAAA,WAAW,GAAG,IAAI,aAAa,EAAE;AACjC,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;;AAGzB,IAAA,WAAW,GAAG,KAAK,CAAgD,SAAS,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,aAAA,EACnF,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,EAAA,CAAA,GAAA,CAFiC;AACrF,YAAA,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS;AACrD,SAAA,CAAA,C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AAE,kBAAkB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,OAAO,4GAAE,eAAe,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAEnG,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAnBpB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,eAAA,EAGJ,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,kBAAkB,EAAE,QAAQ;;;;AAI5B,wBAAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,wBAAwB,EAAE,yBAAyB;AACnD,wBAAA,mBAAmB,EAAE,oBAAoB;AACzC,wBAAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,oBAAoB,EAAE,qBAAqB;AAC5C,qBAAA,EAAA,OAAA,EACQ,CAAC,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,4tBAAA,EAAA,MAAA,EAAA,CAAA,26QAAA,CAAA,EAAA;;;AEnDjH;;AAEG;;;;"}
|
|
@@ -397,6 +397,7 @@ const EN_MESSAGES = {
|
|
|
397
397
|
'core.component.form-builder.group-children': 'Children',
|
|
398
398
|
'core.component.form-builder.group-icon': 'Icon',
|
|
399
399
|
'core.component.form-builder.group-accent-color': 'Accent color',
|
|
400
|
+
'core.component.form-builder.collapsible': 'Allow expand/collapse',
|
|
400
401
|
'core.component.form-builder.group-no-children': 'No fields yet. Add or drag fields into this group.',
|
|
401
402
|
'core.component.form-builder.break': 'Break',
|
|
402
403
|
// ---- Component: code-editor ----
|
|
@@ -1176,6 +1177,7 @@ const JA_MESSAGES = {
|
|
|
1176
1177
|
'core.component.form-builder.group-children': '子要素',
|
|
1177
1178
|
'core.component.form-builder.group-icon': 'アイコン',
|
|
1178
1179
|
'core.component.form-builder.group-accent-color': 'アクセントカラー',
|
|
1180
|
+
'core.component.form-builder.collapsible': '展開・折りたたみを許可',
|
|
1179
1181
|
'core.component.form-builder.group-no-children': 'フィールドがまだありません。このグループにフィールドを追加またはドラッグしてください。',
|
|
1180
1182
|
'core.component.form-builder.break': '改行',
|
|
1181
1183
|
// ---- Component: code-editor ----
|
|
@@ -1955,6 +1957,7 @@ const KO_MESSAGES = {
|
|
|
1955
1957
|
'core.component.form-builder.group-children': '하위 요소',
|
|
1956
1958
|
'core.component.form-builder.group-icon': '아이콘',
|
|
1957
1959
|
'core.component.form-builder.group-accent-color': '강조 색상',
|
|
1960
|
+
'core.component.form-builder.collapsible': '펼치기/접기 허용',
|
|
1958
1961
|
'core.component.form-builder.group-no-children': '필드가 아직 없습니다. 이 그룹에 필드를 추가하거나 드래그하세요.',
|
|
1959
1962
|
'core.component.form-builder.break': '줄 바꿈',
|
|
1960
1963
|
// ---- Component: code-editor ----
|
|
@@ -2734,6 +2737,7 @@ const VI_MESSAGES = {
|
|
|
2734
2737
|
'core.component.form-builder.group-children': 'Thành phần con',
|
|
2735
2738
|
'core.component.form-builder.group-icon': 'Icon',
|
|
2736
2739
|
'core.component.form-builder.group-accent-color': 'Màu nhấn',
|
|
2740
|
+
'core.component.form-builder.collapsible': 'Cho phép thu gọn/mở rộng',
|
|
2737
2741
|
'core.component.form-builder.group-no-children': 'Chưa có trường nào. Thêm hoặc kéo trường vào group này.',
|
|
2738
2742
|
'core.component.form-builder.break': 'Ngắt dòng',
|
|
2739
2743
|
// ---- Component: code-editor ----
|
|
@@ -3513,6 +3517,7 @@ const ZH_MESSAGES = {
|
|
|
3513
3517
|
'core.component.form-builder.group-children': '子项',
|
|
3514
3518
|
'core.component.form-builder.group-icon': '图标',
|
|
3515
3519
|
'core.component.form-builder.group-accent-color': '强调色',
|
|
3520
|
+
'core.component.form-builder.collapsible': '允许展开/折叠',
|
|
3516
3521
|
'core.component.form-builder.group-no-children': '尚无字段。请向此分组添加或拖入字段。',
|
|
3517
3522
|
'core.component.form-builder.break': '换行',
|
|
3518
3523
|
// ---- Component: code-editor ----
|