@digital-realty/ix-radio 1.0.4 → 1.0.6

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.
Files changed (42) hide show
  1. package/README.md +2 -54
  2. package/dist/IxRadio.js.map +1 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/ix-radio-styles.js.map +1 -0
  5. package/dist/ix-radio.js.map +1 -0
  6. package/dist/react/IxRadio.js.map +1 -0
  7. package/dist/{src/single-selection-controller.js → single-selection-controller.js} +1 -0
  8. package/dist/single-selection-controller.js.map +1 -0
  9. package/package.json +14 -7
  10. package/demo/index.html +0 -41
  11. package/demo/native.html +0 -71
  12. package/dist/src/IxRadio.js.map +0 -1
  13. package/dist/src/index.js.map +0 -1
  14. package/dist/src/ix-radio-styles.js.map +0 -1
  15. package/dist/src/ix-radio.js.map +0 -1
  16. package/dist/src/react/IxRadio.js.map +0 -1
  17. package/dist/src/single-selection-controller.js.map +0 -1
  18. package/dist/test/ix-radio.test.d.ts +0 -1
  19. package/dist/test/ix-radio.test.js +0 -44
  20. package/dist/test/ix-radio.test.js.map +0 -1
  21. package/dist/tsconfig.tsbuildinfo +0 -1
  22. package/src/IxRadio.ts +0 -160
  23. package/src/index.ts +0 -1
  24. package/src/ix-radio-styles.ts +0 -3
  25. package/src/ix-radio.ts +0 -3
  26. package/src/react/IxRadio.ts +0 -15
  27. package/src/single-selection-controller.ts +0 -232
  28. package/test/ix-radio.test.ts +0 -46
  29. package/tsconfig.json +0 -21
  30. package/web-dev-server.config.mjs +0 -27
  31. package/web-test-runner.config.mjs +0 -43
  32. /package/dist/{src/IxRadio.d.ts → IxRadio.d.ts} +0 -0
  33. /package/dist/{src/IxRadio.js → IxRadio.js} +0 -0
  34. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  35. /package/dist/{src/index.js → index.js} +0 -0
  36. /package/dist/{src/ix-radio-styles.d.ts → ix-radio-styles.d.ts} +0 -0
  37. /package/dist/{src/ix-radio-styles.js → ix-radio-styles.js} +0 -0
  38. /package/dist/{src/ix-radio.d.ts → ix-radio.d.ts} +0 -0
  39. /package/dist/{src/ix-radio.js → ix-radio.js} +0 -0
  40. /package/dist/{src/react → react}/IxRadio.d.ts +0 -0
  41. /package/dist/{src/react → react}/IxRadio.js +0 -0
  42. /package/dist/{src/single-selection-controller.d.ts → single-selection-controller.d.ts} +0 -0
package/README.md CHANGED
@@ -18,58 +18,6 @@ npm i @digital-realty/ix-radio
18
18
  <ix-radio></ix-radio>
19
19
  ```
20
20
 
21
- ## Linting and formatting
21
+ ## Demo and Documentation
22
22
 
23
- To scan the project for linting and formatting errors, run
24
-
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
34
-
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
48
-
49
- ## Demoing with Storybook
50
-
51
- To run a local instance of Storybook for your component, run
52
-
53
- ```bash
54
- npm run storybook
55
- ```
56
-
57
- To build a production version of Storybook, run
58
-
59
- ```bash
60
- npm run storybook:build
61
- ```
62
-
63
- ## Tooling configs
64
-
65
- For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
66
-
67
- If you customize the configuration a lot, you can consider moving them to individual files.
68
-
69
- ## Local Demo with `web-dev-server`
70
-
71
- ```bash
72
- npm start
73
- ```
74
-
75
- To run a local development server that serves the basic demo located in `demo/index.html`
23
+ Full documentation and demo are available at [DLR Component Gallery](https://inxn-p1-uicomponentgallery.azurewebsites.net/?path=/story/inxn-ix-radio--default).
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IxRadio.js","sourceRoot":"","sources":["../src/IxRadio.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACjD,O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,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCAG3B;AAiB2C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAkB;AAEjD;IAAX,QAAQ,EAAE;sCAAoB;AAKnB;IAAX,QAAQ,EAAE;sCAAc;AAEb;IAAX,QAAQ,EAAE;0CAAwB;AAEvB;IAAX,QAAQ,EAAE;uCAA6B;AAE5B;IAAX,QAAQ,EAAE;uCAA4B","sourcesContent":["import { html, LitElement, isServer } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property } from 'lit/decorators.js';\nimport '@material/web/radio/radio.js';\nimport { isActivationClick } from '@material/web/internal/controller/events.js';\nimport { polyfillElementInternalsAria } from '@material/web/internal/aria/aria.js';\nimport { IxRadioStyles } from './ix-radio-styles.js';\nimport { SingleSelectionController } from './single-selection-controller.js';\n\nconst CHECKED = Symbol('checked');\n\nexport class IxRadio extends LitElement {\n static get styles() {\n return [IxRadioStyles];\n }\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n /**\n * Whether or not the radio is selected.\n */\n @property({ type: Boolean })\n get checked() {\n return this[CHECKED];\n }\n\n set checked(checked: boolean) {\n const wasChecked = this.checked;\n if (wasChecked === checked) {\n return;\n }\n\n this[CHECKED] = checked;\n const state = String(checked);\n this.internals.setFormValue(this.checked ? this.value : null, state);\n this.requestUpdate('checked', wasChecked);\n this.selectionController.handleCheckedChange();\n }\n\n [CHECKED] = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property() label: string = '';\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @property() ariaLabel: string = '';\n\n @property() target: 'wrapper' | '' = '';\n\n @property() htmlId: string | undefined;\n\n /**\n * The HTML name to use in form submission.\n */\n get name() {\n return this.getAttribute('name') ?? '';\n }\n\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this.internals.form;\n }\n\n /**\n * The labels this element is associated with.\n */\n get labels() {\n return this.internals.labels;\n }\n\n private readonly selectionController = new SingleSelectionController(this);\n\n private readonly internals = polyfillElementInternalsAria(\n this,\n (this as HTMLElement) /* needed for closure */\n .attachInternals()\n );\n\n private async handleClick(event: Event) {\n if (this.disabled) {\n return;\n }\n\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.defaultPrevented) {\n return;\n }\n\n if (isActivationClick(event)) {\n this.focus();\n }\n\n // Per spec, clicking on a radio input always selects it.\n this.checked = true;\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.dispatchEvent(\n new InputEvent('input', { bubbles: true, composed: true })\n );\n }\n\n private async handleKeydown(event: KeyboardEvent) {\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.key !== ' ' || event.defaultPrevented) {\n return;\n }\n\n this.click();\n }\n\n constructor() {\n super();\n this.addController(this.selectionController);\n if (!isServer) {\n this.internals.role = 'radio';\n this.addEventListener('click', this.handleClick.bind(this));\n this.addEventListener('keydown', this.handleKeydown.bind(this));\n }\n }\n\n protected override updated() {\n this.internals.ariaChecked = String(this.checked);\n }\n\n get renderRadio() {\n return html`\n <md-radio\n aria-label=${this.ariaLabel || this.label}\n name=${this.name}\n value=${this.value}\n ?checked=${this.checked}\n ?disabled=${this.disabled}\n id=${ifDefined(this.htmlId)}\n touch-target=${this.target}\n ></md-radio>\n `;\n }\n\n render() {\n if (this.label)\n return html`<label\n >${this.renderRadio} <span> ${this.label}</span>\n </label>`;\n\n return this.renderRadio;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { IxRadio } from './IxRadio.js';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-radio-styles.js","sourceRoot":"","sources":["../src/ix-radio-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxRadioStyles = css``;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-radio.js","sourceRoot":"","sources":["../src/ix-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC","sourcesContent":["import { IxRadio } from './IxRadio.js';\n\nwindow.customElements.define('ix-radio', IxRadio);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IxRadio.js","sourceRoot":"","sources":["../../src/react/IxRadio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,UAAU;IACxB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport { IxRadio as IxRadioLit } from '../IxRadio.js';\n\nwindow.customElements.define('ix-button', IxRadioLit);\n\nexport const IxButton = createComponent({\n tagName: 'ix-radio',\n elementClass: IxRadioLit,\n react: React,\n events: {\n onclick: 'onClick',\n onkeydown: 'keydown',\n },\n});\n"]}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable */
1
2
  /**
2
3
  * @license
3
4
  * Copyright 2022 Google LLC
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-selection-controller.js","sourceRoot":"","sources":["../src/single-selection-controller.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;GAIG;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,yBAAyB;IAKpC,YAA6B,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;QAJjD,YAAO,GAAG,KAAK,CAAC;QAEhB,SAAI,GAAsB,IAAI,CAAC;QAyCtB,kBAAa,GAAG,GAAG,EAAE;YACpC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC;QAEe,mBAAc,GAAG,GAAG,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC;QAoDF;;;;WAIG;QACc,kBAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,WAAW,CAAC;YACzC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC;YACrC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,WAAW,CAAC;YACzC,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC;YAC3C,wBAAwB;YACxB,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;gBAC3C,OAAO;aACR;YAED,2DAA2D;YAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;gBACpB,OAAO;aACR;YAED,8DAA8D;YAC9D,qDAAqD;YACrD,KAAK,CAAC,cAA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,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAyB,UAAU,IAAI,IAAI,CAAC,CACvE,CAAC;IACJ,CAAC;CA6EF","sourcesContent":["/* eslint-disable */\n/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ReactiveController } from 'lit';\n\n/**\n * An element that supports single-selection with `SingleSelectionController`.\n */\nexport interface SingleSelectionElement extends HTMLElement {\n /**\n * Whether or not the element is selected.\n */\n checked: boolean;\n}\n\n/**\n * A `ReactiveController` that provides root node-scoped single selection for\n * elements, similar to native `<input type=\"radio\">` selection.\n *\n * To use, elements should add the controller and call\n * `selectionController.handleCheckedChange()` in a getter/setter. This must\n * be synchronous to match native behavior.\n *\n * @example\n * const CHECKED = Symbol('checked');\n *\n * class MyToggle extends LitElement {\n * get checked() { return this[CHECKED]; }\n * set checked(checked: boolean) {\n * const oldValue = this.checked;\n * if (oldValue === checked) {\n * return;\n * }\n *\n * this[CHECKED] = checked;\n * this.selectionController.handleCheckedChange();\n * this.requestUpdate('checked', oldValue);\n * }\n *\n * [CHECKED] = false;\n *\n * private selectionController = new SingleSelectionController(this);\n *\n * constructor() {\n * super();\n * this.addController(this.selectionController);\n * }\n * }\n */\nexport class SingleSelectionController implements ReactiveController {\n private focused = false;\n\n private root: ParentNode | null = null;\n\n constructor(private readonly host: SingleSelectionElement) {}\n\n hostConnected() {\n this.root = this.host.getRootNode() as ParentNode;\n this.host.addEventListener('keydown', this.handleKeyDown);\n this.host.addEventListener('focusin', this.handleFocusIn);\n this.host.addEventListener('focusout', this.handleFocusOut);\n if (this.host.checked) {\n // Uncheck other siblings when attached if already checked. This mimics\n // native <input type=\"radio\"> behavior.\n this.uncheckSiblings();\n }\n\n // Update for the newly added host.\n this.updateTabIndices();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('keydown', this.handleKeyDown);\n this.host.removeEventListener('focusin', this.handleFocusIn);\n this.host.removeEventListener('focusout', this.handleFocusOut);\n // Update for siblings that are still connected.\n this.updateTabIndices();\n this.root = null;\n }\n\n /**\n * Should be called whenever the host's `checked` property changes\n * synchronously.\n */\n handleCheckedChange() {\n if (!this.host.checked) {\n return;\n }\n\n this.uncheckSiblings();\n this.updateTabIndices();\n }\n\n private readonly handleFocusIn = () => {\n this.focused = true;\n this.updateTabIndices();\n };\n\n private readonly handleFocusOut = () => {\n this.focused = false;\n this.updateTabIndices();\n };\n\n private uncheckSiblings() {\n for (const sibling of this.getNamedSiblings()) {\n if (sibling !== this.host) {\n sibling.checked = false;\n }\n }\n }\n\n /**\n * Updates the `tabindex` of the host and its siblings.\n */\n private updateTabIndices() {\n // There are three tabindex states for a group of elements:\n // 1. If any are checked, that element is focusable.\n const siblings = this.getNamedSiblings();\n const checkedSibling = siblings.find(sibling => sibling.checked);\n // 2. If an element is focused, the others are no longer focusable.\n if (checkedSibling || this.focused) {\n const focusable = checkedSibling || this.host;\n focusable.tabIndex = 0;\n\n for (const sibling of siblings) {\n if (sibling !== focusable) {\n sibling.tabIndex = -1;\n }\n }\n return;\n }\n\n // 3. If none are checked or focused, all are focusable.\n for (const sibling of siblings) {\n sibling.tabIndex = 0;\n }\n }\n\n /**\n * Retrieves all siblings in the host element's root with the same `name`\n * attribute.\n */\n private getNamedSiblings() {\n const name = this.host.getAttribute('name');\n if (!name || !this.root) {\n return [];\n }\n\n return Array.from(\n this.root.querySelectorAll<SingleSelectionElement>(`[name=\"${name}\"]`)\n );\n }\n\n /**\n * Handles arrow key events from the host. Using the arrow keys will\n * select and check the next or previous sibling with the host's\n * `name` attribute.\n */\n private readonly handleKeyDown = (event: KeyboardEvent) => {\n const isDown = event.key === 'ArrowDown';\n const isUp = event.key === 'ArrowUp';\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n // Ignore non-arrow keys\n if (!isLeft && !isRight && !isDown && !isUp) {\n return;\n }\n\n // Don't try to select another sibling if there aren't any.\n const siblings = this.getNamedSiblings();\n if (!siblings.length) {\n return;\n }\n\n // Prevent default interactions on the element for arrow keys,\n // since this controller will introduce new behavior.\n event.preventDefault();\n\n // Check if moving forwards or backwards\n const isRtl = getComputedStyle(this.host).direction === 'rtl';\n const forwards = isRtl ? isLeft || isDown : isRight || isDown;\n\n const hostIndex = siblings.indexOf(this.host);\n let nextIndex = forwards ? hostIndex + 1 : hostIndex - 1;\n // Search for the next sibling that is not disabled to select.\n // If we return to the host index, there is nothing to select.\n while (nextIndex !== hostIndex) {\n if (nextIndex >= siblings.length) {\n // Return to start if moving past the last item.\n nextIndex = 0;\n } else if (nextIndex < 0) {\n // Go to end if moving before the first item.\n nextIndex = siblings.length - 1;\n }\n\n // Check if the next sibling is disabled. If so,\n // move the index and continue searching.\n const nextSibling = siblings[nextIndex];\n if (nextSibling.hasAttribute('disabled')) {\n if (forwards) {\n nextIndex++;\n } else {\n nextIndex--;\n }\n\n continue;\n }\n\n // Uncheck and remove focusability from other siblings.\n for (const sibling of siblings) {\n if (sibling !== nextSibling) {\n sibling.checked = false;\n sibling.tabIndex = -1;\n sibling.blur();\n }\n }\n\n // The next sibling should be checked, focused and dispatch a change event\n nextSibling.checked = true;\n nextSibling.tabIndex = 0;\n nextSibling.focus();\n // Fire a change event since the change is triggered by a user action.\n // This matches native <input type=\"radio\"> behavior.\n nextSibling.dispatchEvent(new Event('change', { bubbles: true }));\n\n break;\n }\n };\n}\n"]}
package/package.json CHANGED
@@ -3,14 +3,14 @@
3
3
  "description": "Webcomponent ix-radio following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "interxion",
