@nyaruka/temba-components 0.43.4 → 0.43.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/CHANGELOG.md +12 -0
- package/dist/{ae69ab8b.js → 4182f77e.js} +162 -88
- package/dist/index.js +162 -88
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/templates/components-body.html +1 -1
- package/dist/templates/components-head.html +1 -1
- package/out-tsc/src/contacts/ContactBadges.js +156 -45
- package/out-tsc/src/contacts/ContactBadges.js.map +1 -1
- package/out-tsc/src/store/Store.js +5 -0
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/vectoricon/VectorIcon.js +1 -1
- package/out-tsc/src/vectoricon/VectorIcon.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +3 -0
- package/out-tsc/src/vectoricon/index.js.map +1 -1
- package/package.json +1 -1
- package/src/contacts/ContactBadges.ts +164 -56
- package/src/store/Store.ts +6 -0
- package/src/vectoricon/VectorIcon.ts +1 -1
- package/src/vectoricon/index.ts +3 -0
- package/static/css/temba-components.css +1 -0
package/dist/sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
if(!self.define){let e,t={};const o=(o,n)=>(o=new URL(o+".js",n).href,t[o]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=o,e.onload=t,document.head.appendChild(e)}else e=o,importScripts(o),t()})).then((()=>{let e=t[o];if(!e)throw new Error(`Module ${o} didn’t register its module`);return e})));self.define=(n,s)=>{const
|
|
1
|
+
if(!self.define){let e,t={};const o=(o,n)=>(o=new URL(o+".js",n).href,t[o]||new Promise((t=>{if("document"in self){const e=document.createElement("script");e.src=o,e.onload=t,document.head.appendChild(e)}else e=o,importScripts(o),t()})).then((()=>{let e=t[o];if(!e)throw new Error(`Module ${o} didn’t register its module`);return e})));self.define=(n,s)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(t[c])return;let i={};const r=e=>o(e,c),l={module:{uri:c},exports:i,require:r};t[c]=Promise.all(n.map((e=>l[e]||r(e)))).then((e=>(s(...e),i)))}}define(["./workbox-919adfb7"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"4182f77e.js",revision:"3a9fe1a27cbc62ce68c610fc62cfcc3d"},{url:"templates/components-body.html",revision:"a89d016ba406738f5820611cf6e26d14"},{url:"templates/components-head.html",revision:"01ad1d9c4da1d5175c2095c0856557ae"}],{}),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/
|
|
1
|
+
{"version":3,"file":"sw.js","sources":["../../../../../tmp/cc06dfb410e87c253a204e87cd597a8e/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 {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\nself.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\": \"4182f77e.js\",\n \"revision\": \"3a9fe1a27cbc62ce68c610fc62cfcc3d\"\n },\n {\n \"url\": \"templates/components-body.html\",\n \"revision\": \"a89d016ba406738f5820611cf6e26d14\"\n },\n {\n \"url\": \"templates/components-head.html\",\n \"revision\": \"01ad1d9c4da1d5175c2095c0856557ae\"\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":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_strategies_CacheFirst"],"mappings":"0nBAwBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,qCAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,iBAGhFH,EAAAC,cAAC,iBAAkB,IAAIG,aAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/
|
|
1
|
+
<script type="module" src="{{STATIC_URL}}@nyaruka/temba-components/dist/4182f77e.js"></script><script>window.TEMBA_COMPONENTS_VERSION="0.43.6"</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/
|
|
1
|
+
<link rel="modulepreload" href="{{STATIC_URL}}@nyaruka/temba-components/dist/4182f77e.js" crossorigin="anonymous">
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
1
2
|
import { css, html } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { debounce, getClasses } from '../utils';
|
|
2
5
|
import { Icon } from '../vectoricon';
|
|
3
6
|
import { ContactStoreElement } from './ContactStoreElement';
|
|
4
7
|
const STATUS = {
|
|
@@ -7,79 +10,181 @@ const STATUS = {
|
|
|
7
10
|
archived: { name: 'Archived' },
|
|
8
11
|
};
|
|
9
12
|
export class ContactBadges extends ContactStoreElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.hasMore = false;
|
|
16
|
+
this.expanded = false;
|
|
17
|
+
}
|
|
10
18
|
static get styles() {
|
|
11
19
|
return css `
|
|
20
|
+
.wrapper {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
temba-label {
|
|
13
27
|
margin: 0.3em;
|
|
14
28
|
}
|
|
15
29
|
|
|
30
|
+
.expanded .badges {
|
|
31
|
+
max-height: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.expanded .show-button {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
margin-bottom: 0em;
|
|
37
|
+
margin-top: -0.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.expanded .show-line {
|
|
41
|
+
width: 98%;
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
16
45
|
.badges {
|
|
17
46
|
display: flex;
|
|
47
|
+
overflow: hidden;
|
|
18
48
|
flex-wrap: wrap;
|
|
49
|
+
max-height: 2.2em;
|
|
50
|
+
align-self: flex-start;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.show-button {
|
|
54
|
+
transition: all var(--transition-speed) ease-in-out
|
|
55
|
+
var(--transition-speed);
|
|
56
|
+
opacity: 0;
|
|
57
|
+
display: flex;
|
|
58
|
+
padding: 0em 1em;
|
|
59
|
+
margin-top: -0.8em;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
--icon-color-circle: #fff;
|
|
62
|
+
margin-bottom: -1.5em;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.show-line {
|
|
66
|
+
height: 1px;
|
|
67
|
+
width: 100%;
|
|
68
|
+
background: rgba(0, 0, 0, 0.05);
|
|
69
|
+
margin-top: 1em;
|
|
70
|
+
width: 0px;
|
|
71
|
+
transition: width calc(var(--transition-speed) * 2) linear
|
|
72
|
+
var(--transition-speed);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.has-more .show-line {
|
|
76
|
+
width: 98%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.has-more .show-button {
|
|
80
|
+
opacity: 1;
|
|
81
|
+
margin-bottom: 0em;
|
|
82
|
+
margin-top: -0.5em;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.show-button temba-icon {
|
|
86
|
+
border-radius: 9999px;
|
|
19
87
|
}
|
|
20
88
|
`;
|
|
21
89
|
}
|
|
90
|
+
handleResized() {
|
|
91
|
+
if (this.shadowRoot) {
|
|
92
|
+
const badges = this.shadowRoot.querySelector('.badges');
|
|
93
|
+
if (badges) {
|
|
94
|
+
this.hasMore = badges.scrollHeight > badges.clientHeight;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
updated(changedProperties) {
|
|
99
|
+
super.updated(changedProperties);
|
|
100
|
+
if (changedProperties.has('data')) {
|
|
101
|
+
if (!changedProperties.get('data')) {
|
|
102
|
+
const badges = this.shadowRoot.querySelector('.badges');
|
|
103
|
+
new ResizeObserver(debounce(this.handleResized.bind(this), 200)).observe(badges);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
22
107
|
render() {
|
|
23
108
|
if (this.data) {
|
|
24
109
|
const status = STATUS[this.data.status];
|
|
25
110
|
return html `
|
|
26
|
-
<div
|
|
27
|
-
|
|
111
|
+
<div
|
|
112
|
+
class=${getClasses({
|
|
113
|
+
wrapper: true,
|
|
114
|
+
'has-more': this.hasMore,
|
|
115
|
+
expanded: this.expanded,
|
|
116
|
+
})}
|
|
117
|
+
>
|
|
118
|
+
<div class="badges">
|
|
119
|
+
${status && this.data.status !== 'active'
|
|
28
120
|
? html `
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
121
|
+
<temba-label
|
|
122
|
+
icon="icon.contact_${this.data.status}"
|
|
123
|
+
onclick="goto(event)"
|
|
124
|
+
href="/contact/${status.name.toLowerCase()}/"
|
|
125
|
+
secondary
|
|
126
|
+
clickable
|
|
127
|
+
shadow
|
|
128
|
+
>
|
|
129
|
+
${status.name}
|
|
130
|
+
</temba-label>
|
|
131
|
+
`
|
|
40
132
|
: null}
|
|
41
|
-
|
|
133
|
+
${this.data.flow
|
|
42
134
|
? html `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
135
|
+
<temba-label
|
|
136
|
+
icon="flow"
|
|
137
|
+
onclick="goto(event)"
|
|
138
|
+
href="/contact/?search=flow+%3D+${encodeURIComponent('"' + this.data.flow.name + '"')}"
|
|
139
|
+
clickable
|
|
140
|
+
primary
|
|
141
|
+
shadow
|
|
142
|
+
>
|
|
143
|
+
${this.data.flow.name}
|
|
144
|
+
</temba-label>
|
|
145
|
+
`
|
|
54
146
|
: null}
|
|
55
|
-
|
|
147
|
+
${this.data.language
|
|
56
148
|
? html `
|
|
149
|
+
<temba-label
|
|
150
|
+
icon=${Icon.language}
|
|
151
|
+
onclick="goto(event)"
|
|
152
|
+
href="/contact/?search=language+%3D+${encodeURIComponent('"' + this.data.language + '"')}"
|
|
153
|
+
clickable
|
|
154
|
+
primary
|
|
155
|
+
shadow
|
|
156
|
+
>
|
|
157
|
+
${this.store.getLanguageName(this.data.language)}
|
|
158
|
+
</temba-label>
|
|
159
|
+
`
|
|
160
|
+
: null}
|
|
161
|
+
${this.data.groups.map((group) => {
|
|
162
|
+
return html `
|
|
57
163
|
<temba-label
|
|
58
|
-
|
|
164
|
+
class="group"
|
|
59
165
|
onclick="goto(event)"
|
|
60
|
-
href="/contact
|
|
166
|
+
href="/contact/filter/${group.uuid}/"
|
|
167
|
+
icon=${group.is_dynamic ? Icon.group_smart : Icon.group}
|
|
61
168
|
clickable
|
|
62
|
-
primary
|
|
63
169
|
shadow
|
|
64
170
|
>
|
|
65
|
-
${
|
|
171
|
+
${group.name}
|
|
66
172
|
</temba-label>
|
|
67
|
-
|
|
68
|
-
: null}
|
|
69
|
-
${this.data.groups.map((group) => {
|
|
70
|
-
return html `
|
|
71
|
-
<temba-label
|
|
72
|
-
class="group"
|
|
73
|
-
onclick="goto(event)"
|
|
74
|
-
href="/contact/filter/${group.uuid}/"
|
|
75
|
-
icon=${group.is_dynamic ? Icon.group_smart : Icon.group}
|
|
76
|
-
clickable
|
|
77
|
-
shadow
|
|
78
|
-
>
|
|
79
|
-
${group.name}
|
|
80
|
-
</temba-label>
|
|
81
|
-
`;
|
|
173
|
+
`;
|
|
82
174
|
})}
|
|
175
|
+
</div>
|
|
176
|
+
<div class="show-line"></div>
|
|
177
|
+
|
|
178
|
+
<div class="show-button">
|
|
179
|
+
<temba-icon
|
|
180
|
+
@click=${() => {
|
|
181
|
+
this.expanded = !this.expanded;
|
|
182
|
+
}}
|
|
183
|
+
circled
|
|
184
|
+
name=${!this.expanded ? Icon.down : Icon.up}
|
|
185
|
+
animateChange="spin"
|
|
186
|
+
></temba-icon>
|
|
187
|
+
</div>
|
|
83
188
|
</div>
|
|
84
189
|
`;
|
|
85
190
|
}
|
|
@@ -88,4 +193,10 @@ export class ContactBadges extends ContactStoreElement {
|
|
|
88
193
|
}
|
|
89
194
|
}
|
|
90
195
|
}
|
|
196
|
+
__decorate([
|
|
197
|
+
property({ type: Boolean })
|
|
198
|
+
], ContactBadges.prototype, "hasMore", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
property({ type: Boolean })
|
|
201
|
+
], ContactBadges.prototype, "expanded", void 0);
|
|
91
202
|
//# sourceMappingURL=ContactBadges.js.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"ContactBadges.js","sourceRoot":"","sources":["../../../src/contacts/ContactBadges.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;CAC/B,CAAC;AAEF,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAAtD;;QA2EE,YAAO,GAAG,KAAK,CAAC;QAGhB,aAAQ,GAAG,KAAK,CAAC;IAkHnB,CA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,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF;AArHC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Group } from '../interfaces';\nimport { debounce, getClasses } from '../utils';\nimport { Icon } from '../vectoricon';\nimport { ContactStoreElement } from './ContactStoreElement';\n\nconst STATUS = {\n stopped: { name: 'Stopped' },\n blocked: { name: 'Blocked' },\n archived: { name: 'Archived' },\n};\n\nexport class ContactBadges extends ContactStoreElement {\n static get styles() {\n return css`\n .wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n temba-label {\n margin: 0.3em;\n }\n\n .expanded .badges {\n max-height: inherit;\n }\n\n .expanded .show-button {\n opacity: 1;\n margin-bottom: 0em;\n margin-top: -0.5em;\n }\n\n .expanded .show-line {\n width: 98%;\n opacity: 1;\n }\n\n .badges {\n display: flex;\n overflow: hidden;\n flex-wrap: wrap;\n max-height: 2.2em;\n align-self: flex-start;\n }\n\n .show-button {\n transition: all var(--transition-speed) ease-in-out\n var(--transition-speed);\n opacity: 0;\n display: flex;\n padding: 0em 1em;\n margin-top: -0.8em;\n cursor: pointer;\n --icon-color-circle: #fff;\n margin-bottom: -1.5em;\n }\n\n .show-line {\n height: 1px;\n width: 100%;\n background: rgba(0, 0, 0, 0.05);\n margin-top: 1em;\n width: 0px;\n transition: width calc(var(--transition-speed) * 2) linear\n var(--transition-speed);\n }\n\n .has-more .show-line {\n width: 98%;\n }\n\n .has-more .show-button {\n opacity: 1;\n margin-bottom: 0em;\n margin-top: -0.5em;\n }\n\n .show-button temba-icon {\n border-radius: 9999px;\n }\n `;\n }\n\n @property({ type: Boolean })\n hasMore = false;\n\n @property({ type: Boolean })\n expanded = false;\n\n private handleResized() {\n if (this.shadowRoot) {\n const badges = this.shadowRoot.querySelector('.badges');\n if (badges) {\n this.hasMore = badges.scrollHeight > badges.clientHeight;\n }\n }\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n if (changedProperties.has('data')) {\n if (!changedProperties.get('data')) {\n const badges = this.shadowRoot.querySelector('.badges');\n new ResizeObserver(\n debounce(this.handleResized.bind(this), 200)\n ).observe(badges);\n }\n }\n }\n\n public render(): TemplateResult {\n if (this.data) {\n const status = STATUS[this.data.status];\n return html`\n <div\n class=${getClasses({\n wrapper: true,\n 'has-more': this.hasMore,\n expanded: this.expanded,\n })}\n >\n <div class=\"badges\">\n ${status && this.data.status !== 'active'\n ? html`\n <temba-label\n icon=\"icon.contact_${this.data.status}\"\n onclick=\"goto(event)\"\n href=\"/contact/${status.name.toLowerCase()}/\"\n secondary\n clickable\n shadow\n >\n ${status.name}\n </temba-label>\n `\n : null}\n ${this.data.flow\n ? html`\n <temba-label\n icon=\"flow\"\n onclick=\"goto(event)\"\n href=\"/contact/?search=flow+%3D+${encodeURIComponent(\n '\"' + this.data.flow.name + '\"'\n )}\"\n clickable\n primary\n shadow\n >\n ${this.data.flow.name}\n </temba-label>\n `\n : null}\n ${this.data.language\n ? html`\n <temba-label\n icon=${Icon.language}\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 ? Icon.group_smart : Icon.group}\n clickable\n shadow\n >\n ${group.name}\n </temba-label>\n `;\n })}\n </div>\n <div class=\"show-line\"></div>\n\n <div class=\"show-button\">\n <temba-icon\n @click=${() => {\n this.expanded = !this.expanded;\n }}\n circled\n name=${!this.expanded ? Icon.down : Icon.up}\n animateChange=\"spin\"\n ></temba-icon>\n </div>\n </div>\n `;\n } else {\n return null;\n }\n }\n}\n"]}
|
|
@@ -89,6 +89,11 @@ export class Store extends RapidElement {
|
|
|
89
89
|
}
|
|
90
90
|
return 'en';
|
|
91
91
|
}
|
|
92
|
+
refreshGlobals() {
|
|
93
|
+
getAssets(this.globalsEndpoint).then((assets) => {
|
|
94
|
+
this.keyedAssets['globals'] = assets.map((asset) => asset.key);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
92
97
|
refreshFields() {
|
|
93
98
|
return getAssets(this.fieldsEndpoint).then((assets) => {
|
|
94
99
|
this.keyedAssets['fields'] = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/store/Store.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,MAAM,EACN,SAAS,EAGT,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,UAAU,CAAC;AAClB,OAAO,EAML,eAAe,GAEhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,OAAO,KAAM,SAAQ,YAAY;IAAvC;;QAEE,QAAG,GAAG,KAAK,CAAC;QAGZ,QAAG,GAAG,EAAE,CAAC;QA2BD,gBAAW,GAAgB,EAAE,CAAC;QAE9B,WAAM,GAAG,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAElC,WAAM,GAAoC,EAAE,CAAC;QAC7C,WAAM,GAAqC,EAAE,CAAC;QAC9C,cAAS,GAAQ,EAAE,CAAC;QAEpB,mBAAc,GAAmB,EAAE,CAAC;QAoPpC,oBAAe,GAAG,EAAE,CAAC;QAqCtB,aAAQ,GAA8B,EAAE,CAAC;IAgClD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Q,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wCACP;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;0CACP","sourcesContent":["import { property } from 'lit/decorators.js';\nimport {\n fetchResults,\n getUrl,\n getAssets,\n Asset,\n WebResponse,\n postUrl,\n postJSON,\n postForm,\n} from '../utils';\nimport {\n ContactField,\n ContactGroup,\n CompletionOption,\n CompletionSchema,\n KeyedAssets,\n CustomEventType,\n Workspace,\n} from '../interfaces';\nimport { RapidElement } from '../RapidElement';\nimport Lru from 'tiny-lru';\nimport { DateTime } from 'luxon';\n\nexport class Store extends RapidElement {\n @property({ type: Number })\n ttl = 60000;\n\n @property({ type: Number })\n max = 20;\n\n @property({ type: String, attribute: 'completion' })\n completionEndpoint: string;\n\n @property({ type: String, attribute: 'fields' })\n fieldsEndpoint: string;\n\n @property({ type: String, attribute: 'groups' })\n groupsEndpoint: string;\n\n @property({ type: String, attribute: 'globals' })\n globalsEndpoint: string;\n\n @property({ type: String, attribute: 'languages' })\n languagesEndpoint: string;\n\n @property({ type: String, attribute: 'workspace' })\n workspaceEndpoint: string;\n\n @property({ type: Object, attribute: false })\n private schema: CompletionSchema;\n\n @property({ type: Object, attribute: false })\n private fnOptions: CompletionOption[];\n\n @property({ type: Object, attribute: false })\n private keyedAssets: KeyedAssets = {};\n\n private locale = [...navigator.languages];\n\n private fields: { [key: string]: ContactField } = {};\n private groups: { [uuid: string]: ContactGroup } = {};\n private languages: any = {};\n private workspace: Workspace;\n private featuredFields: ContactField[] = [];\n\n // http promise to monitor for completeness\n public httpComplete: Promise<void | WebResponse[]>;\n\n private cache: any;\n\n public getLocale() {\n return this.locale[0];\n }\n\n public reset() {\n this.cache = Lru(this.max, this.ttl);\n\n /* \n // This will create a shorthand unit\n this.humanizer.addLanguage(\"en\", {\n y: () => \"y\",\n mo: () => \"mo\",\n w: () => \"w\",\n d: () => \"d\",\n h: () => \"h\",\n m: () => \"m\",\n s: () => \"s\",\n ms: () => \"ms\",\n decimal: \".\",\n });\n */\n\n const fetches = [];\n if (this.completionEndpoint) {\n fetches.push(\n getUrl(this.completionEndpoint).then(response => {\n this.schema = response.json['context'] as CompletionSchema;\n this.fnOptions = response.json['functions'] as CompletionOption[];\n })\n );\n }\n\n if (this.fieldsEndpoint) {\n fetches.push(this.refreshFields());\n }\n\n if (this.globalsEndpoint) {\n fetches.push(\n getAssets(this.globalsEndpoint).then((assets: Asset[]) => {\n this.keyedAssets['globals'] = assets.map((asset: Asset) => asset.key);\n })\n );\n }\n\n if (this.languagesEndpoint) {\n fetches.push(\n getAssets(this.languagesEndpoint).then((results: any[]) => {\n // convert array of objects to lookup\n this.languages = results.reduce(function (\n languages: any,\n result: any\n ) {\n languages[result.value] = result.name;\n return languages;\n },\n {});\n })\n );\n }\n\n if (this.groupsEndpoint) {\n fetches.push(\n getAssets(this.groupsEndpoint).then((groups: any[]) => {\n groups.forEach((group: any) => {\n this.groups[group.uuid] = group;\n });\n })\n );\n }\n\n if (this.workspaceEndpoint) {\n fetches.push(\n getUrl(this.workspaceEndpoint).then((response: WebResponse) => {\n this.workspace = response.json;\n const lang = response.headers.get('content-language');\n if (lang) {\n this.locale = [lang, ...this.locale];\n }\n })\n );\n }\n\n this.httpComplete = Promise.all(fetches);\n }\n\n public firstUpdated() {\n this.reset();\n }\n\n public getLanguageCode() {\n if (this.locale.length > 0) {\n return this.locale[0].split('-')[0];\n }\n return 'en';\n }\n\n public refreshFields() {\n return getAssets(this.fieldsEndpoint).then((assets: Asset[]) => {\n this.keyedAssets['fields'] = [];\n this.featuredFields = [];\n\n assets.forEach((field: ContactField) => {\n this.keyedAssets['fields'].push(field.key);\n this.fields[field.key] = field;\n if (field.featured) {\n this.featuredFields.push(field);\n }\n });\n\n this.featuredFields.sort((a, b) => {\n return b.priority - a.priority;\n });\n\n this.keyedAssets['fields'].sort();\n\n this.fireCustomEvent(CustomEventType.StoreUpdated, {\n url: this.fieldsEndpoint,\n data: this.keyedAssets['fields'],\n });\n });\n }\n\n public getShortDuration(scheduled: DateTime, compareDate: DateTime = null) {\n const now = compareDate || DateTime.now();\n return scheduled\n .setLocale(this.locale[0])\n .toRelative({ base: now, style: 'long' });\n }\n\n public getShortDurationFromIso(isoDateA: string, isoDateB: string = null) {\n const scheduled = DateTime.fromISO(isoDateA);\n const now = isoDateB ? DateTime.fromISO(isoDateB) : DateTime.now();\n return this.getShortDuration(scheduled, now);\n }\n\n public setKeyedAssets(name: string, values: string[]): void {\n this.keyedAssets[name] = values;\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n }\n\n public getCompletionSchema(): CompletionSchema {\n return this.schema;\n }\n\n public getFunctions(): CompletionOption[] {\n return this.fnOptions;\n }\n\n public getKeyedAssets(): KeyedAssets {\n return this.keyedAssets;\n }\n\n public getFieldKeys(): string[] {\n return this.keyedAssets['fields'] || [];\n }\n\n public getContactField(key: string): ContactField {\n return this.fields[key];\n }\n\n public getFeaturedFields(): ContactField[] {\n return this.featuredFields;\n }\n\n public getLanguageName(iso: string) {\n return this.languages[iso];\n }\n\n public isDynamicGroup(uuid: string): boolean {\n const group = this.groups[uuid];\n // we treat missing groups as dynamic since the\n // api excludes initializing groups\n if (!group || group.query) {\n return true;\n }\n return false;\n }\n\n public getWorkspace(): Workspace {\n return this.workspace;\n }\n\n public formatDate(dateString: string) {\n return DateTime.fromISO(dateString)\n .setLocale(this.getLocale())\n .toLocaleString(DateTime.DATETIME_SHORT);\n }\n\n public postJSON(url: string, payload: any = '') {\n return postJSON(url, payload);\n }\n\n public postForm(url: string, payload: any | FormData) {\n return postForm(url, payload);\n }\n\n public postUrl(\n url: string,\n payload: any = '',\n headers: any = {},\n contentType = null\n ) {\n return postUrl(url, payload, headers, contentType);\n }\n\n public getUrl(\n url: string,\n options?: {\n force?: boolean;\n controller?: AbortController;\n headers?: { [key: string]: string };\n }\n ): Promise<WebResponse> {\n options = options || {};\n if (!options.force && this.cache.has(url)) {\n return new Promise<WebResponse>(resolve => {\n resolve(this.cache.get(url));\n });\n }\n\n return getUrl(url, options.controller, options.headers || {}).then(\n (response: WebResponse) => {\n return new Promise<WebResponse>((resolve, reject) => {\n if (response.status >= 200 && response.status <= 300) {\n this.cache.set(url, response);\n resolve(response);\n } else {\n reject('Status: ' + response.status);\n }\n });\n }\n );\n }\n\n private pendingResolves = {};\n\n /**\n * Fetches all of the results for a given API endpoint with caching\n * @param url\n */\n public getResults(\n url: string,\n options?: { force?: boolean }\n ): Promise<any[]> {\n options = options || {};\n const key = 'results_' + url;\n const results = this.cache.get(key);\n\n if (!options.force && results) {\n return new Promise<any[]>(resolve => {\n resolve(results);\n });\n }\n\n return new Promise<any[]>(resolve => {\n const pending = this.pendingResolves[url] || [];\n pending.push(resolve);\n this.pendingResolves[url] = pending;\n if (pending.length <= 1) {\n fetchResults(url).then((results: any[]) => {\n this.cache.set(key, results);\n const pending = this.pendingResolves[url] || [];\n while (pending.length > 0) {\n const resolve = pending.pop();\n resolve(results);\n }\n });\n }\n });\n }\n\n public fetching: { [url: string]: number } = {};\n\n public updateCache(url: string, data: any) {\n this.cache.set(url, data);\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data });\n }\n\n public makeRequest(\n url: string,\n options?: { force?: boolean; prepareData?: (data: any) => any }\n ) {\n const previousRequest = this.fetching[url];\n const now = new Date().getTime();\n // if the request was recently made, don't do anything\n if (previousRequest && now - previousRequest < 500) {\n return;\n }\n\n this.fetching[url] = now;\n options = options || {};\n const cached = this.cache.get(url);\n if (cached && !options.force) {\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data: cached });\n } else {\n fetchResults(url).then(data => {\n data = options.prepareData ? options.prepareData(data) : data;\n this.cache.set(url, data);\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data });\n delete this.fetching[url];\n });\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","s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'lit/decorators.js';\nimport {\n fetchResults,\n getUrl,\n getAssets,\n Asset,\n WebResponse,\n postUrl,\n postJSON,\n postForm,\n} from '../utils';\nimport {\n ContactField,\n ContactGroup,\n CompletionOption,\n CompletionSchema,\n KeyedAssets,\n CustomEventType,\n Workspace,\n} from '../interfaces';\nimport { RapidElement } from '../RapidElement';\nimport Lru from 'tiny-lru';\nimport { DateTime } from 'luxon';\n\nexport class Store extends RapidElement {\n @property({ type: Number })\n ttl = 60000;\n\n @property({ type: Number })\n max = 20;\n\n @property({ type: String, attribute: 'completion' })\n completionEndpoint: string;\n\n @property({ type: String, attribute: 'fields' })\n fieldsEndpoint: string;\n\n @property({ type: String, attribute: 'groups' })\n groupsEndpoint: string;\n\n @property({ type: String, attribute: 'globals' })\n globalsEndpoint: string;\n\n @property({ type: String, attribute: 'languages' })\n languagesEndpoint: string;\n\n @property({ type: String, attribute: 'workspace' })\n workspaceEndpoint: string;\n\n @property({ type: Object, attribute: false })\n private schema: CompletionSchema;\n\n @property({ type: Object, attribute: false })\n private fnOptions: CompletionOption[];\n\n @property({ type: Object, attribute: false })\n private keyedAssets: KeyedAssets = {};\n\n private locale = [...navigator.languages];\n\n private fields: { [key: string]: ContactField } = {};\n private groups: { [uuid: string]: ContactGroup } = {};\n private languages: any = {};\n private workspace: Workspace;\n private featuredFields: ContactField[] = [];\n\n // http promise to monitor for completeness\n public httpComplete: Promise<void | WebResponse[]>;\n\n private cache: any;\n\n public getLocale() {\n return this.locale[0];\n }\n\n public reset() {\n this.cache = Lru(this.max, this.ttl);\n\n /* \n // This will create a shorthand unit\n this.humanizer.addLanguage(\"en\", {\n y: () => \"y\",\n mo: () => \"mo\",\n w: () => \"w\",\n d: () => \"d\",\n h: () => \"h\",\n m: () => \"m\",\n s: () => \"s\",\n ms: () => \"ms\",\n decimal: \".\",\n });\n */\n\n const fetches = [];\n if (this.completionEndpoint) {\n fetches.push(\n getUrl(this.completionEndpoint).then(response => {\n this.schema = response.json['context'] as CompletionSchema;\n this.fnOptions = response.json['functions'] as CompletionOption[];\n })\n );\n }\n\n if (this.fieldsEndpoint) {\n fetches.push(this.refreshFields());\n }\n\n if (this.globalsEndpoint) {\n fetches.push(\n getAssets(this.globalsEndpoint).then((assets: Asset[]) => {\n this.keyedAssets['globals'] = assets.map((asset: Asset) => asset.key);\n })\n );\n }\n\n if (this.languagesEndpoint) {\n fetches.push(\n getAssets(this.languagesEndpoint).then((results: any[]) => {\n // convert array of objects to lookup\n this.languages = results.reduce(function (\n languages: any,\n result: any\n ) {\n languages[result.value] = result.name;\n return languages;\n },\n {});\n })\n );\n }\n\n if (this.groupsEndpoint) {\n fetches.push(\n getAssets(this.groupsEndpoint).then((groups: any[]) => {\n groups.forEach((group: any) => {\n this.groups[group.uuid] = group;\n });\n })\n );\n }\n\n if (this.workspaceEndpoint) {\n fetches.push(\n getUrl(this.workspaceEndpoint).then((response: WebResponse) => {\n this.workspace = response.json;\n const lang = response.headers.get('content-language');\n if (lang) {\n this.locale = [lang, ...this.locale];\n }\n })\n );\n }\n\n this.httpComplete = Promise.all(fetches);\n }\n\n public firstUpdated() {\n this.reset();\n }\n\n public getLanguageCode() {\n if (this.locale.length > 0) {\n return this.locale[0].split('-')[0];\n }\n return 'en';\n }\n\n public refreshGlobals() {\n getAssets(this.globalsEndpoint).then((assets: Asset[]) => {\n this.keyedAssets['globals'] = assets.map((asset: Asset) => asset.key);\n });\n }\n\n public refreshFields() {\n return getAssets(this.fieldsEndpoint).then((assets: Asset[]) => {\n this.keyedAssets['fields'] = [];\n this.featuredFields = [];\n\n assets.forEach((field: ContactField) => {\n this.keyedAssets['fields'].push(field.key);\n this.fields[field.key] = field;\n if (field.featured) {\n this.featuredFields.push(field);\n }\n });\n\n this.featuredFields.sort((a, b) => {\n return b.priority - a.priority;\n });\n\n this.keyedAssets['fields'].sort();\n\n this.fireCustomEvent(CustomEventType.StoreUpdated, {\n url: this.fieldsEndpoint,\n data: this.keyedAssets['fields'],\n });\n });\n }\n\n public getShortDuration(scheduled: DateTime, compareDate: DateTime = null) {\n const now = compareDate || DateTime.now();\n return scheduled\n .setLocale(this.locale[0])\n .toRelative({ base: now, style: 'long' });\n }\n\n public getShortDurationFromIso(isoDateA: string, isoDateB: string = null) {\n const scheduled = DateTime.fromISO(isoDateA);\n const now = isoDateB ? DateTime.fromISO(isoDateB) : DateTime.now();\n return this.getShortDuration(scheduled, now);\n }\n\n public setKeyedAssets(name: string, values: string[]): void {\n this.keyedAssets[name] = values;\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n }\n\n public getCompletionSchema(): CompletionSchema {\n return this.schema;\n }\n\n public getFunctions(): CompletionOption[] {\n return this.fnOptions;\n }\n\n public getKeyedAssets(): KeyedAssets {\n return this.keyedAssets;\n }\n\n public getFieldKeys(): string[] {\n return this.keyedAssets['fields'] || [];\n }\n\n public getContactField(key: string): ContactField {\n return this.fields[key];\n }\n\n public getFeaturedFields(): ContactField[] {\n return this.featuredFields;\n }\n\n public getLanguageName(iso: string) {\n return this.languages[iso];\n }\n\n public isDynamicGroup(uuid: string): boolean {\n const group = this.groups[uuid];\n // we treat missing groups as dynamic since the\n // api excludes initializing groups\n if (!group || group.query) {\n return true;\n }\n return false;\n }\n\n public getWorkspace(): Workspace {\n return this.workspace;\n }\n\n public formatDate(dateString: string) {\n return DateTime.fromISO(dateString)\n .setLocale(this.getLocale())\n .toLocaleString(DateTime.DATETIME_SHORT);\n }\n\n public postJSON(url: string, payload: any = '') {\n return postJSON(url, payload);\n }\n\n public postForm(url: string, payload: any | FormData) {\n return postForm(url, payload);\n }\n\n public postUrl(\n url: string,\n payload: any = '',\n headers: any = {},\n contentType = null\n ) {\n return postUrl(url, payload, headers, contentType);\n }\n\n public getUrl(\n url: string,\n options?: {\n force?: boolean;\n controller?: AbortController;\n headers?: { [key: string]: string };\n }\n ): Promise<WebResponse> {\n options = options || {};\n if (!options.force && this.cache.has(url)) {\n return new Promise<WebResponse>(resolve => {\n resolve(this.cache.get(url));\n });\n }\n\n return getUrl(url, options.controller, options.headers || {}).then(\n (response: WebResponse) => {\n return new Promise<WebResponse>((resolve, reject) => {\n if (response.status >= 200 && response.status <= 300) {\n this.cache.set(url, response);\n resolve(response);\n } else {\n reject('Status: ' + response.status);\n }\n });\n }\n );\n }\n\n private pendingResolves = {};\n\n /**\n * Fetches all of the results for a given API endpoint with caching\n * @param url\n */\n public getResults(\n url: string,\n options?: { force?: boolean }\n ): Promise<any[]> {\n options = options || {};\n const key = 'results_' + url;\n const results = this.cache.get(key);\n\n if (!options.force && results) {\n return new Promise<any[]>(resolve => {\n resolve(results);\n });\n }\n\n return new Promise<any[]>(resolve => {\n const pending = this.pendingResolves[url] || [];\n pending.push(resolve);\n this.pendingResolves[url] = pending;\n if (pending.length <= 1) {\n fetchResults(url).then((results: any[]) => {\n this.cache.set(key, results);\n const pending = this.pendingResolves[url] || [];\n while (pending.length > 0) {\n const resolve = pending.pop();\n resolve(results);\n }\n });\n }\n });\n }\n\n public fetching: { [url: string]: number } = {};\n\n public updateCache(url: string, data: any) {\n this.cache.set(url, data);\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data });\n }\n\n public makeRequest(\n url: string,\n options?: { force?: boolean; prepareData?: (data: any) => any }\n ) {\n const previousRequest = this.fetching[url];\n const now = new Date().getTime();\n // if the request was recently made, don't do anything\n if (previousRequest && now - previousRequest < 500) {\n return;\n }\n\n this.fetching[url] = now;\n options = options || {};\n const cached = this.cache.get(url);\n if (cached && !options.force) {\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data: cached });\n } else {\n fetchResults(url).then(data => {\n data = options.prepareData ? options.prepareData(data) : data;\n this.cache.set(url, data);\n this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data });\n delete this.fetching[url];\n });\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorIcon.js","sourceRoot":"","sources":["../../../src/vectoricon/VectorIcon.ts"],"names":[],"mappings":";AAAA,OAAO,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M,EAAE,CAAC;sCAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACT;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACL;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACN;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACH;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yCACnC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACvB;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACuB","sourcesContent":["import { LitElement, TemplateResult, html, css } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Icon } from '.';\n\nimport { getClasses } from '../utils';\n\n// for cache busting, increase whenever the icon set changes\nconst ICON_VERSION = 15;\n\nexport class VectorIcon extends LitElement {\n @property({ type: String })\n name: string;\n\n @property({ type: String })\n prefix: string;\n\n // same as name but without implicit coloring\n @property({ type: String })\n id: string;\n\n @property({ type: Number })\n size = 1;\n\n @property({ type: Boolean })\n clickable: boolean;\n\n @property({ type: Boolean })\n circled: boolean;\n\n @property({ type: String })\n animateChange: string;\n\n @property({ type: String })\n animateClick: string;\n\n @property({ type: Number })\n animationDuration = 200;\n\n @property({ type: String })\n src = '';\n\n @property({ type: Number, attribute: false })\n steps = 2;\n\n @property({ type: Number, attribute: false })\n animationStep: number;\n\n @property({ type: String })\n easing = 'cubic-bezier(0.68, -0.55, 0.265, 1.55)';\n\n static get styles() {\n return css`\n :host {\n margin: auto;\n }\n\n .sheet {\n color: var(--icon-color);\n transform: scale(1);\n transition: fill 100ms ease-in-out,\n background 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55),\n padding 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55),\n margin 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55);\n }\n\n .sheet.spin {\n transform: rotate(0deg);\n }\n\n .sheet.spin-1 {\n transform: rotate(180deg);\n }\n\n .sheet.spin-2 {\n transform: rotate(360deg);\n }\n\n .sheet.spin-3 {\n transform: rotate(0deg);\n transition-duration: 0ms !important;\n }\n\n .sheet.pulse {\n transform: scale(1);\n }\n\n .sheet.pulse-1 {\n transform: scale(1.2);\n }\n\n .clickable:hover {\n cursor: pointer;\n fill: var(--color-link-primary) !important;\n background: rgb(255, 255, 255);\n }\n\n .circled {\n background:
|
|
1
|
+
{"version":3,"file":"VectorIcon.js","sourceRoot":"","sources":["../../../src/vectoricon/VectorIcon.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,4DAA4D;AAC5D,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,OAAO,UAAW,SAAQ,UAAU;IAyCxC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2ET,CAAC;IACJ,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QA7GV,SAAI,GAAG,CA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,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yCACnC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACvB;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACuB","sourcesContent":["import { LitElement, TemplateResult, html, css } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Icon } from '.';\n\nimport { getClasses } from '../utils';\n\n// for cache busting, increase whenever the icon set changes\nconst ICON_VERSION = 15;\n\nexport class VectorIcon extends LitElement {\n @property({ type: String })\n name: string;\n\n @property({ type: String })\n prefix: string;\n\n // same as name but without implicit coloring\n @property({ type: String })\n id: string;\n\n @property({ type: Number })\n size = 1;\n\n @property({ type: Boolean })\n clickable: boolean;\n\n @property({ type: Boolean })\n circled: boolean;\n\n @property({ type: String })\n animateChange: string;\n\n @property({ type: String })\n animateClick: string;\n\n @property({ type: Number })\n animationDuration = 200;\n\n @property({ type: String })\n src = '';\n\n @property({ type: Number, attribute: false })\n steps = 2;\n\n @property({ type: Number, attribute: false })\n animationStep: number;\n\n @property({ type: String })\n easing = 'cubic-bezier(0.68, -0.55, 0.265, 1.55)';\n\n static get styles() {\n return css`\n :host {\n margin: auto;\n }\n\n .sheet {\n color: var(--icon-color);\n transform: scale(1);\n transition: fill 100ms ease-in-out,\n background 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55),\n padding 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55),\n margin 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55);\n }\n\n .sheet.spin {\n transform: rotate(0deg);\n }\n\n .sheet.spin-1 {\n transform: rotate(180deg);\n }\n\n .sheet.spin-2 {\n transform: rotate(360deg);\n }\n\n .sheet.spin-3 {\n transform: rotate(0deg);\n transition-duration: 0ms !important;\n }\n\n .sheet.pulse {\n transform: scale(1);\n }\n\n .sheet.pulse-1 {\n transform: scale(1.2);\n }\n\n .clickable:hover {\n cursor: pointer;\n fill: var(--color-link-primary) !important;\n background: rgb(255, 255, 255);\n }\n\n .circled {\n background: var(--icon-color-circle);\n padding: 0.15em;\n margin: -0.15em;\n box-shadow: var(--shadow);\n }\n\n .wrapper {\n display: flex;\n flex-direction: column;\n border-radius: 999px;\n transition: background 200ms linear,\n transform 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55),\n padding 150ms linear, margin 150ms linear;\n }\n\n .wrapper.clickable {\n transform: scale(1);\n }\n\n .wrapper.clickable:hover {\n --icon-circle-size: 0.35em;\n --icon-background: var(--icon-color-circle-hover);\n }\n\n .wrapper.clickable {\n padding: var(--icon-circle-size);\n margin: calc(-1 * var(--icon-circle-size));\n background: var(--icon-background);\n }\n `;\n }\n\n constructor() {\n super();\n }\n\n private lastName: string;\n\n public firstUpdated(changes: Map<string, any>) {\n super.firstUpdated(changes);\n if (changes.has('animateChange')) {\n // set our default duration if we need one\n if (!changes.has('animationDuration')) {\n this.animationDuration = this.steps * this.animationDuration;\n }\n\n if (this.animateChange === 'spin') {\n this.steps = 3;\n this.animationDuration = 400;\n this.easing = 'linear';\n }\n }\n }\n\n public handleClicked() {\n if (this.animateClick) {\n this.animationStep = 1;\n }\n }\n\n public updated(changes: Map<string, any>) {\n super.updated(changes);\n\n if (changes.has('animationStep')) {\n // if we are halfway through, change the icon\n if (this.lastName && this.animationStep >= this.steps / 2) {\n this.lastName = null;\n this.requestUpdate();\n }\n\n setTimeout(() => {\n if (this.animationStep > 0 && this.animationStep < this.steps) {\n this.animationStep++;\n } else {\n this.animationStep = 0;\n }\n }, this.animationDuration / this.steps);\n }\n\n if (changes.has('name') && this.animateChange) {\n this.lastName = changes.get('name');\n\n // our name changed, lets animate it\n if (this.lastName && this.animateChange) {\n this.animationStep = 1;\n }\n }\n }\n\n public render(): TemplateResult {\n // let icon name mappings take precedence\n let name = this.lastName || this.name;\n name = Icon[name.replace('icon.', '')] || name;\n\n // referencing icons by id is explicit\n if (!name) {\n name = this.id;\n }\n\n return html`\n <div\n @click=${this.handleClicked}\n class=\"wrapper ${getClasses({\n clickable: this.clickable,\n circled: this.circled,\n animate: !!this.animateChange || !!this.animateClick,\n })}\"\n >\n <svg\n style=\"height:${this.size}em;width:${this\n .size}em;transition:transform ${this.animationDuration /\n this.steps}ms\n ${this.easing}\"\n class=\"${getClasses({\n sheet: this.src === '',\n [this.animateChange]: !!this.animateChange,\n [this.animateChange + '-' + this.animationStep]:\n this.animationStep > 0,\n [this.animateClick]: !!this.animateClick,\n [this.animateClick + '-' + this.animationStep]:\n this.animationStep > 0,\n })}\"\n >\n <use\n href=\"${this.src\n ? this.src\n : `${\n this.prefix || (window as any).static_url || '/static/'\n }svg/index.svg?v=${ICON_VERSION}#${name}`}\"\n />\n </svg>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -32,6 +32,7 @@ export var Icon;
|
|
|
32
32
|
Icon["dashboard"] = "pie-chart-01";
|
|
33
33
|
Icon["delete"] = "trash-03";
|
|
34
34
|
Icon["delete_small"] = "x";
|
|
35
|
+
Icon["down"] = "chevron-down";
|
|
35
36
|
Icon["download"] = "download-01";
|
|
36
37
|
Icon["email"] = "mail-01";
|
|
37
38
|
Icon["error"] = "alert-circle";
|
|
@@ -43,6 +44,7 @@ export var Icon;
|
|
|
43
44
|
Icon["flow_message"] = "message-square-02";
|
|
44
45
|
Icon["flow_user"] = "hard-drive";
|
|
45
46
|
Icon["flows"] = "flow";
|
|
47
|
+
Icon["global"] = "at-sign";
|
|
46
48
|
Icon["group"] = "users-01";
|
|
47
49
|
Icon["group_smart"] = "atom-01";
|
|
48
50
|
Icon["help"] = "help-circle";
|
|
@@ -87,6 +89,7 @@ export var Icon;
|
|
|
87
89
|
Icon["trigger"] = "signal-01";
|
|
88
90
|
Icon["triggers"] = "signal-01";
|
|
89
91
|
Icon["updated"] = "edit-02";
|
|
92
|
+
Icon["up"] = "chevron-up";
|
|
90
93
|
Icon["upload"] = "upload-cloud-01";
|
|
91
94
|
Icon["usages"] = "link-04";
|
|
92
95
|
Icon["user"] = "users-01";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vectoricon/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vectoricon/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,IAsGX;AAtGD,WAAY,IAAI;IACd,kCAA0B,CAAA;IAC1B,2BAAmB,CAAA;IACnB,uBAAe,CAAA;IACf,4BAAoB,CAAA;IACpB,gCAAwB,CAAA;IACxB,2BAAmB,CAAA;IACnB,+BAAuB,CAAA;IACvB,mCAA2B,CAAA;IAC3B,mCAA2B,CAAA;IAC3B,qCAA6B,CAAA;IAC7B,gCAAwB,CAAA;IACxB,qCAA6B,CAAA;IAC7B,8BAAsB,CAAA;IACtB,qCAA6B,CAAA;IAC7B,kCAA0B,CAAA;IAC1B,mCAA2B,CAAA;IAC3B,uBAAe,CAAA;IACf,kCAA0B,CAAA;IAC1B,uBAAe,CAAA;IACf,2BAAmB,CAAA;IACnB,yCAAiC,CAAA;IACjC,2BAAmB,CAAA;IACnB,2BAAmB,CAAA;IACnB,oCAA4B,CAAA;IAC5B,4CAAoC,CAAA;IACpC,yCAAiC,CAAA;IACjC,qCAA6B,CAAA;IAC7B,4BAAoB,CAAA;IACpB,wBAAgB,CAAA;IAChB,kCAA0B,CAAA;IAC1B,2BAAmB,CAAA;IACnB,0BAAkB,CAAA;IAClB,6BAAqB,CAAA;IACrB,gCAAwB,CAAA;IACxB,yBAAiB,CAAA;IACjB,8BAAsB,CAAA;IACtB,qBAAa,CAAA;IACb,4BAAoB,CAAA;IACpB,qBAAa,CAAA;IACb,oCAA4B,CAAA;IAC5B,kCAA0B,CAAA;IAC1B,0CAAkC,CAAA;IAClC,gCAAwB,CAAA;IACxB,sBAAc,CAAA;IACd,0BAAkB,CAAA;IACl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 'play',\n add_note = 'file-02',\n airtime = 'bank-note-01',\n archive = 'archive',\n arrow_up = 'chevron-up',\n arrow_down = 'chevron-down',\n arrow_left = 'chevron-left',\n arrow_right = 'chevron-right',\n attachment = 'paperclip',\n broadcast = 'announcement-01',\n call = 'phone-call-01',\n call_missed = 'phone-call-02',\n campaign = 'clock-refresh',\n campaigns = 'clock-refresh',\n channel = 'zap',\n children = 'git-branch-01',\n check = 'check',\n checkbox = 'square',\n checkbox_checked = 'check-square',\n compose = 'send-01',\n contact = 'user-01',\n contact_archived = 'archive',\n contact_blocked = 'message-x-square',\n contact_stopped = 'slash-octagon',\n contact_updated = 'user-edit',\n contacts = 'user-01',\n copy = 'copy-04',\n dashboard = 'pie-chart-01',\n delete = 'trash-03',\n delete_small = 'x',\n down = 'chevron-down',\n download = 'download-01',\n email = 'mail-01',\n error = 'alert-circle',\n event = 'zap',\n fields = 'user-edit',\n flow = 'flow',\n flow_interrupted = 'x-close',\n flow_ivr = 'phone-call-01',\n flow_message = 'message-square-02',\n flow_user = 'hard-drive',\n flows = 'flow',\n global = 'at-sign',\n group = 'users-01',\n group_smart = 'atom-01',\n help = 'help-circle',\n home = 'home-01',\n inbox = 'inbox-01',\n label = 'tag-01',\n language = 'globe-01',\n link = 'link-external-01',\n log = 'file-02',\n menu = 'menu-01',\n menu_collapse = 'chevron-left-double',\n message = 'message-square-02',\n messages = 'message-square-02',\n org_active = 'credit-card-02',\n org_anonymous = 'glasses-01',\n org_bulk = 'credit-card-plus',\n org_flagged = 'flag-01',\n org_new = 'stars-02',\n org_suspended = 'slash-circle-01',\n org_verified = 'check-verified-02',\n overview = 'pie-chart-01',\n featured = 'star-01',\n resthooks = 'share-07',\n restore = 'play',\n retry = 'refresh-cw-05',\n runs = 'rows-03',\n search = 'search-refraction',\n select_open = 'chevron-down',\n select_clear = 'x',\n service = 'magic-wand-01',\n settings = 'settings-02',\n sort = 'chevron-selector-vertical',\n staff = 'hard-drive',\n tickets = 'agent',\n tickets_all = 'archive',\n tickets_closed = 'check',\n tickets_mine = 'coffee',\n tickets_open = 'inbox-01',\n tickets_unassigned = 'inbox-01',\n two_factor_enabled = 'shield-02',\n two_factor_disabled = 'shield-01',\n trigger = 'signal-01',\n triggers = 'signal-01',\n updated = 'edit-02',\n up = 'chevron-up',\n upload = 'upload-cloud-01',\n usages = 'link-04',\n user = 'users-01',\n users = 'users-01',\n user_beta = 'shield-zap',\n webhook = 'link-external-01',\n workspace = 'folder',\n zendesk = 'zendesk',\n\n ext = 'lightning-01',\n fcm = 'lightning-01',\n}\n"]}
|