carbon-components-angular 5.8.1 → 5.9.1
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/docs/documentation/classes/NumberChange.html +5 -0
- 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 +1 -1
- package/docs/documentation/components/ClickableTile.html +1 -1
- package/docs/documentation/components/CodeSnippet.html +1 -1
- package/docs/documentation/components/ComboBox.html +22 -20
- 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 +85 -74
- package/docs/documentation/components/ExpandableTile.html +1 -1
- package/docs/documentation/components/FileComponent.html +1 -1
- package/docs/documentation/components/FileUploader.html +46 -42
- 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 +311 -252
- 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/Modal.html +1 -1
- package/docs/documentation/components/ModalFooter.html +1 -1
- package/docs/documentation/components/ModalHeader.html +10 -23
- package/docs/documentation/components/Notification.html +1 -1
- package/docs/documentation/components/NumberComponent.html +105 -64
- 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 +10 -10
- 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/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 +23 -36
- 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 +46 -48
- package/docs/documentation/components/SideNav.html +1 -1
- package/docs/documentation/components/SideNavItem.html +30 -24
- package/docs/documentation/components/SideNavMenu.html +5 -9
- package/docs/documentation/components/SkeletonPlaceholder.html +1 -1
- package/docs/documentation/components/SkeletonText.html +1 -1
- package/docs/documentation/components/Slider.html +107 -90
- 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 +120 -31
- 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/TableRadio.html +1 -1
- package/docs/documentation/components/TableRowComponent.html +1 -1
- package/docs/documentation/components/TableToolbar.html +8 -8
- 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/TextInputLabelComponent.html +1197 -0
- package/docs/documentation/components/TextareaLabelComponent.html +1243 -0
- package/docs/documentation/components/Tile.html +1 -1
- package/docs/documentation/components/TileGroup.html +142 -27
- package/docs/documentation/components/TimePicker.html +1 -1
- package/docs/documentation/components/TimePickerSelect.html +1 -1
- package/docs/documentation/components/Toast.html +28 -44
- package/docs/documentation/components/Toggle.html +1 -1
- 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/coverage.html +35 -11
- package/docs/documentation/directives/DialogDirective.html +9 -11
- package/docs/documentation/directives/OverflowMenuDirective.html +2 -2
- package/docs/documentation/graph/dependencies.svg +2646 -2598
- package/docs/documentation/images/coverage-badge-documentation.svg +1 -1
- package/docs/documentation/interfaces/PaginationTranslations.html +4 -4
- package/docs/documentation/js/menu-wc.js +15 -9
- package/docs/documentation/js/menu-wc_es5.js +1 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +40 -36
- package/docs/documentation/modules/DatePickerInputModule.html +40 -36
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +39 -39
- package/docs/documentation/modules/DatePickerModule.html +39 -39
- package/docs/documentation/modules/FileUploaderModule/dependencies.svg +34 -34
- package/docs/documentation/modules/FileUploaderModule.html +34 -34
- package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
- package/docs/documentation/modules/GridModule.html +60 -60
- package/docs/documentation/modules/InputModule/dependencies.svg +107 -59
- package/docs/documentation/modules/InputModule.html +126 -60
- package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LoadingModule.html +4 -4
- package/docs/documentation/modules/NFormsModule/dependencies.svg +10 -4
- package/docs/documentation/modules/NFormsModule.html +15 -5
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.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 +42 -54
- package/docs/documentation/modules/ProgressIndicatorModule.html +43 -60
- package/docs/documentation/modules/RadioModule/dependencies.svg +4 -8
- package/docs/documentation/modules/RadioModule.html +4 -8
- package/docs/documentation/modules/SearchModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SearchModule.html +4 -4
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/StructuredListModule/dependencies.svg +66 -66
- package/docs/documentation/modules/StructuredListModule.html +66 -66
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TilesModule/dependencies.svg +78 -78
- package/docs/documentation/modules/TilesModule.html +78 -78
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerModule.html +4 -4
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +46 -50
- package/docs/documentation/modules/TimePickerSelectModule.html +46 -50
- package/docs/documentation/modules/ToggleModule/dependencies.svg +26 -26
- package/docs/documentation/modules/ToggleModule.html +26 -26
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +37 -37
- package/docs/documentation/modules/ToggletipModule.html +37 -37
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation/overview.html +2647 -2599
- package/docs/documentation.json +1062 -453
- package/docs/storybook/1741.0cb8b504.iframe.bundle.js +1 -0
- package/docs/storybook/1895.d4241266.iframe.bundle.js +1 -0
- package/docs/storybook/{3224.acb75ed6.iframe.bundle.js → 3224.8b16624b.iframe.bundle.js} +1 -1
- package/docs/storybook/{3348.91a6fc53.iframe.bundle.js → 3348.683a45b7.iframe.bundle.js} +1 -1
- package/docs/storybook/{3931.f22006ff.iframe.bundle.js → 3931.55f9fea9.iframe.bundle.js} +1 -1
- package/docs/storybook/5868.3e7f17a9.iframe.bundle.js +1 -0
- package/docs/storybook/{1235.8d840d5b.iframe.bundle.js → 7153.87910de3.iframe.bundle.js} +1 -1
- package/docs/storybook/7773.6c3cf943.iframe.bundle.js +1 -0
- package/docs/storybook/{8341.50a06357.iframe.bundle.js → 8341.83894870.iframe.bundle.js} +1 -1
- package/docs/storybook/{901.aa635bd3.iframe.bundle.js → 901.3e5cc559.iframe.bundle.js} +1 -1
- package/docs/storybook/combobox-combobox-stories.fdeea2f7.iframe.bundle.js +1 -0
- package/docs/storybook/file-uploader-file-uploader-stories.fb6f46e6.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.69a14133.iframe.bundle.js +1 -0
- package/docs/storybook/{progress-indicator-progress-indicator-stories.7a79da0d.iframe.bundle.js → number-input-number-stories.3ea609db.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-dialogs-modal-with-table-stories.f2295407.iframe.bundle.js → patterns-dialogs-modal-with-table-stories.494ac5a3.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-forms-multi-step-form-stories.0d86ee5b.iframe.bundle.js → patterns-forms-multi-step-form-stories.75d0fa39.iframe.bundle.js} +1 -1
- package/docs/storybook/patterns-loading-large-loading-stories.8c04d095.iframe.bundle.js +1 -0
- package/docs/storybook/progress-indicator-progress-indicator-stories.dcc5c5ca.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.c5d3a693.iframe.bundle.js → runtime~main.7228f593.iframe.bundle.js} +1 -1
- package/docs/storybook/slider-slider-stories.feee50aa.iframe.bundle.js +1 -0
- package/docs/storybook/{tabs-tabs-stories.d36fc351.iframe.bundle.js → tabs-tabs-stories.675b2d72.iframe.bundle.js} +1 -1
- package/docs/storybook/ui-shell-ui-shell-stories.90ac54a8.iframe.bundle.js +1 -0
- package/esm2020/combobox/combobox.component.mjs +4 -2
- package/esm2020/dialog/dialog.directive.mjs +4 -6
- package/esm2020/dropdown/list/dropdown-list.component.mjs +39 -30
- package/esm2020/file-uploader/file-uploader.component.mjs +16 -13
- package/esm2020/forms/forms.module.mjs +7 -4
- package/esm2020/forms/index.mjs +2 -2
- package/esm2020/input/index.mjs +3 -1
- package/esm2020/input/input.module.mjs +13 -3
- package/esm2020/input/label.component.mjs +200 -124
- package/esm2020/input/text-input-label.component.mjs +211 -0
- package/esm2020/input/textarea-label.component.mjs +215 -0
- package/esm2020/modal/modal-header.component.mjs +7 -9
- package/esm2020/notification/toast.component.mjs +10 -12
- package/esm2020/number-input/number.component.mjs +10 -2
- package/esm2020/pagination/pagination.component.mjs +9 -9
- package/esm2020/progress-indicator/progress-indicator.component.mjs +8 -10
- package/esm2020/progress-indicator/progress-indicator.module.mjs +1 -5
- package/esm2020/slider/slider.component.mjs +6 -5
- package/esm2020/table/toolbar/table-toolbar.component.mjs +7 -7
- package/esm2020/tabs/tab-headers.component.mjs +10 -2
- package/esm2020/tiles/selection-tile.component.mjs +21 -23
- package/esm2020/tiles/tile-group.component.mjs +25 -5
- package/esm2020/ui-shell/sidenav/sidenav-item.component.mjs +8 -2
- package/esm2020/ui-shell/sidenav/sidenav-menu.component.mjs +4 -9
- package/fesm2015/carbon-components-angular-combobox.mjs +3 -1
- package/fesm2015/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-dialog.mjs +3 -5
- package/fesm2015/carbon-components-angular-dialog.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-dropdown.mjs +38 -29
- package/fesm2015/carbon-components-angular-dropdown.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-file-uploader.mjs +15 -12
- package/fesm2015/carbon-components-angular-file-uploader.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-forms.mjs +7 -4
- package/fesm2015/carbon-components-angular-forms.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-input.mjs +572 -74
- package/fesm2015/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-modal.mjs +11 -13
- package/fesm2015/carbon-components-angular-modal.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-notification.mjs +7 -9
- package/fesm2015/carbon-components-angular-notification.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-number-input.mjs +9 -1
- package/fesm2015/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-pagination.mjs +8 -8
- package/fesm2015/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs +7 -13
- package/fesm2015/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-slider.mjs +5 -4
- package/fesm2015/carbon-components-angular-slider.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-table.mjs +6 -6
- package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-tabs.mjs +9 -1
- package/fesm2015/carbon-components-angular-tabs.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-tiles.mjs +43 -26
- package/fesm2015/carbon-components-angular-tiles.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs +10 -9
- package/fesm2015/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-combobox.mjs +3 -1
- package/fesm2020/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-dialog.mjs +3 -5
- package/fesm2020/carbon-components-angular-dialog.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-dropdown.mjs +38 -29
- package/fesm2020/carbon-components-angular-dropdown.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-file-uploader.mjs +15 -12
- package/fesm2020/carbon-components-angular-file-uploader.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-forms.mjs +7 -4
- package/fesm2020/carbon-components-angular-forms.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-input.mjs +572 -74
- package/fesm2020/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-modal.mjs +11 -13
- package/fesm2020/carbon-components-angular-modal.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-notification.mjs +7 -9
- package/fesm2020/carbon-components-angular-notification.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-number-input.mjs +9 -1
- package/fesm2020/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-pagination.mjs +8 -8
- package/fesm2020/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs +7 -13
- package/fesm2020/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-slider.mjs +5 -4
- package/fesm2020/carbon-components-angular-slider.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-table.mjs +6 -6
- package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-tabs.mjs +9 -1
- package/fesm2020/carbon-components-angular-tabs.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-tiles.mjs +43 -26
- package/fesm2020/carbon-components-angular-tiles.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs +10 -9
- package/fesm2020/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/file-uploader/file-uploader.component.d.ts +2 -1
- package/forms/forms.module.d.ts +1 -1
- package/forms/index.d.ts +1 -1
- package/input/index.d.ts +2 -0
- package/input/input.module.d.ts +6 -4
- package/input/label.component.d.ts +10 -23
- package/input/text-input-label.component.d.ts +85 -0
- package/input/textarea-label.component.d.ts +87 -0
- package/modal/modal-header.component.d.ts +1 -3
- package/notification/toast.component.d.ts +1 -3
- package/number-input/number.component.d.ts +5 -1
- package/package.json +1 -1
- package/progress-indicator/progress-indicator.component.d.ts +1 -3
- package/progress-indicator/progress-indicator.module.d.ts +3 -4
- package/slider/slider.component.d.ts +3 -2
- package/tabs/tab-headers.component.d.ts +5 -3
- package/tiles/tile-group.component.d.ts +4 -2
- package/ui-shell/sidenav/sidenav-menu.component.d.ts +1 -1
- package/docs/storybook/1741.baa0e588.iframe.bundle.js +0 -1
- package/docs/storybook/1895.cdd3d03e.iframe.bundle.js +0 -1
- package/docs/storybook/5868.bc6e8b2d.iframe.bundle.js +0 -1
- package/docs/storybook/7773.ef20c61a.iframe.bundle.js +0 -1
- package/docs/storybook/combobox-combobox-stories.cc751a45.iframe.bundle.js +0 -1
- package/docs/storybook/file-uploader-file-uploader-stories.f41b9fbb.iframe.bundle.js +0 -1
- package/docs/storybook/main.760cce33.iframe.bundle.js +0 -1
- package/docs/storybook/number-input-number-stories.aadfb01f.iframe.bundle.js +0 -1
- package/docs/storybook/patterns-loading-large-loading-stories.95988daa.iframe.bundle.js +0 -1
- package/docs/storybook/slider-slider-stories.fe053915.iframe.bundle.js +0 -1
- package/docs/storybook/ui-shell-ui-shell-stories.9dc19b9f.iframe.bundle.js +0 -1
|
@@ -142,49 +142,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
142
142
|
args: ["class.cds--text-area--light"]
|
|
143
143
|
}] } });
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
* [See demo](../../?path=/story/components-input--label)
|
|
147
|
-
*
|
|
148
|
-
* ```html
|
|
149
|
-
* <cds-label labelState="success">
|
|
150
|
-
* <label label>Field with success</label>
|
|
151
|
-
* <input type="text" class="input-field">
|
|
152
|
-
* </cds-label>
|
|
153
|
-
*
|
|
154
|
-
* <cds-label labelState="warning">
|
|
155
|
-
* <label label>Field with warning</label>
|
|
156
|
-
* <input type="text" class="input-field">
|
|
157
|
-
* </cds-label>
|
|
158
|
-
*
|
|
159
|
-
* <cds-label labelState="error">
|
|
160
|
-
* <label label>Field with error</label>
|
|
161
|
-
* <input type="text" class="input-field">
|
|
162
|
-
* </cds-label>
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
class Label {
|
|
145
|
+
class TextareaLabelComponent {
|
|
166
146
|
/**
|
|
167
147
|
* Creates an instance of Label.
|
|
168
148
|
*/
|
|
169
149
|
constructor(changeDetectorRef) {
|
|
170
150
|
this.changeDetectorRef = changeDetectorRef;
|
|
171
|
-
/**
|
|
172
|
-
* The class of the wrapper
|
|
173
|
-
*/
|
|
174
|
-
this.wrapperClass = "cds--text-input__field-wrapper";
|
|
175
151
|
/**
|
|
176
152
|
* The id of the input item associated with the `Label`. This value is also used to associate the `Label` with
|
|
177
153
|
* its input counterpart through the 'for' attribute.
|
|
178
154
|
*/
|
|
179
|
-
this.labelInputID =
|
|
155
|
+
this.labelInputID = "ibm-textarea-" + TextareaLabelComponent.labelCounter;
|
|
180
156
|
/**
|
|
181
|
-
* Set to `true` for disabled
|
|
157
|
+
* Set to `true` for a disabled label.
|
|
182
158
|
*/
|
|
183
159
|
this.disabled = false;
|
|
184
|
-
/**
|
|
185
|
-
* State of the `Label` will determine the styles applied.
|
|
186
|
-
*/
|
|
187
|
-
this.labelState = "";
|
|
188
160
|
/**
|
|
189
161
|
* Set to `true` for a loading label.
|
|
190
162
|
*/
|
|
@@ -200,20 +172,222 @@ class Label {
|
|
|
200
172
|
this.labelClass = true;
|
|
201
173
|
}
|
|
202
174
|
/**
|
|
203
|
-
*
|
|
175
|
+
* Sets the id on the input item associated with the `Label`.
|
|
204
176
|
*/
|
|
205
|
-
|
|
206
|
-
if (this.
|
|
207
|
-
|
|
177
|
+
ngAfterViewInit() {
|
|
178
|
+
if (this.wrapper) {
|
|
179
|
+
// Prioritize setting id to `textarea` over div
|
|
180
|
+
const inputElement = this.wrapper.nativeElement.querySelector("textarea");
|
|
181
|
+
if (inputElement) {
|
|
182
|
+
// avoid overriding ids already set by the user reuse it instead
|
|
183
|
+
if (inputElement.id) {
|
|
184
|
+
this.labelInputID = inputElement.id;
|
|
185
|
+
this.changeDetectorRef.detectChanges();
|
|
186
|
+
}
|
|
187
|
+
inputElement.setAttribute("id", this.labelInputID);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const divElement = this.wrapper.nativeElement.querySelector("div");
|
|
191
|
+
if (divElement) {
|
|
192
|
+
if (divElement.id) {
|
|
193
|
+
this.labelInputID = divElement.id;
|
|
194
|
+
this.changeDetectorRef.detectChanges();
|
|
195
|
+
}
|
|
196
|
+
divElement.setAttribute("id", this.labelInputID);
|
|
197
|
+
}
|
|
208
198
|
}
|
|
209
199
|
}
|
|
200
|
+
isTemplate(value) {
|
|
201
|
+
return value instanceof TemplateRef;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Used to build the id of the input item associated with the `Label`.
|
|
206
|
+
*/
|
|
207
|
+
TextareaLabelComponent.labelCounter = 0;
|
|
208
|
+
TextareaLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextareaLabelComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
209
|
+
TextareaLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TextareaLabelComponent, selector: "cds-textarea-label, ibm-textarea-label", inputs: { labelInputID: "labelInputID", disabled: "disabled", skeleton: "skeleton", labelTemplate: "labelTemplate", textAreaTemplate: "textAreaTemplate", helperText: "helperText", invalidText: "invalidText", invalid: "invalid", warn: "warn", warnText: "warnText", ariaLabel: "ariaLabel" }, host: { properties: { "class.cds--form-item": "this.labelClass" } }, queries: [{ propertyName: "textArea", first: true, predicate: TextArea, descendants: true }], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }], ngImport: i0, template: `
|
|
210
|
+
<label
|
|
211
|
+
[for]="labelInputID"
|
|
212
|
+
[attr.aria-label]="ariaLabel"
|
|
213
|
+
class="cds--label"
|
|
214
|
+
[ngClass]="{
|
|
215
|
+
'cds--label--disabled': disabled,
|
|
216
|
+
'cds--skeleton': skeleton
|
|
217
|
+
}">
|
|
218
|
+
<ng-template *ngIf="labelTemplate; else labelContent" [ngTemplateOutlet]="labelTemplate"></ng-template>
|
|
219
|
+
<ng-template #labelContent>
|
|
220
|
+
<ng-content></ng-content>
|
|
221
|
+
</ng-template>
|
|
222
|
+
</label>
|
|
223
|
+
<div
|
|
224
|
+
class="cds--text-area__wrapper"
|
|
225
|
+
[ngClass]="{
|
|
226
|
+
'cds--text-input__field-wrapper--warning': warn
|
|
227
|
+
}"
|
|
228
|
+
[attr.data-invalid]="(invalid ? true : null)"
|
|
229
|
+
#wrapper>
|
|
230
|
+
<svg
|
|
231
|
+
*ngIf="!warn && invalid"
|
|
232
|
+
ibmIcon="warning--filled"
|
|
233
|
+
size="16"
|
|
234
|
+
class="cds--text-area__invalid-icon">
|
|
235
|
+
</svg>
|
|
236
|
+
<svg
|
|
237
|
+
*ngIf="!invalid && warn"
|
|
238
|
+
ibmIcon="warning--alt--filled"
|
|
239
|
+
size="16"
|
|
240
|
+
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
241
|
+
</svg>
|
|
242
|
+
<ng-template *ngIf="textAreaTemplate; else textAreaContent" [ngTemplateOutlet]="textAreaTemplate"></ng-template>
|
|
243
|
+
<ng-template #textAreaContent>
|
|
244
|
+
<ng-content select="textarea"></ng-content>
|
|
245
|
+
</ng-template>
|
|
246
|
+
</div>
|
|
247
|
+
<div
|
|
248
|
+
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
249
|
+
class="cds--form__helper-text"
|
|
250
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
251
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
252
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
253
|
+
</div>
|
|
254
|
+
<div *ngIf="!warn && invalid" class="cds--form-requirement">
|
|
255
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
256
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
257
|
+
</div>
|
|
258
|
+
<div *ngIf="!invalid && warn" class="cds--form-requirement">
|
|
259
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
260
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
261
|
+
</div>
|
|
262
|
+
`, 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"] }] });
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextareaLabelComponent, decorators: [{
|
|
264
|
+
type: Component,
|
|
265
|
+
args: [{
|
|
266
|
+
selector: "cds-textarea-label, ibm-textarea-label",
|
|
267
|
+
template: `
|
|
268
|
+
<label
|
|
269
|
+
[for]="labelInputID"
|
|
270
|
+
[attr.aria-label]="ariaLabel"
|
|
271
|
+
class="cds--label"
|
|
272
|
+
[ngClass]="{
|
|
273
|
+
'cds--label--disabled': disabled,
|
|
274
|
+
'cds--skeleton': skeleton
|
|
275
|
+
}">
|
|
276
|
+
<ng-template *ngIf="labelTemplate; else labelContent" [ngTemplateOutlet]="labelTemplate"></ng-template>
|
|
277
|
+
<ng-template #labelContent>
|
|
278
|
+
<ng-content></ng-content>
|
|
279
|
+
</ng-template>
|
|
280
|
+
</label>
|
|
281
|
+
<div
|
|
282
|
+
class="cds--text-area__wrapper"
|
|
283
|
+
[ngClass]="{
|
|
284
|
+
'cds--text-input__field-wrapper--warning': warn
|
|
285
|
+
}"
|
|
286
|
+
[attr.data-invalid]="(invalid ? true : null)"
|
|
287
|
+
#wrapper>
|
|
288
|
+
<svg
|
|
289
|
+
*ngIf="!warn && invalid"
|
|
290
|
+
ibmIcon="warning--filled"
|
|
291
|
+
size="16"
|
|
292
|
+
class="cds--text-area__invalid-icon">
|
|
293
|
+
</svg>
|
|
294
|
+
<svg
|
|
295
|
+
*ngIf="!invalid && warn"
|
|
296
|
+
ibmIcon="warning--alt--filled"
|
|
297
|
+
size="16"
|
|
298
|
+
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
299
|
+
</svg>
|
|
300
|
+
<ng-template *ngIf="textAreaTemplate; else textAreaContent" [ngTemplateOutlet]="textAreaTemplate"></ng-template>
|
|
301
|
+
<ng-template #textAreaContent>
|
|
302
|
+
<ng-content select="textarea"></ng-content>
|
|
303
|
+
</ng-template>
|
|
304
|
+
</div>
|
|
305
|
+
<div
|
|
306
|
+
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
307
|
+
class="cds--form__helper-text"
|
|
308
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
309
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
310
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
311
|
+
</div>
|
|
312
|
+
<div *ngIf="!warn && invalid" class="cds--form-requirement">
|
|
313
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
314
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
315
|
+
</div>
|
|
316
|
+
<div *ngIf="!invalid && warn" class="cds--form-requirement">
|
|
317
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
318
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
319
|
+
</div>
|
|
320
|
+
`
|
|
321
|
+
}]
|
|
322
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { labelInputID: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], disabled: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], skeleton: [{
|
|
327
|
+
type: Input
|
|
328
|
+
}], labelTemplate: [{
|
|
329
|
+
type: Input
|
|
330
|
+
}], textAreaTemplate: [{
|
|
331
|
+
type: Input
|
|
332
|
+
}], helperText: [{
|
|
333
|
+
type: Input
|
|
334
|
+
}], invalidText: [{
|
|
335
|
+
type: Input
|
|
336
|
+
}], invalid: [{
|
|
337
|
+
type: Input
|
|
338
|
+
}], warn: [{
|
|
339
|
+
type: Input
|
|
340
|
+
}], warnText: [{
|
|
341
|
+
type: Input
|
|
342
|
+
}], ariaLabel: [{
|
|
343
|
+
type: Input
|
|
344
|
+
}], wrapper: [{
|
|
345
|
+
type: ViewChild,
|
|
346
|
+
args: ["wrapper", { static: false }]
|
|
347
|
+
}], textArea: [{
|
|
348
|
+
type: ContentChild,
|
|
349
|
+
args: [TextArea, { static: false }]
|
|
350
|
+
}], labelClass: [{
|
|
351
|
+
type: HostBinding,
|
|
352
|
+
args: ["class.cds--form-item"]
|
|
353
|
+
}] } });
|
|
354
|
+
|
|
355
|
+
class TextInputLabelComponent {
|
|
356
|
+
/**
|
|
357
|
+
* Creates an instance of Label.
|
|
358
|
+
*/
|
|
359
|
+
constructor(changeDetectorRef) {
|
|
360
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
361
|
+
/**
|
|
362
|
+
* The id of the input item associated with the `Label`. This value is also used to associate the `Label` with
|
|
363
|
+
* its input counterpart through the 'for' attribute.
|
|
364
|
+
*/
|
|
365
|
+
this.labelInputID = "ibm-text-input-" + TextInputLabelComponent.labelCounter++;
|
|
366
|
+
/**
|
|
367
|
+
* Set to `true` for a disabled label.
|
|
368
|
+
*/
|
|
369
|
+
this.disabled = false;
|
|
370
|
+
/**
|
|
371
|
+
* Set to `true` for a loading label.
|
|
372
|
+
*/
|
|
373
|
+
this.skeleton = false;
|
|
374
|
+
/**
|
|
375
|
+
* Set to `true` for an invalid label component.
|
|
376
|
+
*/
|
|
377
|
+
this.invalid = false;
|
|
378
|
+
/**
|
|
379
|
+
* Set to `true` to show a warning (contents set by warningText)
|
|
380
|
+
*/
|
|
381
|
+
this.warn = false;
|
|
382
|
+
this.labelClass = true;
|
|
383
|
+
}
|
|
210
384
|
/**
|
|
211
385
|
* Sets the id on the input item associated with the `Label`.
|
|
212
386
|
*/
|
|
213
387
|
ngAfterViewInit() {
|
|
214
388
|
if (this.wrapper) {
|
|
215
|
-
// Prioritize setting id to `input`
|
|
216
|
-
const inputElement = this.wrapper.nativeElement.querySelector("input
|
|
389
|
+
// Prioritize setting id to `input` over div
|
|
390
|
+
const inputElement = this.wrapper.nativeElement.querySelector("input");
|
|
217
391
|
if (inputElement) {
|
|
218
392
|
// avoid overriding ids already set by the user reuse it instead
|
|
219
393
|
if (inputElement.id) {
|
|
@@ -240,21 +414,24 @@ class Label {
|
|
|
240
414
|
/**
|
|
241
415
|
* Used to build the id of the input item associated with the `Label`.
|
|
242
416
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
417
|
+
TextInputLabelComponent.labelCounter = 0;
|
|
418
|
+
TextInputLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextInputLabelComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
419
|
+
TextInputLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: { labelInputID: "labelInputID", disabled: "disabled", skeleton: "skeleton", labelTemplate: "labelTemplate", textInputTemplate: "textInputTemplate", helperText: "helperText", invalidText: "invalidText", invalid: "invalid", warn: "warn", warnText: "warnText", ariaLabel: "ariaLabel" }, host: { properties: { "class.cds--form-item": "this.labelClass" } }, viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }], ngImport: i0, template: `
|
|
246
420
|
<label
|
|
247
421
|
[for]="labelInputID"
|
|
248
422
|
[attr.aria-label]="ariaLabel"
|
|
249
423
|
class="cds--label"
|
|
250
424
|
[ngClass]="{
|
|
251
|
-
'cds--
|
|
252
|
-
'cds--
|
|
425
|
+
'cds--label--disabled': disabled,
|
|
426
|
+
'cds--skeleton': skeleton
|
|
253
427
|
}">
|
|
254
|
-
<ng-
|
|
428
|
+
<ng-template *ngIf="labelTemplate; else labelContent" [ngTemplateOutlet]="labelTemplate"></ng-template>
|
|
429
|
+
<ng-template #labelContent>
|
|
430
|
+
<ng-content></ng-content>
|
|
431
|
+
</ng-template>
|
|
255
432
|
</label>
|
|
256
433
|
<div
|
|
257
|
-
|
|
434
|
+
class="cds--text-input__field-wrapper"
|
|
258
435
|
[ngClass]="{
|
|
259
436
|
'cds--text-input__field-wrapper--warning': warn
|
|
260
437
|
}"
|
|
@@ -262,27 +439,25 @@ Label.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0
|
|
|
262
439
|
#wrapper>
|
|
263
440
|
<svg
|
|
264
441
|
*ngIf="!warn && invalid"
|
|
265
|
-
|
|
442
|
+
ibmIcon="warning--filled"
|
|
266
443
|
size="16"
|
|
267
|
-
|
|
268
|
-
'cds--text-input__invalid-icon': !textArea,
|
|
269
|
-
'cds--text-area__invalid-icon': textArea
|
|
270
|
-
}">
|
|
444
|
+
class="cds--text-input__invalid-icon">
|
|
271
445
|
</svg>
|
|
272
446
|
<svg
|
|
273
447
|
*ngIf="!invalid && warn"
|
|
274
|
-
|
|
448
|
+
ibmIcon="warning--alt--filled"
|
|
275
449
|
size="16"
|
|
276
450
|
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
277
451
|
</svg>
|
|
278
|
-
<ng-
|
|
452
|
+
<ng-template *ngIf="textInputTemplate; else textInputContent" [ngTemplateOutlet]="textInputTemplate"></ng-template>
|
|
453
|
+
<ng-template #textInputContent>
|
|
454
|
+
<ng-content select="input[type=text],div"></ng-content>
|
|
455
|
+
</ng-template>
|
|
279
456
|
</div>
|
|
280
457
|
<div
|
|
281
458
|
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
282
459
|
class="cds--form__helper-text"
|
|
283
|
-
[ngClass]="{
|
|
284
|
-
'cds--form__helper-text--disabled': disabled
|
|
285
|
-
}">
|
|
460
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
286
461
|
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
287
462
|
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
288
463
|
</div>
|
|
@@ -295,23 +470,26 @@ Label.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0
|
|
|
295
470
|
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
296
471
|
</div>
|
|
297
472
|
`, 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"] }] });
|
|
298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
473
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextInputLabelComponent, decorators: [{
|
|
299
474
|
type: Component,
|
|
300
475
|
args: [{
|
|
301
|
-
selector: "cds-label, ibm-label",
|
|
476
|
+
selector: "cds-text-label, ibm-text-label",
|
|
302
477
|
template: `
|
|
303
478
|
<label
|
|
304
479
|
[for]="labelInputID"
|
|
305
480
|
[attr.aria-label]="ariaLabel"
|
|
306
481
|
class="cds--label"
|
|
307
482
|
[ngClass]="{
|
|
308
|
-
'cds--
|
|
309
|
-
'cds--
|
|
483
|
+
'cds--label--disabled': disabled,
|
|
484
|
+
'cds--skeleton': skeleton
|
|
310
485
|
}">
|
|
311
|
-
<ng-
|
|
486
|
+
<ng-template *ngIf="labelTemplate; else labelContent" [ngTemplateOutlet]="labelTemplate"></ng-template>
|
|
487
|
+
<ng-template #labelContent>
|
|
488
|
+
<ng-content></ng-content>
|
|
489
|
+
</ng-template>
|
|
312
490
|
</label>
|
|
313
491
|
<div
|
|
314
|
-
|
|
492
|
+
class="cds--text-input__field-wrapper"
|
|
315
493
|
[ngClass]="{
|
|
316
494
|
'cds--text-input__field-wrapper--warning': warn
|
|
317
495
|
}"
|
|
@@ -319,27 +497,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
319
497
|
#wrapper>
|
|
320
498
|
<svg
|
|
321
499
|
*ngIf="!warn && invalid"
|
|
322
|
-
|
|
500
|
+
ibmIcon="warning--filled"
|
|
323
501
|
size="16"
|
|
324
|
-
|
|
325
|
-
'cds--text-input__invalid-icon': !textArea,
|
|
326
|
-
'cds--text-area__invalid-icon': textArea
|
|
327
|
-
}">
|
|
502
|
+
class="cds--text-input__invalid-icon">
|
|
328
503
|
</svg>
|
|
329
504
|
<svg
|
|
330
505
|
*ngIf="!invalid && warn"
|
|
331
|
-
|
|
506
|
+
ibmIcon="warning--alt--filled"
|
|
332
507
|
size="16"
|
|
333
508
|
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
334
509
|
</svg>
|
|
335
|
-
<ng-
|
|
510
|
+
<ng-template *ngIf="textInputTemplate; else textInputContent" [ngTemplateOutlet]="textInputTemplate"></ng-template>
|
|
511
|
+
<ng-template #textInputContent>
|
|
512
|
+
<ng-content select="input[type=text],div"></ng-content>
|
|
513
|
+
</ng-template>
|
|
336
514
|
</div>
|
|
337
515
|
<div
|
|
338
516
|
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
339
517
|
class="cds--form__helper-text"
|
|
340
|
-
[ngClass]="{
|
|
341
|
-
'cds--form__helper-text--disabled': disabled
|
|
342
|
-
}">
|
|
518
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
343
519
|
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
344
520
|
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
345
521
|
</div>
|
|
@@ -357,7 +533,318 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
357
533
|
type: Input
|
|
358
534
|
}], disabled: [{
|
|
359
535
|
type: Input
|
|
360
|
-
}],
|
|
536
|
+
}], skeleton: [{
|
|
537
|
+
type: Input
|
|
538
|
+
}], labelTemplate: [{
|
|
539
|
+
type: Input
|
|
540
|
+
}], textInputTemplate: [{
|
|
541
|
+
type: Input
|
|
542
|
+
}], helperText: [{
|
|
543
|
+
type: Input
|
|
544
|
+
}], invalidText: [{
|
|
545
|
+
type: Input
|
|
546
|
+
}], invalid: [{
|
|
547
|
+
type: Input
|
|
548
|
+
}], warn: [{
|
|
549
|
+
type: Input
|
|
550
|
+
}], warnText: [{
|
|
551
|
+
type: Input
|
|
552
|
+
}], ariaLabel: [{
|
|
553
|
+
type: Input
|
|
554
|
+
}], wrapper: [{
|
|
555
|
+
type: ViewChild,
|
|
556
|
+
args: ["wrapper", { static: false }]
|
|
557
|
+
}], labelClass: [{
|
|
558
|
+
type: HostBinding,
|
|
559
|
+
args: ["class.cds--form-item"]
|
|
560
|
+
}] } });
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* [See demo](../../?path=/story/components-input--label)
|
|
564
|
+
*
|
|
565
|
+
* To prevent attribute drilling, use `ibm-text-label` or `ibm-textarea-label` components
|
|
566
|
+
*
|
|
567
|
+
* ```html
|
|
568
|
+
* <cds-label>
|
|
569
|
+
* Label
|
|
570
|
+
* <input cdsText type="text" class="input-field">
|
|
571
|
+
* </cds-label>
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
class Label {
|
|
575
|
+
/**
|
|
576
|
+
* Creates an instance of Label.
|
|
577
|
+
*/
|
|
578
|
+
constructor(changeDetectorRef) {
|
|
579
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
580
|
+
/**
|
|
581
|
+
* The id of the input item associated with the `Label`. This value is also used to associate the `Label` with
|
|
582
|
+
* its input counterpart through the 'for' attribute.
|
|
583
|
+
*/
|
|
584
|
+
this.labelInputID = `cds-label-${Label.labelCounter++}`;
|
|
585
|
+
/**
|
|
586
|
+
* Set to `true` for disabled state.
|
|
587
|
+
*/
|
|
588
|
+
this.disabled = false;
|
|
589
|
+
/**
|
|
590
|
+
* Set to `true` for a loading label.
|
|
591
|
+
*/
|
|
592
|
+
this.skeleton = false;
|
|
593
|
+
/**
|
|
594
|
+
* Set to `true` for an invalid label component.
|
|
595
|
+
*/
|
|
596
|
+
this.invalid = false;
|
|
597
|
+
/**
|
|
598
|
+
* Set to `true` to show a warning (contents set by warningText)
|
|
599
|
+
*/
|
|
600
|
+
this.warn = false;
|
|
601
|
+
}
|
|
602
|
+
get labelClass() {
|
|
603
|
+
return this.type === undefined;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Update wrapper class if a textarea is hosted.
|
|
607
|
+
*/
|
|
608
|
+
ngAfterContentInit() {
|
|
609
|
+
if (this.textArea) {
|
|
610
|
+
this.type = "TextArea";
|
|
611
|
+
}
|
|
612
|
+
else if (this.textInput) {
|
|
613
|
+
this.type = "TextInput";
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Sets the id on the input item associated with the `Label`.
|
|
618
|
+
*/
|
|
619
|
+
ngAfterViewInit() {
|
|
620
|
+
// Will only be called when `default` template is being used
|
|
621
|
+
if (this.wrapper) {
|
|
622
|
+
// Prioritize setting id to `input` & `textarea` over div
|
|
623
|
+
const inputElement = this.wrapper.nativeElement.querySelector("input,textarea");
|
|
624
|
+
if (inputElement) {
|
|
625
|
+
// avoid overriding ids already set by the user reuse it instead
|
|
626
|
+
if (inputElement.id) {
|
|
627
|
+
this.labelInputID = inputElement.id;
|
|
628
|
+
this.changeDetectorRef.detectChanges();
|
|
629
|
+
}
|
|
630
|
+
inputElement.setAttribute("id", this.labelInputID);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
const divElement = this.wrapper.nativeElement.querySelector("div");
|
|
634
|
+
if (divElement) {
|
|
635
|
+
if (divElement.id) {
|
|
636
|
+
this.labelInputID = divElement.id;
|
|
637
|
+
this.changeDetectorRef.detectChanges();
|
|
638
|
+
}
|
|
639
|
+
divElement.setAttribute("id", this.labelInputID);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
isTemplate(value) {
|
|
644
|
+
return value instanceof TemplateRef;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Used to build the id of the input item associated with the `Label`.
|
|
649
|
+
*/
|
|
650
|
+
Label.labelCounter = 0;
|
|
651
|
+
Label.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Label, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
652
|
+
Label.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Label, selector: "cds-label, ibm-label", inputs: { labelInputID: "labelInputID", disabled: "disabled", skeleton: "skeleton", helperText: "helperText", invalidText: "invalidText", invalid: "invalid", warn: "warn", warnText: "warnText", ariaLabel: "ariaLabel" }, host: { properties: { "class.cds--form-item": "this.labelClass" } }, queries: [{ propertyName: "textArea", first: true, predicate: TextArea, descendants: true }, { propertyName: "textInput", first: true, predicate: TextInput, descendants: true }], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }], ngImport: i0, template: `
|
|
653
|
+
<ng-template #inputContentTemplate>
|
|
654
|
+
<ng-content select="input,textarea,div"></ng-content>
|
|
655
|
+
</ng-template>
|
|
656
|
+
|
|
657
|
+
<ng-template #labelContentTemplate>
|
|
658
|
+
<ng-content></ng-content>
|
|
659
|
+
</ng-template>
|
|
660
|
+
|
|
661
|
+
<ng-container [ngSwitch]="type">
|
|
662
|
+
<ng-container *ngSwitchCase="'TextArea'">
|
|
663
|
+
<cds-textarea-label
|
|
664
|
+
[labelInputID]="labelInputID"
|
|
665
|
+
[disabled]="disabled"
|
|
666
|
+
[skeleton]="skeleton"
|
|
667
|
+
[helperText]="helperText"
|
|
668
|
+
[invalid]="invalid"
|
|
669
|
+
[invalidText]="invalidText"
|
|
670
|
+
[warn]="warn"
|
|
671
|
+
[warnText]="warnText"
|
|
672
|
+
[ariaLabel]="ariaLabel"
|
|
673
|
+
[labelTemplate]="labelContentTemplate"
|
|
674
|
+
[textAreaTemplate]="inputContentTemplate">
|
|
675
|
+
</cds-textarea-label>
|
|
676
|
+
</ng-container>
|
|
677
|
+
<ng-container *ngSwitchCase="'TextInput'">
|
|
678
|
+
<cds-text-label
|
|
679
|
+
[labelInputID]="labelInputID"
|
|
680
|
+
[disabled]="disabled"
|
|
681
|
+
[skeleton]="skeleton"
|
|
682
|
+
[helperText]="helperText"
|
|
683
|
+
[invalid]="invalid"
|
|
684
|
+
[invalidText]="invalidText"
|
|
685
|
+
[warn]="warn"
|
|
686
|
+
[warnText]="warnText"
|
|
687
|
+
[ariaLabel]="ariaLabel"
|
|
688
|
+
[labelTemplate]="labelContentTemplate"
|
|
689
|
+
[textInputTemplate]="inputContentTemplate">
|
|
690
|
+
</cds-text-label>
|
|
691
|
+
</ng-container>
|
|
692
|
+
<ng-container *ngSwitchDefault>
|
|
693
|
+
<ng-template [ngTemplateOutlet]="default"></ng-template>
|
|
694
|
+
</ng-container>
|
|
695
|
+
</ng-container>
|
|
696
|
+
|
|
697
|
+
<ng-template #default>
|
|
698
|
+
<label
|
|
699
|
+
[for]="labelInputID"
|
|
700
|
+
[attr.aria-label]="ariaLabel"
|
|
701
|
+
class="cds--label"
|
|
702
|
+
[ngClass]="{
|
|
703
|
+
'cds--label--disabled': disabled,
|
|
704
|
+
'cds--skeleton': skeleton
|
|
705
|
+
}">
|
|
706
|
+
<ng-template [ngTemplateOutlet]="labelContentTemplate"></ng-template>
|
|
707
|
+
</label>
|
|
708
|
+
<div
|
|
709
|
+
class="cds--text-input__field-wrapper"
|
|
710
|
+
[ngClass]="{
|
|
711
|
+
'cds--text-input__field-wrapper--warning': warn
|
|
712
|
+
}"
|
|
713
|
+
[attr.data-invalid]="(invalid ? true : null)"
|
|
714
|
+
#wrapper>
|
|
715
|
+
<svg
|
|
716
|
+
*ngIf="!warn && invalid"
|
|
717
|
+
ibmIcon="warning--filled"
|
|
718
|
+
size="16"
|
|
719
|
+
class="cds--text-input__invalid-icon">
|
|
720
|
+
</svg>
|
|
721
|
+
<svg
|
|
722
|
+
*ngIf="!invalid && warn"
|
|
723
|
+
ibmIcon="warning--alt--filled"
|
|
724
|
+
size="16"
|
|
725
|
+
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
726
|
+
</svg>
|
|
727
|
+
<ng-template [ngTemplateOutlet]="inputContentTemplate"></ng-template>
|
|
728
|
+
</div>
|
|
729
|
+
<div
|
|
730
|
+
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
731
|
+
class="cds--form__helper-text"
|
|
732
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
733
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
734
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
735
|
+
</div>
|
|
736
|
+
<div *ngIf="!warn && invalid" class="cds--form-requirement">
|
|
737
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
738
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
739
|
+
</div>
|
|
740
|
+
<div *ngIf="!invalid && warn" class="cds--form-requirement">
|
|
741
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
742
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
743
|
+
</div>
|
|
744
|
+
</ng-template>
|
|
745
|
+
`, 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: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: TextareaLabelComponent, selector: "cds-textarea-label, ibm-textarea-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textAreaTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "component", type: TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }] });
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Label, decorators: [{
|
|
747
|
+
type: Component,
|
|
748
|
+
args: [{
|
|
749
|
+
selector: "cds-label, ibm-label",
|
|
750
|
+
template: `
|
|
751
|
+
<ng-template #inputContentTemplate>
|
|
752
|
+
<ng-content select="input,textarea,div"></ng-content>
|
|
753
|
+
</ng-template>
|
|
754
|
+
|
|
755
|
+
<ng-template #labelContentTemplate>
|
|
756
|
+
<ng-content></ng-content>
|
|
757
|
+
</ng-template>
|
|
758
|
+
|
|
759
|
+
<ng-container [ngSwitch]="type">
|
|
760
|
+
<ng-container *ngSwitchCase="'TextArea'">
|
|
761
|
+
<cds-textarea-label
|
|
762
|
+
[labelInputID]="labelInputID"
|
|
763
|
+
[disabled]="disabled"
|
|
764
|
+
[skeleton]="skeleton"
|
|
765
|
+
[helperText]="helperText"
|
|
766
|
+
[invalid]="invalid"
|
|
767
|
+
[invalidText]="invalidText"
|
|
768
|
+
[warn]="warn"
|
|
769
|
+
[warnText]="warnText"
|
|
770
|
+
[ariaLabel]="ariaLabel"
|
|
771
|
+
[labelTemplate]="labelContentTemplate"
|
|
772
|
+
[textAreaTemplate]="inputContentTemplate">
|
|
773
|
+
</cds-textarea-label>
|
|
774
|
+
</ng-container>
|
|
775
|
+
<ng-container *ngSwitchCase="'TextInput'">
|
|
776
|
+
<cds-text-label
|
|
777
|
+
[labelInputID]="labelInputID"
|
|
778
|
+
[disabled]="disabled"
|
|
779
|
+
[skeleton]="skeleton"
|
|
780
|
+
[helperText]="helperText"
|
|
781
|
+
[invalid]="invalid"
|
|
782
|
+
[invalidText]="invalidText"
|
|
783
|
+
[warn]="warn"
|
|
784
|
+
[warnText]="warnText"
|
|
785
|
+
[ariaLabel]="ariaLabel"
|
|
786
|
+
[labelTemplate]="labelContentTemplate"
|
|
787
|
+
[textInputTemplate]="inputContentTemplate">
|
|
788
|
+
</cds-text-label>
|
|
789
|
+
</ng-container>
|
|
790
|
+
<ng-container *ngSwitchDefault>
|
|
791
|
+
<ng-template [ngTemplateOutlet]="default"></ng-template>
|
|
792
|
+
</ng-container>
|
|
793
|
+
</ng-container>
|
|
794
|
+
|
|
795
|
+
<ng-template #default>
|
|
796
|
+
<label
|
|
797
|
+
[for]="labelInputID"
|
|
798
|
+
[attr.aria-label]="ariaLabel"
|
|
799
|
+
class="cds--label"
|
|
800
|
+
[ngClass]="{
|
|
801
|
+
'cds--label--disabled': disabled,
|
|
802
|
+
'cds--skeleton': skeleton
|
|
803
|
+
}">
|
|
804
|
+
<ng-template [ngTemplateOutlet]="labelContentTemplate"></ng-template>
|
|
805
|
+
</label>
|
|
806
|
+
<div
|
|
807
|
+
class="cds--text-input__field-wrapper"
|
|
808
|
+
[ngClass]="{
|
|
809
|
+
'cds--text-input__field-wrapper--warning': warn
|
|
810
|
+
}"
|
|
811
|
+
[attr.data-invalid]="(invalid ? true : null)"
|
|
812
|
+
#wrapper>
|
|
813
|
+
<svg
|
|
814
|
+
*ngIf="!warn && invalid"
|
|
815
|
+
ibmIcon="warning--filled"
|
|
816
|
+
size="16"
|
|
817
|
+
class="cds--text-input__invalid-icon">
|
|
818
|
+
</svg>
|
|
819
|
+
<svg
|
|
820
|
+
*ngIf="!invalid && warn"
|
|
821
|
+
ibmIcon="warning--alt--filled"
|
|
822
|
+
size="16"
|
|
823
|
+
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
|
|
824
|
+
</svg>
|
|
825
|
+
<ng-template [ngTemplateOutlet]="inputContentTemplate"></ng-template>
|
|
826
|
+
</div>
|
|
827
|
+
<div
|
|
828
|
+
*ngIf="!skeleton && helperText && !invalid && !warn"
|
|
829
|
+
class="cds--form__helper-text"
|
|
830
|
+
[ngClass]="{'cds--form__helper-text--disabled': disabled}">
|
|
831
|
+
<ng-container *ngIf="!isTemplate(helperText)">{{helperText}}</ng-container>
|
|
832
|
+
<ng-template *ngIf="isTemplate(helperText)" [ngTemplateOutlet]="helperText"></ng-template>
|
|
833
|
+
</div>
|
|
834
|
+
<div *ngIf="!warn && invalid" class="cds--form-requirement">
|
|
835
|
+
<ng-container *ngIf="!isTemplate(invalidText)">{{invalidText}}</ng-container>
|
|
836
|
+
<ng-template *ngIf="isTemplate(invalidText)" [ngTemplateOutlet]="invalidText"></ng-template>
|
|
837
|
+
</div>
|
|
838
|
+
<div *ngIf="!invalid && warn" class="cds--form-requirement">
|
|
839
|
+
<ng-container *ngIf="!isTemplate(warnText)">{{warnText}}</ng-container>
|
|
840
|
+
<ng-template *ngIf="isTemplate(warnText)" [ngTemplateOutlet]="warnText"></ng-template>
|
|
841
|
+
</div>
|
|
842
|
+
</ng-template>
|
|
843
|
+
`
|
|
844
|
+
}]
|
|
845
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { labelInputID: [{
|
|
846
|
+
type: Input
|
|
847
|
+
}], disabled: [{
|
|
361
848
|
type: Input
|
|
362
849
|
}], skeleton: [{
|
|
363
850
|
type: Input
|
|
@@ -379,6 +866,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
379
866
|
}], textArea: [{
|
|
380
867
|
type: ContentChild,
|
|
381
868
|
args: [TextArea]
|
|
869
|
+
}], textInput: [{
|
|
870
|
+
type: ContentChild,
|
|
871
|
+
args: [TextInput, { static: false }]
|
|
382
872
|
}], labelClass: [{
|
|
383
873
|
type: HostBinding,
|
|
384
874
|
args: ["class.cds--form-item"]
|
|
@@ -390,9 +880,13 @@ class InputModule {
|
|
|
390
880
|
InputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
391
881
|
InputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: InputModule, declarations: [Label,
|
|
392
882
|
TextInput,
|
|
393
|
-
TextArea
|
|
883
|
+
TextArea,
|
|
884
|
+
TextareaLabelComponent,
|
|
885
|
+
TextInputLabelComponent], imports: [CommonModule,
|
|
394
886
|
FormsModule,
|
|
395
887
|
IconModule], exports: [Label,
|
|
888
|
+
TextareaLabelComponent,
|
|
889
|
+
TextInputLabelComponent,
|
|
396
890
|
TextInput,
|
|
397
891
|
TextArea] });
|
|
398
892
|
InputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputModule, imports: [CommonModule,
|
|
@@ -404,10 +898,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
404
898
|
declarations: [
|
|
405
899
|
Label,
|
|
406
900
|
TextInput,
|
|
407
|
-
TextArea
|
|
901
|
+
TextArea,
|
|
902
|
+
TextareaLabelComponent,
|
|
903
|
+
TextInputLabelComponent
|
|
408
904
|
],
|
|
409
905
|
exports: [
|
|
410
906
|
Label,
|
|
907
|
+
TextareaLabelComponent,
|
|
908
|
+
TextInputLabelComponent,
|
|
411
909
|
TextInput,
|
|
412
910
|
TextArea
|
|
413
911
|
],
|
|
@@ -423,5 +921,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
423
921
|
* Generated bundle index. Do not edit.
|
|
424
922
|
*/
|
|
425
923
|
|
|
426
|
-
export { InputModule, Label, TextArea, TextInput };
|
|
924
|
+
export { InputModule, Label, TextArea, TextInput, TextInputLabelComponent, TextareaLabelComponent };
|
|
427
925
|
//# sourceMappingURL=carbon-components-angular-input.mjs.map
|