@spectrum-web-components/popover 0.10.0 → 0.11.1

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.
@@ -32,6 +32,18 @@
32
32
  }
33
33
  ],
34
34
  "members": [
35
+ {
36
+ "kind": "field",
37
+ "name": "dialog",
38
+ "type": {
39
+ "text": "boolean"
40
+ },
41
+ "privacy": "public",
42
+ "default": "false",
43
+ "description": "Whether the popover should manage the application\nof padding to its content or not.",
44
+ "attribute": "dialog",
45
+ "reflects": true
46
+ },
35
47
  {
36
48
  "kind": "field",
37
49
  "name": "open",
@@ -40,6 +52,7 @@
40
52
  },
41
53
  "privacy": "public",
42
54
  "default": "false",
55
+ "description": "Whether the popover is visible or not.",
43
56
  "attribute": "open",
44
57
  "reflects": true
45
58
  },
@@ -105,20 +118,22 @@
105
118
  "attribute": "placement"
106
119
  },
107
120
  {
121
+ "name": "dialog",
108
122
  "type": {
109
123
  "text": "boolean"
110
124
  },
111
- "description": "The open state of the popover",
112
- "name": "open",
113
125
  "default": "false",
114
- "fieldName": "open"
126
+ "description": "Whether the popover should manage the application\nof padding to its content or not.",
127
+ "fieldName": "dialog"
115
128
  },
116
129
  {
130
+ "name": "open",
117
131
  "type": {
118
- "text": "Boolean"
132
+ "text": "boolean"
119
133
  },
120
- "description": "Adds some padding to the popover",
121
- "name": "dialog"
134
+ "default": "false",
135
+ "description": "Whether the popover is visible or not.",
136
+ "fieldName": "open"
122
137
  },
123
138
  {
124
139
  "name": "tip",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/popover",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,17 +44,17 @@
44
44
  "lit-html"
45
45
  ],
46
46
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.4.5",
48
- "@spectrum-web-components/overlay": "^0.12.0",
47
+ "@spectrum-web-components/base": "^0.5.1",
48
+ "@spectrum-web-components/overlay": "^0.13.1",
49
49
  "tslib": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@spectrum-css/popover": "^3.0.5"
52
+ "@spectrum-css/popover": "^3.0.11"
53
53
  },
54
54
  "types": "./src/index.d.ts",
55
55
  "customElements": "custom-elements.json",
56
56
  "sideEffects": [
57
57
  "./sp-*.js"
58
58
  ],
59
- "gitHead": "12d891f3dc85e8de641804d8efc9ca06b7fdee2d"
59
+ "gitHead": "df3f333ee26a45f9fc247716b6e8ef051dca630b"
60
60
  }
package/src/Popover.d.ts CHANGED
@@ -4,11 +4,17 @@ import { OverlayDisplayQueryDetail, Placement } from '@spectrum-web-components/o
4
4
  * @element sp-popover
5
5
  *
6
6
  * @slot - content to display within the Popover
7
- * @attr {Boolean} open - The open state of the popover
8
- * @attr {Boolean} dialog - Adds some padding to the popover
9
7
  */
10
8
  export declare class Popover extends SpectrumElement {
11
9
  static get styles(): CSSResultArray;
10
+ /**
11
+ * Whether the popover should manage the application
12
+ * of padding to its content or not.
13
+ */
14
+ dialog: boolean;
15
+ /**
16
+ * Whether the popover is visible or not.
17
+ */
12
18
  open: boolean;
13
19
  /**
14
20
  * @type {"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "none"}
package/src/Popover.js CHANGED
@@ -10,18 +10,25 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
  import { __decorate } from "tslib";
13
- import { html, nothing, property, SpectrumElement, } from '@spectrum-web-components/base';
13
+ import { html, nothing, SpectrumElement, } from '@spectrum-web-components/base';
14
+ import { property } from '@spectrum-web-components/base/src/decorators.js';
14
15
  import popoverStyles from './popover.css.js';
15
16
  /**
16
17
  * @element sp-popover
17
18
  *
18
19
  * @slot - content to display within the Popover
19
- * @attr {Boolean} open - The open state of the popover
20
- * @attr {Boolean} dialog - Adds some padding to the popover
21
20
  */
22
21
  export class Popover extends SpectrumElement {
23
22
  constructor() {
24
23
  super(...arguments);
24
+ /**
25
+ * Whether the popover should manage the application
26
+ * of padding to its content or not.
27
+ */
28
+ this.dialog = false;
29
+ /**
30
+ * Whether the popover is visible or not.
31
+ */
25
32
  this.open = false;
26
33
  /**
27
34
  * @type {"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "none"}
@@ -77,6 +84,9 @@ export class Popover extends SpectrumElement {
77
84
  `;
78
85
  }
79
86
  }
87
+ __decorate([
88
+ property({ type: Boolean, reflect: true })
89
+ ], Popover.prototype, "dialog", void 0);
80
90
  __decorate([
81
91
  property({ type: Boolean, reflect: true })
82
92
  ], Popover.prototype, "open", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sourceRoot":"","sources":["Popover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,eAAe,GAElB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,OAAO,OAAQ,SAAQ,eAAe;IAA5C;;QAMW,SAAI,GAAG,KAAK,CAAC;QAEpB;;;WAGG;QAEI,cAAS,GAAc,MAAM,CAAC;QAG9B,QAAG,GAAG,KAAK,CAAC;IAiDvB,CAAC;IAhEU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3B,CAAC;IAeS,SAAS;QACf,OAAO,IAAI,CAAA;;;;;;;;;;;;;SAaV,CAAC;IACN,CAAC;IAEM,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IAEM,oBAAoB;QACvB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,CAAC;IAEM,cAAc,CAAC,KAA6C;QAC/D,oBAAoB;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO;QAE1B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAc,CAAC;QACpC,oBAAoB;QACpB,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO;QAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAgB,CAAC;QACxE,IAAI,UAAU,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,wBAAwB,GAAG,UAAU,CAAC;SACtD;IACL,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;;cAEL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO;SAC1C,CAAC;IACN,CAAC;CACJ;AA3DG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACvB;AAOpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACS;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oCACxB","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 nothing,\n property,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n * @attr {Boolean} open - The open state of the popover\n * @attr {Boolean} dialog - Adds some padding to the popover\n */\nexport class Popover extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('sp-overlay-query', this.onOverlayQuery);\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('sp-overlay-query', this.onOverlayQuery);\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n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U,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,wBAAwB,GAAG,UAAU,CAAC;SACtD;IACL,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;;cAEL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO;SAC1C,CAAC;IACN,CAAC;CACJ;AAjEG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACrB;AAMtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACvB;AAOpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACS;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oCACxB","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 nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('sp-overlay-query', this.onOverlayQuery);\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('sp-overlay-query', this.onOverlayQuery);\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"]}