@ni/nimble-components 22.0.1 → 22.1.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/dist/all-components-bundle.js +83 -60
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2294 -2292
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +2 -7
- package/dist/esm/combobox/index.js +0 -15
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/label-provider/table/index.d.ts +6 -0
- package/dist/esm/label-provider/table/index.js +10 -2
- package/dist/esm/label-provider/table/index.js.map +1 -1
- package/dist/esm/label-provider/table/label-token-defaults.js +3 -1
- package/dist/esm/label-provider/table/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/table/label-tokens.d.ts +2 -0
- package/dist/esm/label-provider/table/label-tokens.js +8 -0
- package/dist/esm/label-provider/table/label-tokens.js.map +1 -1
- package/dist/esm/table-column/date-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/date-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/date-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/duration-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/duration-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/duration-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/enum-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/enum-text/group-header-view/index.js +1 -12
- package/dist/esm/table-column/enum-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/icon/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/icon/group-header-view/index.js +2 -10
- package/dist/esm/table-column/icon/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/icon/group-header-view/template.js +6 -0
- package/dist/esm/table-column/icon/group-header-view/template.js.map +1 -1
- package/dist/esm/table-column/number-text/group-header-view/index.d.ts +1 -3
- package/dist/esm/table-column/number-text/group-header-view/index.js +0 -6
- package/dist/esm/table-column/number-text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text/group-header-view/index.d.ts +1 -1
- package/dist/esm/table-column/text/group-header-view/index.js +1 -1
- package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/group-header-view/index.d.ts +16 -0
- package/dist/esm/table-column/text-base/group-header-view/index.js +53 -1
- package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Combobox as FoundationCombobox } from '@microsoft/fast-foundation';
|
|
2
2
|
import { ToggleButton } from '../toggle-button';
|
|
3
3
|
import type { ErrorPattern } from '../patterns/error/types';
|
|
4
|
-
import type { DropdownPattern
|
|
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 type { ListOption } from '../list-option';
|
|
8
7
|
declare global {
|
|
9
8
|
interface HTMLElementTagNameMap {
|
|
10
9
|
'nimble-combobox': Combobox;
|
|
@@ -13,7 +12,7 @@ declare global {
|
|
|
13
12
|
/**
|
|
14
13
|
* A nimble-styed HTML combobox
|
|
15
14
|
*/
|
|
16
|
-
export declare class Combobox extends FoundationCombobox implements DropdownPattern, ErrorPattern
|
|
15
|
+
export declare class Combobox extends FoundationCombobox implements DropdownPattern, ErrorPattern {
|
|
17
16
|
appearance: DropdownAppearance;
|
|
18
17
|
/**
|
|
19
18
|
* The ref to the internal dropdown button element.
|
|
@@ -60,10 +59,6 @@ export declare class Combobox extends FoundationCombobox implements DropdownPatt
|
|
|
60
59
|
inputHandler(e: InputEvent): boolean | void;
|
|
61
60
|
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
62
61
|
focusoutHandler(e: FocusEvent): boolean | void;
|
|
63
|
-
/**
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
registerOption(option: ListOption): void;
|
|
67
62
|
protected focusAndScrollOptionIntoView(): void;
|
|
68
63
|
protected openChanged(): void;
|
|
69
64
|
private regionChanged;
|
|
@@ -134,21 +134,6 @@ export class Combobox extends FoundationCombobox {
|
|
|
134
134
|
this.emitChangeIfValueUpdated();
|
|
135
135
|
return returnValue;
|
|
136
136
|
}
|
|
137
|
-
/**
|
|
138
|
-
* @internal
|
|
139
|
-
*/
|
|
140
|
-
registerOption(option) {
|
|
141
|
-
if (this.options.includes(option)) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
// Adding an option to the end, ultimately, isn't the correct
|
|
145
|
-
// thing to do, as this will mean the option's index in the options,
|
|
146
|
-
// at least temporarily, does not match the DOM order. However, it
|
|
147
|
-
// is expected that a successive run of `slottedOptionsChanged` will
|
|
148
|
-
// correct this order issue. See 'https://github.com/ni/nimble/issues/1915'
|
|
149
|
-
// for more info.
|
|
150
|
-
this.options.push(option);
|
|
151
|
-
}
|
|
152
137
|
focusAndScrollOptionIntoView() {
|
|
153
138
|
if (this.open) {
|
|
154
139
|
super.focusAndScrollOptionIntoView();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,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,sBAAsB,EA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E,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 {\n DropdownPattern,\n ListOptionOwner\n} from '../patterns/dropdown/types';\nimport { DropdownAppearance } from '../patterns/dropdown/types';\nimport type { AnchoredRegion } from '../anchored-region';\nimport { template } from './template';\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 FoundationCombobox\n implements DropdownPattern, ErrorPattern, ListOptionOwner {\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 /**\n * @internal\n */\n public registerOption(option: ListOption): void {\n if (this.options.includes(option)) {\n return;\n }\n\n // Adding an option to the end, ultimately, isn't the correct\n // thing to do, as this will mean the option's index in the options,\n // at least temporarily, does not match the DOM order. However, it\n // is expected that a successive run of `slottedOptionsChanged` will\n // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'\n // for more info.\n this.options.push(option);\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,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,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,sBAAsB,EAAE,MAAM,2BAA2B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AAC,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"]}
|
|
@@ -19,6 +19,8 @@ declare const supportedLabels: {
|
|
|
19
19
|
readonly rowSelect: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
20
20
|
readonly rowOperationColumn: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
21
21
|
readonly rowLoading: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
22
|
+
readonly groupRowPlaceholderNoValue: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
23
|
+
readonly groupRowPlaceholderEmpty: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* Label provider for the Nimble table (and its sub-components and columns)
|
|
@@ -38,6 +40,8 @@ export declare class LabelProviderTable extends LabelProviderBase<typeof support
|
|
|
38
40
|
rowSelect: string | undefined;
|
|
39
41
|
rowOperationColumn: string | undefined;
|
|
40
42
|
rowLoading: string | undefined;
|
|
43
|
+
groupRowPlaceholderNoValue: string | undefined;
|
|
44
|
+
groupRowPlaceholderEmpty: string | undefined;
|
|
41
45
|
protected readonly supportedLabels: {
|
|
42
46
|
readonly groupCollapse: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
43
47
|
readonly groupExpand: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
@@ -53,6 +57,8 @@ export declare class LabelProviderTable extends LabelProviderBase<typeof support
|
|
|
53
57
|
readonly rowSelect: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
54
58
|
readonly rowOperationColumn: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
55
59
|
readonly rowLoading: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
60
|
+
readonly groupRowPlaceholderNoValue: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
61
|
+
readonly groupRowPlaceholderEmpty: import("@microsoft/fast-foundation").DesignToken<string>;
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
64
|
export declare const labelProviderTableTag = "nimble-label-provider-table";
|
|
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { attr } from '@microsoft/fast-element';
|
|
3
3
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
4
4
|
import { LabelProviderBase } from '../base';
|
|
5
|
-
import { tableCellActionMenuLabel, tableColumnHeaderGroupedLabel, tableColumnHeaderSortedAscendingLabel, tableColumnHeaderSortedDescendingLabel, tableGroupCollapseLabel, tableGroupExpandLabel, tableGroupSelectAllLabel, tableCollapseAllLabel, tableRowCollapseLabel, tableRowExpandLabel, tableRowOperationColumnLabel, tableRowSelectLabel, tableSelectAllLabel, tableRowLoadingLabel } from './label-tokens';
|
|
5
|
+
import { tableCellActionMenuLabel, tableColumnHeaderGroupedLabel, tableColumnHeaderSortedAscendingLabel, tableColumnHeaderSortedDescendingLabel, tableGroupCollapseLabel, tableGroupExpandLabel, tableGroupSelectAllLabel, tableCollapseAllLabel, tableRowCollapseLabel, tableRowExpandLabel, tableRowOperationColumnLabel, tableRowSelectLabel, tableSelectAllLabel, tableRowLoadingLabel, tableGroupRowPlaceholderEmptyLabel, tableGroupRowPlaceholderNoValueLabel } from './label-tokens';
|
|
6
6
|
const supportedLabels = {
|
|
7
7
|
groupCollapse: tableGroupCollapseLabel,
|
|
8
8
|
groupExpand: tableGroupExpandLabel,
|
|
@@ -17,7 +17,9 @@ const supportedLabels = {
|
|
|
17
17
|
groupSelectAll: tableGroupSelectAllLabel,
|
|
18
18
|
rowSelect: tableRowSelectLabel,
|
|
19
19
|
rowOperationColumn: tableRowOperationColumnLabel,
|
|
20
|
-
rowLoading: tableRowLoadingLabel
|
|
20
|
+
rowLoading: tableRowLoadingLabel,
|
|
21
|
+
groupRowPlaceholderNoValue: tableGroupRowPlaceholderNoValueLabel,
|
|
22
|
+
groupRowPlaceholderEmpty: tableGroupRowPlaceholderEmptyLabel
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Label provider for the Nimble table (and its sub-components and columns)
|
|
@@ -70,6 +72,12 @@ __decorate([
|
|
|
70
72
|
__decorate([
|
|
71
73
|
attr({ attribute: 'row-loading' })
|
|
72
74
|
], LabelProviderTable.prototype, "rowLoading", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
attr({ attribute: 'group-row-placeholder-no-value' })
|
|
77
|
+
], LabelProviderTable.prototype, "groupRowPlaceholderNoValue", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
attr({ attribute: 'group-row-placeholder-empty' })
|
|
80
|
+
], LabelProviderTable.prototype, "groupRowPlaceholderEmpty", void 0);
|
|
73
81
|
const nimbleLabelProviderTable = LabelProviderTable.compose({
|
|
74
82
|
baseName: 'label-provider-table'
|
|
75
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/label-provider/table/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAmB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EACH,wBAAwB,EACxB,6BAA6B,EAC7B,qCAAqC,EACrC,sCAAsC,EACtC,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/label-provider/table/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAmB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EACH,wBAA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C;0DACE;AAG1C;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;+DACE;AAG/C;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gCAAgC,EAAE,CAAC;uEACC;AAGvD;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,iCAAiC,EAAE,CAAC;wEACC;AAGxD;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;qDACG;AAGrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;0DACE;AAG1C;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;qDACG;AAGrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;8DACE;AAG9C;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDACG;AAGtC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gCAAgC,EAAE,CAAC;sEACA;AAGtD;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC;oEACC;AAKxD,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,OAAO,CAAC;IACxD,QAAQ,EAAE,sBAAsB;CACnC,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,6BAA6B,CAAC","sourcesContent":["import { attr } from '@microsoft/fast-element';\nimport { DesignSystem } from '@microsoft/fast-foundation';\nimport { DesignTokensFor, LabelProviderBase } from '../base';\nimport {\n tableCellActionMenuLabel,\n tableColumnHeaderGroupedLabel,\n tableColumnHeaderSortedAscendingLabel,\n tableColumnHeaderSortedDescendingLabel,\n tableGroupCollapseLabel,\n tableGroupExpandLabel,\n tableGroupSelectAllLabel,\n tableCollapseAllLabel,\n tableRowCollapseLabel,\n tableRowExpandLabel,\n tableRowOperationColumnLabel,\n tableRowSelectLabel,\n tableSelectAllLabel,\n tableRowLoadingLabel,\n tableGroupRowPlaceholderEmptyLabel,\n tableGroupRowPlaceholderNoValueLabel\n} from './label-tokens';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-label-provider-table': LabelProviderTable;\n }\n}\n\nconst supportedLabels = {\n groupCollapse: tableGroupCollapseLabel,\n groupExpand: tableGroupExpandLabel,\n rowCollapse: tableRowCollapseLabel,\n rowExpand: tableRowExpandLabel,\n collapseAll: tableCollapseAllLabel,\n cellActionMenu: tableCellActionMenuLabel,\n columnHeaderGrouped: tableColumnHeaderGroupedLabel,\n columnHeaderSortedAscending: tableColumnHeaderSortedAscendingLabel,\n columnHeaderSortedDescending: tableColumnHeaderSortedDescendingLabel,\n selectAll: tableSelectAllLabel,\n groupSelectAll: tableGroupSelectAllLabel,\n rowSelect: tableRowSelectLabel,\n rowOperationColumn: tableRowOperationColumnLabel,\n rowLoading: tableRowLoadingLabel,\n groupRowPlaceholderNoValue: tableGroupRowPlaceholderNoValueLabel,\n groupRowPlaceholderEmpty: tableGroupRowPlaceholderEmptyLabel\n} as const;\n\n/**\n * Label provider for the Nimble table (and its sub-components and columns)\n */\nexport class LabelProviderTable\n extends LabelProviderBase<typeof supportedLabels>\n implements DesignTokensFor<typeof supportedLabels> {\n @attr({ attribute: 'group-collapse' })\n public groupCollapse: string | undefined;\n\n @attr({ attribute: 'group-expand' })\n public groupExpand: string | undefined;\n\n @attr({ attribute: 'row-collapse' })\n public rowCollapse: string | undefined;\n\n @attr({ attribute: 'row-expand' })\n public rowExpand: string | undefined;\n\n @attr({ attribute: 'collapse-all' })\n public collapseAll: string | undefined;\n\n @attr({ attribute: 'cell-action-menu' })\n public cellActionMenu: string | undefined;\n\n @attr({ attribute: 'column-header-grouped' })\n public columnHeaderGrouped: string | undefined;\n\n @attr({ attribute: 'column-header-sorted-ascending' })\n public columnHeaderSortedAscending: string | undefined;\n\n @attr({ attribute: 'column-header-sorted-descending' })\n public columnHeaderSortedDescending: string | undefined;\n\n @attr({ attribute: 'select-all' })\n public selectAll: string | undefined;\n\n @attr({ attribute: 'group-select-all' })\n public groupSelectAll: string | undefined;\n\n @attr({ attribute: 'row-select' })\n public rowSelect: string | undefined;\n\n @attr({ attribute: 'row-operation-column' })\n public rowOperationColumn: string | undefined;\n\n @attr({ attribute: 'row-loading' })\n public rowLoading: string | undefined;\n\n @attr({ attribute: 'group-row-placeholder-no-value' })\n public groupRowPlaceholderNoValue: string | undefined;\n\n @attr({ attribute: 'group-row-placeholder-empty' })\n public groupRowPlaceholderEmpty: string | undefined;\n\n protected override readonly supportedLabels = supportedLabels;\n}\n\nconst nimbleLabelProviderTable = LabelProviderTable.compose({\n baseName: 'label-provider-table'\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleLabelProviderTable());\nexport const labelProviderTableTag = 'nimble-label-provider-table';\n"]}
|
|
@@ -12,6 +12,8 @@ export const tableLabelDefaults = {
|
|
|
12
12
|
tableGroupSelectAllLabel: 'Select all rows in group',
|
|
13
13
|
tableRowSelectLabel: 'Select row',
|
|
14
14
|
tableRowOperationColumnLabel: 'Row operations',
|
|
15
|
-
tableRowLoadingLabel: 'Loading'
|
|
15
|
+
tableRowLoadingLabel: 'Loading',
|
|
16
|
+
tableGroupRowPlaceholderNoValueLabel: 'No value',
|
|
17
|
+
tableGroupRowPlaceholderEmptyLabel: 'Empty'
|
|
16
18
|
};
|
|
17
19
|
//# sourceMappingURL=label-token-defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-token-defaults.js","sourceRoot":"","sources":["../../../../src/label-provider/table/label-token-defaults.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kBAAkB,GAA4C;IACvE,uBAAuB,EAAE,gBAAgB;IACzC,qBAAqB,EAAE,cAAc;IACrC,qBAAqB,EAAE,cAAc;IACrC,mBAAmB,EAAE,YAAY;IACjC,qBAAqB,EAAE,cAAc;IACrC,wBAAwB,EAAE,SAAS;IACnC,6BAA6B,EAAE,SAAS;IACxC,qCAAqC,EAAE,kBAAkB;IACzD,sCAAsC,EAAE,mBAAmB;IAC3D,mBAAmB,EAAE,iBAAiB;IACtC,wBAAwB,EAAE,0BAA0B;IACpD,mBAAmB,EAAE,YAAY;IACjC,4BAA4B,EAAE,gBAAgB;IAC9C,oBAAoB,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"label-token-defaults.js","sourceRoot":"","sources":["../../../../src/label-provider/table/label-token-defaults.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,kBAAkB,GAA4C;IACvE,uBAAuB,EAAE,gBAAgB;IACzC,qBAAqB,EAAE,cAAc;IACrC,qBAAqB,EAAE,cAAc;IACrC,mBAAmB,EAAE,YAAY;IACjC,qBAAqB,EAAE,cAAc;IACrC,wBAAwB,EAAE,SAAS;IACnC,6BAA6B,EAAE,SAAS;IACxC,qCAAqC,EAAE,kBAAkB;IACzD,sCAAsC,EAAE,mBAAmB;IAC3D,mBAAmB,EAAE,iBAAiB;IACtC,wBAAwB,EAAE,0BAA0B;IACpD,mBAAmB,EAAE,YAAY;IACjC,4BAA4B,EAAE,gBAAgB;IAC9C,oBAAoB,EAAE,SAAS;IAC/B,oCAAoC,EAAE,UAAU;IAChD,kCAAkC,EAAE,OAAO;CAC9C,CAAC","sourcesContent":["import type * as TokensNamespace from './label-tokens';\n\ntype TokenName = keyof typeof TokensNamespace;\n\nexport const tableLabelDefaults: { readonly [key in TokenName]: string } = {\n tableGroupCollapseLabel: 'Collapse group',\n tableGroupExpandLabel: 'Expand group',\n tableRowCollapseLabel: 'Collapse row',\n tableRowExpandLabel: 'Expand row',\n tableCollapseAllLabel: 'Collapse all',\n tableCellActionMenuLabel: 'Options',\n tableColumnHeaderGroupedLabel: 'Grouped',\n tableColumnHeaderSortedAscendingLabel: 'Sorted ascending',\n tableColumnHeaderSortedDescendingLabel: 'Sorted descending',\n tableSelectAllLabel: 'Select all rows',\n tableGroupSelectAllLabel: 'Select all rows in group',\n tableRowSelectLabel: 'Select row',\n tableRowOperationColumnLabel: 'Row operations',\n tableRowLoadingLabel: 'Loading',\n tableGroupRowPlaceholderNoValueLabel: 'No value',\n tableGroupRowPlaceholderEmptyLabel: 'Empty'\n};\n"]}
|
|
@@ -13,3 +13,5 @@ export declare const tableGroupSelectAllLabel: DesignToken<string>;
|
|
|
13
13
|
export declare const tableRowSelectLabel: DesignToken<string>;
|
|
14
14
|
export declare const tableRowOperationColumnLabel: DesignToken<string>;
|
|
15
15
|
export declare const tableRowLoadingLabel: DesignToken<string>;
|
|
16
|
+
export declare const tableGroupRowPlaceholderNoValueLabel: DesignToken<string>;
|
|
17
|
+
export declare const tableGroupRowPlaceholderEmptyLabel: DesignToken<string>;
|
|
@@ -56,4 +56,12 @@ export const tableRowLoadingLabel = DesignToken.create({
|
|
|
56
56
|
name: 'table-row-loading-label',
|
|
57
57
|
cssCustomPropertyName: null
|
|
58
58
|
}).withDefault(tableLabelDefaults.tableRowLoadingLabel);
|
|
59
|
+
export const tableGroupRowPlaceholderNoValueLabel = DesignToken.create({
|
|
60
|
+
name: 'table-group-row-placeholder-no-value-label',
|
|
61
|
+
cssCustomPropertyName: null
|
|
62
|
+
}).withDefault(tableLabelDefaults.tableGroupRowPlaceholderNoValueLabel);
|
|
63
|
+
export const tableGroupRowPlaceholderEmptyLabel = DesignToken.create({
|
|
64
|
+
name: 'table-group-row-placeholder-empty-label',
|
|
65
|
+
cssCustomPropertyName: null
|
|
66
|
+
}).withDefault(tableLabelDefaults.tableGroupRowPlaceholderEmptyLabel);
|
|
59
67
|
//# sourceMappingURL=label-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-tokens.js","sourceRoot":"","sources":["../../../../src/label-provider/table/label-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO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B,GAAG,WAAW,CAAC,MAAM,CAAS;IAC3D,IAAI,EAAE,yBAAyB;IAC/B,qBAAqB,EAAE,IAAI;CAC9B,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import { DesignToken } from '@microsoft/fast-foundation';\nimport { tableLabelDefaults } from './label-token-defaults';\n\nexport const tableGroupCollapseLabel = DesignToken.create<string>({\n name: 'table-group-collapse-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupCollapseLabel);\n\nexport const tableGroupExpandLabel = DesignToken.create<string>({\n name: 'table-group-expand-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupExpandLabel);\n\nexport const tableRowCollapseLabel = DesignToken.create<string>({\n name: 'table-row-collapse-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowCollapseLabel);\n\nexport const tableRowExpandLabel = DesignToken.create<string>({\n name: 'table-row-expand-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowExpandLabel);\n\nexport const tableCollapseAllLabel = DesignToken.create<string>({\n name: 'table-collapse-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableCollapseAllLabel);\n\nexport const tableCellActionMenuLabel = DesignToken.create<string>({\n name: 'table-cell-action-menu-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableCellActionMenuLabel);\n\nexport const tableColumnHeaderGroupedLabel = DesignToken.create<string>({\n name: 'table-column-header-grouped-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableColumnHeaderGroupedLabel);\n\nexport const tableColumnHeaderSortedAscendingLabel = DesignToken.create<string>(\n {\n name: 'table-column-header-sorted-ascending-label',\n cssCustomPropertyName: null\n }\n).withDefault(tableLabelDefaults.tableColumnHeaderSortedAscendingLabel);\n\nexport const tableColumnHeaderSortedDescendingLabel = DesignToken.create<string>({\n name: 'table-column-header-sorted-descending-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableColumnHeaderSortedDescendingLabel);\n\nexport const tableSelectAllLabel = DesignToken.create<string>({\n name: 'table-select-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableSelectAllLabel);\n\nexport const tableGroupSelectAllLabel = DesignToken.create<string>({\n name: 'table-group-select-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupSelectAllLabel);\n\nexport const tableRowSelectLabel = DesignToken.create<string>({\n name: 'table-row-select-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowSelectLabel);\n\nexport const tableRowOperationColumnLabel = DesignToken.create<string>({\n name: 'table-row-operation-column-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowOperationColumnLabel);\n\nexport const tableRowLoadingLabel = DesignToken.create<string>({\n name: 'table-row-loading-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowLoadingLabel);\n"]}
|
|
1
|
+
{"version":3,"file":"label-tokens.js","sourceRoot":"","sources":["../../../../src/label-provider/table/label-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC,MAAM,CAAS;IAC9D,IAAI,EAAE,4BAA4B;IAClC,qBAAqB,EAAE,IAAI;CAC9B,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAS;IAC5D,IAAI,EAAE,0BAA0B;IAChC,qBAAqB,EAAE,IAAI;CAC9B,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAS;IA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W,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC","sourcesContent":["import { DesignToken } from '@microsoft/fast-foundation';\nimport { tableLabelDefaults } from './label-token-defaults';\n\nexport const tableGroupCollapseLabel = DesignToken.create<string>({\n name: 'table-group-collapse-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupCollapseLabel);\n\nexport const tableGroupExpandLabel = DesignToken.create<string>({\n name: 'table-group-expand-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupExpandLabel);\n\nexport const tableRowCollapseLabel = DesignToken.create<string>({\n name: 'table-row-collapse-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowCollapseLabel);\n\nexport const tableRowExpandLabel = DesignToken.create<string>({\n name: 'table-row-expand-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowExpandLabel);\n\nexport const tableCollapseAllLabel = DesignToken.create<string>({\n name: 'table-collapse-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableCollapseAllLabel);\n\nexport const tableCellActionMenuLabel = DesignToken.create<string>({\n name: 'table-cell-action-menu-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableCellActionMenuLabel);\n\nexport const tableColumnHeaderGroupedLabel = DesignToken.create<string>({\n name: 'table-column-header-grouped-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableColumnHeaderGroupedLabel);\n\nexport const tableColumnHeaderSortedAscendingLabel = DesignToken.create<string>(\n {\n name: 'table-column-header-sorted-ascending-label',\n cssCustomPropertyName: null\n }\n).withDefault(tableLabelDefaults.tableColumnHeaderSortedAscendingLabel);\n\nexport const tableColumnHeaderSortedDescendingLabel = DesignToken.create<string>({\n name: 'table-column-header-sorted-descending-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableColumnHeaderSortedDescendingLabel);\n\nexport const tableSelectAllLabel = DesignToken.create<string>({\n name: 'table-select-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableSelectAllLabel);\n\nexport const tableGroupSelectAllLabel = DesignToken.create<string>({\n name: 'table-group-select-all-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupSelectAllLabel);\n\nexport const tableRowSelectLabel = DesignToken.create<string>({\n name: 'table-row-select-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowSelectLabel);\n\nexport const tableRowOperationColumnLabel = DesignToken.create<string>({\n name: 'table-row-operation-column-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowOperationColumnLabel);\n\nexport const tableRowLoadingLabel = DesignToken.create<string>({\n name: 'table-row-loading-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableRowLoadingLabel);\n\nexport const tableGroupRowPlaceholderNoValueLabel = DesignToken.create<string>({\n name: 'table-group-row-placeholder-no-value-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupRowPlaceholderNoValueLabel);\n\nexport const tableGroupRowPlaceholderEmptyLabel = DesignToken.create<string>({\n name: 'table-group-row-placeholder-empty-label',\n cssCustomPropertyName: null\n}).withDefault(tableLabelDefaults.tableGroupRowPlaceholderEmptyLabel);\n"]}
|
|
@@ -10,8 +10,6 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying date/time fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableNumberFieldValue, TableColumnDateTextColumnConfig> {
|
|
13
|
-
|
|
14
|
-
private groupHeaderValueChanged;
|
|
15
|
-
private updateText;
|
|
13
|
+
protected updateText(): void;
|
|
16
14
|
}
|
|
17
15
|
export declare const tableColumnDateTextGroupHeaderViewTag = "nimble-table-column-date-text-group-header-view";
|
|
@@ -7,12 +7,6 @@ import { formatNumericDate } from '../models/format-helper';
|
|
|
7
7
|
* The group header view for displaying date/time fields as text.
|
|
8
8
|
*/
|
|
9
9
|
export class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
10
|
-
columnConfigChanged() {
|
|
11
|
-
this.updateText();
|
|
12
|
-
}
|
|
13
|
-
groupHeaderValueChanged() {
|
|
14
|
-
this.updateText();
|
|
15
|
-
}
|
|
16
10
|
updateText() {
|
|
17
11
|
if (this.columnConfig) {
|
|
18
12
|
this.text = formatNumericDate(this.columnConfig.formatter, this.groupHeaderValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/date-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,kCAGvD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/date-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,kCAGvD;IACa,UAAU;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CACzB,IAAI,CAAC,YAAY,CAAC,SAAS,EAC3B,IAAI,CAAC,gBAAgB,CACxB,CAAC;SACL;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;SAClB;IACL,CAAC;CACJ;AAED,MAAM,kCAAkC,GAAG,kCAAkC,CAAC,OAAO,CAAC;IAClF,QAAQ,EAAE,0CAA0C;IACpD,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,kCAAkC,EAAE,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,qCAAqC,GAAG,iDAAiD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableNumberFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnDateTextColumnConfig } from '..';\nimport { formatNumericDate } from '../models/format-helper';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-date-text-group-header': TableColumnDateTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying date/time fields as text.\n */\nexport class TableColumnDateTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableNumberFieldValue,\nTableColumnDateTextColumnConfig\n> {\n protected updateText(): void {\n if (this.columnConfig) {\n this.text = formatNumericDate(\n this.columnConfig.formatter,\n this.groupHeaderValue\n );\n } else {\n this.text = '';\n }\n }\n}\n\nconst tableColumnDateTextGroupHeaderView = TableColumnDateTextGroupHeaderView.compose({\n baseName: 'table-column-date-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnDateTextGroupHeaderView());\nexport const tableColumnDateTextGroupHeaderViewTag = 'nimble-table-column-date-text-group-header-view';\n"]}
|
|
@@ -10,8 +10,6 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying duration fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableNumberFieldValue, TableColumnDurationTextColumnConfig> {
|
|
13
|
-
|
|
14
|
-
private groupHeaderValueChanged;
|
|
15
|
-
private updateText;
|
|
13
|
+
protected updateText(): void;
|
|
16
14
|
}
|
|
17
15
|
export declare const tableColumnDurationTextGroupHeaderViewTag = "nimble-table-column-duration-text-group-header-view";
|
|
@@ -6,12 +6,6 @@ import { styles } from '../../text-base/group-header-view/styles';
|
|
|
6
6
|
* The group header view for displaying duration fields as text.
|
|
7
7
|
*/
|
|
8
8
|
export class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
9
|
-
columnConfigChanged() {
|
|
10
|
-
this.updateText();
|
|
11
|
-
}
|
|
12
|
-
groupHeaderValueChanged() {
|
|
13
|
-
this.updateText();
|
|
14
|
-
}
|
|
15
9
|
updateText() {
|
|
16
10
|
if (this.columnConfig) {
|
|
17
11
|
this.text = this.columnConfig.formatter.format(this.groupHeaderValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/duration-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,kCAG3D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/duration-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,kCAG3D;IACa,UAAU;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAC1C,IAAI,CAAC,gBAAgB,CACxB,CAAC;SACL;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;SAClB;IACL,CAAC;CACJ;AAED,MAAM,sCAAsC,GAAG,sCAAsC,CAAC,OAAO,CAAC;IAC1F,QAAQ,EAAE,8CAA8C;IACxD,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,sCAAsC,EAAE,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,yCAAyC,GAAG,qDAAqD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableNumberFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnDurationTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-duration-text-group-header': TableColumnDurationTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying duration fields as text.\n */\nexport class TableColumnDurationTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableNumberFieldValue,\nTableColumnDurationTextColumnConfig\n> {\n protected updateText(): void {\n if (this.columnConfig) {\n this.text = this.columnConfig.formatter.format(\n this.groupHeaderValue\n );\n } else {\n this.text = '';\n }\n }\n}\n\nconst tableColumnDurationTextGroupHeaderView = TableColumnDurationTextGroupHeaderView.compose({\n baseName: 'table-column-duration-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnDurationTextGroupHeaderView());\nexport const tableColumnDurationTextGroupHeaderViewTag = 'nimble-table-column-duration-text-group-header-view';\n"]}
|
|
@@ -10,8 +10,6 @@ declare global {
|
|
|
10
10
|
* A group header view for enum columns
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableFieldValue, TableColumnEnumColumnConfig> {
|
|
13
|
-
|
|
14
|
-
private groupHeaderValueChanged;
|
|
15
|
-
private updateText;
|
|
13
|
+
protected updateText(): void;
|
|
16
14
|
}
|
|
17
15
|
export declare const tableColumnEnumTextGroupHeaderViewTag = "nimble-table-column-enum-text-group-header-view";
|
|
@@ -7,19 +7,8 @@ import { MappingTextConfig } from '../../enum-base/models/mapping-text-config';
|
|
|
7
7
|
* A group header view for enum columns
|
|
8
8
|
*/
|
|
9
9
|
export class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
10
|
-
columnConfigChanged() {
|
|
11
|
-
this.updateText();
|
|
12
|
-
}
|
|
13
|
-
groupHeaderValueChanged() {
|
|
14
|
-
this.updateText();
|
|
15
|
-
}
|
|
16
10
|
updateText() {
|
|
17
|
-
const
|
|
18
|
-
if (value === undefined || value === null) {
|
|
19
|
-
this.text = '';
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const config = this.columnConfig?.mappingConfigs.get(value);
|
|
11
|
+
const config = this.columnConfig?.mappingConfigs.get(this.groupHeaderValue);
|
|
23
12
|
this.text = config instanceof MappingTextConfig && config.text
|
|
24
13
|
? config.text
|
|
25
14
|
: '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/enum-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4B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AiD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport { template } from '../../text-base/group-header-view/template';\nimport type { TableColumnEnumColumnConfig } from '../../enum-base';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport type { TableFieldValue } from '../../../table/types';\nimport { MappingTextConfig } from '../../enum-base/models/mapping-text-config';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-enum-text-group-header-view': TableColumnEnumTextGroupHeaderView;\n }\n}\n\n/**\n * A group header view for enum columns\n */\nexport class TableColumnEnumTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableFieldValue,\nTableColumnEnumColumnConfig\n> {\n protected updateText(): void {\n const config = this.columnConfig?.mappingConfigs.get(\n this.groupHeaderValue!\n );\n this.text = config instanceof MappingTextConfig && config.text\n ? config.text\n : '';\n }\n}\n\nconst enumTextGroupHeaderView = TableColumnEnumTextGroupHeaderView.compose({\n baseName: 'table-column-enum-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(enumTextGroupHeaderView());\nexport const tableColumnEnumTextGroupHeaderViewTag = 'nimble-table-column-enum-text-group-header-view';\n"]}
|
|
@@ -16,8 +16,6 @@ export declare class TableColumnIconGroupHeaderView extends TableColumnTextGroup
|
|
|
16
16
|
severity: IconSeverity;
|
|
17
17
|
iconTemplate?: ViewTemplate<IconView>;
|
|
18
18
|
visual?: 'spinner' | 'icon';
|
|
19
|
-
|
|
20
|
-
private groupHeaderValueChanged;
|
|
21
|
-
private updateState;
|
|
19
|
+
protected updateText(): void;
|
|
22
20
|
}
|
|
23
21
|
export declare const tableColumnIconGroupHeaderViewTag = "nimble-table-column-icon-group-header-view";
|
|
@@ -10,21 +10,13 @@ import { MappingSpinnerConfig } from '../../enum-base/models/mapping-spinner-con
|
|
|
10
10
|
* The group header view for the icon column
|
|
11
11
|
*/
|
|
12
12
|
export class TableColumnIconGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
13
|
-
|
|
14
|
-
this.updateState();
|
|
15
|
-
}
|
|
16
|
-
groupHeaderValueChanged() {
|
|
17
|
-
this.updateState();
|
|
18
|
-
}
|
|
19
|
-
updateState() {
|
|
13
|
+
updateText() {
|
|
20
14
|
this.visual = undefined;
|
|
21
15
|
if (!this.columnConfig) {
|
|
16
|
+
this.text = '';
|
|
22
17
|
return;
|
|
23
18
|
}
|
|
24
19
|
const value = this.groupHeaderValue;
|
|
25
|
-
if (value === undefined || value === null) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
20
|
const mappingConfig = this.columnConfig.mappingConfigs.get(value);
|
|
29
21
|
if (mappingConfig instanceof MappingIconConfig) {
|
|
30
22
|
this.visual = 'icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/icon/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAgB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AAEvF,OAAO,EACH,iBAAiB,EAEpB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAQrF;;GAEG;AACH,MAAM,OAAO,8BACT,SAAQ,kCAGP;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/icon/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAgB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,M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CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,iCAAiC,GAAG,4CAA4C,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport { ViewTemplate, observable } from '@microsoft/fast-element';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { TableColumnEnumColumnConfig } from '../../enum-base';\nimport type { TableFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport type { IconSeverity } from '../../../icon-base/types';\nimport {\n MappingIconConfig,\n type IconView\n} from '../../enum-base/models/mapping-icon-config';\nimport { MappingSpinnerConfig } from '../../enum-base/models/mapping-spinner-config';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-icon-group-header-view': TableColumnIconGroupHeaderView;\n }\n}\n\n/**\n * The group header view for the icon column\n */\nexport class TableColumnIconGroupHeaderView\n extends TableColumnTextGroupHeaderViewBase<\n TableFieldValue,\n TableColumnEnumColumnConfig\n >\n implements IconView {\n @observable\n public severity: IconSeverity;\n\n @observable\n public iconTemplate?: ViewTemplate<IconView>;\n\n @observable\n public visual?: 'spinner' | 'icon';\n\n protected updateText(): void {\n this.visual = undefined;\n if (!this.columnConfig) {\n this.text = '';\n return;\n }\n const value = this.groupHeaderValue;\n const mappingConfig = this.columnConfig.mappingConfigs.get(value!);\n if (mappingConfig instanceof MappingIconConfig) {\n this.visual = 'icon';\n this.severity = mappingConfig.severity;\n this.text = mappingConfig.text ?? '';\n this.iconTemplate = mappingConfig.iconTemplate;\n } else if (mappingConfig instanceof MappingSpinnerConfig) {\n this.visual = 'spinner';\n this.text = mappingConfig.text ?? '';\n }\n }\n}\n\nconst iconGroupHeaderView = TableColumnIconGroupHeaderView.compose({\n baseName: 'table-column-icon-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate().withPrefix('nimble').register(iconGroupHeaderView());\nexport const tableColumnIconGroupHeaderViewTag = 'nimble-table-column-icon-group-header-view';\n"]}
|
|
@@ -20,5 +20,11 @@ export const template = html `
|
|
|
20
20
|
title="${x => (x.hasOverflow && x.text ? x.text : null)}"
|
|
21
21
|
>${x => x.text}</span>
|
|
22
22
|
`)}
|
|
23
|
+
${when(x => x.visual === undefined, html `
|
|
24
|
+
<span
|
|
25
|
+
${overflow('hasOverflow')}
|
|
26
|
+
title="${x => (x.hasOverflow && x.text ? x.text : null)}"
|
|
27
|
+
>${x => x.text}</span>
|
|
28
|
+
`)}
|
|
23
29
|
`;
|
|
24
30
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/icon/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAgC;MACtD,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,EACxB,IAAI,CAAgC;cAC9B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAa;;kBAEhB,QAAQ,CAAC,aAAa,CAAC;yBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;eACxD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS,CAC9B;MACC,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,EAC3B,IAAI,CAAgC;WACjC,UAAU;qBACA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;0BACN,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;YAEzB,UAAU;;cAER,QAAQ,CAAC,aAAa,CAAC;qBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;WACxD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;KACjB,CACA;CACJ,CAAC","sourcesContent":["import { html, when } from '@microsoft/fast-element';\n\nimport type { TableColumnIconGroupHeaderView } from '.';\nimport { spinnerTag } from '../../../spinner';\nimport { overflow } from '../../../utilities/directive/overflow';\n\n// prettier-ignore\nexport const template = html<TableColumnIconGroupHeaderView>`\n ${when(\n x => x.visual === 'icon',\n html<TableColumnIconGroupHeaderView>`\n ${x => x.iconTemplate!}\n <span \n ${overflow('hasOverflow')}\n title=\"${x => (x.hasOverflow && x.text ? x.text : null)}\"\n >${x => x.text}</span>`\n )}\n ${when(\n x => x.visual === 'spinner',\n html<TableColumnIconGroupHeaderView>`\n <${spinnerTag}\n title=\"${x => x.text}\"\n aria-label=\"${x => x.text}\"\n class=\"no-shrink\">\n </${spinnerTag}>\n <span \n ${overflow('hasOverflow')}\n title=\"${x => (x.hasOverflow && x.text ? x.text : null)}\"\n >${x => x.text}</span>\n `\n )}\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/icon/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAg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View } from '.';\nimport { spinnerTag } from '../../../spinner';\nimport { overflow } from '../../../utilities/directive/overflow';\n\n// prettier-ignore\nexport const template = html<TableColumnIconGroupHeaderView>`\n ${when(\n x => x.visual === 'icon',\n html<TableColumnIconGroupHeaderView>`\n ${x => x.iconTemplate!}\n <span \n ${overflow('hasOverflow')}\n title=\"${x => (x.hasOverflow && x.text ? x.text : null)}\"\n >${x => x.text}</span>`\n )}\n ${when(\n x => x.visual === 'spinner',\n html<TableColumnIconGroupHeaderView>`\n <${spinnerTag}\n title=\"${x => x.text}\"\n aria-label=\"${x => x.text}\"\n class=\"no-shrink\">\n </${spinnerTag}>\n <span \n ${overflow('hasOverflow')}\n title=\"${x => (x.hasOverflow && x.text ? x.text : null)}\"\n >${x => x.text}</span>\n `\n )}\n ${when(\n x => x.visual === undefined,\n html<TableColumnIconGroupHeaderView>`\n <span \n ${overflow('hasOverflow')}\n title=\"${x => (x.hasOverflow && x.text ? x.text : null)}\"\n >${x => x.text}</span>\n `\n )}\n`;\n"]}
|
|
@@ -10,8 +10,6 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying number fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableNumberFieldValue, TableColumnNumberTextColumnConfig> {
|
|
13
|
-
|
|
14
|
-
private groupHeaderValueChanged;
|
|
15
|
-
private updateText;
|
|
13
|
+
protected updateText(): void;
|
|
16
14
|
}
|
|
17
15
|
export declare const tableColumnNumberTextGroupHeaderTag = "nimble-table-column-number-text-group-header-view";
|
|
@@ -6,12 +6,6 @@ import { styles } from '../../text-base/group-header-view/styles';
|
|
|
6
6
|
* The group header view for displaying number fields as text.
|
|
7
7
|
*/
|
|
8
8
|
export class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
9
|
-
columnConfigChanged() {
|
|
10
|
-
this.updateText();
|
|
11
|
-
}
|
|
12
|
-
groupHeaderValueChanged() {
|
|
13
|
-
this.updateText();
|
|
14
|
-
}
|
|
15
9
|
updateText() {
|
|
16
10
|
this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';
|
|
17
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,kCAGzD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,kCAGzD;IACa,UAAU;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAClF,CAAC;CACJ;AAED,MAAM,oCAAoC,GAAG,oCAAoC,CAAC,OAAO,CAAC;IACtF,QAAQ,EAAE,4CAA4C;IACtD,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,oCAAoC,EAAE,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,mCAAmC,GAAG,mDAAmD,CAAC","sourcesContent":["import { DesignSystem } from '@microsoft/fast-foundation';\nimport type { TableNumberFieldValue } from '../../../table/types';\nimport { TableColumnTextGroupHeaderViewBase } from '../../text-base/group-header-view';\nimport { template } from '../../text-base/group-header-view/template';\nimport { styles } from '../../text-base/group-header-view/styles';\nimport type { TableColumnNumberTextColumnConfig } from '..';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-table-column-number-text-group-header': TableColumnNumberTextGroupHeaderView;\n }\n}\n/**\n * The group header view for displaying number fields as text.\n */\nexport class TableColumnNumberTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<\nTableNumberFieldValue,\nTableColumnNumberTextColumnConfig\n> {\n protected updateText(): void {\n this.text = this.columnConfig?.formatter?.format(this.groupHeaderValue) ?? '';\n }\n}\n\nconst tableColumnNumberTextGroupHeaderView = TableColumnNumberTextGroupHeaderView.compose({\n baseName: 'table-column-number-text-group-header-view',\n template,\n styles\n});\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(tableColumnNumberTextGroupHeaderView());\nexport const tableColumnNumberTextGroupHeaderTag = 'nimble-table-column-number-text-group-header-view';\n"]}
|
|
@@ -10,6 +10,6 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying string fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableStringFieldValue, TableColumnTextColumnConfig> {
|
|
13
|
-
|
|
13
|
+
protected updateText(): void;
|
|
14
14
|
}
|
|
15
15
|
export declare const tableColumnTextGroupHeaderViewTag = "nimble-table-column-text-group-header-view";
|
|
@@ -6,7 +6,7 @@ import { styles } from '../../text-base/group-header-view/styles';
|
|
|
6
6
|
* The group header view for displaying string fields as text.
|
|
7
7
|
*/
|
|
8
8
|
export class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
9
|
-
|
|
9
|
+
updateText() {
|
|
10
10
|
this.text = typeof this.groupHeaderValue === 'string'
|
|
11
11
|
? this.groupHeaderValue
|
|
12
12
|
: '';
|