@sd-angular/core 19.0.0-beta.7 → 19.0.0-beta.71
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 +686 -33
- package/assets/scss/ckeditor5.scss +61 -4
- package/assets/scss/core/bootstrap.scss +17 -0
- package/assets/scss/core/form.scss +32 -6
- package/assets/scss/core/grid.scss +40 -0
- package/assets/scss/sd-core.scss +1 -0
- package/assets/scss/themes/material-theme.scss +82 -40
- package/components/anchor-v2/src/components/anchor-item-v2/anchor-item-v2.component.d.ts +5 -5
- package/components/anchor-v2/src/models/sd-anchor-v2.model.d.ts +3 -3
- package/components/avatar/index.d.ts +1 -0
- package/components/avatar/src/avatar.component.d.ts +19 -0
- package/components/badge/src/badge.component.d.ts +77 -19
- package/components/button/src/button.component.d.ts +30 -28
- package/components/code-editor/index.d.ts +1 -0
- package/components/code-editor/src/code-editor.component.d.ts +25 -0
- package/components/document-builder/index.d.ts +1 -0
- package/components/document-builder/src/document-builder.component.d.ts +12 -41
- package/components/document-builder/src/document-builder.model.d.ts +14 -11
- package/components/document-builder/src/plugins/block-space/block-space.plugin.d.ts +9 -0
- package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.d.ts +44 -0
- package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.model.d.ts +57 -0
- package/components/document-builder/src/plugins/heading/heading.plugin.d.ts +1 -0
- package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
- package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
- package/components/document-builder/src/plugins/index.d.ts +7 -2
- package/components/document-builder/src/plugins/page-orientation/page-orientation.plugin.d.ts +2 -2
- package/components/document-builder/src/plugins/paste-handler/filters/bookmark.d.ts +14 -0
- package/components/document-builder/src/plugins/paste-handler/filters/br.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/image.d.ts +25 -0
- package/components/document-builder/src/plugins/paste-handler/filters/list.d.ts +29 -0
- package/components/document-builder/src/plugins/paste-handler/filters/parse.d.ts +35 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removeboldwrapper.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removegooglesheetstag.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removeinvalidtablewidth.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removemsattributes.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removestyleblock.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removexmlns.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/replacemsfootnotes.d.ts +54 -0
- package/components/document-builder/src/plugins/paste-handler/filters/replacetabswithinprewithspaces.d.ts +24 -0
- package/components/document-builder/src/plugins/paste-handler/filters/space.d.ts +27 -0
- package/components/document-builder/src/plugins/paste-handler/filters/table.d.ts +16 -0
- package/components/document-builder/src/plugins/paste-handler/filters/utils.d.ts +25 -0
- package/components/document-builder/src/plugins/paste-handler/index.d.ts +35 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/googledocsnormalizer.d.ts +31 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/googlesheetsnormalizer.d.ts +31 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/mswordnormalizer.d.ts +29 -0
- package/components/document-builder/src/plugins/paste-handler/types.d.ts +30 -0
- package/components/document-builder/src/plugins/table-custom/index.d.ts +34 -0
- package/components/document-builder/src/plugins/variable/variable.plugin.d.ts +39 -0
- package/components/index.d.ts +4 -0
- package/components/mini-editor/index.d.ts +2 -0
- package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
- package/components/mini-editor/src/mini-editor.model.d.ts +44 -0
- package/components/modal/index.d.ts +1 -1
- package/components/modal/src/modal.component.d.ts +24 -0
- package/components/section/index.d.ts +1 -0
- package/components/section/src/section-item/section-item.component.d.ts +7 -0
- package/components/section/src/section.component.d.ts +11 -11
- package/components/side-drawer/src/side-drawer.component.d.ts +11 -24
- package/components/tab-router/src/components/tab-router-item/tab-router-item.component.d.ts +4 -1
- package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +3 -15
- package/components/table/src/components/column-filter/column-filter.component.d.ts +3 -3
- package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +21 -9
- package/components/table/src/components/desktop-cell-view/desktop-cell-view.component.d.ts +21 -7
- package/components/table/src/components/external-filter/external-filter.component.d.ts +1 -1
- package/components/table/src/components/selector-action/action-filter.pipe.d.ts +11 -10
- package/components/table/src/components/selector-action/selector-action.component.d.ts +5 -3
- package/components/table/src/directives/index.d.ts +2 -0
- package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
- package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
- package/components/table/src/models/table-column.model.d.ts +38 -34
- package/components/table/src/models/table-command.model.d.ts +7 -3
- package/components/table/src/models/table-item.model.d.ts +5 -4
- package/components/table/src/models/table-option-config.model.d.ts +5 -0
- package/components/table/src/models/table-option-export.model.d.ts +3 -2
- package/components/table/src/models/table-option-selector.model.d.ts +11 -10
- package/components/table/src/models/table-option.model.d.ts +9 -8
- package/components/table/src/services/index.d.ts +3 -0
- package/components/table/src/services/table-export/table-export.service.d.ts +26 -0
- package/components/table/src/services/table-filter/table-filter.model.d.ts +6 -5
- package/components/table/src/services/table-format/table-format.service.d.ts +16 -0
- package/components/table/src/table.component.d.ts +39 -53
- package/components/upload-file/src/configurations/upload-file.configuration.d.ts +1 -1
- package/components/upload-file/src/services/upload-file.service.d.ts +0 -1
- package/components/upload-file/src/upload-file.component.d.ts +49 -54
- package/components/view/index.d.ts +1 -0
- package/components/view/src/view.component.d.ts +16 -0
- package/components/workflow/src/models/form-generic-component.model.d.ts +5 -4
- package/components/workflow/src/models/index.d.ts +1 -0
- package/directives/index.d.ts +2 -0
- package/directives/src/sd-href.directive.d.ts +9 -0
- package/directives/src/sd-tooltip.directive.d.ts +26 -0
- package/fesm2022/sd-angular-core-components-anchor-v2.mjs +15 -15
- package/fesm2022/sd-angular-core-components-anchor-v2.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-avatar.mjs +103 -0
- package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-badge.mjs +101 -91
- package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-button.mjs +70 -96
- package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-code-editor.mjs +127 -0
- package/fesm2022/sd-angular-core-components-code-editor.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-document-builder.mjs +4006 -611
- package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-history.mjs +1 -1
- package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
- package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-modal.mjs +57 -91
- package/fesm2022/sd-angular-core-components-modal.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-preview.mjs +1 -1
- package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-quick-action.mjs +2 -2
- package/fesm2022/sd-angular-core-components-quick-action.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-section.mjs +41 -43
- package/fesm2022/sd-angular-core-components-section.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-side-drawer.mjs +78 -84
- package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs +152 -226
- package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +1188 -1185
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-upload-file.mjs +339 -444
- package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +45 -0
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-workflow.mjs +47 -57
- package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +4 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-directives.mjs +286 -27
- package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +289 -363
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-chip-calendar.mjs +170 -189
- package/fesm2022/sd-angular-core-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-chip.mjs +184 -194
- package/fesm2022/sd-angular-core-forms-chip.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +180 -242
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +178 -270
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +177 -285
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +210 -337
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +169 -286
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-radio.mjs +3 -2
- package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +390 -447
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +167 -226
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-keycloak.mjs +126 -0
- package/fesm2022/sd-angular-core-modules-keycloak.mjs.map +1 -0
- package/fesm2022/sd-angular-core-modules-layout.mjs +454 -453
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules.mjs +1 -1
- package/fesm2022/sd-angular-core-services-api.mjs +5 -10
- package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +5 -7
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-docx.mjs +173 -0
- package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -0
- package/fesm2022/sd-angular-core-services-notify.mjs +2 -2
- package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services.mjs +1 -0
- package/fesm2022/sd-angular-core-services.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs +21 -45
- package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs +15 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +55 -55
- package/forms/chip/src/chip.component.d.ts +37 -40
- package/forms/chip-calendar/src/chip-calendar.component.d.ts +37 -38
- package/forms/date/src/date.component.d.ts +48 -46
- package/forms/date-range/src/date-range.component.d.ts +35 -34
- package/forms/datetime/src/datetime.component.d.ts +48 -49
- package/forms/input/src/input.component.d.ts +54 -57
- package/forms/input-number/src/input-number.component.d.ts +53 -54
- package/forms/select/src/select.component.d.ts +67 -64
- package/forms/textarea/src/textarea.component.d.ts +40 -43
- package/modules/index.d.ts +1 -1
- package/modules/keycloak/index.d.ts +4 -0
- package/modules/keycloak/keycloak.configuration.d.ts +11 -0
- package/modules/keycloak/keycloak.interceptor.d.ts +2 -0
- package/modules/keycloak/keycloak.module.d.ts +18 -0
- package/modules/keycloak/keycloak.service.d.ts +14 -0
- package/modules/layout/components/layout-main/layout-main.component.d.ts +7 -12
- package/modules/layout/components/page/page.component.d.ts +5 -7
- package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +22 -29
- package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +11 -17
- package/modules/layout/components/sidebar-v1/main.component.d.ts +14 -14
- package/modules/layout/configurations/layout.configuration.d.ts +46 -3
- package/modules/layout/modules/forbidden/pages/root/root.component.d.ts +3 -8
- package/modules/layout/modules/home/components/home-page/home-page.component.d.ts +2 -5
- package/modules/layout/modules/not-found/pages/root/root.component.d.ts +3 -8
- package/modules/layout/pipes/high-light-search.pipe.d.ts +1 -1
- package/modules/layout/services/index.d.ts +1 -0
- package/modules/layout/services/layout.service.d.ts +10 -0
- package/modules/layout/services/menu/menu.model.d.ts +2 -0
- package/modules/layout/services/storage/storage.service.d.ts +0 -3
- package/package.json +87 -64
- package/sd-angular-core-19.0.0-beta.71.tgz +0 -0
- package/services/api/src/api.model.d.ts +6 -1
- package/services/confirm/src/lib/confirm.service.d.ts +1 -0
- package/services/docx/index.d.ts +1 -0
- package/services/docx/src/lib/docx.model.d.ts +9 -0
- package/services/docx/src/lib/docx.service.d.ts +13 -0
- package/services/docx/src/public-api.d.ts +2 -0
- package/services/index.d.ts +1 -0
- package/services/notify/index.d.ts +1 -0
- package/services/notify/src/notify.model.d.ts +1 -1
- package/services/notify/src/notify.service.d.ts +5 -5
- package/utilities/extensions/src/string.extension.d.ts +2 -0
- package/utilities/extensions/src/utility.extension.d.ts +1 -0
- package/utilities/models/index.d.ts +3 -0
- package/utilities/models/src/filter.model.d.ts +17 -4
- package/utilities/models/src/icon.model.d.ts +2 -0
- package/utilities/models/src/nested-key-of.model.d.ts +5 -0
- package/utilities/models/src/order.model.d.ts +2 -1
- package/utilities/models/src/paging.model.d.ts +2 -1
- package/utilities/models/src/pattern.model.d.ts +1 -1
- package/utilities/models/src/unwrap-signal.model.d.ts +6 -0
- package/components/document-builder/src/plugins/comment/comment.plugin.d.ts +0 -4
- package/components/document-builder/src/plugins/table-fit/table-fit.plugin.d.ts +0 -4
- package/components/modal/src/modal/modal.component.d.ts +0 -31
- package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -127
- package/fesm2022/sd-angular-core-modules-oidc.mjs.map +0 -1
- package/modules/oidc/dynamic-sts.loader.d.ts +0 -11
- package/modules/oidc/index.d.ts +0 -2
- package/modules/oidc/oidc.configuration.d.ts +0 -11
- package/modules/oidc/oidc.module.d.ts +0 -14
- package/sd-angular-core-19.0.0-beta.7.tgz +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe,
|
|
2
|
+
import { Pipe, inject, ChangeDetectorRef, input, booleanAttribute, output, contentChild, effect, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
import * as i2 from '@angular/forms';
|
|
7
|
-
import {
|
|
7
|
+
import { FormControl, NgForm, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
9
|
-
import * as
|
|
9
|
+
import * as i6 from '@angular/material/chips';
|
|
10
10
|
import { MatChipsModule } from '@angular/material/chips';
|
|
11
11
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i5 from '@angular/material/icon';
|
|
13
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
14
14
|
import * as i3 from '@angular/material/input';
|
|
15
15
|
import { MatInputModule } from '@angular/material/input';
|
|
16
16
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
17
|
+
import * as i4 from '@angular/material/tooltip';
|
|
17
18
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
19
|
+
import { SdView } from '@sd-angular/core/components/view';
|
|
18
20
|
import { SdViewDefDirective, SdLabelDefDirective } from '@sd-angular/core/forms/directives';
|
|
21
|
+
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
19
22
|
import { SdFormControl } from '@sd-angular/core/forms/models';
|
|
20
23
|
import { Subscription } from 'rxjs';
|
|
21
24
|
import * as uuid from 'uuid';
|
|
@@ -38,7 +41,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
38
41
|
}]
|
|
39
42
|
}], ctorParameters: () => [] });
|
|
40
43
|
|
|
41
|
-
class
|
|
44
|
+
class SdChipErrorStateMatcher {
|
|
42
45
|
formControl;
|
|
43
46
|
constructor(formControl) {
|
|
44
47
|
this.formControl = formControl;
|
|
@@ -49,216 +52,249 @@ class SdChipErrotStateMatcher {
|
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
class SdChip {
|
|
52
|
-
ref;
|
|
53
|
-
|
|
54
|
-
set _autoId(val) {
|
|
55
|
-
if (!val) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.autoId = `forms-chip-${val}`;
|
|
59
|
-
}
|
|
55
|
+
#ref = inject(ChangeDetectorRef);
|
|
56
|
+
#subscription = new Subscription();
|
|
60
57
|
#name = uuid.v4();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
#form;
|
|
59
|
+
// Signals - inputs
|
|
60
|
+
autoId = input();
|
|
61
|
+
name = input();
|
|
62
|
+
appearance = input('outline');
|
|
63
|
+
floatLabel = input('auto');
|
|
64
|
+
size = input('md');
|
|
65
|
+
form = input();
|
|
66
|
+
label = input('');
|
|
67
|
+
placeholder = input();
|
|
68
|
+
removable = input(true);
|
|
69
|
+
hideInlineError = input(false, { transform: booleanAttribute });
|
|
70
|
+
model = input();
|
|
71
|
+
required = input(false, { transform: booleanAttribute });
|
|
72
|
+
min = input(0);
|
|
73
|
+
max = input(0);
|
|
74
|
+
addable = input(true, { transform: booleanAttribute });
|
|
75
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
76
|
+
viewed = input(false, { transform: booleanAttribute });
|
|
77
|
+
hyperlink = input();
|
|
78
|
+
// Signals - outputs
|
|
79
|
+
modelChange = output();
|
|
80
|
+
sdChange = output();
|
|
81
|
+
// Template properties
|
|
82
|
+
input;
|
|
83
|
+
sdViewDef = contentChild(SdViewDefDirective);
|
|
84
|
+
sdLabelDef = contentChild(SdLabelDefDirective);
|
|
85
|
+
sdLabelTemplate = contentChild('sdLabel');
|
|
86
|
+
sdValueTemplate = contentChild('sdValue');
|
|
87
|
+
// Local states
|
|
88
|
+
#isBlurring = false;
|
|
89
|
+
isFocused = false;
|
|
90
|
+
#inputControl = new FormControl();
|
|
91
|
+
#formControl = new SdFormControl();
|
|
92
|
+
#matcher;
|
|
67
93
|
separatorKeysCodes = [ENTER, COMMA];
|
|
68
94
|
selectable = true;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
|
|
95
|
+
constructor() {
|
|
96
|
+
// Update form reference
|
|
97
|
+
effect(() => {
|
|
98
|
+
const formInput = this.form();
|
|
99
|
+
if (formInput) {
|
|
100
|
+
if (formInput instanceof NgForm) {
|
|
101
|
+
this.#form = formInput.form;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.#form = formInput;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// Update validators
|
|
109
|
+
effect(() => {
|
|
110
|
+
this.required();
|
|
111
|
+
this.min();
|
|
112
|
+
this.max();
|
|
113
|
+
this.#updateValidator();
|
|
114
|
+
});
|
|
115
|
+
// Update model
|
|
116
|
+
effect(() => {
|
|
117
|
+
const values = this.model();
|
|
118
|
+
if (Array.isArray(values)) {
|
|
119
|
+
this.#formControl.setValue(values);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
// Handle disabled state
|
|
123
|
+
effect(() => {
|
|
124
|
+
const isDisabled = this.disabled();
|
|
125
|
+
if (isDisabled) {
|
|
126
|
+
this.#formControl.disable();
|
|
127
|
+
this.#inputControl.disable();
|
|
75
128
|
}
|
|
76
129
|
else {
|
|
77
|
-
this.#
|
|
130
|
+
this.#formControl.enable();
|
|
131
|
+
this.#inputControl.enable();
|
|
78
132
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this
|
|
94
|
-
}
|
|
95
|
-
// Model
|
|
96
|
-
set model(values) {
|
|
97
|
-
if (!Array.isArray(values)) {
|
|
98
|
-
values = [];
|
|
99
|
-
}
|
|
100
|
-
this.formControl.setValue(values);
|
|
101
|
-
}
|
|
102
|
-
// Validator
|
|
103
|
-
required = false;
|
|
104
|
-
set _required(val) {
|
|
105
|
-
this.required = val === '' || !!val;
|
|
106
|
-
this.#updateValidator();
|
|
133
|
+
});
|
|
134
|
+
// Setup auto id and name
|
|
135
|
+
effect(() => {
|
|
136
|
+
const autoIdVal = this.autoId();
|
|
137
|
+
if (autoIdVal) {
|
|
138
|
+
// autoId is just for form association, no further processing needed
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
effect(() => {
|
|
142
|
+
const nameVal = this.name();
|
|
143
|
+
if (nameVal) {
|
|
144
|
+
this.#name = nameVal;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
this.#matcher = new SdChipErrorStateMatcher(this.#formControl);
|
|
107
148
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.min = +val || 0;
|
|
111
|
-
this.#updateValidator();
|
|
149
|
+
get formControl() {
|
|
150
|
+
return this.#formControl;
|
|
112
151
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
this.max = +val || 0;
|
|
116
|
-
this.#updateValidator();
|
|
152
|
+
get inputControl() {
|
|
153
|
+
return this.#inputControl;
|
|
117
154
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.
|
|
128
|
-
|
|
129
|
-
}
|
|
155
|
+
get errorTooltipMessage() {
|
|
156
|
+
const errors = this.#formControl.errors;
|
|
157
|
+
if (!errors)
|
|
158
|
+
return undefined;
|
|
159
|
+
if (errors['required'])
|
|
160
|
+
return 'Vui lòng nhập thông tin';
|
|
161
|
+
if (errors['minlength'])
|
|
162
|
+
return `Vui lòng nhập ít nhất ${this.min()} giá trị`;
|
|
163
|
+
if (errors['maxlength'])
|
|
164
|
+
return `Vui lòng nhập tối đa ${this.max()} giá trị`;
|
|
165
|
+
return undefined;
|
|
130
166
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
sdView;
|
|
134
|
-
sdLabelDef;
|
|
135
|
-
isBlurring = false;
|
|
136
|
-
isFocused = false;
|
|
137
|
-
inputControl = new FormControl();
|
|
138
|
-
formControl = new SdFormControl();
|
|
139
|
-
matcher = new SdChipErrotStateMatcher(this.formControl);
|
|
140
|
-
#subscription = new Subscription();
|
|
141
|
-
constructor(ref) {
|
|
142
|
-
this.ref = ref;
|
|
167
|
+
get matcher() {
|
|
168
|
+
return this.#matcher;
|
|
143
169
|
}
|
|
144
170
|
ngAfterViewInit() {
|
|
145
|
-
this.#subscription.add(this
|
|
146
|
-
this
|
|
171
|
+
this.#subscription.add(this.#formControl.sdChanges.subscribe(() => {
|
|
172
|
+
this.#ref.markForCheck();
|
|
147
173
|
}));
|
|
148
|
-
this.#form?.addControl(this.#name, this
|
|
174
|
+
this.#form?.addControl(this.#name, this.#formControl);
|
|
149
175
|
}
|
|
150
176
|
ngOnDestroy() {
|
|
151
177
|
this.#form?.removeControl(this.#name);
|
|
152
178
|
this.#subscription.unsubscribe();
|
|
153
179
|
}
|
|
154
180
|
#updateValidator = () => {
|
|
155
|
-
this
|
|
156
|
-
this
|
|
181
|
+
this.#formControl.clearValidators();
|
|
182
|
+
this.#formControl.clearAsyncValidators();
|
|
157
183
|
const validators = [];
|
|
158
184
|
const asyncValidators = [];
|
|
159
|
-
if (this.required) {
|
|
185
|
+
if (this.required()) {
|
|
160
186
|
validators.push(Validators.required);
|
|
161
187
|
}
|
|
162
|
-
if (this.min > 0) {
|
|
163
|
-
validators.push(Validators.minLength(this.min));
|
|
188
|
+
if (this.min() > 0) {
|
|
189
|
+
validators.push(Validators.minLength(this.min()));
|
|
164
190
|
}
|
|
165
|
-
if (this.max > 0) {
|
|
166
|
-
validators.push(Validators.maxLength(this.max));
|
|
191
|
+
if (this.max() > 0) {
|
|
192
|
+
validators.push(Validators.maxLength(this.max()));
|
|
167
193
|
}
|
|
168
|
-
this
|
|
169
|
-
this
|
|
170
|
-
this
|
|
194
|
+
this.#formControl.setValidators(validators);
|
|
195
|
+
this.#formControl.setAsyncValidators(asyncValidators);
|
|
196
|
+
this.#formControl.updateValueAndValidity();
|
|
171
197
|
};
|
|
172
|
-
|
|
198
|
+
#add = (event) => {
|
|
173
199
|
const value = (event.value ?? '').toString().trim();
|
|
174
|
-
const values = this
|
|
175
|
-
if (value && this.addable && !values.includes(value)) {
|
|
200
|
+
const values = this.#formControl.value ?? [];
|
|
201
|
+
if (value && this.addable() && !values.includes(value)) {
|
|
176
202
|
values.push(value);
|
|
177
|
-
this
|
|
178
|
-
this.modelChange.emit(this
|
|
179
|
-
this.sdChange.emit(this
|
|
203
|
+
this.#formControl.setValue(values);
|
|
204
|
+
this.modelChange.emit(this.#formControl.value);
|
|
205
|
+
this.sdChange.emit(this.#formControl.value);
|
|
180
206
|
}
|
|
181
207
|
this.input.nativeElement.value = '';
|
|
182
|
-
this
|
|
208
|
+
this.#inputControl.setValue('');
|
|
183
209
|
};
|
|
184
|
-
|
|
210
|
+
#clickChip = ($event, item) => {
|
|
185
211
|
$event.stopPropagation();
|
|
186
212
|
$event.stopImmediatePropagation();
|
|
187
|
-
if (!this
|
|
188
|
-
this
|
|
213
|
+
if (!this.#formControl.disabled) {
|
|
214
|
+
this.#focus();
|
|
189
215
|
}
|
|
190
216
|
};
|
|
191
|
-
|
|
192
|
-
const values = this
|
|
217
|
+
#remove = (item) => {
|
|
218
|
+
const values = this.#formControl.value ?? [];
|
|
193
219
|
if (typeof item === 'string' || typeof item === 'number') {
|
|
194
|
-
this
|
|
195
|
-
this.modelChange.emit(this
|
|
196
|
-
this.sdChange.emit(this
|
|
220
|
+
this.#formControl.setValue(values.filter(value => item !== value));
|
|
221
|
+
this.modelChange.emit(this.#formControl.value);
|
|
222
|
+
this.sdChange.emit(this.#formControl.value);
|
|
197
223
|
}
|
|
198
|
-
this
|
|
199
|
-
this
|
|
224
|
+
this.#inputControl.setValue('');
|
|
225
|
+
this.#focus();
|
|
200
226
|
};
|
|
201
|
-
|
|
227
|
+
#select = (event) => {
|
|
202
228
|
const item = event.option.value;
|
|
203
|
-
const values = this
|
|
229
|
+
const values = this.#formControl.value ?? [];
|
|
204
230
|
if (item) {
|
|
205
231
|
if (typeof item === 'string' || typeof item === 'number') {
|
|
206
232
|
if (!values.includes(item)) {
|
|
207
233
|
values.push(item);
|
|
208
|
-
this
|
|
209
|
-
this.modelChange.emit(this
|
|
210
|
-
this.sdChange.emit(this
|
|
234
|
+
this.#formControl.setValue(values);
|
|
235
|
+
this.modelChange.emit(this.#formControl.value);
|
|
236
|
+
this.sdChange.emit(this.#formControl.value);
|
|
211
237
|
}
|
|
212
238
|
}
|
|
213
239
|
this.input.nativeElement.value = '';
|
|
214
|
-
this
|
|
240
|
+
this.#inputControl.setValue('', {
|
|
215
241
|
emitEvent: false,
|
|
216
242
|
});
|
|
217
243
|
}
|
|
218
244
|
};
|
|
219
|
-
onFocus = () => {
|
|
245
|
+
#onFocus = () => {
|
|
220
246
|
this.isFocused = true;
|
|
221
|
-
this
|
|
222
|
-
this
|
|
247
|
+
this.#isBlurring = false;
|
|
248
|
+
this.#inputControl.setValue('');
|
|
223
249
|
};
|
|
224
|
-
onBlur = () => {
|
|
225
|
-
this
|
|
250
|
+
#onBlur = () => {
|
|
251
|
+
this.#isBlurring = true;
|
|
226
252
|
setTimeout(() => {
|
|
227
|
-
if (this
|
|
253
|
+
if (this.#isBlurring) {
|
|
228
254
|
this.isFocused = false;
|
|
229
|
-
this
|
|
255
|
+
this.#inputControl.setValue('', {
|
|
230
256
|
emitEvent: false,
|
|
231
257
|
});
|
|
232
|
-
this
|
|
258
|
+
this.#ref.detectChanges();
|
|
233
259
|
}
|
|
234
260
|
}, 150);
|
|
235
261
|
};
|
|
236
|
-
onClick = () => {
|
|
237
|
-
if (this.
|
|
238
|
-
if (!this
|
|
239
|
-
this
|
|
262
|
+
#onClick = () => {
|
|
263
|
+
if (this.sdViewDef()?.templateRef) {
|
|
264
|
+
if (!this.#formControl.disabled && !this.isFocused) {
|
|
265
|
+
this.#focus();
|
|
240
266
|
}
|
|
241
267
|
}
|
|
242
268
|
};
|
|
243
|
-
focus = () => {
|
|
269
|
+
#focus = () => {
|
|
244
270
|
this.isFocused = true;
|
|
245
|
-
this
|
|
271
|
+
this.#isBlurring = false;
|
|
246
272
|
setTimeout(() => {
|
|
247
273
|
if (this.isFocused) {
|
|
248
274
|
this.input?.nativeElement?.focus();
|
|
249
275
|
}
|
|
250
276
|
}, 100);
|
|
251
277
|
};
|
|
252
|
-
|
|
278
|
+
#clear = ($event) => {
|
|
253
279
|
$event?.stopPropagation();
|
|
254
|
-
this
|
|
255
|
-
this
|
|
256
|
-
this.modelChange.emit(this
|
|
257
|
-
this.sdChange.emit(this
|
|
258
|
-
this
|
|
280
|
+
this.#inputControl.setValue('');
|
|
281
|
+
this.#formControl.setValue([]);
|
|
282
|
+
this.modelChange.emit(this.#formControl.value);
|
|
283
|
+
this.sdChange.emit(this.#formControl.value);
|
|
284
|
+
this.#ref.detectChanges();
|
|
259
285
|
};
|
|
260
|
-
|
|
261
|
-
|
|
286
|
+
// Public method to expose private methods for template
|
|
287
|
+
onAdd = (event) => this.#add(event);
|
|
288
|
+
onClickChip = (event, item) => this.#clickChip(event, item);
|
|
289
|
+
onRemove = (item) => this.#remove(item);
|
|
290
|
+
onSelect = (event) => this.#select(event);
|
|
291
|
+
onFocus = () => this.#onFocus();
|
|
292
|
+
onBlur = () => this.#onBlur();
|
|
293
|
+
onClick = () => this.#onClick();
|
|
294
|
+
focus = () => this.#focus();
|
|
295
|
+
onClear = ($event) => this.#clear($event);
|
|
296
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
297
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdChip, isStandalone: true, selector: "sd-chip", inputs: { autoId: { classPropertyName: "autoId", 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 }, model: { classPropertyName: "model", publicName: "model", 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 }, addable: { classPropertyName: "addable", publicName: "addable", 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 } }, outputs: { modelChange: "modelChange", sdChange: "sdChange" }, 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: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@let _lbl = label();\r\n@let _app = appearance();\r\n@let _req = required();\r\n@let _viewed = viewed();\r\n@let _hideErr = hideInlineError();\r\n@let _viewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\r\n@let _errMsg = errorTooltipMessage;\r\n\r\n@if (_viewed) {\r\n <sd-view\r\n [label]=\"_lbl\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!_app && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (!_app && _lbl && !_labelTemplate) {\r\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_viewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [class.hide-inline-error]=\"_hideErr\"\r\n [appearance]=\"_app\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_app && _lbl) {\r\n <mat-label>{{ _lbl }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [removable]=\"removable()\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder() || _lbl\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_req\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideErr && _errMsg && formControl.touched) {\r\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\r\n }\r\n\r\n @if (!_hideErr && _errMsg && formControl.touched) {\r\n <mat-error>{{ _errMsg }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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}\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"], 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: "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"] }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
262
298
|
}
|
|
263
299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdChip, decorators: [{
|
|
264
300
|
type: Component,
|
|
@@ -273,59 +309,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
273
309
|
MatIconModule,
|
|
274
310
|
MatProgressSpinnerModule,
|
|
275
311
|
MatChipsModule,
|
|
312
|
+
SdLabel,
|
|
313
|
+
SdView,
|
|
276
314
|
SdRemovableChipPipe,
|
|
277
|
-
], template: "@let
|
|
278
|
-
}], ctorParameters: () => [
|
|
279
|
-
type: Input,
|
|
280
|
-
args: ['autoId']
|
|
281
|
-
}], _name: [{
|
|
282
|
-
type: Input,
|
|
283
|
-
args: ['name']
|
|
284
|
-
}], appearance: [{
|
|
285
|
-
type: Input
|
|
286
|
-
}], size: [{
|
|
287
|
-
type: Input
|
|
288
|
-
}], form: [{
|
|
289
|
-
type: Input
|
|
290
|
-
}], _addable: [{
|
|
291
|
-
type: Input,
|
|
292
|
-
args: ['addable']
|
|
293
|
-
}], label: [{
|
|
294
|
-
type: Input
|
|
295
|
-
}], placeholder: [{
|
|
296
|
-
type: Input
|
|
297
|
-
}], _removable: [{
|
|
298
|
-
type: Input,
|
|
299
|
-
args: ['removable']
|
|
300
|
-
}], _hideInlineError: [{
|
|
301
|
-
type: Input,
|
|
302
|
-
args: ['hideInlineError']
|
|
303
|
-
}], model: [{
|
|
304
|
-
type: Input
|
|
305
|
-
}], _required: [{
|
|
306
|
-
type: Input,
|
|
307
|
-
args: ['required']
|
|
308
|
-
}], pMin: [{
|
|
309
|
-
type: Input,
|
|
310
|
-
args: ['min']
|
|
311
|
-
}], pMax: [{
|
|
312
|
-
type: Input,
|
|
313
|
-
args: ['max']
|
|
314
|
-
}], modelChange: [{
|
|
315
|
-
type: Output
|
|
316
|
-
}], disabled: [{
|
|
317
|
-
type: Input
|
|
318
|
-
}], sdChange: [{
|
|
319
|
-
type: Output
|
|
320
|
-
}], input: [{
|
|
315
|
+
], template: "@let _lbl = label();\r\n@let _app = appearance();\r\n@let _req = required();\r\n@let _viewed = viewed();\r\n@let _hideErr = hideInlineError();\r\n@let _viewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\r\n@let _errMsg = errorTooltipMessage;\r\n\r\n@if (_viewed) {\r\n <sd-view\r\n [label]=\"_lbl\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!_app && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (!_app && _lbl && !_labelTemplate) {\r\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_viewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [class.hide-inline-error]=\"_hideErr\"\r\n [appearance]=\"_app\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_app && _lbl) {\r\n <mat-label>{{ _lbl }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [removable]=\"removable()\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder() || _lbl\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_req\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideErr && _errMsg && formControl.touched) {\r\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\r\n }\r\n\r\n @if (!_hideErr && _errMsg && formControl.touched) {\r\n <mat-error>{{ _errMsg }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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}\n"] }]
|
|
316
|
+
}], ctorParameters: () => [], propDecorators: { input: [{
|
|
321
317
|
type: ViewChild,
|
|
322
318
|
args: ['input']
|
|
323
|
-
}], sdView: [{
|
|
324
|
-
type: ContentChild,
|
|
325
|
-
args: [SdViewDefDirective]
|
|
326
|
-
}], sdLabelDef: [{
|
|
327
|
-
type: ContentChild,
|
|
328
|
-
args: [SdLabelDefDirective]
|
|
329
319
|
}] } });
|
|
330
320
|
|
|
331
321
|
/**
|