@nyaruka/temba-components 0.26.10 → 0.26.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.26.11](https://github.com/nyaruka/temba-components/compare/v0.26.10...v0.26.11)
8
+
9
+ > 14 June 2022
10
+
11
+ - Use status names for badges [`26526fc`](https://github.com/nyaruka/temba-components/commit/26526fc339dc2fd1b2b9a3f3a724616f4f5aa8d7)
12
+
7
13
  #### [v0.26.10](https://github.com/nyaruka/temba-components/compare/v0.26.9...v0.26.10)
8
14
 
9
15
  > 13 June 2022
@@ -4428,7 +4428,7 @@ function __decorate(l,n,e,t){var i,o=arguments.length,u=o<3?n:null===t?t=Object.
4428
4428
  </div>
4429
4429
  </temba-textinput>
4430
4430
  </div>
4431
- `}}__decorate([e$2({type:String})],ContactFieldEditor.prototype,"key",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"value",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"name",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"type",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"icon",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"iconClass",void 0);const STATUS={S:{name:"Stopped",icon:"x-octagon"},B:{name:"Blocked",icon:"slash"},V:{name:"Archived",icon:"archive"}};class ContactBadges extends ContactStoreElement{static get styles(){return r$2`
4431
+ `}}__decorate([e$2({type:String})],ContactFieldEditor.prototype,"key",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"value",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"name",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"type",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"icon",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"iconClass",void 0);const STATUS={stopped:{name:"Stopped",icon:"x-octagon"},blocked:{name:"Blocked",icon:"slash"},archived:{name:"Archived",icon:"archive"}};class ContactBadges extends ContactStoreElement{static get styles(){return r$2`
4432
4432
  temba-label {
4433
4433
  margin: 0.3em;
4434
4434
  }
@@ -4442,7 +4442,7 @@ function __decorate(l,n,e,t){var i,o=arguments.length,u=o<3?n:null===t?t=Object.
4442
4442
  }
4443
4443
  `}render(){if(this.data){const l=STATUS[this.data.status];return $`
4444
4444
  <div class="badges">
4445
- ${l&&"A"!==this.data.status?$`
4445
+ ${l&&"active"!==this.data.status?$`
4446
4446
  <temba-label
4447
4447
  class="status"
4448
4448
  icon="${l.icon}"
package/dist/index.js CHANGED
@@ -4428,7 +4428,7 @@ function __decorate(l,n,e,t){var i,o=arguments.length,u=o<3?n:null===t?t=Object.
4428
4428
  </div>
4429
4429
  </temba-textinput>
4430
4430
  </div>
4431
- `}}__decorate([e$2({type:String})],ContactFieldEditor.prototype,"key",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"value",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"name",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"type",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"icon",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"iconClass",void 0);const STATUS={S:{name:"Stopped",icon:"x-octagon"},B:{name:"Blocked",icon:"slash"},V:{name:"Archived",icon:"archive"}};class ContactBadges extends ContactStoreElement{static get styles(){return r$2`
4431
+ `}}__decorate([e$2({type:String})],ContactFieldEditor.prototype,"key",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"value",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"name",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"type",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"icon",void 0),__decorate([e$2({type:String})],ContactFieldEditor.prototype,"iconClass",void 0);const STATUS={stopped:{name:"Stopped",icon:"x-octagon"},blocked:{name:"Blocked",icon:"slash"},archived:{name:"Archived",icon:"archive"}};class ContactBadges extends ContactStoreElement{static get styles(){return r$2`
4432
4432
  temba-label {
4433
4433
  margin: 0.3em;
4434
4434
  }
@@ -4442,7 +4442,7 @@ function __decorate(l,n,e,t){var i,o=arguments.length,u=o<3?n:null===t?t=Object.
4442
4442
  }
4443
4443
  `}render(){if(this.data){const l=STATUS[this.data.status];return $`
4444
4444
  <div class="badges">
4445
- ${l&&"A"!==this.data.status?$`
4445
+ ${l&&"active"!==this.data.status?$`
4446
4446
  <temba-label
4447
4447
  class="status"
4448
4448
  icon="${l.icon}"
package/dist/sw.js CHANGED
@@ -1,2 +1,2 @@
1
- if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return t[e]||(r=new Promise(async r=>{if("document"in self){const t=document.createElement("script");t.src=e,document.head.appendChild(t),t.onload=r}else importScripts(e),r()})),r.then(()=>{if(!t[e])throw new Error(`Module ${e} didn’t register its module`);return t[e]})},r=(r,t)=>{Promise.all(r.map(e)).then(e=>t(1===e.length?e[0]:e))},t={require:Promise.resolve(r)};self.define=(r,s,o)=>{t[r]||(t[r]=Promise.resolve().then(()=>{let t={};const n={uri:location.origin+r.slice(1)};return Promise.all(s.map(r=>{switch(r){case"exports":return t;case"module":return n;default:return e(r)}})).then(e=>{const r=o(...e);return t.default||(t.default=r),t})}))}}define("./sw.js",["./workbox-80efdfd1"],(function(e){"use strict";e.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"cbffa348.js",revision:"825eda3776fab81cc681718f31a1b1c4"},{url:"templates/components-body.html",revision:"8cad832ee850a113523503fe9885b477"},{url:"templates/components-head.html",revision:"56f6fb630bd4681ff2972aad7c713902"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")}));
1
+ if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return t[e]||(r=new Promise(async r=>{if("document"in self){const t=document.createElement("script");t.src=e,document.head.appendChild(t),t.onload=r}else importScripts(e),r()})),r.then(()=>{if(!t[e])throw new Error(`Module ${e} didn’t register its module`);return t[e]})},r=(r,t)=>{Promise.all(r.map(e)).then(e=>t(1===e.length?e[0]:e))},t={require:Promise.resolve(r)};self.define=(r,s,o)=>{t[r]||(t[r]=Promise.resolve().then(()=>{let t={};const n={uri:location.origin+r.slice(1)};return Promise.all(s.map(r=>{switch(r){case"exports":return t;case"module":return n;default:return e(r)}})).then(e=>{const r=o(...e);return t.default||(t.default=r),t})}))}}define("./sw.js",["./workbox-80efdfd1"],(function(e){"use strict";e.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"fc8a85d9.js",revision:"ca7302fec90861fa4588d493e9dc8154"},{url:"templates/components-body.html",revision:"397d6f781e4a12ad0182eaede5ef3622"},{url:"templates/components-head.html",revision:"70786bf9afb7fb110dcd6583956a89cb"}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"))),e.registerRoute("polyfills/*.js",new e.CacheFirst,"GET")}));
2
2
  //# sourceMappingURL=sw.js.map
package/dist/sw.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sw.js","sources":["../../../../../tmp/7d6e3b57d3146c9bc07af3187206c954/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {skipWaiting as workbox_core_skipWaiting} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-core/skipWaiting.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nworkbox_core_skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"cbffa348.js\",\n \"revision\": \"825eda3776fab81cc681718f31a1b1c4\"\n },\n {\n \"url\": \"templates/components-body.html\",\n \"revision\": \"8cad832ee850a113523503fe9885b477\"\n },\n {\n \"url\": \"templates/components-head.html\",\n \"revision\": \"56f6fb630bd4681ff2972aad7c713902\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"k1BAmCoC,CAClC,KACS,uBACK,oCAEd,KACS,0CACK,oCAEd,KACS,0CACK,qCAEb,oBAE2B,IAAIA,kBAAgCC,0BAA2C,iCAG/E,iBAAkB,IAAIC,aAAiC"}
1
+ {"version":3,"file":"sw.js","sources":["../../../../../tmp/f9cae8c92efc7fa4a2bd5421fad9c389/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-routing/registerRoute.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {skipWaiting as workbox_core_skipWaiting} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-core/skipWaiting.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/runner/work/temba-components/temba-components/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nworkbox_core_skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"fc8a85d9.js\",\n \"revision\": \"ca7302fec90861fa4588d493e9dc8154\"\n },\n {\n \"url\": \"templates/components-body.html\",\n \"revision\": \"397d6f781e4a12ad0182eaede5ef3622\"\n },\n {\n \"url\": \"templates/components-head.html\",\n \"revision\": \"70786bf9afb7fb110dcd6583956a89cb\"\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"/index.html\")));\n\n\nworkbox_routing_registerRoute(\"polyfills/*.js\", new workbox_strategies_CacheFirst(), 'GET');\n\n\n\n\n"],"names":["workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"k1BAmCoC,CAClC,KACS,uBACK,oCAEd,KACS,0CACK,oCAEd,KACS,0CACK,qCAEb,oBAE2B,IAAIA,kBAAgCC,0BAA2C,iCAG/E,iBAAkB,IAAIC,aAAiC"}
@@ -1 +1 @@
1
- <script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/cbffa348.js"></script><script>window.TEMBA_COMPONENTS_VERSION="0.26.10"</script>
1
+ <script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/fc8a85d9.js"></script><script>window.TEMBA_COMPONENTS_VERSION="0.26.11"</script>
@@ -1 +1 @@
1
- <link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/cbffa348.js" crossorigin="anonymous">
1
+ <link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/fc8a85d9.js" crossorigin="anonymous">
@@ -1,9 +1,9 @@
1
1
  import { css, html } from 'lit';
2
2
  import { ContactStoreElement } from './ContactStoreElement';
3
3
  const STATUS = {
4
- S: { name: 'Stopped', icon: 'x-octagon' },
5
- B: { name: 'Blocked', icon: 'slash' },
6
- V: { name: 'Archived', icon: 'archive' },
4
+ stopped: { name: 'Stopped', icon: 'x-octagon' },
5
+ blocked: { name: 'Blocked', icon: 'slash' },
6
+ archived: { name: 'Archived', icon: 'archive' },
7
7
  };
8
8
  export class ContactBadges extends ContactStoreElement {
9
9
  static get styles() {
@@ -26,7 +26,7 @@ export class ContactBadges extends ContactStoreElement {
26
26
  const status = STATUS[this.data.status];
27
27
  return html `
28
28
  <div class="badges">
29
- ${status && this.data.status !== 'A'
29
+ ${status && this.data.status !== 'active'
30
30
  ? html `
31
31
  <temba-label
32
32
  class="status"
@@ -1 +1 @@
1
- {"version":3,"file":"ContactBadges.js","sourceRoot":"","sources":["../../../src/contacts/ContactBadges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,GAAG;IACb,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;IACzC,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;IACrC,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;CACzC,CAAC;AAEF,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IACpD,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;KAYT,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAExC,OAAO,IAAI,CAAA;;YAEL,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,GAAG;gBAClC,CAAC,CAAC,IAAI,CAAA;;;0BAGQ,MAAM,CAAC,IAAI;;mCAEF,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;;;;;oBAKxC,MAAM,CAAC,IAAI;;eAEhB;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,IAAI;gBACd,CAAC,CAAC,IAAI,CAAA;;;;;oDAKkC,kBAAkB,CAClD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAChC;;;;;oBAKC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;;eAExB;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAClB,CAAC,CAAC,IAAI,CAAA;;;;;wDAKsC,kBAAkB,CACtD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAC/B;;;;;oBAKC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;eAEnD;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAY,EAAE,EAAE;gBACtC,OAAO,IAAI,CAAA;;;;wCAIiB,KAAK,CAAC,IAAI;uBAC3B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;;;kBAKxC,KAAK,CAAC,IAAI;;aAEf,CAAC;YACJ,CAAC,CAAC;;OAEL,CAAC;SACH;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { Group } from '../interfaces';\nimport { ContactStoreElement } from './ContactStoreElement';\n\nconst STATUS = {\n S: { name: 'Stopped', icon: 'x-octagon' },\n B: { name: 'Blocked', icon: 'slash' },\n V: { name: 'Archived', icon: 'archive' },\n};\n\nexport class ContactBadges extends ContactStoreElement {\n static get styles() {\n return css`\n temba-label {\n margin: 0.3em;\n }\n\n .badges {\n display: flex;\n flex-wrap: wrap;\n }\n\n .flow {\n }\n `;\n }\n\n public render(): TemplateResult {\n if (this.data) {\n const status = STATUS[this.data.status];\n\n return html`\n <div class=\"badges\">\n ${status && this.data.status !== 'A'\n ? html`\n <temba-label\n class=\"status\"\n icon=\"${status.icon}\"\n onclick=\"goto(event)\"\n href=\"/contact/${status.name.toLowerCase()}\"\n clickable\n secondary\n shadow\n >\n ${status.name}\n </temba-label>\n `\n : null}\n ${this.data.flow\n ? html`\n <temba-label\n class=\"flow\"\n icon=\"flow\"\n onclick=\"goto(event)\"\n href=\"/contact/?search=flow+%3D+${encodeURIComponent(\n '\"' + this.data.flow.name + '\"'\n )}\"\n clickable\n tertiary\n shadow\n >\n ${this.data.flow.name}\n </temba-label>\n `\n : null}\n ${this.data.language\n ? html`\n <temba-label\n class=\"language\"\n icon=\"globe\"\n onclick=\"goto(event)\"\n href=\"/contact/?search=language+%3D+${encodeURIComponent(\n '\"' + this.data.language + '\"'\n )}\"\n clickable\n primary\n shadow\n >\n ${this.store.getLanguageName(this.data.language)}\n </temba-label>\n `\n : null}\n ${this.data.groups.map((group: Group) => {\n return html`\n <temba-label\n class=\"group\"\n onclick=\"goto(event)\"\n href=\"/contact/filter/${group.uuid}/\"\n icon=${group.is_dynamic ? 'atom' : 'users'}\n clickable\n light\n shadow\n >\n ${group.name}\n </temba-label>\n `;\n })}\n </div>\n `;\n } else {\n return null;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ContactBadges.js","sourceRoot":"","sources":["../../../src/contacts/ContactBadges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;IAC/C,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;IAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;CAChD,CAAC;AAEF,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IACpD,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;KAYT,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAExC,OAAO,IAAI,CAAA;;YAEL,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ;gBACvC,CAAC,CAAC,IAAI,CAAA;;;0BAGQ,MAAM,CAAC,IAAI;;mCAEF,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;;;;;oBAKxC,MAAM,CAAC,IAAI;;eAEhB;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,IAAI;gBACd,CAAC,CAAC,IAAI,CAAA;;;;;oDAKkC,kBAAkB,CAClD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAChC;;;;;oBAKC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;;eAExB;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAClB,CAAC,CAAC,IAAI,CAAA;;;;;wDAKsC,kBAAkB,CACtD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAC/B;;;;;oBAKC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;eAEnD;gBACH,CAAC,CAAC,IAAI;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAY,EAAE,EAAE;gBACtC,OAAO,IAAI,CAAA;;;;wCAIiB,KAAK,CAAC,IAAI;uBAC3B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;;;kBAKxC,KAAK,CAAC,IAAI;;aAEf,CAAC;YACJ,CAAC,CAAC;;OAEL,CAAC;SACH;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { Group } from '../interfaces';\nimport { ContactStoreElement } from './ContactStoreElement';\n\nconst STATUS = {\n stopped: { name: 'Stopped', icon: 'x-octagon' },\n blocked: { name: 'Blocked', icon: 'slash' },\n archived: { name: 'Archived', icon: 'archive' },\n};\n\nexport class ContactBadges extends ContactStoreElement {\n static get styles() {\n return css`\n temba-label {\n margin: 0.3em;\n }\n\n .badges {\n display: flex;\n flex-wrap: wrap;\n }\n\n .flow {\n }\n `;\n }\n\n public render(): TemplateResult {\n if (this.data) {\n const status = STATUS[this.data.status];\n\n return html`\n <div class=\"badges\">\n ${status && this.data.status !== 'active'\n ? html`\n <temba-label\n class=\"status\"\n icon=\"${status.icon}\"\n onclick=\"goto(event)\"\n href=\"/contact/${status.name.toLowerCase()}\"\n clickable\n secondary\n shadow\n >\n ${status.name}\n </temba-label>\n `\n : null}\n ${this.data.flow\n ? html`\n <temba-label\n class=\"flow\"\n icon=\"flow\"\n onclick=\"goto(event)\"\n href=\"/contact/?search=flow+%3D+${encodeURIComponent(\n '\"' + this.data.flow.name + '\"'\n )}\"\n clickable\n tertiary\n shadow\n >\n ${this.data.flow.name}\n </temba-label>\n `\n : null}\n ${this.data.language\n ? html`\n <temba-label\n class=\"language\"\n icon=\"globe\"\n onclick=\"goto(event)\"\n href=\"/contact/?search=language+%3D+${encodeURIComponent(\n '\"' + this.data.language + '\"'\n )}\"\n clickable\n primary\n shadow\n >\n ${this.store.getLanguageName(this.data.language)}\n </temba-label>\n `\n : null}\n ${this.data.groups.map((group: Group) => {\n return html`\n <temba-label\n class=\"group\"\n onclick=\"goto(event)\"\n href=\"/contact/filter/${group.uuid}/\"\n icon=${group.is_dynamic ? 'atom' : 'users'}\n clickable\n light\n shadow\n >\n ${group.name}\n </temba-label>\n `;\n })}\n </div>\n `;\n } else {\n return null;\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyaruka/temba-components",
3
- "version": "0.26.10",
3
+ "version": "0.26.11",
4
4
  "description": "Web components to support rapidpro and related projects",
5
5
  "author": "Nyaruka <code@nyaruka.coim>",
6
6
  "main": "dist/index.js",
@@ -3,9 +3,9 @@ import { Group } from '../interfaces';
3
3
  import { ContactStoreElement } from './ContactStoreElement';
4
4
 
5
5
  const STATUS = {
6
- S: { name: 'Stopped', icon: 'x-octagon' },
7
- B: { name: 'Blocked', icon: 'slash' },
8
- V: { name: 'Archived', icon: 'archive' },
6
+ stopped: { name: 'Stopped', icon: 'x-octagon' },
7
+ blocked: { name: 'Blocked', icon: 'slash' },
8
+ archived: { name: 'Archived', icon: 'archive' },
9
9
  };
10
10
 
11
11
  export class ContactBadges extends ContactStoreElement {
@@ -31,7 +31,7 @@ export class ContactBadges extends ContactStoreElement {
31
31
 
32
32
  return html`
33
33
  <div class="badges">
34
- ${status && this.data.status !== 'A'
34
+ ${status && this.data.status !== 'active'
35
35
  ? html`
36
36
  <temba-label
37
37
  class="status"