@sd-angular/core 19.0.0-beta.32 → 19.0.0-beta.34
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/components/view/src/view.component.d.ts +11 -11
- package/fesm2022/sd-angular-core-components-table.mjs +4 -4
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +28 -40
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-workflow.mjs +22 -22
- package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +165 -327
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +134 -279
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +132 -289
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +161 -337
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +126 -286
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +205 -400
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +120 -226
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +44 -51
- package/forms/date/src/date.component.d.ts +40 -46
- package/forms/datetime/src/datetime.component.d.ts +39 -47
- package/forms/input/src/input.component.d.ts +44 -55
- package/forms/input-number/src/input-number.component.d.ts +45 -53
- package/forms/select/src/select.component.d.ts +47 -56
- package/forms/textarea/src/textarea.component.d.ts +33 -40
- package/package.json +39 -39
- package/sd-angular-core-19.0.0-beta.34.tgz +0 -0
- package/sd-angular-core-19.0.0-beta.32.tgz +0 -0
|
@@ -1,53 +1,41 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, contentChild, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { SdHrefDirective } from '@sd-angular/core/directives';
|
|
5
5
|
import { SdEmptyPipe } from '@sd-angular/core/pipes';
|
|
6
6
|
|
|
7
7
|
class SdView {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
// ==========================================
|
|
9
|
+
// 1. SIGNAL INPUTS
|
|
10
|
+
// ==========================================
|
|
11
|
+
label = input();
|
|
12
|
+
value = input();
|
|
13
|
+
// input.required() sẽ ép dev bắt buộc phải truyền [display] vào, y hệt @Input({ required: true })
|
|
14
|
+
display = input.required();
|
|
15
|
+
hyperlink = input();
|
|
16
|
+
// Input để hứng template từ component cha (như sd-input, sd-select) truyền xuống
|
|
17
|
+
labelTemplate = input();
|
|
18
|
+
valueTemplate = input();
|
|
19
|
+
// ==========================================
|
|
20
|
+
// 2. SIGNAL QUERIES (Thay thế @ContentChild)
|
|
21
|
+
// ==========================================
|
|
22
|
+
// Trả về Signal chứa TemplateRef nếu Dev dùng thẻ <sd-view> và truyền #sdLabel, #sdValue
|
|
23
|
+
contentLabelTemplate = contentChild('sdLabel');
|
|
24
|
+
contentValueTemplate = contentChild('sdValue');
|
|
25
|
+
// ==========================================
|
|
26
|
+
// 3. COMPUTED SIGNALS (Thay thế Getters)
|
|
27
|
+
// ==========================================
|
|
28
|
+
// Ưu tiên Input từ cha truyền xuống, không có thì lấy ContentChild
|
|
29
|
+
// Lợi ích: Cache giá trị, không bị chạy lại vô tội vạ như Getter cũ!
|
|
30
|
+
activeLabelTemplate = computed(() => this.labelTemplate() ?? this.contentLabelTemplate());
|
|
31
|
+
activeValueTemplate = computed(() => this.valueTemplate() ?? this.contentValueTemplate());
|
|
25
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdView, isStandalone: true, selector: "sd-view", inputs: { label: "label", value: "value", display: "display", hyperlink: "hyperlink", labelTemplate: "labelTemplate", valueTemplate: "valueTemplate" }, queries: [{ propertyName: "contentLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true }, { propertyName: "contentValueTemplate", first: true, predicate: ["sdValue"], descendants: true }], ngImport: i0, template: "@if (activeLabelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate
|
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdView, isStandalone: true, selector: "sd-view", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: true, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, labelTemplate: { classPropertyName: "labelTemplate", publicName: "labelTemplate", isSignal: true, isRequired: false, transformFunction: null }, valueTemplate: { classPropertyName: "valueTemplate", publicName: "valueTemplate", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "contentLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "contentValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (activeLabelTemplate()) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate()!\"></ng-container>\r\n} @else {\r\n @if (label()) {\r\n <div class=\"T14R text-black400\">{{ label() }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate()) {\r\n <ng-container \r\n *ngTemplateOutlet=\"\r\n activeValueTemplate()!; \r\n context: { $implicit: display(), value: value() }\r\n \"> \r\n </ng-container>\r\n} @else {\r\n @if (hyperlink(); as link) {\r\n <a [sdHref]=\"link\">{{ display() }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display() | sdEmpty }}</div>\r\n }\r\n}", dependencies: [{ kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }, { kind: "directive", type: SdHrefDirective, selector: "a[sdHref]", inputs: ["sdHref"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
27
34
|
}
|
|
28
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdView, decorators: [{
|
|
29
36
|
type: Component,
|
|
30
|
-
args: [{ selector: 'sd-view', standalone: true, imports: [SdEmptyPipe, SdHrefDirective, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (activeLabelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate
|
|
31
|
-
}]
|
|
32
|
-
type: Input
|
|
33
|
-
}], value: [{
|
|
34
|
-
type: Input
|
|
35
|
-
}], display: [{
|
|
36
|
-
type: Input,
|
|
37
|
-
args: [{ required: true }]
|
|
38
|
-
}], hyperlink: [{
|
|
39
|
-
type: Input
|
|
40
|
-
}], labelTemplate: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], valueTemplate: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], contentLabelTemplate: [{
|
|
45
|
-
type: ContentChild,
|
|
46
|
-
args: ['sdLabel']
|
|
47
|
-
}], contentValueTemplate: [{
|
|
48
|
-
type: ContentChild,
|
|
49
|
-
args: ['sdValue']
|
|
50
|
-
}] } });
|
|
37
|
+
args: [{ selector: 'sd-view', standalone: true, imports: [SdEmptyPipe, SdHrefDirective, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (activeLabelTemplate()) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate()!\"></ng-container>\r\n} @else {\r\n @if (label()) {\r\n <div class=\"T14R text-black400\">{{ label() }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate()) {\r\n <ng-container \r\n *ngTemplateOutlet=\"\r\n activeValueTemplate()!; \r\n context: { $implicit: display(), value: value() }\r\n \"> \r\n </ng-container>\r\n} @else {\r\n @if (hyperlink(); as link) {\r\n <a [sdHref]=\"link\">{{ display() }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display() | sdEmpty }}</div>\r\n }\r\n}" }]
|
|
38
|
+
}] });
|
|
51
39
|
|
|
52
40
|
/**
|
|
53
41
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-components-view.mjs","sources":["../../../projects/sd-angular/components/view/src/view.component.ts","../../../projects/sd-angular/components/view/src/view.component.html","../../../projects/sd-angular/components/view/sd-angular-core-components-view.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"sd-angular-core-components-view.mjs","sources":["../../../projects/sd-angular/components/view/src/view.component.ts","../../../projects/sd-angular/components/view/src/view.component.html","../../../projects/sd-angular/components/view/sd-angular-core-components-view.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\r\nimport { \r\n ChangeDetectionStrategy, \r\n Component, \r\n TemplateRef, \r\n input, \r\n contentChild, \r\n computed \r\n} from '@angular/core';\r\nimport { SdHrefDirective } from '@sd-angular/core/directives';\r\nimport { SdEmptyPipe } from '@sd-angular/core/pipes';\r\n\r\n@Component({\r\n selector: 'sd-view',\r\n standalone: true,\r\n imports: [SdEmptyPipe, SdHrefDirective, NgTemplateOutlet],\r\n templateUrl: './view.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SdView {\r\n // ==========================================\r\n // 1. SIGNAL INPUTS\r\n // ==========================================\r\n label = input<string | null | undefined>();\r\n value = input<any>(); \r\n \r\n // input.required() sẽ ép dev bắt buộc phải truyền [display] vào, y hệt @Input({ required: true })\r\n display = input.required<string | null | undefined>(); \r\n hyperlink = input<string | null | undefined>();\r\n\r\n // Input để hứng template từ component cha (như sd-input, sd-select) truyền xuống\r\n labelTemplate = input<TemplateRef<any> | undefined>();\r\n valueTemplate = input<TemplateRef<any> | undefined>(); \r\n\r\n // ==========================================\r\n // 2. SIGNAL QUERIES (Thay thế @ContentChild)\r\n // ==========================================\r\n // Trả về Signal chứa TemplateRef nếu Dev dùng thẻ <sd-view> và truyền #sdLabel, #sdValue\r\n contentLabelTemplate = contentChild<TemplateRef<any>>('sdLabel');\r\n contentValueTemplate = contentChild<TemplateRef<any>>('sdValue');\r\n\r\n // ==========================================\r\n // 3. COMPUTED SIGNALS (Thay thế Getters)\r\n // ==========================================\r\n // Ưu tiên Input từ cha truyền xuống, không có thì lấy ContentChild\r\n // Lợi ích: Cache giá trị, không bị chạy lại vô tội vạ như Getter cũ!\r\n activeLabelTemplate = computed(() => this.labelTemplate() ?? this.contentLabelTemplate());\r\n \r\n activeValueTemplate = computed(() => this.valueTemplate() ?? this.contentValueTemplate());\r\n}","@if (activeLabelTemplate()) {\r\n <ng-container *ngTemplateOutlet=\"activeLabelTemplate()!\"></ng-container>\r\n} @else {\r\n @if (label()) {\r\n <div class=\"T14R text-black400\">{{ label() }}</div>\r\n }\r\n}\r\n\r\n@if (activeValueTemplate()) {\r\n <ng-container \r\n *ngTemplateOutlet=\"\r\n activeValueTemplate()!; \r\n context: { $implicit: display(), value: value() }\r\n \"> \r\n </ng-container>\r\n} @else {\r\n @if (hyperlink(); as link) {\r\n <a [sdHref]=\"link\">{{ display() }}</a>\r\n } @else {\r\n <div class=\"T14M\">{{ display() | sdEmpty }}</div>\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAmBa,MAAM,CAAA;;;;IAIjB,KAAK,GAAG,KAAK,EAA6B;IAC1C,KAAK,GAAG,KAAK,EAAO;;AAGpB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAA6B;IACrD,SAAS,GAAG,KAAK,EAA6B;;IAG9C,aAAa,GAAG,KAAK,EAAgC;IACrD,aAAa,GAAG,KAAK,EAAgC;;;;;AAMrD,IAAA,oBAAoB,GAAG,YAAY,CAAmB,SAAS,CAAC;AAChE,IAAA,oBAAoB,GAAG,YAAY,CAAmB,SAAS,CAAC;;;;;;AAOhE,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;AAEzF,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;wGA7B9E,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAN,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAM,+kCCnBnB,kmBAqBC,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EDNW,WAAW,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,eAAe,0EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAI7C,MAAM,EAAA,UAAA,EAAA,CAAA;kBAPlB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAExC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kmBAAA,EAAA;;;AEjBjD;;AAEG;;;;"}
|