@sdcorejs/angular 20.0.1 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -14
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +28 -28
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +34 -34
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +9 -9
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +25 -33
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-base.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-button.mjs +19 -29
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-chart.mjs +28 -28
- package/fesm2022/sdcorejs-angular-components-chart.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +11 -11
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-editor.mjs +36 -48
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +212 -212
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +8 -8
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +10 -10
- package/fesm2022/sdcorejs-angular-components-inform.mjs +35 -39
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-modal.mjs +20 -20
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-operator.mjs +11 -11
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +119 -119
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +132 -141
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +18 -22
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +14 -14
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +36 -38
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +24 -24
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +23 -23
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +23 -23
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +225 -225
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +70 -106
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-view.mjs +14 -14
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +30 -30
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +61 -76
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +26 -49
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +48 -83
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +47 -82
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +46 -61
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +53 -68
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +74 -89
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +12 -12
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +19 -19
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +56 -71
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +58 -73
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +3 -3
- package/fesm2022/sdcorejs-angular-forms-models.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +39 -70
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +69 -86
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +28 -49
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +50 -77
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms.mjs +4 -4
- package/fesm2022/sdcorejs-angular-handlers.mjs +3 -3
- package/fesm2022/sdcorejs-angular-i18n.mjs +9 -9
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +6 -6
- package/fesm2022/sdcorejs-angular-modules-auth.mjs +10 -10
- package/fesm2022/sdcorejs-angular-modules-auth.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-authom.mjs +10 -10
- package/fesm2022/sdcorejs-angular-modules-authom.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-keycloak.mjs +7 -7
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +131 -131
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-permission.mjs +11 -11
- package/fesm2022/sdcorejs-angular-modules-permission.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-pipes.mjs +14 -14
- package/fesm2022/sdcorejs-angular-services-api.mjs +10 -10
- package/fesm2022/sdcorejs-angular-services-cache.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +6 -6
- package/fesm2022/sdcorejs-angular-services-docx.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-excel.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-license.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-loading.mjs +3 -3
- package/fesm2022/sdcorejs-angular-services-notify.mjs +12 -12
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +3 -3
- package/package.json +82 -82
- package/{forms/select/index.d.ts → types/sdcorejs-angular-forms-select.d.ts} +3 -3
- /package/{components/anchor/index.d.ts → types/sdcorejs-angular-components-anchor.d.ts} +0 -0
- /package/{components/autoid-inspector/index.d.ts → types/sdcorejs-angular-components-autoid-inspector.d.ts} +0 -0
- /package/{components/avatar/index.d.ts → types/sdcorejs-angular-components-avatar.d.ts} +0 -0
- /package/{components/badge/index.d.ts → types/sdcorejs-angular-components-badge.d.ts} +0 -0
- /package/{components/base/index.d.ts → types/sdcorejs-angular-components-base.d.ts} +0 -0
- /package/{components/button/index.d.ts → types/sdcorejs-angular-components-button.d.ts} +0 -0
- /package/{components/chart/index.d.ts → types/sdcorejs-angular-components-chart.d.ts} +0 -0
- /package/{components/ckeditor-styles/index.d.ts → types/sdcorejs-angular-components-ckeditor-styles.d.ts} +0 -0
- /package/{components/code-editor/index.d.ts → types/sdcorejs-angular-components-code-editor.d.ts} +0 -0
- /package/{components/document-builder/index.d.ts → types/sdcorejs-angular-components-document-builder.d.ts} +0 -0
- /package/{components/editor/index.d.ts → types/sdcorejs-angular-components-editor.d.ts} +0 -0
- /package/{components/form-generic/index.d.ts → types/sdcorejs-angular-components-form-generic.d.ts} +0 -0
- /package/{components/history/index.d.ts → types/sdcorejs-angular-components-history.d.ts} +0 -0
- /package/{components/import-excel/index.d.ts → types/sdcorejs-angular-components-import-excel.d.ts} +0 -0
- /package/{components/inform/index.d.ts → types/sdcorejs-angular-components-inform.d.ts} +0 -0
- /package/{components/mini-editor/index.d.ts → types/sdcorejs-angular-components-mini-editor.d.ts} +0 -0
- /package/{components/modal/index.d.ts → types/sdcorejs-angular-components-modal.d.ts} +0 -0
- /package/{components/operator/index.d.ts → types/sdcorejs-angular-components-operator.d.ts} +0 -0
- /package/{components/preview/index.d.ts → types/sdcorejs-angular-components-preview.d.ts} +0 -0
- /package/{components/query-bar/index.d.ts → types/sdcorejs-angular-components-query-bar.d.ts} +0 -0
- /package/{components/query-builder/index.d.ts → types/sdcorejs-angular-components-query-builder.d.ts} +0 -0
- /package/{components/quick-action/index.d.ts → types/sdcorejs-angular-components-quick-action.d.ts} +0 -0
- /package/{components/section/index.d.ts → types/sdcorejs-angular-components-section.d.ts} +0 -0
- /package/{components/side-drawer/index.d.ts → types/sdcorejs-angular-components-side-drawer.d.ts} +0 -0
- /package/{components/splitter/index.d.ts → types/sdcorejs-angular-components-splitter.d.ts} +0 -0
- /package/{components/stepper/index.d.ts → types/sdcorejs-angular-components-stepper.d.ts} +0 -0
- /package/{components/tab-router/index.d.ts → types/sdcorejs-angular-components-tab-router.d.ts} +0 -0
- /package/{components/tab/index.d.ts → types/sdcorejs-angular-components-tab.d.ts} +0 -0
- /package/{components/table/index.d.ts → types/sdcorejs-angular-components-table.d.ts} +0 -0
- /package/{components/upload-file/index.d.ts → types/sdcorejs-angular-components-upload-file.d.ts} +0 -0
- /package/{components/view/index.d.ts → types/sdcorejs-angular-components-view.d.ts} +0 -0
- /package/{components/index.d.ts → types/sdcorejs-angular-components.d.ts} +0 -0
- /package/{configurations/index.d.ts → types/sdcorejs-angular-configurations.d.ts} +0 -0
- /package/{directives/index.d.ts → types/sdcorejs-angular-directives.d.ts} +0 -0
- /package/{forms/autocomplete/index.d.ts → types/sdcorejs-angular-forms-autocomplete.d.ts} +0 -0
- /package/{forms/checkbox/index.d.ts → types/sdcorejs-angular-forms-checkbox.d.ts} +0 -0
- /package/{forms/chip-calendar/index.d.ts → types/sdcorejs-angular-forms-chip-calendar.d.ts} +0 -0
- /package/{forms/chip/index.d.ts → types/sdcorejs-angular-forms-chip.d.ts} +0 -0
- /package/{forms/date-range/index.d.ts → types/sdcorejs-angular-forms-date-range.d.ts} +0 -0
- /package/{forms/date/index.d.ts → types/sdcorejs-angular-forms-date.d.ts} +0 -0
- /package/{forms/datetime/index.d.ts → types/sdcorejs-angular-forms-datetime.d.ts} +0 -0
- /package/{forms/directives/index.d.ts → types/sdcorejs-angular-forms-directives.d.ts} +0 -0
- /package/{forms/input-color/index.d.ts → types/sdcorejs-angular-forms-input-color.d.ts} +0 -0
- /package/{forms/input-number/index.d.ts → types/sdcorejs-angular-forms-input-number.d.ts} +0 -0
- /package/{forms/input/index.d.ts → types/sdcorejs-angular-forms-input.d.ts} +0 -0
- /package/{forms/label/index.d.ts → types/sdcorejs-angular-forms-label.d.ts} +0 -0
- /package/{forms/models/index.d.ts → types/sdcorejs-angular-forms-models.d.ts} +0 -0
- /package/{forms/radio/index.d.ts → types/sdcorejs-angular-forms-radio.d.ts} +0 -0
- /package/{forms/switch/index.d.ts → types/sdcorejs-angular-forms-switch.d.ts} +0 -0
- /package/{forms/textarea/index.d.ts → types/sdcorejs-angular-forms-textarea.d.ts} +0 -0
- /package/{forms/index.d.ts → types/sdcorejs-angular-forms.d.ts} +0 -0
- /package/{handlers/index.d.ts → types/sdcorejs-angular-handlers.d.ts} +0 -0
- /package/{i18n/index.d.ts → types/sdcorejs-angular-i18n.d.ts} +0 -0
- /package/{interceptors/index.d.ts → types/sdcorejs-angular-interceptors.d.ts} +0 -0
- /package/{models/index.d.ts → types/sdcorejs-angular-models.d.ts} +0 -0
- /package/{modules/auth/index.d.ts → types/sdcorejs-angular-modules-auth.d.ts} +0 -0
- /package/{modules/authom/index.d.ts → types/sdcorejs-angular-modules-authom.d.ts} +0 -0
- /package/{modules/keycloak/index.d.ts → types/sdcorejs-angular-modules-keycloak.d.ts} +0 -0
- /package/{modules/layout/index.d.ts → types/sdcorejs-angular-modules-layout.d.ts} +0 -0
- /package/{modules/permission/index.d.ts → types/sdcorejs-angular-modules-permission.d.ts} +0 -0
- /package/{modules/index.d.ts → types/sdcorejs-angular-modules.d.ts} +0 -0
- /package/{pipes/index.d.ts → types/sdcorejs-angular-pipes.d.ts} +0 -0
- /package/{services/api/index.d.ts → types/sdcorejs-angular-services-api.d.ts} +0 -0
- /package/{services/cache/index.d.ts → types/sdcorejs-angular-services-cache.d.ts} +0 -0
- /package/{services/confirm/index.d.ts → types/sdcorejs-angular-services-confirm.d.ts} +0 -0
- /package/{services/docx/index.d.ts → types/sdcorejs-angular-services-docx.d.ts} +0 -0
- /package/{services/excel/index.d.ts → types/sdcorejs-angular-services-excel.d.ts} +0 -0
- /package/{services/license/index.d.ts → types/sdcorejs-angular-services-license.d.ts} +0 -0
- /package/{services/loading/index.d.ts → types/sdcorejs-angular-services-loading.d.ts} +0 -0
- /package/{services/notify/index.d.ts → types/sdcorejs-angular-services-notify.d.ts} +0 -0
- /package/{services/storage/index.d.ts → types/sdcorejs-angular-services-storage.d.ts} +0 -0
- /package/{services/index.d.ts → types/sdcorejs-angular-services.d.ts} +0 -0
- /package/{utilities/data-state/index.d.ts → types/sdcorejs-angular-utilities-data-state.d.ts} +0 -0
- /package/{utilities/extensions/index.d.ts → types/sdcorejs-angular-utilities-extensions.d.ts} +0 -0
- /package/{utilities/models/index.d.ts → types/sdcorejs-angular-utilities-models.d.ts} +0 -0
- /package/{utilities/index.d.ts → types/sdcorejs-angular-utilities.d.ts} +0 -0
- /package/{index.d.ts → types/sdcorejs-angular.d.ts} +0 -0
|
@@ -21,61 +21,38 @@ class SdCheckbox {
|
|
|
21
21
|
#subscription = new Subscription();
|
|
22
22
|
#model;
|
|
23
23
|
// Inputs — all accept null|undefined at the boundary, transform to canonical shape
|
|
24
|
-
autoIdInput = input(undefined, ...(ngDevMode ?
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
transform: (v) => v ?? undefined,
|
|
28
|
-
}]));
|
|
29
|
-
name = input(undefined, ...(ngDevMode ? [{ debugName: "name", transform: (v) => v ?? undefined }] : [{
|
|
30
|
-
transform: (v) => v ?? undefined,
|
|
31
|
-
}]));
|
|
24
|
+
autoIdInput = input(undefined, { ...(ngDevMode ? { debugName: "autoIdInput" } : /* istanbul ignore next */ {}), alias: 'autoId',
|
|
25
|
+
transform: (v) => v ?? undefined });
|
|
26
|
+
name = input(undefined, { ...(ngDevMode ? { debugName: "name" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
|
|
32
27
|
// why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.
|
|
33
28
|
// Transform once at the input boundary so the rest of the component only deals with FormGroup.
|
|
34
|
-
form = input(undefined, ...(ngDevMode ?
|
|
35
|
-
|
|
36
|
-
return undefined;
|
|
37
|
-
if (val instanceof NgForm)
|
|
38
|
-
return val.form;
|
|
39
|
-
if (val instanceof FormGroup)
|
|
40
|
-
return val;
|
|
41
|
-
if (val?.form instanceof FormGroup)
|
|
42
|
-
return val.form;
|
|
29
|
+
form = input(undefined, { ...(ngDevMode ? { debugName: "form" } : /* istanbul ignore next */ {}), transform: (val) => {
|
|
30
|
+
if (!val)
|
|
43
31
|
return undefined;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return val.form;
|
|
54
|
-
return undefined;
|
|
55
|
-
},
|
|
56
|
-
}]));
|
|
57
|
-
label = input(undefined, ...(ngDevMode ? [{ debugName: "label", transform: (v) => v ?? undefined }] : [{
|
|
58
|
-
transform: (v) => v ?? undefined,
|
|
59
|
-
}]));
|
|
32
|
+
if (val instanceof NgForm)
|
|
33
|
+
return val.form;
|
|
34
|
+
if (val instanceof FormGroup)
|
|
35
|
+
return val;
|
|
36
|
+
if (val?.form instanceof FormGroup)
|
|
37
|
+
return val.form;
|
|
38
|
+
return undefined;
|
|
39
|
+
} });
|
|
40
|
+
label = input(undefined, { ...(ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
|
|
60
41
|
// why: full Color enum, áp dụng qua [data-sd-color] + SCSS override MDC vars.
|
|
61
|
-
color = input('primary', ...(ngDevMode ?
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
viewed = input(false, ...(ngDevMode ? [{ debugName: "viewed", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
66
|
-
inlineError = input('', ...(ngDevMode ? [{ debugName: "inlineError", transform: (v) => v ?? '' }] : [{
|
|
67
|
-
transform: (v) => v ?? '',
|
|
68
|
-
}]));
|
|
42
|
+
color = input('primary', { ...(ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {}), transform: (v) => v || 'primary' });
|
|
43
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
44
|
+
viewed = input(false, { ...(ngDevMode ? { debugName: "viewed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
45
|
+
inlineError = input('', { ...(ngDevMode ? { debugName: "inlineError" } : /* istanbul ignore next */ {}), transform: (v) => v ?? '' });
|
|
69
46
|
// Two-way model
|
|
70
|
-
model = model(undefined, ...(ngDevMode ? [{ debugName: "model" }] : []));
|
|
47
|
+
model = model(undefined, ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
71
48
|
// Outputs (sdChange is in addition to auto-generated modelChange from `model` signal)
|
|
72
49
|
sdChange = output();
|
|
73
50
|
// Computed (template bindings)
|
|
74
|
-
autoId = computed(() => (this.autoIdInput() ? `forms-checkbox-${this.autoIdInput()}` : undefined), ...(ngDevMode ? [{ debugName: "autoId" }] : []));
|
|
51
|
+
autoId = computed(() => (this.autoIdInput() ? `forms-checkbox-${this.autoIdInput()}` : undefined), ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
75
52
|
#state = sdFormControlState(computed(() => this.formControl));
|
|
76
|
-
dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataDisabled" }] : []));
|
|
77
|
-
dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataEmpty" }] : []));
|
|
78
|
-
dataValue = computed(() => sdSerializeDataValue(this.#state().value), ...(ngDevMode ? [{ debugName: "dataValue" }] : []));
|
|
53
|
+
dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataDisabled" }] : /* istanbul ignore next */ []));
|
|
54
|
+
dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataEmpty" }] : /* istanbul ignore next */ []));
|
|
55
|
+
dataValue = computed(() => sdSerializeDataValue(this.#state().value), ...(ngDevMode ? [{ debugName: "dataValue" }] : /* istanbul ignore next */ []));
|
|
79
56
|
constructor() {
|
|
80
57
|
// why: external [name] override falls back to generated uuid only when truthy
|
|
81
58
|
effect(() => {
|
|
@@ -125,10 +102,10 @@ class SdCheckbox {
|
|
|
125
102
|
this.formControl.setValidators(validators);
|
|
126
103
|
this.formControl.updateValueAndValidity();
|
|
127
104
|
};
|
|
128
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
129
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: SdCheckbox, isStandalone: true, selector: "sd-checkbox", 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 }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", 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 (viewed()) {\n @if (label()) {\n <div class=\"T14R text-black400\">{{ label() }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.checkbox.checked' : 'core.form.checkbox.unchecked') | translate }}</div>\n} @else {\n <mat-checkbox\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\">\n {{ label() }}\n </mat-checkbox>\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n}\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host ::ng-deep .mdc-label{margin-bottom:0}:host{--sd-c: var(--sd-primary)}: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-checkbox,:host ::ng-deep .mdc-checkbox{--mdc-checkbox-selected-icon-color: var(--sd-c) !important;--mdc-checkbox-selected-focus-icon-color: var(--sd-c) !important;--mdc-checkbox-selected-hover-icon-color: var(--sd-c) !important;--mdc-checkbox-selected-pressed-icon-color: var(--sd-c) !important;--mdc-checkbox-selected-focus-state-layer-color: var(--sd-c) !important;--mdc-checkbox-selected-hover-state-layer-color: var(--sd-c) !important;--mdc-checkbox-selected-pressed-state-layer-color: var(--sd-c) !important;--mat-checkbox-selected-icon-color: var(--sd-c) !important;--mat-checkbox-selected-focus-icon-color: var(--sd-c) !important;--mat-checkbox-selected-hover-icon-color: var(--sd-c) !important;--mat-checkbox-selected-pressed-icon-color: var(--sd-c) !important;--mat-checkbox-selected-focus-state-layer-color: var(--sd-c) !important;--mat-checkbox-selected-hover-state-layer-color: var(--sd-c) !important;--mat-checkbox-selected-pressed-state-layer-color: var(--sd-c) !important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: MatFormFieldModule }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
130
107
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdCheckbox, decorators: [{
|
|
132
109
|
type: Component,
|
|
133
110
|
args: [{ selector: 'sd-checkbox', standalone: true, host: {
|
|
134
111
|
// why: host class .sd-c-<x> + default sd-c-primary cho fallback. Thay data-sd-color
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-forms-checkbox.mjs","sources":["../../../projects/sdcorejs-angular/forms/checkbox/src/checkbox.component.ts","../../../projects/sdcorejs-angular/forms/checkbox/src/checkbox.component.html","../../../projects/sdcorejs-angular/forms/checkbox/sdcorejs-angular-forms-checkbox.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n OnDestroy,\n output,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, NgForm, ReactiveFormsModule, ValidatorFn } from '@angular/forms';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { sdFormControlState, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';\nimport { Color } from '@sdcorejs/utils/models';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { Subscription } from 'rxjs';\nimport * as uuid from 'uuid';\n\n@Component({\n selector: 'sd-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n standalone: true,\n host: {\n // why: host class .sd-c-<x> + default sd-c-primary cho fallback. Thay data-sd-color\n // để tránh edge case host-attr-binding không reactive trong vài cảnh build pipeline.\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: [CommonModule, FormsModule, ReactiveFormsModule, MatFormFieldModule, MatCheckboxModule, TranslatePipe],\n})\nexport class SdCheckbox implements OnDestroy, AfterViewInit {\n readonly #ref = inject(ChangeDetectorRef);\n\n id = `I${uuid.v4()}`;\n #name = uuid.v4();\n formControl = new FormControl();\n #subscription = new Subscription();\n #model: unknown;\n\n // Inputs — all accept null|undefined at the boundary, transform to canonical shape\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 // why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.\n // Transform once at the input boundary so the rest of the component only deals with FormGroup.\n readonly form = input<FormGroup | undefined, any>(undefined, {\n transform: (val: any): FormGroup | undefined => {\n if (!val) return undefined;\n if (val instanceof NgForm) return val.form;\n if (val instanceof FormGroup) return val;\n if (val?.form instanceof FormGroup) return val.form;\n return undefined;\n },\n });\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n // why: full Color enum, áp dụng qua [data-sd-color] + SCSS override MDC vars.\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly viewed = input(false, { transform: booleanAttribute });\n readonly inlineError = input<string, string | null | undefined>('', {\n transform: (v): string => v ?? '',\n });\n\n // Two-way model\n readonly model = model<unknown>(undefined);\n\n // Outputs (sdChange is in addition to auto-generated modelChange from `model` signal)\n readonly sdChange = output<unknown>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-checkbox-${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\n constructor() {\n // why: external [name] override falls back to generated uuid only when truthy\n effect(() => {\n const val = this.name();\n if (val) this.#name = val;\n });\n\n effect(() => {\n if (this.disabled()) this.formControl.disable();\n else this.formControl.enable();\n });\n\n effect(() => {\n const value = this.model();\n if (this.#model !== value) {\n this.#model = value;\n this.formControl.setValue(value, { emitEvent: false });\n }\n });\n\n effect(() => {\n // touch dependency so validator re-attaches when inlineError changes\n this.inlineError();\n this.#updateValidator();\n });\n }\n\n ngAfterViewInit() {\n this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));\n this.form()?.addControl(this.#name, this.formControl);\n this.#ref.detectChanges();\n }\n\n ngOnDestroy() {\n this.form()?.removeControl(this.#name);\n this.#subscription.unsubscribe();\n }\n\n #onChange = (value: unknown) => {\n this.#model = value;\n this.model.set(value);\n this.sdChange.emit(value);\n };\n\n #updateValidator = () => {\n this.formControl.clearValidators();\n const validators: ValidatorFn[] = [];\n\n if (this.inlineError()) {\n validators.push(SdInlineErrorValidator);\n }\n this.formControl.setValidators(validators);\n this.formControl.updateValueAndValidity();\n };\n}\n","@if (viewed()) {\n @if (label()) {\n <div class=\"T14R text-black400\">{{ label() }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.checkbox.checked' : 'core.form.checkbox.unchecked') | translate }}</div>\n} @else {\n <mat-checkbox\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\">\n {{ label() }}\n </mat-checkbox>\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAyCa,UAAU,CAAA;AACZ,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEzC,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,EAAE,EAAE,EAAE;AACpB,IAAA,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE;AACjB,IAAA,WAAW,GAAG,IAAI,WAAW,EAAE;AAC/B,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;AAClC,IAAA,MAAM;;AAGG,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,CAA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AA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,iBAAiB,+aAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;4FAEnG,UAAU,EAAA,UAAA,EAAA,CAAA;kBAjBtB,SAAS;+BACE,aAAa,EAAA,UAAA,EAGX,IAAI,EAAA,IAAA,EACV;;;AAGJ,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,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,knBAAA,EAAA,MAAA,EAAA,CAAA,wpLAAA,CAAA,EAAA;;;AEvCjH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-forms-checkbox.mjs","sources":["../../../projects/sdcorejs-angular/forms/checkbox/src/checkbox.component.ts","../../../projects/sdcorejs-angular/forms/checkbox/src/checkbox.component.html","../../../projects/sdcorejs-angular/forms/checkbox/sdcorejs-angular-forms-checkbox.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n OnDestroy,\n output,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, NgForm, ReactiveFormsModule, ValidatorFn } from '@angular/forms';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';\nimport { sdFormControlState, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';\nimport { Color } from '@sdcorejs/utils/models';\nimport { TranslatePipe } from '@sdcorejs/angular/i18n';\nimport { Subscription } from 'rxjs';\nimport * as uuid from 'uuid';\n\n@Component({\n selector: 'sd-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n standalone: true,\n host: {\n // why: host class .sd-c-<x> + default sd-c-primary cho fallback. Thay data-sd-color\n // để tránh edge case host-attr-binding không reactive trong vài cảnh build pipeline.\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: [CommonModule, FormsModule, ReactiveFormsModule, MatFormFieldModule, MatCheckboxModule, TranslatePipe],\n})\nexport class SdCheckbox implements OnDestroy, AfterViewInit {\n readonly #ref = inject(ChangeDetectorRef);\n\n id = `I${uuid.v4()}`;\n #name = uuid.v4();\n formControl = new FormControl();\n #subscription = new Subscription();\n #model: unknown;\n\n // Inputs — all accept null|undefined at the boundary, transform to canonical shape\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 // why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.\n // Transform once at the input boundary so the rest of the component only deals with FormGroup.\n readonly form = input<FormGroup | undefined, any>(undefined, {\n transform: (val: any): FormGroup | undefined => {\n if (!val) return undefined;\n if (val instanceof NgForm) return val.form;\n if (val instanceof FormGroup) return val;\n if (val?.form instanceof FormGroup) return val.form;\n return undefined;\n },\n });\n readonly label = input<string | undefined, string | null | undefined>(undefined, {\n transform: (v): string | undefined => v ?? undefined,\n });\n // why: full Color enum, áp dụng qua [data-sd-color] + SCSS override MDC vars.\n readonly color = input<Color, Color | null | undefined>('primary', {\n transform: (v): Color => v || 'primary',\n });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly viewed = input(false, { transform: booleanAttribute });\n readonly inlineError = input<string, string | null | undefined>('', {\n transform: (v): string => v ?? '',\n });\n\n // Two-way model\n readonly model = model<unknown>(undefined);\n\n // Outputs (sdChange is in addition to auto-generated modelChange from `model` signal)\n readonly sdChange = output<unknown>();\n\n // Computed (template bindings)\n readonly autoId = computed(() => (this.autoIdInput() ? `forms-checkbox-${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\n constructor() {\n // why: external [name] override falls back to generated uuid only when truthy\n effect(() => {\n const val = this.name();\n if (val) this.#name = val;\n });\n\n effect(() => {\n if (this.disabled()) this.formControl.disable();\n else this.formControl.enable();\n });\n\n effect(() => {\n const value = this.model();\n if (this.#model !== value) {\n this.#model = value;\n this.formControl.setValue(value, { emitEvent: false });\n }\n });\n\n effect(() => {\n // touch dependency so validator re-attaches when inlineError changes\n this.inlineError();\n this.#updateValidator();\n });\n }\n\n ngAfterViewInit() {\n this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));\n this.form()?.addControl(this.#name, this.formControl);\n this.#ref.detectChanges();\n }\n\n ngOnDestroy() {\n this.form()?.removeControl(this.#name);\n this.#subscription.unsubscribe();\n }\n\n #onChange = (value: unknown) => {\n this.#model = value;\n this.model.set(value);\n this.sdChange.emit(value);\n };\n\n #updateValidator = () => {\n this.formControl.clearValidators();\n const validators: ValidatorFn[] = [];\n\n if (this.inlineError()) {\n validators.push(SdInlineErrorValidator);\n }\n this.formControl.setValidators(validators);\n this.formControl.updateValueAndValidity();\n };\n}\n","@if (viewed()) {\n @if (label()) {\n <div class=\"T14R text-black400\">{{ label() }}</div>\n }\n <div class=\"T14M\">{{ (model() ? 'core.form.checkbox.checked' : 'core.form.checkbox.unchecked') | translate }}</div>\n} @else {\n <mat-checkbox\n [formControl]=\"formControl\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\">\n {{ label() }}\n </mat-checkbox>\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\n <mat-error>\n {{ inlineError() }}\n </mat-error>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAyCa,UAAU,CAAA;AACZ,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEzC,IAAA,EAAE,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,EAAE,EAAE,EAAE;AACpB,IAAA,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE;AACjB,IAAA,WAAW,GAAG,IAAI,WAAW,EAAE;AAC/B,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;AAClC,IAAA,MAAM;;AAGG,IAAA,WAAW,GAAG,KAAK,CAAgD,SAAS,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,aAAA,EAAA,8BAAA,EAAA,CAAA,EACnF,KAAK,EAAE,QAAQ;QACf,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,EAAA,CACpD;AACO,IAAA,IAAI,GAAG,KAAK,CAAgD,SAAS,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,MAAA,EAAA,8BAAA,EAAA,CAAA,EAC5E,SAAS,EAAE,CAAC,CAAC,KAAyB,CAAC,IAAI,SAAS,GACpD;;;IAGO,IAAI,GAAG,KAAK,CAA6B,SAAS,EAAA,EAAA,I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
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdRemovableChipPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
43
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: SdRemovableChipPipe, isStandalone: true, name: "sdRemovableChip" });
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdRemovableChipPipe, decorators: [{
|
|
46
46
|
type: Pipe,
|
|
47
47
|
args: [{
|
|
48
48
|
name: 'sdRemovableChip'
|
|
@@ -65,96 +65,61 @@ class SdChipCalendar {
|
|
|
65
65
|
#subscription = new Subscription();
|
|
66
66
|
#name = uuid.v4();
|
|
67
67
|
#isBlurring = false;
|
|
68
|
-
menuTrigger = viewChild(MatMenuTrigger, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : []));
|
|
69
|
-
calendar = viewChild(MatCalendar, ...(ngDevMode ? [{ debugName: "calendar" }] : []));
|
|
70
|
-
autoIdInput = input(undefined, ...(ngDevMode ?
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
transform: (v) => v ?? undefined,
|
|
74
|
-
}]));
|
|
75
|
-
autoId = computed(() => (this.autoIdInput() ? `forms-chip-calendar-${this.autoIdInput()}` : undefined), ...(ngDevMode ? [{ debugName: "autoId" }] : []));
|
|
68
|
+
menuTrigger = viewChild(MatMenuTrigger, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : /* istanbul ignore next */ []));
|
|
69
|
+
calendar = viewChild(MatCalendar, ...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
|
|
70
|
+
autoIdInput = input(undefined, { ...(ngDevMode ? { debugName: "autoIdInput" } : /* istanbul ignore next */ {}), alias: 'autoId',
|
|
71
|
+
transform: (v) => v ?? undefined });
|
|
72
|
+
autoId = computed(() => (this.autoIdInput() ? `forms-chip-calendar-${this.autoIdInput()}` : undefined), ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
76
73
|
#state = sdFormControlState(computed(() => this.formControl));
|
|
77
|
-
dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataDisabled" }] : []));
|
|
78
|
-
dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataEmpty" }] : []));
|
|
79
|
-
dataValue = computed(() => sdSerializeDataValue(this.#state().value), ...(ngDevMode ? [{ debugName: "dataValue" }] : []));
|
|
74
|
+
dataDisabled = computed(() => (this.#state().disabled ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataDisabled" }] : /* istanbul ignore next */ []));
|
|
75
|
+
dataEmpty = computed(() => (sdIsEmpty(this.#state().value) ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataEmpty" }] : /* istanbul ignore next */ []));
|
|
76
|
+
dataValue = computed(() => sdSerializeDataValue(this.#state().value), ...(ngDevMode ? [{ debugName: "dataValue" }] : /* istanbul ignore next */ []));
|
|
80
77
|
dataCount = computed(() => {
|
|
81
78
|
const v = this.#state().value;
|
|
82
79
|
return String(Array.isArray(v) ? v.length : 0);
|
|
83
|
-
}, ...(ngDevMode ? [{ debugName: "dataCount" }] : []));
|
|
84
|
-
dataRequired = computed(() => (this.required() ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataRequired" }] : []));
|
|
80
|
+
}, ...(ngDevMode ? [{ debugName: "dataCount" }] : /* istanbul ignore next */ []));
|
|
81
|
+
dataRequired = computed(() => (this.required() ? 'true' : 'false'), ...(ngDevMode ? [{ debugName: "dataRequired" }] : /* istanbul ignore next */ []));
|
|
85
82
|
dataErrorMessage = computed(() => {
|
|
86
83
|
void this.#state();
|
|
87
84
|
const msg = this.errorMessage();
|
|
88
85
|
return msg && msg.length > 0 ? msg : null;
|
|
89
|
-
}, ...(ngDevMode ? [{ debugName: "dataErrorMessage" }] : []));
|
|
90
|
-
name = input(undefined, ...(ngDevMode ?
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
transform: (v) => v || 'outline',
|
|
95
|
-
}]));
|
|
96
|
-
floatLabel = input('auto', ...(ngDevMode ? [{ debugName: "floatLabel", transform: (v) => v || 'auto' }] : [{
|
|
97
|
-
transform: (v) => v || 'auto',
|
|
98
|
-
}]));
|
|
99
|
-
size = input('md', ...(ngDevMode ? [{ debugName: "size", transform: (v) => v || 'md' }] : [{
|
|
100
|
-
transform: (v) => v || 'md',
|
|
101
|
-
}]));
|
|
86
|
+
}, ...(ngDevMode ? [{ debugName: "dataErrorMessage" }] : /* istanbul ignore next */ []));
|
|
87
|
+
name = input(undefined, { ...(ngDevMode ? { debugName: "name" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
|
|
88
|
+
appearance = input('outline', { ...(ngDevMode ? { debugName: "appearance" } : /* istanbul ignore next */ {}), transform: (v) => v || 'outline' });
|
|
89
|
+
floatLabel = input('auto', { ...(ngDevMode ? { debugName: "floatLabel" } : /* istanbul ignore next */ {}), transform: (v) => v || 'auto' });
|
|
90
|
+
size = input('md', { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), transform: (v) => v || 'md' });
|
|
102
91
|
// why: parent may bind NgForm (template-driven), FormGroup (reactive), or a wrapper with `.form`.
|
|
103
92
|
// Transform once at the input boundary so the rest of the component only deals with FormGroup.
|
|
104
|
-
form = input(undefined, ...(ngDevMode ?
|
|
105
|
-
|
|
106
|
-
return undefined;
|
|
107
|
-
if (val instanceof NgForm)
|
|
108
|
-
return val.form;
|
|
109
|
-
if (val instanceof FormGroup)
|
|
110
|
-
return val;
|
|
111
|
-
if (val?.form instanceof FormGroup)
|
|
112
|
-
return val.form;
|
|
93
|
+
form = input(undefined, { ...(ngDevMode ? { debugName: "form" } : /* istanbul ignore next */ {}), transform: (val) => {
|
|
94
|
+
if (!val)
|
|
113
95
|
return undefined;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}]));
|
|
133
|
-
removable = input(true, ...(ngDevMode ? [{ debugName: "removable", transform: (v) => v ?? true }] : [{
|
|
134
|
-
transform: (v) => v ?? true,
|
|
135
|
-
}]));
|
|
136
|
-
hideInlineError = input(false, ...(ngDevMode ? [{ debugName: "hideInlineError", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
137
|
-
required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
138
|
-
min = input(0, ...(ngDevMode ? [{ debugName: "min", transform: (v) => v ?? 0 }] : [{
|
|
139
|
-
transform: (v) => v ?? 0,
|
|
140
|
-
}]));
|
|
141
|
-
max = input(0, ...(ngDevMode ? [{ debugName: "max", transform: (v) => v ?? 0 }] : [{
|
|
142
|
-
transform: (v) => v ?? 0,
|
|
143
|
-
}]));
|
|
144
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
145
|
-
viewed = input(false, ...(ngDevMode ? [{ debugName: "viewed", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
146
|
-
hyperlink = input(undefined, ...(ngDevMode ? [{ debugName: "hyperlink", transform: (v) => v ?? undefined }] : [{
|
|
147
|
-
transform: (v) => v ?? undefined,
|
|
148
|
-
}]));
|
|
96
|
+
if (val instanceof NgForm)
|
|
97
|
+
return val.form;
|
|
98
|
+
if (val instanceof FormGroup)
|
|
99
|
+
return val;
|
|
100
|
+
if (val?.form instanceof FormGroup)
|
|
101
|
+
return val.form;
|
|
102
|
+
return undefined;
|
|
103
|
+
} });
|
|
104
|
+
label = input('', { ...(ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {}), transform: (v) => v ?? '' });
|
|
105
|
+
placeholder = input(undefined, { ...(ngDevMode ? { debugName: "placeholder" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
|
|
106
|
+
removable = input(true, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: (v) => v ?? true });
|
|
107
|
+
hideInlineError = input(false, { ...(ngDevMode ? { debugName: "hideInlineError" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
108
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
109
|
+
min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
|
|
110
|
+
max = input(0, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
|
|
111
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
112
|
+
viewed = input(false, { ...(ngDevMode ? { debugName: "viewed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
113
|
+
hyperlink = input(undefined, { ...(ngDevMode ? { debugName: "hyperlink" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
|
|
149
114
|
// Two-way model
|
|
150
|
-
model = model(undefined, ...(ngDevMode ? [{ debugName: "model" }] : []));
|
|
115
|
+
model = model(undefined, ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
151
116
|
// Outputs (modelChange auto-generated by model() signal)
|
|
152
117
|
sdChange = output();
|
|
153
|
-
input = viewChild('input', ...(ngDevMode ? [{ debugName: "input" }] : []));
|
|
154
|
-
sdViewDef = contentChild(SdViewDefDirective, ...(ngDevMode ? [{ debugName: "sdViewDef" }] : []));
|
|
155
|
-
sdLabelDef = contentChild(SdLabelDefDirective, ...(ngDevMode ? [{ debugName: "sdLabelDef" }] : []));
|
|
156
|
-
sdLabelTemplate = contentChild('sdLabel', ...(ngDevMode ? [{ debugName: "sdLabelTemplate" }] : []));
|
|
157
|
-
sdValueTemplate = contentChild('sdValue', ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : []));
|
|
118
|
+
input = viewChild('input', ...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
|
|
119
|
+
sdViewDef = contentChild(SdViewDefDirective, ...(ngDevMode ? [{ debugName: "sdViewDef" }] : /* istanbul ignore next */ []));
|
|
120
|
+
sdLabelDef = contentChild(SdLabelDefDirective, ...(ngDevMode ? [{ debugName: "sdLabelDef" }] : /* istanbul ignore next */ []));
|
|
121
|
+
sdLabelTemplate = contentChild('sdLabel', ...(ngDevMode ? [{ debugName: "sdLabelTemplate" }] : /* istanbul ignore next */ []));
|
|
122
|
+
sdValueTemplate = contentChild('sdValue', ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : /* istanbul ignore next */ []));
|
|
158
123
|
isFocused = false;
|
|
159
124
|
#inputControl = new FormControl();
|
|
160
125
|
#formControl = new SdFormControl();
|
|
@@ -210,7 +175,7 @@ class SdChipCalendar {
|
|
|
210
175
|
if (errors['maxlength'])
|
|
211
176
|
return this.#i18n.t('core.form.chip-calendar.maxlength', { max: this.max() });
|
|
212
177
|
return undefined;
|
|
213
|
-
}, ...(ngDevMode ? [{ debugName: "errorMessage" }] : []));
|
|
178
|
+
}, ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
214
179
|
get matcher() {
|
|
215
180
|
return this.#matcher;
|
|
216
181
|
}
|
|
@@ -342,10 +307,10 @@ class SdChipCalendar {
|
|
|
342
307
|
onSelectDate = (date) => this.#selectDate(date);
|
|
343
308
|
onCloseCalendar = () => this.#closeCalendar();
|
|
344
309
|
dateClass = (cellDate) => this.#dateClass(cellDate);
|
|
345
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
346
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.23", type: SdChipCalendar, isStandalone: true, selector: "sd-chip-calendar", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", 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 }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", 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-has-label": "!!label()", "class.sd-viewed": "viewed()" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }, { propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _lbl = label();\n@let _app = appearance();\n@let _req = required();\n@let _viewed = viewed();\n@let _hideErr = hideInlineError();\n@let _viewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\n@let _errMsg = errorMessage();\n\n@if (_viewed) {\n <sd-view\n [label]=\"_lbl\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"formControl.value\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if (!_app && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if (!_app && _lbl && !_labelTemplate) {\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewDef?.templateRef\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n @if (_viewDef?.templateRef && !isFocused) {\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\n } @else {\n <mat-form-field\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideErr\"\n [appearance]=\"_app\"\n [floatLabel]=\"floatLabel()\">\n @if (_app && _lbl) {\n <mat-label>{{ _lbl }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\n @for (item of formControl.value; track item) {\n @if (item) {\n <mat-chip-row\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [removable]=\"removable()\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\n <mat-icon matChipRemove>cancel</mat-icon>\n }\n </mat-chip-row>\n }\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder() || _lbl\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [matMenuTriggerFor]=\"calendarMenu\"\n [required]=\"_req\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n readonly\n #input />\n </mat-chip-grid>\n\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\n <div style=\"width: 280px\" (click)=\"$event.stopPropagation()\" aria-hidden=\"true\">\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\n </div>\n </mat-menu>\n @if (_hideErr && _errMsg && formControl.touched) {\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\n }\n\n @if (!_hideErr && _errMsg && formControl.touched) {\n <mat-error>{{ _errMsg }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}mat-form-field{width:100%}mat-chip-listbox{display:flex;flex-wrap:wrap;gap:4px}::ng-deep .sd-chip-calendar-selected-date .mat-calendar-body-cell-content{background-color:var(--sd-primary-light)!important;color:var(--sd-primary)!important;border-radius:50%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i6.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i6.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i6.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i7.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
310
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdChipCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
311
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: SdChipCalendar, isStandalone: true, selector: "sd-chip-calendar", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", 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 }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", 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-has-label": "!!label()", "class.sd-viewed": "viewed()" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }, { propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _lbl = label();\n@let _app = appearance();\n@let _req = required();\n@let _viewed = viewed();\n@let _hideErr = hideInlineError();\n@let _viewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\n@let _errMsg = errorMessage();\n\n@if (_viewed) {\n <sd-view\n [label]=\"_lbl\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"formControl.value\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if (!_app && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if (!_app && _lbl && !_labelTemplate) {\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewDef?.templateRef\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n @if (_viewDef?.templateRef && !isFocused) {\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\n } @else {\n <mat-form-field\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideErr\"\n [appearance]=\"_app\"\n [floatLabel]=\"floatLabel()\">\n @if (_app && _lbl) {\n <mat-label>{{ _lbl }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\n @for (item of formControl.value; track item) {\n @if (item) {\n <mat-chip-row\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [removable]=\"removable()\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\n <mat-icon matChipRemove>cancel</mat-icon>\n }\n </mat-chip-row>\n }\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [placeholder]=\"placeholder() || _lbl\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [matMenuTriggerFor]=\"calendarMenu\"\n [required]=\"_req\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n readonly\n #input />\n </mat-chip-grid>\n\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\n <div style=\"width: 280px\" (click)=\"$event.stopPropagation()\" aria-hidden=\"true\">\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\n </div>\n </mat-menu>\n @if (_hideErr && _errMsg && formControl.touched) {\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\n }\n\n @if (!_hideErr && _errMsg && formControl.touched) {\n <mat-error>{{ _errMsg }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n}\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}:host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}mat-form-field{width:100%}mat-chip-listbox{display:flex;flex-wrap:wrap;gap:4px}::ng-deep .sd-chip-calendar-selected-date .mat-calendar-body-cell-content{background-color:var(--sd-primary-light)!important;color:var(--sd-primary)!important;border-radius:50%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i6.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i6.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i6.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i7.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
347
312
|
}
|
|
348
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: SdChipCalendar, decorators: [{
|
|
349
314
|
type: Component,
|
|
350
315
|
args: [{ selector: 'sd-chip-calendar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: { '[class.sd-has-label]': '!!label()', '[class.sd-viewed]': 'viewed()' }, imports: [
|
|
351
316
|
CommonModule,
|