@ni/nimble-components 11.0.4 → 11.2.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 +2727 -1823
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1473 -1234
- 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/index.d.ts +3 -0
- package/dist/esm/number-field/index.js +37 -3
- package/dist/esm/number-field/index.js.map +1 -1
- package/dist/esm/number-field/styles.js +50 -22
- package/dist/esm/number-field/styles.js.map +1 -1
- package/dist/esm/number-field/types.d.ts +9 -0
- package/dist/esm/number-field/types.js +9 -0
- package/dist/esm/number-field/types.js.map +1 -0
- 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 +7 -55
- package/dist/esm/text-field/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -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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C5B,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":""}
|
|
@@ -1,193 +1,6 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
|
-
import {
|
|
3
|
-
import { applicationBackgroundColor, bodyFont, bodyFontColor, bodyDisabledFontColor, borderHoverColor, borderWidth, controlHeight, iconSize, popupBorderColor, popupBoxShadowColor, smallDelay, smallPadding } from '../theme-provider/design-tokens';
|
|
4
|
-
import { focusVisible } from '../utilities/style/focus';
|
|
2
|
+
import { styles as dropdownStyles } from '../patterns/dropdown/styles';
|
|
5
3
|
export const styles = css `
|
|
6
|
-
${
|
|
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: 2px;
|
|
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: 100%;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host::after {
|
|
50
|
-
content: '';
|
|
51
|
-
position: absolute;
|
|
52
|
-
bottom: 0px;
|
|
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
|
-
@media (prefers-reduced-motion) {
|
|
62
|
-
:host::after {
|
|
63
|
-
transition-duration: 0s;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
:host(:hover)::after,
|
|
68
|
-
:host(${focusVisible})::after {
|
|
69
|
-
width: 100%;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:host([disabled]:hover)::after {
|
|
73
|
-
width: 0px;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.control {
|
|
77
|
-
align-items: center;
|
|
78
|
-
box-sizing: border-box;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
display: flex;
|
|
81
|
-
min-height: 100%;
|
|
82
|
-
width: 100%;
|
|
83
|
-
border-bottom: ${borderWidth} solid ${bodyDisabledFontColor};
|
|
84
|
-
background-color: transparent;
|
|
85
|
-
padding-left: 8px;
|
|
86
|
-
padding-bottom: 1px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
:host([disabled]) .control {
|
|
90
|
-
cursor: default;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
:host(.open:not(:hover)) .control {
|
|
94
|
-
border-bottom-color: ${borderHoverColor};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([disabled]) .control,
|
|
98
|
-
:host([disabled]) .control:hover {
|
|
99
|
-
border-bottom-color: ${bodyDisabledFontColor};
|
|
100
|
-
color: ${bodyDisabledFontColor};
|
|
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: 1 1 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: 0 0 auto;
|
|
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: 0 0 auto;
|
|
191
|
-
}
|
|
4
|
+
${dropdownStyles}
|
|
192
5
|
`;
|
|
193
6
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,cAAc;CACnB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TextField as FoundationTextField } from '@microsoft/fast-foundation';
|
|
2
|
+
import '../icons/exclamation-mark';
|
|
2
3
|
import { TextFieldAppearance } from './types';
|
|
4
|
+
import type { IHasErrorText } from '../patterns/error/types';
|
|
3
5
|
declare global {
|
|
4
6
|
interface HTMLElementTagNameMap {
|
|
5
7
|
'nimble-text-field': TextField;
|
|
@@ -8,7 +10,7 @@ declare global {
|
|
|
8
10
|
/**
|
|
9
11
|
* A nimble-styed HTML text input
|
|
10
12
|
*/
|
|
11
|
-
export declare class TextField extends FoundationTextField {
|
|
13
|
+
export declare class TextField extends FoundationTextField implements IHasErrorText {
|
|
12
14
|
/**
|
|
13
15
|
* The appearance the text field should have.
|
|
14
16
|
*
|
|
@@ -24,6 +26,6 @@ export declare class TextField extends FoundationTextField {
|
|
|
24
26
|
* @remarks
|
|
25
27
|
* HTML Attribute: error-text
|
|
26
28
|
*/
|
|
27
|
-
errorText: string;
|
|
29
|
+
errorText: string | undefined;
|
|
28
30
|
connectedCallback(): void;
|
|
29
31
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr, html } from '@microsoft/fast-element';
|
|
3
3
|
import { DesignSystem, TextField as FoundationTextField, textFieldTemplate as template } from '@microsoft/fast-foundation';
|
|
4
|
-
import
|
|
4
|
+
import '../icons/exclamation-mark';
|
|
5
5
|
import { styles } from './styles';
|
|
6
6
|
import { TextFieldAppearance } from './types';
|
|
7
|
+
import { errorTextTemplate } from '../patterns/error/template';
|
|
7
8
|
/**
|
|
8
9
|
* A nimble-styed HTML text input
|
|
9
10
|
*/
|
|
@@ -39,18 +40,13 @@ const nimbleTextField = TextField.compose({
|
|
|
39
40
|
delegatesFocus: true
|
|
40
41
|
},
|
|
41
42
|
end: html `
|
|
42
|
-
<
|
|
43
|
+
<nimble-icon-exclamation-mark
|
|
44
|
+
class="error-icon fail"
|
|
45
|
+
></nimble-icon-exclamation-mark>
|
|
43
46
|
<span part="actions">
|
|
44
47
|
<slot name="actions"></slot>
|
|
45
48
|
</span>
|
|
46
|
-
|
|
47
|
-
id="errortext"
|
|
48
|
-
class="errortext error-content"
|
|
49
|
-
title="${x => x.errorText}"
|
|
50
|
-
aria-live="polite"
|
|
51
|
-
>
|
|
52
|
-
${x => x.errorText}
|
|
53
|
-
</div>
|
|
49
|
+
${errorTextTemplate}
|
|
54
50
|
`
|
|
55
51
|
});
|
|
56
52
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleTextField());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-field/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,SAAS,IAAI,mBAAmB,EAEhC,iBAAiB,IAAI,QAAQ,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-field/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,SAAS,IAAI,mBAAmB,EAEhC,iBAAiB,IAAI,QAAQ,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAS/D;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,mBAAmB;IAAlD;;QACI;;;;;;WAMG;QAEI,eAAU,GAAwB,mBAAmB,CAAC,SAAS,CAAC;IAgB3E,CAAC;IAJmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IAChE,CAAC;CACJ;AAhBG;IADC,IAAI;6CACkE;AAUvE;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;4CACG;AAQzC,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAmB;IACxD,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,mBAAmB;IAC9B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;IACD,GAAG,EAAE,IAAI,CAAW;;;;;;;UAOd,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { display } from '@microsoft/fast-foundation';
|
|
3
|
-
import { borderRgbPartialColor, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight,
|
|
3
|
+
import { borderRgbPartialColor, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, failColor, fillSelectedRgbPartialColor, labelHeight, smallDelay, controlLabelFont, bodyFont, controlLabelFontColor, controlLabelDisabledFontColor, standardPadding } from '../theme-provider/design-tokens';
|
|
4
4
|
import { appearanceBehavior } from '../utilities/style/appearance';
|
|
5
5
|
import { TextFieldAppearance } from './types';
|
|
6
6
|
import { Theme } from '../theme-provider/types';
|
|
7
7
|
import { themeBehavior } from '../utilities/style/theme';
|
|
8
|
+
import { styles as errorStyles } from '../patterns/error/styles';
|
|
8
9
|
export const styles = css `
|
|
9
10
|
${display('inline-block')}
|
|
11
|
+
${errorStyles}
|
|
10
12
|
|
|
11
13
|
:host {
|
|
12
14
|
font: ${bodyFont};
|
|
@@ -48,10 +50,6 @@ export const styles = css `
|
|
|
48
50
|
gap: calc(${standardPadding} / 2);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
:host(.invalid) .root {
|
|
52
|
-
border-bottom-color: ${failColor};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
53
|
:host([readonly]) .root {
|
|
56
54
|
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
57
55
|
}
|
|
@@ -60,6 +58,10 @@ export const styles = css `
|
|
|
60
58
|
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
61
59
|
}
|
|
62
60
|
|
|
61
|
+
:host(.invalid) .root {
|
|
62
|
+
border-bottom-color: ${failColor};
|
|
63
|
+
}
|
|
64
|
+
|
|
63
65
|
.root:focus-within {
|
|
64
66
|
border-bottom-color: ${borderHoverColor};
|
|
65
67
|
}
|
|
@@ -181,52 +183,6 @@ export const styles = css `
|
|
|
181
183
|
width: 0px;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
|
-
.error-content {
|
|
185
|
-
display: none;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
:host(.invalid) .error-content {
|
|
189
|
-
display: contents;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
:host(.invalid) .error-content svg {
|
|
193
|
-
height: ${iconSize};
|
|
194
|
-
width: ${iconSize};
|
|
195
|
-
flex: none;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
:host(.invalid) .error-content path {
|
|
199
|
-
fill: ${failColor};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
:host([disabled]) .error-content path {
|
|
203
|
-
fill: ${bodyDisabledFontColor};
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.errortext {
|
|
207
|
-
display: none;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
:host(.invalid) .errortext {
|
|
211
|
-
display: block;
|
|
212
|
-
font: ${errorTextFont};
|
|
213
|
-
color: ${failColor};
|
|
214
|
-
width: 100%;
|
|
215
|
-
position: absolute;
|
|
216
|
-
top: ${controlHeight};
|
|
217
|
-
overflow: hidden;
|
|
218
|
-
text-overflow: ellipsis;
|
|
219
|
-
white-space: nowrap;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
:host(.invalid) .error-text:empty {
|
|
223
|
-
display: none;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
:host([disabled]) .errortext {
|
|
227
|
-
color: ${bodyDisabledFontColor};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
186
|
[part='actions'] {
|
|
231
187
|
display: contents;
|
|
232
188
|
}
|
|
@@ -281,10 +237,6 @@ export const styles = css `
|
|
|
281
237
|
.control {
|
|
282
238
|
height: var(--ni-private-height-within-border);
|
|
283
239
|
}
|
|
284
|
-
|
|
285
|
-
:host(.invalid) .errortext {
|
|
286
|
-
top: calc(${controlHeight} - ${borderWidth});
|
|
287
|
-
}
|
|
288
240
|
`), appearanceBehavior(TextFieldAppearance.frameless, css `
|
|
289
241
|
.control {
|
|
290
242
|
padding-left: ${borderWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,2BAA2B,EAC3B,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAA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