@i-cell/ids-angular 0.1.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 +24 -0
- package/accordion/accordion-animations.d.ts +1 -0
- package/accordion/accordion-defaults.d.ts +18 -0
- package/accordion/accordion-item/accordion-item.component.d.ts +27 -0
- package/accordion/accordion.component.d.ts +29 -0
- package/accordion/index.d.ts +5 -0
- package/accordion/public-api.d.ts +5 -0
- package/accordion/types/accordion-appearance.type.d.ts +5 -0
- package/avatar/avatar-defaults.d.ts +12 -0
- package/avatar/avatar-image.directive.d.ts +5 -0
- package/avatar/avatar.component.d.ts +28 -0
- package/avatar/index.d.ts +5 -0
- package/avatar/public-api.d.ts +6 -0
- package/avatar/tokens/avatar-parent.d.ts +6 -0
- package/avatar/types/avatar-type.type.d.ts +6 -0
- package/avatar/types/avatar-variant.type.d.ts +8 -0
- package/button/button-defaults.d.ts +11 -0
- package/button/button-group-defaults.d.ts +7 -0
- package/button/button-group.component.d.ts +11 -0
- package/button/button.component.d.ts +23 -0
- package/button/index.d.ts +5 -0
- package/button/public-api.d.ts +7 -0
- package/button/tokens/button-parent.d.ts +6 -0
- package/button/types/button-appearance.type.d.ts +6 -0
- package/button/types/button-variant.type.d.ts +14 -0
- package/card/card-body.directive.d.ts +6 -0
- package/card/card-defaults.d.ts +12 -0
- package/card/card-footer.directive.d.ts +6 -0
- package/card/card-header.component.d.ts +6 -0
- package/card/card-media.directive.d.ts +7 -0
- package/card/card-section-base.directive.d.ts +9 -0
- package/card/card-subtitle.directive.d.ts +5 -0
- package/card/card-title.directive.d.ts +5 -0
- package/card/card.component.d.ts +21 -0
- package/card/index.d.ts +5 -0
- package/card/public-api.d.ts +10 -0
- package/card/types/card-appearances.type.d.ts +6 -0
- package/card/types/card-variant.type.d.ts +13 -0
- package/checkbox/checkbox-defaults.d.ts +9 -0
- package/checkbox/checkbox-group-defaults.d.ts +9 -0
- package/checkbox/checkbox-group.component.d.ts +28 -0
- package/checkbox/checkbox.component.d.ts +68 -0
- package/checkbox/index.d.ts +5 -0
- package/checkbox/public-api.d.ts +7 -0
- package/checkbox/types/checkbox-events.class.d.ts +6 -0
- package/checkbox/types/checkbox-group-child.d.ts +7 -0
- package/checkbox/types/checkbox-parent.d.ts +8 -0
- package/checkbox/types/checkbox-state.type.d.ts +6 -0
- package/checkbox/types/checkbox-variant.type.d.ts +6 -0
- package/chip/chip-defaults.d.ts +12 -0
- package/chip/chip-group-defaults.d.ts +9 -0
- package/chip/chip-group.component.d.ts +14 -0
- package/chip/chip.component.d.ts +35 -0
- package/chip/index.d.ts +5 -0
- package/chip/public-api.d.ts +7 -0
- package/chip/types/chip-appearance.type.d.ts +5 -0
- package/chip/types/chip-events.type.d.ts +4 -0
- package/chip/types/chip-variant.type.d.ts +8 -0
- package/core/base-classes/component-base.d.ts +13 -0
- package/core/base-classes/directive-base.d.ts +16 -0
- package/core/directives/detect-scrollable.directive.d.ts +11 -0
- package/core/index.d.ts +5 -0
- package/core/pipes/sentence-case.pipe.d.ts +7 -0
- package/core/public-api.d.ts +17 -0
- package/core/services/resize-observer.service.d.ts +13 -0
- package/core/types/orientation.type.d.ts +5 -0
- package/core/types/position.type.d.ts +39 -0
- package/core/types/size-collection.type.d.ts +5 -0
- package/core/types/size.type.d.ts +7 -0
- package/core/utils/class-prefix.d.ts +2 -0
- package/core/utils/class.d.ts +2 -0
- package/core/utils/coercion.d.ts +6 -0
- package/core/utils/compare.d.ts +1 -0
- package/core/utils/date.d.ts +1 -0
- package/core/utils/even-odd.d.ts +2 -0
- package/core/utils/fallback-value.d.ts +1 -0
- package/core/utils/string.d.ts +1 -0
- package/dialog/custom-dialog-base.d.ts +15 -0
- package/dialog/dialog-defaults.d.ts +9 -0
- package/dialog/dialog-header.directive.d.ts +7 -0
- package/dialog/dialog.component.d.ts +22 -0
- package/dialog/dialog.service.d.ts +17 -0
- package/dialog/index.d.ts +5 -0
- package/dialog/public-api.d.ts +5 -0
- package/divider/divider-defaults.d.ts +12 -0
- package/divider/divider.component.d.ts +18 -0
- package/divider/index.d.ts +5 -0
- package/divider/public-api.d.ts +3 -0
- package/divider/types/divider-variant.type.d.ts +13 -0
- package/fesm2022/i-cell-ids-angular-accordion.mjs +223 -0
- package/fesm2022/i-cell-ids-angular-accordion.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-avatar.mjs +125 -0
- package/fesm2022/i-cell-ids-angular-avatar.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-button.mjs +117 -0
- package/fesm2022/i-cell-ids-angular-button.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-card.mjs +222 -0
- package/fesm2022/i-cell-ids-angular-card.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-checkbox.mjs +346 -0
- package/fesm2022/i-cell-ids-angular-checkbox.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-chip.mjs +166 -0
- package/fesm2022/i-cell-ids-angular-chip.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-core.mjs +266 -0
- package/fesm2022/i-cell-ids-angular-core.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-dialog.mjs +157 -0
- package/fesm2022/i-cell-ids-angular-dialog.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-divider.mjs +76 -0
- package/fesm2022/i-cell-ids-angular-divider.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-forms.mjs +871 -0
- package/fesm2022/i-cell-ids-angular-forms.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-icon-button.mjs +81 -0
- package/fesm2022/i-cell-ids-angular-icon-button.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-icon.mjs +149 -0
- package/fesm2022/i-cell-ids-angular-icon.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-menu.mjs +108 -0
- package/fesm2022/i-cell-ids-angular-menu.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-notification.mjs +167 -0
- package/fesm2022/i-cell-ids-angular-notification.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-overlay-panel.mjs +72 -0
- package/fesm2022/i-cell-ids-angular-overlay-panel.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-paginator.mjs +319 -0
- package/fesm2022/i-cell-ids-angular-paginator.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-radio.mjs +312 -0
- package/fesm2022/i-cell-ids-angular-radio.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs +264 -0
- package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-segmented-control.mjs +283 -0
- package/fesm2022/i-cell-ids-angular-segmented-control.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-select.mjs +550 -0
- package/fesm2022/i-cell-ids-angular-select.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-snackbar.mjs +440 -0
- package/fesm2022/i-cell-ids-angular-snackbar.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-switch.mjs +181 -0
- package/fesm2022/i-cell-ids-angular-switch.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tab.mjs +141 -0
- package/fesm2022/i-cell-ids-angular-tab.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-table.mjs +663 -0
- package/fesm2022/i-cell-ids-angular-table.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tag.mjs +116 -0
- package/fesm2022/i-cell-ids-angular-tag.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tooltip.mjs +587 -0
- package/fesm2022/i-cell-ids-angular-tooltip.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular.mjs +9 -0
- package/fesm2022/i-cell-ids-angular.mjs.map +1 -0
- package/forms/common/error/error-state.d.ts +23 -0
- package/forms/common/success/success-state.d.ts +23 -0
- package/forms/components/fieldset/fieldset-defaults.d.ts +9 -0
- package/forms/components/fieldset/fieldset-message.directive.d.ts +5 -0
- package/forms/components/fieldset/fieldset-row/fieldset-row.component.d.ts +8 -0
- package/forms/components/fieldset/fieldset.component.d.ts +16 -0
- package/forms/components/form-field/form-field-control.d.ts +21 -0
- package/forms/components/form-field/form-field-defaults.d.ts +9 -0
- package/forms/components/form-field/form-field.component.d.ts +41 -0
- package/forms/components/form-field/tokens/form-field-control.d.ts +3 -0
- package/forms/components/form-field/types/form-field-variant.type.d.ts +5 -0
- package/forms/components/input/input-defaults.d.ts +9 -0
- package/forms/components/input/input.directive.d.ts +55 -0
- package/forms/components/input/types/input.type.d.ts +1 -0
- package/forms/components/message/error-message/error-message.component.d.ts +15 -0
- package/forms/components/message/hint-message/hint-message.component.d.ts +10 -0
- package/forms/components/message/message-defaults.d.ts +9 -0
- package/forms/components/message/success-message/success-message.component.d.ts +11 -0
- package/forms/components/message/types/message-parent-form-field.d.ts +9 -0
- package/forms/components/message/types/message-variant.type.d.ts +6 -0
- package/forms/components/message/types/message.type.d.ts +6 -0
- package/forms/components/option/option-group.component.d.ts +13 -0
- package/forms/components/option/option.component.d.ts +47 -0
- package/forms/components/option/tokens/option-group.d.ts +3 -0
- package/forms/components/option/tokens/option-parent.d.ts +11 -0
- package/forms/components/option/types/option-events.class.d.ts +7 -0
- package/forms/components/pseudo-checkbox/pseudo-checkbox.component.d.ts +14 -0
- package/forms/components/pseudo-checkbox/tokens/pseudo-checkbox-parent.d.ts +7 -0
- package/forms/components/pseudo-checkbox/types/pseudo-checkbox-state.type.d.ts +6 -0
- package/forms/directives/form-field-action.directive.d.ts +5 -0
- package/forms/directives/label.directive.d.ts +5 -0
- package/forms/directives/message-prefix.directive.d.ts +5 -0
- package/forms/directives/message-suffix.directive.d.ts +5 -0
- package/forms/directives/message.directive.d.ts +17 -0
- package/forms/directives/prefix.directive.d.ts +7 -0
- package/forms/directives/suffix.directive.d.ts +7 -0
- package/forms/index.d.ts +5 -0
- package/forms/public-api.d.ts +35 -0
- package/forms/validators.d.ts +9 -0
- package/icon/icon-defaults.d.ts +11 -0
- package/icon/icon.component.d.ts +32 -0
- package/icon/index.d.ts +5 -0
- package/icon/public-api.d.ts +5 -0
- package/icon/tokens/icon-parent.d.ts +6 -0
- package/icon/types/icon-source.type.d.ts +5 -0
- package/icon/types/icon-variant.type.d.ts +12 -0
- package/icon-button/icon-button-defaults.d.ts +11 -0
- package/icon-button/icon-button.component.d.ts +22 -0
- package/icon-button/index.d.ts +5 -0
- package/icon-button/public-api.d.ts +5 -0
- package/icon-button/tokens/icon-button-parent.d.ts +9 -0
- package/icon-button/types/icon-button-appearance.type.d.ts +6 -0
- package/icon-button/types/icon-button-variant.type.d.ts +13 -0
- package/index.d.ts +5 -0
- package/menu/action-menu/action-menu-trigger.directive.d.ts +12 -0
- package/menu/index.d.ts +5 -0
- package/menu/menu-item/menu-item-defaults.d.ts +11 -0
- package/menu/menu-item/menu-item.component.d.ts +23 -0
- package/menu/menu-item/types/menu-item-appearance.type.d.ts +5 -0
- package/menu/menu-item/types/menu-item-variant.type.d.ts +4 -0
- package/menu/public-api.d.ts +5 -0
- package/notification/index.d.ts +5 -0
- package/notification/notification-action-button.directive.d.ts +5 -0
- package/notification/notification-defaults.d.ts +15 -0
- package/notification/notification.component.d.ts +34 -0
- package/notification/public-api.d.ts +5 -0
- package/notification/types/notification-appearance.type.d.ts +5 -0
- package/notification/types/notification-variant.type.d.ts +10 -0
- package/overlay-panel/index.d.ts +5 -0
- package/overlay-panel/overlay-panel-defaults.d.ts +11 -0
- package/overlay-panel/overlay-panel.component.d.ts +18 -0
- package/overlay-panel/public-api.d.ts +4 -0
- package/overlay-panel/types/overlay-panel-appearance.type.d.ts +6 -0
- package/overlay-panel/types/overlay-panel-variant.type.d.ts +5 -0
- package/package.json +153 -0
- package/paginator/index.d.ts +5 -0
- package/paginator/paginator-defaults.d.ts +22 -0
- package/paginator/paginator-intl.d.ts +24 -0
- package/paginator/paginator.component.d.ts +67 -0
- package/paginator/public-api.d.ts +5 -0
- package/paginator/types/paginator-appearance.type.d.ts +4 -0
- package/paginator/types/paginator-events.class.d.ts +6 -0
- package/paginator/types/paginator-variant.type.d.ts +7 -0
- package/public-api.d.ts +2 -0
- package/radio/index.d.ts +5 -0
- package/radio/public-api.d.ts +5 -0
- package/radio/radio-defaults.d.ts +11 -0
- package/radio/radio-group.directive.d.ts +46 -0
- package/radio/radio.component.d.ts +30 -0
- package/radio/types/radio-events.class.d.ts +6 -0
- package/radio/types/radio-variant.type.d.ts +6 -0
- package/segmented-control/index.d.ts +5 -0
- package/segmented-control/public-api.d.ts +6 -0
- package/segmented-control/segmented-control-defaults.d.ts +11 -0
- package/segmented-control/segmented-control-item.component.d.ts +33 -0
- package/segmented-control/segmented-control.directive.d.ts +42 -0
- package/segmented-control/types/segmented-control-appearance.type.d.ts +4 -0
- package/segmented-control/types/segmented-control-item-change.class.d.ts +7 -0
- package/segmented-control/types/segmented-control-variant.type.d.ts +6 -0
- package/segmented-control-toggle/index.d.ts +5 -0
- package/segmented-control-toggle/public-api.d.ts +6 -0
- package/segmented-control-toggle/segmented-control-toggle-defaults.d.ts +12 -0
- package/segmented-control-toggle/segmented-control-toggle-item.component.d.ts +32 -0
- package/segmented-control-toggle/segmented-control-toggle.directive.d.ts +43 -0
- package/segmented-control-toggle/types/segmented-control-toggle-appearance.type.d.ts +5 -0
- package/segmented-control-toggle/types/segmented-control-toggle-item-change.class.d.ts +6 -0
- package/segmented-control-toggle/types/segmented-control-toggle-variant.type.d.ts +11 -0
- package/select/index.d.ts +5 -0
- package/select/public-api.d.ts +3 -0
- package/select/select-defaults.d.ts +9 -0
- package/select/select-positions.d.ts +2 -0
- package/select/select-trigger.directive.d.ts +5 -0
- package/select/select.component.d.ts +102 -0
- package/snackbar/animations.d.ts +2 -0
- package/snackbar/index.d.ts +5 -0
- package/snackbar/public-api.d.ts +7 -0
- package/snackbar/services/snackbar.service.d.ts +28 -0
- package/snackbar/snackbar-defaults.d.ts +16 -0
- package/snackbar/snackbar-group.component.d.ts +25 -0
- package/snackbar/snackbar-position-strategies.d.ts +4 -0
- package/snackbar/snackbar.component.d.ts +51 -0
- package/snackbar/types/snackbar-data.type.d.ts +15 -0
- package/snackbar/types/snackbar-inner-data.type.d.ts +4 -0
- package/snackbar/types/snackbar-position.type.d.ts +9 -0
- package/snackbar/types/snackbar-variant.type.d.ts +8 -0
- package/switch/index.d.ts +5 -0
- package/switch/public-api.d.ts +5 -0
- package/switch/switch-animations.d.ts +2 -0
- package/switch/switch-defaults.d.ts +13 -0
- package/switch/switch-group.component.d.ts +14 -0
- package/switch/switch.component.d.ts +45 -0
- package/switch/types/switch-positions.type.d.ts +10 -0
- package/switch/types/switch-variant.type.d.ts +6 -0
- package/tab/index.d.ts +5 -0
- package/tab/public-api.d.ts +6 -0
- package/tab/tab-group-defaults.d.ts +15 -0
- package/tab/tab-group.component.d.ts +29 -0
- package/tab/tab.component.d.ts +18 -0
- package/tab/types/tab-group-position.type.d.ts +6 -0
- package/tab/types/tab-group-variant.type.d.ts +6 -0
- package/tab/types/tab-indicator-position.type.d.ts +7 -0
- package/table/components/cell-content/cell-content.component.d.ts +25 -0
- package/table/datasource/server-side-datasource.d.ts +37 -0
- package/table/directives/cell-renderer.d.ts +13 -0
- package/table/directives/cell-template.d.ts +8 -0
- package/table/directives/row-info-holder.d.ts +9 -0
- package/table/index.d.ts +5 -0
- package/table/public-api.d.ts +18 -0
- package/table/table-defaults.d.ts +22 -0
- package/table/table-intl.d.ts +25 -0
- package/table/table.component.d.ts +142 -0
- package/table/types/pagination-params.d.ts +9 -0
- package/table/types/request-factory.d.ts +5 -0
- package/table/types/request-pagination-data.d.ts +6 -0
- package/table/types/response-data.d.ts +5 -0
- package/table/types/table-appearance.type.d.ts +6 -0
- package/table/types/table-cell-click-event.d.ts +6 -0
- package/table/types/table-column-def.d.ts +97 -0
- package/table/types/table-row-click-event.d.ts +4 -0
- package/table/types/table-row-keydown-event.d.ts +4 -0
- package/table/types/table-sort-direction.d.ts +6 -0
- package/table/types/table-sort-info.d.ts +6 -0
- package/table/types/table-variant.type.d.ts +6 -0
- package/tag/index.d.ts +5 -0
- package/tag/public-api.d.ts +6 -0
- package/tag/tag-defaults.d.ts +11 -0
- package/tag/tag-group-defaults.d.ts +9 -0
- package/tag/tag-group.component.d.ts +13 -0
- package/tag/tag.component.d.ts +23 -0
- package/tag/types/tag-appearance.type.d.ts +5 -0
- package/tag/types/tag-variant.type.d.ts +13 -0
- package/tooltip/index.d.ts +5 -0
- package/tooltip/public-api.d.ts +5 -0
- package/tooltip/tooltip-defaults.d.ts +18 -0
- package/tooltip/tooltip-position-strategies.d.ts +3 -0
- package/tooltip/tooltip.component.d.ts +31 -0
- package/tooltip/tooltip.directive.d.ts +60 -0
- package/tooltip/types/tooltip-position.type.d.ts +11 -0
- package/tooltip/types/tooltip-variant.type.d.ts +5 -0
- package/tooltip/types/tooltip.type.d.ts +2 -0
- package/tooltip/utils/tooltip-converters.d.ts +3 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Directive, InjectionToken, Component, ViewEncapsulation, ChangeDetectionStrategy, EventEmitter, signal, Output } from '@angular/core';
|
|
3
|
+
import { DirectiveBase, IdsSize, IdsOrientation, ComponentBaseWithDefaults, coerceBooleanAttribute } from '@i-cell/ids-angular/core';
|
|
4
|
+
|
|
5
|
+
const IdsCardAppearance = {
|
|
6
|
+
FILLED: 'filled',
|
|
7
|
+
OUTLINED: 'outlined',
|
|
8
|
+
ELEVATED: 'elevated',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const IdsCardVariant = {
|
|
12
|
+
PRIMARY: 'primary',
|
|
13
|
+
SECONDARY: 'secondary',
|
|
14
|
+
SURFACE: 'surface',
|
|
15
|
+
BRAND: 'brand',
|
|
16
|
+
LIGHT: 'light',
|
|
17
|
+
DARK: 'dark',
|
|
18
|
+
INFO: 'info',
|
|
19
|
+
SUCCESS: 'success',
|
|
20
|
+
WARNING: 'warning',
|
|
21
|
+
ERROR: 'error',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class IdsCardSectionBase extends DirectiveBase {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.stretch = input(false);
|
|
28
|
+
this._hostClasses = computed(() => this._getHostClasses([this.stretch() ? 'stretched' : 'padded']));
|
|
29
|
+
}
|
|
30
|
+
get _hostName() {
|
|
31
|
+
return 'card-section';
|
|
32
|
+
}
|
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardSectionBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
34
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.2", type: IdsCardSectionBase, isStandalone: false, inputs: { stretch: { classPropertyName: "stretch", publicName: "stretch", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardSectionBase, decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{
|
|
39
|
+
standalone: false,
|
|
40
|
+
}]
|
|
41
|
+
}] });
|
|
42
|
+
|
|
43
|
+
class IdsCardBodyDirective extends IdsCardSectionBase {
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardBodyDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
45
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsCardBodyDirective, isStandalone: true, selector: "ids-card-body", host: { classAttribute: "ids-card-body" }, usesInheritance: true, ngImport: i0 }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardBodyDirective, decorators: [{
|
|
48
|
+
type: Directive,
|
|
49
|
+
args: [{
|
|
50
|
+
selector: 'ids-card-body',
|
|
51
|
+
standalone: true,
|
|
52
|
+
host: {
|
|
53
|
+
class: 'ids-card-body',
|
|
54
|
+
},
|
|
55
|
+
}]
|
|
56
|
+
}] });
|
|
57
|
+
|
|
58
|
+
const IDS_CARD_DEFAULT_CONFIG = new InjectionToken('IDS_CARD_DEFAULT_CONFIG', {
|
|
59
|
+
providedIn: 'root',
|
|
60
|
+
factory: IDS_CARD_DEFAULT_CONFIG_FACTORY,
|
|
61
|
+
});
|
|
62
|
+
function IDS_CARD_DEFAULT_CONFIG_FACTORY() {
|
|
63
|
+
return {
|
|
64
|
+
appearance: IdsCardAppearance.FILLED,
|
|
65
|
+
size: IdsSize.COMPACT,
|
|
66
|
+
variant: IdsCardVariant.SURFACE,
|
|
67
|
+
orientation: IdsOrientation.VERTICAL,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class IdsCardFooterDirective extends IdsCardSectionBase {
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardFooterDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
73
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsCardFooterDirective, isStandalone: true, selector: "ids-card-footer,footer[idsCardFooter]", host: { classAttribute: "ids-card-footer" }, usesInheritance: true, ngImport: i0 }); }
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardFooterDirective, decorators: [{
|
|
76
|
+
type: Directive,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: 'ids-card-footer,footer[idsCardFooter]',
|
|
79
|
+
standalone: true,
|
|
80
|
+
host: {
|
|
81
|
+
class: 'ids-card-footer',
|
|
82
|
+
},
|
|
83
|
+
}]
|
|
84
|
+
}] });
|
|
85
|
+
|
|
86
|
+
class IdsCardHeaderComponent extends IdsCardSectionBase {
|
|
87
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
88
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: IdsCardHeaderComponent, isStandalone: true, selector: "ids-card-header,header[idsCardHeader]", host: { classAttribute: "ids-card-header" }, usesInheritance: true, ngImport: i0, template: `
|
|
89
|
+
<div class="ids-card-header-headline">
|
|
90
|
+
<ng-content select="ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]" />
|
|
91
|
+
</div>
|
|
92
|
+
<ng-content />
|
|
93
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardHeaderComponent, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: 'ids-card-header,header[idsCardHeader]',
|
|
99
|
+
imports: [],
|
|
100
|
+
template: `
|
|
101
|
+
<div class="ids-card-header-headline">
|
|
102
|
+
<ng-content select="ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]" />
|
|
103
|
+
</div>
|
|
104
|
+
<ng-content />
|
|
105
|
+
`,
|
|
106
|
+
encapsulation: ViewEncapsulation.None,
|
|
107
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
108
|
+
host: {
|
|
109
|
+
class: 'ids-card-header',
|
|
110
|
+
},
|
|
111
|
+
}]
|
|
112
|
+
}] });
|
|
113
|
+
|
|
114
|
+
class IdsCardMediaDirective extends IdsCardSectionBase {
|
|
115
|
+
constructor() {
|
|
116
|
+
super(...arguments);
|
|
117
|
+
this.stretch = input(true);
|
|
118
|
+
}
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardMediaDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
120
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.2", type: IdsCardMediaDirective, isStandalone: true, selector: "[idsCardMedia]", inputs: { stretch: { classPropertyName: "stretch", publicName: "stretch", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ids-card-media" }, usesInheritance: true, ngImport: i0 }); }
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardMediaDirective, decorators: [{
|
|
123
|
+
type: Directive,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: '[idsCardMedia]',
|
|
126
|
+
standalone: true,
|
|
127
|
+
host: {
|
|
128
|
+
class: 'ids-card-media',
|
|
129
|
+
},
|
|
130
|
+
}]
|
|
131
|
+
}] });
|
|
132
|
+
|
|
133
|
+
class IdsCardSubtitleDirective {
|
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardSubtitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
135
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsCardSubtitleDirective, isStandalone: true, selector: "[idsCardSubtitle]", host: { classAttribute: "ids-card-subtitle" }, ngImport: i0 }); }
|
|
136
|
+
}
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardSubtitleDirective, decorators: [{
|
|
138
|
+
type: Directive,
|
|
139
|
+
args: [{
|
|
140
|
+
selector: '[idsCardSubtitle]',
|
|
141
|
+
standalone: true,
|
|
142
|
+
host: {
|
|
143
|
+
class: 'ids-card-subtitle',
|
|
144
|
+
},
|
|
145
|
+
}]
|
|
146
|
+
}] });
|
|
147
|
+
|
|
148
|
+
class IdsCardTitleDirective {
|
|
149
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
150
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.2", type: IdsCardTitleDirective, isStandalone: true, selector: "[idsCardTitle]", host: { classAttribute: "ids-card-title" }, ngImport: i0 }); }
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardTitleDirective, decorators: [{
|
|
153
|
+
type: Directive,
|
|
154
|
+
args: [{
|
|
155
|
+
selector: '[idsCardTitle]',
|
|
156
|
+
standalone: true,
|
|
157
|
+
host: {
|
|
158
|
+
class: 'ids-card-title',
|
|
159
|
+
},
|
|
160
|
+
}]
|
|
161
|
+
}] });
|
|
162
|
+
|
|
163
|
+
const defaultConfig = IDS_CARD_DEFAULT_CONFIG_FACTORY();
|
|
164
|
+
class IdsCardComponent extends ComponentBaseWithDefaults {
|
|
165
|
+
constructor() {
|
|
166
|
+
super(...arguments);
|
|
167
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CARD_DEFAULT_CONFIG);
|
|
168
|
+
this.appearance = input(this._defaultConfig.appearance);
|
|
169
|
+
this.size = input(this._defaultConfig.size);
|
|
170
|
+
this.variant = input(this._defaultConfig.variant);
|
|
171
|
+
this.orientation = input(this._defaultConfig.orientation);
|
|
172
|
+
this.disabled = input(false, { transform: (value) => coerceBooleanAttribute(value) });
|
|
173
|
+
// Old fashion output for now, signal outputs cannot be queried as of now for subscribers
|
|
174
|
+
this.click = new EventEmitter();
|
|
175
|
+
this._hasClickHandler = signal(false);
|
|
176
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
177
|
+
this.appearance(),
|
|
178
|
+
this.size(),
|
|
179
|
+
this.variant(),
|
|
180
|
+
this.orientation(),
|
|
181
|
+
this.disabled() && this._hasClickHandler() ? 'disabled' : null,
|
|
182
|
+
this._hasClickHandler() ? 'clickable' : null,
|
|
183
|
+
]));
|
|
184
|
+
}
|
|
185
|
+
get _hostName() {
|
|
186
|
+
return 'card';
|
|
187
|
+
}
|
|
188
|
+
ngOnInit() {
|
|
189
|
+
this._hasClickHandler.set(this.click.observed);
|
|
190
|
+
}
|
|
191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
192
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.2", type: IdsCardComponent, isStandalone: true, selector: "ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, host: { properties: { "attr.aria-disabled": "this.disabled()? \"\" : null", "attr.tabindex": " this._hasClickHandler() ? 0 : null" } }, usesInheritance: true, ngImport: i0, template: `
|
|
193
|
+
<ng-content />
|
|
194
|
+
<ng-content select="ids-card-footer,footer[idsCardFooter]" />
|
|
195
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCardComponent, decorators: [{
|
|
198
|
+
type: Component,
|
|
199
|
+
args: [{
|
|
200
|
+
selector: 'ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]',
|
|
201
|
+
imports: [],
|
|
202
|
+
template: `
|
|
203
|
+
<ng-content />
|
|
204
|
+
<ng-content select="ids-card-footer,footer[idsCardFooter]" />
|
|
205
|
+
`,
|
|
206
|
+
encapsulation: ViewEncapsulation.None,
|
|
207
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
208
|
+
host: {
|
|
209
|
+
'[attr.aria-disabled]': 'this.disabled()? "" : null',
|
|
210
|
+
'[attr.tabindex]': ' this._hasClickHandler() ? 0 : null',
|
|
211
|
+
},
|
|
212
|
+
}]
|
|
213
|
+
}], propDecorators: { click: [{
|
|
214
|
+
type: Output
|
|
215
|
+
}] } });
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Generated bundle index. Do not edit.
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
export { IDS_CARD_DEFAULT_CONFIG, IDS_CARD_DEFAULT_CONFIG_FACTORY, IdsCardAppearance, IdsCardBodyDirective, IdsCardComponent, IdsCardFooterDirective, IdsCardHeaderComponent, IdsCardMediaDirective, IdsCardSubtitleDirective, IdsCardTitleDirective, IdsCardVariant };
|
|
222
|
+
//# sourceMappingURL=i-cell-ids-angular-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-cell-ids-angular-card.mjs","sources":["../../../projects/widgets/card/types/card-appearances.type.ts","../../../projects/widgets/card/types/card-variant.type.ts","../../../projects/widgets/card/card-section-base.directive.ts","../../../projects/widgets/card/card-body.directive.ts","../../../projects/widgets/card/card-defaults.ts","../../../projects/widgets/card/card-footer.directive.ts","../../../projects/widgets/card/card-header.component.ts","../../../projects/widgets/card/card-media.directive.ts","../../../projects/widgets/card/card-subtitle.directive.ts","../../../projects/widgets/card/card-title.directive.ts","../../../projects/widgets/card/card.component.ts","../../../projects/widgets/card/i-cell-ids-angular-card.ts"],"sourcesContent":["export const IdsCardAppearance = {\n FILLED: 'filled',\n OUTLINED: 'outlined',\n ELEVATED: 'elevated',\n} as const;\n\nexport type IdsCardAppearanceType = (typeof IdsCardAppearance)[keyof typeof IdsCardAppearance];\n","export const IdsCardVariant = {\n PRIMARY: 'primary',\n SECONDARY: 'secondary',\n SURFACE: 'surface',\n BRAND: 'brand',\n LIGHT: 'light',\n DARK: 'dark',\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n} as const;\n\nexport type IdsCardVariantType = (typeof IdsCardVariant)[keyof typeof IdsCardVariant];\n\n","import { computed, Directive, input } from '@angular/core';\nimport { DirectiveBase } from '@i-cell/ids-angular/core';\n\n@Directive({\n standalone: false,\n})\nexport abstract class IdsCardSectionBase extends DirectiveBase {\n protected override get _hostName(): string {\n return 'card-section';\n }\n\n public stretch = input(false);\n\n protected _hostClasses = computed(() => this._getHostClasses([this.stretch() ? 'stretched' : 'padded']));\n}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: 'ids-card-body',\n standalone: true,\n host: {\n class: 'ids-card-body',\n },\n})\nexport class IdsCardBodyDirective extends IdsCardSectionBase {}\n","import { IdsCardAppearance, IdsCardAppearanceType } from './types/card-appearances.type';\nimport { IdsCardVariant, IdsCardVariantType } from './types/card-variant.type';\n\nimport { InjectionToken } from '@angular/core';\nimport { IdsSize, IdsSizeType, IdsOrientationType, IdsOrientation } from '@i-cell/ids-angular/core';\n\nexport interface IdsCardDefaultConfig {\n appearance?: IdsCardAppearanceType,\n size?: IdsSizeType,\n variant?: IdsCardVariantType,\n orientation?: IdsOrientationType,\n}\n\nexport const IDS_CARD_DEFAULT_CONFIG = new InjectionToken<IdsCardDefaultConfig>(\n 'IDS_CARD_DEFAULT_CONFIG',\n {\n providedIn: 'root',\n factory: IDS_CARD_DEFAULT_CONFIG_FACTORY,\n },\n);\n\nexport function IDS_CARD_DEFAULT_CONFIG_FACTORY(): Required<IdsCardDefaultConfig> {\n return {\n appearance: IdsCardAppearance.FILLED,\n size: IdsSize.COMPACT,\n variant: IdsCardVariant.SURFACE,\n orientation: IdsOrientation.VERTICAL,\n };\n}\n\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: 'ids-card-footer,footer[idsCardFooter]',\n standalone: true,\n host: {\n class: 'ids-card-footer',\n },\n})\nexport class IdsCardFooterDirective extends IdsCardSectionBase {}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'ids-card-header,header[idsCardHeader]',\n imports: [],\n template: `\n <div class=\"ids-card-header-headline\">\n <ng-content select=\"ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]\" />\n </div>\n <ng-content />\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ids-card-header',\n },\n})\nexport class IdsCardHeaderComponent extends IdsCardSectionBase {}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive, input } from '@angular/core';\n\n@Directive({\n selector: '[idsCardMedia]',\n standalone: true,\n host: {\n class: 'ids-card-media',\n },\n})\nexport class IdsCardMediaDirective extends IdsCardSectionBase {\n public override stretch = input(true);\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[idsCardSubtitle]',\n standalone: true,\n host: {\n class: 'ids-card-subtitle',\n },\n})\nexport class IdsCardSubtitleDirective {}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[idsCardTitle]',\n standalone: true,\n host: {\n class: 'ids-card-title',\n },\n})\nexport class IdsCardTitleDirective {}\n","import { IDS_CARD_DEFAULT_CONFIG, IDS_CARD_DEFAULT_CONFIG_FACTORY, IdsCardDefaultConfig } from './card-defaults';\nimport { IdsCardAppearanceType } from './types/card-appearances.type';\nimport { IdsCardVariantType } from './types/card-variant.type';\n\nimport { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output, ViewEncapsulation, computed, input, signal } from '@angular/core';\nimport { ComponentBaseWithDefaults, IdsOrientationType, IdsSizeType, coerceBooleanAttribute } from '@i-cell/ids-angular/core';\n\nconst defaultConfig = IDS_CARD_DEFAULT_CONFIG_FACTORY();\n\n@Component({\n selector: 'ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]',\n imports: [],\n template: `\n <ng-content />\n <ng-content select=\"ids-card-footer,footer[idsCardFooter]\" />\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.aria-disabled]': 'this.disabled()? \"\" : null',\n '[attr.tabindex]': ' this._hasClickHandler() ? 0 : null',\n },\n})\nexport class IdsCardComponent extends ComponentBaseWithDefaults<IdsCardDefaultConfig> implements OnInit {\n protected override get _hostName(): string {\n return 'card';\n }\n\n protected readonly _defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CARD_DEFAULT_CONFIG);\n\n public appearance = input<IdsCardAppearanceType>(this._defaultConfig.appearance);\n public size = input<IdsSizeType>(this._defaultConfig.size);\n public variant = input<IdsCardVariantType>(this._defaultConfig.variant);\n public orientation = input<IdsOrientationType>(this._defaultConfig.orientation);\n public disabled = input(false, { transform: (value: boolean | string) => coerceBooleanAttribute(value) });\n\n // Old fashion output for now, signal outputs cannot be queried as of now for subscribers\n @Output()\n // eslint-disable-next-line @angular-eslint/no-output-native\n public click = new EventEmitter();\n\n private _hasClickHandler = signal(false);\n\n protected _hostClasses = computed(() => this._getHostClasses([\n this.appearance(),\n this.size(),\n this.variant(),\n this.orientation(),\n this.disabled() && this._hasClickHandler() ? 'disabled' : null,\n this._hasClickHandler() ? 'clickable' : null,\n ]));\n\n public ngOnInit(): void {\n this._hasClick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AAE;;;AAGT,EAAA,CAAA;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,4BAA4B;AACpD,wBAAA,iBAAiB,EAAE,qCAAqC;AACzD,qBAAA;AACF,iBAAA;8BAiBQ,KAAK,EAAA,CAAA;sBAFX;;;ACrCH;;AAEG;;;;"}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injector, ChangeDetectorRef, signal, computed, input, model, output, viewChild, contentChildren, Component, ViewEncapsulation, ChangeDetectionStrategy, effect } from '@angular/core';
|
|
3
|
+
import { IdsSize, IdsOrientation, ComponentBaseWithDefaults, coerceBooleanAttribute, coerceNumberAttribute, isString } from '@i-cell/ids-angular/core';
|
|
4
|
+
import { NgControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { IdsHintMessageComponent, IdsErrorMessageComponent, IdsValidators, IDS_FORM_FIELD_CONTROL } from '@i-cell/ids-angular/forms';
|
|
6
|
+
import { IdsIconComponent } from '@i-cell/ids-angular/icon';
|
|
7
|
+
|
|
8
|
+
class IdsCheckBoxChangeEvent {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const IdsCheckboxState = {
|
|
12
|
+
UNCHECKED: 'unchecked',
|
|
13
|
+
CHECKED: 'checked',
|
|
14
|
+
INDETERMINATE: 'indeterminate',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const IdsCheckboxVariant = {
|
|
18
|
+
SURFACE: 'surface',
|
|
19
|
+
LIGHT: 'light',
|
|
20
|
+
DARK: 'dark',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const IDS_CHECKBOX_DEFAULT_CONFIG = new InjectionToken('IDS_CHECKBOX_DEFAULT_CONFIG', {
|
|
24
|
+
providedIn: 'root',
|
|
25
|
+
factory: IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY,
|
|
26
|
+
});
|
|
27
|
+
function IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY() {
|
|
28
|
+
return {
|
|
29
|
+
size: IdsSize.COMPACT,
|
|
30
|
+
variant: IdsCheckboxVariant.SURFACE,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const IDS_CHECKBOX_GROUP_DEFAULT_CONFIG = new InjectionToken('IDS_CHECKBOX_GROUP_DEFAULT_CONFIG', {
|
|
35
|
+
providedIn: 'root',
|
|
36
|
+
factory: IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY,
|
|
37
|
+
});
|
|
38
|
+
function IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY() {
|
|
39
|
+
return {
|
|
40
|
+
...IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY(),
|
|
41
|
+
orientation: IdsOrientation.VERTICAL,
|
|
42
|
+
allowParent: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
47
|
+
const IDS_CHECKBOX_GROUP_CHILD = new InjectionToken('IDS_CHECKBOX_GROUP_CHILD');
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
+
const IDS_CHECKBOX_PARENT = new InjectionToken('IDS_CHECKBOX_PARENT');
|
|
51
|
+
|
|
52
|
+
const defaultConfig$1 = IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY();
|
|
53
|
+
class IdsCheckboxComponent extends ComponentBaseWithDefaults {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
this._injector = inject(Injector);
|
|
57
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
58
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig$1, IDS_CHECKBOX_DEFAULT_CONFIG);
|
|
59
|
+
this._checkboxGroup = inject(IDS_CHECKBOX_PARENT, { optional: true });
|
|
60
|
+
this._checkboxState = signal(IdsCheckboxState.UNCHECKED);
|
|
61
|
+
this.inputId = computed(() => `${this.id()}-input`);
|
|
62
|
+
this.name = input();
|
|
63
|
+
this.required = input(false, { transform: coerceBooleanAttribute });
|
|
64
|
+
this.readonly = input(false, { transform: coerceBooleanAttribute });
|
|
65
|
+
this.size = input(this._defaultConfig.size);
|
|
66
|
+
this.tabIndex = input(0, { transform: coerceNumberAttribute });
|
|
67
|
+
this.value = input();
|
|
68
|
+
this.variant = input(this._defaultConfig.variant);
|
|
69
|
+
this.checked = input(false, { transform: coerceBooleanAttribute });
|
|
70
|
+
this.indeterminate = input(false, { transform: coerceBooleanAttribute });
|
|
71
|
+
this.ariaLabel = input('', { alias: 'aria-label' });
|
|
72
|
+
this.ariaLabelledby = input(null, { alias: 'aria-labelledby' });
|
|
73
|
+
this.ariaDescribedby = input('', { alias: 'aria-describedby' });
|
|
74
|
+
this.disabled = model(false);
|
|
75
|
+
this.isChecked = computed(() => this._checkboxState() === IdsCheckboxState.CHECKED);
|
|
76
|
+
this.isIndeterminate = computed(() => this._checkboxState() === IdsCheckboxState.INDETERMINATE);
|
|
77
|
+
this.isFocusable = computed(() => !this.disabled() && !this.readonly());
|
|
78
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
79
|
+
this._parentOrSelfSize(),
|
|
80
|
+
this._parentOrSelfVariant(),
|
|
81
|
+
this.disabled() ? 'disabled' : null,
|
|
82
|
+
]));
|
|
83
|
+
this._nativeValue = computed(() => {
|
|
84
|
+
const value = this.value();
|
|
85
|
+
return isString(value) ? value : undefined;
|
|
86
|
+
});
|
|
87
|
+
this._parentOrSelfSize = computed(() => this._checkboxGroup?.size() ?? this.size());
|
|
88
|
+
this._parentOrSelfVariant = computed(() => this._checkboxGroup?.variant() ?? this.variant());
|
|
89
|
+
this._onChange = () => { };
|
|
90
|
+
this._onTouched = () => { };
|
|
91
|
+
this.controlDir = null;
|
|
92
|
+
this.change = output();
|
|
93
|
+
this.indeterminateChange = output();
|
|
94
|
+
this._inputElement = viewChild.required('inputEl');
|
|
95
|
+
this._hintMessages = contentChildren(IdsHintMessageComponent, { descendants: true });
|
|
96
|
+
this._errorMessages = contentChildren(IdsErrorMessageComponent, { descendants: true });
|
|
97
|
+
}
|
|
98
|
+
get _hostName() {
|
|
99
|
+
return 'checkbox';
|
|
100
|
+
}
|
|
101
|
+
ngOnChanges(changes) {
|
|
102
|
+
const checkedChange = changes['checked'];
|
|
103
|
+
const indeterminateChange = changes['indeterminate'];
|
|
104
|
+
if (indeterminateChange || checkedChange) {
|
|
105
|
+
const currentChecked = checkedChange?.currentValue;
|
|
106
|
+
const currentIndeterminate = indeterminateChange?.currentValue;
|
|
107
|
+
if (currentIndeterminate === true) {
|
|
108
|
+
this._checkboxState.set(IdsCheckboxState.INDETERMINATE);
|
|
109
|
+
}
|
|
110
|
+
else if (currentChecked === true) {
|
|
111
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this._checkboxState.set(IdsCheckboxState.UNCHECKED);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
ngOnInit() {
|
|
119
|
+
this.controlDir = this._injector.get(NgControl, null, { self: true, optional: true });
|
|
120
|
+
}
|
|
121
|
+
ngAfterViewInit() {
|
|
122
|
+
if (this.indeterminate !== undefined) {
|
|
123
|
+
this._syncIndeterminate(this.indeterminate());
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
focus() {
|
|
127
|
+
this._inputElement().nativeElement.focus();
|
|
128
|
+
}
|
|
129
|
+
writeValue(value) {
|
|
130
|
+
if (this.isIndeterminate()) {
|
|
131
|
+
this._checkboxState.set(IdsCheckboxState.INDETERMINATE);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this._checkboxState.set(value ? IdsCheckboxState.CHECKED : IdsCheckboxState.UNCHECKED);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
registerOnChange(fn) {
|
|
138
|
+
this._onChange = fn;
|
|
139
|
+
}
|
|
140
|
+
registerOnTouched(fn) {
|
|
141
|
+
this._onTouched = fn;
|
|
142
|
+
}
|
|
143
|
+
setDisabledState(isDisabled) {
|
|
144
|
+
this.disabled.set(isDisabled);
|
|
145
|
+
}
|
|
146
|
+
_createChangeEvent(isChecked, value) {
|
|
147
|
+
const event = new IdsCheckBoxChangeEvent();
|
|
148
|
+
event.source = this;
|
|
149
|
+
event.checked = isChecked;
|
|
150
|
+
event.value = value;
|
|
151
|
+
return event;
|
|
152
|
+
}
|
|
153
|
+
_emitChangeEvent() {
|
|
154
|
+
this._onChange(this.isChecked());
|
|
155
|
+
this.change.emit(this._createChangeEvent(this.isChecked(), this.value()));
|
|
156
|
+
this._syncChecked(this.isChecked());
|
|
157
|
+
}
|
|
158
|
+
toggle() {
|
|
159
|
+
if (this.isIndeterminate()) {
|
|
160
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this._checkboxState.set(this._checkboxState() === IdsCheckboxState.CHECKED ? IdsCheckboxState.UNCHECKED : IdsCheckboxState.CHECKED);
|
|
164
|
+
}
|
|
165
|
+
this._onChange(this.isChecked());
|
|
166
|
+
}
|
|
167
|
+
select() {
|
|
168
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
169
|
+
this._onChange(this.isChecked());
|
|
170
|
+
}
|
|
171
|
+
deselect() {
|
|
172
|
+
this._checkboxState.set(IdsCheckboxState.UNCHECKED);
|
|
173
|
+
this._onChange(this.isChecked());
|
|
174
|
+
}
|
|
175
|
+
_handleInputClick() {
|
|
176
|
+
if (this.isIndeterminate()) {
|
|
177
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
178
|
+
this.indeterminateChange.emit(this.isIndeterminate());
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
this._checkboxState.set(this._checkboxState() === IdsCheckboxState.CHECKED ? IdsCheckboxState.UNCHECKED : IdsCheckboxState.CHECKED);
|
|
182
|
+
}
|
|
183
|
+
this._emitChangeEvent();
|
|
184
|
+
this._syncIndeterminate(this.isIndeterminate());
|
|
185
|
+
}
|
|
186
|
+
onBlur() {
|
|
187
|
+
Promise.resolve().then(() => {
|
|
188
|
+
this._onTouched();
|
|
189
|
+
this._changeDetectorRef.markForCheck();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
_syncChecked(value) {
|
|
193
|
+
const nativeCheckbox = this._inputElement();
|
|
194
|
+
nativeCheckbox.nativeElement.checked = value;
|
|
195
|
+
}
|
|
196
|
+
_syncIndeterminate(value) {
|
|
197
|
+
const nativeCheckbox = this._inputElement();
|
|
198
|
+
nativeCheckbox.nativeElement.indeterminate = value;
|
|
199
|
+
}
|
|
200
|
+
onInputClick() {
|
|
201
|
+
if (!this.readonly() && !this.disabled()) {
|
|
202
|
+
this._handleInputClick();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
onTouchTargetClick() {
|
|
206
|
+
if (!this.readonly() && !this.disabled()) {
|
|
207
|
+
this._handleInputClick();
|
|
208
|
+
}
|
|
209
|
+
if (!this.disabled()) {
|
|
210
|
+
this._inputElement().nativeElement.focus();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
get displayedMessages() {
|
|
214
|
+
if (this._errorMessages().length > 0 && this.controlDir?.errors) {
|
|
215
|
+
return 'error';
|
|
216
|
+
}
|
|
217
|
+
if (this._hintMessages().length > 0) {
|
|
218
|
+
return 'hint';
|
|
219
|
+
}
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
get hasRequiredValidator() {
|
|
223
|
+
const control = this.controlDir?.control;
|
|
224
|
+
if (!control) {
|
|
225
|
+
return this.required();
|
|
226
|
+
}
|
|
227
|
+
return control.hasValidator(Validators.required)
|
|
228
|
+
|| control.hasValidator(Validators.requiredTrue)
|
|
229
|
+
|| control.hasValidator(IdsValidators.required)
|
|
230
|
+
|| control.hasValidator(IdsValidators.requiredTrue)
|
|
231
|
+
|| control.hasValidator(IdsValidators.requiredFalse);
|
|
232
|
+
}
|
|
233
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
234
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsCheckboxComponent, isStandalone: true, selector: "ids-checkbox", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", change: "change", indeterminateChange: "indeterminateChange" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null" } }, providers: [
|
|
235
|
+
{
|
|
236
|
+
provide: NG_VALUE_ACCESSOR,
|
|
237
|
+
useExisting: IdsCheckboxComponent,
|
|
238
|
+
multi: true,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
provide: IDS_FORM_FIELD_CONTROL,
|
|
242
|
+
useExisting: IdsCheckboxComponent,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
provide: IDS_CHECKBOX_GROUP_CHILD,
|
|
246
|
+
useExisting: IdsCheckboxComponent,
|
|
247
|
+
},
|
|
248
|
+
], queries: [{ propertyName: "_hintMessages", predicate: IdsHintMessageComponent, descendants: true, isSignal: true }, { propertyName: "_errorMessages", predicate: IdsErrorMessageComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"ids-checkbox__input-wrapper\">\n <div class=\"ids-checkbox__touch-target\" (click)=\"onTouchTargetClick()\"></div>\n <input\n #inputEl\n type=\"checkbox\"\n [class.ids-checkbox--selected]=\"isChecked()\"\n [id]=\"inputId()\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"isIndeterminate() ? 'mixed' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"isIndeterminate()\"\n [name]=\"name()\"\n [required]=\"required()\"\n [tabIndex]=\"!isFocusable() ? -1 : tabIndex()\"\n [value]=\"_nativeValue()\"\n (blur)=\"onBlur()\"\n (click)=\"onInputClick()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-checkbox__icon\" aria-hidden=\"true\">\n @if (isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n\n<div class=\"ids-checkbox__label-wrapper\">\n <div class=\"ids-checkbox__label-container\">\n <label class=\"ids-checkbox__label\" [for]=\"inputId()\">\n <ng-content />\n @if (hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n </label>\n </div>\n @let messages = displayedMessages;\n @if (messages) {\n <div class=\"ids-checkbox__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
249
|
+
}
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCheckboxComponent, decorators: [{
|
|
251
|
+
type: Component,
|
|
252
|
+
args: [{ selector: 'ids-checkbox', imports: [IdsIconComponent], providers: [
|
|
253
|
+
{
|
|
254
|
+
provide: NG_VALUE_ACCESSOR,
|
|
255
|
+
useExisting: IdsCheckboxComponent,
|
|
256
|
+
multi: true,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
provide: IDS_FORM_FIELD_CONTROL,
|
|
260
|
+
useExisting: IdsCheckboxComponent,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
provide: IDS_CHECKBOX_GROUP_CHILD,
|
|
264
|
+
useExisting: IdsCheckboxComponent,
|
|
265
|
+
},
|
|
266
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
267
|
+
'[attr.aria-label]': 'null',
|
|
268
|
+
'[attr.aria-labelledby]': 'null',
|
|
269
|
+
}, template: "<div class=\"ids-checkbox__input-wrapper\">\n <div class=\"ids-checkbox__touch-target\" (click)=\"onTouchTargetClick()\"></div>\n <input\n #inputEl\n type=\"checkbox\"\n [class.ids-checkbox--selected]=\"isChecked()\"\n [id]=\"inputId()\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"isIndeterminate() ? 'mixed' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [checked]=\"isChecked()\"\n [indeterminate]=\"isIndeterminate()\"\n [name]=\"name()\"\n [required]=\"required()\"\n [tabIndex]=\"!isFocusable() ? -1 : tabIndex()\"\n [value]=\"_nativeValue()\"\n (blur)=\"onBlur()\"\n (click)=\"onInputClick()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-checkbox__icon\" aria-hidden=\"true\">\n @if (isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n\n<div class=\"ids-checkbox__label-wrapper\">\n <div class=\"ids-checkbox__label-container\">\n <label class=\"ids-checkbox__label\" [for]=\"inputId()\">\n <ng-content />\n @if (hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n </label>\n </div>\n @let messages = displayedMessages;\n @if (messages) {\n <div class=\"ids-checkbox__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n" }]
|
|
270
|
+
}] });
|
|
271
|
+
|
|
272
|
+
const defaultConfig = IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY();
|
|
273
|
+
class IdsCheckboxGroupComponent extends ComponentBaseWithDefaults {
|
|
274
|
+
constructor() {
|
|
275
|
+
super(...arguments);
|
|
276
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG);
|
|
277
|
+
this._childCheckboxes = contentChildren(IDS_CHECKBOX_GROUP_CHILD);
|
|
278
|
+
this.groupLabel = input('', { alias: 'label' });
|
|
279
|
+
this.allowParent = input(this._defaultConfig.allowParent);
|
|
280
|
+
this.parentCheckboxLabel = input('', { alias: 'parentLabel' });
|
|
281
|
+
this.name = input();
|
|
282
|
+
this.size = input(this._defaultConfig.size);
|
|
283
|
+
this.variant = input(this._defaultConfig.variant);
|
|
284
|
+
this.orientation = input(this._defaultConfig.orientation);
|
|
285
|
+
this._groupLabelId = computed(() => `${this.id()}-label`);
|
|
286
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
287
|
+
this.size(),
|
|
288
|
+
this.variant(),
|
|
289
|
+
this.orientation(),
|
|
290
|
+
]));
|
|
291
|
+
this._parentCheckboxChecked = computed(() => this._childCheckboxes().every((child) => child.isChecked()));
|
|
292
|
+
this._parentCheckboxIndeterminate = computed(() => !this._parentCheckboxChecked() && this._childCheckboxes().some((child) => child.isChecked()));
|
|
293
|
+
this._invalidParentOrientation = effect(() => {
|
|
294
|
+
if (this.allowParent() && this.orientation() === IdsOrientation.HORIZONTAL) {
|
|
295
|
+
throw this._createHostError('Parent checkbox can be used only in vertical orientation');
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
get _hostName() {
|
|
300
|
+
return 'checkbox-group';
|
|
301
|
+
}
|
|
302
|
+
selectAllChild() {
|
|
303
|
+
this._childCheckboxes().forEach((child) => {
|
|
304
|
+
child.select();
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
deselectAllChild() {
|
|
308
|
+
this._childCheckboxes().forEach((child) => {
|
|
309
|
+
child.deselect();
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
_handleParentChange(event) {
|
|
313
|
+
if (event.checked) {
|
|
314
|
+
this.selectAllChild();
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
this.deselectAllChild();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCheckboxGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
321
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.2", type: IdsCheckboxGroupComponent, isStandalone: true, selector: "ids-checkbox-group", inputs: { groupLabel: { classPropertyName: "groupLabel", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, allowParent: { classPropertyName: "allowParent", publicName: "allowParent", isSignal: true, isRequired: false, transformFunction: null }, parentCheckboxLabel: { classPropertyName: "parentCheckboxLabel", publicName: "parentLabel", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "_groupLabelId()" } }, providers: [
|
|
322
|
+
{
|
|
323
|
+
provide: IDS_CHECKBOX_PARENT,
|
|
324
|
+
useExisting: IdsCheckboxGroupComponent,
|
|
325
|
+
},
|
|
326
|
+
], queries: [{ propertyName: "_childCheckboxes", predicate: IDS_CHECKBOX_GROUP_CHILD, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label class=\"ids-checkbox-group__label\" [for]=\"id()\" [id]=\"_groupLabelId()\">{{ groupLabel() }}</label>\n\n@if (allowParent()) {\n <ids-checkbox\n [checked]=\"_parentCheckboxChecked()\"\n [indeterminate]=\"_parentCheckboxIndeterminate()\"\n (change)=\"_handleParentChange($event)\"\n >{{ parentCheckboxLabel() }}</ids-checkbox\n >\n}\n\n<div class=\"ids-checkbox-group__list\">\n <ng-content select=\"ids-checkbox\" />\n</div>\n", dependencies: [{ kind: "component", type: IdsCheckboxComponent, selector: "ids-checkbox", inputs: ["name", "required", "readonly", "size", "tabIndex", "value", "variant", "checked", "indeterminate", "aria-label", "aria-labelledby", "aria-describedby", "disabled"], outputs: ["disabledChange", "change", "indeterminateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: IdsCheckboxGroupComponent, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{ selector: 'ids-checkbox-group', imports: [IdsCheckboxComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
331
|
+
'role': 'group',
|
|
332
|
+
'[attr.aria-labelledby]': '_groupLabelId()',
|
|
333
|
+
}, providers: [
|
|
334
|
+
{
|
|
335
|
+
provide: IDS_CHECKBOX_PARENT,
|
|
336
|
+
useExisting: IdsCheckboxGroupComponent,
|
|
337
|
+
},
|
|
338
|
+
], template: "<label class=\"ids-checkbox-group__label\" [for]=\"id()\" [id]=\"_groupLabelId()\">{{ groupLabel() }}</label>\n\n@if (allowParent()) {\n <ids-checkbox\n [checked]=\"_parentCheckboxChecked()\"\n [indeterminate]=\"_parentCheckboxIndeterminate()\"\n (change)=\"_handleParentChange($event)\"\n >{{ parentCheckboxLabel() }}</ids-checkbox\n >\n}\n\n<div class=\"ids-checkbox-group__list\">\n <ng-content select=\"ids-checkbox\" />\n</div>\n" }]
|
|
339
|
+
}] });
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Generated bundle index. Do not edit.
|
|
343
|
+
*/
|
|
344
|
+
|
|
345
|
+
export { IDS_CHECKBOX_DEFAULT_CONFIG, IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY, IdsCheckBoxChangeEvent, IdsCheckboxComponent, IdsCheckboxGroupComponent, IdsCheckboxState, IdsCheckboxVariant };
|
|
346
|
+
//# sourceMappingURL=i-cell-ids-angular-checkbox.mjs.map
|