carbon-components-angular 5.67.0 → 5.68.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/checkbox/checkbox-group-host.d.ts +31 -0
- package/checkbox/checkbox-group.component.d.ts +67 -0
- package/checkbox/checkbox.component.d.ts +56 -4
- package/checkbox/checkbox.module.d.ts +5 -3
- package/checkbox/index.d.ts +2 -0
- package/docs/documentation/components/AILabelComponent.html +1 -1
- package/docs/documentation/components/Accordion.html +1 -1
- package/docs/documentation/components/AccordionItem.html +1 -1
- package/docs/documentation/components/ActionableNotification.html +1 -1
- package/docs/documentation/components/AlertModal.html +1 -1
- package/docs/documentation/components/BaseIconButton.html +1 -1
- package/docs/documentation/components/BaseNotification.html +1 -1
- package/docs/documentation/components/BaseTabHeader.html +1 -1
- package/docs/documentation/components/Breadcrumb.html +1 -1
- package/docs/documentation/components/BreadcrumbItemComponent.html +1 -1
- package/docs/documentation/components/ButtonSet.html +1 -1
- package/docs/documentation/components/Checkbox.html +767 -58
- package/docs/documentation/components/CheckboxGroup.html +1401 -0
- package/docs/documentation/components/ClickableTile.html +1 -1
- package/docs/documentation/components/CodeSnippet.html +1 -1
- package/docs/documentation/components/ComboBox.html +1 -1
- package/docs/documentation/components/ComboButtonComponent.html +1 -1
- package/docs/documentation/components/ContainedList.html +1 -1
- package/docs/documentation/components/ContainedListItem.html +1 -1
- package/docs/documentation/components/ContentSwitcher.html +1 -1
- package/docs/documentation/components/ContextMenuComponent.html +1 -1
- package/docs/documentation/components/ContextMenuDividerComponent.html +1 -1
- package/docs/documentation/components/ContextMenuGroupComponent.html +1 -1
- package/docs/documentation/components/ContextMenuItemComponent.html +1 -1
- package/docs/documentation/components/DatePicker.html +1 -1
- package/docs/documentation/components/DatePickerInput.html +1 -1
- package/docs/documentation/components/Dialog.html +1 -1
- package/docs/documentation/components/Documentation.html +1 -1
- package/docs/documentation/components/Dropdown.html +1 -1
- package/docs/documentation/components/DropdownList.html +1 -1
- package/docs/documentation/components/ExpandableTile.html +1 -1
- package/docs/documentation/components/FileComponent.html +1 -1
- package/docs/documentation/components/FileUploader.html +1 -1
- package/docs/documentation/components/Hamburger.html +1 -1
- package/docs/documentation/components/Header.html +1 -1
- package/docs/documentation/components/HeaderAction.html +1 -1
- package/docs/documentation/components/HeaderGlobal.html +1 -1
- package/docs/documentation/components/HeaderItem.html +1 -1
- package/docs/documentation/components/HeaderMenu.html +1 -1
- package/docs/documentation/components/HeaderNavigation.html +1 -1
- package/docs/documentation/components/IconButton.html +1 -1
- package/docs/documentation/components/InlineLoading.html +1 -1
- package/docs/documentation/components/Label.html +1 -1
- package/docs/documentation/components/ListColumn.html +1 -1
- package/docs/documentation/components/ListHeader.html +1 -1
- package/docs/documentation/components/ListRow.html +1 -1
- package/docs/documentation/components/Loading.html +1 -1
- package/docs/documentation/components/MenuButtonComponent.html +1 -1
- package/docs/documentation/components/Modal.html +1 -1
- package/docs/documentation/components/ModalFooter.html +1 -1
- package/docs/documentation/components/ModalHeader.html +1 -1
- package/docs/documentation/components/Notification.html +1 -1
- package/docs/documentation/components/NumberComponent.html +1 -1
- package/docs/documentation/components/OverflowMenu.html +1 -1
- package/docs/documentation/components/OverflowMenuCustomPane.html +1 -1
- package/docs/documentation/components/OverflowMenuOption.html +1 -1
- package/docs/documentation/components/OverflowMenuPane.html +1 -1
- package/docs/documentation/components/Overlay.html +1 -1
- package/docs/documentation/components/Pagination.html +1 -1
- package/docs/documentation/components/PaginationNav.html +1 -1
- package/docs/documentation/components/PaginationNavItem.html +1 -1
- package/docs/documentation/components/PaginationOverflow.html +1 -1
- package/docs/documentation/components/Panel.html +1 -1
- package/docs/documentation/components/PasswordInputLabelComponent.html +1 -1
- package/docs/documentation/components/Placeholder.html +1 -1
- package/docs/documentation/components/PopoverContent.html +1 -1
- package/docs/documentation/components/ProgressBar.html +1 -1
- package/docs/documentation/components/ProgressIndicator.html +1 -1
- package/docs/documentation/components/Radio.html +1 -1
- package/docs/documentation/components/RadioGroup.html +1 -1
- package/docs/documentation/components/Search.html +1 -1
- package/docs/documentation/components/Select.html +1 -1
- package/docs/documentation/components/SelectionTile.html +1 -1
- package/docs/documentation/components/SideNav.html +1 -1
- package/docs/documentation/components/SideNavItem.html +1 -1
- package/docs/documentation/components/SideNavMenu.html +1 -1
- package/docs/documentation/components/SkeletonPlaceholder.html +1 -1
- package/docs/documentation/components/SkeletonText.html +1 -1
- package/docs/documentation/components/Slider.html +1 -1
- package/docs/documentation/components/StructuredList.html +1 -1
- package/docs/documentation/components/SwitcherList.html +1 -1
- package/docs/documentation/components/SwitcherListItem.html +1 -1
- package/docs/documentation/components/Tab.html +1 -1
- package/docs/documentation/components/TabHeaderGroup.html +1 -1
- package/docs/documentation/components/TabHeaders.html +1 -1
- package/docs/documentation/components/TabSkeleton.html +1 -1
- package/docs/documentation/components/Table.html +1 -1
- package/docs/documentation/components/TableBody.html +1 -1
- package/docs/documentation/components/TableCheckbox.html +1 -1
- package/docs/documentation/components/TableContainer.html +1 -1
- package/docs/documentation/components/TableData.html +1 -1
- package/docs/documentation/components/TableExpandButton.html +1 -1
- package/docs/documentation/components/TableExpandedRow.html +1 -1
- package/docs/documentation/components/TableHead.html +1 -1
- package/docs/documentation/components/TableHeadCell.html +1 -1
- package/docs/documentation/components/TableHeadCheckbox.html +1 -1
- package/docs/documentation/components/TableHeadExpand.html +1 -1
- package/docs/documentation/components/TableHeader.html +1 -1
- package/docs/documentation/components/TableHeaderDecorator.html +1 -1
- package/docs/documentation/components/TableRadio.html +1 -1
- package/docs/documentation/components/TableRowComponent.html +1 -1
- package/docs/documentation/components/TableToolbar.html +1 -1
- package/docs/documentation/components/TableToolbarActions.html +1 -1
- package/docs/documentation/components/TableToolbarContent.html +1 -1
- package/docs/documentation/components/TableToolbarSearch.html +1 -1
- package/docs/documentation/components/Tabs.html +1 -1
- package/docs/documentation/components/Tag.html +1 -1
- package/docs/documentation/components/TagFilter.html +1 -1
- package/docs/documentation/components/TagOperationalComponent.html +1 -1
- package/docs/documentation/components/TagSelectableComponent.html +1 -1
- package/docs/documentation/components/TextInputLabelComponent.html +1 -1
- package/docs/documentation/components/TextareaLabelComponent.html +1 -1
- package/docs/documentation/components/Tile.html +1 -1
- package/docs/documentation/components/TileGroup.html +1 -1
- package/docs/documentation/components/TimePicker.html +1 -1
- package/docs/documentation/components/TimePickerSelect.html +1 -1
- package/docs/documentation/components/Toast.html +1 -1
- package/docs/documentation/components/Toggle.html +526 -66
- package/docs/documentation/components/Toggletip.html +1 -1
- package/docs/documentation/components/Tooltip.html +1 -1
- package/docs/documentation/components/TooltipDefinition.html +1 -1
- package/docs/documentation/components/TreeNodeComponent.html +1 -1
- package/docs/documentation/components/TreeViewComponent.html +1 -1
- package/docs/documentation/coverage.html +42 -6
- package/docs/documentation/graph/dependencies.svg +3103 -3057
- package/docs/documentation/interfaces/CheckboxGroupHost.html +417 -0
- package/docs/documentation/js/menu-wc.js +9 -3
- package/docs/documentation/js/menu-wc_es5.js +1 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/miscellaneous/variables.html +26 -0
- package/docs/documentation/modules/CheckboxModule/dependencies.svg +92 -36
- package/docs/documentation/modules/CheckboxModule.html +116 -39
- package/docs/documentation/modules/CodeSnippetModule/dependencies.svg +4 -4
- package/docs/documentation/modules/CodeSnippetModule.html +4 -4
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboBoxModule.html +4 -4
- package/docs/documentation/modules/ComboButtonModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboButtonModule.html +4 -4
- package/docs/documentation/modules/ContextMenuModule/dependencies.svg +52 -52
- package/docs/documentation/modules/ContextMenuModule.html +52 -52
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +42 -46
- package/docs/documentation/modules/DatePickerInputModule.html +42 -46
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +54 -58
- package/docs/documentation/modules/DatePickerModule.html +54 -58
- package/docs/documentation/modules/DialogModule/dependencies.svg +34 -34
- package/docs/documentation/modules/DialogModule.html +34 -34
- package/docs/documentation/modules/DropdownModule/dependencies.svg +70 -70
- package/docs/documentation/modules/DropdownModule.html +70 -70
- package/docs/documentation/modules/FileUploaderModule/dependencies.svg +62 -62
- package/docs/documentation/modules/FileUploaderModule.html +62 -62
- package/docs/documentation/modules/GridModule/dependencies.svg +7 -7
- package/docs/documentation/modules/GridModule.html +7 -7
- package/docs/documentation/modules/I18nModule/dependencies.svg +4 -4
- package/docs/documentation/modules/I18nModule.html +4 -4
- package/docs/documentation/modules/IconModule/dependencies.svg +4 -4
- package/docs/documentation/modules/IconModule.html +4 -4
- package/docs/documentation/modules/InlineLoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/InlineLoadingModule.html +4 -4
- package/docs/documentation/modules/InputModule/dependencies.svg +4 -4
- package/docs/documentation/modules/InputModule.html +4 -4
- package/docs/documentation/modules/LayerModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LayerModule.html +4 -4
- package/docs/documentation/modules/LayoutModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LayoutModule.html +4 -4
- package/docs/documentation/modules/LoadingModule/dependencies.svg +13 -13
- package/docs/documentation/modules/LoadingModule.html +13 -13
- package/docs/documentation/modules/MenuButtonModule/dependencies.svg +4 -4
- package/docs/documentation/modules/MenuButtonModule.html +4 -4
- package/docs/documentation/modules/ModalModule/dependencies.svg +115 -115
- package/docs/documentation/modules/ModalModule.html +115 -115
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NotificationModule/dependencies.svg +37 -37
- package/docs/documentation/modules/NotificationModule.html +37 -37
- package/docs/documentation/modules/NumberModule/dependencies.svg +24 -24
- package/docs/documentation/modules/NumberModule.html +24 -24
- package/docs/documentation/modules/PaginationModule/dependencies.svg +56 -56
- package/docs/documentation/modules/PaginationModule.html +56 -56
- package/docs/documentation/modules/PanelModule/dependencies.svg +36 -36
- package/docs/documentation/modules/PanelModule.html +36 -36
- package/docs/documentation/modules/PopoverModule/dependencies.svg +4 -4
- package/docs/documentation/modules/PopoverModule.html +4 -4
- package/docs/documentation/modules/ProgressBarModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressBarModule.html +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +58 -62
- package/docs/documentation/modules/RadioModule.html +58 -62
- package/docs/documentation/modules/SearchModule/dependencies.svg +30 -30
- package/docs/documentation/modules/SearchModule.html +30 -30
- package/docs/documentation/modules/SelectModule/dependencies.svg +61 -61
- package/docs/documentation/modules/SelectModule.html +61 -61
- package/docs/documentation/modules/SideNavModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SideNavModule.html +4 -4
- package/docs/documentation/modules/SkeletonModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SkeletonModule.html +4 -4
- package/docs/documentation/modules/SliderModule/dependencies.svg +42 -46
- package/docs/documentation/modules/SliderModule.html +42 -46
- package/docs/documentation/modules/StructuredListModule/dependencies.svg +4 -4
- package/docs/documentation/modules/StructuredListModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +224 -224
- package/docs/documentation/modules/TableModule.html +224 -224
- package/docs/documentation/modules/TabsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TabsModule.html +4 -4
- package/docs/documentation/modules/TagModule/dependencies.svg +37 -37
- package/docs/documentation/modules/TagModule.html +37 -37
- package/docs/documentation/modules/ThemeModule/dependencies.svg +13 -13
- package/docs/documentation/modules/ThemeModule.html +13 -13
- package/docs/documentation/modules/TilesModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TilesModule.html +4 -4
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerSelectModule.html +4 -4
- package/docs/documentation/modules/ToggleModule/dependencies.svg +7 -7
- package/docs/documentation/modules/ToggleModule.html +7 -7
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggletipModule.html +4 -4
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +35 -35
- package/docs/documentation/modules/TreeviewModule.html +35 -35
- package/docs/documentation/overview.html +3105 -3059
- package/docs/documentation.json +1002 -127
- package/docs/storybook/9300.537382cc.iframe.bundle.js +1 -0
- package/docs/storybook/955.99b6ac85.iframe.bundle.js +1 -0
- package/docs/storybook/checkbox-checkbox-stories.a40b7a36.iframe.bundle.js +1 -0
- package/docs/storybook/dialog-overflow-menu-overflow-menu-stories.d99d789a.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/index.json +1 -1
- package/docs/storybook/main.4ba3ac58.iframe.bundle.js +1 -0
- package/docs/storybook/modal-modal-stories.02e35bd4.iframe.bundle.js +1 -0
- package/docs/storybook/pagination-pagination-nav-stories.647ce4df.iframe.bundle.js +1 -0
- package/docs/storybook/pagination-pagination-stories.aa18b936.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.018cbdfe.iframe.bundle.js → runtime~main.229d454b.iframe.bundle.js} +1 -1
- package/docs/storybook/stories.json +1 -1
- package/docs/storybook/toggle-toggle-stories.999199e8.iframe.bundle.js +1 -0
- package/esm2020/checkbox/checkbox-group-host.mjs +3 -0
- package/esm2020/checkbox/checkbox-group.component.mjs +201 -0
- package/esm2020/checkbox/checkbox.component.mjs +169 -9
- package/esm2020/checkbox/checkbox.module.mjs +16 -7
- package/esm2020/checkbox/index.mjs +3 -1
- package/esm2020/table/cell/table-checkbox.component.mjs +1 -1
- package/esm2020/table/head/table-head-checkbox.component.mjs +1 -1
- package/esm2020/toggle/toggle.component.mjs +12 -7
- package/fesm2015/carbon-components-angular-checkbox.mjs +385 -15
- package/fesm2015/carbon-components-angular-checkbox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-table.mjs +2 -2
- package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-toggle.mjs +13 -6
- package/fesm2015/carbon-components-angular-toggle.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-checkbox.mjs +379 -15
- package/fesm2020/carbon-components-angular-checkbox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-table.mjs +2 -2
- package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-toggle.mjs +11 -6
- package/fesm2020/carbon-components-angular-toggle.mjs.map +1 -1
- package/package.json +1 -1
- package/toggle/toggle.component.d.ts +3 -3
- package/docs/storybook/1895.d3fd5755.iframe.bundle.js +0 -1
- package/docs/storybook/955.754a7cf6.iframe.bundle.js +0 -1
- package/docs/storybook/checkbox-checkbox-stories.3aeae19d.iframe.bundle.js +0 -1
- package/docs/storybook/dialog-overflow-menu-overflow-menu-stories.aa916da9.iframe.bundle.js +0 -1
- package/docs/storybook/main.544b1246.iframe.bundle.js +0 -1
- package/docs/storybook/modal-modal-stories.22f92029.iframe.bundle.js +0 -1
- package/docs/storybook/pagination-pagination-nav-stories.9f6e65be.iframe.bundle.js +0 -1
- package/docs/storybook/pagination-pagination-stories.540698c1.iframe.bundle.js +0 -1
- package/docs/storybook/toggle-toggle-stories.7832edbb.iframe.bundle.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Checkbox } from 'carbon-components-angular/checkbox';
|
|
1
|
+
import { Checkbox, CHECKBOX_GROUP_HOST } from 'carbon-components-angular/checkbox';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { TemplateRef, Component, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { TemplateRef, Component, Optional, Inject, Input, HostBinding, NgModule } from '@angular/core';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from 'carbon-components-angular/i18n';
|
|
6
6
|
import { I18nModule } from 'carbon-components-angular/i18n';
|
|
@@ -39,8 +39,8 @@ class Toggle extends Checkbox {
|
|
|
39
39
|
/**
|
|
40
40
|
* Creates an instance of Toggle.
|
|
41
41
|
*/
|
|
42
|
-
constructor(changeDetectorRef, i18n) {
|
|
43
|
-
super(changeDetectorRef);
|
|
42
|
+
constructor(changeDetectorRef, hostGroup, i18n) {
|
|
43
|
+
super(changeDetectorRef, hostGroup);
|
|
44
44
|
this.changeDetectorRef = changeDetectorRef;
|
|
45
45
|
this.i18n = i18n;
|
|
46
46
|
/**
|
|
@@ -122,7 +122,7 @@ class Toggle extends Checkbox {
|
|
|
122
122
|
* Variable used for creating unique ids for toggle components.
|
|
123
123
|
*/
|
|
124
124
|
Toggle.toggleCount = 0;
|
|
125
|
-
Toggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Toggle, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.I18n }], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
Toggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Toggle, deps: [{ token: i0.ChangeDetectorRef }, { token: CHECKBOX_GROUP_HOST, optional: true }, { token: i1.I18n }], target: i0.ɵɵFactoryTarget.Component });
|
|
126
126
|
Toggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Toggle, selector: "cds-toggle, ibm-toggle", inputs: { offText: "offText", onText: "onText", label: "label", size: "size", hideLabel: "hideLabel", ariaLabel: "ariaLabel", skeleton: "skeleton" }, host: { properties: { "class.cds--toggle--skeleton": "this.skeleton", "class.cds--toggle": "this.toggleClass", "class.cds--toggle--disabled": "this.disabledClass", "class.cds--form-item": "this.formItem" } }, providers: [
|
|
127
127
|
{
|
|
128
128
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -247,7 +247,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
247
247
|
}
|
|
248
248
|
]
|
|
249
249
|
}]
|
|
250
|
-
}], ctorParameters: function () {
|
|
250
|
+
}], ctorParameters: function () {
|
|
251
|
+
return [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
252
|
+
type: Optional
|
|
253
|
+
}, {
|
|
254
|
+
type: Inject,
|
|
255
|
+
args: [CHECKBOX_GROUP_HOST]
|
|
256
|
+
}] }, { type: i1.I18n }];
|
|
257
|
+
}, propDecorators: { offText: [{
|
|
251
258
|
type: Input
|
|
252
259
|
}], onText: [{
|
|
253
260
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carbon-components-angular-toggle.mjs","sources":["../../src/toggle/toggle.component.ts","../../src/toggle/toggle.module.ts","../../src/toggle/carbon-components-angular-toggle.ts"],"sourcesContent":["import { Checkbox } from \"carbon-components-angular/checkbox\";\nimport {\n\tChangeDetectorRef,\n\tComponent,\n\tInput,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * @deprecated since v5 - Use boolean\n * Defines the set of states for a toggle component.\n */\nexport enum ToggleState {\n\tInit,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * @todo - Toggle component will no longer extend `Checkbox` component as of v6\n * Toggle is no longer repies on using checkbox, so doesn't make sense for us to continue inheriting ALL checkbox\n * component attributes.\n */\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ToggleModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-toggle [(ngModel)]=\"toggleState\">Toggle</cds-toggle>\n * ```\n *\n * [See demo](../../?path=/story/components-toggle--basic)\n */\n@Component({\n\tselector: \"cds-toggle, ibm-toggle\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate;\">\n\t\t\t<button\n\t\t\t\tclass=\"cds--toggle__button\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[id]=\"id\"\n\t\t\t\trole=\"switch\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t[attr.aria-checked]=\"checked\"\n\t\t\t\t(click)=\"onClick($event)\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\">\n\t\t\t</button>\n\t\t\t<label\n\t\t\t\tclass=\"cds--toggle__label\"\n\t\t\t\t[for]=\"id\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--toggle__label-text\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</span>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--toggle__appearance\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--toggle__appearance--sm': size === 'sm'\n\t\t\t\t\t}\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"cds--toggle__switch\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--toggle__switch--checked': checked\n\t\t\t\t\t\t}\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t*ngIf=\"size === 'sm'\"\n\t\t\t\t\t\t\tclass='cds--toggle__check'\n\t\t\t\t\t\t\twidth=\"6px\"\n\t\t\t\t\t\t\theight=\"5px\"\n\t\t\t\t\t\t\tviewBox=\"0 0 6 5\">\n\t\t\t\t\t\t\t<path d=\"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"cds--toggle__text\">\n\t\t\t\t\t\t{{(hideLabel ? label : (getCheckedText() | async))}}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t</ng-container>\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"cds--toggle__skeleton-circle\"></div>\n\t\t\t<div class=\"cds--toggle__skeleton-rectangle\"></div>\n\t\t</ng-template>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Toggle,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Toggle extends Checkbox {\n\t/**\n\t * Variable used for creating unique ids for toggle components.\n\t */\n\tstatic toggleCount = 0;\n\n\t/**\n\t * Text that is set on the left side of the toggle.\n\t */\n\t@Input()\n\tset offText(value: string | Observable<string>) {\n\t\tthis._offValues.override(value);\n\t}\n\n\tget offText() {\n\t\treturn this._offValues.value;\n\t}\n\n\t/**\n\t * Text that is set on the right side of the toggle.\n\t */\n\t@Input()\n\tset onText(value: string | Observable<string>) {\n\t\tthis._onValues.override(value);\n\t}\n\n\tget onText() {\n\t\treturn this._onValues.value;\n\t}\n\t/**\n\t * Text that is set as the label of the toggle.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Size of the toggle component.\n\t */\n\t@Input() size: \"sm\" | \"md\" = \"md\";\n\t/**\n\t * Set to `true` to hide the toggle label & set toggle on/off text to label.\n\t */\n\t@Input() hideLabel = false;\n\n\t/**\n\t * Set `aria-label` property for the button when label is empty\n\t */\n\t@Input() ariaLabel: string;\n\n\t@HostBinding(\"class.cds--toggle--skeleton\") @Input() skeleton = false;\n\n\t@HostBinding(\"class.cds--toggle\") toggleClass = true;\n\t@HostBinding(\"class.cds--toggle--disabled\") get disabledClass () {\n\t\treturn this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--form-item\") get formItem() {\n\t\treturn !this.skeleton;\n\t}\n\n\t/**\n\t * The unique id allocated to the `Toggle`.\n\t */\n\tid = \"toggle-\" + Toggle.toggleCount;\n\n\tprotected _offValues = this.i18n.getOverridable(\"TOGGLE.OFF\");\n\tprotected _onValues = this.i18n.getOverridable(\"TOGGLE.ON\");\n\t/**\n\t * Creates an instance of Toggle.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef, protected i18n: I18n) {\n\t\tsuper(changeDetectorRef);\n\t\tToggle.toggleCount++;\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the toggle input.\n\t *\n\t * ex: `this.formGroup.get(\"myToggle\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tgetOffText(): Observable<string> {\n\t\treturn this._offValues.subject;\n\t}\n\n\tgetOnText(): Observable<string> {\n\t\treturn this._onValues.subject;\n\t}\n\n\tgetCheckedText(): Observable<string> {\n\t\tif (this.checked) {\n\t\t\treturn this._onValues.subject;\n\t\t}\n\t\treturn this._offValues.subject;\n\t}\n\n\t/**\n\t * Creates instance of `ToggleChange` used to propagate the change event.\n\t */\n\temitChangeEvent() {\n\t\tthis.checkedChange.emit(this.checked);\n\t\tthis.propagateChange(this.checked);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n","// modules\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { CommonModule } from \"@angular/common\";\n\n// imports\nimport { I18nModule } from \"carbon-components-angular/i18n\";\nimport { Toggle } from \"./toggle.component\";\n\n@NgModule({\n\tdeclarations: [\n\t\tToggle\n\t],\n\texports: [\n\t\tToggle\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tFormsModule,\n\t\tI18nModule\n\t]\n})\nexport class ToggleModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAaA;;;AAGG;AACS,IAAA,YAIX;AA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AhD,WAAW;uBAAC,sBAAsB,CAAA;;;AC/JpC;MAsBa,YAAY,CAAA;;yGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;0GAAZ,YAAY,EAAA,YAAA,EAAA,CAXvB,MAAM,CAAA,EAAA,OAAA,EAAA,CAMN,YAAY;QACZ,WAAW;QACX,UAAU,aALV,MAAM,CAAA,EAAA,CAAA,CAAA;AAQK,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YALvB,YAAY;QACZ,WAAW;QACX,UAAU,CAAA,EAAA,CAAA,CAAA;2FAGC,YAAY,EAAA,UAAA,EAAA,CAAA;kBAbxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE;wBACb,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,YAAY;wBACZ,WAAW;wBACX,UAAU;AACV,qBAAA;iBACD,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"carbon-components-angular-toggle.mjs","sources":["../../src/toggle/toggle.component.ts","../../src/toggle/toggle.module.ts","../../src/toggle/carbon-components-angular-toggle.ts"],"sourcesContent":["import { Checkbox, CHECKBOX_GROUP_HOST, CheckboxGroupHost } from \"carbon-components-angular/checkbox\";\nimport {\n\tChangeDetectorRef,\n\tComponent,\n\tInject,\n\tInput,\n\tOptional,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * @deprecated since v5 - Use boolean\n * Defines the set of states for a toggle component.\n */\nexport enum ToggleState {\n\tInit,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * @todo - Toggle component will no longer extend `Checkbox` component as of v6\n * Toggle is no longer repies on using checkbox, so doesn't make sense for us to continue inheriting ALL checkbox\n * component attributes.\n */\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ToggleModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-toggle [(ngModel)]=\"toggleState\">Toggle</cds-toggle>\n * ```\n *\n * [See demo](../../?path=/story/components-toggle--basic)\n */\n@Component({\n\tselector: \"cds-toggle, ibm-toggle\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate;\">\n\t\t\t<button\n\t\t\t\tclass=\"cds--toggle__button\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[id]=\"id\"\n\t\t\t\trole=\"switch\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t[attr.aria-checked]=\"checked\"\n\t\t\t\t(click)=\"onClick($event)\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\">\n\t\t\t</button>\n\t\t\t<label\n\t\t\t\tclass=\"cds--toggle__label\"\n\t\t\t\t[for]=\"id\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--toggle__label-text\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</span>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--toggle__appearance\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--toggle__appearance--sm': size === 'sm'\n\t\t\t\t\t}\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"cds--toggle__switch\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--toggle__switch--checked': checked\n\t\t\t\t\t\t}\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t*ngIf=\"size === 'sm'\"\n\t\t\t\t\t\t\tclass='cds--toggle__check'\n\t\t\t\t\t\t\twidth=\"6px\"\n\t\t\t\t\t\t\theight=\"5px\"\n\t\t\t\t\t\t\tviewBox=\"0 0 6 5\">\n\t\t\t\t\t\t\t<path d=\"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"cds--toggle__text\">\n\t\t\t\t\t\t{{(hideLabel ? label : (getCheckedText() | async))}}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t</ng-container>\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"cds--toggle__skeleton-circle\"></div>\n\t\t\t<div class=\"cds--toggle__skeleton-rectangle\"></div>\n\t\t</ng-template>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Toggle,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Toggle extends Checkbox {\n\t/**\n\t * Variable used for creating unique ids for toggle components.\n\t */\n\tstatic toggleCount = 0;\n\n\t/**\n\t * Text that is set on the left side of the toggle.\n\t */\n\t@Input()\n\tset offText(value: string | Observable<string>) {\n\t\tthis._offValues.override(value);\n\t}\n\n\tget offText() {\n\t\treturn this._offValues.value;\n\t}\n\n\t/**\n\t * Text that is set on the right side of the toggle.\n\t */\n\t@Input()\n\tset onText(value: string | Observable<string>) {\n\t\tthis._onValues.override(value);\n\t}\n\n\tget onText() {\n\t\treturn this._onValues.value;\n\t}\n\t/**\n\t * Text that is set as the label of the toggle.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Size of the toggle component.\n\t */\n\t@Input() size: \"sm\" | \"md\" = \"md\";\n\t/**\n\t * Set to `true` to hide the toggle label & set toggle on/off text to label.\n\t */\n\t@Input() hideLabel = false;\n\n\t/**\n\t * Set `aria-label` property for the button when label is empty\n\t */\n\t@Input() ariaLabel: string;\n\n\t@HostBinding(\"class.cds--toggle--skeleton\") @Input() skeleton = false;\n\n\t@HostBinding(\"class.cds--toggle\") toggleClass = true;\n\t@HostBinding(\"class.cds--toggle--disabled\") get disabledClass () {\n\t\treturn this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--form-item\") get formItem() {\n\t\treturn !this.skeleton;\n\t}\n\n\t/**\n\t * The unique id allocated to the `Toggle`.\n\t */\n\tid = \"toggle-\" + Toggle.toggleCount;\n\n\tprotected _offValues = this.i18n.getOverridable(\"TOGGLE.OFF\");\n\tprotected _onValues = this.i18n.getOverridable(\"TOGGLE.ON\");\n\t/**\n\t * Creates an instance of Toggle.\n\t */\n\tconstructor(\n\t\tprotected changeDetectorRef: ChangeDetectorRef,\n\t\t@Optional() @Inject(CHECKBOX_GROUP_HOST) hostGroup: CheckboxGroupHost | null,\n\t\tprotected i18n: I18n\n\t) {\n\t\tsuper(changeDetectorRef, hostGroup);\n\t\tToggle.toggleCount++;\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the toggle input.\n\t *\n\t * ex: `this.formGroup.get(\"myToggle\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tgetOffText(): Observable<string> {\n\t\treturn this._offValues.subject;\n\t}\n\n\tgetOnText(): Observable<string> {\n\t\treturn this._onValues.subject;\n\t}\n\n\tgetCheckedText(): Observable<string> {\n\t\tif (this.checked) {\n\t\t\treturn this._onValues.subject;\n\t\t}\n\t\treturn this._offValues.subject;\n\t}\n\n\t/**\n\t * Creates instance of `ToggleChange` used to propagate the change event.\n\t */\n\temitChangeEvent() {\n\t\tthis.checkedChange.emit(this.checked);\n\t\tthis.propagateChange(this.checked);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n","// modules\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { CommonModule } from \"@angular/common\";\n\n// imports\nimport { I18nModule } from \"carbon-components-angular/i18n\";\nimport { Toggle } from \"./toggle.component\";\n\n@NgModule({\n\tdeclarations: [\n\t\tToggle\n\t],\n\texports: [\n\t\tToggle\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tFormsModule,\n\t\tI18nModule\n\t]\n})\nexport class ToggleModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAeA;;;AAGG;AACS,IAAA,YAIX;AAJD,CAAA,UAAY,WAAW,EAAA;IACtB,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;IACJ,WAAA,CAAA,WAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;IACP,WAAA,CAAA,WAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACV,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA,CAAA;AAED;;;;AAIG;AAEH;;;;;;;;;;;;AAYG;AAgEG,MAAO,MAAO,SAAQ,QAAQ,CAAA;AAiEnC;;AAEG;AACH,IAAA,WAAA,CACW,iBAAoC,EACL,SAAmC,EAClE,IAAU,EAAA;AAEpB,QAAA,KAAK,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AAJ1B,QAAA,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;AAEpC,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAM;AAtCrB;;AAEG;AACM,QAAA,IAAI,CAAA,IAAA,GAAgB,IAAI,CAAC;AAClC;;AAEG;AACM,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK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,CAAA;kBAbxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE;wBACb,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,YAAY;wBACZ,WAAW;wBACX,UAAU;AACV,qBAAA;iBACD,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, EventEmitter, TemplateRef, Component, ChangeDetectionStrategy, Optional, Inject, Input, Output, ViewChild, HostListener, HostBinding, ContentChildren, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
|
+
import * as i2 from 'carbon-components-angular/icon';
|
|
7
|
+
import { IconModule } from 'carbon-components-angular/icon';
|
|
8
|
+
|
|
9
|
+
const CHECKBOX_GROUP_HOST = new InjectionToken("CheckboxGroupHost");
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Defines the set of states for a checkbox component.
|
|
@@ -27,8 +31,9 @@ class Checkbox {
|
|
|
27
31
|
/**
|
|
28
32
|
* Creates an instance of `Checkbox`.
|
|
29
33
|
*/
|
|
30
|
-
constructor(changeDetectorRef) {
|
|
34
|
+
constructor(changeDetectorRef, hostGroup) {
|
|
31
35
|
this.changeDetectorRef = changeDetectorRef;
|
|
36
|
+
this.hostGroup = hostGroup;
|
|
32
37
|
/**
|
|
33
38
|
* Set to `true` for a disabled checkbox.
|
|
34
39
|
*/
|
|
@@ -45,6 +50,10 @@ class Checkbox {
|
|
|
45
50
|
* The unique id for the checkbox component.
|
|
46
51
|
*/
|
|
47
52
|
this.id = `checkbox-${Checkbox.checkboxCount}`;
|
|
53
|
+
/**
|
|
54
|
+
* Optional title for the `<label>` element.
|
|
55
|
+
*/
|
|
56
|
+
this.title = "";
|
|
48
57
|
/**
|
|
49
58
|
* Emits click event.
|
|
50
59
|
*/
|
|
@@ -72,6 +81,7 @@ class Checkbox {
|
|
|
72
81
|
* Keeps a reference to the checkboxes current state, as defined in `CheckboxState`.
|
|
73
82
|
*/
|
|
74
83
|
this.currentCheckboxState = CheckboxState.Init;
|
|
84
|
+
this.helperId = `checkbox-helper-${Checkbox.helperIdCounter++}`;
|
|
75
85
|
/**
|
|
76
86
|
* Called when checkbox is blurred. Needed to properly implement `ControlValueAccessor`.
|
|
77
87
|
*/
|
|
@@ -124,10 +134,28 @@ class Checkbox {
|
|
|
124
134
|
get checked() {
|
|
125
135
|
return this._checked;
|
|
126
136
|
}
|
|
137
|
+
get effectiveReadOnly() {
|
|
138
|
+
const own = this.readOnly;
|
|
139
|
+
const group = this.hostGroup?.readOnly ?? false;
|
|
140
|
+
return !!(own !== undefined ? own : group);
|
|
141
|
+
}
|
|
142
|
+
get effectiveInvalid() {
|
|
143
|
+
const own = this.invalid;
|
|
144
|
+
const group = this.hostGroup?.invalid ?? false;
|
|
145
|
+
return !!(own !== undefined ? own : group);
|
|
146
|
+
}
|
|
147
|
+
get effectiveWarn() {
|
|
148
|
+
const own = this.warn;
|
|
149
|
+
const group = this.hostGroup?.warn ?? false;
|
|
150
|
+
return !!(own !== undefined ? own : group);
|
|
151
|
+
}
|
|
127
152
|
/**
|
|
128
153
|
* Toggle the selected state of the checkbox.
|
|
129
154
|
*/
|
|
130
155
|
toggle() {
|
|
156
|
+
if (this.effectiveReadOnly) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
131
159
|
// Flip checked and reset indeterminate
|
|
132
160
|
this.setChecked(!this.checked, true);
|
|
133
161
|
}
|
|
@@ -166,6 +194,13 @@ class Checkbox {
|
|
|
166
194
|
this.disabled = isDisabled;
|
|
167
195
|
this.changeDetectorRef.markForCheck();
|
|
168
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Invoked by `CheckboxGroup` when group `readOnly`, `invalid`, `warn` change so `OnPush`
|
|
199
|
+
* checkboxes still refresh inherited state from `CHECKBOX_GROUP_HOST`.
|
|
200
|
+
*/
|
|
201
|
+
markForCheckFromGroup() {
|
|
202
|
+
this.changeDetectorRef.markForCheck();
|
|
203
|
+
}
|
|
169
204
|
focusOut() {
|
|
170
205
|
this.onTouched();
|
|
171
206
|
}
|
|
@@ -179,6 +214,13 @@ class Checkbox {
|
|
|
179
214
|
* Handles click events on the `Checkbox` and emits changes to other classes.
|
|
180
215
|
*/
|
|
181
216
|
onClick(event) {
|
|
217
|
+
if (this.effectiveReadOnly) {
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
if (this.click.observers.length) {
|
|
220
|
+
this.click.emit();
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
182
224
|
if (this.click.observers.length) {
|
|
183
225
|
// Disable default checkbox activation behavior which flips checked and resets indeterminate.
|
|
184
226
|
// This allows the parent component to control the checked/indeterminate properties.
|
|
@@ -213,6 +255,12 @@ class Checkbox {
|
|
|
213
255
|
this.inputCheckbox.nativeElement.indeterminate = true;
|
|
214
256
|
}
|
|
215
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Returns `true` when the provided value is a `TemplateRef`.
|
|
260
|
+
*/
|
|
261
|
+
isTemplate(value) {
|
|
262
|
+
return value instanceof TemplateRef;
|
|
263
|
+
}
|
|
216
264
|
/**
|
|
217
265
|
* Sets checked state and optionally resets indeterminate state.
|
|
218
266
|
*/
|
|
@@ -235,15 +283,22 @@ class Checkbox {
|
|
|
235
283
|
* Variable used for creating unique ids for checkbox components.
|
|
236
284
|
*/
|
|
237
285
|
Checkbox.checkboxCount = 0;
|
|
238
|
-
Checkbox
|
|
239
|
-
Checkbox.ɵ
|
|
286
|
+
Checkbox.helperIdCounter = 0;
|
|
287
|
+
Checkbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Checkbox, deps: [{ token: i0.ChangeDetectorRef }, { token: CHECKBOX_GROUP_HOST, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
288
|
+
Checkbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: { disabled: "disabled", skeleton: "skeleton", hideLabel: "hideLabel", name: "name", id: "id", required: "required", value: "value", ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", title: "title", helperText: "helperText", invalid: "invalid", invalidText: "invalidText", warn: "warn", warnText: "warnText", readOnly: "readOnly", decorator: "decorator", indeterminate: "indeterminate", checked: "checked" }, outputs: { click: "click", checkedChange: "checkedChange", indeterminateChange: "indeterminateChange" }, host: { listeners: { "focusout": "focusOut()" } }, providers: [
|
|
240
289
|
{
|
|
241
290
|
provide: NG_VALUE_ACCESSOR,
|
|
242
291
|
useExisting: Checkbox,
|
|
243
292
|
multi: true
|
|
244
293
|
}
|
|
245
294
|
], viewQueries: [{ propertyName: "inputCheckbox", first: true, predicate: ["inputCheckbox"], descendants: true }], ngImport: i0, template: `
|
|
246
|
-
<div class="cds--form-item cds--checkbox-wrapper"
|
|
295
|
+
<div class="cds--form-item cds--checkbox-wrapper"
|
|
296
|
+
[ngClass]="{
|
|
297
|
+
'cds--checkbox-wrapper--invalid': !effectiveReadOnly && effectiveInvalid,
|
|
298
|
+
'cds--checkbox-wrapper--warning': !effectiveReadOnly && !effectiveInvalid && effectiveWarn,
|
|
299
|
+
'cds--checkbox-wrapper--readonly': effectiveReadOnly,
|
|
300
|
+
'cds--checkbox-wrapper--decorator': !!decorator
|
|
301
|
+
}">
|
|
247
302
|
<input
|
|
248
303
|
#inputCheckbox
|
|
249
304
|
class="cds--checkbox"
|
|
@@ -254,28 +309,74 @@ Checkbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.
|
|
|
254
309
|
[required]="required"
|
|
255
310
|
[checked]="checked"
|
|
256
311
|
[disabled]="disabled"
|
|
312
|
+
[attr.data-invalid]="(!effectiveReadOnly && effectiveInvalid) ? true : null"
|
|
313
|
+
[attr.aria-readonly]="effectiveReadOnly ? true : null"
|
|
257
314
|
[attr.aria-labelledby]="ariaLabelledby"
|
|
315
|
+
[attr.aria-describedby]="(helperText && !effectiveInvalid && !effectiveWarn) ? helperId : null"
|
|
258
316
|
(change)="onChange($event)"
|
|
259
317
|
(click)="onClick($event)">
|
|
260
318
|
<label
|
|
261
319
|
[for]="id + '_input'"
|
|
262
320
|
[attr.aria-label]="ariaLabel"
|
|
321
|
+
[attr.title]="title || null"
|
|
263
322
|
class="cds--checkbox-label"
|
|
264
323
|
[ngClass]="{
|
|
265
324
|
'cds--skeleton' : skeleton
|
|
266
325
|
}">
|
|
267
326
|
<span [ngClass]="{'cds--visually-hidden' : hideLabel}" class="cds--checkbox-label-text">
|
|
268
327
|
<ng-content></ng-content>
|
|
328
|
+
<ng-container *ngIf="decorator">
|
|
329
|
+
<div class="cds--checkbox-wrapper-inner--decorator">
|
|
330
|
+
<ng-template [ngTemplateOutlet]="decorator"></ng-template>
|
|
331
|
+
</div>
|
|
332
|
+
</ng-container>
|
|
269
333
|
</span>
|
|
270
334
|
</label>
|
|
335
|
+
<div class="cds--checkbox__validation-msg">
|
|
336
|
+
<ng-container *ngIf="!effectiveReadOnly && effectiveInvalid">
|
|
337
|
+
<svg
|
|
338
|
+
cdsIcon="warning--filled"
|
|
339
|
+
size="16"
|
|
340
|
+
class="cds--checkbox__invalid-icon">
|
|
341
|
+
</svg>
|
|
342
|
+
<div class="cds--form-requirement">
|
|
343
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
344
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="$any(invalidText)"></ng-template>
|
|
345
|
+
</div>
|
|
346
|
+
</ng-container>
|
|
347
|
+
<ng-container *ngIf="!effectiveReadOnly && !effectiveInvalid && effectiveWarn">
|
|
348
|
+
<svg
|
|
349
|
+
cdsIcon="warning--alt--filled"
|
|
350
|
+
size="16"
|
|
351
|
+
class="cds--checkbox__invalid-icon cds--checkbox__invalid-icon--warning">
|
|
352
|
+
</svg>
|
|
353
|
+
<div class="cds--form-requirement">
|
|
354
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
355
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="$any(warnText)"></ng-template>
|
|
356
|
+
</div>
|
|
357
|
+
</ng-container>
|
|
358
|
+
</div>
|
|
359
|
+
<div
|
|
360
|
+
*ngIf="helperText && !effectiveInvalid && !effectiveWarn"
|
|
361
|
+
class="cds--form__helper-text"
|
|
362
|
+
[id]="helperId">
|
|
363
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
364
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="$any(helperText)"></ng-template>
|
|
365
|
+
</div>
|
|
271
366
|
</div>
|
|
272
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
367
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
273
368
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Checkbox, decorators: [{
|
|
274
369
|
type: Component,
|
|
275
370
|
args: [{
|
|
276
371
|
selector: "cds-checkbox, ibm-checkbox",
|
|
277
372
|
template: `
|
|
278
|
-
<div class="cds--form-item cds--checkbox-wrapper"
|
|
373
|
+
<div class="cds--form-item cds--checkbox-wrapper"
|
|
374
|
+
[ngClass]="{
|
|
375
|
+
'cds--checkbox-wrapper--invalid': !effectiveReadOnly && effectiveInvalid,
|
|
376
|
+
'cds--checkbox-wrapper--warning': !effectiveReadOnly && !effectiveInvalid && effectiveWarn,
|
|
377
|
+
'cds--checkbox-wrapper--readonly': effectiveReadOnly,
|
|
378
|
+
'cds--checkbox-wrapper--decorator': !!decorator
|
|
379
|
+
}">
|
|
279
380
|
<input
|
|
280
381
|
#inputCheckbox
|
|
281
382
|
class="cds--checkbox"
|
|
@@ -286,20 +387,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
286
387
|
[required]="required"
|
|
287
388
|
[checked]="checked"
|
|
288
389
|
[disabled]="disabled"
|
|
390
|
+
[attr.data-invalid]="(!effectiveReadOnly && effectiveInvalid) ? true : null"
|
|
391
|
+
[attr.aria-readonly]="effectiveReadOnly ? true : null"
|
|
289
392
|
[attr.aria-labelledby]="ariaLabelledby"
|
|
393
|
+
[attr.aria-describedby]="(helperText && !effectiveInvalid && !effectiveWarn) ? helperId : null"
|
|
290
394
|
(change)="onChange($event)"
|
|
291
395
|
(click)="onClick($event)">
|
|
292
396
|
<label
|
|
293
397
|
[for]="id + '_input'"
|
|
294
398
|
[attr.aria-label]="ariaLabel"
|
|
399
|
+
[attr.title]="title || null"
|
|
295
400
|
class="cds--checkbox-label"
|
|
296
401
|
[ngClass]="{
|
|
297
402
|
'cds--skeleton' : skeleton
|
|
298
403
|
}">
|
|
299
404
|
<span [ngClass]="{'cds--visually-hidden' : hideLabel}" class="cds--checkbox-label-text">
|
|
300
405
|
<ng-content></ng-content>
|
|
406
|
+
<ng-container *ngIf="decorator">
|
|
407
|
+
<div class="cds--checkbox-wrapper-inner--decorator">
|
|
408
|
+
<ng-template [ngTemplateOutlet]="decorator"></ng-template>
|
|
409
|
+
</div>
|
|
410
|
+
</ng-container>
|
|
301
411
|
</span>
|
|
302
412
|
</label>
|
|
413
|
+
<div class="cds--checkbox__validation-msg">
|
|
414
|
+
<ng-container *ngIf="!effectiveReadOnly && effectiveInvalid">
|
|
415
|
+
<svg
|
|
416
|
+
cdsIcon="warning--filled"
|
|
417
|
+
size="16"
|
|
418
|
+
class="cds--checkbox__invalid-icon">
|
|
419
|
+
</svg>
|
|
420
|
+
<div class="cds--form-requirement">
|
|
421
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
422
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="$any(invalidText)"></ng-template>
|
|
423
|
+
</div>
|
|
424
|
+
</ng-container>
|
|
425
|
+
<ng-container *ngIf="!effectiveReadOnly && !effectiveInvalid && effectiveWarn">
|
|
426
|
+
<svg
|
|
427
|
+
cdsIcon="warning--alt--filled"
|
|
428
|
+
size="16"
|
|
429
|
+
class="cds--checkbox__invalid-icon cds--checkbox__invalid-icon--warning">
|
|
430
|
+
</svg>
|
|
431
|
+
<div class="cds--form-requirement">
|
|
432
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
433
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="$any(warnText)"></ng-template>
|
|
434
|
+
</div>
|
|
435
|
+
</ng-container>
|
|
436
|
+
</div>
|
|
437
|
+
<div
|
|
438
|
+
*ngIf="helperText && !effectiveInvalid && !effectiveWarn"
|
|
439
|
+
class="cds--form__helper-text"
|
|
440
|
+
[id]="helperId">
|
|
441
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
442
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="$any(helperText)"></ng-template>
|
|
443
|
+
</div>
|
|
303
444
|
</div>
|
|
304
445
|
`,
|
|
305
446
|
providers: [
|
|
@@ -311,7 +452,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
311
452
|
],
|
|
312
453
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
313
454
|
}]
|
|
314
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }
|
|
455
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
456
|
+
type: Optional
|
|
457
|
+
}, {
|
|
458
|
+
type: Inject,
|
|
459
|
+
args: [CHECKBOX_GROUP_HOST]
|
|
460
|
+
}] }]; }, propDecorators: { disabled: [{
|
|
315
461
|
type: Input
|
|
316
462
|
}], skeleton: [{
|
|
317
463
|
type: Input
|
|
@@ -329,6 +475,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
329
475
|
type: Input
|
|
330
476
|
}], ariaLabelledby: [{
|
|
331
477
|
type: Input
|
|
478
|
+
}], title: [{
|
|
479
|
+
type: Input
|
|
480
|
+
}], helperText: [{
|
|
481
|
+
type: Input
|
|
482
|
+
}], invalid: [{
|
|
483
|
+
type: Input
|
|
484
|
+
}], invalidText: [{
|
|
485
|
+
type: Input
|
|
486
|
+
}], warn: [{
|
|
487
|
+
type: Input
|
|
488
|
+
}], warnText: [{
|
|
489
|
+
type: Input
|
|
490
|
+
}], readOnly: [{
|
|
491
|
+
type: Input
|
|
492
|
+
}], decorator: [{
|
|
493
|
+
type: Input
|
|
332
494
|
}], indeterminate: [{
|
|
333
495
|
type: Input
|
|
334
496
|
}], checked: [{
|
|
@@ -347,26 +509,228 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
347
509
|
args: ["focusout"]
|
|
348
510
|
}] } });
|
|
349
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Groups related checkboxes with a shared legend, validation, and optional decorator
|
|
514
|
+
* (e.g. AI label).
|
|
515
|
+
*
|
|
516
|
+
* ```html
|
|
517
|
+
* <cds-checkbox-group legend="Group label" [decorator]="decoratorTpl">
|
|
518
|
+
* <cds-checkbox>Option 1</cds-checkbox>
|
|
519
|
+
* </cds-checkbox-group>
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
class CheckboxGroup {
|
|
523
|
+
constructor(changeDetectorRef) {
|
|
524
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
525
|
+
this.hostFormItem = true;
|
|
526
|
+
this.helperTextId = `checkbox-group-helper-${CheckboxGroup.nextHelperId++}`;
|
|
527
|
+
this.orientation = "vertical";
|
|
528
|
+
this.invalid = false;
|
|
529
|
+
this.warn = false;
|
|
530
|
+
this.readOnly = false;
|
|
531
|
+
}
|
|
532
|
+
ngOnChanges(changes) {
|
|
533
|
+
if (changes["readOnly"] || changes["invalid"] || changes["warn"]) {
|
|
534
|
+
this.notifyCheckboxesHostStateChanged();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
ngAfterContentInit() {
|
|
538
|
+
this.checkboxes.changes.subscribe(() => this.notifyCheckboxesHostStateChanged());
|
|
539
|
+
}
|
|
540
|
+
isTemplate(value) {
|
|
541
|
+
return value instanceof TemplateRef;
|
|
542
|
+
}
|
|
543
|
+
notifyCheckboxesHostStateChanged() {
|
|
544
|
+
Promise.resolve().then(() => {
|
|
545
|
+
this.checkboxes?.forEach((cb) => cb.markForCheckFromGroup());
|
|
546
|
+
this.changeDetectorRef.markForCheck();
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
CheckboxGroup.nextHelperId = 0;
|
|
551
|
+
CheckboxGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
552
|
+
CheckboxGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CheckboxGroup, selector: "cds-checkbox-group, ibm-checkbox-group", inputs: { legend: "legend", legendId: "legendId", fieldsetAriaLabelledby: "fieldsetAriaLabelledby", orientation: "orientation", helperText: "helperText", invalid: "invalid", invalidText: "invalidText", warn: "warn", warnText: "warnText", readOnly: "readOnly", decorator: "decorator" }, host: { properties: { "class.cds--form-item": "this.hostFormItem" } }, providers: [
|
|
553
|
+
{ provide: CHECKBOX_GROUP_HOST, useExisting: CheckboxGroup }
|
|
554
|
+
], queries: [{ propertyName: "checkboxes", predicate: i0.forwardRef(function () { return Checkbox; }), descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
555
|
+
<fieldset
|
|
556
|
+
class="cds--checkbox-group"
|
|
557
|
+
[ngClass]="{
|
|
558
|
+
'cds--checkbox-group--horizontal': orientation === 'horizontal',
|
|
559
|
+
'cds--checkbox-group--readonly': readOnly,
|
|
560
|
+
'cds--checkbox-group--invalid': !readOnly && invalid,
|
|
561
|
+
'cds--checkbox-group--warning': !readOnly && !invalid && warn,
|
|
562
|
+
'cds--checkbox-group--decorator': !!decorator
|
|
563
|
+
}"
|
|
564
|
+
[attr.data-invalid]="invalid ? true : null"
|
|
565
|
+
[attr.aria-labelledby]="legendId || fieldsetAriaLabelledby || null"
|
|
566
|
+
[attr.aria-readonly]="readOnly ? true : null"
|
|
567
|
+
[attr.aria-describedby]="(helperText && !invalid && !warn) ? helperTextId : null">
|
|
568
|
+
<legend *ngIf="legend" class="cds--label" [attr.id]="legendId || null">
|
|
569
|
+
<ng-template *ngIf="isTemplate(legend); else legendLabel" [ngTemplateOutlet]="legend"></ng-template>
|
|
570
|
+
<ng-template #legendLabel>{{legend}}</ng-template>
|
|
571
|
+
<ng-container *ngIf="decorator">
|
|
572
|
+
<div class="cds--checkbox-group-inner--decorator">
|
|
573
|
+
<ng-template [ngTemplateOutlet]="decorator"></ng-template>
|
|
574
|
+
</div>
|
|
575
|
+
</ng-container>
|
|
576
|
+
</legend>
|
|
577
|
+
<ng-content></ng-content>
|
|
578
|
+
<div class="cds--checkbox-group__validation-msg">
|
|
579
|
+
<ng-container *ngIf="!readOnly && invalid">
|
|
580
|
+
<svg
|
|
581
|
+
cdsIcon="warning--filled"
|
|
582
|
+
size="16"
|
|
583
|
+
class="cds--checkbox__invalid-icon">
|
|
584
|
+
</svg>
|
|
585
|
+
<div class="cds--form-requirement">
|
|
586
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{ invalidText }}</ng-container>
|
|
587
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
588
|
+
</div>
|
|
589
|
+
</ng-container>
|
|
590
|
+
<ng-container *ngIf="!readOnly && !invalid && warn">
|
|
591
|
+
<svg
|
|
592
|
+
cdsIcon="warning--alt--filled"
|
|
593
|
+
size="16"
|
|
594
|
+
class="cds--checkbox__invalid-icon cds--checkbox__invalid-icon--warning">
|
|
595
|
+
</svg>
|
|
596
|
+
<div class="cds--form-requirement">
|
|
597
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
598
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
599
|
+
</div>
|
|
600
|
+
</ng-container>
|
|
601
|
+
</div>
|
|
602
|
+
<div
|
|
603
|
+
*ngIf="helperText && !invalid && !warn"
|
|
604
|
+
class="cds--form__helper-text"
|
|
605
|
+
[id]="helperTextId">
|
|
606
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
607
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
608
|
+
</div>
|
|
609
|
+
</fieldset>
|
|
610
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxGroup, decorators: [{
|
|
612
|
+
type: Component,
|
|
613
|
+
args: [{
|
|
614
|
+
selector: "cds-checkbox-group, ibm-checkbox-group",
|
|
615
|
+
template: `
|
|
616
|
+
<fieldset
|
|
617
|
+
class="cds--checkbox-group"
|
|
618
|
+
[ngClass]="{
|
|
619
|
+
'cds--checkbox-group--horizontal': orientation === 'horizontal',
|
|
620
|
+
'cds--checkbox-group--readonly': readOnly,
|
|
621
|
+
'cds--checkbox-group--invalid': !readOnly && invalid,
|
|
622
|
+
'cds--checkbox-group--warning': !readOnly && !invalid && warn,
|
|
623
|
+
'cds--checkbox-group--decorator': !!decorator
|
|
624
|
+
}"
|
|
625
|
+
[attr.data-invalid]="invalid ? true : null"
|
|
626
|
+
[attr.aria-labelledby]="legendId || fieldsetAriaLabelledby || null"
|
|
627
|
+
[attr.aria-readonly]="readOnly ? true : null"
|
|
628
|
+
[attr.aria-describedby]="(helperText && !invalid && !warn) ? helperTextId : null">
|
|
629
|
+
<legend *ngIf="legend" class="cds--label" [attr.id]="legendId || null">
|
|
630
|
+
<ng-template *ngIf="isTemplate(legend); else legendLabel" [ngTemplateOutlet]="legend"></ng-template>
|
|
631
|
+
<ng-template #legendLabel>{{legend}}</ng-template>
|
|
632
|
+
<ng-container *ngIf="decorator">
|
|
633
|
+
<div class="cds--checkbox-group-inner--decorator">
|
|
634
|
+
<ng-template [ngTemplateOutlet]="decorator"></ng-template>
|
|
635
|
+
</div>
|
|
636
|
+
</ng-container>
|
|
637
|
+
</legend>
|
|
638
|
+
<ng-content></ng-content>
|
|
639
|
+
<div class="cds--checkbox-group__validation-msg">
|
|
640
|
+
<ng-container *ngIf="!readOnly && invalid">
|
|
641
|
+
<svg
|
|
642
|
+
cdsIcon="warning--filled"
|
|
643
|
+
size="16"
|
|
644
|
+
class="cds--checkbox__invalid-icon">
|
|
645
|
+
</svg>
|
|
646
|
+
<div class="cds--form-requirement">
|
|
647
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{ invalidText }}</ng-container>
|
|
648
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
649
|
+
</div>
|
|
650
|
+
</ng-container>
|
|
651
|
+
<ng-container *ngIf="!readOnly && !invalid && warn">
|
|
652
|
+
<svg
|
|
653
|
+
cdsIcon="warning--alt--filled"
|
|
654
|
+
size="16"
|
|
655
|
+
class="cds--checkbox__invalid-icon cds--checkbox__invalid-icon--warning">
|
|
656
|
+
</svg>
|
|
657
|
+
<div class="cds--form-requirement">
|
|
658
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
659
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
660
|
+
</div>
|
|
661
|
+
</ng-container>
|
|
662
|
+
</div>
|
|
663
|
+
<div
|
|
664
|
+
*ngIf="helperText && !invalid && !warn"
|
|
665
|
+
class="cds--form__helper-text"
|
|
666
|
+
[id]="helperTextId">
|
|
667
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
668
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
669
|
+
</div>
|
|
670
|
+
</fieldset>
|
|
671
|
+
`,
|
|
672
|
+
providers: [
|
|
673
|
+
{ provide: CHECKBOX_GROUP_HOST, useExisting: CheckboxGroup }
|
|
674
|
+
],
|
|
675
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
676
|
+
}]
|
|
677
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { hostFormItem: [{
|
|
678
|
+
type: HostBinding,
|
|
679
|
+
args: ["class.cds--form-item"]
|
|
680
|
+
}], checkboxes: [{
|
|
681
|
+
type: ContentChildren,
|
|
682
|
+
args: [forwardRef(() => Checkbox), { descendants: true }]
|
|
683
|
+
}], legend: [{
|
|
684
|
+
type: Input
|
|
685
|
+
}], legendId: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}], fieldsetAriaLabelledby: [{
|
|
688
|
+
type: Input
|
|
689
|
+
}], orientation: [{
|
|
690
|
+
type: Input
|
|
691
|
+
}], helperText: [{
|
|
692
|
+
type: Input
|
|
693
|
+
}], invalid: [{
|
|
694
|
+
type: Input
|
|
695
|
+
}], invalidText: [{
|
|
696
|
+
type: Input
|
|
697
|
+
}], warn: [{
|
|
698
|
+
type: Input
|
|
699
|
+
}], warnText: [{
|
|
700
|
+
type: Input
|
|
701
|
+
}], readOnly: [{
|
|
702
|
+
type: Input
|
|
703
|
+
}], decorator: [{
|
|
704
|
+
type: Input
|
|
705
|
+
}] } });
|
|
706
|
+
|
|
350
707
|
// modules
|
|
351
708
|
class CheckboxModule {
|
|
352
709
|
}
|
|
353
710
|
CheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
354
|
-
CheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CheckboxModule, declarations: [Checkbox
|
|
355
|
-
|
|
711
|
+
CheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CheckboxModule, declarations: [Checkbox,
|
|
712
|
+
CheckboxGroup], imports: [CommonModule,
|
|
713
|
+
FormsModule,
|
|
714
|
+
IconModule], exports: [Checkbox,
|
|
715
|
+
CheckboxGroup] });
|
|
356
716
|
CheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxModule, imports: [CommonModule,
|
|
357
|
-
FormsModule
|
|
717
|
+
FormsModule,
|
|
718
|
+
IconModule] });
|
|
358
719
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxModule, decorators: [{
|
|
359
720
|
type: NgModule,
|
|
360
721
|
args: [{
|
|
361
722
|
declarations: [
|
|
362
|
-
Checkbox
|
|
723
|
+
Checkbox,
|
|
724
|
+
CheckboxGroup
|
|
363
725
|
],
|
|
364
726
|
exports: [
|
|
365
|
-
Checkbox
|
|
727
|
+
Checkbox,
|
|
728
|
+
CheckboxGroup
|
|
366
729
|
],
|
|
367
730
|
imports: [
|
|
368
731
|
CommonModule,
|
|
369
|
-
FormsModule
|
|
732
|
+
FormsModule,
|
|
733
|
+
IconModule
|
|
370
734
|
]
|
|
371
735
|
}]
|
|
372
736
|
}] });
|
|
@@ -375,5 +739,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
375
739
|
* Generated bundle index. Do not edit.
|
|
376
740
|
*/
|
|
377
741
|
|
|
378
|
-
export { Checkbox, CheckboxModule, CheckboxState };
|
|
742
|
+
export { CHECKBOX_GROUP_HOST, Checkbox, CheckboxGroup, CheckboxModule, CheckboxState };
|
|
379
743
|
//# sourceMappingURL=carbon-components-angular-checkbox.mjs.map
|