@ni/nimble-components 11.0.4 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +6972 -6133
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1477 -1283
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +41 -0
- package/dist/esm/combobox/index.js +136 -0
- package/dist/esm/combobox/index.js.map +1 -0
- package/dist/esm/combobox/styles.d.ts +1 -0
- package/dist/esm/combobox/styles.js +87 -0
- package/dist/esm/combobox/styles.js.map +1 -0
- package/dist/esm/combobox/types.d.ts +2 -0
- package/dist/esm/combobox/types.js +3 -0
- package/dist/esm/combobox/types.js.map +1 -0
- package/dist/esm/number-field/styles.js +1 -0
- package/dist/esm/number-field/styles.js.map +1 -1
- package/dist/esm/patterns/dropdown/styles.d.ts +1 -0
- package/dist/esm/patterns/dropdown/styles.js +193 -0
- package/dist/esm/patterns/dropdown/styles.js.map +1 -0
- package/dist/esm/patterns/dropdown/types.d.ts +5 -0
- package/dist/esm/patterns/dropdown/types.js +6 -0
- package/dist/esm/patterns/dropdown/types.js.map +1 -0
- package/dist/esm/patterns/error/styles.d.ts +1 -0
- package/dist/esm/patterns/error/styles.js +40 -0
- package/dist/esm/patterns/error/styles.js.map +1 -0
- package/dist/esm/patterns/error/template.d.ts +2 -0
- package/dist/esm/patterns/error/template.js +7 -0
- package/dist/esm/patterns/error/template.js.map +1 -0
- package/dist/esm/patterns/error/types.d.ts +9 -0
- package/dist/esm/patterns/error/types.js +2 -0
- package/dist/esm/patterns/error/types.js.map +1 -0
- package/dist/esm/select/styles.js +2 -189
- package/dist/esm/select/styles.js.map +1 -1
- package/dist/esm/text-field/index.d.ts +4 -2
- package/dist/esm/text-field/index.js +6 -10
- package/dist/esm/text-field/index.js.map +1 -1
- package/dist/esm/text-field/styles.js +8 -55
- package/dist/esm/text-field/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Combobox as FoundationCombobox } from '@microsoft/fast-foundation';
|
|
2
|
+
import type { ToggleButton } from '../toggle-button';
|
|
3
|
+
import '../icons/exclamation-mark';
|
|
4
|
+
import '../icons/arrow-expander-down';
|
|
5
|
+
import type { IHasErrorText } from '../patterns/error/types';
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'nimble-combobox': Combobox;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A nimble-styed HTML combobox
|
|
13
|
+
*/
|
|
14
|
+
export declare class Combobox extends FoundationCombobox implements IHasErrorText {
|
|
15
|
+
/**
|
|
16
|
+
* The ref to the internal dropdown button element.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
readonly dropdownButton: ToggleButton | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* A message explaining why the value is invalid.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
* @remarks
|
|
26
|
+
* HTML Attribute: error-text
|
|
27
|
+
*/
|
|
28
|
+
errorText: string | undefined;
|
|
29
|
+
setPositioning(): void;
|
|
30
|
+
slottedOptionsChanged(prev: HTMLElement[], next: HTMLElement[]): void;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
toggleButtonClickHandler(e: Event): void;
|
|
34
|
+
toggleButtonChangeHandler(e: Event): void;
|
|
35
|
+
toggleButtonKeyDownHandler(e: KeyboardEvent): boolean;
|
|
36
|
+
filterOptions(): void;
|
|
37
|
+
protected openChanged(): void;
|
|
38
|
+
private ariaLabelChanged;
|
|
39
|
+
private updateInputAriaLabel;
|
|
40
|
+
private readonly focusOutHandler;
|
|
41
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, html, observable, ref } from '@microsoft/fast-element';
|
|
3
|
+
import { DesignSystem, Combobox as FoundationCombobox, comboboxTemplate as template } from '@microsoft/fast-foundation';
|
|
4
|
+
import { keyArrowDown, keyArrowUp, keyEnter, keySpace } from '@microsoft/fast-web-utilities';
|
|
5
|
+
import { errorTextTemplate } from '../patterns/error/template';
|
|
6
|
+
import '../icons/exclamation-mark';
|
|
7
|
+
import '../icons/arrow-expander-down';
|
|
8
|
+
import { styles } from './styles';
|
|
9
|
+
/**
|
|
10
|
+
* A nimble-styed HTML combobox
|
|
11
|
+
*/
|
|
12
|
+
export class Combobox extends FoundationCombobox {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.focusOutHandler = () => {
|
|
16
|
+
this.open = false;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
// Workaround for https://github.com/microsoft/fast/issues/5123
|
|
20
|
+
setPositioning() {
|
|
21
|
+
if (!this.$fastController.isConnected) {
|
|
22
|
+
// Don't call setPositioning() until we're connected,
|
|
23
|
+
// since this.forcedPosition isn't initialized yet.
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
super.setPositioning();
|
|
27
|
+
}
|
|
28
|
+
// Workaround for https://github.com/microsoft/fast/issues/5773
|
|
29
|
+
slottedOptionsChanged(prev, next) {
|
|
30
|
+
const value = this.value;
|
|
31
|
+
super.slottedOptionsChanged(prev, next);
|
|
32
|
+
if (value) {
|
|
33
|
+
this.value = value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
// Call setPositioning() after this.forcedPosition is initialized.
|
|
39
|
+
this.setPositioning();
|
|
40
|
+
this.updateInputAriaLabel();
|
|
41
|
+
this.addEventListener('focusout', this.focusOutHandler);
|
|
42
|
+
}
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
this.removeEventListener('focusout', this.focusOutHandler);
|
|
45
|
+
}
|
|
46
|
+
toggleButtonClickHandler(e) {
|
|
47
|
+
e.stopImmediatePropagation();
|
|
48
|
+
}
|
|
49
|
+
toggleButtonChangeHandler(e) {
|
|
50
|
+
this.open = this.dropdownButton.checked;
|
|
51
|
+
e.stopImmediatePropagation();
|
|
52
|
+
}
|
|
53
|
+
toggleButtonKeyDownHandler(e) {
|
|
54
|
+
switch (e.key) {
|
|
55
|
+
case keyArrowUp:
|
|
56
|
+
case keyArrowDown:
|
|
57
|
+
case keySpace:
|
|
58
|
+
case keyEnter:
|
|
59
|
+
this.open = true;
|
|
60
|
+
this.stopPropagation(e);
|
|
61
|
+
return false;
|
|
62
|
+
default:
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
filterOptions() {
|
|
67
|
+
super.filterOptions();
|
|
68
|
+
const enabledOptions = this.filteredOptions.filter(o => !o.disabled);
|
|
69
|
+
this.filteredOptions = enabledOptions;
|
|
70
|
+
}
|
|
71
|
+
openChanged() {
|
|
72
|
+
super.openChanged();
|
|
73
|
+
if (this.dropdownButton) {
|
|
74
|
+
this.dropdownButton.checked = this.open;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Workaround for https://github.com/microsoft/fast/issues/6041.
|
|
78
|
+
ariaLabelChanged(_oldValue, _newValue) {
|
|
79
|
+
this.updateInputAriaLabel();
|
|
80
|
+
}
|
|
81
|
+
updateInputAriaLabel() {
|
|
82
|
+
const inputElement = this.shadowRoot?.querySelector('.selected-value');
|
|
83
|
+
if (this.ariaLabel) {
|
|
84
|
+
inputElement?.setAttribute('aria-label', this.ariaLabel);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
inputElement?.removeAttribute('aria-label');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
__decorate([
|
|
92
|
+
observable
|
|
93
|
+
], Combobox.prototype, "dropdownButton", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
attr({ attribute: 'error-text' })
|
|
96
|
+
], Combobox.prototype, "errorText", void 0);
|
|
97
|
+
const nimbleCombobox = Combobox.compose({
|
|
98
|
+
baseName: 'combobox',
|
|
99
|
+
baseClass: FoundationCombobox,
|
|
100
|
+
template,
|
|
101
|
+
styles,
|
|
102
|
+
shadowOptions: {
|
|
103
|
+
delegatesFocus: true
|
|
104
|
+
},
|
|
105
|
+
end: html `
|
|
106
|
+
<div class="end-slot-container">
|
|
107
|
+
<nimble-icon-exclamation-mark
|
|
108
|
+
class="error-icon fail"
|
|
109
|
+
></nimble-icon-exclamation-mark>
|
|
110
|
+
<div class="separator"></div>
|
|
111
|
+
<nimble-toggle-button
|
|
112
|
+
${ref('dropdownButton')}
|
|
113
|
+
appearance="ghost"
|
|
114
|
+
?checked="${x => x.open}"
|
|
115
|
+
?disabled="${x => x.disabled}"
|
|
116
|
+
content-hidden="true"
|
|
117
|
+
@click="${(x, c) => x.toggleButtonClickHandler(c.event)}"
|
|
118
|
+
@change="${(x, c) => x.toggleButtonChangeHandler(c.event)}"
|
|
119
|
+
@keydown="${(x, c) => x.toggleButtonKeyDownHandler(c.event)}"
|
|
120
|
+
class="dropdown-button"
|
|
121
|
+
part="button"
|
|
122
|
+
aria-haspopup="true"
|
|
123
|
+
aria-expanded="${x => x.open}"
|
|
124
|
+
>
|
|
125
|
+
<nimble-icon-arrow-expander-down
|
|
126
|
+
slot="start"
|
|
127
|
+
class="dropdown-icon"
|
|
128
|
+
>
|
|
129
|
+
</nimble-icon-arrow-expander-down>
|
|
130
|
+
</nimble-toggle-button>
|
|
131
|
+
</div>
|
|
132
|
+
${errorTextTemplate}
|
|
133
|
+
`
|
|
134
|
+
});
|
|
135
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCombobox());
|
|
136
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,EAE9B,gBAAgB,IAAI,QAAQ,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACX,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,kBAAkB;IAAhD;;QAwGqB,oBAAe,GAAG,GAAS,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACtB,CAAC,CAAC;IACN,CAAC;IAxFG,+DAA+D;IAC/C,cAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YACnC,qDAAqD;YACrD,mDAAmD;YACnD,OAAO;SACV;QACD,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3B,CAAC;IAED,+DAA+D;IAC/C,qBAAqB,CACjC,IAAmB,EACnB,IAAmB;QAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC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C,CAAC,KAAsB,CAAC;;;;iCAI3D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;;;;;;;;UASlC,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { controlHeight, failColor, bodyDisabledFontColor, borderRgbPartialColor, smallPadding } from '../theme-provider/design-tokens';
|
|
3
|
+
import { styles as dropdownStyles } from '../patterns/dropdown/styles';
|
|
4
|
+
import { styles as errorStyles } from '../patterns/error/styles';
|
|
5
|
+
import { focusVisible } from '../utilities/style/focus';
|
|
6
|
+
export const styles = css `
|
|
7
|
+
${dropdownStyles}
|
|
8
|
+
${errorStyles}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
--ni-private-hover-bottom-border-width: 2px;
|
|
12
|
+
--ni-private-bottom-border-width: 1px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([disabled]) *,
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
user-select: none;
|
|
18
|
+
color: ${bodyDisabledFontColor};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.control {
|
|
22
|
+
bottom-border-width: var(--ni-private-bottom-border-width);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(.invalid) .control {
|
|
26
|
+
border-bottom: var(--ni-private-bottom-border-width) solid ${failColor};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([disabled]) .control {
|
|
30
|
+
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host(.invalid[disabled]) .control {
|
|
34
|
+
border-color: ${failColor};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.selected-value {
|
|
38
|
+
-webkit-appearance: none;
|
|
39
|
+
background: transparent;
|
|
40
|
+
border: none;
|
|
41
|
+
color: inherit;
|
|
42
|
+
margin: auto 0;
|
|
43
|
+
width: 100%;
|
|
44
|
+
font-size: inherit;
|
|
45
|
+
padding-left: 0px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.selected-value:hover,
|
|
49
|
+
.selected-value:disabled,
|
|
50
|
+
.selected-value:active,
|
|
51
|
+
.selected-value${focusVisible} {
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[part='indicator'] {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.end-slot-container {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: baseline;
|
|
62
|
+
padding-right: ${smallPadding};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.separator {
|
|
66
|
+
display: inline;
|
|
67
|
+
width: 2px;
|
|
68
|
+
border-right: 2px solid rgba(${borderRgbPartialColor}, 0.15);
|
|
69
|
+
height: calc(${controlHeight} - 12px);
|
|
70
|
+
align-self: center;
|
|
71
|
+
padding-left: 4px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dropdown-button {
|
|
75
|
+
${controlHeight.cssCustomProperty}: 24px;
|
|
76
|
+
margin-left: ${smallPadding};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([disabled]) .dropdown-icon {
|
|
80
|
+
fill: ${bodyDisabledFontColor};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host(:empty) .listbox {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/combobox/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,EACf,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,cAAc;MACd,WAAW;;;;;;;;;;iBAUA,qBAAqB;;;;;;;;qEAQ+B,SAAS;;;;6BAIjD,qBAAqB;;;;wBAI1B,SAAS;;;;;;;;;;;;;;;;;qBAiBZ,YAAY;;;;;;;;;;;yBAWR,YAAY;;;;;;uCAME,qBAAqB;uBACrC,aAAa;;;;;;UAM1B,aAAa,CAAC,iBAAiB;uBAClB,YAAY;;;;gBAInB,qBAAqB;;;;;;CAMpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/combobox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/number-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,2BAA2B,EAC3B,QAAQ,EACR,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,UAAU,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;;;+BAUP,SAAS;;;;;;;;;;;;;;;;;;;;uBAoBjB,aAAa,MAAM,WAAW;;;;;;;;;;;;;;iBAcpC,qBAAqB;2BACX,2BAA2B;;;;iBAIrC,qBAAqB;;;;;;;;iBAQrB,qBAAqB;;;;;;;;;;;;;;;;;;;;kBAoBpB,QAAQ;iBACT,QAAQ;gBACT,WAAW;;CAE1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
3
|
+
import { applicationBackgroundColor, bodyFont, bodyFontColor, bodyDisabledFontColor, borderHoverColor, borderWidth, controlHeight, iconSize, popupBorderColor, popupBoxShadowColor, smallDelay, smallPadding, failColor, borderRgbPartialColor } from '../../theme-provider/design-tokens';
|
|
4
|
+
import { focusVisible } from '../../utilities/style/focus';
|
|
5
|
+
export const styles = css `
|
|
6
|
+
${display('inline-flex')}
|
|
7
|
+
|
|
8
|
+
:host {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
color: ${bodyFontColor};
|
|
11
|
+
font: ${bodyFont};
|
|
12
|
+
height: ${controlHeight};
|
|
13
|
+
position: relative;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
user-select: none;
|
|
16
|
+
min-width: 250px;
|
|
17
|
+
outline: none;
|
|
18
|
+
vertical-align: top;
|
|
19
|
+
--ni-private-hover-indicator-width: calc(${borderWidth} + 1px);
|
|
20
|
+
--ni-private-focus-indicator-width: 1px;
|
|
21
|
+
--ni-private-indicator-lines-gap: 1px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host::before {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
bottom: calc(
|
|
28
|
+
var(--ni-private-hover-indicator-width) +
|
|
29
|
+
var(--ni-private-indicator-lines-gap)
|
|
30
|
+
);
|
|
31
|
+
width: 0px;
|
|
32
|
+
height: 0px;
|
|
33
|
+
justify-self: center;
|
|
34
|
+
border-bottom: ${borderHoverColor}
|
|
35
|
+
var(--ni-private-focus-indicator-width) solid;
|
|
36
|
+
transition: width ${smallDelay} ease-in;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (prefers-reduced-motion) {
|
|
40
|
+
:host::before {
|
|
41
|
+
transition-duration: 0s;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host(${focusVisible})::before {
|
|
46
|
+
width: calc(100% - 8px);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host::after {
|
|
50
|
+
content: '';
|
|
51
|
+
position: absolute;
|
|
52
|
+
bottom: calc(-1 * ${borderWidth});
|
|
53
|
+
width: 0px;
|
|
54
|
+
height: 0px;
|
|
55
|
+
justify-self: center;
|
|
56
|
+
border-bottom: ${borderHoverColor}
|
|
57
|
+
var(--ni-private-hover-indicator-width) solid;
|
|
58
|
+
transition: width ${smallDelay} ease-in;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host(.invalid)::after {
|
|
62
|
+
border-bottom-color: ${failColor};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media (prefers-reduced-motion) {
|
|
66
|
+
:host::after {
|
|
67
|
+
transition-duration: 0s;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host(:hover)::after,
|
|
72
|
+
:host(${focusVisible})::after {
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([disabled]:hover)::after {
|
|
77
|
+
width: 0px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.control {
|
|
81
|
+
align-items: center;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
display: flex;
|
|
85
|
+
min-height: 100%;
|
|
86
|
+
width: 100%;
|
|
87
|
+
border-bottom: ${borderWidth} solid ${bodyDisabledFontColor};
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
padding-left: 8px;
|
|
90
|
+
padding-bottom: 1px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host(.open:not(:hover)) .control {
|
|
94
|
+
border-bottom-color: ${borderHoverColor};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([disabled]) .control {
|
|
98
|
+
cursor: default;
|
|
99
|
+
color: ${bodyDisabledFontColor};
|
|
100
|
+
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.listbox {
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
left: 0;
|
|
108
|
+
overflow-y: auto;
|
|
109
|
+
position: absolute;
|
|
110
|
+
width: 100%;
|
|
111
|
+
--ni-private-listbox-padding: ${smallPadding};
|
|
112
|
+
max-height: calc(
|
|
113
|
+
var(--ni-private-select-max-height) - 2 *
|
|
114
|
+
var(--ni-private-listbox-padding)
|
|
115
|
+
);
|
|
116
|
+
z-index: 1;
|
|
117
|
+
padding: var(--ni-private-listbox-padding);
|
|
118
|
+
box-shadow: 0px 3px 3px ${popupBoxShadowColor};
|
|
119
|
+
border: 1px solid ${popupBorderColor};
|
|
120
|
+
background-color: ${applicationBackgroundColor};
|
|
121
|
+
background-clip: padding-box;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.listbox[hidden] {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([open][position='above']) .listbox {
|
|
129
|
+
border-bottom-left-radius: 0;
|
|
130
|
+
border-bottom-right-radius: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([open][position='below']) .listbox {
|
|
134
|
+
border-top-left-radius: 0;
|
|
135
|
+
border-top-right-radius: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([open][position='above']) .listbox {
|
|
139
|
+
bottom: ${controlHeight};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([open][position='below']) .listbox {
|
|
143
|
+
top: calc(${controlHeight} + ${smallPadding});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.selected-value {
|
|
147
|
+
flex: auto;
|
|
148
|
+
font-family: inherit;
|
|
149
|
+
text-align: start;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
text-overflow: ellipsis;
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.indicator {
|
|
156
|
+
flex: none;
|
|
157
|
+
margin-inline-start: 1em;
|
|
158
|
+
padding-right: 8px;
|
|
159
|
+
display: flex;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
align-items: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.indicator slot[name='indicator'] svg {
|
|
165
|
+
width: ${iconSize};
|
|
166
|
+
height: ${iconSize};
|
|
167
|
+
fill: ${bodyFontColor};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:host([disabled]) .indicator slot[name='indicator'] svg {
|
|
171
|
+
fill: ${bodyDisabledFontColor};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
slot[name='listbox'] {
|
|
175
|
+
display: none;
|
|
176
|
+
width: 100%;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:host([open]) slot[name='listbox'] {
|
|
180
|
+
display: flex;
|
|
181
|
+
position: absolute;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.end {
|
|
185
|
+
margin-inline-start: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
::slotted([role='option']),
|
|
189
|
+
::slotted(option) {
|
|
190
|
+
flex: none;
|
|
191
|
+
}
|
|
192
|
+
`;
|
|
193
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,qBAAqB,EACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;;iBAIX,aAAa;gBACd,QAAQ;kBACN,aAAa;;;;;;;mDAOoB,WAAW;;;;;;;;;;;;;;;yBAerC,gBAAgB;;4BAEb,UAAU;;;;;;;;;YAS1B,YAAY;;;;;;;4BAOI,WAAW;;;;yBAId,gBAAgB;;4BAEb,UAAU;;;;+BAIP,SAAS;;;;;;;;;;YAU5B,YAAY;;;;;;;;;;;;;;;yBAeC,WAAW,UAAU,qBAAqB;;;;;;;+BAOpC,gBAAgB;;;;;iBAK9B,qBAAqB;6BACT,qBAAqB;;;;;;;;;;;wCAWV,YAAY;;;;;;;kCAOlB,mBAAmB;4BACzB,gBAAgB;4BAChB,0BAA0B;;;;;;;;;;;;;;;;;;;kBAmBpC,aAAa;;;;oBAIX,aAAa,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;iBAsBlC,QAAQ;kBACP,QAAQ;gBACV,aAAa;;;;gBAIb,qBAAqB;;;;;;;;;;;;;;;;;;;;;CAqBpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,cAAc,CAAC,KAAK;IAC3B,KAAK,EAAE,cAAc,CAAC,KAAK;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { controlHeight, failColor, errorTextFont, borderWidth, iconSize } from '../../theme-provider/design-tokens';
|
|
3
|
+
export const styles = css `
|
|
4
|
+
.error-icon {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host(.invalid) .error-icon {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
width: ${iconSize};
|
|
11
|
+
height: ${iconSize};
|
|
12
|
+
flex: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.error-text {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host(.invalid) .error-text {
|
|
20
|
+
display: block;
|
|
21
|
+
font: ${errorTextFont};
|
|
22
|
+
color: ${failColor};
|
|
23
|
+
width: 100%;
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: ${controlHeight};
|
|
26
|
+
left: 0px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host(.invalid[readonly]:not([disabled])) .error-text {
|
|
33
|
+
top: calc(${controlHeight} - ${borderWidth});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host(.invalid) .error-text:empty {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/error/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACH,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACX,MAAM,oCAAoC,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;iBAOR,QAAQ;kBACP,QAAQ;;;;;;;;;;gBAUV,aAAa;iBACZ,SAAS;;;eAGX,aAAa;;;;;;;;oBAQR,aAAa,MAAM,WAAW;;;;;;CAMjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/patterns/error/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAe;qCACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;UAC3C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;;CAEzB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface should be used by components that want to leverage the errorTextTemplate defined in templates.ts
|
|
3
|
+
*/
|
|
4
|
+
export interface IHasErrorText {
|
|
5
|
+
/**
|
|
6
|
+
* The error text that will be displayed when a component has the 'invalid' class set
|
|
7
|
+
*/
|
|
8
|
+
errorText: string | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/error/types.ts"],"names":[],"mappings":""}
|