@spectrum-web-components/dropzone 0.9.9 → 0.9.11-devmode.7

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.
@@ -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 './Dropzone.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 './Dropzone.js';
13
- //# sourceMappingURL=index.js.map
1
+ export * from "./Dropzone.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,eAAe,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 './Dropzone.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 './Dropzone.js';\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,32 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host{border-radius:var(
4
+ --spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)
5
+ );border-style:dashed;border-width:var(
6
+ --spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)
7
+ );padding:var(
8
+ --spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)
9
+ );text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(
10
+ --spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)
11
+ )}:host([dragged]){background-color:var(
12
+ --spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)
13
+ );border-color:var(
14
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
15
+ )}:host([dragged]) ::slotted(*){color:var(
16
+ --spectrum-global-color-blue-400
17
+ )}:host(:focus){border-color:var(
18
+ --spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)
19
+ )}:host(:focus) ::slotted(*){color:var(
20
+ --spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))
21
+ )}:host(:focus.focus-visible){border-color:var(
22
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
23
+ )}:host(:focus:focus-visible){border-color:var(
24
+ --spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)
25
+ )}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(
26
+ --spectrum-global-color-blue-400
27
+ )}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(
28
+ --spectrum-global-color-blue-400
29
+ )}
30
+ `;
31
+ export default styles;
32
+ //# sourceMappingURL=spectrum-dropzone.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-dropzone.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{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}\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;AA6Bf,eAAe;",
6
+ "names": []
7
+ }
@@ -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{border-radius:var(
15
4
  --spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)
16
5
  );border-style:dashed;border-width:var(
@@ -40,4 +29,4 @@ const styles = css `
40
29
  )}
41
30
  `;
42
31
  export default styles;
43
- //# sourceMappingURL=spectrum-dropzone.css.js.map
32
+ //# sourceMappingURL=spectrum-dropzone.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"spectrum-dropzone.css.js","sourceRoot":"","sources":["spectrum-dropzone.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BjB,CAAC;AACF,eAAe,MAAM,CAAC","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{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-dropzone.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{border-radius:var(\n--spectrum-dropzone-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:dashed;border-width:var(\n--spectrum-dropzone-border-width,var(--spectrum-alias-border-size-thick)\n);padding:var(\n--spectrum-dropzone-padding,var(--spectrum-global-dimension-size-900)\n);text-align:center}:host([dragged]){border-style:solid}:host(:focus){border-style:dashed;outline:0}:host(:focus.focus-visible){border-style:solid}:host(:focus:focus-visible){border-style:solid}:host{border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host([dragged]){background-color:var(\n--spectrum-dropzone-background-color-selected-hover,var(--spectrum-alias-highlight-selected)\n);border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host([dragged]) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus){border-color:var(\n--spectrum-dropzone-border-color,var(--spectrum-global-color-gray-300)\n)}:host(:focus) ::slotted(*){color:var(\n--spectrum-global-color-static-gray-500,rgb(var(--spectrum-global-color-static-gray-500-rgb))\n)}:host(:focus.focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus:focus-visible){border-color:var(\n--spectrum-dropzone-border-color-selected-hover,var(--spectrum-global-color-blue-400)\n)}:host(:focus[dragged].focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}:host(:focus[dragged]:focus-visible) ::slotted(*){color:var(\n--spectrum-global-color-blue-400\n)}\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;AA6Bf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,41 +1,30 @@
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 { html } from '@spectrum-web-components/base';
13
- import '../sp-dropzone.js';
14
- import { illustration } from '../test/test-svg';
15
- import '@spectrum-web-components/illustrated-message/sp-illustrated-message.js';
16
- import '@spectrum-web-components/link/sp-link.js';
1
+ import { html } from "@spectrum-web-components/base";
2
+ import "@spectrum-web-components/dropzone/sp-dropzone.js";
3
+ import { illustration } from "../test/test-svg";
4
+ import "@spectrum-web-components/illustrated-message/sp-illustrated-message.js";
5
+ import "@spectrum-web-components/link/sp-link.js";
17
6
  export default {
18
- component: 'sp-dropzone',
19
- title: 'Dropzone',
20
- args: {
21
- isDragged: false,
22
- },
23
- argTypes: {
24
- isDragged: {
25
- name: 'isDragged',
26
- type: { name: 'boolean', required: false },
27
- table: {
28
- type: { summary: 'boolean' },
29
- defaultValue: { summary: false },
30
- },
31
- control: {
32
- type: 'boolean',
33
- },
34
- },
35
- },
7
+ component: "sp-dropzone",
8
+ title: "Dropzone",
9
+ args: {
10
+ isDragged: false
11
+ },
12
+ argTypes: {
13
+ isDragged: {
14
+ name: "isDragged",
15
+ type: { name: "boolean", required: false },
16
+ table: {
17
+ type: { summary: "boolean" },
18
+ defaultValue: { summary: false }
19
+ },
20
+ control: {
21
+ type: "boolean"
22
+ }
23
+ }
24
+ }
36
25
  };
37
26
  export const Default = (args) => {
38
- return html `
27
+ return html`
39
28
  <sp-dropzone id="dropzone" tabindex="0" ?dragged=${args.isDragged}>
40
29
  <sp-illustrated-message heading="Drag and Drop Your File" cta>
41
30
  ${illustration}
@@ -57,7 +46,7 @@ export const Default = (args) => {
57
46
  `;
