@spectrum-web-components/search 0.11.3 → 0.11.6-devmode.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/search",
3
- "version": "0.11.3",
3
+ "version": "0.11.6-devmode.0+07474d44f",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,24 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-search": "./sp-search.js",
27
- "./sp-search.js": "./sp-search.js"
28
+ "./src/Search.js": {
29
+ "development": "./src/Search.dev.js",
30
+ "default": "./src/Search.js"
31
+ },
32
+ "./src/index.js": {
33
+ "development": "./src/index.dev.js",
34
+ "default": "./src/index.js"
35
+ },
36
+ "./src/search.css.js": "./src/search.css.js",
37
+ "./sp-search.js": {
38
+ "development": "./sp-search.dev.js",
39
+ "default": "./sp-search.js"
40
+ }
28
41
  },
29
42
  "scripts": {
30
43
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -44,20 +57,20 @@
44
57
  "lit-html"
45
58
  ],
46
59
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.7",
48
- "@spectrum-web-components/button": "^0.17.6",
49
- "@spectrum-web-components/icon": "^0.11.9",
50
- "@spectrum-web-components/icons-workflow": "^0.8.9",
51
- "@spectrum-web-components/textfield": "^0.11.8",
60
+ "@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
61
+ "@spectrum-web-components/button": "^0.18.1-devmode.0+07474d44f",
62
+ "@spectrum-web-components/icon": "^0.11.12-devmode.0+07474d44f",
63
+ "@spectrum-web-components/icons-workflow": "^0.8.12-devmode.0+07474d44f",
64
+ "@spectrum-web-components/textfield": "^0.11.11-devmode.0+07474d44f",
52
65
  "tslib": "^2.0.0"
53
66
  },
54
67
  "devDependencies": {
55
- "@spectrum-css/search": "^4.2.10"
68
+ "@spectrum-css/search": "^4.2.12"
56
69
  },
57
70
  "types": "./src/index.d.ts",
58
71
  "customElements": "custom-elements.json",
59
72
  "sideEffects": [
60
73
  "./sp-*.js"
61
74
  ],
62
- "gitHead": "275ee61b152ac3eed0cd1603d8eab2aec90876a0"
75
+ "gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
63
76
  }
@@ -0,0 +1,3 @@
1
+ import { Search } from "./src/Search.dev.js";
2
+ customElements.define("sp-search", Search);
3
+ //# sourceMappingURL=sp-search.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-search.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Search } from './src/Search.dev.js'\n\ncustomElements.define('sp-search', Search);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-search': Search;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
package/sp-search.js CHANGED
@@ -1,14 +1,3 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { Search } from './src/Search.js';
13
- customElements.define('sp-search', Search);
14
- //# sourceMappingURL=sp-search.js.map
1
+ import { Search } from "./src/Search.js";
2
+ customElements.define("sp-search", Search);
3
+ //# sourceMappingURL=sp-search.js.map
package/sp-search.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-search.js","sourceRoot":"","sources":["sp-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Search } from './src/Search.js';\n\ncustomElements.define('sp-search', Search);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-search': Search;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-search.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Search } from './src/Search.js';\n\ncustomElements.define('sp-search', Search);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-search': Search;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
package/src/Search.d.ts CHANGED
@@ -21,5 +21,5 @@ export declare class Search extends Textfield {
21
21
  reset(): Promise<void>;
22
22
  protected renderField(): TemplateResult;
23
23
  firstUpdated(changedProperties: PropertyValues): void;
24
- updated(changedProperties: PropertyValues): void;
24
+ willUpdate(): void;
25
25
  }
