@operato/popup 0.2.8 → 0.2.26

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/CHANGELOG.md CHANGED
@@ -3,6 +3,48 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.2.26](https://github.com/hatiolab/operato/compare/v0.2.25...v0.2.26) (2021-11-24)
7
+
8
+ **Note:** Version bump only for package @operato/popup
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.2.25](https://github.com/hatiolab/operato/compare/v0.2.24...v0.2.25) (2021-11-24)
15
+
16
+ **Note:** Version bump only for package @operato/popup
17
+
18
+
19
+
20
+
21
+
22
+ ### [0.2.15](https://github.com/hatiolab/operato/compare/v0.2.14...v0.2.15) (2021-11-21)
23
+
24
+
25
+ ### :bug: Bug Fix
26
+
27
+ * replace keycode to key for KeyboardEvent ([742d85a](https://github.com/hatiolab/operato/commit/742d85a104ea29dcaccc8f5ff1f42c527a2ac2af))
28
+
29
+
30
+
31
+ ### [0.2.10](https://github.com/hatiolab/operato/compare/v0.2.9...v0.2.10) (2021-11-15)
32
+
33
+
34
+ ### :bug: Bug Fix
35
+
36
+ * update eslint-config for open-wc ([1130c63](https://github.com/hatiolab/operato/commit/1130c6300da89612f7e55a9b61a348266bea0b96))
37
+
38
+
39
+
40
+ ### [0.2.9](https://github.com/hatiolab/operato/compare/v0.2.8...v0.2.9) (2021-11-06)
41
+
42
+ **Note:** Version bump only for package @operato/popup
43
+
44
+
45
+
46
+
47
+
6
48
  ### [0.2.8](https://github.com/hatiolab/operato/compare/v0.2.7...v0.2.8) (2021-11-05)
7
49
 
8
50
 
@@ -1,9 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { css, html } from 'lit';
3
- import { render } from 'lit-html';
4
3
  import { customElement, property } from 'lit/decorators.js';
5
- import { KEYCODE } from './const';
6
4
  import { Popup } from './ox-popup';
5
+ import { render } from 'lit-html';
7
6
  function focusClosest(element) {
8
7
  /* Find the closest focusable element. */
9
8
  const closest = element.closest('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
@@ -17,19 +16,24 @@ let PopupList = class PopupList extends Popup {
17
16
  this._onkeydown = function (e) {
18
17
  var _a;
19
18
  e.stopPropagation();
20
- switch (e.keyCode) {
21
- case KEYCODE.KEY_ESC:
19
+ switch (e.key) {
20
+ case 'Esc': // for IE/Edge
21
+ case 'Escape':
22
22
  this.close();
23
23
  break;
24
- case KEYCODE.KEY_LEFT:
25
- case KEYCODE.KEY_UP:
24
+ case 'Left': // for IE/Edge
25
+ case 'ArrowLeft':
26
+ case 'Up': // for IE/Edge
27
+ case 'ArrowUp':
26
28
  this.activeIndex--;
27
29
  break;
28
- case KEYCODE.KEY_RIGHT:
29
- case KEYCODE.KEY_DOWN:
30
+ case 'Right': // for IE/Edge
31
+ case 'ArrowRight':
32
+ case 'Down': // for IE/Edge
33
+ case 'ArrowDown':
30
34
  this.activeIndex++;
31
35
  break;
32
- case KEYCODE.KEY_ENTER:
36
+ case 'Enter':
33
37
  e.stopPropagation();
34
38
  var option = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest('[option]');
35
39
  if (option) {
@@ -1 +1 @@
1
- {"version":3,"file":"ox-popup-list.js","sourceRoot":"","sources":["../../src/ox-popup-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,SAAS,YAAY,CAAC,OAAoB;IACxC,yCAAyC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC7B,0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3B,CAAC;CACF,CAAA;AAjLQ,gBAAM,GAAG;IACd,GAAG,KAAK,CAAC,MAAM;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAwB;AAvDxC,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CAkLrB;SAlLY,SAAS","sourcesContent":["import { css, html, PropertyValues } from 'lit'\nimport { render } from 'lit-html'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { KEYCODE } from './const'\nimport { Popup } from './ox-popup'\n\nfunction focusClosest(element: HTMLElement) {\n /* Find the closest focusable element. */\n const closest = element.closest(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n ) as HTMLElement\n\n closest?.focus()\n\n return closest\n}\n\n@customElement('ox-popup-list')\nexport class PopupList extends Popup {\n static styles = [\n ...Popup.styles,\n css`\n :host {\n display: none;\n flex-direction: column;\n align-items: stretch;\n background-color: var(--theme-white-color, #fff);\n z-index: 100;\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n padding: 5px;\n\n color: var(--theme-primary-text-color, #3c3938);\n font: normal 14px 'Roboto', sans-serif;\n }\n\n :host([active]) {\n display: flex;\n }\n\n :host(*:focus) {\n outline: none;\n }\n\n ::slotted(*) {\n margin: 1px 0;\n padding: 4px 2px 3px 2px;\n }\n\n ::slotted(*:focus) {\n outline: none;\n }\n\n ::slotted([option]) {\n border-radius: 5px;\n }\n\n ::slotted([option][active]) {\n background-color: rgba(20, 154, 155, 0.1);\n cursor: pointer;\n }\n\n ::slotted([separator]) {\n height: 1px;\n width: 100%;\n padding: 0;\n background-color: rgba(0, 0, 0, 0.15);\n }\n ::slotted([option] > input) {\n border: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.3));\n }\n `\n ]\n\n @property({ type: Number }) activeIndex: number = 0\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupList, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.keyCode) {\n case KEYCODE.KEY_ESC:\n this.close()\n break\n\n case KEYCODE.KEY_LEFT:\n case KEYCODE.KEY_UP:\n this.activeIndex--\n break\n\n case KEYCODE.KEY_RIGHT:\n case KEYCODE.KEY_DOWN:\n this.activeIndex++\n break\n\n case KEYCODE.KEY_ENTER:\n e.stopPropagation()\n var option = (e.target as HTMLElement)?.closest('[option]')\n if (option) {\n this.select(option)\n }\n break\n }\n }.bind(this)\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: PopupList, e: FocusEvent) {\n const target = e.target as HTMLElement\n const to = e.relatedTarget as HTMLElement\n const from = target.closest('ox-popup-list')\n\n if (!to && from !== this) {\n e.stopPropagation()\n\n /* \"하위의 ox-popup-list 엘리먼트가 포커스를 잃었지만, 그 포커스를 받은 엘리먼트가 없다.\"는 의미는 그 서브메뉴가 클로즈된 것을 의미한다. */\n this.setActive(this.activeIndex)\n } else {\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, ox-popup-list는 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupList, e: MouseEvent) {\n e.stopPropagation()\n\n const option = (e.target as HTMLElement)?.closest('[option]')\n if (option) {\n this.setActive(option)\n this.select(option)\n }\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('activeIndex')) {\n this.setActive(this.activeIndex)\n }\n }\n\n select(option: Element) {\n option.dispatchEvent(new CustomEvent('selected', { bubbles: true, composed: true, detail: this }))\n\n if (!option.hasAttribute('alive-on-select') && !this.hasAttribute('alive-on-select')) {\n this.close()\n }\n }\n\n setActive(active: number | Element | null) {\n const options = Array.from(this.querySelectorAll(':scope > [option]'))\n\n options.map(async (option, index) => {\n if (typeof active === 'number' && index === (active + options.length) % options.length) {\n option.setAttribute('active', '')\n focusClosest(option as HTMLElement)\n\n this.activeIndex = index\n } else if (active === option) {\n this.activeIndex = index\n } else {\n option.removeAttribute('active')\n }\n })\n }\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup-list') as PopupList\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner\n\n owner.appendChild(target)\n }\n}\n"]}
1
+ {"version":3,"file":"ox-popup-list.js","sourceRoot":"","sources":["../../src/ox-popup-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,SAAS,YAAY,CAAC,OAAoB;IACxC,yCAAyC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC7B,0EAA0E,CAC5D,CAAA;IAEhB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAA;IAEhB,OAAO,OAAO,CAAA;AAChB,CAAC;AAGD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,KAAK;IAApC;;QAuD8B,gBAAW,GAAW,CAAC,CAAA;QAMzC,eAAU,GAA+B,UAA2B,CAAgB;;YAC5F,CAAC,CAAC,eAAe,EAAE,CAAA;YAEnB,QAAQ,CAAC,CAAC,GAAG,EAAE;gBACb,KAAK,KAAK,CAAC,CAAC,cAAc;gBAC1B,KAAK,QAAQ;oBACX,IAAI,CA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B,SAAS,CAuLrB;SAvLY,SAAS","sourcesContent":["import { PropertyValues, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Popup } from './ox-popup'\nimport { render } from 'lit-html'\n\nfunction focusClosest(element: HTMLElement) {\n /* Find the closest focusable element. */\n const closest = element.closest(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n ) as HTMLElement\n\n closest?.focus()\n\n return closest\n}\n\n@customElement('ox-popup-list')\nexport class PopupList extends Popup {\n static styles = [\n ...Popup.styles,\n css`\n :host {\n display: none;\n flex-direction: column;\n align-items: stretch;\n background-color: var(--theme-white-color, #fff);\n z-index: 100;\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n padding: 5px;\n\n color: var(--theme-primary-text-color, #3c3938);\n font: normal 14px 'Roboto', sans-serif;\n }\n\n :host([active]) {\n display: flex;\n }\n\n :host(*:focus) {\n outline: none;\n }\n\n ::slotted(*) {\n margin: 1px 0;\n padding: 4px 2px 3px 2px;\n }\n\n ::slotted(*:focus) {\n outline: none;\n }\n\n ::slotted([option]) {\n border-radius: 5px;\n }\n\n ::slotted([option][active]) {\n background-color: rgba(20, 154, 155, 0.1);\n cursor: pointer;\n }\n\n ::slotted([separator]) {\n height: 1px;\n width: 100%;\n padding: 0;\n background-color: rgba(0, 0, 0, 0.15);\n }\n ::slotted([option] > input) {\n border: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.3));\n }\n `\n ]\n\n @property({ type: Number }) activeIndex: number = 0\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupList, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.key) {\n case 'Esc': // for IE/Edge\n case 'Escape':\n this.close()\n break\n\n case 'Left': // for IE/Edge\n case 'ArrowLeft':\n case 'Up': // for IE/Edge\n case 'ArrowUp':\n this.activeIndex--\n break\n\n case 'Right': // for IE/Edge\n case 'ArrowRight':\n case 'Down': // for IE/Edge\n case 'ArrowDown':\n this.activeIndex++\n break\n\n case 'Enter':\n e.stopPropagation()\n var option = (e.target as HTMLElement)?.closest('[option]')\n if (option) {\n this.select(option)\n }\n break\n }\n }.bind(this)\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: PopupList, e: FocusEvent) {\n const target = e.target as HTMLElement\n const to = e.relatedTarget as HTMLElement\n const from = target.closest('ox-popup-list')\n\n if (!to && from !== this) {\n e.stopPropagation()\n\n /* \"하위의 ox-popup-list 엘리먼트가 포커스를 잃었지만, 그 포커스를 받은 엘리먼트가 없다.\"는 의미는 그 서브메뉴가 클로즈된 것을 의미한다. */\n this.setActive(this.activeIndex)\n } else {\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, ox-popup-list는 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupList, e: MouseEvent) {\n e.stopPropagation()\n\n const option = (e.target as HTMLElement)?.closest('[option]')\n if (option) {\n this.setActive(option)\n this.select(option)\n }\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('activeIndex')) {\n this.setActive(this.activeIndex)\n }\n }\n\n select(option: Element) {\n option.dispatchEvent(new CustomEvent('selected', { bubbles: true, composed: true, detail: this }))\n\n if (!option.hasAttribute('alive-on-select') && !this.hasAttribute('alive-on-select')) {\n this.close()\n }\n }\n\n setActive(active: number | Element | null) {\n const options = Array.from(this.querySelectorAll(':scope > [option]'))\n\n options.map(async (option, index) => {\n if (typeof active === 'number' && index === (active + options.length) % options.length) {\n option.setAttribute('active', '')\n focusClosest(option as HTMLElement)\n\n this.activeIndex = index\n } else if (active === option) {\n this.activeIndex = index\n } else {\n option.removeAttribute('active')\n }\n })\n }\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup-list') as PopupList\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner\n\n owner.appendChild(target)\n }\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { css, html } from 'lit';
3
- import { render } from 'lit-html';
4
3
  import { customElement, property } from 'lit/decorators.js';
5
- import { KEYCODE } from './const';
6
4
  import { Popup } from './ox-popup';
5
+ import { render } from 'lit-html';
7
6
  function focusClosest(element) {
8
7
  /* Find the closest focusable element. */
9
8
  const closest = element.closest('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
@@ -17,19 +16,24 @@ let PopupMenu = class PopupMenu extends Popup {
17
16
  this._onkeydown = function (e) {
18
17
  var _a;
19
18
  e.stopPropagation();
20
- switch (e.keyCode) {
21
- case KEYCODE.KEY_ESC:
22
- case KEYCODE.KEY_LEFT:
19
+ switch (e.key) {
20
+ case 'Esc': // for IE/Edge
21
+ case 'Escape':
22
+ case 'Left': // for IE/Edge
23
+ case 'ArrowLeft':
23
24
  this.close();
24
25
  break;
25
- case KEYCODE.KEY_UP:
26
+ case 'Up': // for IE/Edge
27
+ case 'ArrowUp':
26
28
  this.activeIndex--;
27
29
  break;
28
- case KEYCODE.KEY_RIGHT:
29
- case KEYCODE.KEY_DOWN:
30
+ case 'Right': // for IE/Edge
31
+ case 'ArrowRight':
32
+ case 'Down': // for IE/Edge
33
+ case 'ArrowDown':
30
34
  this.activeIndex++;
31
35
  break;
32
- case KEYCODE.KEY_ENTER:
36
+ case 'Enter':
33
37
  e.stopPropagation();
34
38
  var menu = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest('[menu], ox-popup-menuitem');
35
39
  if (menu) {
@@ -1 +1 @@
1
- {"version":3,"file":"ox-popup-menu.js","sourceRoot":"","sources":["../../src/ox-popup-menu.ts"],"names":[],"mappings":";AAAA,OAAO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ACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,EACV,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,MAAM,EAMP;QACC,MAAM,KAAK,GAAG,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAA;QACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAc,CAAA;QACnE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAExB,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAA;QAC/B,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;QAE7B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAEjC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;QAEtB,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;CACF,CAAA;AAzLQ,gBAAM,GAAG;IACd,GAAG,KAAK,CAAC,MAAM;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAwB;AAzDxC,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CA0LrB;SA1LY,SAAS","sourcesContent":["import { css, html, PropertyValues } from 'lit'\nimport { render } from 'lit-html'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { KEYCODE } from './const'\nimport { Popup } from './ox-popup'\n\nfunction focusClosest(element: HTMLElement) {\n /* Find the closest focusable element. */\n const closest = element.closest(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n ) as HTMLElement\n\n closest?.focus()\n\n return closest\n}\n\n@customElement('ox-popup-menu')\nexport class PopupMenu extends Popup {\n static styles = [\n ...Popup.styles,\n css`\n :host {\n display: none;\n flex-direction: column;\n align-items: stretch;\n background-color: var(--theme-white-color, #fff);\n z-index: 100;\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n padding: 5px;\n\n color: var(--theme-primary-text-color, #3c3938);\n font: normal 14px 'Roboto', sans-serif;\n }\n\n :host([active]) {\n display: flex;\n }\n\n :host(*:focus) {\n outline: none;\n }\n\n ::slotted(*) {\n margin: 1px 0;\n padding: 4px 2px 3px 2px;\n }\n\n ::slotted(*:focus) {\n outline: none;\n }\n\n ::slotted([menu]),\n ::slotted(ox-popup-menuitem) {\n border-radius: 5px;\n }\n\n ::slotted([menu][active]),\n ::slotted(ox-popup-menuitem[active]) {\n background-color: rgba(20, 154, 155, 0.1);\n cursor: pointer;\n }\n\n ::slotted([separator]) {\n height: 1px;\n width: 100%;\n padding: 0;\n background-color: rgba(0, 0, 0, 0.15);\n }\n ::slotted([menu] > input) {\n border: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.3));\n }\n `\n ]\n\n @property({ type: Number }) activeIndex: number = 0\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenu, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.keyCode) {\n case KEYCODE.KEY_ESC:\n case KEYCODE.KEY_LEFT:\n this.close()\n break\n\n case KEYCODE.KEY_UP:\n this.activeIndex--\n break\n\n case KEYCODE.KEY_RIGHT:\n case KEYCODE.KEY_DOWN:\n this.activeIndex++\n break\n\n case KEYCODE.KEY_ENTER:\n e.stopPropagation()\n var menu = (e.target as HTMLElement)?.closest('[menu], ox-popup-menuitem')\n if (menu) {\n this.select(menu)\n }\n break\n }\n }.bind(this)\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: PopupMenu, e: FocusEvent) {\n const target = e.target as HTMLElement\n const to = e.relatedTarget as HTMLElement\n const from = target.closest('ox-popup-menu')\n\n if (!to && from !== this) {\n e.stopPropagation()\n\n /* \"하위의 POPUP-MENU 엘리먼트가 포커스를 잃었지만, 그 포커스를 받은 엘리먼트가 없다.\"는 의미는 그 서브메뉴가 클로즈된 것을 의미한다. */\n this.setActive(this.activeIndex)\n } else {\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, popup-menu는 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupMenu, e: MouseEvent) {\n e.stopPropagation()\n\n const menu = (e.target as HTMLElement)?.closest('[menu], ox-popup-menuitem')\n if (menu) {\n this.setActive(menu)\n this.select(menu)\n }\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('activeIndex')) {\n this.setActive(this.activeIndex)\n }\n }\n\n select(menu: Element) {\n menu.dispatchEvent(new CustomEvent('selected'))\n if (!menu.hasAttribute('alive-on-select')) {\n this.dispatchEvent(new CustomEvent('ox-close', { bubbles: true, composed: true, detail: this }))\n }\n }\n\n setActive(active: number | Element | null) {\n const menus = Array.from(this.querySelectorAll(':scope > ox-popup-menuitem, :scope > [menu]'))\n\n menus.map(async (menu, index) => {\n if (typeof active === 'number' && index === (active + menus.length) % menus.length) {\n menu.setAttribute('active', '')\n focusClosest(menu as HTMLElement)\n\n this.activeIndex = index\n } else if (active === menu) {\n if (this.activeIndex === index) {\n /* 메뉴의 update를 유도하기 위해서 강제로 토글시킴 */\n menu.removeAttribute('active')\n await this.updateComplete\n menu.setAttribute('active', '')\n }\n\n this.activeIndex = index\n } else {\n menu.removeAttribute('active')\n }\n })\n }\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup-menu') as PopupMenu\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner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AY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;iBAChC;gBAED,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;aACzB;iBAAM;gBACL,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;aAC/B;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,EACV,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,MAAM,EAMP;QACC,MAAM,KAAK,GAAG,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAA;QACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAc,CAAA;QACnE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAExB,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,IAAI,CAAA;QAC/B,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;QAE7B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAEjC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;QAEtB,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;CACF,CAAA;AA9LQ,gBAAM,GAAG;IACd,GAAG,KAAK,CAAC,MAAM;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmDF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAwB;AAzDxC,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CA+LrB;SA/LY,SAAS","sourcesContent":["import { PropertyValues, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Popup } from './ox-popup'\nimport { render } from 'lit-html'\n\nfunction focusClosest(element: HTMLElement) {\n /* Find the closest focusable element. */\n const closest = element.closest(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n ) as HTMLElement\n\n closest?.focus()\n\n return closest\n}\n\n@customElement('ox-popup-menu')\nexport class PopupMenu extends Popup {\n static styles = [\n ...Popup.styles,\n css`\n :host {\n display: none;\n flex-direction: column;\n align-items: stretch;\n background-color: var(--theme-white-color, #fff);\n z-index: 100;\n box-shadow: 2px 3px 10px 5px rgba(0, 0, 0, 0.15);\n padding: 5px;\n\n color: var(--theme-primary-text-color, #3c3938);\n font: normal 14px 'Roboto', sans-serif;\n }\n\n :host([active]) {\n display: flex;\n }\n\n :host(*:focus) {\n outline: none;\n }\n\n ::slotted(*) {\n margin: 1px 0;\n padding: 4px 2px 3px 2px;\n }\n\n ::slotted(*:focus) {\n outline: none;\n }\n\n ::slotted([menu]),\n ::slotted(ox-popup-menuitem) {\n border-radius: 5px;\n }\n\n ::slotted([menu][active]),\n ::slotted(ox-popup-menuitem[active]) {\n background-color: rgba(20, 154, 155, 0.1);\n cursor: pointer;\n }\n\n ::slotted([separator]) {\n height: 1px;\n width: 100%;\n padding: 0;\n background-color: rgba(0, 0, 0, 0.15);\n }\n ::slotted([menu] > input) {\n border: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.3));\n }\n `\n ]\n\n @property({ type: Number }) activeIndex: number = 0\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenu, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.key) {\n case 'Esc': // for IE/Edge\n case 'Escape':\n case 'Left': // for IE/Edge\n case 'ArrowLeft':\n this.close()\n break\n\n case 'Up': // for IE/Edge\n case 'ArrowUp':\n this.activeIndex--\n break\n\n case 'Right': // for IE/Edge\n case 'ArrowRight':\n case 'Down': // for IE/Edge\n case 'ArrowDown':\n this.activeIndex++\n break\n\n case 'Enter':\n e.stopPropagation()\n var menu = (e.target as HTMLElement)?.closest('[menu], ox-popup-menuitem')\n if (menu) {\n this.select(menu)\n }\n break\n }\n }.bind(this)\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: PopupMenu, e: FocusEvent) {\n const target = e.target as HTMLElement\n const to = e.relatedTarget as HTMLElement\n const from = target.closest('ox-popup-menu')\n\n if (!to && from !== this) {\n e.stopPropagation()\n\n /* \"하위의 POPUP-MENU 엘리먼트가 포커스를 잃었지만, 그 포커스를 받은 엘리먼트가 없다.\"는 의미는 그 서브메뉴가 클로즈된 것을 의미한다. */\n this.setActive(this.activeIndex)\n } else {\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, popup-menu는 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupMenu, e: MouseEvent) {\n e.stopPropagation()\n\n const menu = (e.target as HTMLElement)?.closest('[menu], ox-popup-menuitem')\n if (menu) {\n this.setActive(menu)\n this.select(menu)\n }\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('activeIndex')) {\n this.setActive(this.activeIndex)\n }\n }\n\n select(menu: Element) {\n menu.dispatchEvent(new CustomEvent('selected'))\n if (!menu.hasAttribute('alive-on-select')) {\n this.dispatchEvent(new CustomEvent('ox-close', { bubbles: true, composed: true, detail: this }))\n }\n }\n\n setActive(active: number | Element | null) {\n const menus = Array.from(this.querySelectorAll(':scope > ox-popup-menuitem, :scope > [menu]'))\n\n menus.map(async (menu, index) => {\n if (typeof active === 'number' && index === (active + menus.length) % menus.length) {\n menu.setAttribute('active', '')\n focusClosest(menu as HTMLElement)\n\n this.activeIndex = index\n } else if (active === menu) {\n if (this.activeIndex === index) {\n /* 메뉴의 update를 유도하기 위해서 강제로 토글시킴 */\n menu.removeAttribute('active')\n await this.updateComplete\n menu.setAttribute('active', '')\n }\n\n this.activeIndex = index\n } else {\n menu.removeAttribute('active')\n }\n })\n }\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup-menu') as PopupMenu\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner\n\n owner.appendChild(target)\n }\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, LitElement } from 'lit';
2
+ import { LitElement, css, html } from 'lit';
3
3
  import { customElement, property, state } from 'lit/decorators.js';
4
- import { KEYCODE } from './const';
5
4
  let PopupMenuItem = class PopupMenuItem extends LitElement {
6
5
  constructor() {
7
6
  super(...arguments);
@@ -21,16 +20,18 @@ let PopupMenuItem = class PopupMenuItem extends LitElement {
21
20
  });
22
21
  }.bind(this);
23
22
  this._onkeydown = function (e) {
24
- switch (e.keyCode) {
25
- case KEYCODE.KEY_RIGHT:
23
+ switch (e.key) {
24
+ case 'Right':
25
+ case 'ArrowRight':
26
26
  e.stopPropagation();
27
27
  this.expand(false);
28
28
  break;
29
- case KEYCODE.KEY_LEFT:
29
+ case 'Left':
30
+ case 'ArrowLeft':
30
31
  e.stopPropagation();
31
32
  this.collapseSelf();
32
33
  break;
33
- case KEYCODE.KEY_ENTER:
34
+ case 'Enter':
34
35
  if (this._submenu) {
35
36
  e.stopPropagation();
36
37
  this.expand(false);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-popup-menuitem.js","sourceRoot":"","sources":["../../src/ox-popup-menuitem.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAIjC,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,UAAU;IAA7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EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACrG,CAAC;IAED,KAAK;QACH,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClG,CAAC;CACF,CAAA;AAnJQ,oBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCF;CACF,CAAA;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAe;AAEjC;IAAR,KAAK,EAAE;+CAAqB;AAhDlB,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAoJzB;SApJY,aAAa","sourcesContent":["import { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { KEYCODE } from './const'\nimport { PopupMenu } from './ox-popup-menu'\n\n@customElement('ox-popup-menuitem')\nexport class PopupMenuItem extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: row;\n position: relative;\n align-items: center;\n }\n\n [icon] {\n width: 20px;\n display: flex;\n flex-direction: row;\n padding: 0;\n margin: 0 4px 0 0;\n align-items: center;\n justify-content: center;\n }\n\n [icon] > * {\n flex: 1;\n }\n\n [label] {\n flex: 1;\n text-transform: capitalize;\n }\n\n ::slotted(*[slot='icon']) {\n color: var(--secondary-color, #476172);\n font-size: 18px;\n }\n\n mwc-icon {\n display: block;\n width: 24px;\n text-align: right;\n font-size: 18px;\n color: var(--theme-primary-text-color, #3c3938);\n opacity: 0.7;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: String }) label!: string\n\n @state() _submenu?: PopupMenu\n\n render() {\n return html`\n <div icon>\n <slot name=\"icon\"> </slot>\n </div>\n <div label>${this.label}</div>\n\n ${this._submenu ? html`<mwc-icon>chevron_right</mwc-icon>` : html``}\n\n <slot @slotchange=${this._onslotchange}> </slot>\n `\n }\n\n firstUpdated() {\n this.setAttribute('tabindex', '0')\n this.addEventListener('keydown', this._onkeydown)\n this.addEventListener('click', this._onclick)\n }\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupMenuItem, e: MouseEvent) {\n if (!this._submenu) {\n return\n }\n\n e.stopPropagation()\n\n const parent = this.closest('ox-popup-menu') as PopupMenu\n if (parent) {\n parent.setActive(this)\n }\n\n this.dispatchEvent(new CustomEvent('selected'))\n\n requestAnimationFrame(() => {\n this.expand(false)\n })\n }.bind(this)\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenuItem, e: KeyboardEvent) {\n switch (e.keyCode) {\n case KEYCODE.KEY_RIGHT:\n e.stopPropagation()\n this.expand(false)\n break\n\n case KEYCODE.KEY_LEFT:\n e.stopPropagation()\n this.collapseSelf()\n break\n\n case KEYCODE.KEY_ENTER:\n if (this._submenu) {\n e.stopPropagation()\n this.expand(false)\n }\n break\n }\n }.bind(this)\n\n protected _onslotchange: (e: Event) => void = function (this: PopupMenuItem, e: Event) {\n this._submenu = this.querySelector('ox-popup-menu') as PopupMenu\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('active')) {\n this.updateActive()\n }\n }\n\n updateActive() {\n if (this.active) {\n this.expand(true)\n } else {\n this.collapse()\n }\n }\n\n expand(silent: boolean) {\n if (!this._submenu) {\n return\n }\n\n const top = 0\n const left = this.offsetWidth + 8\n this._submenu.open({ top, left, silent })\n }\n\n collapse() {\n this._submenu?.close()\n }\n\n collapseSelf() {\n this.dispatchEvent(new CustomEvent('ox-collapse', { bubbles: true, composed: true, detail: this }))\n }\n\n close() {\n this.dispatchEvent(new CustomEvent('ox-close', { bubbles: true, composed: true, detail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,CAAC,WAAW,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IAC3C,CAAC;IAED,QAAQ;;QACN,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,EAAE,CAAA;IACxB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACrG,CAAC;IAED,KAAK;QACH,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClG,CAAC;CACF,CAAA;AArJQ,oBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwCF;CACF,CAAA;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAe;AAEjC;IAAR,KAAK,EAAE;+CAAqB;AAhDlB,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAsJzB;SAtJY,aAAa","sourcesContent":["import { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { PopupMenu } from './ox-popup-menu'\n\n@customElement('ox-popup-menuitem')\nexport class PopupMenuItem extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: row;\n position: relative;\n align-items: center;\n }\n\n [icon] {\n width: 20px;\n display: flex;\n flex-direction: row;\n padding: 0;\n margin: 0 4px 0 0;\n align-items: center;\n justify-content: center;\n }\n\n [icon] > * {\n flex: 1;\n }\n\n [label] {\n flex: 1;\n text-transform: capitalize;\n }\n\n ::slotted(*[slot='icon']) {\n color: var(--secondary-color, #476172);\n font-size: 18px;\n }\n\n mwc-icon {\n display: block;\n width: 24px;\n text-align: right;\n font-size: 18px;\n color: var(--theme-primary-text-color, #3c3938);\n opacity: 0.7;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: String }) label!: string\n\n @state() _submenu?: PopupMenu\n\n render() {\n return html`\n <div icon>\n <slot name=\"icon\"> </slot>\n </div>\n <div label>${this.label}</div>\n\n ${this._submenu ? html`<mwc-icon>chevron_right</mwc-icon>` : html``}\n\n <slot @slotchange=${this._onslotchange}> </slot>\n `\n }\n\n firstUpdated() {\n this.setAttribute('tabindex', '0')\n this.addEventListener('keydown', this._onkeydown)\n this.addEventListener('click', this._onclick)\n }\n\n protected _onclick: (e: MouseEvent) => void = function (this: PopupMenuItem, e: MouseEvent) {\n if (!this._submenu) {\n return\n }\n\n e.stopPropagation()\n\n const parent = this.closest('ox-popup-menu') as PopupMenu\n if (parent) {\n parent.setActive(this)\n }\n\n this.dispatchEvent(new CustomEvent('selected'))\n\n requestAnimationFrame(() => {\n this.expand(false)\n })\n }.bind(this)\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenuItem, e: KeyboardEvent) {\n switch (e.key) {\n case 'Right':\n case 'ArrowRight':\n e.stopPropagation()\n this.expand(false)\n break\n\n case 'Left':\n case 'ArrowLeft':\n e.stopPropagation()\n this.collapseSelf()\n break\n\n case 'Enter':\n if (this._submenu) {\n e.stopPropagation()\n this.expand(false)\n }\n break\n }\n }.bind(this)\n\n protected _onslotchange: (e: Event) => void = function (this: PopupMenuItem, e: Event) {\n this._submenu = this.querySelector('ox-popup-menu') as PopupMenu\n }.bind(this)\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('active')) {\n this.updateActive()\n }\n }\n\n updateActive() {\n if (this.active) {\n this.expand(true)\n } else {\n this.collapse()\n }\n }\n\n expand(silent: boolean) {\n if (!this._submenu) {\n return\n }\n\n const top = 0\n const left = this.offsetWidth + 8\n this._submenu.open({ top, left, silent })\n }\n\n collapse() {\n this._submenu?.close()\n }\n\n collapseSelf() {\n this.dispatchEvent(new CustomEvent('ox-collapse', { bubbles: true, composed: true, detail: this }))\n }\n\n close() {\n this.dispatchEvent(new CustomEvent('ox-close', { bubbles: true, composed: true, detail: this }))\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, LitElement } from 'lit';
3
- import { render } from 'lit-html';
2
+ import { LitElement, css, html } from 'lit';
4
3
  import { customElement, state } from 'lit/decorators.js';
5
- import { KEYCODE } from './const';
4
+ import { render } from 'lit-html';
6
5
  let Popup = class Popup extends LitElement {
7
6
  constructor() {
8
7
  super(...arguments);
@@ -16,8 +15,9 @@ let Popup = class Popup extends LitElement {
16
15
  }.bind(this);
17
16
  this._onkeydown = function (e) {
18
17
  e.stopPropagation();
19
- switch (e.keyCode) {
20
- case KEYCODE.KEY_ESC:
18
+ switch (e.key) {
19
+ case 'Esc': // for IE/Edge
20
+ case 'Escape':
21
21
  this.close();
22
22
  break;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ox-popup.js","sourceRoot":"","sources":["../../src/ox-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGjC,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,UAAU;IAArC;;QA0BY,gBAAW,GAA4B,UAAuB,CAAa;YACnF,MAAM,EAAE,GAAG,CAAC,CAAC,aAA4B,CAAA;YAEz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EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAEtD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC9B,OAAO,IAAI,CAAC,OAAO,CAAA;SACpB;IACH,CAAC;CACF,CAAA;AAlKQ,YAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,CAAA;AAEQ;IAAR,KAAK,EAAE;sCAAkB;AApBf,KAAK;IADjB,aAAa,CAAC,UAAU,CAAC;GACb,KAAK,CAmKjB;SAnKY,KAAK","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { render } from 'lit-html'\nimport { customElement, state } from 'lit/decorators.js'\n\nimport { KEYCODE } from './const'\n\n@customElement('ox-popup')\nexport class Popup extends LitElement {\n static styles = [\n css`\n :host {\n position: absolute;\n display: none;\n background-color: white;\n z-index: 100;\n }\n\n :host([active]) {\n display: block;\n }\n\n :host(*:focus) {\n outline: none;\n }\n `\n ]\n\n @state() _parent?: Element\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: Popup, e: FocusEvent) {\n const to = e.relatedTarget as HTMLElement\n\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, ox-popup은 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }.bind(this)\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: Popup, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.keyCode) {\n case KEYCODE.KEY_ESC:\n this.close()\n break\n }\n }.bind(this)\n\n protected _onkeyup: (e: KeyboardEvent) => void = function (this: Popup, e: KeyboardEvent) {\n e.stopPropagation()\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: Popup, e: MouseEvent) {\n e.stopPropagation()\n }.bind(this)\n\n protected _onclose: (e: Event) => void = function (this: Popup, e: Event) {\n this.close()\n }.bind(this)\n\n protected _oncollapse: (e: Event) => void = function (this: Popup, e: Event) {\n e.stopPropagation()\n this.close()\n }.bind(this)\n\n protected _onwindowblur: (e: Event) => void = function (this: Popup, e: Event) {\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n\n this.addEventListener('focusout', this._onfocusout)\n this.addEventListener('keydown', this._onkeydown)\n this.addEventListener('keyup', this._onkeyup)\n this.addEventListener('click', this._onclick)\n this.addEventListener('ox-close', this._onclose)\n this.addEventListener('ox-collapse', this._oncollapse)\n\n /* When the window is out of focus, all pop-ups should disappear. */\n window.addEventListener('blur', this._onwindowblur)\n\n this.setAttribute('tabindex', '0') // make this element focusable\n this.guaranteeFocus()\n }\n\n /**\n * Configuration for opening ox-popup\n *\n * @typedef {Object} PopupOpenOptions\n * @property {HTMLTemplate} template HTMLTemplate to be displayed inside the popup\n * @property {Number} top The position-top where the pop-up will be displayed\n * @property {Number} left The position-left where the pop-up will be displayed\n * @property {HTMLElement} parent Popup's parent element\n */\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup') as Popup\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner\n owner.appendChild(target)\n }\n\n open({ left = 0, top = 0, silent = false }: { left?: number; top?: number; silent?: boolean }) {\n this.style.left = `${left}px`\n this.style.top = `${top}px`\n\n this.setAttribute('active', '')\n\n !silent && this.guaranteeFocus()\n }\n\n guaranteeFocus() {\n const focusible = this.querySelector(\n ':scope > button, :scope > [href], :scope > input, :scope > select, :scope > textarea, :scope > [tabindex]:not([tabindex=\"-1\"])'\n )\n\n if (focusible) {\n ;(focusible as HTMLElement).focus()\n } else {\n this.focus()\n }\n }\n\n close() {\n this.removeAttribute('active')\n\n if (this._parent) {\n /* this case is when the popup is opened by Popup.open(...) */\n this.removeEventListener('focusout', this._onfocusout)\n this.removeEventListener('keydown', this._onkeydown)\n this.removeEventListener('keyup', this._onkeyup)\n this.removeEventListener('click', this._onclick)\n this.removeEventListener('ox-close', this._onclose)\n this.removeEventListener('ox-collapse', this._oncollapse)\n\n window.removeEventListener('blur', this._onwindowblur)\n\n this._parent.removeChild(this)\n delete this._parent\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-popup.js","sourceRoot":"","sources":["../../src/ox-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,UAAU;IAArC;;QA0BY,gBAAW,GAA4B,UAAuB,CAAa;YACnF,MAAM,EAAE,GAAG,CAAC,CAAC,aAA4B,CAAA;YAEzC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBACtB,sDAAsD;gBACtD,uBAAuB;gBACvB,CAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE,CAAA;aACpC;QACH,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEF,eAAU,GAA+B,UAAuB,CAAgB;YACxF,CAAC,CAAC,eAAe,EAAE,CAAA;YAEnB,QAAQ,CAAC,CAAC,GAAG,EAAE;gBACb,KAAK,KAAK,CAAC,CAAC,cAAc;gBAC1B,KAAK,QAAQ;oBACX,IAAI,CAAC,KAAK,EAAE,CAAA;oBACZ,MAAK;aACR;QACH,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEF,aAAQ,GAA+B,UAAuB,CAAgB;YACtF,CAAC,CAAC,eAAe,EAAE,CAAA;QACrB,CAAC,CAAC,IAA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AAC,KAAK,EAAE,CAAA;SACpC;aAAM;YACL,IAAI,CAAC,KAAK,EAAE,CAAA;SACb;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;QAE9B,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,8DAA8D;YAC9D,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;YACtD,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;YACpD,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAChD,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAChD,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACnD,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;YAEzD,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAEtD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC9B,OAAO,IAAI,CAAC,OAAO,CAAA;SACpB;IACH,CAAC;CACF,CAAA;AAnKQ,YAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,CAAA;AAEQ;IAAR,KAAK,EAAE;sCAAkB;AApBf,KAAK;IADjB,aAAa,CAAC,UAAU,CAAC;GACb,KAAK,CAoKjB;SApKY,KAAK","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\nimport { render } from 'lit-html'\n\n@customElement('ox-popup')\nexport class Popup extends LitElement {\n static styles = [\n css`\n :host {\n position: absolute;\n display: none;\n background-color: white;\n z-index: 100;\n }\n\n :host([active]) {\n display: block;\n }\n\n :host(*:focus) {\n outline: none;\n }\n `\n ]\n\n @state() _parent?: Element\n\n render() {\n return html` <slot> </slot> `\n }\n\n protected _onfocusout: (e: FocusEvent) => void = function (this: Popup, e: FocusEvent) {\n const to = e.relatedTarget as HTMLElement\n\n if (!this.contains(to)) {\n /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, ox-popup은 닫혀야 한다. */\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }\n }.bind(this)\n\n protected _onkeydown: (e: KeyboardEvent) => void = function (this: Popup, e: KeyboardEvent) {\n e.stopPropagation()\n\n switch (e.key) {\n case 'Esc': // for IE/Edge\n case 'Escape':\n this.close()\n break\n }\n }.bind(this)\n\n protected _onkeyup: (e: KeyboardEvent) => void = function (this: Popup, e: KeyboardEvent) {\n e.stopPropagation()\n }.bind(this)\n\n protected _onclick: (e: MouseEvent) => void = function (this: Popup, e: MouseEvent) {\n e.stopPropagation()\n }.bind(this)\n\n protected _onclose: (e: Event) => void = function (this: Popup, e: Event) {\n this.close()\n }.bind(this)\n\n protected _oncollapse: (e: Event) => void = function (this: Popup, e: Event) {\n e.stopPropagation()\n this.close()\n }.bind(this)\n\n protected _onwindowblur: (e: Event) => void = function (this: Popup, e: Event) {\n // @ts-ignore for debug\n !window.POPUP_DEBUG && this.close()\n }.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n\n this.addEventListener('focusout', this._onfocusout)\n this.addEventListener('keydown', this._onkeydown)\n this.addEventListener('keyup', this._onkeyup)\n this.addEventListener('click', this._onclick)\n this.addEventListener('ox-close', this._onclose)\n this.addEventListener('ox-collapse', this._oncollapse)\n\n /* When the window is out of focus, all pop-ups should disappear. */\n window.addEventListener('blur', this._onwindowblur)\n\n this.setAttribute('tabindex', '0') // make this element focusable\n this.guaranteeFocus()\n }\n\n /**\n * Configuration for opening ox-popup\n *\n * @typedef {Object} PopupOpenOptions\n * @property {HTMLTemplate} template HTMLTemplate to be displayed inside the popup\n * @property {Number} top The position-top where the pop-up will be displayed\n * @property {Number} left The position-left where the pop-up will be displayed\n * @property {HTMLElement} parent Popup's parent element\n */\n\n /**\n * Open Popup\n *\n * @param {PopupOpenOptions}\n */\n static open({\n template,\n top,\n left,\n parent\n }: {\n template: unknown\n top: number\n left: number\n parent?: Element | null\n }) {\n const owner = parent || document.body\n const target = document.createElement('ox-popup') as Popup\n render(template, target)\n\n target.style.left = `${left}px`\n target.style.top = `${top}px`\n\n target.setAttribute('active', '')\n\n target._parent = owner\n owner.appendChild(target)\n }\n\n open({ left = 0, top = 0, silent = false }: { left?: number; top?: number; silent?: boolean }) {\n this.style.left = `${left}px`\n this.style.top = `${top}px`\n\n this.setAttribute('active', '')\n\n !silent && this.guaranteeFocus()\n }\n\n guaranteeFocus() {\n const focusible = this.querySelector(\n ':scope > button, :scope > [href], :scope > input, :scope > select, :scope > textarea, :scope > [tabindex]:not([tabindex=\"-1\"])'\n )\n\n if (focusible) {\n ;(focusible as HTMLElement).focus()\n } else {\n this.focus()\n }\n }\n\n close() {\n this.removeAttribute('active')\n\n if (this._parent) {\n /* this case is when the popup is opened by Popup.open(...) */\n this.removeEventListener('focusout', this._onfocusout)\n this.removeEventListener('keydown', this._onkeydown)\n this.removeEventListener('keyup', this._onkeyup)\n this.removeEventListener('click', this._onclick)\n this.removeEventListener('ox-close', this._onclose)\n this.removeEventListener('ox-collapse', this._oncollapse)\n\n window.removeEventListener('blur', this._onwindowblur)\n\n this._parent.removeChild(this)\n delete this._parent\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/const.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@lit/reactive-element/decorators/base.d.ts","../../../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../../../node_modules/@lit/reactive-element/decorators/property.d.ts","../../../node_modules/@lit/reactive-element/decorators/state.d.ts","../../../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../../../node_modules/@lit/reactive-element/decorators/query.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../../../node_modules/lit/decorators.d.ts","../src/ox-popup.ts","../src/ox-popup-list.ts","../src/ox-popup-menu.ts","../src/ox-popup-menuitem.ts","../src/index.ts","../stories/index.stories.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/get-diffable-html.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/index.d.ts","../../../node_modules/chai-a11y-axe/chai-a11y-axe-plugin.d.ts","../../../node_modules/chai-a11y-axe/src/accessible.d.ts","../../../node_modules/chai-a11y-axe/index.d.ts","../../../node_modules/@types/chai-dom/index.d.ts","../../../node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@open-wc/testing/register-chai-plugins.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/elementupdated.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-html/directive.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-html/lit-html.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-element/lit-element.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/litfixture.d.ts","../../../node_modules/@open-wc/dedupe-mixin/index.d.ts","../../../node_modules/@open-wc/scoped-elements/node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/types.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/scopedelementsmixin.d.ts","../../../node_modules/@open-wc/scoped-elements/types/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixturewrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/helpers.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/stringfixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/index.d.ts","../../../node_modules/@open-wc/testing/index.d.ts","../test/ox-popup-menu.test.ts","../test/ox-popup.test.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","4386b221786b9008d0d6fa24d5ab0892831bd87bf74c1f2e03b1ee137361fbbe","0c8a56610b08f55e29ffb466cd27626ad6dbe822312a398026e82270c63088e3","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","3bdd9bf64c082a3977eda98dcd9c7dc3253532d45e957a7f869539129a04005c","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"70f04c91d3186b1b10157157887fab664968fc9b88377785a5ee42750c202c6d","06e20da1bc94df355f22ac7a9533c2488816ec4cb9134d9b160a263629a07072","c311ef8d8b159d0c268b415f78c1949498dc2d14455a9891c5b8ef84625b1e41","f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","97c58f6db61d45712d91d2260994817ae2b568bbb37cc280013079b6b5d2232d","ac388c7c7a262213a3700451bc921e382a93fb27c0252c34ccf03540b4ce044b","9bdb35d0b28dcd5d8f0879bd29f0cf07b7eb48aa63be4dd44057e32fcfeb1c83","fb0107c83e2e0e75b77dacd0c3c6c3ab6844e98dce2a8f858c6f0a57c12136a6","84610cf09dee3cefc910555318f1ad7b45f1cba36905a86849324ca4fead2385","a25d1e52291791819032826af5c52987e16ffdb96e8bb69f7f1790f5ab080be6","d660961abada6b5030461f3322ef3a2e1d9fec74167574f8b590a7796cf90a72","707b4eae3d469b2f347d2083037151922f94c370a9456ebd5ac0a4fb7441c7e7","ef509d57201aa4e2e3e2b3d1fafd066a8ce68cd2caea737d539c3544f5a99a67","84c66a77a1302611ea5001dc88d10de1b5d87c6b2f30a48585495217421ce1ac","f60afac582e976621184b4a92722c203f0c4682c4eb0b8e2db3926ca5f67bd13","fb23b449e964bbaa7fd7df760123350cbe272dede0fc01dd1f7be1e6bfd6325b","92dd8cfa881594b3f25d994a7c82bf77ab69b1bcadc5a527d66c07b61e36a083","97607c02fa0e2df624b61bafd602896e31ac5d933ba5e1b7d98dc44139cf5c18","43ec169fb4888e6ef41c55b5d6f37d54033a3bedf7b3314b5251a9ef886ed9d3","74fdb00025eb66240c558c5941c105d8bc2df5b8e79cbd95522b93f0765f48ef",{"version":"f7834c76f2d4db5fb156f2f18fdf855431843cf0d32620fcf24b836cd4a85096","affectsGlobalScope":true},"8a659f7d82d932649a78f89643c5b436953424a219d705d49b8b3d9ccd6e35ff",{"version":"75cd6dce1c5f87511772c891de86d0c9e6829e6273dea9f92a5bec9d0479d1e7","affectsGlobalScope":true},{"version":"cd711db43a952f15464b571ac11b7a440332cd52342bc92c4bf908c70688f57f","affectsGlobalScope":true},"9d8709c916778cb34830708ed47b78e9a46d1fb2eb73a682b14eee990bed4aa6",{"version":"5d90911f942229eb9049feab241739a5ced76f137948f8f42a615e5f01d4e7ea","affectsGlobalScope":true},"999a90d30a3183dcee987d0a5a7c586aba5bacbf6ce087ba8635124082ccfeea","8a5878edd52f4a720560b4c6e6247e9ddc3df6118ad9cf2f9927903b03d5f440",{"version":"d95d76d79a0351572ec5b1a6cc1e5c4bce1be82eedeed7278d6f31ea1059fa69","affectsGlobalScope":true},"6b40029289530423f407a22755c85b81740f9acfd88d2b53564f8c1657c26660","15b043358a9bac56ee6a567d61adf545b3a09e2f2ead9c3ef3cc617ed3522e71",{"version":"b98f6185455945922c7cfdad772ec1c46e5c169a2d71aca6530e041f77665f03","affectsGlobalScope":true},"65b91a3725399231d3469529b5e27b85bf2aa98013e607f308e5fe260b47eeff","a11181f6d68200e83ccb1fb48b262a7132a3257e0a230f41c9dc4c351964297a","0c8a56610b08f55e29ffb466cd27626ad6dbe822312a398026e82270c63088e3","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a",{"version":"a25a80c5c07b61db0d40c5baba89c6584048536596e7e3ee7c632c46f641d932","affectsGlobalScope":true},"70f04c91d3186b1b10157157887fab664968fc9b88377785a5ee42750c202c6d","a0c7f94ed02009f741ef243b7adbfced3d1d2e2d79ea4d16af73946fac25dbf4",{"version":"f1bfa18deca3c5a0e2763c2757debee18626820315f50ab551d9cb283eb9a49f","affectsGlobalScope":true},"f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","245731ddcde842fa1024619d54409f90128bb64070c6729088697944dbc58bd5","88cda4269c54f0803834fd62b2fac61af8bff7a085693f7ca9df85c1f19dee8a",{"version":"a25a80c5c07b61db0d40c5baba89c6584048536596e7e3ee7c632c46f641d932","affectsGlobalScope":true},{"version":"494f93d7c6e2178b8e0f53cc10977d2913753a6d7442907022b970d5c0a13d05","affectsGlobalScope":true},"8acb762a884708f254d0bfa25565c14c2a5b79d3767a13d03563ebf6520d0385","fdf0aa1a72ff0188a9013926201a391116ef6701cd439b89850786abdf755fb8","f0b43f422b01042dd784bee89f9c67330001a575258bb49d28fd56e1a581e92e","abf9ea97b78a7b239186cf5b7ed59c4a593abac3c408c8c95fc5e604cfdfdb43","ae91c9161caf0af81c89e780a045fc5ea8382407e516342e409c5db9161d3b32","2c387828a523cc77a4300f5deb063651c9346c5a36ccfbfc127c38df8ab45b0c","d598157512ae6e0d3aa6bb0dd261ae34845831dccf7bc7739695ee2589eb76f5","88740fc0276ac55a747251bc46c2ed96bf8d7455b0a800eff33b1a16df2b36e8","d2173e08898108c0aaa6dbfed27725b4a71f5817153800c86f03fa06456a2fc7","6e3d4b09fff332f804c02afb2fe878e49d593cfb61628dceed482145853a8d5c","20e1391c91714828f5e9ede65dfe3e8445a9c147420a50a1ef3a351d1759b9db","31c268bcfbbb3a89dd4019ff8001069024921c2c0fb73bccc6f8e6f2da7bff09","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"34f1d0e1f63dd8c0bdc1fd15ec2b7216fd709953781c4d1b1213d88e2d94db9e","affectsGlobalScope":true},"4be51d991034b331db6a518e5a9607cb136b6d3ab2a691191a7d481354836a5f",{"version":"fa56e5f529c26a31207fecafbfd88136936868a4c17f8a347f0e8e6ea18309ad","affectsGlobalScope":true},"2f3a95a0e681afcde084379ed3b404ee09971425cf4600c3dd8b6f4adf058896","3fe5750809a130a0c9ee5dbca9e262913a10d1deda3ddb1280a77b099197e937",{"version":"d7e32c36d30042b47cd8620b197d3e3381954cf8baa413dc4273796e4cf718a1","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","41a3a8f7ba70f6e10fad838a363157217163bd897416480d0ed516b5d63e727e","53cf527b7d4a7ee1c16eeadff678d6df9f2a98cd5ece18f0f9211d8080204734","0038ccd1c90bc523ee4f7eeabc3f4082a48a5775415855e46f142447b9ad1114","aacb7a1f78d635e42d1112144c83508f340722e5293f7f14091581193618dca3","87c064559d14068edb2861fc7d48c1a8196a63523e00cc29aadd57c0eefb24a5","226afbe8d2d18dc02d1aebb449af0a11a278acb98b42c763aeec6d5a8e654441",{"version":"c3a43212afe9781a304d8f5dd3895fd38a143ac46fb64b4d343122e38c83a9ab","affectsGlobalScope":true},"15bd9405b2d4353f043fa12442758a51aba5146d407aea031118605af9799032","01862fc59b8c037ea9fe03c6f3dc1ffc95bfc16fb37d58d6e7603706b9041d97","2163cfbd3438e495c08fb59b29740b1f96c7aec8ebb4faf9c9156f4fe94cb501","644a9cb29158878e67199d04c06699575d03812c90ea40c69d5a075fb8ec6b79","1f66294c9e9c24e84552cfaa70a27422811649de5a2efc69d3cf2ef38e833308","a82a261dac2131e55347889de6846a3e84741283d93d6525550ab3976be85cf6",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"1207275e727d14356922953c0597c77acad13e9812a0109a756c0c59ff0e87f3","dce04e108fbcbe674bceeea757269b7775a8a07693d6a58f55b36e649541675a","c90911387c5e9e024c309e63a14946a9bc3c71293e8f9d09eece16e11f167974","066f0de5d2acf0be06eb29a5ada8107f93891d7a983e6ba095260406650d742d",{"version":"6ae884f4861da8949f2c466b2d44fb087b2f1de82fe3449c3c52bd1d8cf998e6","affectsGlobalScope":true},"cbe717c2735bf2a6ceb29c2131232e74f4f95878072873dfb263566035024f99","5fd00b0ad7ef4e7eb69341da6ec17400922860afbdbc2cc46a37eba833d8a0bd","bc0c9dbd2b273d9466a31143a5f0118e8902232d906b3987d19d1bd67b96ee5d","757fec48e36f86c8b791b770c31f510d0e53817a95f61130df26df57cb382113","c5274b1cfbfb2610697727d460147756b686139af95cc487d894bc1c41133254","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"caa0d6f003d642fab06c4a90ac3c86ad0889b7693294e04360e935ed5376796b","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","28e6ac6505a2b6755ce0752cd4d2dbd880e0e4e9bbfeaa3c777821825db2711a",{"version":"8a4f510bad5e5f5312fd966d20675381a3467c0c8d1b528b7f8e5ebb732ba1c9","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","8ee0dfa79a0b3e43bd5c0554157051abd87ef47df49884eba3e6a10bba1ecdc1","dcbcf0056d7bcd4e716bd0cc9223913e58373095c4750250f525694d88f49962","715b8aedc97884235eac2346481e7f1cca0379f870a58a60d22f444f8b7c59a8","3dfbe800bece5d51c4a4abf726598bf4aa80b19ae4e8288ada7cf75efdc40930","2ac6c37c23dbb6a87d0657fbaa509bd077dd4ea066fecff1e94a01e19410d8c6","5d50d7b266824bd435c9696f71d64041db90667b6f95d5285adfa6946a73dde5","58250ab8b2768e6d713bb8271d4d1ed1029069bb94631764538a474fe1cb1eca","b9d6227d9cf5e2aac16c149377136b01e8692c0f82f185f6192c78285236e71d","555122eabf41efe584457b407892ed4420c5dc5404004eafed8bc365459f1eef","56f3ed639ae070160aaa79a626e0f956374c7dcd2093216f48cc952981ea2e93",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b77af427289204692955d5095b9c3c8505881678879fa3c8c89b6cce7babb9ee",{"version":"c4c03cf65951d980ba618ae9601d10438730803fc9c8a1f7b34af8739981e205","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5},"fileIdsList":[[146],[44,146],[51,146],[44,51,146],[42,43,146],[81,82,146],[92,146],[83,89,91,146],[83,89,146],[67,68,146],[69,146],[68,70,146],[83,85,146],[85,146],[46,84,146],[83,85,86,146],[80,87,88,95,96,97,98,146],[88,93,146],[94,146],[89,146],[87,94,146],[67,79,99,146],[71,74,75,78,146],[67,146],[103,146],[106,146],[107,112,146],[108,118,119,126,135,145,146],[108,109,118,126,146],[110,146],[111,112,119,127,146],[112,135,142,146],[113,115,118,126,146],[114,146],[115,116,146],[117,118,146],[118,146],[118,119,120,135,145,146],[118,119,120,135,146],[121,126,135,145,146],[118,119,121,122,126,135,142,145,146],[121,123,135,142,145,146],[103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152],[118,124,146],[125,145,146],[115,118,126,135,146],[127,146],[128,146],[106,129,146],[130,144,146,150],[131,146],[132,146],[118,133,146],[133,134,146,148],[118,135,136,137,146],[135,137,146],[135,136,146],[138,146],[139,146],[118,140,141,146],[140,141,146],[112,126,142,146],[143,146],[126,144,146],[107,121,132,145,146],[112,146],[135,146,147],[146,148],[146,149],[107,112,118,120,129,135,145,146,148,150],[135,146,151],[67,77,146],[76,146],[45,146],[73,146],[72,146],[44,48,146],[48,146],[46,47,146],[52,53,54,55,56,57,58,59,146],[44,48,49,146],[40,146],[40,61,62,63,64,146],[40,41,48,50,60,61,146],[40,41,50,60,63,146],[40,41,48,50,60,146],[40,50,61,146],[40,50,63,100,146],[40,50,61,100,146]],"referencedMap":[[42,1],[51,2],[52,3],[55,4],[53,4],[57,4],[59,4],[58,4],[56,4],[54,3],[43,1],[44,5],[89,1],[90,6],[93,7],[92,8],[91,9],[69,10],[70,11],[68,1],[71,12],[81,1],[82,1],[83,6],[86,13],[84,14],[85,15],[87,16],[99,17],[80,1],[94,18],[95,19],[96,1],[97,20],[88,21],[98,19],[100,22],[79,23],[76,1],[75,24],[67,1],[154,1],[103,25],[104,25],[106,26],[107,27],[108,28],[109,29],[110,30],[111,31],[112,32],[113,33],[114,34],[115,35],[116,35],[117,36],[118,37],[119,38],[120,39],[105,1],[152,1],[121,40],[122,41],[123,42],[153,43],[124,44],[125,45],[126,46],[127,47],[128,48],[129,49],[130,50],[131,51],[132,52],[133,53],[134,54],[135,55],[137,56],[136,57],[138,58],[139,59],[140,60],[141,61],[142,62],[143,63],[144,64],[145,65],[146,66],[147,67],[148,68],[149,69],[150,70],[151,71],[78,72],[77,73],[46,74],[45,1],[72,24],[74,75],[73,76],[49,77],[47,78],[48,79],[60,80],[50,81],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[41,82],[65,83],[62,84],[63,84],[64,85],[61,86],[66,87],[101,88],[102,89]],"exportedModulesMap":[[42,1],[51,2],[52,3],[55,4],[53,4],[57,4],[59,4],[58,4],[56,4],[54,3],[43,1],[44,5],[89,1],[90,6],[93,7],[92,8],[91,9],[69,10],[70,11],[68,1],[71,12],[81,1],[82,1],[83,6],[86,13],[84,14],[85,15],[87,16],[99,17],[80,1],[94,18],[95,19],[96,1],[97,20],[88,21],[98,19],[100,22],[79,23],[76,1],[75,24],[67,1],[154,1],[103,25],[104,25],[106,26],[107,27],[108,28],[109,29],[110,30],[111,31],[112,32],[113,33],[114,34],[115,35],[116,35],[117,36],[118,37],[119,38],[120,39],[105,1],[152,1],[121,40],[122,41],[123,42],[153,43],[124,44],[125,45],[126,46],[127,47],[128,48],[129,49],[130,50],[131,51],[132,52],[133,53],[134,54],[135,55],[137,56],[136,57],[138,58],[139,59],[140,60],[141,61],[142,62],[143,63],[144,64],[145,65],[146,66],[147,67],[148,68],[149,69],[150,70],[151,71],[78,72],[77,73],[46,74],[45,1],[72,24],[74,75],[73,76],[49,77],[47,78],[48,79],[60,80],[50,81],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[41,82],[65,83],[62,84],[63,84],[64,85],[61,86],[66,87],[101,88],[102,89]],"semanticDiagnosticsPerFile":[42,51,52,55,53,57,59,58,56,54,43,44,89,90,93,92,91,69,70,68,71,81,82,83,86,84,85,87,99,80,94,95,96,97,88,98,100,79,76,75,67,154,103,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,105,152,121,122,123,153,124,125,126,127,128,129,130,131,132,133,134,135,137,136,138,139,140,141,142,143,144,145,146,147,148,149,150,151,78,77,46,45,72,74,73,49,47,48,60,50,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,41,65,62,63,64,61,66,101,102]},"version":"4.4.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@lit/reactive-element/decorators/base.d.ts","../../../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../../../node_modules/@lit/reactive-element/decorators/property.d.ts","../../../node_modules/@lit/reactive-element/decorators/state.d.ts","../../../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../../../node_modules/@lit/reactive-element/decorators/query.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../../../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../../../node_modules/lit/decorators.d.ts","../src/ox-popup.ts","../src/ox-popup-list.ts","../src/ox-popup-menu.ts","../src/ox-popup-menuitem.ts","../src/index.ts","../stories/index.stories.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/get-diffable-html.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/index.d.ts","../../../node_modules/chai-a11y-axe/chai-a11y-axe-plugin.d.ts","../../../node_modules/chai-a11y-axe/src/accessible.d.ts","../../../node_modules/chai-a11y-axe/index.d.ts","../../../node_modules/@types/chai-dom/index.d.ts","../../../node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@open-wc/testing/register-chai-plugins.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/elementupdated.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-html/directive.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-html/lit-html.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit-element/lit-element.d.ts","../../../node_modules/@open-wc/testing-helpers/node_modules/lit/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/litfixture.d.ts","../../../node_modules/@open-wc/dedupe-mixin/index.d.ts","../../../node_modules/@open-wc/scoped-elements/node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/types.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/scopedelementsmixin.d.ts","../../../node_modules/@open-wc/scoped-elements/types/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixturewrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/helpers.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/stringfixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/index.d.ts","../../../node_modules/@open-wc/testing/index.d.ts","../test/ox-popup-menu.test.ts","../test/ox-popup.test.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","0c8a56610b08f55e29ffb466cd27626ad6dbe822312a398026e82270c63088e3","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","3bdd9bf64c082a3977eda98dcd9c7dc3253532d45e957a7f869539129a04005c","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"70f04c91d3186b1b10157157887fab664968fc9b88377785a5ee42750c202c6d","06e20da1bc94df355f22ac7a9533c2488816ec4cb9134d9b160a263629a07072","c311ef8d8b159d0c268b415f78c1949498dc2d14455a9891c5b8ef84625b1e41","f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","97c58f6db61d45712d91d2260994817ae2b568bbb37cc280013079b6b5d2232d","ac388c7c7a262213a3700451bc921e382a93fb27c0252c34ccf03540b4ce044b","9bdb35d0b28dcd5d8f0879bd29f0cf07b7eb48aa63be4dd44057e32fcfeb1c83","fb0107c83e2e0e75b77dacd0c3c6c3ab6844e98dce2a8f858c6f0a57c12136a6","84610cf09dee3cefc910555318f1ad7b45f1cba36905a86849324ca4fead2385","a25d1e52291791819032826af5c52987e16ffdb96e8bb69f7f1790f5ab080be6","d660961abada6b5030461f3322ef3a2e1d9fec74167574f8b590a7796cf90a72","707b4eae3d469b2f347d2083037151922f94c370a9456ebd5ac0a4fb7441c7e7","ef509d57201aa4e2e3e2b3d1fafd066a8ce68cd2caea737d539c3544f5a99a67","84c66a77a1302611ea5001dc88d10de1b5d87c6b2f30a48585495217421ce1ac","0baa1f2b0fa207545f02687e89ca89280982f2a92103fdde0468e32539f1b676","de17eb357b7e2f0138da67b8054647a16face812a41366949138fe5baef3235d","ddb0dbff2d26b42db0598966c3b05c64397f625305a2c02eceeadc90540e11e3","226047443fd66cdbcab702142557c6ab22458702b52f73c9ddc1e0ae39dae14c","43ec169fb4888e6ef41c55b5d6f37d54033a3bedf7b3314b5251a9ef886ed9d3","74fdb00025eb66240c558c5941c105d8bc2df5b8e79cbd95522b93f0765f48ef",{"version":"f7834c76f2d4db5fb156f2f18fdf855431843cf0d32620fcf24b836cd4a85096","affectsGlobalScope":true},"8a659f7d82d932649a78f89643c5b436953424a219d705d49b8b3d9ccd6e35ff",{"version":"75cd6dce1c5f87511772c891de86d0c9e6829e6273dea9f92a5bec9d0479d1e7","affectsGlobalScope":true},{"version":"cd711db43a952f15464b571ac11b7a440332cd52342bc92c4bf908c70688f57f","affectsGlobalScope":true},"9d8709c916778cb34830708ed47b78e9a46d1fb2eb73a682b14eee990bed4aa6",{"version":"5d90911f942229eb9049feab241739a5ced76f137948f8f42a615e5f01d4e7ea","affectsGlobalScope":true},"999a90d30a3183dcee987d0a5a7c586aba5bacbf6ce087ba8635124082ccfeea","8a5878edd52f4a720560b4c6e6247e9ddc3df6118ad9cf2f9927903b03d5f440",{"version":"d95d76d79a0351572ec5b1a6cc1e5c4bce1be82eedeed7278d6f31ea1059fa69","affectsGlobalScope":true},"6b40029289530423f407a22755c85b81740f9acfd88d2b53564f8c1657c26660","15b043358a9bac56ee6a567d61adf545b3a09e2f2ead9c3ef3cc617ed3522e71",{"version":"b98f6185455945922c7cfdad772ec1c46e5c169a2d71aca6530e041f77665f03","affectsGlobalScope":true},"65b91a3725399231d3469529b5e27b85bf2aa98013e607f308e5fe260b47eeff","a11181f6d68200e83ccb1fb48b262a7132a3257e0a230f41c9dc4c351964297a","0c8a56610b08f55e29ffb466cd27626ad6dbe822312a398026e82270c63088e3","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a",{"version":"a25a80c5c07b61db0d40c5baba89c6584048536596e7e3ee7c632c46f641d932","affectsGlobalScope":true},"70f04c91d3186b1b10157157887fab664968fc9b88377785a5ee42750c202c6d","a0c7f94ed02009f741ef243b7adbfced3d1d2e2d79ea4d16af73946fac25dbf4",{"version":"f1bfa18deca3c5a0e2763c2757debee18626820315f50ab551d9cb283eb9a49f","affectsGlobalScope":true},"f07a77a7fb1d49aa2b61cb68bf712a083487acd7130d20223a83de03af0c257d","245731ddcde842fa1024619d54409f90128bb64070c6729088697944dbc58bd5","88cda4269c54f0803834fd62b2fac61af8bff7a085693f7ca9df85c1f19dee8a",{"version":"a25a80c5c07b61db0d40c5baba89c6584048536596e7e3ee7c632c46f641d932","affectsGlobalScope":true},{"version":"494f93d7c6e2178b8e0f53cc10977d2913753a6d7442907022b970d5c0a13d05","affectsGlobalScope":true},"8acb762a884708f254d0bfa25565c14c2a5b79d3767a13d03563ebf6520d0385","fdf0aa1a72ff0188a9013926201a391116ef6701cd439b89850786abdf755fb8","f0b43f422b01042dd784bee89f9c67330001a575258bb49d28fd56e1a581e92e","abf9ea97b78a7b239186cf5b7ed59c4a593abac3c408c8c95fc5e604cfdfdb43","ae91c9161caf0af81c89e780a045fc5ea8382407e516342e409c5db9161d3b32","2c387828a523cc77a4300f5deb063651c9346c5a36ccfbfc127c38df8ab45b0c","d598157512ae6e0d3aa6bb0dd261ae34845831dccf7bc7739695ee2589eb76f5","88740fc0276ac55a747251bc46c2ed96bf8d7455b0a800eff33b1a16df2b36e8","d2173e08898108c0aaa6dbfed27725b4a71f5817153800c86f03fa06456a2fc7","6e3d4b09fff332f804c02afb2fe878e49d593cfb61628dceed482145853a8d5c","20e1391c91714828f5e9ede65dfe3e8445a9c147420a50a1ef3a351d1759b9db","31c268bcfbbb3a89dd4019ff8001069024921c2c0fb73bccc6f8e6f2da7bff09","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"34f1d0e1f63dd8c0bdc1fd15ec2b7216fd709953781c4d1b1213d88e2d94db9e","affectsGlobalScope":true},"4be51d991034b331db6a518e5a9607cb136b6d3ab2a691191a7d481354836a5f",{"version":"fa56e5f529c26a31207fecafbfd88136936868a4c17f8a347f0e8e6ea18309ad","affectsGlobalScope":true},"dbfe629576a07827e766347bea31814a914dbce17a0e6b42b71df91d6b4c5f04","3fe5750809a130a0c9ee5dbca9e262913a10d1deda3ddb1280a77b099197e937",{"version":"d7e32c36d30042b47cd8620b197d3e3381954cf8baa413dc4273796e4cf718a1","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","ca4f1923f7b902be3f19040f9b3859524f8d276f73c1c2985af8df1446a27da8","53cf527b7d4a7ee1c16eeadff678d6df9f2a98cd5ece18f0f9211d8080204734","0038ccd1c90bc523ee4f7eeabc3f4082a48a5775415855e46f142447b9ad1114","aacb7a1f78d635e42d1112144c83508f340722e5293f7f14091581193618dca3","87c064559d14068edb2861fc7d48c1a8196a63523e00cc29aadd57c0eefb24a5","226afbe8d2d18dc02d1aebb449af0a11a278acb98b42c763aeec6d5a8e654441",{"version":"c3a43212afe9781a304d8f5dd3895fd38a143ac46fb64b4d343122e38c83a9ab","affectsGlobalScope":true},"21259ca1ed518e7adf7653fe0c75972a9baaafc459c8a95e78964a867517adac","01862fc59b8c037ea9fe03c6f3dc1ffc95bfc16fb37d58d6e7603706b9041d97","2163cfbd3438e495c08fb59b29740b1f96c7aec8ebb4faf9c9156f4fe94cb501","b9855c90cb7d9dcc9d6235aa9581f57e34d1396fbaaa8eb56d2754bb47b3b118","1f66294c9e9c24e84552cfaa70a27422811649de5a2efc69d3cf2ef38e833308","a82a261dac2131e55347889de6846a3e84741283d93d6525550ab3976be85cf6",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"1207275e727d14356922953c0597c77acad13e9812a0109a756c0c59ff0e87f3","dce04e108fbcbe674bceeea757269b7775a8a07693d6a58f55b36e649541675a","c90911387c5e9e024c309e63a14946a9bc3c71293e8f9d09eece16e11f167974","066f0de5d2acf0be06eb29a5ada8107f93891d7a983e6ba095260406650d742d",{"version":"6ae884f4861da8949f2c466b2d44fb087b2f1de82fe3449c3c52bd1d8cf998e6","affectsGlobalScope":true},"cbe717c2735bf2a6ceb29c2131232e74f4f95878072873dfb263566035024f99","5fd00b0ad7ef4e7eb69341da6ec17400922860afbdbc2cc46a37eba833d8a0bd","bc0c9dbd2b273d9466a31143a5f0118e8902232d906b3987d19d1bd67b96ee5d","757fec48e36f86c8b791b770c31f510d0e53817a95f61130df26df57cb382113","e28d7f6119c9c585989f28bbd34716f6f93f4b31b4a19d9fb8a2e2cc13699464","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","28e6ac6505a2b6755ce0752cd4d2dbd880e0e4e9bbfeaa3c777821825db2711a",{"version":"8a4f510bad5e5f5312fd966d20675381a3467c0c8d1b528b7f8e5ebb732ba1c9","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","8222fe4c00d4530dc2eba1c2948292d02ea45801c35cea74e7647034d6f0ee88","dcbcf0056d7bcd4e716bd0cc9223913e58373095c4750250f525694d88f49962","715b8aedc97884235eac2346481e7f1cca0379f870a58a60d22f444f8b7c59a8","1379d5d1decf758cf2041743711f1d0235ef30b1eed5777faba29181088149c5","2ac6c37c23dbb6a87d0657fbaa509bd077dd4ea066fecff1e94a01e19410d8c6","5d50d7b266824bd435c9696f71d64041db90667b6f95d5285adfa6946a73dde5","58250ab8b2768e6d713bb8271d4d1ed1029069bb94631764538a474fe1cb1eca","b9d6227d9cf5e2aac16c149377136b01e8692c0f82f185f6192c78285236e71d","555122eabf41efe584457b407892ed4420c5dc5404004eafed8bc365459f1eef","56f3ed639ae070160aaa79a626e0f956374c7dcd2093216f48cc952981ea2e93",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"4f6762953742f1fa21ec4b41d49c0f76e72e324960f56b127717d2dc9a0baa3e",{"version":"c4c03cf65951d980ba618ae9601d10438730803fc9c8a1f7b34af8739981e205","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5},"fileIdsList":[[145],[43,145],[50,145],[43,50,145],[41,42,145],[80,81,145],[91,145],[82,88,90,145],[82,88,145],[66,67,145],[68,145],[67,69,145],[82,84,145],[84,145],[45,83,145],[82,84,85,145],[79,86,87,94,95,96,97,145],[87,92,145],[93,145],[88,145],[86,93,145],[66,78,98,145],[70,73,74,77,145],[66,145],[102,145],[105,145],[106,111,145],[107,117,118,125,134,144,145],[107,108,117,125,145],[109,145],[110,111,118,126,145],[111,134,141,145],[112,114,117,125,145],[113,145],[114,115,145],[116,117,145],[117,145],[117,118,119,134,144,145],[117,118,119,134,145],[120,125,134,144,145],[117,118,120,121,125,134,141,144,145],[120,122,134,141,144,145],[102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[117,123,145],[124,144,145],[114,117,125,134,145],[126,145],[127,145],[105,128,145],[129,143,145,149],[130,145],[131,145],[117,132,145],[132,133,145,147],[117,134,135,136,145],[134,136,145],[134,135,145],[137,145],[138,145],[117,139,140,145],[139,140,145],[111,125,141,145],[142,145],[125,143,145],[106,120,131,144,145],[111,145],[134,145,146],[145,147],[145,148],[106,111,117,119,128,134,144,145,147,149],[134,145,150],[66,76,145],[75,145],[44,145],[72,145],[71,145],[43,47,145],[47,145],[45,46,145],[51,52,53,54,55,56,57,58,145],[43,47,48,145],[40,60,61,62,63,145],[40,47,49,59,60,145],[40,49,59,62,145],[40,47,49,59,145],[40,49,60,145],[40,49,62,99,145],[40,49,60,99,145]],"referencedMap":[[41,1],[50,2],[51,3],[54,4],[52,4],[56,4],[58,4],[57,4],[55,4],[53,3],[42,1],[43,5],[88,1],[89,6],[92,7],[91,8],[90,9],[68,10],[69,11],[67,1],[70,12],[80,1],[81,1],[82,6],[85,13],[83,14],[84,15],[86,16],[98,17],[79,1],[93,18],[94,19],[95,1],[96,20],[87,21],[97,19],[99,22],[78,23],[75,1],[74,24],[66,1],[153,1],[102,25],[103,25],[105,26],[106,27],[107,28],[108,29],[109,30],[110,31],[111,32],[112,33],[113,34],[114,35],[115,35],[116,36],[117,37],[118,38],[119,39],[104,1],[151,1],[120,40],[121,41],[122,42],[152,43],[123,44],[124,45],[125,46],[126,47],[127,48],[128,49],[129,50],[130,51],[131,52],[132,53],[133,54],[134,55],[136,56],[135,57],[137,58],[138,59],[139,60],[140,61],[141,62],[142,63],[143,64],[144,65],[145,66],[146,67],[147,68],[148,69],[149,70],[150,71],[77,72],[76,73],[45,74],[44,1],[71,24],[73,75],[72,76],[48,77],[46,78],[47,79],[59,80],[49,81],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[64,82],[61,83],[62,83],[63,84],[60,85],[65,86],[100,87],[101,88]],"exportedModulesMap":[[41,1],[50,2],[51,3],[54,4],[52,4],[56,4],[58,4],[57,4],[55,4],[53,3],[42,1],[43,5],[88,1],[89,6],[92,7],[91,8],[90,9],[68,10],[69,11],[67,1],[70,12],[80,1],[81,1],[82,6],[85,13],[83,14],[84,15],[86,16],[98,17],[79,1],[93,18],[94,19],[95,1],[96,20],[87,21],[97,19],[99,22],[78,23],[75,1],[74,24],[66,1],[153,1],[102,25],[103,25],[105,26],[106,27],[107,28],[108,29],[109,30],[110,31],[111,32],[112,33],[113,34],[114,35],[115,35],[116,36],[117,37],[118,38],[119,39],[104,1],[151,1],[120,40],[121,41],[122,42],[152,43],[123,44],[124,45],[125,46],[126,47],[127,48],[128,49],[129,50],[130,51],[131,52],[132,53],[133,54],[134,55],[136,56],[135,57],[137,58],[138,59],[139,60],[140,61],[141,62],[142,63],[143,64],[144,65],[145,66],[146,67],[147,68],[148,69],[149,70],[150,71],[77,72],[76,73],[45,74],[44,1],[71,24],[73,75],[72,76],[48,77],[46,78],[47,79],[59,80],[49,81],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[64,82],[61,83],[62,83],[63,84],[60,85],[65,86],[100,87],[101,88]],"semanticDiagnosticsPerFile":[41,50,51,54,52,56,58,57,55,53,42,43,88,89,92,91,90,68,69,67,70,80,81,82,85,83,84,86,98,79,93,94,95,96,87,97,99,78,75,74,66,153,102,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,104,151,120,121,122,152,123,124,125,126,127,128,129,130,131,132,133,134,136,135,137,138,139,140,141,142,143,144,145,146,147,148,149,150,77,76,45,44,71,73,72,48,46,47,59,49,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,64,61,62,63,60,65,100,101]},"version":"4.4.4"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent popup following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "heartyoh",
6
- "version": "0.2.8",
6
+ "version": "0.2.26",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -54,30 +54,6 @@
54
54
  "typescript": "^4.4.4"
55
55
  },
56
56
  "customElements": "custom-elements.json",
57
- "eslintConfig": {
58
- "parser": "@typescript-eslint/parser",
59
- "extends": [
60
- "@open-wc",
61
- "prettier"
62
- ],
63
- "plugins": [
64
- "@typescript-eslint"
65
- ],
66
- "rules": {
67
- "no-unused-vars": "off",
68
- "@typescript-eslint/no-unused-vars": [
69
- "error"
70
- ],
71
- "import/no-unresolved": "off",
72
- "import/extensions": [
73
- "error",
74
- "always",
75
- {
76
- "ignorePackages": true
77
- }
78
- ]
79
- }
80
- },
81
57
  "prettier": "@hatiolab/prettier-config",
82
58
  "husky": {
83
59
  "hooks": {
@@ -90,5 +66,5 @@
90
66
  "prettier --write"
91
67
  ]
92
68
  },
93
- "gitHead": "34b491398a4ca1ca637c756c75222de8685c0fe9"
69
+ "gitHead": "5fc8d5fa1dd2f4f38539cc3c5e1d50f00f55e80d"
94
70
  }
@@ -1,9 +1,8 @@
1
- import { css, html, PropertyValues } from 'lit'
2
- import { render } from 'lit-html'
1
+ import { PropertyValues, css, html } from 'lit'
3
2
  import { customElement, property } from 'lit/decorators.js'
4
3
 
5
- import { KEYCODE } from './const'
6
4
  import { Popup } from './ox-popup'
5
+ import { render } from 'lit-html'
7
6
 
8
7
  function focusClosest(element: HTMLElement) {
9
8
  /* Find the closest focusable element. */
@@ -81,22 +80,27 @@ export class PopupList extends Popup {
81
80
  protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupList, e: KeyboardEvent) {
82
81
  e.stopPropagation()
83
82
 
84
- switch (e.keyCode) {
85
- case KEYCODE.KEY_ESC:
83
+ switch (e.key) {
84
+ case 'Esc': // for IE/Edge
85
+ case 'Escape':
86
86
  this.close()
87
87
  break
88
88
 
89
- case KEYCODE.KEY_LEFT:
90
- case KEYCODE.KEY_UP:
89
+ case 'Left': // for IE/Edge
90
+ case 'ArrowLeft':
91
+ case 'Up': // for IE/Edge
92
+ case 'ArrowUp':
91
93
  this.activeIndex--
92
94
  break
93
95
 
94
- case KEYCODE.KEY_RIGHT:
95
- case KEYCODE.KEY_DOWN:
96
+ case 'Right': // for IE/Edge
97
+ case 'ArrowRight':
98
+ case 'Down': // for IE/Edge
99
+ case 'ArrowDown':
96
100
  this.activeIndex++
97
101
  break
98
102
 
99
- case KEYCODE.KEY_ENTER:
103
+ case 'Enter':
100
104
  e.stopPropagation()
101
105
  var option = (e.target as HTMLElement)?.closest('[option]')
102
106
  if (option) {
@@ -1,9 +1,8 @@
1
- import { css, html, PropertyValues } from 'lit'
2
- import { render } from 'lit-html'
1
+ import { PropertyValues, css, html } from 'lit'
3
2
  import { customElement, property } from 'lit/decorators.js'
4
3
 
5
- import { KEYCODE } from './const'
6
4
  import { Popup } from './ox-popup'
5
+ import { render } from 'lit-html'
7
6
 
8
7
  function focusClosest(element: HTMLElement) {
9
8
  /* Find the closest focusable element. */
@@ -83,22 +82,27 @@ export class PopupMenu extends Popup {
83
82
  protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenu, e: KeyboardEvent) {
84
83
  e.stopPropagation()
85
84
 
86
- switch (e.keyCode) {
87
- case KEYCODE.KEY_ESC:
88
- case KEYCODE.KEY_LEFT:
85
+ switch (e.key) {
86
+ case 'Esc': // for IE/Edge
87
+ case 'Escape':
88
+ case 'Left': // for IE/Edge
89
+ case 'ArrowLeft':
89
90
  this.close()
90
91
  break
91
92
 
92
- case KEYCODE.KEY_UP:
93
+ case 'Up': // for IE/Edge
94
+ case 'ArrowUp':
93
95
  this.activeIndex--
94
96
  break
95
97
 
96
- case KEYCODE.KEY_RIGHT:
97
- case KEYCODE.KEY_DOWN:
98
+ case 'Right': // for IE/Edge
99
+ case 'ArrowRight':
100
+ case 'Down': // for IE/Edge
101
+ case 'ArrowDown':
98
102
  this.activeIndex++
99
103
  break
100
104
 
101
- case KEYCODE.KEY_ENTER:
105
+ case 'Enter':
102
106
  e.stopPropagation()
103
107
  var menu = (e.target as HTMLElement)?.closest('[menu], ox-popup-menuitem')
104
108
  if (menu) {
@@ -1,7 +1,6 @@
1
- import { css, html, LitElement, PropertyValues } from 'lit'
1
+ import { LitElement, PropertyValues, css, html } from 'lit'
2
2
  import { customElement, property, state } from 'lit/decorators.js'
3
3
 
4
- import { KEYCODE } from './const'
5
4
  import { PopupMenu } from './ox-popup-menu'
6
5
 
7
6
  @customElement('ox-popup-menuitem')
@@ -94,18 +93,20 @@ export class PopupMenuItem extends LitElement {
94
93
  }.bind(this)
95
94
 
96
95
  protected _onkeydown: (e: KeyboardEvent) => void = function (this: PopupMenuItem, e: KeyboardEvent) {
97
- switch (e.keyCode) {
98
- case KEYCODE.KEY_RIGHT:
96
+ switch (e.key) {
97
+ case 'Right':
98
+ case 'ArrowRight':
99
99
  e.stopPropagation()
100
100
  this.expand(false)
101
101
  break
102
102
 
103
- case KEYCODE.KEY_LEFT:
103
+ case 'Left':
104
+ case 'ArrowLeft':
104
105
  e.stopPropagation()
105
106
  this.collapseSelf()
106
107
  break
107
108
 
108
- case KEYCODE.KEY_ENTER:
109
+ case 'Enter':
109
110
  if (this._submenu) {
110
111
  e.stopPropagation()
111
112
  this.expand(false)
package/src/ox-popup.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { css, html, LitElement } from 'lit'
2
- import { render } from 'lit-html'
1
+ import { LitElement, css, html } from 'lit'
3
2
  import { customElement, state } from 'lit/decorators.js'
4
3
 
5
- import { KEYCODE } from './const'
4
+ import { render } from 'lit-html'
6
5
 
7
6
  @customElement('ox-popup')
8
7
  export class Popup extends LitElement {
@@ -44,8 +43,9 @@ export class Popup extends LitElement {
44
43
  protected _onkeydown: (e: KeyboardEvent) => void = function (this: Popup, e: KeyboardEvent) {
45
44
  e.stopPropagation()
46
45
 
47
- switch (e.keyCode) {
48
- case KEYCODE.KEY_ESC:
46
+ switch (e.key) {
47
+ case 'Esc': // for IE/Edge
48
+ case 'Escape':
49
49
  this.close()
50
50
  break
51
51
  }
@@ -1,12 +0,0 @@
1
- export declare enum KEYCODE {
2
- KEY_LEFT = 37,
3
- KEY_UP = 38,
4
- KEY_RIGHT = 39,
5
- KEY_DOWN = 40,
6
- KEY_ENTER = 13,
7
- KEY_TAP = 9,
8
- KEY_BACKSPACE = 8,
9
- KEY_ESC = 27,
10
- KEY_PAGEUP = 33,
11
- KEY_PAGEDOWN = 34
12
- }
package/dist/src/const.js DELETED
@@ -1,14 +0,0 @@
1
- export var KEYCODE;
2
- (function (KEYCODE) {
3
- KEYCODE[KEYCODE["KEY_LEFT"] = 37] = "KEY_LEFT";
4
- KEYCODE[KEYCODE["KEY_UP"] = 38] = "KEY_UP";
5
- KEYCODE[KEYCODE["KEY_RIGHT"] = 39] = "KEY_RIGHT";
6
- KEYCODE[KEYCODE["KEY_DOWN"] = 40] = "KEY_DOWN";
7
- KEYCODE[KEYCODE["KEY_ENTER"] = 13] = "KEY_ENTER";
8
- KEYCODE[KEYCODE["KEY_TAP"] = 9] = "KEY_TAP";
9
- KEYCODE[KEYCODE["KEY_BACKSPACE"] = 8] = "KEY_BACKSPACE";
10
- KEYCODE[KEYCODE["KEY_ESC"] = 27] = "KEY_ESC";
11
- KEYCODE[KEYCODE["KEY_PAGEUP"] = 33] = "KEY_PAGEUP";
12
- KEYCODE[KEYCODE["KEY_PAGEDOWN"] = 34] = "KEY_PAGEDOWN";
13
- })(KEYCODE || (KEYCODE = {}));
14
- //# sourceMappingURL=const.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,OAWX;AAXD,WAAY,OAAO;IACjB,8CAAa,CAAA;IACb,0CAAW,CAAA;IACX,gDAAc,CAAA;IACd,8CAAa,CAAA;IACb,gDAAc,CAAA;IACd,2CAAW,CAAA;IACX,uDAAiB,CAAA;IACjB,4CAAY,CAAA;IACZ,kDAAe,CAAA;IACf,sDAAiB,CAAA;AACnB,CAAC,EAXW,OAAO,KAAP,OAAO,QAWlB","sourcesContent":["export enum KEYCODE {\n KEY_LEFT = 37,\n KEY_UP = 38,\n KEY_RIGHT = 39,\n KEY_DOWN = 40,\n KEY_ENTER = 13,\n KEY_TAP = 9,\n KEY_BACKSPACE = 8,\n KEY_ESC = 27,\n KEY_PAGEUP = 33,\n KEY_PAGEDOWN = 34\n}\n"]}
package/src/const.ts DELETED
@@ -1,12 +0,0 @@
1
- export enum KEYCODE {
2
- KEY_LEFT = 37,
3
- KEY_UP = 38,
4
- KEY_RIGHT = 39,
5
- KEY_DOWN = 40,
6
- KEY_ENTER = 13,
7
- KEY_TAP = 9,
8
- KEY_BACKSPACE = 8,
9
- KEY_ESC = 27,
10
- KEY_PAGEUP = 33,
11
- KEY_PAGEDOWN = 34
12
- }