6
- "version": "1.0.4",
6
+ "version": "1.0.6",
7
7
  "type": "module",
8
- "main": "dist/src/index.js",
9
- "module": "dist/src/index.js",
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.js",
10
10
  "exports": {
11
- ".": "./dist/src/index.js",
12
- "./ix-radio.js": "./dist/src/ix-radio.js",
13
- "./IxRadio": "./dist/src/react/IxRadio.js"
11
+ ".": "./dist/index.js",
12
+ "./ix-radio.js": "./dist/ix-radio.js",
13
+ "./IxRadio": "./dist/react/IxRadio.js"
14
14
  },
15
15
  "publishConfig": {
16
16
  "access": "public"
@@ -92,5 +92,12 @@
92
92
  "prettier --write"
93
93
  ]
94
94
  },
95
- "gitHead": "1e8e36ae0147d1fb0037ba85c727e3a30daebbc9"
95
+ "files": [
96
+ "/dist",
97
+ "!/dist/test",
98
+ "package.json",
99
+ "README.md",
100
+ "LICENSE"
101
+ ],
102
+ "gitHead": "f487170ac27de967505c921dabf983d2a122e625"
96
103
  }
package/demo/index.html DELETED
@@ -1,41 +0,0 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '../dist/src/ix-radio.js';
17
-
18
- const handleSubmit = (e) => {
19
- e.preventDefault();
20
- const form = e.target;
21
- const formData = new FormData(form);
22
- formData.forEach((value, key) => console.log(`${key}: ${value}`));
23
- }
24
-
25
- render(
26
- html`
27
- <form @submit=${handleSubmit}>
28
- <fieldset id="radiogroup">
29
- <ix-radio label="Red" name="aName" value="red"></ix-radio><br/><br/>
30
- <ix-radio label="Green" name="aName" value="green"></ix-radio><br/><br/>
31
- <ix-radio label="Blue" name="aName" value="blue"></ix-radio><br/><br/>
32
- <ix-radio label="Black" name="aName" value="black"></ix-radio>
33
- </fieldset>
34
- <button type="submit">Submit</button>
35
- </form>
36
- `,
37
- document.querySelector('#demo')
38
- );
39
- </script>
40
- </body>
41
- </html>
package/demo/native.html DELETED
@@ -1,71 +0,0 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '@material/web/radio/radio.js';
17
-
18
- const handleSubmit = (e) => {
19
- e.preventDefault();
20
- const form = e.target;
21
- const formData = new FormData(form);
22
- formData.forEach((value, key) => console.log(`${key}: ${value}`));
23
- }
24
-
25
- render(
26
- html`
27
- <form @submit=${handleSubmit}>
28
- <div class="column" role="radiogroup" aria-label="Animals">
29
- <div class="radio-label">
30
- <md-radio
31
- aria-label="Birds"
32
- id="birds-radio"
33
- name="with-labels"
34
- touch-target="wrapper"
35
- value="birds"
36
- >
37
- </md-radio>
38
- <label for="birds-radio">Birds</label>
39
- </div>
40
- <div class="radio-label">
41
- <md-radio
42
- aria-label="Cats"
43
- id="cats-radio"
44
- name="with-labels"
45
- touch-target="wrapper"
46
- value="cats"
47
- >
48
- </md-radio>
49
- <label for="cats-radio">Cats</label>
50
- </div>
51
- <div class="radio-label">
52
- <md-radio
53
- aria-label="Dogs"
54
- id="dogs-radio"
55
- name="with-labels"
56
- touch-target="wrapper"
57
- value="dogs"
58
- ?disabled=${true}
59
- >
60
- </md-radio>
61
- <label for="dogs-radio">Dogs</label>
62
- </div>
63
- </div>
64
- <button type="submit">Submit</button>
65
- </form>
66
- `,
67
- document.querySelector('#demo')
68
- );
69
- </script>
70
- </body>
71
- </html>
@@ -1 +0,0 @@
1
- {"version":3,"file":"IxRadio.js","sourceRoot":"","sources":["../../src/IxRadio.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAA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AAX,QAAQ,EAAE;uCAA4B","sourcesContent":["import { html, LitElement, isServer } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property } from 'lit/decorators.js';\nimport '@material/web/radio/radio.js';\nimport { isActivationClick } from '@material/web/internal/controller/events.js';\nimport { polyfillElementInternalsAria } from '@material/web/internal/aria/aria.js';\nimport { IxRadioStyles } from './ix-radio-styles.js';\nimport { SingleSelectionController } from './single-selection-controller.js';\n\nconst CHECKED = Symbol('checked');\n\nexport class IxRadio extends LitElement {\n static get styles() {\n return [IxRadioStyles];\n }\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n /**\n * Whether or not the radio is selected.\n */\n @property({ type: Boolean })\n get checked() {\n return this[CHECKED];\n }\n\n set checked(checked: boolean) {\n const wasChecked = this.checked;\n if (wasChecked === checked) {\n return;\n }\n\n this[CHECKED] = checked;\n const state = String(checked);\n this.internals.setFormValue(this.checked ? this.value : null, state);\n this.requestUpdate('checked', wasChecked);\n this.selectionController.handleCheckedChange();\n }\n\n [CHECKED] = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property() label: string = '';\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @property() ariaLabel: string = '';\n\n @property() target: 'wrapper' | '' = '';\n\n @property() htmlId: string | undefined;\n\n /**\n * The HTML name to use in form submission.\n */\n get name() {\n return this.getAttribute('name') ?? '';\n }\n\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this.internals.form;\n }\n\n /**\n * The labels this element is associated with.\n */\n get labels() {\n return this.internals.labels;\n }\n\n private readonly selectionController = new SingleSelectionController(this);\n\n private readonly internals = polyfillElementInternalsAria(\n this,\n (this as HTMLElement) /* needed for closure */\n .attachInternals()\n );\n\n private async handleClick(event: Event) {\n if (this.disabled) {\n return;\n }\n\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.defaultPrevented) {\n return;\n }\n\n if (isActivationClick(event)) {\n this.focus();\n }\n\n // Per spec, clicking on a radio input always selects it.\n this.checked = true;\n this.dispatchEvent(new Event('change', { bubbles: true }));\n this.dispatchEvent(\n new InputEvent('input', { bubbles: true, composed: true })\n );\n }\n\n private async handleKeydown(event: KeyboardEvent) {\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.key !== ' ' || event.defaultPrevented) {\n return;\n }\n\n this.click();\n }\n\n constructor() {\n super();\n this.addController(this.selectionController);\n if (!isServer) {\n this.internals.role = 'radio';\n this.addEventListener('click', this.handleClick.bind(this));\n this.addEventListener('keydown', this.handleKeydown.bind(this));\n }\n }\n\n protected override updated() {\n this.internals.ariaChecked = String(this.checked);\n }\n\n get renderRadio() {\n return html`\n <md-radio\n aria-label=${this.ariaLabel || this.label}\n name=${this.name}\n value=${this.value}\n ?checked=${this.checked}\n ?disabled=${this.disabled}\n id=${ifDefined(this.htmlId)}\n touch-target=${this.target}\n ></md-radio>\n `;\n }\n\n render() {\n if (this.label)\n return html`<label\n >${this.renderRadio} <span> ${this.label}</span>\n </label>`;\n\n return this.renderRadio;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { IxRadio } from './IxRadio.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ix-radio-styles.js","sourceRoot":"","sources":["../../src/ix-radio-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxRadioStyles = css``;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ix-radio.js","sourceRoot":"","sources":["../../src/ix-radio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC","sourcesContent":["import { IxRadio } from './IxRadio.js';\n\nwindow.customElements.define('ix-radio', IxRadio);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IxRadio.js","sourceRoot":"","sources":["../../../src/react/IxRadio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,UAAU;IACxB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport { IxRadio as IxRadioLit } from '../IxRadio.js';\n\nwindow.customElements.define('ix-button', IxRadioLit);\n\nexport const IxButton = createComponent({\n tagName: 'ix-radio',\n elementClass: IxRadioLit,\n react: React,\n events: {\n onclick: 'onClick',\n onkeydown: 'keydown',\n },\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-selection-controller.js","sourceRoot":"","sources":["../../src/single-selection-controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,yBAAyB;IAKpC,YAA6B,IAA4B;QAA5B,SAAI,GAAJ,IAAI,CAAwB;QAJjD,YAAO,GAAG,KAAK,CAAC;QAEhB,SAAI,GAAsB,IAAI,CAAC;QAyCtB,kBAAa,GAAG,GAAG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AAgB;QACtB,2DAA2D;QAC3D,oDAAoD;QACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjE,mEAAmE;QACnE,IAAI,cAAc,IAAI,IAAI,CAAC,OAAO,EAAE;YAClC,MAAM,SAAS,GAAG,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC;YAC9C,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC;YAEvB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC9B,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;iBACvB;aACF;YACD,OAAO;SACR;QAED,wDAAwD;QACxD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;SACtB;IACH,CAAC;IAED;;;OAGG;IACK,gBAAgB;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACvB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAyB,UAAU,IAAI,IAAI,CAAC,CACvE,CAAC;IACJ,CAAC;CA6EF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ReactiveController } from 'lit';\n\n/**\n * An element that supports single-selection with `SingleSelectionController`.\n */\nexport interface SingleSelectionElement extends HTMLElement {\n /**\n * Whether or not the element is selected.\n */\n checked: boolean;\n}\n\n/**\n * A `ReactiveController` that provides root node-scoped single selection for\n * elements, similar to native `<input type=\"radio\">` selection.\n *\n * To use, elements should add the controller and call\n * `selectionController.handleCheckedChange()` in a getter/setter. This must\n * be synchronous to match native behavior.\n *\n * @example\n * const CHECKED = Symbol('checked');\n *\n * class MyToggle extends LitElement {\n * get checked() { return this[CHECKED]; }\n * set checked(checked: boolean) {\n * const oldValue = this.checked;\n * if (oldValue === checked) {\n * return;\n * }\n *\n * this[CHECKED] = checked;\n * this.selectionController.handleCheckedChange();\n * this.requestUpdate('checked', oldValue);\n * }\n *\n * [CHECKED] = false;\n *\n * private selectionController = new SingleSelectionController(this);\n *\n * constructor() {\n * super();\n * this.addController(this.selectionController);\n * }\n * }\n */\nexport class SingleSelectionController implements ReactiveController {\n private focused = false;\n\n private root: ParentNode | null = null;\n\n constructor(private readonly host: SingleSelectionElement) {}\n\n hostConnected() {\n this.root = this.host.getRootNode() as ParentNode;\n this.host.addEventListener('keydown', this.handleKeyDown);\n this.host.addEventListener('focusin', this.handleFocusIn);\n this.host.addEventListener('focusout', this.handleFocusOut);\n if (this.host.checked) {\n // Uncheck other siblings when attached if already checked. This mimics\n // native <input type=\"radio\"> behavior.\n this.uncheckSiblings();\n }\n\n // Update for the newly added host.\n this.updateTabIndices();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('keydown', this.handleKeyDown);\n this.host.removeEventListener('focusin', this.handleFocusIn);\n this.host.removeEventListener('focusout', this.handleFocusOut);\n // Update for siblings that are still connected.\n this.updateTabIndices();\n this.root = null;\n }\n\n /**\n * Should be called whenever the host's `checked` property changes\n * synchronously.\n */\n handleCheckedChange() {\n if (!this.host.checked) {\n return;\n }\n\n this.uncheckSiblings();\n this.updateTabIndices();\n }\n\n private readonly handleFocusIn = () => {\n this.focused = true;\n this.updateTabIndices();\n };\n\n private readonly handleFocusOut = () => {\n this.focused = false;\n this.updateTabIndices();\n };\n\n private uncheckSiblings() {\n for (const sibling of this.getNamedSiblings()) {\n if (sibling !== this.host) {\n sibling.checked = false;\n }\n }\n }\n\n /**\n * Updates the `tabindex` of the host and its siblings.\n */\n private updateTabIndices() {\n // There are three tabindex states for a group of elements:\n // 1. If any are checked, that element is focusable.\n const siblings = this.getNamedSiblings();\n const checkedSibling = siblings.find(sibling => sibling.checked);\n // 2. If an element is focused, the others are no longer focusable.\n if (checkedSibling || this.focused) {\n const focusable = checkedSibling || this.host;\n focusable.tabIndex = 0;\n\n for (const sibling of siblings) {\n if (sibling !== focusable) {\n sibling.tabIndex = -1;\n }\n }\n return;\n }\n\n // 3. If none are checked or focused, all are focusable.\n for (const sibling of siblings) {\n sibling.tabIndex = 0;\n }\n }\n\n /**\n * Retrieves all siblings in the host element's root with the same `name`\n * attribute.\n */\n private getNamedSiblings() {\n const name = this.host.getAttribute('name');\n if (!name || !this.root) {\n return [];\n }\n\n return Array.from(\n this.root.querySelectorAll<SingleSelectionElement>(`[name=\"${name}\"]`)\n );\n }\n\n /**\n * Handles arrow key events from the host. Using the arrow keys will\n * select and check the next or previous sibling with the host's\n * `name` attribute.\n */\n private readonly handleKeyDown = (event: KeyboardEvent) => {\n const isDown = event.key === 'ArrowDown';\n const isUp = event.key === 'ArrowUp';\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n // Ignore non-arrow keys\n if (!isLeft && !isRight && !isDown && !isUp) {\n return;\n }\n\n // Don't try to select another sibling if there aren't any.\n const siblings = this.getNamedSiblings();\n if (!siblings.length) {\n return;\n }\n\n // Prevent default interactions on the element for arrow keys,\n // since this controller will introduce new behavior.\n event.preventDefault();\n\n // Check if moving forwards or backwards\n const isRtl = getComputedStyle(this.host).direction === 'rtl';\n const forwards = isRtl ? isLeft || isDown : isRight || isDown;\n\n const hostIndex = siblings.indexOf(this.host);\n let nextIndex = forwards ? hostIndex + 1 : hostIndex - 1;\n // Search for the next sibling that is not disabled to select.\n // If we return to the host index, there is nothing to select.\n while (nextIndex !== hostIndex) {\n if (nextIndex >= siblings.length) {\n // Return to start if moving past the last item.\n nextIndex = 0;\n } else if (nextIndex < 0) {\n // Go to end if moving before the first item.\n nextIndex = siblings.length - 1;\n }\n\n // Check if the next sibling is disabled. If so,\n // move the index and continue searching.\n const nextSibling = siblings[nextIndex];\n if (nextSibling.hasAttribute('disabled')) {\n if (forwards) {\n nextIndex++;\n } else {\n nextIndex--;\n }\n\n continue;\n }\n\n // Uncheck and remove focusability from other siblings.\n for (const sibling of siblings) {\n if (sibling !== nextSibling) {\n sibling.checked = false;\n sibling.tabIndex = -1;\n sibling.blur();\n }\n }\n\n // The next sibling should be checked, focused and dispatch a change event\n nextSibling.checked = true;\n nextSibling.tabIndex = 0;\n nextSibling.focus();\n // Fire a change event since the change is triggered by a user action.\n // This matches native <input type=\"radio\"> behavior.\n nextSibling.dispatchEvent(new Event('change', { bubbles: true }));\n\n break;\n }\n };\n}\n"]}
@@ -1 +0,0 @@
1
- import '../src/ix-radio.js';
@@ -1,44 +0,0 @@
1
- import { html } from 'lit';
2
- import { fixture, expect } from '@open-wc/testing';
3
- import '../src/ix-radio.js';
4
- describe('IxRadio', () => {
5
- it('should render with label and id', async () => {
6
- var _a, _b;
7
- const props = {
8
- label: 'Red',
9
- ariaLabel: 'Red',
10
- value: 'Red',
11
- target: '',
12
- };
13
- const el = await fixture(html `
14
- <ix-radio
15
- .label=${props.label}
16
- .ariaLabel=${props.ariaLabel}
17
- .value=${props.value}
18
- htmlId="test-id"
19
- ></ix-radio>
20
- `);
21
- const radio = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('md-radio');
22
- const label = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('label');
23
- expect(radio).to.be.not.null;
24
- expect(radio === null || radio === void 0 ? void 0 : radio.id).to.equal('test-id');
25
- expect(label).to.be.not.null;
26
- expect(label === null || label === void 0 ? void 0 : label.innerText.trim()).to.equal('Red');
27
- });
28
- it('should not render the label or id if none are specified', async () => {
29
- var _a, _b;
30
- const props = {
31
- ariaLabel: 'Red',
32
- value: 'Red',
33
- };
34
- const el = await fixture(html `
35
- <ix-radio .ariaLabel=${props.ariaLabel} .value=${props.value}></ix-radio>
36
- `);
37
- const radio = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('md-radio');
38
- const label = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('label');
39
- expect(radio === null || radio === void 0 ? void 0 : radio.id).to.equal('');
40
- expect(radio).to.be.not.null;
41
- expect(label).to.be.null;
42
- });
43
- });
44
- //# sourceMappingURL=ix-radio.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ix-radio.test.js","sourceRoot":"","sources":["../../test/ix-radio.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAmB,MAAM,kBAAkB,CAAC;AAEpE,OAAO,oBAAoB,CAAC;AAE5B,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;;QAC/C,MAAM,KAAK,GAAG;YACZ,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,EAAE;SACX,CAAC;QACF,MAAM,EAAE,GAAG,MAAM,OAAO,CAAU,IAAI,CAAA;;iBAEzB,KAAK,CAAC,KAAK;qBACP,KAAK,CAAC,SAAS;iBACnB,KAAK,CAAC,KAAK;;;KAGvB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC7B,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC7B,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;;QACvE,MAAM,KAAK,GAAG;YACZ,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,KAAK;SACb,CAAC;QACF,MAAM,EAAE,GAAG,MAAM,OAAO,CAAU,IAAI,CAAA;6BACb,KAAK,CAAC,SAAS,WAAW,KAAK,CAAC,KAAK;KAC7D,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC7B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect , triggerBlurFor } from '@open-wc/testing';\nimport { IxRadio } from '../src/IxRadio.js';\nimport '../src/ix-radio.js';\n\ndescribe('IxRadio', () => {\n it('should render with label and id', async () => {\n const props = {\n label: 'Red',\n ariaLabel: 'Red',\n value: 'Red',\n target: '',\n };\n const el = await fixture<IxRadio>(html`\n <ix-radio\n .label=${props.label}\n .ariaLabel=${props.ariaLabel}\n .value=${props.value}\n htmlId=\"test-id\"\n ></ix-radio>\n `);\n\n const radio = el.shadowRoot?.querySelector('md-radio');\n const label = el.shadowRoot?.querySelector('label');\n expect(radio).to.be.not.null;\n expect(radio?.id).to.equal('test-id');\n expect(label).to.be.not.null;\n expect(label?.innerText.trim()).to.equal('Red');\n });\n\n it('should not render the label or id if none are specified', async () => {\n const props = {\n ariaLabel: 'Red',\n value: 'Red',\n };\n const el = await fixture<IxRadio>(html`\n <ix-radio .ariaLabel=${props.ariaLabel} .value=${props.value}></ix-radio>\n `);\n\n const radio = el.shadowRoot?.querySelector('md-radio');\n const label = el.shadowRoot?.querySelector('label');\n expect(radio?.id).to.equal('');\n expect(radio).to.be.not.null;\n expect(label).to.be.null;\n });\n});\n"]}
@@ -1 +0,0 @@
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.date.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.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.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.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.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-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/lit-html/directives/if-defined.d.ts","../../../node_modules/lit/directives/if-defined.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/reactive-element/decorators/query-assigned-elements.d.ts","../../../node_modules/lit/decorators.d.ts","../../../node_modules/@material/web/internal/controller/attachable-controller.d.ts","../../../node_modules/@material/web/focus/internal/focus-ring.d.ts","../../../node_modules/@material/web/focus/md-focus-ring.d.ts","../../../node_modules/@material/web/ripple/internal/ripple.d.ts","../../../node_modules/@material/web/ripple/ripple.d.ts","../../../node_modules/@material/web/radio/internal/radio.d.ts","../../../node_modules/@material/web/radio/radio.d.ts","../../../node_modules/@material/web/internal/controller/events.d.ts","../../../node_modules/@material/web/internal/aria/aria.d.ts","../src/ix-radio-styles.ts","../src/single-selection-controller.ts","../src/ixradio.ts","../src/index.ts","../src/ix-radio.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@lit-labs/react/create-component.d.ts","../../../node_modules/@lit-labs/react/index.d.ts","../src/react/ixradio.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/@types/sinonjs__fake-timers/index.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/lit-html/static.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/renderable.d.ts","../../../node_modules/@open-wc/dedupe-mixin/index.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/scopedelementswrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/litfixture.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/ix-radio.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/dom-events.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/readline/promises.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/test.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/accepts/index.d.ts","../../../node_modules/@types/babel__code-frame/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/co-body/index.d.ts","../../../node_modules/@types/command-line-args/index.d.ts","../../../node_modules/@types/content-disposition/index.d.ts","../../../node_modules/@types/convert-source-map/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/send/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/http-errors/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/keygrip/index.d.ts","../../../node_modules/@types/cookies/index.d.ts","../../../node_modules/@types/debounce/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/http-assert/index.d.ts","../../../node_modules/@types/intl-tel-input/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@types/jquery/jquerystatic.d.ts","../../../node_modules/@types/jquery/jquery.d.ts","../../../node_modules/@types/jquery/misc.d.ts","../../../node_modules/@types/jquery/legacy.d.ts","../../../node_modules/@types/sizzle/index.d.ts","../../../node_modules/@types/jquery/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/koa-compose/index.d.ts","../../../node_modules/@types/koa/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/parse5/lib/tree-adapters/default.d.ts","../../../node_modules/@types/parse5/index.d.ts","../../../node_modules/@types/prismjs/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/scheduler/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"7a1971efcba559ea9002ada4c4e3c925004fb67a755300d53b5edf9399354900","e59262ddaae67dec2d226f8a5d05cf6c4dc353c0d9b1e4980a61d7fcf9a2b051","5e30131b6a5587fe666926ad1d9807e733c0a597ed12d682669fcaa331aea576","470b8c2386c916bad4aa0d05e89b271a47dbe1250cb25dc0f93102b457228dde","15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e",{"version":"17f2b4d00e42e0cc1dfc3be692a6da5a14a6cb73b87259e6d20ff02bcd6d573f","affectsGlobalScope":true},"7000ec8572390d035ba5ef993953957150d0c38ffb31b56653c97dd78cb6e1aa","056892cca68dca10a914f1580ba0e5710d26794e8707225dca9b5717ed702f1e","4ddf3962990379d1ea59b369a5516c7533b7944010d6998e0e9b1ab35d5af1f0","1bcd560deed90a43c51b08aa18f7f55229f2e30974ab5ed1b7bb5721be379013","dc08fe04e50bc24d1baded4f33e942222bbdd5d77d6341a93cfe6e4e4586a3be","74fe889b1d2bba4b2893d518ba94e2b20dabe6d19d0c2f9554d9a5d3755710f4","2ae64cd7b6e760496069ee3b496c64700c956a0620740e1ef52b163824859db7","2a8f0a19a927e83421597c056c90695557142f54ca96358f01eb1f2a5eb228be","d08415b3d6d7fd153ba6e7bf7707ffc57f3c6ad85730ea63544756610b4350c6","411f23da7a63c3d3fd4860c41a458e8df239776fd5d9cd36dd3ad6be92afccbd","6ada3e065916c0ef2dbc9bc0f9b5d59afb25d9176f81fa2c8993a536924140c6","356cc1b058e05e07d2acd73bfa87f83a6f4a343450ee375dad232ff4a55d41d8","df286e6b181ed08766bc19cf1a2fddc50bc5d540f233bc1ce4430a3c1c8c8379","f436800c0af503703110c93144fcc7392524636fb4216296411243b29fe0162d","0d5002560b45ce4fd6c4124632f61789e584be0634602486a2ce59541311d153","bbe13c947d7d6c3426e0e5815e2b3464fa03d34a4bf47298c43b9237cf59555b","9f7d0ee33b9f8fa4dc2e9628e0cdf8683104d01de9d3d24f62cd5da014a5bec4","a8992b852521a66f63e0cedc6e1f054b28f972232b6fa5ca59771db6a1c8bbea","905800cc110167503d0cf58bb0dd6fa4aaac1e9cedc9bd9c48e5d1f8b5b8d4c8","37577c4f865accbe17a77e46395831df983810f7f40029dcecab030e0dcf1a98",{"version":"17fef45daf4268739c248d3fd4904112e247beaa33ec18214cf0830cbebae306","affectsGlobalScope":true},"2c887f29f6796ea68247c626acbef560ff29bb8d0042b641e4fc69559841463d",{"version":"726740c77a2cfbf8ddf85c52584bb359be7effbbcb8da1eb74132c9fda946c29","affectsGlobalScope":true},"2571868e740098cfd677ee99183a09d011b529d6860cb6e4df5858234f69b07a",{"version":"943319780f01291dec216cc960385ebf66c530a6492aa5540822f7b44d4e05e9","affectsGlobalScope":true},"a5faee6d6664f8a6e429bd906c6d55b96f802c23a969b32f25420e208cd395ad","c92a25531a3051d64f3805788ab07211e4cf27aba6ef3db97dee290287d50dca",{"version":"9f6c2463a0a34294f1ba0f10f42c8d577bf028393c978ebbf0d62c9f5b12797a","signature":"15a23acdb56850cd8077cbe925ce94a2567c7957c8c4751b748738c08cfcb8d2"},{"version":"01f8a09bb64ff1f4c3f700c71de94e5a24c69d46743d17e3a88a6f0941445825","signature":"2d446a9adec42e317be6dfe240e346f85c8ad6cb6cc4cee166ff5fedabf6f9e8"},{"version":"2e189317b36ab9dcc86d817dbb1515204e6cab2c75081844feeda983ea65a793","signature":"a910c1ccf3f40d07e111e1d7dd0b6489b855f76e435b34365053b0a3fdfd3a91"},"289d9c4984526af7f058192a793758b1442fa25c84ce23bed54336c3183339d8",{"version":"44e977b7c2cd5ea7f7e685b70c1bc525e4a8837e66eed44b5f2bdc08fd146aac","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"0bd5e7096c7bc02bf70b2cc017fc45ef489cb19bd2f32a71af39ff5787f1b56a","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","60ecad5852d4d83edae430e597405132d278a79c10499e9363aecbe1ddc0eade","5f8f00356f6a82e21493b2d57b2178f11b00cf8960df00bd37bdcae24c9333ca",{"version":"b608a6434fb3fe6901467659e8e96abc07d0d96a69fa7235598c1f91f9fb0266","affectsGlobalScope":true},"f2cf91ff23f677bfc43d6e53493802c32d49be819cdc7882551b30bdcc5d0d3c","8b56bffe700912f2b02068748da0bbdc3778ef2a43e8cecf0c4438b3a5e36b1c",{"version":"f66458c038fedca0465ef2509d69cf199e2ad9fd15b3d7842a42bc18952bc408","signature":"1662064d7f9615f9c507ca5dde724f96293e89ccd07cea430c68e0850d9df50e"},{"version":"1fb008c1a29f86a8a0e9a674b7235f23c6d2a86c9658772941fb626a60aac53b","affectsGlobalScope":true},"72bee526b949b9932edba50997ff3b9cdede7b314d790d5f0d94f3d2944930ea",{"version":"2d412861573a672bd90fdcb1e48740593324565f3b3aaf6808c0e3e2f0d54ae8","affectsGlobalScope":true},{"version":"cd711db43a952f15464b571ac11b7a440332cd52342bc92c4bf908c70688f57f","affectsGlobalScope":true},"9d8709c916778cb34830708ed47b78e9a46d1fb2eb73a682b14eee990bed4aa6",{"version":"507e2131e89b515ce40c05c0c2fef6cc575ba8947703f92e8cdf36078747a9ff","affectsGlobalScope":true},"999a90d30a3183dcee987d0a5a7c586aba5bacbf6ce087ba8635124082ccfeea","8a5878edd52f4a720560b4c6e6247e9ddc3df6118ad9cf2f9927903b03d5f440",{"version":"31214658e22c23eb58ff8383346bf6c8d135b3eab0748f3226aa7b6f30d2021f","affectsGlobalScope":true},"cc75216f6b332971954ef74bf3d14c3881c461e82987050d5f62af3e5966e845","ee1fb501d38eaafa8099e00bd1fc7014ccc99bee616c660f605ae3559324793d",{"version":"4b93bb181cf4f25ccbf2ec1f559912c81678433a9784ce84163b5c9e1548998f","affectsGlobalScope":true},"65b91a3725399231d3469529b5e27b85bf2aa98013e607f308e5fe260b47eeff","04e3793f33c71ceae20a4719698c068b72c98cf925b3c5f8a33096c00ed44258","bbc354c6a2740b087f1139e88e90309de480c5390362e2f0d32a145d8d7cf539","605e0f5adf8993110c06c775e2a59b7774d1e7a99fc9657140380bab005063bc","88cda4269c54f0803834fd62b2fac61af8bff7a085693f7ca9df85c1f19dee8a",{"version":"d40075d9f1c08b4a8d8e468076f5258900e99895e7259c40f3923b7044bbed6c","affectsGlobalScope":true},"47a20e497d83cd84ad0aa5363200003f08f850fa819339044e03399941eef063","ade0d37a4c1d1abede2abf2591b7cc6347892ea53d4a39bf44a25fb6f707822f","eefa12914a21dafe4352e79866599498b73b3bd232d19854932f58ef36303fb0","d7840fd94e6dfb5b0d9df5a20fe1e79c8dd72b1efdb74d2ef04c31e3588c6b5b","fa6d684e15fe6e99c7208a51b45c04f8e0147f1c8587871aac48fff55b7b1f24","26a3d4bf5351a0034f4203d42946ef5308b22919ba2f26a3ecb976a17c714d83","735eca4958f164c1121f08f9de89352e6f75a56c1533ceefeae075c085799618","d5b69429138b2fb26076427c630064a71c12959263ec3d92cbec54baf89354e1","793fca6322a14fa8fa6bc6a4fc694fd7bcc88922c4f9abcd48bf6908f8bf939b","0b2b7cb8164fcc6f4a71c1bf47c2cd4828c867f0ec19d178bb20954348de9a30","50f63746fc2a779d1f9c5657fd78e292045dc98b540e026799e039ea629f2943",{"version":"9bd45c4b2099aa0817dcca236cb498d33c0e7312dbb52a16dd87aa60d2664bb9","signature":"0311dd9b915ee46f72125d8c3240f01ad92fceb52b7cb1733c8b841900ec5afa"},"09df3b4f1c937f02e7fee2836d4c4d7a63e66db70fd4d4e97126f4542cc21d9d","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"32465ea19404cb188e84cf08c6b1f6b12d739140436402cdbc184a3fd20a7d81","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"62486c25ff70799e9faac5c6108820969617daeb6e65644c212d03cdb5902a3c","affectsGlobalScope":true},"546ab07e19116d935ad982e76a223275b53bff7771dab94f433b7ab04652936e","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"aefb5a4a209f756b580eb53ea771cca8aad411603926f307a5e5b8ec6b16dcf6","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","f5a8b7ec4b798c88679194a8ebc25dcb6f5368e6e5811fcda9fe12b0d445b8db","b86e1a45b29437f3a99bad4147cb9fe2357617e8008c0484568e5bb5138d6e13","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","42c431e7965b641106b5e25ab3283aa4865ca7bb9909610a2abfa6226e4348be","0b7e732af0a9599be28c091d6bd1cb22c856ec0d415d4749c087c3881ca07a56","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"3b4c85eea12187de9929a76792b98406e8778ce575caca8c574f06da82622c54","f788131a39c81e0c9b9e463645dd7132b5bc1beb609b0e31e5c1ceaea378b4df","0c236069ce7bded4f6774946e928e4b3601894d294054af47a553f7abcafe2c1","21894466693f64957b9bd4c80fa3ec7fdfd4efa9d1861e070aca23f10220c9b2","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","ad8848c289c0b633452e58179f46edccd14b5a0fe90ebce411f79ff040b803e0",{"version":"5d4ef3f46c7f9d62f7c964f9f9ccdd293be99fb3dcc66c983f2aea7430e3c7c6","affectsGlobalScope":true},"91f8b5abcdff8f9ecb9656b9852878718416fb7700b2c4fad8331e5b97c080bb","59d8f064f86a4a2be03b33c0efcc9e7a268ad27b22f82dce16899f3364f70ba8","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"f49fb15c4aa06b65b0dce4db4584bfd8a9f74644baef1511b404dc95be34af00","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"7aaeb5e62f90e1b2be0fc4844df78cdb1be15c22b427bc6c39d57308785b8f10","3ba30205a029ebc0c91d7b1ab4da73f6277d730ca1fc6692d5a9144c6772c76b","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"cbf046714f3a3ba2544957e1973ac94aa819fa8aa668846fa8de47eb1c41b0b2","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eae74e3d50820f37c72c0679fed959cd1e63c98f6a146a55b8c4361582fa6a52","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"aed89e3c18f4c659ee8153a76560dffda23e2d801e1e60d7a67abd84bc555f8d","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","2f940651c2f30e6b29f8743fae3f40b7b1c03615184f837132b56ea75edad08b","5749c327c3f789f658072f8340786966c8b05ea124a56c1d8d60e04649495a4d",{"version":"c9d62b2a51b2ff166314d8be84f6881a7fcbccd37612442cf1c70d27d5352f50","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d3f4c342fb62f348f25f54b473b0ab7371828cbf637134194fa9cdf04856f87b","6738101ae8e56cd3879ab3f99630ada7d78097fc9fd334df7e766216778ca219","ef437dd282a112d1172b50ac7fd86713d475a496da7aeb31119f529f1313c8d5","82819f9ecc249a6a3e284003540d02ea1b1f56f410c23231797b9e1e4b9622df","81a109b6bb6adf5ed70f2c7e6d907b8c3adcf7b47b5ee09701c5f97370fd29b7","c7da551241b7be719b7bd654ab12a5098c3206fbb189076dd2d8871011a6ab5a","f78253406029c78c96d8923b15e89a5900836e47a2b98bee6c83dc142421d395","5ae76b5a59f2f787e9eb2d4f1a066ceb4505a52bf8fe77ac321d791ef2e72000","64fcc79ee3c237816b9cef0a9289b00bf3da5b17040cd970ac04ba03c4ac1595","49f1d42ac650932fe64a9b623c27ea6e681335ea2e7cda52a5358f4248701001","f6218314af6f492ce5461bdadac5b829f5b4b31a3d1da3d04e77ed0afe0829fb","7167d932a7e2e991084421bb22af20024ada5a046d948c742de0f89996de5d0b","e2d3bfa79f0fad3ad67dfb0685c50dbe19b364a440160a2d40d0e3f44c75938c",{"version":"1c598f8d911f0bc39f04910c8c93f2f76fbb65f892ee5ecc38a2b58bb95af752","affectsGlobalScope":true},"4eadf1158f1ae8f7b0deea0f96b391359042cf74d1eb3ce1dacdb69de96e590d","f0120fc76274f614e7b8f5420a74abce69eee25b81e2084479fa426f33ccd46a","003f07cf566395059625b39785398f18652c8952e19790e7d6eeb22a9cbe0440","432dc46f22f9790797d98ccf09f7dc4a897bb5e874921217b951fb808947446b","28ed61ddc42936537ad29ade1404d533b4b28967460e29811409e5a40d9fc3b3","a36023d4a654c11e071b99cde8203d55d9feaf4940c766b9c960b8e0eb4f4c1f","42fe73978ddb3a82329bf41a116e921deb266551e4f0ad9e9c7bdc581c24f085","0670eede14b39fd186fe7e224db70510158af5279528d12292df9b980867c1d0","4274d4169679f93587cb887aa43570c2b5a840db17022093aa232ac2a9ca9beb","e98185f4249720ace1921d59c1ff4612fa5c633a183fc9bf28e2e7b8e3c7fd51",{"version":"481dc63ed954bc59b9169888ef7f009578f0aa395ff56059c173cba33c7ee065","affectsGlobalScope":true},"8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","c79bd2f3e5c05e7ad80dc82ce8d339cac23ac1f5e6cfab96c860bb70d5162873","e3328cedfe4d7fac23ba75d00bf5169269800ab949d0837cd88c4211a52c3762",{"version":"0e2d2d0ccf42bdd96e597727fad4d30bceabe0d161280824eb60d0d7c8929312","affectsGlobalScope":true},{"version":"6f8d2fca4cba47ab1b4ab6238c69d4b91d0e0a232109e4d26b2f9eda946e873c","affectsGlobalScope":true},{"version":"1ba37271a244a1b872be0134c1b86e2bd446093c312d2f76e405b1c989e2fe97","affectsGlobalScope":true},{"version":"381236c13b79159876be4802d48edfc72dea4e8662e58d189676de9d54ad725f","affectsGlobalScope":true},"592c25a8a783ccd3666c22292dab7125aacee947b9fd0e79204a609284ba80e7","2b1af4170f6dfa90f43d2fe3d6c36f95b7fa121aa434a2acefb763d7be460a53","dd89872dd0647dfd63665f3d525c06d114310a2f7a5a9277e5982a152b31be2b","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","fa849c825ac37d70ca78097a1cd06bb5ac281651f765fff8e491cfb0709de57b","c39e1ee964fa0bb318ee2db72c430b3aede3b50dbde414b03b4e43915f80c292","32ab25b7b28b24a138d879ca371b18c8fdfdd564ad5107e1333c5aa5d5fea494","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","30abc554c7ad13063a02ddd06757929b34357aea1f6fcf4ca39114cb0fc19384","2f768f764e91667b3018488352dfcb4b6ef2d14b3e472bbeca7c0b3eae8d7d15","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","0eacae49e20c8004e5022b3abc41cee708925a7bb0a52bafa2e416eca424d39d",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true},"58b3082802116f10782ecaa577a473499def44650204beb38a8541d4d98b757b","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","fc37aca06f6b8b296c42412a2e75ab53d30cd1fa8a340a3bb328a723fd678377","5f2c582b9ef260cb9559a64221b38606378c1fabe17694592cdfe5975a6d7efa","5cd2c1aad6f55e97990dfb8883885be47f885b78a8576f492389ff85e484d698","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","4964ba28dd6c9d086735062e8f4c63f23dd14e20b9b6d2acdc5774760d47b132","cc0700b1b97e18a3d5d9184470502d8762ec85158819d662730c3a8c5d702584","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","f77ff4cd234d3fd18ddd5aeadb6f94374511931976d41f4b9f594cb71f7ce6f3","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","4f18b4e6081e5e980ef53ddf57b9c959d36cffe1eb153865f512a01aeffb5e1e","7f17d4846a88eca5fe71c4474ef687ee89c4acf9b5372ab9b2ee68644b7e0fe0","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","58e0cee50add50d4b6d47a935e26aeb0080d98c9cf729f8af389511cdfa10526","bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31","5fdc3a2b97a9b1987cea799a36c6a4ea2f34fb60e52734361451cb5445f11a94"],"root":[[79,83],91,121],"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":[[88,168],[89,168],[168],[49,168],[59,168],[49,59,168],[49,59,67,168],[47,48,168],[56,70,168],[56,71,168],[56,168],[53,56,72,74,168],[56,75,168],[53,56,70,168],[56,73,168],[110,168],[49,108,109,168],[49,108,168],[92,93,168],[94,168],[93,95,168],[105,106,113,114,115,117,118,168],[107,111,168],[112,168],[108,168],[107,112,116,168],[107,168],[92,104,119,168],[96,99,100,103,168],[141,168,175],[141,168,175,178],[92,168],[141,168,175,180],[141,168,175,178,191,192],[138,141,168,175,180,186,187],[168,179,180,188,190],[168,196],[168,200],[168,201],[168,203,204,205,206,207],[168,212],[138,141,142,146,152,167,168,175,176,183,189,192,193,198,211],[168,213,215,216,217,218,219,220,221,222,223,224,225],[168,213,214,216,217,218,219,220,221,222,223,224,225],[168,214,215,216,217,218,219,220,221,222,223,224,225],[168,213,214,215,217,218,219,220,221,222,223,224,225],[168,213,214,215,216,218,219,220,221,222,223,224,225],[168,213,214,215,216,217,219,220,221,222,223,224,225],[168,213,214,215,216,217,218,220,221,222,223,224,225],[168,213,214,215,216,217,218,219,221,222,223,224,225],[168,213,214,215,216,217,218,219,220,222,223,224,225],[168,213,214,215,216,217,218,219,220,221,223,224,225],[168,213,214,215,216,217,218,219,220,221,222,224,225],[168,213,214,215,216,217,218,219,220,221,222,223,225],[168,213,214,215,216,217,218,219,220,221,222,223,224],[122,168],[125,168],[126,131,159,168],[127,138,139,146,156,167,168],[127,128,138,146,168],[129,168],[130,131,139,147,168],[131,156,164,168],[132,134,138,146,168],[133,168],[134,135,168],[138,168],[136,138,168],[125,138,168],[138,139,140,156,167,168],[138,139,140,153,156,159,168],[168,172],[134,138,141,146,156,167,168],[138,139,141,142,146,156,164,167,168],[141,143,156,164,167,168],[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,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174],[138,144,168],[145,167,168,172],[134,138,146,156,168],[147,168],[148,168],[125,149,168],[150,166,168,172],[151,168],[152,168],[138,153,154,168],[153,155,168,170],[126,138,156,157,158,159,168],[126,156,158,168],[156,157,168],[159,168],[160,168],[125,156,168],[138,162,163,168],[162,163,168],[131,146,156,164,168],[165,168],[146,166,168],[126,141,152,167,168],[131,168],[156,168,169],[145,168,170],[168,171],[126,131,138,140,149,156,167,168,170,172],[156,168,173],[168,232],[168,233],[84,85,86,87,168],[168,175],[168,237,276],[168,237,261,276],[168,276],[168,237],[168,237,262,276],[168,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275],[168,262,276],[139,156,168,175,185],[141,168,175,185,189],[92,102,168],[101,168],[50,168],[138,141,143,146,156,164,167,168,173,175],[138,156,168,175],[98,168],[97,168],[49,53,168],[53,168],[51,52,168],[60,61,62,63,64,65,66,67,68,168],[57,168],[49,53,54,55,168],[46,81,168],[46,56,168],[46,56,58,69,76,77,78,79,80,168],[46,81,88,90,168],[46,56,81,83,120,168],[56],[53,56,76],[81,90],[83]],"referencedMap":[[89,1],[90,2],[47,3],[59,4],[60,5],[63,6],[61,6],[65,6],[68,7],[67,3],[66,6],[64,6],[62,5],[48,3],[49,8],[71,9],[72,10],[78,11],[70,11],[77,3],[75,12],[76,13],[73,14],[74,15],[108,3],[111,16],[110,17],[109,18],[94,19],[95,20],[93,3],[96,21],[119,22],[105,3],[112,23],[113,24],[114,3],[115,25],[117,26],[107,11],[116,27],[118,24],[120,28],[104,29],[176,30],[177,3],[179,31],[100,32],[92,3],[181,33],[182,3],[178,30],[183,3],[184,3],[193,34],[194,3],[195,3],[188,35],[191,36],[197,37],[198,3],[189,3],[199,3],[200,3],[201,38],[202,39],[208,40],[204,3],[203,3],[206,3],[205,3],[209,3],[210,3],[192,3],[211,41],[212,42],[214,43],[215,44],[213,45],[216,46],[217,47],[218,48],[219,49],[220,50],[221,51],[222,52],[223,53],[224,54],[225,55],[226,37],[185,3],[227,3],[228,3],[229,3],[122,56],[123,56],[125,57],[126,58],[127,59],[128,60],[129,61],[130,62],[131,63],[132,64],[133,65],[134,66],[135,66],[137,67],[136,68],[138,69],[139,70],[140,71],[124,72],[174,3],[141,73],[142,74],[143,75],[175,76],[144,77],[145,78],[146,79],[147,80],[148,81],[149,82],[150,83],[151,84],[152,85],[153,86],[154,86],[155,87],[156,88],[158,89],[157,90],[159,91],[160,92],[161,93],[162,94],[163,95],[164,96],[165,97],[166,98],[167,99],[168,100],[169,101],[170,102],[171,103],[172,104],[173,105],[230,3],[231,3],[233,106],[232,107],[234,3],[86,3],[180,3],[187,3],[84,3],[88,108],[235,109],[236,3],[87,3],[261,110],[262,111],[237,112],[240,112],[259,110],[260,110],[250,110],[249,113],[247,110],[242,110],[255,110],[253,110],[257,110],[241,110],[254,110],[258,110],[243,110],[244,110],[256,110],[238,110],[245,110],[246,110],[248,110],[252,110],[263,114],[251,110],[239,110],[276,115],[275,3],[270,114],[272,116],[271,114],[264,114],[265,114],[267,114],[269,114],[273,116],[274,116],[266,116],[268,116],[186,117],[190,118],[103,119],[102,120],[101,3],[207,3],[51,121],[50,3],[196,3],[277,122],[278,123],[97,32],[99,124],[98,125],[85,3],[54,126],[52,127],[57,127],[55,3],[53,128],[106,127],[69,129],[58,130],[56,131],[46,3],[44,3],[45,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[19,3],[23,3],[20,3],[21,3],[22,3],[24,3],[25,3],[26,3],[5,3],[27,3],[28,3],[29,3],[30,3],[6,3],[34,3],[31,3],[32,3],[33,3],[35,3],[7,3],[36,3],[41,3],[42,3],[37,3],[38,3],[39,3],[40,3],[1,3],[43,3],[82,132],[79,133],[83,132],[81,134],[91,135],[80,133],[121,136]],"exportedModulesMap":[[89,1],[90,2],[47,3],[59,4],[60,5],[63,6],[61,6],[65,6],[68,7],[67,3],[66,6],[64,6],[62,5],[48,3],[49,8],[71,9],[72,10],[78,11],[70,11],[77,3],[75,12],[76,13],[73,14],[74,15],[108,3],[111,16],[110,17],[109,18],[94,19],[95,20],[93,3],[96,21],[119,22],[105,3],[112,23],[113,24],[114,3],[115,25],[117,26],[107,11],[116,27],[118,24],[120,28],[104,29],[176,30],[177,3],[179,31],[100,32],[92,3],[181,33],[182,3],[178,30],[183,3],[184,3],[193,34],[194,3],[195,3],[188,35],[191,36],[197,37],[198,3],[189,3],[199,3],[200,3],[201,38],[202,39],[208,40],[204,3],[203,3],[206,3],[205,3],[209,3],[210,3],[192,3],[211,41],[212,42],[214,43],[215,44],[213,45],[216,46],[217,47],[218,48],[219,49],[220,50],[221,51],[222,52],[223,53],[224,54],[225,55],[226,37],[185,3],[227,3],[228,3],[229,3],[122,56],[123,56],[125,57],[126,58],[127,59],[128,60],[129,61],[130,62],[131,63],[132,64],[133,65],[134,66],[135,66],[137,67],[136,68],[138,69],[139,70],[140,71],[124,72],[174,3],[141,73],[142,74],[143,75],[175,76],[144,77],[145,78],[146,79],[147,80],[148,81],[149,82],[150,83],[151,84],[152,85],[153,86],[154,86],[155,87],[156,88],[158,89],[157,90],[159,91],[160,92],[161,93],[162,94],[163,95],[164,96],[165,97],[166,98],[167,99],[168,100],[169,101],[170,102],[171,103],[172,104],[173,105],[230,3],[231,3],[233,106],[232,107],[234,3],[86,3],[180,3],[187,3],[84,3],[88,108],[235,109],[236,3],[87,3],[261,110],[262,111],[237,112],[240,112],[259,110],[260,110],[250,110],[249,113],[247,110],[242,110],[255,110],[253,110],[257,110],[241,110],[254,110],[258,110],[243,110],[244,110],[256,110],[238,110],[245,110],[246,110],[248,110],[252,110],[263,114],[251,110],[239,110],[276,115],[275,3],[270,114],[272,116],[271,114],[264,114],[265,114],[267,114],[269,114],[273,116],[274,116],[266,116],[268,116],[186,117],[190,118],[103,119],[102,120],[101,3],[207,3],[51,121],[50,3],[196,3],[277,122],[278,123],[97,32],[99,124],[98,125],[85,3],[54,126],[52,127],[57,127],[55,3],[53,128],[106,127],[69,129],[58,130],[56,131],[46,3],[44,3],[45,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[19,3],[23,3],[20,3],[21,3],[22,3],[24,3],[25,3],[26,3],[5,3],[27,3],[28,3],[29,3],[30,3],[6,3],[34,3],[31,3],[32,3],[33,3],[35,3],[7,3],[36,3],[41,3],[42,3],[37,3],[38,3],[39,3],[40,3],[1,3],[43,3],[82,132],[79,137],[81,138],[91,139],[80,137],[121,140]],"semanticDiagnosticsPerFile":[89,90,47,59,60,63,61,65,68,67,66,64,62,48,49,71,72,78,70,77,75,76,73,74,108,111,110,109,94,95,93,96,119,105,112,113,114,115,117,107,116,118,120,104,176,177,179,100,92,181,182,178,183,184,193,194,195,188,191,197,198,189,199,200,201,202,208,204,203,206,205,209,210,192,211,212,214,215,213,216,217,218,219,220,221,222,223,224,225,226,185,227,228,229,122,123,125,126,127,128,129,130,131,132,133,134,135,137,136,138,139,140,124,174,141,142,143,175,144,145,146,147,148,149,150,151,152,153,154,155,156,158,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,230,231,233,232,234,86,180,187,84,88,235,236,87,261,262,237,240,259,260,250,249,247,242,255,253,257,241,254,258,243,244,256,238,245,246,248,252,263,251,239,276,275,270,272,271,264,265,267,269,273,274,266,268,186,190,103,102,101,207,51,50,196,277,278,97,99,98,85,54,52,57,55,53,106,69,58,56,46,44,45,8,10,9,2,11,12,13,14,15,16,17,18,3,4,19,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,82,79,83,81,91,80,121]},"version":"5.2.2"}
package/src/IxRadio.ts DELETED
@@ -1,160 +0,0 @@
1
- import { html, LitElement, isServer } from 'lit';
2
- import { ifDefined } from 'lit/directives/if-defined.js';
3
- import { property } from 'lit/decorators.js';
4
- import '@material/web/radio/radio.js';
5
- import { isActivationClick } from '@material/web/internal/controller/events.js';
6
- import { polyfillElementInternalsAria } from '@material/web/internal/aria/aria.js';
7
- import { IxRadioStyles } from './ix-radio-styles.js';
8
- import { SingleSelectionController } from './single-selection-controller.js';
9
-
10
- const CHECKED = Symbol('checked');
11
-
12
- export class IxRadio extends LitElement {
13
- static get styles() {
14
- return [IxRadioStyles];
15
- }
16
-
17
- /** @nocollapse */
18
- static readonly formAssociated = true;
19
-
20
- /**
21
- * Whether or not the radio is selected.
22
- */
23
- @property({ type: Boolean })
24
- get checked() {
25
- return this[CHECKED];
26
- }
27
-
28
- set checked(checked: boolean) {
29
- const wasChecked = this.checked;
30
- if (wasChecked === checked) {
31
- return;
32
- }
33
-
34
- this[CHECKED] = checked;
35
- const state = String(checked);
36
- this.internals.setFormValue(this.checked ? this.value : null, state);
37
- this.requestUpdate('checked', wasChecked);
38
- this.selectionController.handleCheckedChange();
39
- }
40
-
41
- [CHECKED] = false;
42
-
43
- @property({ type: Boolean, reflect: true }) disabled = false;
44
-
45
- @property() label: string = '';
46
-
47
- /**
48
- * The element value to use in form submission when checked.
49
- */
50
- @property() value = 'on';
51
-
52
- @property() ariaLabel: string = '';
53
-
54
- @property() target: 'wrapper' | '' = '';
55
-
56
- @property() htmlId: string | undefined;
57
-
58
- /**
59
- * The HTML name to use in form submission.
60
- */
61
- get name() {
62
- return this.getAttribute('name') ?? '';
63
- }
64
-
65
- set name(name: string) {
66
- this.setAttribute('name', name);
67
- }
68
-
69
- /**
70
- * The associated form element with which this element's value will submit.
71
- */
72
- get form() {
73
- return this.internals.form;
74
- }
75
-
76
- /**
77
- * The labels this element is associated with.
78
- */
79
- get labels() {
80
- return this.internals.labels;
81
- }
82
-
83
- private readonly selectionController = new SingleSelectionController(this);
84
-
85
- private readonly internals = polyfillElementInternalsAria(
86
- this,
87
- (this as HTMLElement) /* needed for closure */
88
- .attachInternals()
89
- );
90
-
91
- private async handleClick(event: Event) {
92
- if (this.disabled) {
93
- return;
94
- }
95
-
96
- // allow event to propagate to user code after a microtask.
97
- await 0;
98
- if (event.defaultPrevented) {
99
- return;
100
- }
101
-
102
- if (isActivationClick(event)) {
103
- this.focus();
104
- }
105
-
106
- // Per spec, clicking on a radio input always selects it.
107
- this.checked = true;
108
- this.dispatchEvent(new Event('change', { bubbles: true }));
109
- this.dispatchEvent(
110
- new InputEvent('input', { bubbles: true, composed: true })
111
- );
112
- }
113
-
114
- private async handleKeydown(event: KeyboardEvent) {
115
- // allow event to propagate to user code after a microtask.
116
- await 0;
117
- if (event.key !== ' ' || event.defaultPrevented) {
118
- return;
119
- }
120
-
121
- this.click();
122
- }
123
-
124
- constructor() {
125
- super();
126
- this.addController(this.selectionController);
127
- if (!isServer) {
128
- this.internals.role = 'radio';
129
- this.addEventListener('click', this.handleClick.bind(this));
130
- this.addEventListener('keydown', this.handleKeydown.bind(this));
131
- }
132
- }
133
-
134
- protected override updated() {
135
- this.internals.ariaChecked = String(this.checked);
136
- }
137
-
138
- get renderRadio() {
139
- return html`
140
- <md-radio
141
- aria-label=${this.ariaLabel || this.label}
142
- name=${this.name}
143
- value=${this.value}
144
- ?checked=${this.checked}
145
- ?disabled=${this.disabled}
146
- id=${ifDefined(this.htmlId)}
147
- touch-target=${this.target}
148
- ></md-radio>
149
- `;
150
- }
151
-
152
- render() {
153
- if (this.label)
154
- return html`<label
155
- >${this.renderRadio} <span> ${this.label}</span>
156
- </label>`;
157
-
158
- return this.renderRadio;
159
- }
160
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export { IxRadio } from './IxRadio.js';
@@ -1,3 +0,0 @@
1
- import { css } from 'lit';
2
-
3
- export const IxRadioStyles = css``;
package/src/ix-radio.ts DELETED
@@ -1,3 +0,0 @@
1
- import { IxRadio } from './IxRadio.js';
2
-
3
- window.customElements.define('ix-radio', IxRadio);
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { createComponent } from '@lit-labs/react';
3
- import { IxRadio as IxRadioLit } from '../IxRadio.js';
4
-
5
- window.customElements.define('ix-button', IxRadioLit);
6
-
7
- export const IxButton = createComponent({
8
- tagName: 'ix-radio',
9
- elementClass: IxRadioLit,
10
- react: React,
11
- events: {
12
- onclick: 'onClick',
13
- onkeydown: 'keydown',
14
- },
15
- });
@@ -1,232 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2022 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- import { ReactiveController } from 'lit';
8
-
9
- /**
10
- * An element that supports single-selection with `SingleSelectionController`.
11
- */
12
- export interface SingleSelectionElement extends HTMLElement {
13
- /**
14
- * Whether or not the element is selected.
15
- */
16
- checked: boolean;
17
- }
18
-
19
- /**
20
- * A `ReactiveController` that provides root node-scoped single selection for
21
- * elements, similar to native `<input type="radio">` selection.
22
- *
23
- * To use, elements should add the controller and call
24
- * `selectionController.handleCheckedChange()` in a getter/setter. This must
25
- * be synchronous to match native behavior.
26
- *
27
- * @example
28
- * const CHECKED = Symbol('checked');
29
- *
30
- * class MyToggle extends LitElement {
31
- * get checked() { return this[CHECKED]; }
32
- * set checked(checked: boolean) {
33
- * const oldValue = this.checked;
34
- * if (oldValue === checked) {
35
- * return;
36
- * }
37
- *
38
- * this[CHECKED] = checked;
39
- * this.selectionController.handleCheckedChange();
40
- * this.requestUpdate('checked', oldValue);
41
- * }
42
- *
43
- * [CHECKED] = false;
44
- *
45
- * private selectionController = new SingleSelectionController(this);
46
- *
47
- * constructor() {
48
- * super();
49
- * this.addController(this.selectionController);
50
- * }
51
- * }
52
- */
53
- export class SingleSelectionController implements ReactiveController {
54
- private focused = false;
55
-
56
- private root: ParentNode | null = null;
57
-
58
- constructor(private readonly host: SingleSelectionElement) {}
59
-
60
- hostConnected() {
61
- this.root = this.host.getRootNode() as ParentNode;
62
- this.host.addEventListener('keydown', this.handleKeyDown);
63
- this.host.addEventListener('focusin', this.handleFocusIn);
64
- this.host.addEventListener('focusout', this.handleFocusOut);
65
- if (this.host.checked) {
66
- // Uncheck other siblings when attached if already checked. This mimics
67
- // native <input type="radio"> behavior.
68
- this.uncheckSiblings();
69
- }
70
-
71
- // Update for the newly added host.
72
- this.updateTabIndices();
73
- }
74
-
75
- hostDisconnected() {
76
- this.host.removeEventListener('keydown', this.handleKeyDown);
77
- this.host.removeEventListener('focusin', this.handleFocusIn);
78
- this.host.removeEventListener('focusout', this.handleFocusOut);
79
- // Update for siblings that are still connected.
80
- this.updateTabIndices();
81
- this.root = null;
82
- }
83
-
84
- /**
85
- * Should be called whenever the host's `checked` property changes
86
- * synchronously.
87
- */
88
- handleCheckedChange() {
89
- if (!this.host.checked) {
90
- return;
91
- }
92
-
93
- this.uncheckSiblings();
94
- this.updateTabIndices();
95
- }
96
-
97
- private readonly handleFocusIn = () => {
98
- this.focused = true;
99
- this.updateTabIndices();
100
- };
101
-
102
- private readonly handleFocusOut = () => {
103
- this.focused = false;
104
- this.updateTabIndices();
105
- };
106
-
107
- private uncheckSiblings() {
108
- for (const sibling of this.getNamedSiblings()) {
109
- if (sibling !== this.host) {
110
- sibling.checked = false;
111
- }
112
- }
113
- }
114
-
115
- /**
116
- * Updates the `tabindex` of the host and its siblings.
117
- */
118
- private updateTabIndices() {
119
- // There are three tabindex states for a group of elements:
120
- // 1. If any are checked, that element is focusable.
121
- const siblings = this.getNamedSiblings();
122
- const checkedSibling = siblings.find(sibling => sibling.checked);
123
- // 2. If an element is focused, the others are no longer focusable.
124
- if (checkedSibling || this.focused) {
125
- const focusable = checkedSibling || this.host;
126
- focusable.tabIndex = 0;
127
-
128
- for (const sibling of siblings) {
129
- if (sibling !== focusable) {
130
- sibling.tabIndex = -1;
131
- }
132
- }
133
- return;
134
- }
135
-
136
- // 3. If none are checked or focused, all are focusable.
137
- for (const sibling of siblings) {
138
- sibling.tabIndex = 0;
139
- }
140
- }
141
-
142
- /**
143
- * Retrieves all siblings in the host element's root with the same `name`
144
- * attribute.
145
- */
146
- private getNamedSiblings() {
147
- const name = this.host.getAttribute('name');
148
- if (!name || !this.root) {
149
- return [];
150
- }
151
-
152
- return Array.from(
153
- this.root.querySelectorAll<SingleSelectionElement>(`[name="${name}"]`)
154
- );
155
- }
156
-
157
- /**
158
- * Handles arrow key events from the host. Using the arrow keys will
159
- * select and check the next or previous sibling with the host's
160
- * `name` attribute.
161
- */
162
- private readonly handleKeyDown = (event: KeyboardEvent) => {
163
- const isDown = event.key === 'ArrowDown';
164
- const isUp = event.key === 'ArrowUp';
165
- const isLeft = event.key === 'ArrowLeft';
166
- const isRight = event.key === 'ArrowRight';
167
- // Ignore non-arrow keys
168
- if (!isLeft && !isRight && !isDown && !isUp) {
169
- return;
170
- }
171
-
172
- // Don't try to select another sibling if there aren't any.
173
- const siblings = this.getNamedSiblings();
174
- if (!siblings.length) {
175
- return;
176
- }
177
-
178
- // Prevent default interactions on the element for arrow keys,
179
- // since this controller will introduce new behavior.
180
- event.preventDefault();
181
-
182
- // Check if moving forwards or backwards
183
- const isRtl = getComputedStyle(this.host).direction === 'rtl';
184
- const forwards = isRtl ? isLeft || isDown : isRight || isDown;
185
-
186
- const hostIndex = siblings.indexOf(this.host);
187
- let nextIndex = forwards ? hostIndex + 1 : hostIndex - 1;
188
- // Search for the next sibling that is not disabled to select.
189
- // If we return to the host index, there is nothing to select.
190
- while (nextIndex !== hostIndex) {
191
- if (nextIndex >= siblings.length) {
192
- // Return to start if moving past the last item.
193
- nextIndex = 0;
194
- } else if (nextIndex < 0) {
195
- // Go to end if moving before the first item.
196
- nextIndex = siblings.length - 1;
197
- }
198
-
199
- // Check if the next sibling is disabled. If so,
200
- // move the index and continue searching.
201
- const nextSibling = siblings[nextIndex];
202
- if (nextSibling.hasAttribute('disabled')) {
203
- if (forwards) {
204
- nextIndex++;
205
- } else {
206
- nextIndex--;
207
- }
208
-
209
- continue;
210
- }
211
-
212
- // Uncheck and remove focusability from other siblings.
213
- for (const sibling of siblings) {
214
- if (sibling !== nextSibling) {
215
- sibling.checked = false;
216
- sibling.tabIndex = -1;
217
- sibling.blur();
218
- }
219
- }
220
-
221
- // The next sibling should be checked, focused and dispatch a change event
222
- nextSibling.checked = true;
223
- nextSibling.tabIndex = 0;
224
- nextSibling.focus();
225
- // Fire a change event since the change is triggered by a user action.
226
- // This matches native <input type="radio"> behavior.
227
- nextSibling.dispatchEvent(new Event('change', { bubbles: true }));
228
-
229
- break;
230
- }
231
- };
232
- }
@@ -1,46 +0,0 @@
1
- import { html } from 'lit';
2
- import { fixture, expect , triggerBlurFor } from '@open-wc/testing';
3
- import { IxRadio } from '../src/IxRadio.js';
4
- import '../src/ix-radio.js';
5
-
6
- describe('IxRadio', () => {
7
- it('should render with label and id', async () => {
8
- const props = {
9
- label: 'Red',
10
- ariaLabel: 'Red',
11
- value: 'Red',
12
- target: '',
13
- };
14
- const el = await fixture<IxRadio>(html`
15
- <ix-radio
16
- .label=${props.label}
17
- .ariaLabel=${props.ariaLabel}
18
- .value=${props.value}
19
- htmlId="test-id"
20
- ></ix-radio>
21
- `);
22
-
23
- const radio = el.shadowRoot?.querySelector('md-radio');
24
- const label = el.shadowRoot?.querySelector('label');
25
- expect(radio).to.be.not.null;
26
- expect(radio?.id).to.equal('test-id');
27
- expect(label).to.be.not.null;
28
- expect(label?.innerText.trim()).to.equal('Red');
29
- });
30
-
31
- it('should not render the label or id if none are specified', async () => {
32
- const props = {
33
- ariaLabel: 'Red',
34
- value: 'Red',
35
- };
36
- const el = await fixture<IxRadio>(html`
37
- <ix-radio .ariaLabel=${props.ariaLabel} .value=${props.value}></ix-radio>
38
- `);
39
-
40
- const radio = el.shadowRoot?.querySelector('md-radio');
41
- const label = el.shadowRoot?.querySelector('label');
42
- expect(radio?.id).to.equal('');
43
- expect(radio).to.be.not.null;
44
- expect(label).to.be.null;
45
- });
46
- });
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2017", "dom"],
8
- "strict": true,
9
- "esModuleInterop": false,
10
- "allowSyntheticDefaultImports": true,
11
- "experimentalDecorators": true,
12
- "importHelpers": true,
13
- "outDir": "dist",
14
- "sourceMap": true,
15
- "inlineSources": true,
16
- "rootDir": "./",
17
- "declaration": true,
18
- "incremental": true
19
- },
20
- "include": ["**/*.ts"]
21
- }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });
@@ -1,43 +0,0 @@
1
- // import { playwrightLauncher } from '@web/test-runner-playwright';
2
-
3
- const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
4
-
5
- export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
6
- /** Test files to run */
7
- files: 'dist/test/**/*.test.js',
8
-
9
- /** Resolve bare module imports */
10
- nodeResolve: {
11
- exportConditions: ['browser', 'development'],
12
- },
13
-
14
- port: 8012,
15
-
16
- /** Filter out lit dev mode logs */
17
- filterBrowserLogs(log) {
18
- for (const arg of log.args) {
19
- if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
20
- return false;
21
- }
22
- }
23
- return true;
24
- },
25
-
26
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
27
- // esbuildTarget: 'auto',
28
-
29
- /** Amount of browsers to run concurrently */
30
- // concurrentBrowsers: 2,
31
-
32
- /** Amount of test files per browser to test concurrently */
33
- // concurrency: 1,
34
-
35
- /** Browsers to run tests on */
36
- // browsers: [
37
- // playwrightLauncher({ product: 'chromium' }),
38
- // playwrightLauncher({ product: 'firefox' }),
39
- // playwrightLauncher({ product: 'webkit' }),
40
- // ],
41
-
42
- // See documentation for all available options
43
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes