@digital-realty/ix-chip 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.
package/dist/IxChip.d.ts CHANGED
@@ -23,5 +23,6 @@ export declare class IxChip extends LitElement {
23
23
  * The label of the chip.
24
24
  */
25
25
  label: string;
26
- render(): import("lit-html").TemplateResult<1>;
26
+ remove: () => void;
27
+ render(): import("lit").TemplateResult<1>;
27
28
  }
package/dist/IxChip.js CHANGED
@@ -27,6 +27,9 @@ export class IxChip extends LitElement {
27
27
  * The label of the chip.
28
28
  */
29
29
  this.label = '';
30
+ this.remove = () => {
31
+ this.dispatchEvent(new CustomEvent('remove', { bubbles: true }));
32
+ };
30
33
  }
31
34
  render() {
32
35
  let comp;
@@ -51,6 +54,7 @@ export class IxChip extends LitElement {
51
54
  ?disabled=${this.disabled}
52
55
  ?always-focusable=${this.alwaysFocusable}
53
56
  .label=${this.label}
57
+ @remove=${this.remove}
54
58
  >${this.label}</md-input-chip
55
59
  >`;
56
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IxChip.js","sourceRoot":"","sources":["../src/IxChip.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,wCAAwC,CAAC;AAEhD,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QAC8B,eAAU,GAInB,QAAQ,CAAC;QAE5B;;;;WAIG;QAC0B,aAAQ,GAAG,KAAK,CAAC;QAE9C;;;;;;WAMG;QAEH,oBAAe,GAAG,KAAK,CAAC;QAExB;;WAEG;QACS,UAAK,GAAG,EAAE,CAAC;IAoCzB,CAAC;IAlCC,MAAM;QACJ,IAAI,IAAI,CAAC;QACT,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE;YAChC,IAAI,GAAG,IAAI,CAAA;oBACG,IAAI,CAAC,QAAQ;4BACL,IAAI,CAAC,eAAe;iBAC/B,IAAI,CAAC,KAAK;WAChB,IAAI,CAAC,KAAK;QACb,CAAC;SACJ;aAAM,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE;YACvC,IAAI,GAAG,IAAI,CAAA;oBACG,IAAI,CAAC,QAAQ;4BACL,IAAI,CAAC,eAAe;iBAC/B,IAAI,CAAC,KAAK;WAChB,IAAI,CAAC,KAAK;QACb,CAAC;SACJ;aAAM,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO,EAAE;YACtC,IAAI,GAAG,IAAI,CAAA;oBACG,IAAI,CAAC,QAAQ;4BACL,IAAI,CAAC,eAAe;iBAC/B,IAAI,CAAC,KAAK;WAChB,IAAI,CAAC,KAAK;QACb,CAAC;SACJ;aAAM,IAAI,IAAI,CAAC,UAAU,KAAK,YAAY,EAAE;YAC3C,IAAI,GAAG,IAAI,CAAA;oBACG,IAAI,CAAC,QAAQ;4BACL,IAAI,CAAC,eAAe;iBAC/B,IAAI,CAAC,KAAK;WAChB,IAAI,CAAC,KAAK;QACb,CAAC;SACJ;QAED,OAAO,IAAI,CAAA,IAAI,IAAI,GAAG,CAAC;IACzB,CAAC;CACF;AA9D6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAIC;AAOC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAkB;AAU9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;+CACnC;AAKZ;IAAX,QAAQ,EAAE;qCAAY","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport '@material/web/chips/assist-chip.js';\nimport '@material/web/chips/filter-chip.js';\nimport '@material/web/chips/input-chip.js';\nimport '@material/web/chips/suggestion-chip.js';\n\nexport class IxChip extends LitElement {\n @property({ type: String }) appearance:\n | 'assist'\n | 'filter'\n | 'input'\n | 'suggestion' = 'assist';\n\n /**\n * Whether or not the chip is disabled.\n *\n * Disabled chips are not focusable, unless `always-focusable` is set.\n */\n @property({ type: Boolean }) disabled = false;\n\n /**\n * When true, allow disabled chips to be focused with arrow keys.\n *\n * Add this when a chip needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({ type: Boolean, attribute: 'always-focusable' })\n alwaysFocusable = false;\n\n /**\n * The label of the chip.\n */\n @property() label = '';\n\n render() {\n let comp;\n if (this.appearance === 'assist') {\n comp = html`<md-assist-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-assist-chip\n >`;\n } else if (this.appearance === 'filter') {\n comp = html`<md-filter-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-filter-chip\n >`;\n } else if (this.appearance === 'input') {\n comp = html`<md-input-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-input-chip\n >`;\n } else if (this.appearance === 'suggestion') {\n comp = html`<md-suggestion-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-suggestion-chip\n >`;\n }\n\n return html` ${comp} `;\n }\n}\n"]}
1
+ {"version":3,"file":"IxChip.js","sourceRoot":"","sources":["../src/IxChip.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,mCAA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K;WAChB,IAAI,CAAC,KAAK;QACb,CAAC;SACJ;QAED,OAAO,IAAI,CAAA,IAAI,IAAI,GAAG,CAAC;IACzB,CAAC;CACF;AAnE6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAIC;AAOC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAkB;AAU9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;+CACnC;AAKZ;IAAX,QAAQ,EAAE;qCAAY","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport '@material/web/chips/assist-chip.js';\nimport '@material/web/chips/filter-chip.js';\nimport '@material/web/chips/input-chip.js';\nimport '@material/web/chips/suggestion-chip.js';\n\nexport class IxChip extends LitElement {\n @property({ type: String }) appearance:\n | 'assist'\n | 'filter'\n | 'input'\n | 'suggestion' = 'assist';\n\n /**\n * Whether or not the chip is disabled.\n *\n * Disabled chips are not focusable, unless `always-focusable` is set.\n */\n @property({ type: Boolean }) disabled = false;\n\n /**\n * When true, allow disabled chips to be focused with arrow keys.\n *\n * Add this when a chip needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({ type: Boolean, attribute: 'always-focusable' })\n alwaysFocusable = false;\n\n /**\n * The label of the chip.\n */\n @property() label = '';\n\n remove = () => {\n this.dispatchEvent(new CustomEvent('remove', { bubbles: true }));\n };\n\n render() {\n let comp;\n if (this.appearance === 'assist') {\n comp = html`<md-assist-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-assist-chip\n >`;\n } else if (this.appearance === 'filter') {\n comp = html`<md-filter-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-filter-chip\n >`;\n } else if (this.appearance === 'input') {\n comp = html`<md-input-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n @remove=${this.remove}\n >${this.label}</md-input-chip\n >`;\n } else if (this.appearance === 'suggestion') {\n comp = html`<md-suggestion-chip\n ?disabled=${this.disabled}\n ?always-focusable=${this.alwaysFocusable}\n .label=${this.label}\n >${this.label}</md-suggestion-chip\n >`;\n }\n\n return html` ${comp} `;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
2
  import '@material/web/chips/chip-set';
3
3
  export declare class IxChipSet extends LitElement {
4
- render(): import("lit-html").TemplateResult<1>;
4
+ render(): import("lit").TemplateResult<1>;
5
5
  }
@@ -1,4 +1,4 @@
1
1
  import { IxChip as LitComp } from '../IxChip.js';
2
- export declare const IxChip: import("@lit-labs/react").ReactWebComponent<LitComp, {
2
+ export declare const IxChip: import("@lit/react").ReactWebComponent<LitComp, {
3
3
  onclick: string;
4
4
  }>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { createComponent } from '@lit-labs/react';
2
+ import { createComponent } from '@lit/react';
3
3
  import { IxChip as LitComp } from '../IxChip.js';
4
- window.customElements.define('ix-chip', LitComp);
4
+ customElements.define('ix-chip', LitComp);
5
5
  export const IxChip = createComponent({
6
6
  tagName: 'ix-chip',
7
7
  elementClass: LitComp,
@@ -1 +1 @@
1
- {"version":3,"file":"IxChip.js","sourceRoot":"","sources":["../../src/react/IxChip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport { IxChip as LitComp } from '../IxChip.js';\n\nwindow.customElements.define('ix-chip', LitComp);\n\nexport const IxChip = createComponent({\n tagName: 'ix-chip',\n elementClass: LitComp,\n react: React,\n events: {\n onclick: 'onClick',\n },\n});\n"]}
1
+ {"version":3,"file":"IxChip.js","sourceRoot":"","sources":["../../src/react/IxChip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjD,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxChip as LitComp } from '../IxChip.js';\n\ncustomElements.define('ix-chip', LitComp);\n\nexport const IxChip = createComponent({\n tagName: 'ix-chip',\n elementClass: LitComp,\n react: React,\n events: {\n onclick: 'onClick',\n },\n});\n"]}
@@ -1,2 +1,2 @@
1
1
  import { IxChipSet as LitComp } from '../IxChipSet.js';
2
- export declare const IxChipSet: import("@lit-labs/react").ReactWebComponent<LitComp, {}>;
2
+ export declare const IxChipSet: import("@lit/react").ReactWebComponent<LitComp, {}>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { createComponent } from '@lit-labs/react';
2
+ import { createComponent } from '@lit/react';
3
3
  import { IxChipSet as LitComp } from '../IxChipSet.js';
4
- window.customElements.define('ix-chip-set', LitComp);
4
+ customElements.define('ix-chip-set', LitComp);
5
5
  export const IxChipSet = createComponent({
6
6
  tagName: 'ix-chip-set',
7
7
  elementClass: LitComp,
@@ -1 +1 @@
1
- {"version":3,"file":"IxChipSet.js","sourceRoot":"","sources":["../../src/react/IxChipSet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport { IxChipSet as LitComp } from '../IxChipSet.js';\n\nwindow.customElements.define('ix-chip-set', LitComp);\n\nexport const IxChipSet = createComponent({\n tagName: 'ix-chip-set',\n elementClass: LitComp,\n react: React,\n});\n"]}
1
+ {"version":3,"file":"IxChipSet.js","sourceRoot":"","sources":["../../src/react/IxChipSet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEvD,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,OAAO;IACrB,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxChipSet as LitComp } from '../IxChipSet.js';\n\ncustomElements.define('ix-chip-set', LitComp);\n\nexport const IxChipSet = createComponent({\n tagName: 'ix-chip-set',\n elementClass: LitComp,\n react: React,\n});\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-chip following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "1.0.4",
6
+ "version": "1.0.6",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
29
29
  },
30
30
  "dependencies": {
31
- "@lit-labs/react": "^2.0.3",
31
+ "@lit/react": "^1.0.2",
32
32
  "@material/web": "^1.0.0",
33
33
  "lit": "^2.0.2",
34
34
  "react": "^18.2.0"
@@ -97,5 +97,5 @@
97
97
  "README.md",
98
98
  "LICENSE"
99
99
  ],
100
- "gitHead": "f487170ac27de967505c921dabf983d2a122e625"
100
+ "gitHead": "6cd64253a78e37e6ba8882a8c94e6cae73d82d51"
101
101
  }