@noctuatech/uswds 1.4.3 → 1.4.5
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/package.json +6 -6
- package/src/lib/file-input/file-input.element.test.ts +128 -0
- package/src/lib/file-input/file-input.element.ts +39 -3
- package/src/lib/modal/modal.element.test.ts +25 -0
- package/src/lib/modal/modal.element.ts +7 -1
- package/src/lib/search/search.element.ts +15 -12
- package/target/lib/file-input/file-input.element.js +33 -3
- package/target/lib/file-input/file-input.element.js.map +1 -1
- package/target/lib/file-input/file-input.element.test.js +87 -0
- package/target/lib/file-input/file-input.element.test.js.map +1 -1
- package/target/lib/modal/modal.element.d.ts +1 -0
- package/target/lib/modal/modal.element.js +5 -1
- package/target/lib/modal/modal.element.js.map +1 -1
- package/target/lib/modal/modal.element.test.js +8 -0
- package/target/lib/modal/modal.element.test.js.map +1 -1
- package/target/lib/search/search.element.d.ts +1 -1
- package/target/lib/search/search.element.js +10 -10
- package/target/lib/search/search.element.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctuatech/uswds",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/**"
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@11ty/eleventy": "^3.0.0",
|
|
115
|
-
"@chromatic-com/storybook": "^4.
|
|
115
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
116
116
|
"@open-wc/testing": "^4.0.0",
|
|
117
|
-
"@storybook/addon-docs": "^
|
|
118
|
-
"@storybook/web-components-vite": "^
|
|
117
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
118
|
+
"@storybook/web-components-vite": "^10.0.7",
|
|
119
119
|
"@testing-library/dom": "^10.4.0",
|
|
120
120
|
"@testing-library/user-event": "^14.6.1",
|
|
121
121
|
"@types/mocha": "^10.0.7",
|
|
122
|
-
"@types/node": "^
|
|
122
|
+
"@types/node": "^24.0.0",
|
|
123
123
|
"@uswds/uswds": "^3.10.0",
|
|
124
124
|
"@web/dev-server-import-maps": "^0.2.1",
|
|
125
125
|
"@web/test-runner": "^0.20.0",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"mocha": "^11.0.0",
|
|
132
132
|
"plop": "^4.0.1",
|
|
133
133
|
"prettier": "^3.5.3",
|
|
134
|
-
"storybook": "^
|
|
134
|
+
"storybook": "^10.0.7",
|
|
135
135
|
"typescript": "^5.8.0",
|
|
136
136
|
"wireit": "^0.14.9"
|
|
137
137
|
},
|
|
@@ -69,4 +69,132 @@ describe('usa-file-input', () => {
|
|
|
69
69
|
assert.equal(fileInput.files?.length, 1);
|
|
70
70
|
assert.equal(fileInput.files?.[0].name, 'test.txt');
|
|
71
71
|
});
|
|
72
|
+
|
|
73
|
+
it('should fire input event when a file is dragged and dropped', async () => {
|
|
74
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
75
|
+
<usa-file-input> Input accepts a single file </usa-file-input>
|
|
76
|
+
`);
|
|
77
|
+
|
|
78
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
79
|
+
|
|
80
|
+
assert.isOk(nativeInput);
|
|
81
|
+
|
|
82
|
+
// Create a spy to track input events
|
|
83
|
+
let inputEventFired = false;
|
|
84
|
+
fileInput.addEventListener('input', () => {
|
|
85
|
+
inputEventFired = true;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Simulate drag and drop with a file
|
|
89
|
+
const data = new DataTransfer();
|
|
90
|
+
data.items.add(new File([], 'test.txt'));
|
|
91
|
+
|
|
92
|
+
const dropEvent = new DragEvent('drop', {
|
|
93
|
+
dataTransfer: data,
|
|
94
|
+
bubbles: true,
|
|
95
|
+
cancelable: true,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
99
|
+
|
|
100
|
+
// Wait for effects to resolve
|
|
101
|
+
await Promise.resolve();
|
|
102
|
+
|
|
103
|
+
// Verify that the input event was fired
|
|
104
|
+
assert.isTrue(inputEventFired);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should filter dropped files based on accept MIME type', async () => {
|
|
108
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
109
|
+
<usa-file-input accept="image/*"> Input accepts only images </usa-file-input>
|
|
110
|
+
`);
|
|
111
|
+
|
|
112
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
113
|
+
|
|
114
|
+
assert.isOk(nativeInput);
|
|
115
|
+
|
|
116
|
+
// Simulate drag and drop with mixed file types
|
|
117
|
+
const data = new DataTransfer();
|
|
118
|
+
data.items.add(new File([], 'image.png', { type: 'image/png' }));
|
|
119
|
+
data.items.add(new File([], 'document.txt', { type: 'text/plain' }));
|
|
120
|
+
data.items.add(new File([], 'photo.jpg', { type: 'image/jpeg' }));
|
|
121
|
+
|
|
122
|
+
const dropEvent = new DragEvent('drop', {
|
|
123
|
+
dataTransfer: data,
|
|
124
|
+
bubbles: true,
|
|
125
|
+
cancelable: true,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
129
|
+
|
|
130
|
+
// Wait for effects to resolve
|
|
131
|
+
await Promise.resolve();
|
|
132
|
+
|
|
133
|
+
// Verify that only image files were accepted
|
|
134
|
+
assert.equal(fileInput.files?.length, 2);
|
|
135
|
+
assert.equal(fileInput.files?.[0].name, 'image.png');
|
|
136
|
+
assert.equal(fileInput.files?.[1].name, 'photo.jpg');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should filter dropped files based on accept file extension', async () => {
|
|
140
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
141
|
+
<usa-file-input accept=".txt,.pdf"> Input accepts text and PDF files </usa-file-input>
|
|
142
|
+
`);
|
|
143
|
+
|
|
144
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
145
|
+
|
|
146
|
+
assert.isOk(nativeInput);
|
|
147
|
+
|
|
148
|
+
// Simulate drag and drop with mixed file types
|
|
149
|
+
const data = new DataTransfer();
|
|
150
|
+
data.items.add(new File([], 'document.txt'));
|
|
151
|
+
data.items.add(new File([], 'image.png'));
|
|
152
|
+
data.items.add(new File([], 'report.pdf'));
|
|
153
|
+
|
|
154
|
+
const dropEvent = new DragEvent('drop', {
|
|
155
|
+
dataTransfer: data,
|
|
156
|
+
bubbles: true,
|
|
157
|
+
cancelable: true,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
161
|
+
|
|
162
|
+
// Wait for effects to resolve
|
|
163
|
+
await Promise.resolve();
|
|
164
|
+
|
|
165
|
+
// Verify that only .txt and .pdf files were accepted
|
|
166
|
+
assert.equal(fileInput.files?.length, 2);
|
|
167
|
+
assert.equal(fileInput.files?.[0].name, 'document.txt');
|
|
168
|
+
assert.equal(fileInput.files?.[1].name, 'report.pdf');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('should accept all dropped files when accept property is not set', async () => {
|
|
172
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
173
|
+
<usa-file-input> Input accepts all files </usa-file-input>
|
|
174
|
+
`);
|
|
175
|
+
|
|
176
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
177
|
+
|
|
178
|
+
assert.isOk(nativeInput);
|
|
179
|
+
|
|
180
|
+
// Simulate drag and drop with mixed file types
|
|
181
|
+
const data = new DataTransfer();
|
|
182
|
+
data.items.add(new File([], 'document.txt'));
|
|
183
|
+
data.items.add(new File([], 'image.png'));
|
|
184
|
+
data.items.add(new File([], 'report.pdf'));
|
|
185
|
+
|
|
186
|
+
const dropEvent = new DragEvent('drop', {
|
|
187
|
+
dataTransfer: data,
|
|
188
|
+
bubbles: true,
|
|
189
|
+
cancelable: true,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
193
|
+
|
|
194
|
+
// Wait for effects to resolve
|
|
195
|
+
await Promise.resolve();
|
|
196
|
+
|
|
197
|
+
// Verify that all files were accepted
|
|
198
|
+
assert.equal(fileInput.files?.length, 3);
|
|
199
|
+
});
|
|
72
200
|
});
|
|
@@ -163,9 +163,11 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
163
163
|
|
|
164
164
|
const input = this.#input();
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
if (input.files) {
|
|
167
|
+
this.files = input.files;
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
@listen('dragenter')
|
|
@@ -191,13 +193,47 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
191
193
|
if (item.kind === 'file') {
|
|
192
194
|
const file = item.getAsFile();
|
|
193
195
|
|
|
194
|
-
if (file) {
|
|
196
|
+
if (file && this.#isFileAccepted(file)) {
|
|
195
197
|
data.items.add(file);
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
this.files = data.files;
|
|
203
|
+
|
|
204
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
#isFileAccepted(file: File): boolean {
|
|
209
|
+
// If no accept property is set, accept all files
|
|
210
|
+
if (!this.accept) {
|
|
211
|
+
return true;
|
|
201
212
|
}
|
|
213
|
+
|
|
214
|
+
// Split the accept string by comma and trim whitespace
|
|
215
|
+
const acceptedTypes = this.accept.split(',').map((type) => type.trim());
|
|
216
|
+
|
|
217
|
+
for (const acceptType of acceptedTypes) {
|
|
218
|
+
if (acceptType.endsWith('/*')) {
|
|
219
|
+
// Handle wildcard types like "image/*" or "audio/*"
|
|
220
|
+
|
|
221
|
+
const mainType = acceptType.split('/')[0];
|
|
222
|
+
if (file.type.startsWith(mainType + '/')) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
} else if (acceptType.startsWith('.')) {
|
|
226
|
+
if (file.name.toLowerCase().endsWith(acceptType.toLowerCase())) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Handle exact MIME type match
|
|
232
|
+
if (file.type === acceptType) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return false;
|
|
202
238
|
}
|
|
203
239
|
}
|
|
@@ -20,4 +20,29 @@ describe('usa-modal', () => {
|
|
|
20
20
|
|
|
21
21
|
return assert.isAccessible(modal);
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
it('should open modal if document level element with modal-target is clicked', async () => {
|
|
25
|
+
const container = await fixture<HTMLDivElement>(html`
|
|
26
|
+
<div>
|
|
27
|
+
<button modal-target="test">OPEN</button>
|
|
28
|
+
|
|
29
|
+
<usa-modal id="test">
|
|
30
|
+
<usa-modal-close></usa-modal-close>
|
|
31
|
+
|
|
32
|
+
<usa-modal-heading> Are you sure you want to continue? </usa-modal-heading>
|
|
33
|
+
|
|
34
|
+
<p>This is some other example of content</p>
|
|
35
|
+
</usa-modal>
|
|
36
|
+
</div>
|
|
37
|
+
`);
|
|
38
|
+
|
|
39
|
+
const btn = container.querySelector('button')!;
|
|
40
|
+
const modal = container.querySelector('usa-modal')!;
|
|
41
|
+
|
|
42
|
+
assert.notOk(modal.isOpen);
|
|
43
|
+
|
|
44
|
+
btn.click();
|
|
45
|
+
|
|
46
|
+
assert.ok(modal.isOpen);
|
|
47
|
+
});
|
|
23
48
|
});
|
|
@@ -47,6 +47,12 @@ declare global {
|
|
|
47
47
|
export class USAModalElement extends HTMLElement {
|
|
48
48
|
#dialog = query('dialog');
|
|
49
49
|
|
|
50
|
+
get isOpen() {
|
|
51
|
+
const dialog = this.#dialog();
|
|
52
|
+
|
|
53
|
+
return dialog.open;
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
openModal() {
|
|
51
57
|
const dialog = this.#dialog();
|
|
52
58
|
|
|
@@ -64,7 +70,7 @@ export class USAModalElement extends HTMLElement {
|
|
|
64
70
|
this.dispatchEvent(new Event('close'));
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
@listen('click', () =>
|
|
73
|
+
@listen('click', (el) => el.getRootNode())
|
|
68
74
|
onGlobalModalAction(e: Event) {
|
|
69
75
|
if (e.target instanceof Element) {
|
|
70
76
|
const modalTarget = e.target.getAttribute('modal-target');
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { attr, css, element, html, listen, query } from
|
|
1
|
+
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
2
2
|
|
|
3
|
-
import { USASearchEvent } from
|
|
3
|
+
import { USASearchEvent } from './search.event.js';
|
|
4
4
|
|
|
5
5
|
declare global {
|
|
6
6
|
interface HTMLElementTagNameMap {
|
|
7
|
-
|
|
7
|
+
'usa-search': USASearchElement;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@element({
|
|
12
|
-
tagName:
|
|
12
|
+
tagName: 'usa-search',
|
|
13
13
|
shadowDom: [
|
|
14
14
|
css`
|
|
15
15
|
* {
|
|
@@ -23,7 +23,7 @@ declare global {
|
|
|
23
23
|
|
|
24
24
|
form {
|
|
25
25
|
display: flex;
|
|
26
|
-
align-items: flex-end
|
|
26
|
+
align-items: flex-end;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
usa-input {
|
|
@@ -33,9 +33,12 @@ declare global {
|
|
|
33
33
|
usa-button {
|
|
34
34
|
margin-bottom: 1.5rem;
|
|
35
35
|
height: 2.5rem;
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
usa-button::part(button) {
|
|
36
40
|
border-top-left-radius: 0;
|
|
37
41
|
border-bottom-left-radius: 0;
|
|
38
|
-
position: relative;
|
|
39
42
|
}
|
|
40
43
|
`,
|
|
41
44
|
html`
|
|
@@ -51,10 +54,10 @@ declare global {
|
|
|
51
54
|
})
|
|
52
55
|
export class USASearchElement extends HTMLElement {
|
|
53
56
|
@attr()
|
|
54
|
-
accessor name =
|
|
57
|
+
accessor name = 'search';
|
|
55
58
|
|
|
56
59
|
@attr()
|
|
57
|
-
accessor placeholder =
|
|
60
|
+
accessor placeholder = 'Search';
|
|
58
61
|
|
|
59
62
|
@attr()
|
|
60
63
|
accessor required = false;
|
|
@@ -63,12 +66,12 @@ export class USASearchElement extends HTMLElement {
|
|
|
63
66
|
accessor disabled = false;
|
|
64
67
|
|
|
65
68
|
@attr()
|
|
66
|
-
accessor autocomplete: AutoFill =
|
|
69
|
+
accessor autocomplete: AutoFill = 'off';
|
|
67
70
|
|
|
68
71
|
@attr()
|
|
69
|
-
accessor value =
|
|
72
|
+
accessor value = '';
|
|
70
73
|
|
|
71
|
-
#input = query(
|
|
74
|
+
#input = query('usa-input');
|
|
72
75
|
|
|
73
76
|
attributeChangedCallback() {
|
|
74
77
|
this.#input({
|
|
@@ -81,7 +84,7 @@ export class USASearchElement extends HTMLElement {
|
|
|
81
84
|
});
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
@listen(
|
|
87
|
+
@listen('submit', 'form')
|
|
85
88
|
onSubmit(e: Event) {
|
|
86
89
|
const searchEvent = new USASearchEvent(this.value);
|
|
87
90
|
|
|
@@ -105,8 +105,10 @@ let USAFileInputElement = (() => {
|
|
|
105
105
|
onInputChange(e) {
|
|
106
106
|
e.stopPropagation();
|
|
107
107
|
const input = this.#input();
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
if (input.files) {
|
|
109
|
+
this.files = input.files;
|
|
110
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
onDragEnter() {
|
|
112
114
|
this.classList.add('dragenter');
|
|
@@ -122,13 +124,41 @@ let USAFileInputElement = (() => {
|
|
|
122
124
|
for (const item of e.dataTransfer.items) {
|
|
123
125
|
if (item.kind === 'file') {
|
|
124
126
|
const file = item.getAsFile();
|
|
125
|
-
if (file) {
|
|
127
|
+
if (file && this.#isFileAccepted(file)) {
|
|
126
128
|
data.items.add(file);
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
this.files = data.files;
|
|
133
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
#isFileAccepted(file) {
|
|
137
|
+
// If no accept property is set, accept all files
|
|
138
|
+
if (!this.accept) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
// Split the accept string by comma and trim whitespace
|
|
142
|
+
const acceptedTypes = this.accept.split(',').map((type) => type.trim());
|
|
143
|
+
for (const acceptType of acceptedTypes) {
|
|
144
|
+
if (acceptType.endsWith('/*')) {
|
|
145
|
+
// Handle wildcard types like "image/*" or "audio/*"
|
|
146
|
+
const mainType = acceptType.split('/')[0];
|
|
147
|
+
if (file.type.startsWith(mainType + '/')) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else if (acceptType.startsWith('.')) {
|
|
152
|
+
if (file.name.toLowerCase().endsWith(acceptType.toLowerCase())) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Handle exact MIME type match
|
|
157
|
+
if (file.type === acceptType) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
131
160
|
}
|
|
161
|
+
return false;
|
|
132
162
|
}
|
|
133
163
|
static {
|
|
134
164
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.element.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.ts"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAA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C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAExE,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;gBACvC,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC9B,oDAAoD;oBAEpD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1C,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC;wBACzC,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;qBAAM,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACtC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;wBAC/D,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;gBAED,+BAA+B;gBAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;oBAC7B,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;;YAlIU,uDAAmB;;;;;SAAnB,mBAAmB"}
|
|
@@ -38,5 +38,92 @@ describe('usa-file-input', () => {
|
|
|
38
38
|
assert.equal(fileInput.files?.length, 1);
|
|
39
39
|
assert.equal(fileInput.files?.[0].name, 'test.txt');
|
|
40
40
|
});
|
|
41
|
+
it('should fire input event when a file is dragged and dropped', async () => {
|
|
42
|
+
const fileInput = await fixture(html `<usa-file-input>Input accepts a single file</usa-file-input>`);
|
|
43
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
44
|
+
assert.isOk(nativeInput);
|
|
45
|
+
// Create a spy to track input events
|
|
46
|
+
let inputEventFired = false;
|
|
47
|
+
fileInput.addEventListener('input', () => {
|
|
48
|
+
inputEventFired = true;
|
|
49
|
+
});
|
|
50
|
+
// Simulate drag and drop with a file
|
|
51
|
+
const data = new DataTransfer();
|
|
52
|
+
data.items.add(new File([], 'test.txt'));
|
|
53
|
+
const dropEvent = new DragEvent('drop', {
|
|
54
|
+
dataTransfer: data,
|
|
55
|
+
bubbles: true,
|
|
56
|
+
cancelable: true,
|
|
57
|
+
});
|
|
58
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
59
|
+
// Wait for effects to resolve
|
|
60
|
+
await Promise.resolve();
|
|
61
|
+
// Verify that the input event was fired
|
|
62
|
+
assert.isTrue(inputEventFired);
|
|
63
|
+
});
|
|
64
|
+
it('should filter dropped files based on accept MIME type', async () => {
|
|
65
|
+
const fileInput = await fixture(html `<usa-file-input accept="image/*">Input accepts only images</usa-file-input>`);
|
|
66
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
67
|
+
assert.isOk(nativeInput);
|
|
68
|
+
// Simulate drag and drop with mixed file types
|
|
69
|
+
const data = new DataTransfer();
|
|
70
|
+
data.items.add(new File([], 'image.png', { type: 'image/png' }));
|
|
71
|
+
data.items.add(new File([], 'document.txt', { type: 'text/plain' }));
|
|
72
|
+
data.items.add(new File([], 'photo.jpg', { type: 'image/jpeg' }));
|
|
73
|
+
const dropEvent = new DragEvent('drop', {
|
|
74
|
+
dataTransfer: data,
|
|
75
|
+
bubbles: true,
|
|
76
|
+
cancelable: true,
|
|
77
|
+
});
|
|
78
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
79
|
+
// Wait for effects to resolve
|
|
80
|
+
await Promise.resolve();
|
|
81
|
+
// Verify that only image files were accepted
|
|
82
|
+
assert.equal(fileInput.files?.length, 2);
|
|
83
|
+
assert.equal(fileInput.files?.[0].name, 'image.png');
|
|
84
|
+
assert.equal(fileInput.files?.[1].name, 'photo.jpg');
|
|
85
|
+
});
|
|
86
|
+
it('should filter dropped files based on accept file extension', async () => {
|
|
87
|
+
const fileInput = await fixture(html `<usa-file-input accept=".txt,.pdf">Input accepts text and PDF files</usa-file-input>`);
|
|
88
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
89
|
+
assert.isOk(nativeInput);
|
|
90
|
+
// Simulate drag and drop with mixed file types
|
|
91
|
+
const data = new DataTransfer();
|
|
92
|
+
data.items.add(new File([], 'document.txt'));
|
|
93
|
+
data.items.add(new File([], 'image.png'));
|
|
94
|
+
data.items.add(new File([], 'report.pdf'));
|
|
95
|
+
const dropEvent = new DragEvent('drop', {
|
|
96
|
+
dataTransfer: data,
|
|
97
|
+
bubbles: true,
|
|
98
|
+
cancelable: true,
|
|
99
|
+
});
|
|
100
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
101
|
+
// Wait for effects to resolve
|
|
102
|
+
await Promise.resolve();
|
|
103
|
+
// Verify that only .txt and .pdf files were accepted
|
|
104
|
+
assert.equal(fileInput.files?.length, 2);
|
|
105
|
+
assert.equal(fileInput.files?.[0].name, 'document.txt');
|
|
106
|
+
assert.equal(fileInput.files?.[1].name, 'report.pdf');
|
|
107
|
+
});
|
|
108
|
+
it('should accept all dropped files when accept property is not set', async () => {
|
|
109
|
+
const fileInput = await fixture(html `<usa-file-input>Input accepts all files</usa-file-input>`);
|
|
110
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
111
|
+
assert.isOk(nativeInput);
|
|
112
|
+
// Simulate drag and drop with mixed file types
|
|
113
|
+
const data = new DataTransfer();
|
|
114
|
+
data.items.add(new File([], 'document.txt'));
|
|
115
|
+
data.items.add(new File([], 'image.png'));
|
|
116
|
+
data.items.add(new File([], 'report.pdf'));
|
|
117
|
+
const dropEvent = new DragEvent('drop', {
|
|
118
|
+
dataTransfer: data,
|
|
119
|
+
bubbles: true,
|
|
120
|
+
cancelable: true,
|
|
121
|
+
});
|
|
122
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
123
|
+
// Wait for effects to resolve
|
|
124
|
+
await Promise.resolve();
|
|
125
|
+
// Verify that all files were accepted
|
|
126
|
+
assert.equal(fileInput.files?.length, 3);
|
|
127
|
+
});
|
|
41
128
|
});
|
|
42
129
|
//# sourceMappingURL=file-input.element.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.element.test.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.test.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAsB,IAAI,CAAA,gDAAgD,CAAC,CAAC;QAE3G,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;QAE3C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAkB,IAAI,CAAA;;+CAEL,IAAI,CAAC,KAAK;;;;;;;;KAQpD,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEpC,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACvD,IAAI,IAAI,YAAY,IAAI,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC,IAAI,CAAC;YACnB,CAAC;YAED,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,SAAS,GAAG,MAAM,OAAO,CAAsB,IAAI,CAAA;;KAExD,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAEjE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEzB,qCAAqC;QACrC,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;QAEzC,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE;YACtC,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAErC,8BAA8B;QAC9B,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,qDAAqD;QACrD,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"file-input.element.test.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.test.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MA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AU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAErC,8BAA8B;QAC9B,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,sCAAsC;QACtC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ let USAModalElement = (() => {
|
|
|
21
21
|
static {
|
|
22
22
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
23
23
|
_onModalClose_decorators = [listen('close', 'dialog')];
|
|
24
|
-
_onGlobalModalAction_decorators = [listen('click', () =>
|
|
24
|
+
_onGlobalModalAction_decorators = [listen('click', (el) => el.getRootNode())];
|
|
25
25
|
_onModalAction_decorators = [listen('click', (host) => host)];
|
|
26
26
|
__esDecorate(this, null, _onModalClose_decorators, { kind: "method", name: "onModalClose", static: false, private: false, access: { has: obj => "onModalClose" in obj, get: obj => obj.onModalClose }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
27
27
|
__esDecorate(this, null, _onGlobalModalAction_decorators, { kind: "method", name: "onGlobalModalAction", static: false, private: false, access: { has: obj => "onGlobalModalAction" in obj, get: obj => obj.onGlobalModalAction }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -32,6 +32,10 @@ let USAModalElement = (() => {
|
|
|
32
32
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
33
33
|
}
|
|
34
34
|
#dialog = (__runInitializers(this, _instanceExtraInitializers), query('dialog'));
|
|
35
|
+
get isOpen() {
|
|
36
|
+
const dialog = this.#dialog();
|
|
37
|
+
return dialog.open;
|
|
38
|
+
}
|
|
35
39
|
openModal() {
|
|
36
40
|
const dialog = this.#dialog();
|
|
37
41
|
dialog.showModal();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.element.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;IA8CtD,eAAe;4BAtC3B,OAAO,CAAC;YACP,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BF;gBACD,IAAI,CAAA;;;;KAIH;aACF;SACF,CAAC;;;;sBACmC,WAAW;;;;;+BAAnB,SAAQ,WAAW;;;;
|
|
1
|
+
{"version":3,"file":"modal.element.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;IA8CtD,eAAe;4BAtC3B,OAAO,CAAC;YACP,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BF;gBACD,IAAI,CAAA;;;;KAIH;aACF;SACF,CAAC;;;;sBACmC,WAAW;;;;;+BAAnB,SAAQ,WAAW;;;;wCAqB7C,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC;+CAKzB,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;yCAWzC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YAfhC,uLAAA,YAAY,6DAEX;YAGD,4MAAA,mBAAmB,6DAQlB;YAGD,0LAAA,aAAa,6DAQZ;YA9CH,6KA+CC;;;YA/CY,uDAAe;;QAC1B,OAAO,IADI,mDAAe,EAChB,KAAK,CAAC,QAAQ,CAAC,EAAC;QAE1B,IAAI,MAAM;YACR,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE9B,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QAED,SAAS;YACP,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE9B,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;QAED,UAAU;YACR,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE9B,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;QAGD,YAAY;YACV,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC;QAGD,mBAAmB,CAAC,CAAQ;YAC1B,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,EAAE,CAAC;gBAChC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;gBAE1D,IAAI,WAAW,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;oBAC5B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QAGD,aAAa,CAAC,CAAQ;YACpB,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,EAAE,CAAC;gBAChC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;gBAE1D,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;oBAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC;;;;SA9CU,eAAe"}
|
|
@@ -7,5 +7,13 @@ describe('usa-modal', () => {
|
|
|
7
7
|
const modal = await fixture(html `<usa-modal open><usa-modal-close></usa-modal-close><usa-modal-heading>Are you sure you want to continue?</usa-modal-heading><p>This is some other example of content</p></usa-modal>`);
|
|
8
8
|
return assert.isAccessible(modal);
|
|
9
9
|
});
|
|
10
|
+
it('should open modal if document level element with modal-target is clicked', async () => {
|
|
11
|
+
const container = await fixture(html `<div><button modal-target="test">OPEN</button><usa-modal id="test"><usa-modal-close></usa-modal-close><usa-modal-heading>Are you sure you want to continue?</usa-modal-heading><p>This is some other example of content</p></usa-modal></div>`);
|
|
12
|
+
const btn = container.querySelector('button');
|
|
13
|
+
const modal = container.querySelector('usa-modal');
|
|
14
|
+
assert.notOk(modal.isOpen);
|
|
15
|
+
btn.click();
|
|
16
|
+
assert.ok(modal.isOpen);
|
|
17
|
+
});
|
|
10
18
|
});
|
|
11
19
|
//# sourceMappingURL=modal.element.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.element.test.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.element.test.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0CAA0C,CAAC;AAClD,OAAO,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAkB,IAAI,CAAA;;;;;;;;KAQhD,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"modal.element.test.js","sourceRoot":"","sources":["../../../src/lib/modal/modal.element.test.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0CAA0C,CAAC;AAClD,OAAO,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAkB,IAAI,CAAA;;;;;;;;KAQhD,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0EAA0E,EAAE,KAAK,IAAI,EAAE;QACxF,MAAM,SAAS,GAAG,MAAM,OAAO,CAAiB,IAAI,CAAA;;;;;;;;;;;;KAYnD,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAE,CAAC;QAEpD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE3B,GAAG,CAAC,KAAK,EAAE,CAAC;QAEZ,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { attr, css, element, html, listen, query } from
|
|
3
|
-
import { USASearchEvent } from
|
|
2
|
+
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
3
|
+
import { USASearchEvent } from './search.event.js';
|
|
4
4
|
let USASearchElement = (() => {
|
|
5
5
|
let _classDecorators = [element({
|
|
6
|
-
tagName:
|
|
6
|
+
tagName: 'usa-search',
|
|
7
7
|
shadowDom: [
|
|
8
|
-
css `*{box-sizing:border-box}:host{display:block;position:relative}form{display:flex;align-items:flex-end}usa-input{flex-grow:1}usa-button{margin-bottom:1.5rem;height:2.5rem;border-top-left-radius:0;border-bottom-left-radius:0
|
|
8
|
+
css `*{box-sizing:border-box}:host{display:block;position:relative}form{display:flex;align-items:flex-end}usa-input{flex-grow:1}usa-button{margin-bottom:1.5rem;height:2.5rem;position:relative}usa-button::part(button){border-top-left-radius:0;border-bottom-left-radius:0}`,
|
|
9
9
|
html `<form><usa-input exportparts="input"><slot></slot></usa-input><usa-button type="submit" exportparts="button,link">Search</usa-button></form>`,
|
|
10
10
|
],
|
|
11
11
|
})];
|
|
@@ -43,7 +43,7 @@ let USASearchElement = (() => {
|
|
|
43
43
|
_disabled_decorators = [attr()];
|
|
44
44
|
_autocomplete_decorators = [attr()];
|
|
45
45
|
_value_decorators = [attr()];
|
|
46
|
-
_onSubmit_decorators = [listen(
|
|
46
|
+
_onSubmit_decorators = [listen('submit', 'form')];
|
|
47
47
|
__esDecorate(this, null, _name_decorators, { kind: "accessor", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
48
48
|
__esDecorate(this, null, _placeholder_decorators, { kind: "accessor", name: "placeholder", static: false, private: false, access: { has: obj => "placeholder" in obj, get: obj => obj.placeholder, set: (obj, value) => { obj.placeholder = value; } }, metadata: _metadata }, _placeholder_initializers, _placeholder_extraInitializers);
|
|
49
49
|
__esDecorate(this, null, _required_decorators, { kind: "accessor", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
@@ -56,10 +56,10 @@ let USASearchElement = (() => {
|
|
|
56
56
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
57
57
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
58
58
|
}
|
|
59
|
-
#name_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _name_initializers,
|
|
59
|
+
#name_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _name_initializers, 'search'));
|
|
60
60
|
get name() { return this.#name_accessor_storage; }
|
|
61
61
|
set name(value) { this.#name_accessor_storage = value; }
|
|
62
|
-
#placeholder_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _placeholder_initializers,
|
|
62
|
+
#placeholder_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _placeholder_initializers, 'Search'));
|
|
63
63
|
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
64
64
|
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
65
65
|
#required_accessor_storage = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
@@ -68,13 +68,13 @@ let USASearchElement = (() => {
|
|
|
68
68
|
#disabled_accessor_storage = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
69
69
|
get disabled() { return this.#disabled_accessor_storage; }
|
|
70
70
|
set disabled(value) { this.#disabled_accessor_storage = value; }
|
|
71
|
-
#autocomplete_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _autocomplete_initializers,
|
|
71
|
+
#autocomplete_accessor_storage = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _autocomplete_initializers, 'off'));
|
|
72
72
|
get autocomplete() { return this.#autocomplete_accessor_storage; }
|
|
73
73
|
set autocomplete(value) { this.#autocomplete_accessor_storage = value; }
|
|
74
|
-
#value_accessor_storage = (__runInitializers(this, _autocomplete_extraInitializers), __runInitializers(this, _value_initializers,
|
|
74
|
+
#value_accessor_storage = (__runInitializers(this, _autocomplete_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
75
75
|
get value() { return this.#value_accessor_storage; }
|
|
76
76
|
set value(value) { this.#value_accessor_storage = value; }
|
|
77
|
-
#input = (__runInitializers(this, _value_extraInitializers), query(
|
|
77
|
+
#input = (__runInitializers(this, _value_extraInitializers), query('usa-input'));
|
|
78
78
|
attributeChangedCallback() {
|
|
79
79
|
this.#input({
|
|
80
80
|
name: this.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.element.js","sourceRoot":"","sources":["../../../src/lib/search/search.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.element.js","sourceRoot":"","sources":["../../../src/lib/search/search.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;IAoDtC,gBAAgB;4BA5C5B,OAAO,CAAC;YACP,OAAO,EAAE,YAAY;YACrB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BF;gBACD,IAAI,CAAA;;;;;;;;KAQH;aACF;SACF,CAAC;;;;sBACoC,WAAW;;;;;;;;;;;;;;;;;;;;;gCAAnB,SAAQ,WAAW;;;;gCAC9C,IAAI,EAAE;uCAGN,IAAI,EAAE;oCAGN,IAAI,EAAE;oCAGN,IAAI,EAAE;wCAGN,IAAI,EAAE;iCAGN,IAAI,EAAE;oCAgBN,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;YA9BzB,iKAAS,IAAI,6BAAJ,IAAI,mFAAY;YAGzB,sLAAS,WAAW,6BAAX,WAAW,iGAAY;YAGhC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAS;YAG1B,6KAAS,QAAQ,6BAAR,QAAQ,2FAAS;YAG1B,yLAAS,YAAY,6BAAZ,YAAY,mGAAmB;YAGxC,oKAAS,KAAK,6BAAL,KAAK,qFAAM;YAgBpB,2KAAA,QAAQ,6DAQP;YAzCH,6KA0CC;;;YA1CY,uDAAgB;;QAE3B,0BAFW,mDAAgB,8CAEX,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