@@ -0,0 +1,111 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html
14
+ } from "@spectrum-web-components/base";
15
+ import {
16
+ property,
17
+ query
18
+ } from "@spectrum-web-components/base/src/decorators.js";
19
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
20
+ import { Textfield } from "@spectrum-web-components/textfield";
21
+ import "@spectrum-web-components/button/sp-clear-button.js";
22
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js";
23
+ import searchStyles from "./search.css.js";
24
+ const stopPropagation = (event) => event.stopPropagation();
25
+ export class Search extends Textfield {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.action = "";
29
+ this.label = "Search";
30
+ this.placeholder = "Search";
31
+ }
32
+ static get styles() {
33
+ return [...super.styles, searchStyles];
34
+ }
35
+ handleSubmit(event) {
36
+ const applyDefault = this.dispatchEvent(new Event("submit", {
37
+ cancelable: true,
38
+ bubbles: true
39
+ }));
40
+ if (!applyDefault) {
41
+ event.preventDefault();
42
+ }
43
+ }
44
+ handleKeydown(event) {
45
+ const { code } = event;
46
+ if (!this.value || code !== "Escape") {
47
+ return;
48
+ }
49
+ this.reset();
50
+ }
51
+ async reset() {
52
+ this.value = "";
53
+ await this.updateComplete;
54
+ this.focusElement.dispatchEvent(new InputEvent("input", {
55
+ bubbles: true,
56
+ composed: true
57
+ }));
58
+ this.focusElement.dispatchEvent(new InputEvent("change", {
59
+ bubbles: true
60
+ }));
61
+ }
62
+ renderField() {
63
+ return html`
64
+ <form
65
+ action=${this.action}
66
+ id="form"
67
+ method=${ifDefined(this.method)}
68
+ @submit=${this.handleSubmit}
69
+ @reset=${this.reset}
70
+ @keydown=${this.handleKeydown}
71
+ >
72
+ <sp-icon-magnify
73
+ class="icon magnifier icon-workflow"
74
+ ></sp-icon-magnify>
75
+ ${super.renderField()}
76
+ ${this.value ? html`
77
+ <sp-clear-button
78
+ id="button"
79
+ label="Reset"
80
+ tabindex="-1"
81
+ type="reset"
82
+ @keydown=${stopPropagation}
83
+ ></sp-clear-button>
84
+ ` : html``}
85
+ </form>
86
+ `;
87
+ }
88
+ firstUpdated(changedProperties) {
89
+ super.firstUpdated(changedProperties);
90
+ this.inputElement.setAttribute("type", "search");
91
+ }
92
+ willUpdate() {
93
+ this.multiline = false;
94
+ }
95
+ }
96
+ __decorateClass([
97
+ property()
98
+ ], Search.prototype, "action", 2);
99
+ __decorateClass([
100
+ property()
101
+ ], Search.prototype, "label", 2);
102
+ __decorateClass([
103
+ property()
104
+ ], Search.prototype, "method", 2);
105
+ __decorateClass([
106
+ property()
107
+ ], Search.prototype, "placeholder", 2);
108
+ __decorateClass([
109
+ query("#form")
110
+ ], Search.prototype, "form", 2);
111
+ //# sourceMappingURL=Search.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Search.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport { Textfield } from '@spectrum-web-components/textfield';\nimport '@spectrum-web-components/button/sp-clear-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\n\nimport searchStyles from './search.css.js';\n\nconst stopPropagation = (event: Event): void => event.stopPropagation();\n\n/**\n * @element sp-search\n * @slot help-text - default or non-negative help text to associate to your form element\n * @slot negative-help-text - negative help text to associate to your form element when `invalid`\n *\n * @fires submit - The search form has been submitted.\n */\nexport class Search extends Textfield {\n public static override get styles(): CSSResultArray {\n return [...super.styles, searchStyles];\n }\n\n @property()\n public action = '';\n\n @property()\n public override label = 'Search';\n\n @property()\n public method?: 'GET' | 'POST' | 'dialog';\n\n @property()\n public override placeholder = 'Search';\n\n @query('#form')\n public form!: HTMLFormElement;\n\n private handleSubmit(event: Event): void {\n const applyDefault = this.dispatchEvent(\n new Event('submit', {\n cancelable: true,\n bubbles: true,\n })\n );\n if (!applyDefault) {\n event.preventDefault();\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n if (!this.value || code !== 'Escape') {\n return;\n }\n this.reset();\n }\n\n public async reset(): Promise<void> {\n this.value = '';\n await this.updateComplete;\n this.focusElement.dispatchEvent(\n new InputEvent('input', {\n bubbles: true,\n composed: true,\n })\n );\n // The native `change` event on an `input` element is not composed,\n // so this synthetic replication of a `change` event must not be\n // either as the `Textfield` baseclass should only need to handle\n // the native variant of this interaction.\n this.focusElement.dispatchEvent(\n new InputEvent('change', {\n bubbles: true,\n })\n );\n }\n\n protected override renderField(): TemplateResult {\n return html`\n <form\n action=${this.action}\n id=\"form\"\n method=${ifDefined(this.method)}\n @submit=${this.handleSubmit}\n @reset=${this.reset}\n @keydown=${this.handleKeydown}\n >\n <sp-icon-magnify\n class=\"icon magnifier icon-workflow\"\n ></sp-icon-magnify>\n ${super.renderField()}\n ${this.value\n ? html`\n <sp-clear-button\n id=\"button\"\n label=\"Reset\"\n tabindex=\"-1\"\n type=\"reset\"\n @keydown=${stopPropagation}\n ></sp-clear-button>\n `\n : html``}\n </form>\n `;\n }\n\n public override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.inputElement.setAttribute('type', 'search');\n }\n\n public override willUpdate(): void {\n this.multiline = false;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAIA;AAEA;AACA;AACA;AAEA;AAEA,MAAM,kBAAkB,CAAC,UAAuB,MAAM,gBAAgB;AAS/D,aAAM,eAAe,UAAU;AAAA,EAA/B;AAAA;AAMI,kBAAS;AAGA,iBAAQ;AAMR,uBAAc;AAAA;AAAA,aAdH,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,EAiBQ,aAAa,OAAoB;AACrC,UAAM,eAAe,KAAK,cACtB,IAAI,MAAM,UAAU;AAAA,MAChB,YAAY;AAAA,MACZ,SAAS;AAAA,IACb,CAAC,CACL;AACA,QAAI,CAAC,cAAc;AACf,YAAM,eAAe;AAAA,IACzB;AAAA,EACJ;AAAA,EAEQ,cAAc,OAA4B;AAC9C,UAAM,EAAE,SAAS;AACjB,QAAI,CAAC,KAAK,SAAS,SAAS,UAAU;AAClC;AAAA,IACJ;AACA,SAAK,MAAM;AAAA,EACf;AAAA,QAEa,QAAuB;AAChC,SAAK,QAAQ;AACb,UAAM,KAAK;AACX,SAAK,aAAa,cACd,IAAI,WAAW,SAAS;AAAA,MACpB,SAAS;AAAA,MACT,UAAU;AAAA,IACd,CAAC,CACL;AAKA,SAAK,aAAa,cACd,IAAI,WAAW,UAAU;AAAA,MACrB,SAAS;AAAA,IACb,CAAC,CACL;AAAA,EACJ;AAAA,EAEmB,cAA8B;AAC7C,WAAO;AAAA;AAAA,yBAEU,KAAK;AAAA;AAAA,yBAEL,UAAU,KAAK,MAAM;AAAA,0BACpB,KAAK;AAAA,yBACN,KAAK;AAAA,2BACH,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKd,MAAM,YAAY;AAAA,kBAClB,KAAK,QACD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAMmB;AAAA;AAAA,0BAGnB;AAAA;AAAA;AAAA,EAGlB;AAAA,EAEgB,aAAa,mBAAyC;AAClE,UAAM,aAAa,iBAAiB;AACpC,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACnD;AAAA,EAEgB,aAAmB;AAC/B,SAAK,YAAY;AAAA,EACrB;AACJ;AA3FW;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AANJ,OAMI;AAGS;AAAA,EADhB,AAAC,SAAS;AAAA,GACM,AATb,OASa;AAGT;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AAZJ,OAYI;AAGS;AAAA,EADhB,AAAC,SAAS;AAAA,GACM,AAfb,OAea;AAGT;AAAA,EADP,AAAC,MAAM,OAAO;AAAA,GACP,AAlBJ,OAkBI;",
6
+ "names": []
7
+ }
package/src/Search.js CHANGED
@@ -1,73 +1,66 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { __decorate } from "tslib";
13
- import { html, } from '@spectrum-web-components/base';
14
- import { property, query, } from '@spectrum-web-components/base/src/decorators.js';
15
- import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
16
- import { Textfield } from '@spectrum-web-components/textfield';
17
- import '@spectrum-web-components/button/sp-clear-button.js';
18
- import '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';
19
- import searchStyles from './search.css.js';
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html
14
+ } from "@spectrum-web-components/base";
15
+ import {
16
+ property,
17
+ query
18
+ } from "@spectrum-web-components/base/src/decorators.js";
19
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
20
+ import { Textfield } from "@spectrum-web-components/textfield";
21
+ import "@spectrum-web-components/button/sp-clear-button.js";
22
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js";
23
+ import searchStyles from "./search.css.js";
20
24
  const stopPropagation = (event) => event.stopPropagation();
