diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index a65e6a2d6..66dc7300c 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -727,7 +727,4 @@ border-color: #666; opacity: 1; } - .oui-mdc-tab-body-wrapper { - min-height: 100px; - } diff --git a/documentation.json b/documentation.json index f019d8965..1db52d05d 100644 --- a/documentation.json +++ b/documentation.json @@ -3436,7 +3436,7 @@ { "name": "ErrorStateMatcher", "id": "injectable-ErrorStateMatcher-2a790495b111018f3cbba0de2309c414412a62be2f0fb8cffdc004f5dc3b3f11c8e19fc024a0ae5e7487dfe35577ec4246ce26c8c46297b9d2651b92f301d6e5", - "file": "ui/src/components/core/common-behaviors/error-options.ts", + "file": "ui/src/components/core/error/error-options.ts", "properties": [], "methods": [ { @@ -3493,7 +3493,7 @@ { "name": "ErrorStateMatcher", "id": "injectable-ErrorStateMatcher-2a790495b111018f3cbba0de2309c414412a62be2f0fb8cffdc004f5dc3b3f11c8e19fc024a0ae5e7487dfe35577ec4246ce26c8c46297b9d2651b92f301d6e5-1", - "file": "ui/src/components/core/error/error-options.ts", + "file": "ui/src/components/core/common-behaviors/error-options.ts", "properties": [], "methods": [ { @@ -7188,7 +7188,7 @@ { "name": "ShowOnDirtyErrorStateMatcher", "id": "injectable-ShowOnDirtyErrorStateMatcher-2a790495b111018f3cbba0de2309c414412a62be2f0fb8cffdc004f5dc3b3f11c8e19fc024a0ae5e7487dfe35577ec4246ce26c8c46297b9d2651b92f301d6e5", - "file": "ui/src/components/core/common-behaviors/error-options.ts", + "file": "ui/src/components/core/error/error-options.ts", "properties": [], "methods": [ { @@ -7245,7 +7245,7 @@ { "name": "ShowOnDirtyErrorStateMatcher", "id": "injectable-ShowOnDirtyErrorStateMatcher-2a790495b111018f3cbba0de2309c414412a62be2f0fb8cffdc004f5dc3b3f11c8e19fc024a0ae5e7487dfe35577ec4246ce26c8c46297b9d2651b92f301d6e5-1", - "file": "ui/src/components/core/error/error-options.ts", + "file": "ui/src/components/core/common-behaviors/error-options.ts", "properties": [], "methods": [ { @@ -19219,9 +19219,9 @@ }, { "name": "OuiSelectTrigger", - "id": "directive-OuiSelectTrigger-d85db46eab36d315c1fdcd891bdac570b57a0ccdc711e79255f204f23073d94dc6b0707254460df0585b83b8338fb5a5a8a9bcb9d49bc6bf529c53c663cbdac2", + "id": "component-OuiSelect-d85db46eab36d315c1fdcd891bdac570b57a0ccdc711e79255f204f23073d94dc6b0707254460df0585b83b8338fb5a5a8a9bcb9d49bc6bf529c53c663cbdac2", "file": "ui/src/components/select/select.component.ts", - "type": "directive", + "type": "component", "description": "
Allows the user to customize the trigger that is displayed when the select has a value.
\n", "rawdescription": "\n\nAllows the user to customize the trigger that is displayed when the select has a value.\n", "sourceCode": "import { ActiveDescendantKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { SelectionModel } from '@angular/cdk/collections';\nimport {\n A,\n DOWN_ARROW,\n END,\n ENTER,\n HOME,\n LEFT_ARROW,\n RIGHT_ARROW,\n SPACE,\n UP_ARROW,\n hasModifierKey,\n TAB,\n} from '@angular/cdk/keycodes';\nimport { CdkConnectedOverlay } from '@angular/cdk/overlay';\nimport {\n AfterContentInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n DoCheck,\n ElementRef,\n EventEmitter,\n Input,\n isDevMode,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n Inject,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormGroupDirective,\n NgControl,\n NgForm,\n} from '@angular/forms';\nimport {\n _countGroupLabelsBeforeOption,\n _getOptionScrollPosition,\n CanDisable,\n CanDisableCtor,\n CanUpdateErrorState,\n CanUpdateErrorStateCtor,\n HasTabIndex,\n HasTabIndexCtor,\n OuiOptionSelectionChange,\n mixinErrorState,\n mixinTabIndex,\n mixinDisabled,\n} from '../core';\nimport { OuiFormField, OuiFormFieldControl } from '../form-field/public-api';\nimport { DOCUMENT } from '@angular/common';\nimport { OUI_OPTION_PARENT_COMPONENT, OuiOption } from '../core/option/option';\nimport { OuiOptgroup } from '../core/option/optgroup';\nimport { ErrorStateMatcher } from '../core/error/error-options';\nimport { defer, merge, Observable, Subject } from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n startWith,\n switchMap,\n take,\n takeUntil,\n} from 'rxjs/operators';\nimport {\n getOuiSelectDynamicMultipleError,\n getOuiSelectNonArrayValueError,\n getOuiSelectNonFunctionValueError,\n} from './select-errors';\nimport { OuiIconRegistry } from '../icon/icon-registery';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { ICONS } from '../core/shared/icons';\n\nlet nextUniqueId = 0;\n\n/**\n * The following style constants are necessary to save here in order\n * to properly calculate the alignment of the selected option over\n * the trigger element.\n */\n\n/** The height of each select option. */\nexport const SELECT_OPTION_HEIGHT = 40;\n\n/** The panel's padding on the x-axis */\nexport const SELECT_PANEL_PADDING_X = 16;\n\n/** The panel's x axis padding if it is indented (e.g. there is an option group). */\nexport const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;\n\n/** The height of the select items in `em` units. */\nexport const SELECT_ITEM_HEIGHT_EM = 3;\n\n/** The total height of the select panel. */\nexport const SELECT_PANEL_HEIGHT = 200;\n\n// TODO(josephperrott): Revert to a constant after 2018 spec updates are fully merged.\n/**\n * Distance between the panel edge and the option text in\n * multi-selection mode.\n *\n * Calculated as:\n * (SELECT_PANEL_PADDING_X * 1.5) + 20 = 44\n * The padding is multiplied by 1.5 because the checkbox's margin is half the padding.\n * The checkbox width is 16px.\n */\nexport let SELECT_MULTIPLE_PANEL_PADDING_X = 0;\n\n/**\n * The select panel will only \"fit\" inside the viewport if it is positioned at\n * this value or more away from the viewport boundary.\n */\nexport const SELECT_PANEL_VIEWPORT_PADDING = 8;\n\n/** Change event object that is emitted when the select value has changed. */\nexport class OuiSelectChange {\n constructor(\n /** Reference to the select that emitted the change event. */\n public source: OuiSelect,\n /** Current value of the select that emitted the event. */\n public value: any\n ) {}\n}\n\n// Boilerplate for applying mixins to OuiSelect.\n/** @docs-private */\nexport class OuiSelectBase {\n constructor(\n public _elementRef: ElementRef,\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n public ngControl: NgControl\n ) {}\n}\n\nexport const _OuiSelectMixinBase: CanDisableCtor &\n HasTabIndexCtor &\n CanUpdateErrorStateCtor &\n typeof OuiSelectBase = mixinTabIndex(\n mixinDisabled(mixinErrorState(OuiSelectBase))\n);\n\n/**\n * Allows the user to customize the trigger that is displayed when the select has a value.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'oui-select-trigger',\n})\nexport class OuiSelectTrigger {}\n\n@Component({\n selector: 'oui-select',\n exportAs: 'ouiSelect',\n templateUrl: 'select.html',\n styleUrls: ['select.scss'],\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['disabled', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n role: 'listbox',\n '[attr.id]': 'id',\n '[attr.tabindex]': 'tabIndex',\n '[attr.aria-label]': '_getAriaLabel()',\n '[attr.aria-labelledby]': '_getAriaLabelledby()',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-invalid]': 'errorState',\n '[attr.aria-owns]': 'panelOpen ? _optionIds : null',\n '[attr.aria-multiselectable]': 'multiple',\n '[attr.aria-describedby]': '_ariaDescribedby || null',\n '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',\n '[class.oui-select-disabled]': 'disabled',\n '[class.oui-select-invalid]': 'errorState',\n '[class.oui-select-required]': 'required',\n '[class.oui-select-empty]': 'empty',\n class: 'oui-select oui-input',\n '(keydown)': '_handleKeydown($event)',\n '(focus)': '_onFocus()',\n '(blur)': '_onBlur()',\n },\n providers: [\n { provide: OuiFormFieldControl, useExisting: OuiSelect },\n { provide: OUI_OPTION_PARENT_COMPONENT, useExisting: OuiSelect },\n ],\n})\nexport class OuiSelect\n extends _OuiSelectMixinBase\n implements\n AfterContentInit,\n OnChanges,\n OnDestroy,\n OnInit,\n DoCheck,\n ControlValueAccessor,\n CanDisable,\n HasTabIndex,\n OuiFormFieldControl