@ni/nimble-components 24.1.6 → 24.1.8
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/dist/all-components-bundle.js +501 -61
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +7375 -7353
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +172 -20
- package/dist/esm/combobox/index.js +453 -44
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/combobox/models/combobox-form-associated.d.ts +16 -0
- package/dist/esm/combobox/models/combobox-form-associated.js +19 -0
- package/dist/esm/combobox/models/combobox-form-associated.js.map +1 -0
- package/dist/esm/src/combobox/index.d.ts +172 -20
- package/dist/esm/src/combobox/models/combobox-form-associated.d.ts +16 -0
- package/dist/esm/src/table-column/date-text/index.d.ts +25 -1
- package/dist/esm/src/table-column/duration-text/index.d.ts +26 -2
- package/dist/esm/src/table-column/number-text/index.d.ts +25 -1
- package/dist/esm/src/table-column/text/index.d.ts +25 -1
- package/dist/esm/src/table-column/text-base/index.d.ts +10 -9
- package/dist/esm/table-column/date-text/index.d.ts +25 -1
- package/dist/esm/table-column/date-text/index.js +2 -2
- package/dist/esm/table-column/date-text/index.js.map +1 -1
- package/dist/esm/table-column/duration-text/index.d.ts +26 -2
- package/dist/esm/table-column/duration-text/index.js +2 -2
- package/dist/esm/table-column/duration-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +25 -1
- package/dist/esm/table-column/number-text/index.js +2 -2
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/text/index.d.ts +25 -1
- package/dist/esm/table-column/text/index.js +2 -2
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/table-column/text-base/index.d.ts +10 -9
- package/dist/esm/table-column/text-base/index.js +6 -2
- package/dist/esm/table-column/text-base/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{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,CAAC,CAAC,CAAC,IAAI;6BACV,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;0BAElB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAK,CAAC;2BAC5C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC;4BAC7C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,KAAsB,CAAC;;;;iCAI3D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;;mBAGzB,wBAAwB;;;;oBAIvB,wBAAwB;gBAC5B,eAAe;;UAErB,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import { attr, html, observable, ref } from '@microsoft/fast-element';\nimport {\n DesignSystem,\n Combobox as FoundationCombobox,\n ComboboxOptions\n} from '@microsoft/fast-foundation';\nimport {\n keyArrowDown,\n keyArrowUp,\n keyEnter,\n keySpace\n} from '@microsoft/fast-web-utilities';\nimport { ToggleButton, toggleButtonTag } from '../toggle-button';\nimport { errorTextTemplate } from '../patterns/error/template';\nimport { iconArrowExpanderDownTag } from '../icons/arrow-expander-down';\nimport { iconExclamationMarkTag } from '../icons/exclamation-mark';\n\nimport { styles } from './styles';\nimport type { ErrorPattern } from '../patterns/error/types';\nimport type { DropdownPattern } from '../patterns/dropdown/types';\nimport { DropdownAppearance } from '../patterns/dropdown/types';\nimport type { AnchoredRegion } from '../anchored-region';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-combobox': Combobox;\n }\n}\n\n/**\n * A nimble-styed HTML combobox\n */\nexport class Combobox\n extends FoundationCombobox\n implements DropdownPattern, ErrorPattern {\n @attr\n public appearance: DropdownAppearance = DropdownAppearance.underline;\n\n /**\n * The ref to the internal dropdown button element.\n *\n * @internal\n */\n @observable\n public readonly dropdownButton?: ToggleButton;\n\n /**\n * A message explaining why the value is invalid.\n *\n * @public\n * @remarks\n * HTML Attribute: error-text\n */\n @attr({ attribute: 'error-text' })\n public errorText?: string;\n\n @attr({ attribute: 'error-visible', mode: 'boolean' })\n public errorVisible = false;\n\n /**\n * @internal\n */\n @observable\n public region?: AnchoredRegion;\n\n /**\n * @internal\n */\n @observable\n public controlWrapper?: HTMLElement;\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n public override get value(): string {\n return super.value;\n }\n\n // This override is to work around an issue in FAST where an old filter value\n // is used after programmatically setting the value property.\n // See: https://github.com/microsoft/fast/issues/6749\n public override set value(next: string) {\n super.value = next;\n // Workaround using index notation to manipulate private member\n // Can remove when following resolved: https://github.com/microsoft/fast/issues/6749\n // eslint-disable-next-line @typescript-eslint/dot-notation\n this['filter'] = next;\n this.filterOptions();\n this.selectedIndex = this.options\n .map(option => option.text)\n .indexOf(this.value);\n }\n\n private valueUpdatedByInput = false;\n private valueBeforeTextUpdate?: string;\n\n // Workaround for https://github.com/microsoft/fast/issues/5123\n public override setPositioning(): void {\n if (!this.$fastController.isConnected) {\n // Don't call setPositioning() until we're connected,\n // since this.forcedPosition isn't initialized yet.\n return;\n }\n super.setPositioning();\n }\n\n // Workaround for https://github.com/microsoft/fast/issues/5773\n public override slottedOptionsChanged(\n prev: HTMLElement[],\n next: HTMLElement[]\n ): void {\n const value = this.value;\n super.slottedOptionsChanged(prev, next);\n if (value) {\n this.value = value;\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n // Call setPositioning() after this.forcedPosition is initialized.\n this.setPositioning();\n this.updateInputAriaLabel();\n }\n\n public toggleButtonClickHandler(e: Event): void {\n e.stopImmediatePropagation();\n }\n\n public toggleButtonChangeHandler(e: Event): void {\n this.open = this.dropdownButton!.checked;\n e.stopImmediatePropagation();\n }\n\n public toggleButtonKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyArrowUp:\n case keyArrowDown:\n case keySpace:\n case keyEnter:\n this.open = true;\n this.stopPropagation(e);\n return false;\n default:\n return true;\n }\n }\n\n public override filterOptions(): void {\n super.filterOptions();\n const enabledOptions = this.filteredOptions.filter(o => !o.disabled);\n this.filteredOptions = enabledOptions;\n }\n\n /**\n * This is a workaround for the issue described here: https://github.com/microsoft/fast/issues/6267\n * For now, we will update the value ourselves while a user types in text. Note that there is other\n * implementation related to this (like the 'keydownEventHandler') needed to create the complete set\n * of desired behavior described in the issue noted above.\n */\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n public override inputHandler(e: InputEvent): boolean | void {\n const returnValue = super.inputHandler(e);\n if (!this.valueUpdatedByInput) {\n this.valueBeforeTextUpdate = this.value;\n }\n this.valueUpdatedByInput = true;\n // This is a workaround for this FAST issue: https://github.com/microsoft/fast/issues/6776\n if (this.value !== this.control.value) {\n this.focusAndScrollOptionIntoView();\n }\n\n this.value = this.control.value;\n return returnValue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n public override keydownHandler(e: KeyboardEvent): boolean | void {\n const returnValue = super.keydownHandler(e);\n if (e.ctrlKey || e.altKey) {\n return returnValue;\n }\n\n switch (e.key) {\n case keyEnter:\n this.emitChangeIfValueUpdated();\n break;\n case keyArrowDown:\n case keyArrowUp:\n if (this.open && this.valueUpdatedByInput) {\n this.valueUpdatedByInput = false;\n }\n break;\n default:\n return returnValue;\n }\n return returnValue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n public override focusoutHandler(e: FocusEvent): boolean | void {\n const returnValue = super.focusoutHandler(e);\n this.open = false;\n this.emitChangeIfValueUpdated();\n return returnValue;\n }\n\n protected override focusAndScrollOptionIntoView(): void {\n if (this.open) {\n super.focusAndScrollOptionIntoView();\n }\n }\n\n protected override openChanged(): void {\n super.openChanged();\n if (this.dropdownButton) {\n this.dropdownButton.checked = this.open;\n }\n }\n\n private regionChanged(\n _prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (this.region && this.controlWrapper) {\n this.region.anchorElement = this.controlWrapper;\n }\n }\n\n private controlWrapperChanged(\n _prev: HTMLElement | undefined,\n _next: HTMLElement | undefined\n ): void {\n if (this.region && this.controlWrapper) {\n this.region.anchorElement = this.controlWrapper;\n }\n }\n\n // Workaround for https://github.com/microsoft/fast/issues/6041.\n private ariaLabelChanged(_oldValue: string, _newValue: string): void {\n this.updateInputAriaLabel();\n }\n\n private maxHeightChanged(): void {\n this.updateListboxMaxHeightCssVariable();\n }\n\n private updateListboxMaxHeightCssVariable(): void {\n if (this.listbox) {\n this.listbox.style.setProperty(\n '--ni-private-select-max-height',\n `${this.maxHeight}px`\n );\n }\n }\n\n private updateInputAriaLabel(): void {\n const inputElement = this.shadowRoot?.querySelector('.selected-value');\n if (this.ariaLabel) {\n inputElement?.setAttribute('aria-label', this.ariaLabel);\n } else {\n inputElement?.removeAttribute('aria-label');\n }\n }\n\n /**\n * This will only emit a `change` event after text entry where the text in the input prior to\n * typing is different than the text present upon an attempt to commit (e.g. pressing <Enter>).\n * So, for a concrete example:\n * 1) User types 'Sue' (when Combobox input was blank).\n * 2) User presses <Enter> -> 'change' event fires\n * 3) User deletes 'Sue'\n * 4) User re-types 'Sue'\n * 5) User presses <Enter> -> NO 'change' event is fired\n */\n private emitChangeIfValueUpdated(): void {\n if (this.valueUpdatedByInput) {\n if (this.value !== this.valueBeforeTextUpdate) {\n this.$emit('change');\n }\n\n this.valueUpdatedByInput = false;\n }\n }\n}\n\nconst nimbleCombobox = Combobox.compose<ComboboxOptions>({\n baseName: 'combobox',\n baseClass: FoundationCombobox,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n },\n end: html<Combobox>`\n <div class=\"end-slot-container\">\n <${iconExclamationMarkTag}\n severity=\"error\"\n class=\"error-icon\"\n ></${iconExclamationMarkTag}>\n <div class=\"separator\"></div>\n <${toggleButtonTag}\n ${ref('dropdownButton')}\n appearance=\"ghost\"\n ?checked=\"${x => x.open}\"\n ?disabled=\"${x => x.disabled}\"\n content-hidden=\"true\"\n @click=\"${(x, c) => x.toggleButtonClickHandler(c.event)}\"\n @change=\"${(x, c) => x.toggleButtonChangeHandler(c.event)}\"\n @keydown=\"${(x, c) => x.toggleButtonKeyDownHandler(c.event as KeyboardEvent)}\"\n class=\"dropdown-button\"\n part=\"button\"\n aria-haspopup=\"true\"\n aria-expanded=\"${x => x.open}\"\n tabindex=\"-1\"\n >\n <${iconArrowExpanderDownTag}\n slot=\"start\"\n class=\"dropdown-icon\"\n >\n </${iconArrowExpanderDownTag}>\n </${toggleButtonTag}>\n </div>\n ${errorTextTemplate}\n `\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCombobox());\nexport const comboboxTag = 'nimble-combobox';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,GAAG,EACH,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,GAAG,EACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,YAAY,EAEZ,oBAAoB,EACpB,cAAc,EAEd,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAgB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,s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C;;4BAEX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;6BACV,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;0BAElB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAK,CAAC;2BAC5C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC;4BAC7C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,KAAsB,CAAC;;;;iCAI3D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;;mBAGzB,wBAAwB;;;;oBAIvB,wBAAwB;gBAC5B,eAAe;;UAErB,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAGH,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAEvD,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import {\n DOM,\n Observable,\n attr,\n html,\n observable,\n ref\n} from '@microsoft/fast-element';\nimport {\n DesignSystem,\n ComboboxOptions,\n ComboboxAutocomplete,\n SelectPosition,\n ListboxOption,\n DelegatesARIACombobox,\n applyMixins,\n StartEnd\n} from '@microsoft/fast-foundation';\nimport {\n keyArrowDown,\n keyArrowUp,\n keyEnter,\n keyEscape,\n keySpace,\n keyTab,\n limit,\n uniqueId\n} from '@microsoft/fast-web-utilities';\nimport { ToggleButton, toggleButtonTag } from '../toggle-button';\nimport { errorTextTemplate } from '../patterns/error/template';\nimport { iconArrowExpanderDownTag } from '../icons/arrow-expander-down';\nimport { iconExclamationMarkTag } from '../icons/exclamation-mark';\n\nimport { styles } from './styles';\nimport type { ErrorPattern } from '../patterns/error/types';\nimport type { DropdownPattern } from '../patterns/dropdown/types';\nimport { DropdownAppearance } from '../patterns/dropdown/types';\nimport type { AnchoredRegion } from '../anchored-region';\nimport { template } from './template';\nimport { FormAssociatedCombobox } from './models/combobox-form-associated';\nimport type { ListOption } from '../list-option';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-combobox': Combobox;\n }\n}\n\n/**\n * A nimble-styed HTML combobox\n */\nexport class Combobox\n extends FormAssociatedCombobox\n implements DropdownPattern, ErrorPattern {\n @attr\n public appearance: DropdownAppearance = DropdownAppearance.underline;\n\n /**\n * A message explaining why the value is invalid.\n */\n @attr({ attribute: 'error-text' })\n public errorText?: string;\n\n @attr({ attribute: 'error-visible', mode: 'boolean' })\n public errorVisible = false;\n\n /**\n * The autocomplete attribute.\n */\n @attr({ attribute: 'autocomplete', mode: 'fromView' })\n public autocomplete?: ComboboxAutocomplete;\n\n /**\n * The placement for the listbox when the combobox is open.\n */\n @attr({ attribute: 'position' })\n public positionAttribute?: SelectPosition;\n\n /**\n * The open attribute.\n */\n @attr({ attribute: 'open', mode: 'boolean' })\n public open = false;\n\n /**\n * Sets the placeholder value of the element, generally used to provide a hint to the user.\n * @remarks Using a non-null assertion to mimic FAST's original improper typing of an\n * uninitialized property:\n * https://github.com/microsoft/fast/blob/0c27d027ff6e8616ad4fddc17f4432aa7f6cbad0/packages/web-components/fast-foundation/src/combobox/combobox.ts#L199\n */\n @attr\n public placeholder!: string;\n\n /**\n * The current state of the calculated position of the listbox.\n *\n * @public\n */\n @observable\n public position?: SelectPosition;\n\n /**\n * @internal\n */\n @observable\n public region?: AnchoredRegion;\n\n /**\n * @internal\n */\n @observable\n public controlWrapper!: HTMLElement;\n\n /**\n * @internal\n */\n @observable\n public control!: HTMLInputElement;\n\n /**\n * @internal\n */\n @observable\n public listbox!: HTMLDivElement;\n\n /**\n * @internal\n */\n @observable\n public readonly dropdownButton?: ToggleButton;\n\n /**\n * The collection of currently filtered options.\n */\n public filteredOptions: ListboxOption[] = [];\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n public override get value(): string {\n Observable.track(this, 'value');\n return this._value;\n }\n\n public override set value(next: string) {\n const prev = `${this._value}`;\n let updatedValue = next;\n\n if (this.$fastController.isConnected && this.options) {\n const selectedIndex = this.options.findIndex(\n el => el.text.toLowerCase() === next.toLowerCase()\n );\n\n const prevSelectedValue = this.options[this.selectedIndex]?.text;\n const nextSelectedValue = this.options[selectedIndex]?.text;\n\n this.selectedIndex = prevSelectedValue !== nextSelectedValue\n ? selectedIndex\n : this.selectedIndex;\n\n updatedValue = this.firstSelectedOption?.text || next;\n }\n\n if (prev !== updatedValue) {\n this._value = updatedValue;\n super.valueChanged(prev, updatedValue);\n Observable.notify(this, 'value');\n }\n\n // Can remove when following resolved: https://github.com/microsoft/fast/issues/6749\n this.filter = next;\n this.filterOptions();\n this.selectedIndex = this.options\n .map(option => option.text)\n .indexOf(this.value);\n }\n\n /**\n * The list of options.\n *\n * Overrides `Listbox.options`.\n */\n public override get options(): ListboxOption[] {\n Observable.track(this, 'options');\n return this.filteredOptions?.length\n ? this.filteredOptions\n : this._options;\n }\n\n public override set options(value: ListboxOption[]) {\n this._options = value;\n Observable.notify(this, 'options');\n }\n\n /**\n * The unique id for the internal listbox element.\n *\n * @internal\n */\n public listboxId: string = uniqueId('listbox-');\n\n /**\n * The max height for the listbox when opened.\n *\n * @internal\n */\n @observable\n public maxHeight = 0;\n\n private valueUpdatedByInput = false;\n private valueBeforeTextUpdate?: string;\n private _value = '';\n private filter = '';\n\n /**\n * The initial state of the position attribute.\n */\n private forcedPosition = false;\n\n private get isAutocompleteInline(): boolean {\n return (\n this.autocomplete === ComboboxAutocomplete.inline\n || this.isAutocompleteBoth\n );\n }\n\n private get isAutocompleteList(): boolean {\n return (\n this.autocomplete === ComboboxAutocomplete.list\n || this.isAutocompleteBoth\n );\n }\n\n private get isAutocompleteBoth(): boolean {\n return this.autocomplete === ComboboxAutocomplete.both;\n }\n\n public override slottedOptionsChanged(\n prev: HTMLElement[],\n next: HTMLElement[]\n ): void {\n // Workaround for https://github.com/microsoft/fast/issues/5773\n const value = this.value;\n super.slottedOptionsChanged(prev, next);\n this.updateValue();\n if (value) {\n this.value = value;\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.forcedPosition = !!this.positionAttribute;\n if (this.value) {\n this.initialValue = this.value;\n }\n this.setPositioning();\n this.updateInputAriaLabel();\n }\n\n /**\n * @internal\n */\n public override clickHandler(e: MouseEvent): boolean {\n if (this.disabled) {\n return false;\n }\n\n if (this.open) {\n const captured = (e.target as HTMLElement).closest<ListOption>(\n 'option,[role=option]'\n );\n\n if (!captured || captured.disabled) {\n return false;\n }\n\n this.selectedOptions = [captured];\n this.control.value = captured.text;\n this.clearSelectionRange();\n this.updateValue(true);\n }\n\n this.open = !this.open;\n\n if (this.open) {\n this.control.focus();\n }\n\n return true;\n }\n\n /**\n * @internal\n */\n public toggleButtonClickHandler(e: Event): void {\n e.stopImmediatePropagation();\n }\n\n /**\n * @internal\n */\n public toggleButtonChangeHandler(e: Event): void {\n this.open = this.dropdownButton!.checked;\n e.stopImmediatePropagation();\n }\n\n /**\n * @internal\n */\n public toggleButtonKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyArrowUp:\n case keyArrowDown:\n case keySpace:\n case keyEnter:\n this.open = true;\n this.stopPropagation(e);\n return false;\n default:\n return true;\n }\n }\n\n /**\n * @internal\n */\n public filterOptions(): void {\n if (\n !this.autocomplete\n || this.autocomplete === ComboboxAutocomplete.none\n ) {\n this.filter = '';\n }\n\n const filter = this.filter.toLowerCase();\n\n this.filteredOptions = this._options.filter(o => o.text.toLowerCase().startsWith(filter));\n\n if (this.isAutocompleteList) {\n if (!this.filteredOptions.length && !filter) {\n this.filteredOptions = this._options;\n }\n\n this._options.forEach(o => {\n (o as ListOption).visuallyHidden = !this.filteredOptions.includes(o);\n });\n }\n\n const enabledOptions = this.filteredOptions.filter(o => !o.disabled);\n this.filteredOptions = enabledOptions;\n }\n\n /**\n * @internal\n */\n public inputHandler(e: InputEvent): boolean {\n this.filter = this.control.value;\n this.filterOptions();\n\n if (!this.isAutocompleteInline) {\n this.selectedIndex = this.options\n .map(option => option.text)\n .indexOf(this.control.value);\n }\n\n if (!(e.inputType.includes('deleteContent') || !this.filter.length)) {\n if (this.isAutocompleteList && !this.open) {\n this.open = true;\n }\n\n if (this.isAutocompleteInline) {\n if (this.filteredOptions.length) {\n this.selectedOptions = [this.filteredOptions[0]!];\n this.selectedIndex = this.options.indexOf(\n this.firstSelectedOption\n );\n this.setInlineSelection();\n } else {\n this.selectedIndex = -1;\n }\n }\n }\n\n // This is a workaround for the issue described here: https://github.com/microsoft/fast/issues/6267\n // For now, we will update the value ourselves while a user types in text. Note that there is other\n // implementation related to this (like the 'keydownEventHandler') needed to create the complete set\n // of desired behavior described in the issue noted above.\n if (!this.valueUpdatedByInput) {\n this.valueBeforeTextUpdate = this.value;\n }\n this.valueUpdatedByInput = true;\n\n // This is a workaround for this FAST issue: https://github.com/microsoft/fast/issues/6776\n if (this.value !== this.control.value) {\n this.focusAndScrollOptionIntoView();\n }\n\n this.value = this.control.value;\n return true;\n }\n\n public override keydownHandler(e: KeyboardEvent): boolean {\n if (e.ctrlKey || e.altKey) {\n return true;\n }\n\n switch (e.key) {\n case keyEnter:\n this.syncValue();\n if (this.isAutocompleteInline) {\n this.filter = this.value;\n }\n\n this.open = false;\n this.clearSelectionRange();\n this.emitChangeIfValueUpdated();\n break;\n case keyEscape:\n if (!this.isAutocompleteInline) {\n this.selectedIndex = -1;\n }\n\n if (this.open) {\n this.open = false;\n break;\n }\n\n this.value = '';\n this.control.value = '';\n this.filter = '';\n this.filterOptions();\n break;\n case keyTab:\n this.setInputToSelection();\n\n if (!this.open) {\n return true;\n }\n\n e.preventDefault();\n this.open = false;\n break;\n case keyArrowDown:\n case keyArrowUp:\n this.filterOptions();\n\n if (!this.open) {\n this.open = true;\n break;\n }\n\n if (this.filteredOptions.length > 0) {\n super.keydownHandler(e);\n }\n\n if (this.isAutocompleteInline) {\n this.setInlineSelection();\n }\n\n if (this.open && this.valueUpdatedByInput) {\n this.valueUpdatedByInput = false;\n }\n break;\n default:\n return true;\n }\n return true;\n }\n\n /**\n * @internal\n */\n public keyupHandler(e: KeyboardEvent): boolean {\n const key = e.key;\n\n switch (key) {\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Backspace':\n case 'Delete':\n case 'Home':\n case 'End': {\n this.filter = this.control.value;\n this.selectedIndex = -1;\n this.filterOptions();\n break;\n }\n default: {\n break;\n }\n }\n\n return true;\n }\n\n /**\n * @internal\n */\n public override focusoutHandler(e: FocusEvent): boolean {\n this.syncValue();\n\n if (this.open) {\n const focusTarget = e.relatedTarget as HTMLElement;\n if (this.isSameNode(focusTarget)) {\n this.focus();\n }\n }\n\n this.open = false;\n this.emitChangeIfValueUpdated();\n return true;\n }\n\n /**\n * Reset the element to its first selectable option when its parent form is reset.\n *\n * @internal\n */\n public override formResetCallback(): void {\n super.formResetCallback();\n this.setDefaultSelectedOption();\n this.updateValue();\n }\n\n /** {@inheritDoc (FormAssociated:interface).validate} */\n public override validate(): void {\n super.validate(this.control);\n }\n\n /**\n * Set the default selected options at initialization or reset.\n *\n * @internal\n * @remarks\n * Overrides `Listbox.setDefaultSelectedOption`\n */\n public override setDefaultSelectedOption(): void {\n if (this.$fastController.isConnected && this.options) {\n const selectedIndex = this.options.findIndex(\n el => el.getAttribute('selected') !== null || el.selected\n );\n\n this.selectedIndex = selectedIndex;\n if (!this.dirtyValue && this.firstSelectedOption) {\n this.value = this.firstSelectedOption.text;\n }\n this.setSelectedOptions();\n }\n }\n\n /**\n * @internal\n */\n public override selectedIndexChanged(\n prev: number | undefined,\n next: number\n ): void {\n if (this.$fastController.isConnected) {\n const pinnedSelectedIndex = limit(\n -1,\n this.options.length - 1,\n next\n );\n\n // we only want to call the super method when the selectedIndex is in range\n if (pinnedSelectedIndex !== this.selectedIndex) {\n this.selectedIndex = pinnedSelectedIndex;\n return;\n }\n\n super.selectedIndexChanged(prev, pinnedSelectedIndex);\n }\n }\n\n /**\n * Synchronize the `aria-disabled` property when the `disabled` property changes.\n *\n * @internal\n */\n public override disabledChanged(prev: boolean, next: boolean): void {\n if (super.disabledChanged) {\n super.disabledChanged(prev, next);\n }\n this.ariaDisabled = this.disabled ? 'true' : 'false';\n }\n\n /**\n * Move focus to the previous selectable option.\n *\n * @internal\n * @remarks\n * Overrides `Listbox.selectPreviousOption`\n */\n public override selectPreviousOption(): void {\n if (!this.disabled && this.selectedIndex >= 0) {\n this.selectedIndex -= 1;\n }\n }\n\n /**\n * @internal\n */\n public setPositioning(): void {\n // Workaround for https://github.com/microsoft/fast/issues/5123\n if (!this.$fastController.isConnected) {\n // Don't call setPositioning() until we're connected,\n // since this.forcedPosition isn't initialized yet.\n return;\n }\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n\n if (this.forcedPosition) {\n this.position = this.positionAttribute;\n } else if (currentBox.top > availableBottom) {\n this.position = SelectPosition.above;\n } else {\n this.position = SelectPosition.below;\n }\n\n this.positionAttribute = this.forcedPosition\n ? this.positionAttribute\n : this.position;\n\n this.maxHeight = this.position === SelectPosition.above\n ? Math.trunc(currentBox.top)\n : Math.trunc(availableBottom);\n }\n\n /**\n * Focus the control and scroll the first selected option into view.\n *\n * @internal\n * @remarks\n * Overrides: `Listbox.focusAndScrollOptionIntoView`\n */\n protected override focusAndScrollOptionIntoView(): void {\n if (this.open) {\n if (this.contains(document.activeElement)) {\n this.control.focus();\n if (this.firstSelectedOption) {\n requestAnimationFrame(() => {\n this.firstSelectedOption?.scrollIntoView({\n block: 'nearest'\n });\n });\n }\n }\n }\n }\n\n protected openChanged(): void {\n if (this.open) {\n this.ariaControls = this.listboxId;\n this.ariaExpanded = 'true';\n\n this.setPositioning();\n this.focusAndScrollOptionIntoView();\n\n // focus is directed to the element when `open` is changed programmatically\n DOM.queueUpdate(() => this.focus());\n } else {\n this.ariaControls = '';\n this.ariaExpanded = 'false';\n }\n\n if (this.dropdownButton) {\n this.dropdownButton.checked = this.open;\n }\n }\n\n protected placeholderChanged(): void {\n if (this.proxy instanceof HTMLInputElement) {\n this.proxy.placeholder = this.placeholder ?? '';\n }\n }\n\n /**\n * Ensure that the entire list of options is used when setting the selected property.\n * @internal\n * @remarks\n * Overrides: `Listbox.selectedOptionsChanged`\n */\n protected override selectedOptionsChanged(\n _: ListboxOption[] | undefined,\n next: ListboxOption[]\n ): void {\n if (this.$fastController.isConnected) {\n this._options.forEach(o => {\n o.selected = next.includes(o);\n });\n }\n }\n\n protected positionChanged(\n _: SelectPosition | undefined,\n next: SelectPosition | undefined\n ): void {\n this.positionAttribute = next;\n this.setPositioning();\n }\n\n private regionChanged(\n _prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (this.region && this.controlWrapper) {\n this.region.anchorElement = this.controlWrapper;\n }\n }\n\n private controlWrapperChanged(\n _prev: HTMLElement | undefined,\n _next: HTMLElement | undefined\n ): void {\n if (this.region && this.controlWrapper) {\n this.region.anchorElement = this.controlWrapper;\n }\n }\n\n // Workaround for https://github.com/microsoft/fast/issues/6041.\n private ariaLabelChanged(_oldValue: string, _newValue: string): void {\n this.updateInputAriaLabel();\n }\n\n private maxHeightChanged(): void {\n this.updateListboxMaxHeightCssVariable();\n }\n\n /**\n * Sets the value and to match the first selected option.\n */\n private updateValue(shouldEmit?: boolean): void {\n if (this.$fastController.isConnected) {\n this.value = this.firstSelectedOption?.text || this.control.value;\n this.control.value = this.value;\n }\n\n if (shouldEmit) {\n this.$emit('change');\n }\n }\n\n /**\n * Focus and set the content of the control based on the first selected option.\n */\n private setInputToSelection(): void {\n if (this.firstSelectedOption) {\n this.control.value = this.firstSelectedOption.text;\n this.control.focus();\n }\n }\n\n /**\n * Focus, set and select the content of the control based on the first selected option.\n */\n private setInlineSelection(): void {\n if (this.firstSelectedOption) {\n this.setInputToSelection();\n this.control.setSelectionRange(\n this.filter.length,\n this.control.value.length,\n 'backward'\n );\n }\n }\n\n private clearSelectionRange(): void {\n const controlValueLength = this.control.value.length;\n this.control.setSelectionRange(controlValueLength, controlValueLength);\n }\n\n /**\n * Determines if a value update should involve emitting a change event, then updates the value.\n */\n private syncValue(): void {\n const newValue = this.selectedIndex > -1\n ? this.firstSelectedOption?.text\n : this.control.value;\n this.updateValue(this.value !== newValue);\n }\n\n private updateListboxMaxHeightCssVariable(): void {\n if (this.listbox) {\n this.listbox.style.setProperty(\n '--ni-private-select-max-height',\n `${this.maxHeight}px`\n );\n }\n }\n\n private updateInputAriaLabel(): void {\n const inputElement = this.shadowRoot?.querySelector('.selected-value');\n if (this.ariaLabel) {\n inputElement?.setAttribute('aria-label', this.ariaLabel);\n } else {\n inputElement?.removeAttribute('aria-label');\n }\n }\n\n /**\n * This will only emit a `change` event after text entry where the text in the input prior to\n * typing is different than the text present upon an attempt to commit (e.g. pressing <Enter>).\n * So, for a concrete example:\n * 1) User types 'Sue' (when Combobox input was blank).\n * 2) User presses <Enter> -> 'change' event fires\n * 3) User deletes 'Sue'\n * 4) User re-types 'Sue'\n * 5) User presses <Enter> -> NO 'change' event is fired\n */\n private emitChangeIfValueUpdated(): void {\n if (this.valueUpdatedByInput) {\n if (this.value !== this.valueBeforeTextUpdate) {\n this.$emit('change');\n }\n\n this.valueUpdatedByInput = false;\n }\n }\n}\n\nconst nimbleCombobox = Combobox.compose<ComboboxOptions>({\n baseName: 'combobox',\n baseClass: FormAssociatedCombobox,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n },\n end: html<Combobox>`\n <div class=\"end-slot-container\">\n <${iconExclamationMarkTag}\n severity=\"error\"\n class=\"error-icon\"\n ></${iconExclamationMarkTag}>\n <div class=\"separator\"></div>\n <${toggleButtonTag}\n ${ref('dropdownButton')}\n appearance=\"ghost\"\n ?checked=\"${x => x.open}\"\n ?disabled=\"${x => x.disabled}\"\n content-hidden=\"true\"\n @click=\"${(x, c) => x.toggleButtonClickHandler(c.event)}\"\n @change=\"${(x, c) => x.toggleButtonChangeHandler(c.event)}\"\n @keydown=\"${(x, c) => x.toggleButtonKeyDownHandler(c.event as KeyboardEvent)}\"\n class=\"dropdown-button\"\n part=\"button\"\n aria-haspopup=\"true\"\n aria-expanded=\"${x => x.open}\"\n tabindex=\"-1\"\n >\n <${iconArrowExpanderDownTag}\n slot=\"start\"\n class=\"dropdown-icon\"\n >\n </${iconArrowExpanderDownTag}>\n </${toggleButtonTag}>\n </div>\n ${errorTextTemplate}\n `\n});\n\nexport interface Combobox extends StartEnd, DelegatesARIACombobox {}\napplyMixins(Combobox, StartEnd, DelegatesARIACombobox);\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCombobox());\nexport const comboboxTag = 'nimble-combobox';\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormAssociated, ListboxElement } from '@microsoft/fast-foundation';
|
|
2
|
+
declare class Combobox extends ListboxElement {
|
|
3
|
+
}
|
|
4
|
+
interface Combobox extends FormAssociated {
|
|
5
|
+
}
|
|
6
|
+
declare const FormAssociatedCombobox_base: typeof Combobox;
|
|
7
|
+
/**
|
|
8
|
+
* A form-associated base class for the Combobox component. This was copied from the
|
|
9
|
+
* FAST FormAssociatedCombobox (which is not exported by fast-foundation)
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormAssociatedCombobox extends FormAssociatedCombobox_base {
|
|
14
|
+
proxy: HTMLInputElement;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/combobox/combobox.form-associated.ts
|
|
2
|
+
/* eslint-disable max-classes-per-file */
|
|
3
|
+
import { FormAssociated, ListboxElement } from '@microsoft/fast-foundation';
|
|
4
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
5
|
+
class Combobox extends ListboxElement {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A form-associated base class for the Combobox component. This was copied from the
|
|
9
|
+
* FAST FormAssociatedCombobox (which is not exported by fast-foundation)
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export class FormAssociatedCombobox extends FormAssociated(Combobox) {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.proxy = document.createElement('input');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=combobox-form-associated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-form-associated.js","sourceRoot":"","sources":["../../../../src/combobox/models/combobox-form-associated.ts"],"names":[],"mappings":"AAAA,yKAAyK;AACzK,yCAAyC;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5E,+CAA+C;AAC/C,MAAM,QAAS,SAAQ,cAAc;CAAG;AAIxC;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAApE;;QACW,UAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CAAA","sourcesContent":["// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/combobox/combobox.form-associated.ts\n/* eslint-disable max-classes-per-file */\nimport { FormAssociated, ListboxElement } from '@microsoft/fast-foundation';\n\n// eslint-disable-next-line jsdoc/require-jsdoc\nclass Combobox extends ListboxElement {}\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Combobox extends FormAssociated {}\n\n/**\n * A form-associated base class for the Combobox component. This was copied from the\n * FAST FormAssociatedCombobox (which is not exported by fast-foundation)\n *\n * @internal\n */\nexport class FormAssociatedCombobox extends FormAssociated(Combobox) {\n public proxy = document.createElement('input');\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComboboxAutocomplete, SelectPosition, ListboxOption, DelegatesARIACombobox, StartEnd } from '@microsoft/fast-foundation';
|
|
2
2
|
import { ToggleButton } from '../toggle-button';
|
|
3
3
|
import type { ErrorPattern } from '../patterns/error/types';
|
|
4
4
|
import type { DropdownPattern } from '../patterns/dropdown/types';
|
|
5
5
|
import { DropdownAppearance } from '../patterns/dropdown/types';
|
|
6
6
|
import type { AnchoredRegion } from '../anchored-region';
|
|
7
|
+
import { FormAssociatedCombobox } from './models/combobox-form-associated';
|
|
7
8
|
declare global {
|
|
8
9
|
interface HTMLElementTagNameMap {
|
|
9
10
|
'nimble-combobox': Combobox;
|
|
@@ -12,23 +13,38 @@ declare global {
|
|
|
12
13
|
/**
|
|
13
14
|
* A nimble-styed HTML combobox
|
|
14
15
|
*/
|
|
15
|
-
export declare class Combobox extends
|
|
16
|
+
export declare class Combobox extends FormAssociatedCombobox implements DropdownPattern, ErrorPattern {
|
|
16
17
|
appearance: DropdownAppearance;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
19
|
+
* A message explaining why the value is invalid.
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
errorText?: string;
|
|
22
|
+
errorVisible: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* The autocomplete attribute.
|
|
25
|
+
*/
|
|
26
|
+
autocomplete?: ComboboxAutocomplete;
|
|
27
|
+
/**
|
|
28
|
+
* The placement for the listbox when the combobox is open.
|
|
29
|
+
*/
|
|
30
|
+
positionAttribute?: SelectPosition;
|
|
31
|
+
/**
|
|
32
|
+
* The open attribute.
|
|
33
|
+
*/
|
|
34
|
+
open: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the placeholder value of the element, generally used to provide a hint to the user.
|
|
37
|
+
* @remarks Using a non-null assertion to mimic FAST's original improper typing of an
|
|
38
|
+
* uninitialized property:
|
|
39
|
+
* https://github.com/microsoft/fast/blob/0c27d027ff6e8616ad4fddc17f4432aa7f6cbad0/packages/web-components/fast-foundation/src/combobox/combobox.ts#L199
|
|
40
|
+
*/
|
|
41
|
+
placeholder: string;
|
|
42
|
+
/**
|
|
43
|
+
* The current state of the calculated position of the listbox.
|
|
25
44
|
*
|
|
26
45
|
* @public
|
|
27
|
-
* @remarks
|
|
28
|
-
* HTML Attribute: error-text
|
|
29
46
|
*/
|
|
30
|
-
|
|
31
|
-
errorVisible: boolean;
|
|
47
|
+
position?: SelectPosition;
|
|
32
48
|
/**
|
|
33
49
|
* @internal
|
|
34
50
|
*/
|
|
@@ -36,35 +52,169 @@ export declare class Combobox extends FoundationCombobox implements DropdownPatt
|
|
|
36
52
|
/**
|
|
37
53
|
* @internal
|
|
38
54
|
*/
|
|
39
|
-
controlWrapper
|
|
55
|
+
controlWrapper: HTMLElement;
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
control: HTMLInputElement;
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
listbox: HTMLDivElement;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
readonly dropdownButton?: ToggleButton;
|
|
68
|
+
/**
|
|
69
|
+
* The collection of currently filtered options.
|
|
70
|
+
*/
|
|
71
|
+
filteredOptions: ListboxOption[];
|
|
40
72
|
/** @internal */
|
|
41
73
|
hasOverflow: boolean;
|
|
42
74
|
get value(): string;
|
|
43
75
|
set value(next: string);
|
|
76
|
+
/**
|
|
77
|
+
* The list of options.
|
|
78
|
+
*
|
|
79
|
+
* Overrides `Listbox.options`.
|
|
80
|
+
*/
|
|
81
|
+
get options(): ListboxOption[];
|
|
82
|
+
set options(value: ListboxOption[]);
|
|
83
|
+
/**
|
|
84
|
+
* The unique id for the internal listbox element.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
listboxId: string;
|
|
89
|
+
/**
|
|
90
|
+
* The max height for the listbox when opened.
|
|
91
|
+
*
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
maxHeight: number;
|
|
44
95
|
private valueUpdatedByInput;
|
|
45
96
|
private valueBeforeTextUpdate?;
|
|
46
|
-
|
|
97
|
+
private _value;
|
|
98
|
+
private filter;
|
|
99
|
+
/**
|
|
100
|
+
* The initial state of the position attribute.
|
|
101
|
+
*/
|
|
102
|
+
private forcedPosition;
|
|
103
|
+
private get isAutocompleteInline();
|
|
104
|
+
private get isAutocompleteList();
|
|
105
|
+
private get isAutocompleteBoth();
|
|
47
106
|
slottedOptionsChanged(prev: HTMLElement[], next: HTMLElement[]): void;
|
|
48
107
|
connectedCallback(): void;
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
clickHandler(e: MouseEvent): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
49
115
|
toggleButtonClickHandler(e: Event): void;
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
50
119
|
toggleButtonChangeHandler(e: Event): void;
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
51
123
|
toggleButtonKeyDownHandler(e: KeyboardEvent): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
52
127
|
filterOptions(): void;
|
|
53
128
|
/**
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
inputHandler(e: InputEvent): boolean;
|
|
132
|
+
keydownHandler(e: KeyboardEvent): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
keyupHandler(e: KeyboardEvent): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
focusoutHandler(e: FocusEvent): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Reset the element to its first selectable option when its parent form is reset.
|
|
143
|
+
*
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
formResetCallback(): void;
|
|
147
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
148
|
+
validate(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Set the default selected options at initialization or reset.
|
|
151
|
+
*
|
|
152
|
+
* @internal
|
|
153
|
+
* @remarks
|
|
154
|
+
* Overrides `Listbox.setDefaultSelectedOption`
|
|
155
|
+
*/
|
|
156
|
+
setDefaultSelectedOption(): void;
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
selectedIndexChanged(prev: number | undefined, next: number): void;
|
|
161
|
+
/**
|
|
162
|
+
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
163
|
+
*
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
disabledChanged(prev: boolean, next: boolean): void;
|
|
167
|
+
/**
|
|
168
|
+
* Move focus to the previous selectable option.
|
|
169
|
+
*
|
|
170
|
+
* @internal
|
|
171
|
+
* @remarks
|
|
172
|
+
* Overrides `Listbox.selectPreviousOption`
|
|
173
|
+
*/
|
|
174
|
+
selectPreviousOption(): void;
|
|
175
|
+
/**
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
setPositioning(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Focus the control and scroll the first selected option into view.
|
|
181
|
+
*
|
|
182
|
+
* @internal
|
|
183
|
+
* @remarks
|
|
184
|
+
* Overrides: `Listbox.focusAndScrollOptionIntoView`
|
|
58
185
|
*/
|
|
59
|
-
inputHandler(e: InputEvent): boolean | void;
|
|
60
|
-
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
61
|
-
focusoutHandler(e: FocusEvent): boolean | void;
|
|
62
186
|
protected focusAndScrollOptionIntoView(): void;
|
|
63
187
|
protected openChanged(): void;
|
|
188
|
+
protected placeholderChanged(): void;
|
|
189
|
+
/**
|
|
190
|
+
* Ensure that the entire list of options is used when setting the selected property.
|
|
191
|
+
* @internal
|
|
192
|
+
* @remarks
|
|
193
|
+
* Overrides: `Listbox.selectedOptionsChanged`
|
|
194
|
+
*/
|
|
195
|
+
protected selectedOptionsChanged(_: ListboxOption[] | undefined, next: ListboxOption[]): void;
|
|
196
|
+
protected positionChanged(_: SelectPosition | undefined, next: SelectPosition | undefined): void;
|
|
64
197
|
private regionChanged;
|
|
65
198
|
private controlWrapperChanged;
|
|
66
199
|
private ariaLabelChanged;
|
|
67
200
|
private maxHeightChanged;
|
|
201
|
+
/**
|
|
202
|
+
* Sets the value and to match the first selected option.
|
|
203
|
+
*/
|
|
204
|
+
private updateValue;
|
|
205
|
+
/**
|
|
206
|
+
* Focus and set the content of the control based on the first selected option.
|
|
207
|
+
*/
|
|
208
|
+
private setInputToSelection;
|
|
209
|
+
/**
|
|
210
|
+
* Focus, set and select the content of the control based on the first selected option.
|
|
211
|
+
*/
|
|
212
|
+
private setInlineSelection;
|
|
213
|
+
private clearSelectionRange;
|
|
214
|
+
/**
|
|
215
|
+
* Determines if a value update should involve emitting a change event, then updates the value.
|
|
216
|
+
*/
|
|
217
|
+
private syncValue;
|
|
68
218
|
private updateListboxMaxHeightCssVariable;
|
|
69
219
|
private updateInputAriaLabel;
|
|
70
220
|
/**
|
|
@@ -79,4 +229,6 @@ export declare class Combobox extends FoundationCombobox implements DropdownPatt
|
|
|
79
229
|
*/
|
|
80
230
|
private emitChangeIfValueUpdated;
|
|
81
231
|
}
|
|
232
|
+
export interface Combobox extends StartEnd, DelegatesARIACombobox {
|
|
233
|
+
}
|
|
82
234
|
export declare const comboboxTag = "nimble-combobox";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormAssociated, ListboxElement } from '@microsoft/fast-foundation';
|
|
2
|
+
declare class Combobox extends ListboxElement {
|
|
3
|
+
}
|
|
4
|
+
interface Combobox extends FormAssociated {
|
|
5
|
+
}
|
|
6
|
+
declare const FormAssociatedCombobox_base: typeof Combobox;
|
|
7
|
+
/**
|
|
8
|
+
* A form-associated base class for the Combobox component. This was copied from the
|
|
9
|
+
* FAST FormAssociatedCombobox (which is not exported by fast-foundation)
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormAssociatedCombobox extends FormAssociatedCombobox_base {
|
|
14
|
+
proxy: HTMLInputElement;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -14,10 +14,33 @@ declare global {
|
|
|
14
14
|
'nimble-table-column-date-text': TableColumnDateText;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
declare const TableColumnDateText_base: (abstract new (...args: any[]) => {
|
|
18
|
+
groupingDisabled: boolean;
|
|
19
|
+
groupIndex?: number | null | undefined;
|
|
20
|
+
groupingDisabledChanged(): void;
|
|
21
|
+
groupIndexChanged(): void;
|
|
22
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
23
|
+
}) & (abstract new (...args: any[]) => {
|
|
24
|
+
fractionalWidth?: number | null | undefined;
|
|
25
|
+
minPixelWidth?: number | null | undefined;
|
|
26
|
+
fractionalWidthChanged(): void;
|
|
27
|
+
minPixelWidthChanged(): void;
|
|
28
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
29
|
+
}) & (abstract new (...args: any[]) => {
|
|
30
|
+
placeholder?: string | undefined;
|
|
31
|
+
placeholderChanged(): void;
|
|
32
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnDateTextColumnConfig>) & {
|
|
33
|
+
compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
|
|
34
|
+
from<TBase extends {
|
|
35
|
+
new (): HTMLElement;
|
|
36
|
+
prototype: HTMLElement;
|
|
37
|
+
}>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
|
|
38
|
+
define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
|
|
39
|
+
});
|
|
17
40
|
/**
|
|
18
41
|
* The table column for displaying dates/times as text.
|
|
19
42
|
*/
|
|
20
|
-
export declare class TableColumnDateText extends
|
|
43
|
+
export declare class TableColumnDateText extends TableColumnDateText_base {
|
|
21
44
|
/** @internal */
|
|
22
45
|
validator: TableColumnDateTextValidator;
|
|
23
46
|
format: DateTextFormat;
|
|
@@ -71,3 +94,4 @@ export declare class TableColumnDateText extends TableColumnTextBase {
|
|
|
71
94
|
private getCustomFormattingOptions;
|
|
72
95
|
}
|
|
73
96
|
export declare const tableColumnDateTextTag = "nimble-table-column-date-text";
|
|
97
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TableNumberField } from '../../table/types';
|
|
2
|
-
import { TableColumnTextBase } from '../text-base';
|
|
3
2
|
import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
4
3
|
import { DurationFormatter } from './models/duration-formatter';
|
|
5
4
|
import type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';
|
|
5
|
+
import { TableColumnTextBase } from '../text-base';
|
|
6
6
|
export type TableColumnDurationTextCellRecord = TableNumberField<'value'>;
|
|
7
7
|
export interface TableColumnDurationTextColumnConfig extends TableColumnTextBaseColumnConfig {
|
|
8
8
|
formatter: DurationFormatter;
|
|
@@ -12,10 +12,33 @@ declare global {
|
|
|
12
12
|
'nimble-table-column-duration-text': TableColumnDurationText;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
declare const TableColumnDurationText_base: (abstract new (...args: any[]) => {
|
|
16
|
+
groupingDisabled: boolean;
|
|
17
|
+
groupIndex?: number | null | undefined;
|
|
18
|
+
groupingDisabledChanged(): void;
|
|
19
|
+
groupIndexChanged(): void;
|
|
20
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
21
|
+
}) & (abstract new (...args: any[]) => {
|
|
22
|
+
fractionalWidth?: number | null | undefined;
|
|
23
|
+
minPixelWidth?: number | null | undefined;
|
|
24
|
+
fractionalWidthChanged(): void;
|
|
25
|
+
minPixelWidthChanged(): void;
|
|
26
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
27
|
+
}) & (abstract new (...args: any[]) => {
|
|
28
|
+
placeholder?: string | undefined;
|
|
29
|
+
placeholderChanged(): void;
|
|
30
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnDurationTextColumnConfig>) & {
|
|
31
|
+
compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
|
|
32
|
+
from<TBase extends {
|
|
33
|
+
new (): HTMLElement;
|
|
34
|
+
prototype: HTMLElement;
|
|
35
|
+
}>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
|
|
36
|
+
define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
|
|
37
|
+
});
|
|
15
38
|
/**
|
|
16
39
|
* The table column for displaying a duration value as text.
|
|
17
40
|
*/
|
|
18
|
-
export declare class TableColumnDurationText extends
|
|
41
|
+
export declare class TableColumnDurationText extends TableColumnDurationText_base {
|
|
19
42
|
private readonly langSubscriber;
|
|
20
43
|
connectedCallback(): void;
|
|
21
44
|
disconnectedCallback(): void;
|
|
@@ -24,3 +47,4 @@ export declare class TableColumnDurationText extends TableColumnTextBase {
|
|
|
24
47
|
private updateColumnConfig;
|
|
25
48
|
}
|
|
26
49
|
export declare const tableColumnDurationTextTag = "nimble-table-column-duration-text";
|
|
50
|
+
export {};
|
|
@@ -17,10 +17,33 @@ declare global {
|
|
|
17
17
|
'nimble-table-column-number-text': TableColumnNumberText;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
declare const TableColumnNumberText_base: (abstract new (...args: any[]) => {
|
|
21
|
+
groupingDisabled: boolean;
|
|
22
|
+
groupIndex?: number | null | undefined;
|
|
23
|
+
groupingDisabledChanged(): void;
|
|
24
|
+
groupIndexChanged(): void;
|
|
25
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
26
|
+
}) & (abstract new (...args: any[]) => {
|
|
27
|
+
fractionalWidth?: number | null | undefined;
|
|
28
|
+
minPixelWidth?: number | null | undefined;
|
|
29
|
+
fractionalWidthChanged(): void;
|
|
30
|
+
minPixelWidthChanged(): void;
|
|
31
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
32
|
+
}) & (abstract new (...args: any[]) => {
|
|
33
|
+
placeholder?: string | undefined;
|
|
34
|
+
placeholderChanged(): void;
|
|
35
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnNumberTextColumnConfig>) & {
|
|
36
|
+
compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
|
|
37
|
+
from<TBase extends {
|
|
38
|
+
new (): HTMLElement;
|
|
39
|
+
prototype: HTMLElement;
|
|
40
|
+
}>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
|
|
41
|
+
define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
|
|
42
|
+
});
|
|
20
43
|
/**
|
|
21
44
|
* The table column for displaying numbers as text.
|
|
22
45
|
*/
|
|
23
|
-
export declare class TableColumnNumberText extends
|
|
46
|
+
export declare class TableColumnNumberText extends TableColumnNumberText_base {
|
|
24
47
|
/** @internal */
|
|
25
48
|
validator: TableColumnNumberTextValidator;
|
|
26
49
|
format: NumberTextFormat;
|
|
@@ -51,3 +74,4 @@ export declare class TableColumnNumberText extends TableColumnTextBase {
|
|
|
51
74
|
private determineCellContentAlignment;
|
|
52
75
|
}
|
|
53
76
|
export declare const tableColumnNumberTextTag = "nimble-table-column-number-text";
|
|
77
|
+
export {};
|
|
@@ -10,11 +10,35 @@ declare global {
|
|
|
10
10
|
'nimble-table-column-text': TableColumnText;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
declare const TableColumnText_base: (abstract new (...args: any[]) => {
|
|
14
|
+
groupingDisabled: boolean;
|
|
15
|
+
groupIndex?: number | null | undefined;
|
|
16
|
+
groupingDisabledChanged(): void;
|
|
17
|
+
groupIndexChanged(): void;
|
|
18
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
19
|
+
}) & (abstract new (...args: any[]) => {
|
|
20
|
+
fractionalWidth?: number | null | undefined;
|
|
21
|
+
minPixelWidth?: number | null | undefined;
|
|
22
|
+
fractionalWidthChanged(): void;
|
|
23
|
+
minPixelWidthChanged(): void;
|
|
24
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
|
|
25
|
+
}) & (abstract new (...args: any[]) => {
|
|
26
|
+
placeholder?: string | undefined;
|
|
27
|
+
placeholderChanged(): void;
|
|
28
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnTextColumnConfig>) & {
|
|
29
|
+
compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
|
|
30
|
+
from<TBase extends {
|
|
31
|
+
new (): HTMLElement;
|
|
32
|
+
prototype: HTMLElement;
|
|
33
|
+
}>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
|
|
34
|
+
define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
|
|
35
|
+
});
|
|
13
36
|
/**
|
|
14
37
|
* The table column for displaying string fields as text.
|
|
15
38
|
*/
|
|
16
|
-
export declare class TableColumnText extends
|
|
39
|
+
export declare class TableColumnText extends TableColumnText_base {
|
|
17
40
|
placeholderChanged(): void;
|
|
18
41
|
protected getColumnInternalsOptions(): ColumnInternalsOptions;
|
|
19
42
|
}
|
|
20
43
|
export declare const tableColumnTextTag = "nimble-table-column-text";
|
|
44
|
+
export {};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { TableColumn } from '../base';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The base class for table columns that display fields of any type as text.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class TableColumnTextBase<TColumnConfig> extends TableColumn<TColumnConfig> {
|
|
6
|
+
fieldName?: string;
|
|
7
|
+
protected fieldNameChanged(): void;
|
|
8
|
+
}
|
|
9
|
+
type TableColumnBaseConstructor<TColumnConfig> = abstract new (...args: any[]) => TableColumnTextBase<TColumnConfig>;
|
|
10
|
+
export declare function mixinTextBase<TBase extends TableColumnBaseConstructor<TColumnConfig>, TColumnConfig>(base: TBase): (abstract new (...args: any[]) => {
|
|
3
11
|
groupingDisabled: boolean;
|
|
4
12
|
groupIndex?: number | null | undefined;
|
|
5
13
|
groupingDisabledChanged(): void;
|
|
@@ -14,12 +22,5 @@ declare const TableColumnTextBase_base: (abstract new (...args: any[]) => {
|
|
|
14
22
|
}) & (abstract new (...args: any[]) => {
|
|
15
23
|
placeholder?: string | undefined;
|
|
16
24
|
placeholderChanged(): void;
|
|
17
|
-
}) &
|
|
18
|
-
/**
|
|
19
|
-
* The base class for table columns that display fields of any type as text.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class TableColumnTextBase extends TableColumnTextBase_base {
|
|
22
|
-
fieldName?: string;
|
|
23
|
-
protected fieldNameChanged(): void;
|
|
24
|
-
}
|
|
25
|
+
}) & TBase;
|
|
25
26
|
export {};
|