21
- /**
22
- * @element sp-search
23
- * @slot help-text - default or non-negative help text to associate to your form element
24
- * @slot negative-help-text - negative help text to associate to your form element when `invalid`
25
- *
26
- * @fires submit - The search form has been submitted.
27
- */
28
25
  export class Search extends Textfield {
29
- constructor() {
30
- super(...arguments);
31
- this.action = '';
32
- this.label = 'Search';
33
- this.placeholder = 'Search';
26
+ constructor() {
27
+ super(...arguments);
28
+ this.action = "";
29
+ this.label = "Search";
30
+ this.placeholder = "Search";
31
+ }
32
+ static get styles() {
33
+ return [...super.styles, searchStyles];
34
+ }
35
+ handleSubmit(event) {
36
+ const applyDefault = this.dispatchEvent(new Event("submit", {
37
+ cancelable: true,
38
+ bubbles: true
39
+ }));
40
+ if (!applyDefault) {
41
+ event.preventDefault();
34
42
  }
35
- static get styles() {
36
- return [...super.styles, searchStyles];
43
+ }
44
+ handleKeydown(event) {
45
+ const { code } = event;
46
+ if (!this.value || code !== "Escape") {
47
+ return;
37
48
  }
38
- handleSubmit(event) {
39
- const applyDefault = this.dispatchEvent(new Event('submit', {
40
- cancelable: true,
41
- bubbles: true,
42
- }));
43
- if (!applyDefault) {
44
- event.preventDefault();
45
- }
46
- }
47
- handleKeydown(event) {
48
- const { code } = event;
49
- if (!this.value || code !== 'Escape') {
50
- return;
51
- }
52
- this.reset();
53
- }
54
- async reset() {
55
- this.value = '';
56
- await this.updateComplete;
57
- this.focusElement.dispatchEvent(new InputEvent('input', {
58
- bubbles: true,
59
- composed: true,
60
- }));
61
- // The native `change` event on an `input` element is not composed,
62
- // so this synthetic replication of a `change` event must not be
63
- // either as the `Textfield` baseclass should only need to handle
64
- // the native variant of this interaction.
65
- this.focusElement.dispatchEvent(new InputEvent('change', {
66
- bubbles: true,
67
- }));
68
- }
69
- renderField() {
70
- return html `
49
+ this.reset();
50
+ }
51
+ async reset() {
52
+ this.value = "";
53
+ await this.updateComplete;
54
+ this.focusElement.dispatchEvent(new InputEvent("input", {
55
+ bubbles: true,
56
+ composed: true
57
+ }));
58
+ this.focusElement.dispatchEvent(new InputEvent("change", {
59
+ bubbles: true
60
+ }));
61
+ }
62
+ renderField() {
63
+ return html`
71
64
  <form
72
65
  action=${this.action}
73
66
  id="form"
@@ -80,8 +73,7 @@ export class Search extends Textfield {
80
73
  class="icon magnifier icon-workflow"
81
74
  ></sp-icon-magnify>
82
75
  ${super.renderField()}
83
- ${this.value
84
- ? html `
76
+ ${this.value ? html`
85
77
  <sp-clear-button
86
78
  id="button"
87
79
  label="Reset"
@@ -89,33 +81,31 @@ export class Search extends Textfield {
89
81
  type="reset"
90
82
  @keydown=${stopPropagation}
91
83
  ></sp-clear-button>
92
- `
93
- : html ``}
84
+ ` : html``}
94
85
  </form>
95
86
  `;
96
- }
97
- firstUpdated(changedProperties) {
98
- super.firstUpdated(changedProperties);
99
- this.inputElement.setAttribute('type', 'search');
100
- }
101
- updated(changedProperties) {
102
- super.updated(changedProperties);
103
- this.multiline = false;
104
- }
87
+ }
88
+ firstUpdated(changedProperties) {
89
+ super.firstUpdated(changedProperties);
90
+ this.inputElement.setAttribute("type", "search");
91
+ }
92
+ willUpdate() {
93
+ this.multiline = false;
94
+ }
105
95
  }
106
- __decorate([
107
- property()
108
- ], Search.prototype, "action", void 0);
109
- __decorate([
110
- property()
111
- ], Search.prototype, "label", void 0);
112
- __decorate([
113
- property()
114
- ], Search.prototype, "method", void 0);
115
- __decorate([
116
- property()
117
- ], Search.prototype, "placeholder", void 0);
118
- __decorate([
119
- query('#form')
120
- ], Search.prototype, "form", void 0);
121
- //# sourceMappingURL=Search.js.map
96
+ __decorateClass([
97
+ property()
98
+ ], Search.prototype, "action", 2);
99
+ __decorateClass([
100
+ property()
101
+ ], Search.prototype, "label", 2);
102
+ __decorateClass([
103
+ property()
104
+ ], Search.prototype, "method", 2);
105
+ __decorateClass([
106
+ property()
107
+ ], Search.prototype, "placeholder", 2);
108
+ __decorateClass([
109
+ query("#form")
110
+ ], Search.prototype, "form", 2);
111
+ //# sourceMappingURL=Search.js.map
package/src/Search.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"Search.js","sourceRoot":"","sources":["Search.ts"],"names":[],"mappings":"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","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport { Textfield } from '@spectrum-web-components/textfield';\nimport '@spectrum-web-components/button/sp-clear-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\n\nimport searchStyles from './search.css.js';\n\nconst stopPropagation = (event: Event): void => event.stopPropagation();\n\n/**\n * @element sp-search\n * @slot help-text - default or non-negative help text to associate to your form element\n * @slot negative-help-text - negative help text to associate to your form element when `invalid`\n *\n * @fires submit - The search form has been submitted.\n */\nexport class Search extends Textfield {\n public static override get styles(): CSSResultArray {\n return [...super.styles, searchStyles];\n }\n\n @property()\n public action = '';\n\n @property()\n public override label = 'Search';\n\n @property()\n public method?: 'GET' | 'POST' | 'dialog';\n\n @property()\n public override placeholder = 'Search';\n\n @query('#form')\n public form!: HTMLFormElement;\n\n private handleSubmit(event: Event): void {\n const applyDefault = this.dispatchEvent(\n new Event('submit', {\n cancelable: true,\n bubbles: true,\n })\n );\n if (!applyDefault) {\n event.preventDefault();\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n if (!this.value || code !== 'Escape') {\n return;\n }\n this.reset();\n }\n\n public async reset(): Promise<void> {\n this.value = '';\n await this.updateComplete;\n this.focusElement.dispatchEvent(\n new InputEvent('input', {\n bubbles: true,\n composed: true,\n })\n );\n // The native `change` event on an `input` element is not composed,\n // so this synthetic replication of a `change` event must not be\n // either as the `Textfield` baseclass should only need to handle\n // the native variant of this interaction.\n this.focusElement.dispatchEvent(\n new InputEvent('change', {\n bubbles: true,\n })\n );\n }\n\n protected override renderField(): TemplateResult {\n return html`\n <form\n action=${this.action}\n id=\"form\"\n method=${ifDefined(this.method)}\n @submit=${this.handleSubmit}\n @reset=${this.reset}\n @keydown=${this.handleKeydown}\n >\n <sp-icon-magnify\n class=\"icon magnifier icon-workflow\"\n ></sp-icon-magnify>\n ${super.renderField()}\n ${this.value\n ? html`\n <sp-clear-button\n id=\"button\"\n label=\"Reset\"\n tabindex=\"-1\"\n type=\"reset\"\n @keydown=${stopPropagation}\n ></sp-clear-button>\n `\n : html``}\n </form>\n `;\n }\n\n public override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.inputElement.setAttribute('type', 'search');\n }\n\n public override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n this.multiline = false;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["Search.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport { Textfield } from '@spectrum-web-components/textfield';\nimport '@spectrum-web-components/button/sp-clear-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\n\nimport searchStyles from './search.css.js';\n\nconst stopPropagation = (event: Event): void => event.stopPropagation();\n\n/**\n * @element sp-search\n * @slot help-text - default or non-negative help text to associate to your form element\n * @slot negative-help-text - negative help text to associate to your form element when `invalid`\n *\n * @fires submit - The search form has been submitted.\n */\nexport class Search extends Textfield {\n public static override get styles(): CSSResultArray {\n return [...super.styles, searchStyles];\n }\n\n @property()\n public action = '';\n\n @property()\n public override label = 'Search';\n\n @property()\n public method?: 'GET' | 'POST' | 'dialog';\n\n @property()\n public override placeholder = 'Search';\n\n @query('#form')\n public form!: HTMLFormElement;\n\n private handleSubmit(event: Event): void {\n const applyDefault = this.dispatchEvent(\n new Event('submit', {\n cancelable: true,\n bubbles: true,\n })\n );\n if (!applyDefault) {\n event.preventDefault();\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n if (!this.value || code !== 'Escape') {\n return;\n }\n this.reset();\n }\n\n public async reset(): Promise<void> {\n this.value = '';\n await this.updateComplete;\n this.focusElement.dispatchEvent(\n new InputEvent('input', {\n bubbles: true,\n composed: true,\n })\n );\n // The native `change` event on an `input` element is not composed,\n // so this synthetic replication of a `change` event must not be\n // either as the `Textfield` baseclass should only need to handle\n // the native variant of this interaction.\n this.focusElement.dispatchEvent(\n new InputEvent('change', {\n bubbles: true,\n })\n );\n }\n\n protected override renderField(): TemplateResult {\n return html`\n <form\n action=${this.action}\n id=\"form\"\n method=${ifDefined(this.method)}\n @submit=${this.handleSubmit}\n @reset=${this.reset}\n @keydown=${this.handleKeydown}\n >\n <sp-icon-magnify\n class=\"icon magnifier icon-workflow\"\n ></sp-icon-magnify>\n ${super.renderField()}\n ${this.value\n ? html`\n <sp-clear-button\n id=\"button\"\n label=\"Reset\"\n tabindex=\"-1\"\n type=\"reset\"\n @keydown=${stopPropagation}\n ></sp-clear-button>\n `\n : html``}\n </form>\n `;\n }\n\n public override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.inputElement.setAttribute('type', 'search');\n }\n\n public override willUpdate(): void {\n this.multiline = false;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAIA;AAEA;AACA;AACA;AAEA;AAEA,MAAM,kBAAkB,CAAC,UAAuB,MAAM,gBAAgB;AAS/D,aAAM,eAAe,UAAU;AAAA,EAA/B;AAAA;AAMI,kBAAS;AAGA,iBAAQ;AAMR,uBAAc;AAAA;AAAA,aAdH,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,EAiBQ,aAAa,OAAoB;AACrC,UAAM,eAAe,KAAK,cACtB,IAAI,MAAM,UAAU;AAAA,MAChB,YAAY;AAAA,MACZ,SAAS;AAAA,IACb,CAAC,CACL;AACA,QAAI,CAAC,cAAc;AACf,YAAM,eAAe;AAAA,IACzB;AAAA,EACJ;AAAA,EAEQ,cAAc,OAA4B;AAC9C,UAAM,EAAE,SAAS;AACjB,QAAI,CAAC,KAAK,SAAS,SAAS,UAAU;AAClC;AAAA,IACJ;AACA,SAAK,MAAM;AAAA,EACf;AAAA,QAEa,QAAuB;AAChC,SAAK,QAAQ;AACb,UAAM,KAAK;AACX,SAAK,aAAa,cACd,IAAI,WAAW,SAAS;AAAA,MACpB,SAAS;AAAA,MACT,UAAU;AAAA,IACd,CAAC,CACL;AAKA,SAAK,aAAa,cACd,IAAI,WAAW,UAAU;AAAA,MACrB,SAAS;AAAA,IACb,CAAC,CACL;AAAA,EACJ;AAAA,EAEmB,cAA8B;AAC7C,WAAO;AAAA;AAAA,yBAEU,KAAK;AAAA;AAAA,yBAEL,UAAU,KAAK,MAAM;AAAA,0BACpB,KAAK;AAAA,yBACN,KAAK;AAAA,2BACH,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKd,MAAM,YAAY;AAAA,kBAClB,KAAK,QACD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAMmB;AAAA;AAAA,0BAGnB;AAAA;AAAA;AAAA,EAGlB;AAAA,EAEgB,aAAa,mBAAyC;AAClE,UAAM,aAAa,iBAAiB;AACpC,SAAK,aAAa,aAAa,QAAQ,QAAQ;AAAA,EACnD;AAAA,EAEgB,aAAmB;AAC/B,SAAK,YAAY;AAAA,EACrB;AACJ;AA3FW;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AANJ,OAMI;AAGS;AAAA,EADhB,AAAC,SAAS;AAAA,GACM,AATb,OASa;AAGT;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AAZJ,OAYI;AAGS;AAAA,EADhB,AAAC,SAAS;AAAA,GACM,AAfb,OAea;AAGT;AAAA,EADP,AAAC,MAAM,OAAO;AAAA,GACP,AAlBJ,OAkBI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Search.dev.js";
2
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Search.dev.js'\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,13 +1,2 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- export * from './Search.js';
13
- //# sourceMappingURL=index.js.map
1
+ export * from "./Search.js";
2
+ //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,aAAa,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Search.js';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Search.js';\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,51 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{--spectrum-search-quiet-button-offset:calc(var(
4
+ --spectrum-actionbutton-m-texticon-min-width,
5
+ var(--spectrum-global-dimension-size-400)
6
+ )/2 - var(--spectrum-alias-ui-icon-cross-size-100)/2)}#textfield{display:inline-block;position:relative}:host([dir=ltr]) #button{right:0}:host([dir=rtl]) #button{left:0}#button{position:absolute;top:0}.input{-webkit-appearance:none;border-radius:var(
7
+ --spectrum-alias-search-border-radius,var(--spectrum-global-dimension-size-50)
8
+ );outline-offset:-2px}.input::-webkit-search-cancel-button,.input::-webkit-search-decoration{-webkit-appearance:none}#textfield:after{border-radius:var(
9
+ --spectrum-alias-search-border-radius,var(--spectrum-global-dimension-size-50)
10
+ )}:host([dir=ltr]:not([quiet])) #textfield .icon{left:var(
11
+ --spectrum-alias-search-padding-left-m
12
+ )}:host([dir=rtl]:not([quiet])) #textfield .icon{right:var(
13
+ --spectrum-alias-search-padding-left-m
14
+ )}:host([dir=ltr]:not([quiet])) #textfield .input{padding-left:calc(var(--spectrum-alias-search-padding-left-m) + var(
15
+ --spectrum-alias-workflow-icon-size-m,
16
+ var(--spectrum-global-dimension-size-225)
17
+ ) + var(
18
+ --spectrum-textfield-m-texticon-icon-gap,
19
+ var(--spectrum-global-dimension-size-100)
20
+ ) - var(
21
+ --spectrum-textfield-m-texticon-border-size,
22
+ var(--spectrum-alias-input-border-size)
23
+ ))}:host([dir=rtl]:not([quiet])) #textfield .input{padding-right:calc(var(--spectrum-alias-search-padding-left-m) + var(
24
+ --spectrum-alias-workflow-icon-size-m,
25
+ var(--spectrum-global-dimension-size-225)
26
+ ) + var(
27
+ --spectrum-textfield-m-texticon-icon-gap,
28
+ var(--spectrum-global-dimension-size-100)
29
+ ) - var(
30
+ --spectrum-textfield-m-texticon-border-size,
31
+ var(--spectrum-alias-input-border-size)
32
+ ))}:host([quiet]) #button{transform:translateX(var(--spectrum-search-quiet-button-offset))}:host([quiet]) .input{border-radius:var(
33
+ --spectrum-alias-search-border-radius-quiet,0
34
+ )}:host([quiet]) #textfield:after{border-radius:var(
35
+ --spectrum-alias-search-border-radius-quiet,0
36
+ )}.icon{color:var(
37
+ --spectrum-textfield-m-texticon-icon-color,var(--spectrum-alias-component-icon-color-default)
38
+ )}.input:hover~.icon{color:var(
39
+ --spectrum-search-m-icon-color-hover,var(--spectrum-alias-component-icon-color-hover)
40
+ )}.input:active~.icon{color:var(
41
+ --spectrum-search-m-icon-color-down,var(--spectrum-alias-component-icon-color-down)
42
+ )}.input.focus-visible~.icon{color:var(
43
+ --spectrum-search-m-icon-color-key-focus,var(--spectrum-alias-component-icon-color-key-focus)
44
+ )}.input:focus-visible~.icon{color:var(
45
+ --spectrum-search-m-icon-color-key-focus,var(--spectrum-alias-component-icon-color-key-focus)
46
+ )}.input:disabled~.icon{color:var(
47
+ --spectrum-textfield-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)
48
+ )}input::-webkit-search-cancel-button{display:none}
49
+ `;
50
+ export default styles;
51
+ //# sourceMappingURL=search.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["search.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-search-quiet-button-offset:calc(var(\n--spectrum-actionbutton-m-texticon-min-width,\nvar(--spectrum-global-dimension-size-400)\n)/2 - var(--spectrum-alias-ui-icon-cross-size-100)/2)}#textfield{display:inline-block;position:relative}:host([dir=ltr]) #button{right:0}:host([dir=rtl]) #button{left:0}#button{position:absolute;top:0}.input{-webkit-appearance:none;border-radius:var(\n--spectrum-alias-search-border-radius,var(--spectrum-global-dimension-size-50)\n);outline-offset:-2px}.input::-webkit-search-cancel-button,.input::-webkit-search-decoration{-webkit-appearance:none}#textfield:after{border-radius:var(\n--spectrum-alias-search-border-radius,var(--spectrum-global-dimension-size-50)\n)}:host([dir=ltr]:not([quiet])) #textfield .icon{left:var(\n--spectrum-alias-search-padding-left-m\n)}:host([dir=rtl]:not([quiet])) #textfield .icon{right:var(\n--spectrum-alias-search-padding-left-m\n)}:host([dir=ltr]:not([quiet])) #textfield .input{padding-left:calc(var(--spectrum-alias-search-padding-left-m) + var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-textfield-m-texticon-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) - var(\n--spectrum-textfield-m-texticon-border-size,\nvar(--spectrum-alias-input-border-size)\n))}:host([dir=rtl]:not([quiet])) #textfield .input{padding-right:calc(var(--spectrum-alias-search-padding-left-m) + var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-textfield-m-texticon-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) - var(\n--spectrum-textfield-m-texticon-border-size,\nvar(--spectrum-alias-input-border-size)\n))}:host([quiet]) #button{transform:translateX(var(--spectrum-search-quiet-button-offset))}:host([quiet]) .input{border-radius:var(\n--spectrum-alias-search-border-radius-quiet,0\n)}:host([quiet]) #textfield:after{border-radius:var(\n--spectrum-alias-search-border-radius-quiet,0\n)}.icon{color:var(\n--spectrum-textfield-m-texticon-icon-color,var(--spectrum-alias-component-icon-color-default)\n)}.input:hover~.icon{color:var(\n--spectrum-search-m-icon-color-hover,var(--spectrum-alias-component-icon-color-hover)\n)}.input:active~.icon{color:var(\n--spectrum-search-m-icon-color-down,var(--spectrum-alias-component-icon-color-down)\n)}.input.focus-visible~.icon{color:var(\n--spectrum-search-m-icon-color-key-focus,var(--spectrum-alias-component-icon-color-key-focus)\n)}.input:focus-visible~.icon{color:var(\n--spectrum-search-m-icon-color-key-focus,var(--spectrum-alias-component-icon-color-key-focus)\n)}.input:disabled~.icon{color:var(\n--spectrum-textfield-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n)}input::-webkit-search-cancel-button{display:none}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDf,eAAe;",
6
+ "names": []
7
+ }
package/src/search.css.js CHANGED
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
14
3
  :host{--spectrum-search-quiet-button-offset:calc(var(
15
4
  --spectrum-actionbutton-m-texticon-min-width,
16
5
  var(--spectrum-global-dimension-size-400)
@@ -59,4 +48,4 @@ var(--spectrum-alias-input-border-size)
59
48
  )}input::-webkit-search-cancel-button{display:none}
60
49
  `;
61
50
  export default styles;
62
- //# sourceMappingURL=search.css.js.map
51
+ //# sourceMappingURL=search.css.js.map