@vonage/vwc-tags 2.38.0 → 2.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/vwc-tags",
3
- "version": "2.38.0",
3
+ "version": "2.39.1",
4
4
  "description": "tags component",
5
5
  "homepage": "https://github.com/Vonage/vivid/tree/master/components/tags#readme",
6
6
  "license": "ISC",
@@ -26,16 +26,16 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@material/mwc-ripple": "^0.22.1",
29
- "@vonage/vvd-core": "2.38.0",
30
- "@vonage/vvd-foundation": "2.38.0",
31
- "@vonage/vvd-typography": "2.38.0",
32
- "@vonage/vwc-icon": "2.38.0",
29
+ "@vonage/vvd-core": "2.39.1",
30
+ "@vonage/vvd-foundation": "2.39.1",
31
+ "@vonage/vvd-typography": "2.39.1",
32
+ "@vonage/vwc-icon": "2.39.1",
33
33
  "lit-element": "^2.4.0",
34
34
  "lit-html": "^1.3.0",
35
35
  "tslib": "^2.3.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@vonage/vvd-umbrella": "2.38.0"
38
+ "@vonage/vvd-umbrella": "2.39.1"
39
39
  },
40
- "gitHead": "06a78e20396dcd36ef81de6a386a14b9923977e1"
40
+ "gitHead": "7533681acee0b1889d3ee77f5268677f8bff261e"
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vwc-tag-base.js","sourceRoot":"","sources":["src/vwc-tag-base.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EACN,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAkB,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAClF,MAAM,aAAa,CAAC;AACrB,OAAO,E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AC;4CACzB;AAGjB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACZ;AAG7B;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACxB;AAGjB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACtB;AAGnB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACvB;AAGnB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACxB;AAGlB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAClB;AAEhB;IAAR,KAAK,EAAE;sDAAsC;AAyG9C;IADC,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAU/B","sourcesContent":["import '@material/mwc-ripple';\nimport type { Ripple } from '@material/mwc-ripple';\nimport { RippleHandlers } from '@material/mwc-ripple/ripple-handlers.js';\n\nimport type { Connotation, Shape, Layout } from '@vonage/vvd-foundation/constants.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport type { ClassInfo } from 'lit-html/directives/class-map.js';\nimport {\n\tLitElement, html, property, TemplateResult, queryAsync, state, query, eventOptions\n} from 'lit-element';\nimport { nothing } from 'lit-html';\n\n\ntype TagConnotation = Extract<\n\tConnotation,\n\t| Connotation.Primary\n\t| Connotation.CTA\n>;\n\ntype TagShape = Extract<Shape, Shape.Rounded | Shape.Pill>;\n\ntype TagLayout = Extract<\n\tLayout, Layout.Outlined | Layout.Soft\n>;\nexport class VWCTagBase extends LitElement {\n\t@queryAsync('mwc-ripple') ripple!: Promise<Ripple | null>;\n\n\t@query('#selectable') selectableElement!: HTMLElement;\n\n\t@property({ type: String, reflect: true })\n\t\ttext?: string;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tselected = false;\n\n\t@property({ type: String, reflect: true })\n\t\tconnotation?: TagConnotation;\n\n\t@property({ type: String, reflect: true })\n\t\tshape?: TagShape;\n\n\t@property({ type: String, reflect: true })\n\t\tlayout?: TagLayout;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tselectable = false;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tremovable = false;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tremoveEventOnly = false;\n\n\t@state() protected shouldRenderRipple = false;\n\n\tprotected rippleHandlers = new RippleHandlers(() => {\n\t\tthis.shouldRenderRipple = true;\n\t\treturn this.ripple;\n\t});\n\n\toverride focus(): void {\n\t\tconst selectableElement = this.selectableElement;\n\t\tif (selectableElement) {\n\t\t\tthis.rippleHandlers.startFocus();\n\t\t\tselectableElement.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tconst selectableElement = this.selectableElement;\n\t\tif (selectableElement) {\n\t\t\tthis.rippleHandlers.endFocus();\n\t\t\tselectableElement.blur();\n\t\t}\n\t}\n\n\t// protected firstUpdated(): void {\n\t// \tif (this.selected) {\n\t// \t\tthis.handleRippleActivate();\n\t// \t}\n\t// }\n\n\tprotected renderRipple(): TemplateResult | string {\n\t\treturn this.shouldRenderRipple ?\n\t\t\thtml`<mwc-ripple class=\"ripple\"></mwc-ripple>` : '';\n\t}\n\n\tprotected renderIcon(type?: string): TemplateResult {\n\t\treturn html`<vwc-icon class=\"vwc-tag__icon\" .type=\"${type}\"></vwc-icon>`;\n\t}\n\n\tprotected getRenderClasses(): ClassInfo {\n\t\treturn {\n\t\t\t[`connotation-${this.connotation}`]: !!this.connotation,\n\t\t\t[`layout-${this.layout}`]: !!this.layout\n\t\t};\n\t}\n\n\tprotected renderTagSelectable(): TemplateResult {\n\t\tconst classes = {\n\t\t\t'vwc-tag--selected': this.selected,\n\t\t\t...this.getRenderClasses()\n\t\t};\n\n\t\treturn html`<span\n\t\t\tid=\"selectable\"\n\t\t\tclass=\"vwc-tag vwc-tag-selectable ${classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\taria-selected=\"${this.selected}\"\n\t\t\t@focus=\"${this.handleRippleFocus}\"\n\t\t\t@blur=\"${this.handleRippleBlur}\"\n\t\t\t@mousedown=\"${this.handleRippleActivate}\"\n\t\t\t@mouseenter=\"${this.handleRippleMouseEnter}\"\n\t\t\t@mouseleave=\"${this.handleRippleMouseLeave}\"\n\t\t\t@touchstart=\"${this.handleRippleActivate}\"\n\t\t\t@touchend=\"${this.handleRippleDeactivate}\"\n\t\t\t@touchcancel=\"${this.handleRippleDeactivate}\"\n\t\t\t@click=\"${() => this.selected = !this.selected}\"\n\t\t\t@keydown=\"${this.handleKeydown}\">\n\t\t\t${this.renderRipple()}\n\t\t\t<span class=\"vwc-tag__checkmark\">\n\t\t\t\t${this.renderIcon('check-circle-solid')}\n\t\t\t</span>\n\t\t\t<span class=\"text\">\n\t\t\t\t${this.text}\n\t\t\t</span>\n\t\t</span>`;\n\t}\n\n\tprotected removeTag(): void {\n\t\tthis.dispatchEvent(new CustomEvent('remove-tag', {detail: this}));\n\t\tif (!this.removeEventOnly) {\n\t\t\tthis.remove();\n\t\t}\n\t}\n\n\tprotected renderRemoveButton(): TemplateResult {\n\t\treturn html`<button class=\"remove-button\" @click=\"${()=> this.removeTag()}\">\n\t\t\t${this.renderIcon('close-line')}\n\t\t</button>`;\n\t}\n\n\toverride render(): TemplateResult {\n\t\treturn this.selectable\n\t\t\t? this.renderTagSelectable()\n\t\t\t: html`<span class=\"vwc-tag ${classMap(this.getRenderClasses())}\">\n\t\t\t${this.text}\n\t\t\t${this.removable ? this.renderRemoveButton() : nothing}\n\t\t</span>`;\n\t}\n\n\thandleKeydown({ key }: KeyboardEvent): void {\n\t\tif (key === ' '/* spacebar */) {\n\t\t\tthis.selected = !this.selected;\n\t\t}\n\t}\n\n\t@eventOptions({ passive: true })\n\tprotected handleRippleActivate(evt?: Event): void {\n\t\tconst onUp = () => {\n\t\t\twindow.removeEventListener('mouseup', onUp);\n\n\t\t\tthis.handleRippleDeactivate();\n\t\t};\n\n\t\twindow.addEventListener('mouseup', onUp);\n\t\tthis.rippleHandlers.startPress(evt);\n\t}\n\n\tprotected handleRippleDeactivate(): void {\n\t\tthis.rippleHandlers.endPress();\n\t}\n\n\tprotected handleRippleMouseEnter(): void {\n\t\tthis.rippleHandlers.startHover();\n\t}\n\n\tprotected handleRippleMouseLeave(): void {\n\t\tthis.rippleHandlers.endHover();\n\t}\n\n\tprotected handleRippleFocus(): void {\n\t\tthis.rippleHandlers.startFocus();\n\t}\n\n\tprotected handleRippleBlur(): void {\n\t\tthis.rippleHandlers.endFocus();\n\t}\n}\n"]}
1
+ {"version":3,"file":"vwc-tag-base.js","sourceRoot":"","sources":["src/vwc-tag-base.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EACN,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAkB,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAClF,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAcnC,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QASE,aAAQ,GAAG,KAAK,CAAC;QAYjB,eAAU,GAAG,KAAK,CAAC;QAGnB,cAAS,GAAG,KAAK,CAAC;QAGlB,oBAAe,GAAG,KAAK,CAAC;QAEN,uBAAkB,GAAG,KAAK,CAAC;QAEpC,mBAAc,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE;YAClD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;YAC/B,OAAO,IAAI,CAAC,MAAM,CAAC;QACpB,CAAC,CAAC,CAAC;IA4HJ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C,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACxB;AAGlB;IADA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAClB;AAEhB;IAAR,KAAK,EAAE;sDAAsC;AAmG9C;IADC,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAU/B","sourcesContent":["import '@material/mwc-ripple';\nimport type { Ripple } from '@material/mwc-ripple';\nimport { RippleHandlers } from '@material/mwc-ripple/ripple-handlers.js';\n\nimport type { Connotation, Shape, Layout } from '@vonage/vvd-foundation/constants.js';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport type { ClassInfo } from 'lit-html/directives/class-map.js';\nimport {\n\tLitElement, html, property, TemplateResult, queryAsync, state, query, eventOptions\n} from 'lit-element';\nimport { nothing } from 'lit-html';\n\n\ntype TagConnotation = Extract<\n\tConnotation,\n\t| Connotation.Primary\n\t| Connotation.CTA\n>;\n\ntype TagShape = Extract<Shape, Shape.Rounded | Shape.Pill>;\n\ntype TagLayout = Extract<\n\tLayout, Layout.Outlined | Layout.Soft\n>;\nexport class VWCTagBase extends LitElement {\n\t@queryAsync('mwc-ripple') ripple!: Promise<Ripple | null>;\n\n\t@query('#selectable') selectableElement!: HTMLElement;\n\n\t@property({ type: String, reflect: true })\n\t\ttext?: string;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tselected = false;\n\n\t@property({ type: String, reflect: true })\n\t\tconnotation?: TagConnotation;\n\n\t@property({ type: String, reflect: true })\n\t\tshape?: TagShape;\n\n\t@property({ type: String, reflect: true })\n\t\tlayout?: TagLayout;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tselectable = false;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tremovable = false;\n\n\t@property({ type: Boolean, reflect: true })\n\t\tremoveEventOnly = false;\n\n\t@state() protected shouldRenderRipple = false;\n\n\tprotected rippleHandlers = new RippleHandlers(() => {\n\t\tthis.shouldRenderRipple = true;\n\t\treturn this.ripple;\n\t});\n\n\toverride focus(): void {\n\t\tconst selectableElement = this.selectableElement;\n\t\tif (selectableElement) {\n\t\t\tthis.rippleHandlers.startFocus();\n\t\t\tselectableElement.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tconst selectableElement = this.selectableElement;\n\t\tif (selectableElement) {\n\t\t\tthis.rippleHandlers.endFocus();\n\t\t\tselectableElement.blur();\n\t\t}\n\t}\n\n\tprotected renderRipple(): TemplateResult | string {\n\t\treturn this.shouldRenderRipple ?\n\t\t\thtml`<mwc-ripple class=\"ripple\"></mwc-ripple>` : '';\n\t}\n\n\tprotected renderIcon(type?: string): TemplateResult {\n\t\treturn html`<vwc-icon class=\"vwc-tag__icon\" .type=\"${type}\"></vwc-icon>`;\n\t}\n\n\tprotected getRenderClasses(): ClassInfo {\n\t\treturn {\n\t\t\t[`connotation-${this.connotation}`]: !!this.connotation,\n\t\t\t[`layout-${this.layout}`]: !!this.layout\n\t\t};\n\t}\n\n\tprotected renderTagSelectable(): TemplateResult {\n\t\tconst classes = {\n\t\t\t'vwc-tag--selected': this.selected,\n\t\t\t...this.getRenderClasses()\n\t\t};\n\n\t\treturn html`<span\n\t\t\tid=\"selectable\"\n\t\t\tclass=\"vwc-tag vwc-tag-selectable ${classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\taria-selected=\"${this.selected}\"\n\t\t\t@focus=\"${this.handleRippleFocus}\"\n\t\t\t@blur=\"${this.handleRippleBlur}\"\n\t\t\t@mousedown=\"${this.handleRippleActivate}\"\n\t\t\t@mouseenter=\"${this.handleRippleMouseEnter}\"\n\t\t\t@mouseleave=\"${this.handleRippleMouseLeave}\"\n\t\t\t@touchstart=\"${this.handleRippleActivate}\"\n\t\t\t@touchend=\"${this.handleRippleDeactivate}\"\n\t\t\t@touchcancel=\"${this.handleRippleDeactivate}\"\n\t\t\t@click=\"${() => this.selected = !this.selected}\"\n\t\t\t@keydown=\"${this.handleKeydown}\">\n\t\t\t${this.renderRipple()}\n\t\t\t<span class=\"vwc-tag__checkmark\">\n\t\t\t\t${this.renderIcon('check-circle-solid')}\n\t\t\t</span>\n\t\t\t<span class=\"text\">\n\t\t\t\t${this.text}\n\t\t\t</span>\n\t\t</span>`;\n\t}\n\n\tprotected removeTag(): void {\n\t\tthis.dispatchEvent(new CustomEvent('remove-tag', {detail: this}));\n\t\tif (!this.removeEventOnly) {\n\t\t\tthis.remove();\n\t\t}\n\t}\n\n\tprotected renderRemoveButton(): TemplateResult {\n\t\treturn html`<button class=\"remove-button\" @click=\"${()=> this.removeTag()}\">\n\t\t\t${this.renderIcon('close-line')}\n\t\t</button>`;\n\t}\n\n\toverride render(): TemplateResult {\n\t\treturn this.selectable\n\t\t\t? this.renderTagSelectable()\n\t\t\t: html`<span class=\"vwc-tag ${classMap(this.getRenderClasses())}\">\n\t\t\t${this.text}\n\t\t\t${this.removable ? this.renderRemoveButton() : nothing}\n\t\t</span>`;\n\t}\n\n\thandleKeydown({ key }: KeyboardEvent): void {\n\t\tif (key === ' '/* spacebar */) {\n\t\t\tthis.selected = !this.selected;\n\t\t}\n\t}\n\n\t@eventOptions({ passive: true })\n\tprotected handleRippleActivate(evt?: Event): void {\n\t\tconst onUp = () => {\n\t\t\twindow.removeEventListener('mouseup', onUp);\n\n\t\t\tthis.handleRippleDeactivate();\n\t\t};\n\n\t\twindow.addEventListener('mouseup', onUp);\n\t\tthis.rippleHandlers.startPress(evt);\n\t}\n\n\tprotected handleRippleDeactivate(): void {\n\t\tthis.rippleHandlers.endPress();\n\t}\n\n\tprotected handleRippleMouseEnter(): void {\n\t\tthis.rippleHandlers.startHover();\n\t}\n\n\tprotected handleRippleMouseLeave(): void {\n\t\tthis.rippleHandlers.endHover();\n\t}\n\n\tprotected handleRippleFocus(): void {\n\t\tthis.rippleHandlers.startFocus();\n\t}\n\n\tprotected handleRippleBlur(): void {\n\t\tthis.rippleHandlers.endFocus();\n\t}\n}\n"]}