58
47
  };
59
48
  export const Dragged = (args) => {
60
- return html `
49
+ return html`
61
50
  <sp-dropzone id="dropzone" tabindex="0" ?dragged=${args.isDragged}>
62
51
  <sp-illustrated-message heading="Drag and Drop Your File" cta>
63
52
  ${illustration}
@@ -79,6 +68,6 @@ export const Dragged = (args) => {
79
68
  `;
80
69
  };
81
70
  Dragged.args = {
82
- isDragged: true,
71
+ isDragged: true
83
72
  };
84
- //# sourceMappingURL=dropzone.stories.js.map
73
+ //# sourceMappingURL=dropzone.stories.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"dropzone.stories.js","sourceRoot":"","sources":["dropzone.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,wEAAwE,CAAC;AAChF,OAAO,0CAA0C,CAAC;AAElD,eAAe;IACX,SAAS,EAAE,aAAa;IACxB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE;QACF,SAAS,EAAE,KAAK;KACnB;IACD,QAAQ,EAAE;QACN,SAAS,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;KACJ;CACJ,CAAC;AAMF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAe,EAAkB,EAAE;IACvD,OAAO,IAAI,CAAA;2DAC4C,IAAI,CAAC,SAAS;;kBAEvD,YAAY;;;;;;;;;;;;;;;;KAgBzB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAe,EAAkB,EAAE;IACvD,OAAO,IAAI,CAAA;2DAC4C,IAAI,CAAC,SAAS;;kBAEvD,YAAY;;;;;;;;;;;;;;;;KAgBzB,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,GAAG;IACX,SAAS,EAAE,IAAI;CAClB,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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-dropzone.js';\nimport { illustration } from '../test/test-svg';\nimport '@spectrum-web-components/illustrated-message/sp-illustrated-message.js';\nimport '@spectrum-web-components/link/sp-link.js';\n\nexport default {\n component: 'sp-dropzone',\n title: 'Dropzone',\n args: {\n isDragged: false,\n },\n argTypes: {\n isDragged: {\n name: 'isDragged',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype StoryArgs = {\n isDragged?: boolean;\n};\n\nexport const Default = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-dropzone id=\"dropzone\" tabindex=\"0\" ?dragged=${args.isDragged}>\n <sp-illustrated-message heading=\"Drag and Drop Your File\" cta>\n ${illustration}\n <div slot=\"description\">\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div slot=\"description\">\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </sp-illustrated-message>\n </sp-dropzone>\n `;\n};\n\nexport const Dragged = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-dropzone id=\"dropzone\" tabindex=\"0\" ?dragged=${args.isDragged}>\n <sp-illustrated-message heading=\"Drag and Drop Your File\" cta>\n ${illustration}\n <div slot=\"description\">\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div slot=\"description\">\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </sp-illustrated-message>\n </sp-dropzone>\n `;\n};\nDragged.args = {\n isDragged: true,\n};\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["dropzone.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/dropzone/sp-dropzone.js';\nimport { illustration } from '../test/test-svg';\nimport '@spectrum-web-components/illustrated-message/sp-illustrated-message.js';\nimport '@spectrum-web-components/link/sp-link.js';\n\nexport default {\n component: 'sp-dropzone',\n title: 'Dropzone',\n args: {\n isDragged: false,\n },\n argTypes: {\n isDragged: {\n name: 'isDragged',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype StoryArgs = {\n isDragged?: boolean;\n};\n\nexport const Default = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-dropzone id=\"dropzone\" tabindex=\"0\" ?dragged=${args.isDragged}>\n <sp-illustrated-message heading=\"Drag and Drop Your File\" cta>\n ${illustration}\n <div slot=\"description\">\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div slot=\"description\">\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </sp-illustrated-message>\n </sp-dropzone>\n `;\n};\n\nexport const Dragged = (args: StoryArgs): TemplateResult => {\n return html`\n <sp-dropzone id=\"dropzone\" tabindex=\"0\" ?dragged=${args.isDragged}>\n <sp-illustrated-message heading=\"Drag and Drop Your File\" cta>\n ${illustration}\n <div slot=\"description\">\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div slot=\"description\">\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </sp-illustrated-message>\n </sp-dropzone>\n `;\n};\nDragged.args = {\n isDragged: true,\n};\n"],
5
+ "mappings": "AAWA;AAEA;AACA;AACA;AACA;AAEA,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,IACF,WAAW;AAAA,EACf;AAAA,EACA,UAAU;AAAA,IACN,WAAW;AAAA,MACP,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,QACL,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,EACJ;AACJ;AAMO,aAAM,UAAU,CAAC,SAAoC;AACxD,SAAO;AAAA,2DACgD,KAAK;AAAA;AAAA,kBAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBlB;AAEO,aAAM,UAAU,CAAC,SAAoC;AACxD,SAAO;AAAA,2DACgD,KAAK;AAAA;AAAA,kBAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBlB;AACA,QAAQ,OAAO;AAAA,EACX,WAAW;AACf;",
6
+ "names": []
7
+ }
@@ -1,18 +1,7 @@
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 '@spectrum-web-components/dropzone/sp-dropzone.js';
13
- import { html } from 'lit';
14
- import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
15
- measureFixtureCreation(html `
1
+ import "@spectrum-web-components/dropzone/sp-dropzone.js";
2
+ import { html } from "lit";
3
+ import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
4
+ measureFixtureCreation(html`
16
5
  <sp-dropzone id="dropzone">
17
6
  <sp-illustrated-message heading="Drag and Drop Your File">
18
7
  <svg>
@@ -37,4 +26,4 @@ measureFixtureCreation(html `
37
26
  </div>
38
27
  </sp-dropzone>
39
28
  `);
40
- //# sourceMappingURL=test-basic.js.map
29
+ //# sourceMappingURL=test-basic.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"test-basic.js","sourceRoot":"","sources":["test-basic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;CAwB1B,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*/\n\nimport '@spectrum-web-components/dropzone/sp-dropzone.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-dropzone id=\"dropzone\">\n <sp-illustrated-message heading=\"Drag and Drop Your File\">\n <svg>\n <use xlink:href=\"geometry.svg#upload_geometry\" />\n </svg>\n </sp-illustrated-message>\n\n <div style=\"color: grey\">\n <div>\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div>\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </div>\n </sp-dropzone>\n`);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["test-basic.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 '@spectrum-web-components/dropzone/sp-dropzone.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-dropzone id=\"dropzone\">\n <sp-illustrated-message heading=\"Drag and Drop Your File\">\n <svg>\n <use xlink:href=\"geometry.svg#upload_geometry\" />\n </svg>\n </sp-illustrated-message>\n\n <div style=\"color: grey\">\n <div>\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input type=\"file\" id=\"file-input\" style=\"display: none\" />\n </div>\n <div>\n or\n <sp-link href=\"http://stock.adobe.com\" target=\"blank\">\n Search Adobe Stock\n </sp-link>\n </div>\n </div>\n </sp-dropzone>\n`);\n"],
5
+ "mappings": "AAYA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAwBtB;",
6
+ "names": []
7
+ }
@@ -1,15 +1,4 @@
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 * as stories from '../stories/dropzone.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('DropzoneStories', stories);
15
- //# sourceMappingURL=dropzone.test-vrt.js.map
1
+ import * as stories from "../stories/dropzone.stories.js";
2
+ import { regressVisuals } from "../../../test/visual/test.js";
3
+ regressVisuals("DropzoneStories", stories);
4
+ //# sourceMappingURL=dropzone.test-vrt.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"dropzone.test-vrt.js","sourceRoot":"","sources":["dropzone.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,iBAAiB,EAAE,OAAO,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*/\n\nimport * as stories from '../stories/dropzone.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('DropzoneStories', stories);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["dropzone.test-vrt.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 * as stories from '../stories/dropzone.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('DropzoneStories', stories);\n"],
5
+ "mappings": "AAYA;AACA;AAEA,eAAe,mBAAmB,OAAO;",
6
+ "names": []
7
+ }
@@ -1,21 +1,10 @@
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 '../sp-dropzone.js';
13
- import { illustration } from './test-svg.js';
14
- import { waitForPredicate } from '../../../test/testing-helpers.js';
15
- import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
16
- describe('Dropzone', () => {
17
- it('loads', async () => {
18
- const el = await fixture(html `
1
+ import "@spectrum-web-components/dropzone/sp-dropzone.js";
2
+ import { illustration } from "./test-svg.js";
3
+ import { waitForPredicate } from "../../../test/testing-helpers.js";
4
+ import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
5
+ describe("Dropzone", () => {
6
+ it("loads", async () => {
7
+ const el = await fixture(html`
19
8
  <sp-dropzone id="dropzone">
20
9
  <sp-illustrated-message heading="Drag and Drop Your File">
21
10
  ${illustration}
@@ -45,109 +34,104 @@ describe('Dropzone', () => {
45
34
  </div>
46
35
  </sp-dropzone>
47
36
  `);
48
- expect(el).to.not.equal(undefined);
49
- if (!el.shadowRoot)
50
- throw new Error('No shadowRoot');
51
- const slot = el.shadowRoot.querySelector('slot');
52
- expect(slot).to.not.equal(undefined);
53
- return true;
54
- });
55
- it('manages `dropEffects`', async () => {
56
- const el = await fixture(html `
37
+ expect(el).to.not.equal(void 0);
38
+ if (!el.shadowRoot)
39
+ throw new Error("No shadowRoot");
40
+ const slot = el.shadowRoot.querySelector("slot");
41
+ expect(slot).to.not.equal(void 0);
42
+ return true;
43
+ });
44
+ it("manages `dropEffects`", async () => {
45
+ const el = await fixture(html`
57
46
  <sp-dropzone id="dropzone"></sp-dropzone>
58
47
  `);
59
- await elementUpdated(el);
60
- expect(el.dropEffect).to.equal('copy');
61
- el.dropEffect = 'move';
62
- await elementUpdated(el);
63
- expect(el.dropEffect).to.equal('move');
64
- });
65
- it('manages `dragover` events', async () => {
66
- const el = await fixture(html `
48
+ await elementUpdated(el);
49
+ expect(el.dropEffect).to.equal("copy");
50
+ el.dropEffect = "move";
51
+ await elementUpdated(el);
52
+ expect(el.dropEffect).to.equal("move");
53
+ });
54
+ it("manages `dragover` events", async () => {
55
+ const el = await fixture(html`
67
56
  <sp-dropzone id="dropzone"></sp-dropzone>
68
57
  `);
69
- await elementUpdated(el);
70
- expect(el.isDragged).to.be.false;
71
- el.dispatchEvent(new DragEvent('dragover'));
72
- expect(el.isDragged).to.be.false;
73
- let dataTransfer = false;
74
- try {
75
- // Safari doesn't like this...
76
- dataTransfer = new DataTransfer();
77
- }
78
- catch (error) { }
79
- if (dataTransfer) {
80
- const dragOverEvent = new DragEvent('dragover', {
81
- dataTransfer,
82
- });
83
- el.dispatchEvent(dragOverEvent);
84
- expect(el.isDragged).to.be.true;
85
- // We should be able to make the following test here:
86
- // expect(dataTransfer.dropEffect).to.equal(el.dropEffect);
87
- // However, Chrome doesn't like it in the context of a test...
88
- }
89
- });
90
- it('allows `dragover` events to be canceled', async () => {
91
- const canceledDrag = (event) => {
92
- event.preventDefault();
93
- };
94
- const el = await fixture(html `
58
+ await elementUpdated(el);
59
+ expect(el.isDragged).to.be.false;
60
+ el.dispatchEvent(new DragEvent("dragover"));
61
+ expect(el.isDragged).to.be.false;
62
+ let dataTransfer = false;
63
+ try {
64
+ dataTransfer = new DataTransfer();
65
+ } catch (error) {
66
+ }
67
+ if (dataTransfer) {
68
+ const dragOverEvent = new DragEvent("dragover", {
69
+ dataTransfer
70
+ });
71
+ el.dispatchEvent(dragOverEvent);
72
+ expect(el.isDragged).to.be.true;
73
+ }
74
+ });
75
+ it("allows `dragover` events to be canceled", async () => {
76
+ const canceledDrag = (event) => {
77
+ event.preventDefault();
78
+ };
79
+ const el = await fixture(html`
95
80
  <sp-dropzone
96
81
  id="dropzone"
97
82
  @sp-dropzone-should-accept=${canceledDrag}
98
83
  ></sp-dropzone>
99
84
  `);
100
- await elementUpdated(el);
101
- expect(el.isDragged).to.be.false;
102
- let dataTransfer = false;
103
- try {
104
- // Safari doesn't like this...
105
- dataTransfer = new DataTransfer();
106
- }
107
- catch (error) { }
108
- if (dataTransfer) {
109
- const dragOverEvent = new DragEvent('dragover', {
110
- dataTransfer,
111
- });
112
- el.dispatchEvent(dragOverEvent);
113
- expect(el.isDragged).to.be.false;
114
- expect(dataTransfer.dropEffect).to.not.equal(el.dropEffect);
115
- expect(dataTransfer.dropEffect).to.equal('none');
116
- }
117
- });
118
- it('manages `dragleave` events via debounce', async () => {
119
- let dragLeftCount = 0;
120
- const onDragLeave = () => {
121
- dragLeftCount += 1;
122
- };
123
- const el = await fixture(html `
85
+ await elementUpdated(el);
86
+ expect(el.isDragged).to.be.false;
87
+ let dataTransfer = false;
88
+ try {
89
+ dataTransfer = new DataTransfer();
90
+ } catch (error) {
91
+ }
92
+ if (dataTransfer) {
93
+ const dragOverEvent = new DragEvent("dragover", {
94
+ dataTransfer
95
+ });
96
+ el.dispatchEvent(dragOverEvent);
97
+ expect(el.isDragged).to.be.false;
98
+ expect(dataTransfer.dropEffect).to.not.equal(el.dropEffect);
99
+ expect(dataTransfer.dropEffect).to.equal("none");
100
+ }
101
+ });
102
+ it("manages `dragleave` events via debounce", async () => {
103
+ let dragLeftCount = 0;
104
+ const onDragLeave = () => {
105
+ dragLeftCount += 1;
106
+ };
107
+ const el = await fixture(html`
124
108
  <sp-dropzone
125
109
  id="dropzone"
126
110
  @sp-dropzone-dragleave=${onDragLeave}
127
111
  ></sp-dropzone>
128
112
  `);
129
- await elementUpdated(el);
130
- expect(dragLeftCount).to.equal(0);
131
- el.dispatchEvent(new DragEvent('dragleave'));
132
- el.dispatchEvent(new DragEvent('dragleave'));
133
- await waitForPredicate(() => dragLeftCount === 1);
134
- expect(dragLeftCount).to.equal(1);
135
- });
136
- it('manages `dragleave` events', async () => {
137
- let dropped = false;
138
- const onDrop = () => {
139
- dropped = true;
140
- };
141
- const el = await fixture(html `
113
+ await elementUpdated(el);
114
+ expect(dragLeftCount).to.equal(0);
115
+ el.dispatchEvent(new DragEvent("dragleave"));
116
+ el.dispatchEvent(new DragEvent("dragleave"));
117
+ await waitForPredicate(() => dragLeftCount === 1);
118
+ expect(dragLeftCount).to.equal(1);
119
+ });
120
+ it("manages `dragleave` events", async () => {
121
+ let dropped = false;
122
+ const onDrop = () => {
123
+ dropped = true;
124
+ };
125
+ const el = await fixture(html`
142
126
  <sp-dropzone
143
127
  id="dropzone"
144
128
  @sp-dropzone-drop=${onDrop}
145
129
  ></sp-dropzone>
146
130
  `);
147
- await elementUpdated(el);
148
- expect(dropped).to.be.false;
149
- el.dispatchEvent(new DragEvent('drop'));
150
- expect(dropped).to.be.true;
151
- });
131
+ await elementUpdated(el);
132
+ expect(dropped).to.be.false;
133
+ el.dispatchEvent(new DragEvent("drop"));
134
+ expect(dropped).to.be.true;
135
+ });
152
136
  });
153
- //# sourceMappingURL=dropzone.test.js.map
137
+ //# sourceMappingURL=dropzone.test.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"dropzone.test.js","sourceRoot":"","sources":["dropzone.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QACnB,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;;0BAGU,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;aA0BzB,CACJ,CAAC;QACF,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrD,MAAM,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAoB,CAAC;QACpE,MAAM,CAAC,IAAI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AAC,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 '../sp-dropzone.js';\nimport { Dropzone } from '../';\nimport { illustration } from './test-svg.js';\nimport { waitForPredicate } from '../../../test/testing-helpers.js';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ndescribe('Dropzone', () => {\n it('loads', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\">\n <sp-illustrated-message heading=\"Drag and Drop Your File\">\n ${illustration}\n </sp-illustrated-message>\n\n <div style=\"color: grey\">\n <div>\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input\n type=\"file\"\n id=\"file-input\"\n style=\"display: none\"\n />\n </div>\n <div>\n or\n <sp-link\n href=\"http://stock.adobe.com\"\n target=\"blank\"\n >\n Search Adobe Stock\n </sp-link>\n </div>\n </div>\n </sp-dropzone>\n `\n );\n expect(el).to.not.equal(undefined);\n if (!el.shadowRoot) throw new Error('No shadowRoot');\n const slot = el.shadowRoot.querySelector('slot') as HTMLSlotElement;\n expect(slot).to.not.equal(undefined);\n return true;\n });\n it('manages `dropEffects`', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\"></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.dropEffect).to.equal('copy');\n\n el.dropEffect = 'move';\n\n await elementUpdated(el);\n\n expect(el.dropEffect).to.equal('move');\n });\n it('manages `dragover` events', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\"></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.isDragged).to.be.false;\n\n el.dispatchEvent(new DragEvent('dragover'));\n\n expect(el.isDragged).to.be.false;\n\n let dataTransfer: DataTransfer | boolean = false;\n try {\n // Safari doesn't like this...\n dataTransfer = new DataTransfer();\n } catch (error) {}\n if (dataTransfer) {\n const dragOverEvent = new DragEvent('dragover', {\n dataTransfer,\n });\n\n el.dispatchEvent(dragOverEvent);\n\n expect(el.isDragged).to.be.true;\n // We should be able to make the following test here:\n // expect(dataTransfer.dropEffect).to.equal(el.dropEffect);\n // However, Chrome doesn't like it in the context of a test...\n }\n });\n it('allows `dragover` events to be canceled', async () => {\n const canceledDrag = (event: DragEvent): void => {\n event.preventDefault();\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-should-accept=${canceledDrag}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.isDragged).to.be.false;\n\n let dataTransfer: DataTransfer | boolean = false;\n try {\n // Safari doesn't like this...\n dataTransfer = new DataTransfer();\n } catch (error) {}\n if (dataTransfer) {\n const dragOverEvent = new DragEvent('dragover', {\n dataTransfer,\n });\n\n el.dispatchEvent(dragOverEvent);\n\n expect(el.isDragged).to.be.false;\n expect(dataTransfer.dropEffect).to.not.equal(el.dropEffect);\n expect(dataTransfer.dropEffect).to.equal('none');\n }\n });\n it('manages `dragleave` events via debounce', async () => {\n let dragLeftCount = 0;\n const onDragLeave = (): void => {\n dragLeftCount += 1;\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-dragleave=${onDragLeave}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(dragLeftCount).to.equal(0);\n\n el.dispatchEvent(new DragEvent('dragleave'));\n el.dispatchEvent(new DragEvent('dragleave'));\n\n await waitForPredicate(() => dragLeftCount === 1);\n\n expect(dragLeftCount).to.equal(1);\n });\n\n it('manages `dragleave` events', async () => {\n let dropped = false;\n const onDrop = (): void => {\n dropped = true;\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-drop=${onDrop}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(dropped).to.be.false;\n\n el.dispatchEvent(new DragEvent('drop'));\n\n expect(dropped).to.be.true;\n });\n});\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["dropzone.test.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 '@spectrum-web-components/dropzone/sp-dropzone.js';\nimport { Dropzone } from '@spectrum-web-components/dropzone';\nimport { illustration } from './test-svg.js';\nimport { waitForPredicate } from '../../../test/testing-helpers.js';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ndescribe('Dropzone', () => {\n it('loads', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\">\n <sp-illustrated-message heading=\"Drag and Drop Your File\">\n ${illustration}\n </sp-illustrated-message>\n\n <div style=\"color: grey\">\n <div>\n <label for=\"file-input\">\n <sp-link>Select a File</sp-link>\n from your computer\n </label>\n <input\n type=\"file\"\n id=\"file-input\"\n style=\"display: none\"\n />\n </div>\n <div>\n or\n <sp-link\n href=\"http://stock.adobe.com\"\n target=\"blank\"\n >\n Search Adobe Stock\n </sp-link>\n </div>\n </div>\n </sp-dropzone>\n `\n );\n expect(el).to.not.equal(undefined);\n if (!el.shadowRoot) throw new Error('No shadowRoot');\n const slot = el.shadowRoot.querySelector('slot') as HTMLSlotElement;\n expect(slot).to.not.equal(undefined);\n return true;\n });\n it('manages `dropEffects`', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\"></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.dropEffect).to.equal('copy');\n\n el.dropEffect = 'move';\n\n await elementUpdated(el);\n\n expect(el.dropEffect).to.equal('move');\n });\n it('manages `dragover` events', async () => {\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone id=\"dropzone\"></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.isDragged).to.be.false;\n\n el.dispatchEvent(new DragEvent('dragover'));\n\n expect(el.isDragged).to.be.false;\n\n let dataTransfer: DataTransfer | boolean = false;\n try {\n // Safari doesn't like this...\n dataTransfer = new DataTransfer();\n } catch (error) {}\n if (dataTransfer) {\n const dragOverEvent = new DragEvent('dragover', {\n dataTransfer,\n });\n\n el.dispatchEvent(dragOverEvent);\n\n expect(el.isDragged).to.be.true;\n // We should be able to make the following test here:\n // expect(dataTransfer.dropEffect).to.equal(el.dropEffect);\n // However, Chrome doesn't like it in the context of a test...\n }\n });\n it('allows `dragover` events to be canceled', async () => {\n const canceledDrag = (event: DragEvent): void => {\n event.preventDefault();\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-should-accept=${canceledDrag}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.isDragged).to.be.false;\n\n let dataTransfer: DataTransfer | boolean = false;\n try {\n // Safari doesn't like this...\n dataTransfer = new DataTransfer();\n } catch (error) {}\n if (dataTransfer) {\n const dragOverEvent = new DragEvent('dragover', {\n dataTransfer,\n });\n\n el.dispatchEvent(dragOverEvent);\n\n expect(el.isDragged).to.be.false;\n expect(dataTransfer.dropEffect).to.not.equal(el.dropEffect);\n expect(dataTransfer.dropEffect).to.equal('none');\n }\n });\n it('manages `dragleave` events via debounce', async () => {\n let dragLeftCount = 0;\n const onDragLeave = (): void => {\n dragLeftCount += 1;\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-dragleave=${onDragLeave}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(dragLeftCount).to.equal(0);\n\n el.dispatchEvent(new DragEvent('dragleave'));\n el.dispatchEvent(new DragEvent('dragleave'));\n\n await waitForPredicate(() => dragLeftCount === 1);\n\n expect(dragLeftCount).to.equal(1);\n });\n\n it('manages `dragleave` events', async () => {\n let dropped = false;\n const onDrop = (): void => {\n dropped = true;\n };\n const el = await fixture<Dropzone>(\n html`\n <sp-dropzone\n id=\"dropzone\"\n @sp-dropzone-drop=${onDrop}\n ></sp-dropzone>\n `\n );\n\n await elementUpdated(el);\n\n expect(dropped).to.be.false;\n\n el.dispatchEvent(new DragEvent('drop'));\n\n expect(dropped).to.be.true;\n });\n});\n"],
5
+ "mappings": "AAWA;AAEA;AACA;AACA;AAEA,SAAS,YAAY,MAAM;AACvB,KAAG,SAAS,YAAY;AACpB,UAAM,KAAK,MAAM,QACb;AAAA;AAAA;AAAA,0BAGc;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,aA2BlB;AACA,WAAO,EAAE,EAAE,GAAG,IAAI,MAAM,MAAS;AACjC,QAAI,CAAC,GAAG;AAAY,YAAM,IAAI,MAAM,eAAe;AACnD,UAAM,OAAO,GAAG,WAAW,cAAc,MAAM;AAC/C,WAAO,IAAI,EAAE,GAAG,IAAI,MAAM,MAAS;AACnC,WAAO;AAAA,EACX,CAAC;AACD,KAAG,yBAAyB,YAAY;AACpC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA,aAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,UAAU,EAAE,GAAG,MAAM,MAAM;AAErC,OAAG,a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