@nyaruka/temba-components 0.25.2 → 0.26.2
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/.github/workflows/build.yml +1 -1
- package/CHANGELOG.md +33 -0
- package/demo/index.html +60 -1
- package/dist/4f80c187.js +4277 -0
- package/dist/index.js +3957 -36
- package/dist/static/icons/symbol-defs.svg +29 -20
- 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/FormElement.js +1 -1
- package/out-tsc/src/FormElement.js.map +1 -1
- package/out-tsc/src/RapidElement.js +1 -1
- package/out-tsc/src/RapidElement.js.map +1 -1
- package/out-tsc/src/alert/Alert.js +3 -3
- package/out-tsc/src/alert/Alert.js.map +1 -1
- package/out-tsc/src/aliaseditor/AliasEditor.js +3 -3
- package/out-tsc/src/aliaseditor/AliasEditor.js.map +1 -1
- package/out-tsc/src/anchor/Anchor.js +2 -1
- package/out-tsc/src/anchor/Anchor.js.map +1 -1
- package/out-tsc/src/button/Button.js +2 -1
- package/out-tsc/src/button/Button.js.map +1 -1
- package/out-tsc/src/charcount/CharCount.js +2 -1
- package/out-tsc/src/charcount/CharCount.js.map +1 -1
- package/out-tsc/src/checkbox/Checkbox.js +3 -1
- package/out-tsc/src/checkbox/Checkbox.js.map +1 -1
- package/out-tsc/src/completion/Completion.js +2 -1
- package/out-tsc/src/completion/Completion.js.map +1 -1
- package/out-tsc/src/completion/helpers.js +27 -4
- package/out-tsc/src/completion/helpers.js.map +1 -1
- package/out-tsc/src/contacts/ContactChat.js +101 -86
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/contacts/ContactDetails.js +2 -1
- package/out-tsc/src/contacts/ContactDetails.js.map +1 -1
- package/out-tsc/src/contacts/ContactHistory.js +32 -37
- package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
- package/out-tsc/src/contacts/events.js +62 -76
- package/out-tsc/src/contacts/events.js.map +1 -1
- package/out-tsc/src/contactsearch/ContactSearch.js +2 -1
- package/out-tsc/src/contactsearch/ContactSearch.js.map +1 -1
- package/out-tsc/src/datepicker/DatePicker.js +2 -1
- package/out-tsc/src/datepicker/DatePicker.js.map +1 -1
- package/out-tsc/src/dialog/Dialog.js +2 -2
- package/out-tsc/src/dialog/Dialog.js.map +1 -1
- package/out-tsc/src/dialog/Modax.js +3 -6
- package/out-tsc/src/dialog/Modax.js.map +1 -1
- package/out-tsc/src/dropdown/Dropdown.js +133 -0
- package/out-tsc/src/dropdown/Dropdown.js.map +1 -0
- package/out-tsc/src/formfield/FormField.js +2 -1
- package/out-tsc/src/formfield/FormField.js.map +1 -1
- package/out-tsc/src/label/Label.js +2 -1
- package/out-tsc/src/label/Label.js.map +1 -1
- package/out-tsc/src/leafletmap/LeafletMap.js +2 -1
- package/out-tsc/src/leafletmap/LeafletMap.js.map +1 -1
- package/out-tsc/src/list/TembaList.js +7 -5
- package/out-tsc/src/list/TembaList.js.map +1 -1
- package/out-tsc/src/list/TembaMenu.js +112 -97
- package/out-tsc/src/list/TembaMenu.js.map +1 -1
- package/out-tsc/src/list/TicketList.js +2 -1
- package/out-tsc/src/list/TicketList.js.map +1 -1
- package/out-tsc/src/loading/Loading.js +2 -1
- package/out-tsc/src/loading/Loading.js.map +1 -1
- package/out-tsc/src/omnibox/Omnibox.js +2 -1
- package/out-tsc/src/omnibox/Omnibox.js.map +1 -1
- package/out-tsc/src/options/Options.js +3 -2
- package/out-tsc/src/options/Options.js.map +1 -1
- package/out-tsc/src/remote/Remote.js +2 -1
- package/out-tsc/src/remote/Remote.js.map +1 -1
- package/out-tsc/src/select/Select.js +8 -10
- package/out-tsc/src/select/Select.js.map +1 -1
- package/out-tsc/src/shadowless/Shadowless.js +2 -2
- package/out-tsc/src/shadowless/Shadowless.js.map +1 -1
- package/out-tsc/src/store/Store.js +2 -1
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/tabpane/Tab.js +46 -0
- package/out-tsc/src/tabpane/Tab.js.map +1 -0
- package/out-tsc/src/tabpane/TabPane.js +109 -0
- package/out-tsc/src/tabpane/TabPane.js.map +1 -0
- package/out-tsc/src/textinput/TextInput.js +3 -2
- package/out-tsc/src/textinput/TextInput.js.map +1 -1
- package/out-tsc/src/tip/Tip.js +2 -2
- package/out-tsc/src/tip/Tip.js.map +1 -1
- package/out-tsc/src/vectoricon/VectorIcon.js +18 -6
- package/out-tsc/src/vectoricon/VectorIcon.js.map +1 -1
- package/out-tsc/temba-modules.js +6 -0
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/temba-contact-history.test.js +9 -6
- package/out-tsc/test/temba-contact-history.test.js.map +1 -1
- package/out-tsc/test/temba-dialog.test.js +3 -3
- package/out-tsc/test/temba-dialog.test.js.map +1 -1
- package/package.json +10 -9
- package/screenshots/truth/alert/error.png +0 -0
- package/screenshots/truth/alert/info.png +0 -0
- package/screenshots/truth/alert/warning.png +0 -0
- package/screenshots/truth/contacts/history-expanded.png +0 -0
- package/screenshots/truth/contacts/history.png +0 -0
- package/screenshots/truth/counter/summary.png +0 -0
- package/screenshots/truth/counter/unicode-variables.png +0 -0
- package/screenshots/truth/counter/unicode.png +0 -0
- package/screenshots/truth/dialog/focused.png +0 -0
- package/screenshots/truth/list/items-selected.png +0 -0
- package/screenshots/truth/list/items-updated.png +0 -0
- package/screenshots/truth/list/items.png +0 -0
- package/screenshots/truth/list/menu-root.png +0 -0
- package/screenshots/truth/list/menu-submenu.png +0 -0
- package/screenshots/truth/modax/form.png +0 -0
- package/screenshots/truth/modax/simple.png +0 -0
- package/screenshots/truth/options/block.png +0 -0
- package/screenshots/truth/select/embedded.png +0 -0
- package/screenshots/truth/select/expression-selected.png +0 -0
- package/screenshots/truth/select/expressions.png +0 -0
- package/screenshots/truth/select/functions.png +0 -0
- package/screenshots/truth/select/local-options.png +0 -0
- package/screenshots/truth/select/remote-options.png +0 -0
- package/screenshots/truth/select/search-enabled.png +0 -0
- package/screenshots/truth/select/search-selected-focus.png +0 -0
- package/screenshots/truth/select/search-selected.png +0 -0
- package/screenshots/truth/select/search-with-selected.png +0 -0
- package/screenshots/truth/select/searching.png +0 -0
- package/screenshots/truth/select/selected-multi.png +0 -0
- package/screenshots/truth/select/selected-single.png +0 -0
- package/screenshots/truth/select/selection-clearable.png +0 -0
- package/screenshots/truth/select/with-placeholder.png +0 -0
- package/screenshots/truth/select/without-placeholder.png +0 -0
- package/screenshots/truth/textinput/date-initialized.png +0 -0
- package/screenshots/truth/textinput/input-focused.png +0 -0
- package/screenshots/truth/textinput/textarea-focused.png +0 -0
- package/screenshots/truth/tip/bottom.png +0 -0
- package/screenshots/truth/tip/left.png +0 -0
- package/screenshots/truth/tip/right.png +0 -0
- package/screenshots/truth/tip/top.png +0 -0
- package/src/FormElement.ts +1 -1
- package/src/RapidElement.ts +1 -1
- package/src/alert/Alert.ts +3 -3
- package/src/aliaseditor/AliasEditor.ts +4 -3
- package/src/anchor/Anchor.ts +2 -1
- package/src/button/Button.ts +3 -1
- package/src/charcount/CharCount.ts +2 -1
- package/src/checkbox/Checkbox.ts +3 -1
- package/src/completion/Completion.ts +2 -1
- package/src/completion/helpers.ts +30 -4
- package/src/contacts/ContactChat.ts +115 -95
- package/src/contacts/ContactDetails.ts +2 -1
- package/src/contacts/ContactHistory.ts +64 -67
- package/src/contacts/events.ts +62 -77
- package/src/contactsearch/ContactSearch.ts +2 -1
- package/src/datepicker/DatePicker.ts +2 -7
- package/src/dialog/Dialog.ts +2 -2
- package/src/dialog/Modax.ts +4 -6
- package/src/dropdown/Dropdown.ts +136 -0
- package/src/formfield/FormField.ts +2 -1
- package/src/label/Label.ts +2 -8
- package/src/leafletmap/LeafletMap.ts +2 -2
- package/src/list/TembaList.ts +8 -5
- package/src/list/TembaMenu.ts +125 -103
- package/src/list/TicketList.ts +2 -1
- package/src/loading/Loading.ts +2 -1
- package/src/omnibox/Omnibox.ts +2 -1
- package/src/options/Options.ts +3 -2
- package/src/remote/Remote.ts +2 -7
- package/src/select/Select.ts +11 -10
- package/src/shadowless/Shadowless.ts +2 -2
- package/src/store/Store.ts +2 -1
- package/src/tabpane/Tab.ts +42 -0
- package/src/tabpane/TabPane.ts +113 -0
- package/src/textinput/TextInput.ts +3 -2
- package/src/tip/Tip.ts +2 -2
- package/src/vectoricon/VectorIcon.ts +18 -6
- package/static/css/temba-components.css +11 -0
- package/static/icons/Read Me.txt +1 -1
- package/static/icons/SVG/pause.svg +5 -0
- package/static/icons/SVG/play.svg +5 -0
- package/static/icons/SVG/{upload-cloud.svg → publish.svg} +1 -1
- package/static/icons/SVG/user-x.svg +5 -0
- package/static/icons/demo-external-svg.html +157 -142
- package/static/icons/demo-files/demo.css +3 -3
- package/static/icons/demo.html +186 -162
- package/static/icons/selection.json +390 -318
- package/static/icons/symbol-defs.svg +29 -20
- package/temba-modules.ts +6 -0
- package/test/temba-contact-history.test.ts +10 -6
- package/test/temba-dialog.test.ts +5 -6
- package/test-assets/modax/form.html +1 -1
- package/test-assets/style.css +7 -0
- package/web-test-runner.config.mjs +130 -117
- package/dist/56e0e480.js +0 -356
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/FormElement.ts
CHANGED
package/src/RapidElement.ts
CHANGED
package/src/alert/Alert.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css, html, LitElement,
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
2
3
|
|
|
3
4
|
export class Alert extends LitElement {
|
|
4
5
|
static get styles() {
|
|
@@ -9,11 +10,10 @@ export class Alert extends LitElement {
|
|
|
9
10
|
|
|
10
11
|
.temba-alert {
|
|
11
12
|
color: rgba(0, 0, 0, 0.8);
|
|
12
|
-
padding: 0.
|
|
13
|
+
padding: 0.65rem 1rem;
|
|
13
14
|
border: 1px solid rgba(0, 0, 0, 0.35);
|
|
14
15
|
border-left: 10px solid rgba(0, 0, 0, 0.35);
|
|
15
16
|
border-radius: var(--curvature-widget);
|
|
16
|
-
font-size: 14px;
|
|
17
17
|
box-shadow: var(--shadow);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import { css, html, LitElement, property, TemplateResult } from 'lit-element';
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from 'lit';
|
|
3
2
|
import { FeatureProperties } from '../interfaces';
|
|
4
3
|
import { getUrl, postJSON, WebResponse } from '../utils';
|
|
5
4
|
import { TextInput } from '../textinput/TextInput';
|
|
6
5
|
import { styleMap } from 'lit-html/directives/style-map';
|
|
7
6
|
import { FormElement } from '../FormElement';
|
|
8
7
|
|
|
8
|
+
import { property } from 'lit/decorators';
|
|
9
|
+
|
|
9
10
|
export class AliasEditor extends LitElement {
|
|
10
11
|
static get styles() {
|
|
11
12
|
return css`
|
|
@@ -258,7 +259,7 @@ export class AliasEditor extends LitElement {
|
|
|
258
259
|
evt.stopPropagation();
|
|
259
260
|
}}
|
|
260
261
|
>
|
|
261
|
-
<temba-icon name="edit"
|
|
262
|
+
<temba-icon name="edit" />
|
|
262
263
|
</div>
|
|
263
264
|
`
|
|
264
265
|
: ''}
|
package/src/anchor/Anchor.ts
CHANGED
package/src/button/Button.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, html, css
|
|
1
|
+
import { LitElement, TemplateResult, html, css } from 'lit';
|
|
2
2
|
import { getClasses } from '../utils';
|
|
3
3
|
|
|
4
|
+
import { property } from 'lit/decorators';
|
|
5
|
+
|
|
4
6
|
export class Button extends LitElement {
|
|
5
7
|
static get styles() {
|
|
6
8
|
return css`
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, TemplateResult } from 'lit';
|
|
2
2
|
import { RapidElement } from '../RapidElement';
|
|
3
3
|
import { splitSMS } from '../sms';
|
|
4
4
|
import { getExtendedCharacters } from './helpers';
|
|
5
|
+
import { property } from 'lit/decorators';
|
|
5
6
|
|
|
6
7
|
export class CharCount extends RapidElement {
|
|
7
8
|
static get styles() {
|
package/src/checkbox/Checkbox.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TemplateResult, html, css
|
|
1
|
+
import { TemplateResult, html, css } from 'lit';
|
|
2
2
|
import { FormElement } from '../FormElement';
|
|
3
|
+
import { property } from 'lit/decorators';
|
|
3
4
|
|
|
4
5
|
export class Checkbox extends FormElement {
|
|
5
6
|
static get styles() {
|
|
@@ -96,6 +97,7 @@ export class Checkbox extends FormElement {
|
|
|
96
97
|
|
|
97
98
|
public click(): void {
|
|
98
99
|
this.handleClick();
|
|
100
|
+
super.click();
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
public render(): TemplateResult {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TemplateResult, css,
|
|
1
|
+
import { TemplateResult, css, html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
2
3
|
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
3
4
|
import { TextInput } from '../textinput/TextInput';
|
|
4
5
|
import {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { html,
|
|
1
|
+
import { html, TemplateResult } from 'lit';
|
|
2
2
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
|
|
3
|
+
import { directive, Directive, Part, PartInfo, PartType } from 'lit/directive';
|
|
3
4
|
import ExcellentParser, { Expression } from './ExcellentParser';
|
|
4
5
|
import {
|
|
5
6
|
CompletionOption,
|
|
@@ -38,9 +39,34 @@ const sessionParser = new ExcellentParser('@', [
|
|
|
38
39
|
'resume',
|
|
39
40
|
]);
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// Class-based directive API
|
|
43
|
+
export class RenderMarkdown extends Directive {
|
|
44
|
+
// State stored in class field
|
|
45
|
+
value: string | undefined;
|
|
46
|
+
constructor(partInfo: PartInfo) {
|
|
47
|
+
super(partInfo);
|
|
48
|
+
// When necessary, validate part in constructor using `part.type`
|
|
49
|
+
if (partInfo.type !== PartType.CHILD) {
|
|
50
|
+
throw new Error('renderMarkdown only supports child expressions');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Optional: override update to perform any direct DOM manipulation
|
|
54
|
+
// DirectiveParameters<this>
|
|
55
|
+
update(part: Part, [initialValue]: any) {
|
|
56
|
+
/* Any imperative updates to DOM/parts would go here */
|
|
57
|
+
return this.render(initialValue);
|
|
58
|
+
}
|
|
59
|
+
// Do SSR-compatible rendering (arguments are passed from call site)
|
|
60
|
+
render(initialValue: string) {
|
|
61
|
+
// Previous state available on class field
|
|
62
|
+
if (this.value === undefined) {
|
|
63
|
+
this.value = initialValue;
|
|
64
|
+
}
|
|
65
|
+
return html`${unsafeHTML(md.render(this.value))}`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const renderMarkdown = directive(RenderMarkdown);
|
|
44
70
|
|
|
45
71
|
export const renderCompletionOption = (
|
|
46
72
|
option: CompletionOption,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, TemplateResult } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
2
3
|
import { RapidElement } from '../RapidElement';
|
|
3
4
|
import { Contact, CustomEventType, Ticket } from '../interfaces';
|
|
4
5
|
import { COOKIE_KEYS, getCookieBoolean, postJSON, setCookie } from '../utils';
|
|
@@ -13,35 +14,36 @@ const DEFAULT_REFRESH = 10000;
|
|
|
13
14
|
export class ContactChat extends RapidElement {
|
|
14
15
|
public static get styles() {
|
|
15
16
|
return css`
|
|
16
|
-
:host {
|
|
17
|
-
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2),
|
|
18
|
-
0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
19
|
-
|
|
20
|
-
height: 100%;
|
|
21
|
-
border-radius: var(--curvature);
|
|
22
|
-
|
|
23
|
-
flex-grow: 1;
|
|
24
|
-
width: 100%;
|
|
25
|
-
display: block;
|
|
26
|
-
background: #f2f2f2;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
17
|
.left-pane {
|
|
31
18
|
box-shadow: -13px 10px 7px 14px rgba(0, 0, 0, 0);
|
|
32
19
|
transition: box-shadow 600ms linear;
|
|
33
20
|
}
|
|
34
21
|
|
|
35
22
|
.left-pane.open {
|
|
36
|
-
box-shadow: -13px 10px 7px 14px rgba(0, 0, 0, 0.15);
|
|
37
23
|
z-index: 1000;
|
|
38
24
|
}
|
|
39
25
|
|
|
26
|
+
:host {
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
min-height: 0;
|
|
31
|
+
border-radius: var(--curvature);
|
|
32
|
+
}
|
|
33
|
+
|
|
40
34
|
.chat-wrapper {
|
|
41
35
|
display: flex;
|
|
36
|
+
flex-grow: 1;
|
|
42
37
|
flex-direction: column;
|
|
43
|
-
height: 100%;
|
|
44
38
|
overflow: hidden;
|
|
39
|
+
min-height: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
temba-contact-history {
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
min-height: 0;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
.chatbox {
|
|
@@ -52,6 +54,11 @@ export class ContactChat extends RapidElement {
|
|
|
52
54
|
flex-direction: column;
|
|
53
55
|
z-index: 3;
|
|
54
56
|
border-bottom-left-radius: var(--curvature);
|
|
57
|
+
border-bottom-right-radius: var(--curvature);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.chatbox.full {
|
|
61
|
+
border-bottom-right-radius: 0 !important;
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
.closed-footer {
|
|
@@ -175,6 +182,9 @@ export class ContactChat extends RapidElement {
|
|
|
175
182
|
@property({ type: Boolean })
|
|
176
183
|
showDetails = true;
|
|
177
184
|
|
|
185
|
+
@property({ type: Boolean })
|
|
186
|
+
toolbar = false;
|
|
187
|
+
|
|
178
188
|
@property({ type: Boolean })
|
|
179
189
|
monitor = false;
|
|
180
190
|
|
|
@@ -320,14 +330,13 @@ export class ContactChat extends RapidElement {
|
|
|
320
330
|
|
|
321
331
|
public render(): TemplateResult {
|
|
322
332
|
return html`
|
|
323
|
-
<div
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
>
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
? html` <temba-contact-history
|
|
333
|
+
<div
|
|
334
|
+
style="flex-grow: 1; margin-right: 0em; display:flex; flex-direction:row; min-height: 0;"
|
|
335
|
+
class="left-pane ${this.showDetails ? 'open' : ''}"
|
|
336
|
+
>
|
|
337
|
+
<div class="chat-wrapper">
|
|
338
|
+
${this.currentContact
|
|
339
|
+
? html`<temba-contact-history
|
|
331
340
|
.uuid=${this.currentContact.uuid}
|
|
332
341
|
.contact=${this.currentContact}
|
|
333
342
|
.ticket=${
|
|
@@ -348,7 +357,9 @@ export class ContactChat extends RapidElement {
|
|
|
348
357
|
@click=${this.handleReopen}
|
|
349
358
|
></temba-button>
|
|
350
359
|
</div>`
|
|
351
|
-
: html` <div
|
|
360
|
+
: html` <div
|
|
361
|
+
class="chatbox ${this.toolbar ? 'full' : ''}"
|
|
362
|
+
>
|
|
352
363
|
<temba-completion
|
|
353
364
|
@change=${this.handleChatChange}
|
|
354
365
|
.value=${this.currentChat}
|
|
@@ -374,81 +385,88 @@ export class ContactChat extends RapidElement {
|
|
|
374
385
|
</div>`
|
|
375
386
|
}
|
|
376
387
|
</div>`
|
|
377
|
-
|
|
378
|
-
</div>
|
|
388
|
+
: null}
|
|
379
389
|
</div>
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
${this.toolbar
|
|
393
|
+
? html`${
|
|
394
|
+
this.currentContact
|
|
395
|
+
? html`<temba-contact-details
|
|
396
|
+
style="z-index: 10"
|
|
397
|
+
class="${this.showDetails ? '' : 'hidden'}"
|
|
398
|
+
showGroups="true"
|
|
399
|
+
.visible=${this.showDetails}
|
|
400
|
+
.ticket=${this.currentTicket}
|
|
401
|
+
.contact=${this.currentContact}
|
|
402
|
+
></temba-contact-details>`
|
|
403
|
+
: null
|
|
404
|
+
}
|
|
390
405
|
|
|
391
406
|
<div class="toolbar ${this.showDetails ? '' : 'closed'}">
|
|
392
|
-
${
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
407
|
+
${
|
|
408
|
+
this.currentContact
|
|
409
|
+
? html`
|
|
410
|
+
<temba-tip
|
|
411
|
+
style="margin-top:5px"
|
|
412
|
+
text="${this.showDetails ? 'Hide Details' : 'Show Details'}"
|
|
413
|
+
position="left"
|
|
414
|
+
hideOnChange
|
|
415
|
+
>
|
|
416
|
+
<temba-icon
|
|
417
|
+
id="details-button"
|
|
418
|
+
name="${this.showDetails ? 'chevrons-left' : 'sidebar'}"
|
|
419
|
+
@click="${this.handleDetailSlider}"
|
|
420
|
+
clickable
|
|
421
|
+
animatechange="spin"
|
|
422
|
+
></temba-icon>
|
|
423
|
+
</temba-tip>
|
|
424
|
+
|
|
425
|
+
${this.currentTicket
|
|
426
|
+
? html`<temba-tip
|
|
427
|
+
style="margin-top:5px"
|
|
428
|
+
text="Assign"
|
|
429
|
+
position="left"
|
|
430
|
+
>
|
|
431
|
+
<temba-icon
|
|
432
|
+
id="assign-button"
|
|
433
|
+
name="user"
|
|
434
|
+
@click="${() => {
|
|
435
|
+
const modax = this.shadowRoot.getElementById(
|
|
436
|
+
'assign-dialog'
|
|
437
|
+
) as Modax;
|
|
438
|
+
modax.open = true;
|
|
439
|
+
}}"
|
|
440
|
+
clickable
|
|
441
|
+
></temba-icon>
|
|
442
|
+
</temba-tip>
|
|
443
|
+
<temba-tip
|
|
444
|
+
style="margin-top:5px"
|
|
445
|
+
text="Add Note"
|
|
446
|
+
position="left"
|
|
447
|
+
>
|
|
448
|
+
<temba-icon
|
|
449
|
+
id="add-note-button"
|
|
450
|
+
name="edit"
|
|
451
|
+
@click="${() => {
|
|
452
|
+
const note = this.shadowRoot.getElementById(
|
|
453
|
+
'note-dialog'
|
|
454
|
+
) as Modax;
|
|
455
|
+
note.open = true;
|
|
456
|
+
}}"
|
|
457
|
+
clickable
|
|
458
|
+
></temba-icon>
|
|
459
|
+
</temba-tip>`
|
|
460
|
+
: null}
|
|
461
|
+
`
|
|
462
|
+
: null
|
|
463
|
+
}
|
|
447
464
|
</div>
|
|
448
465
|
</div>
|
|
449
466
|
|
|
450
|
-
${
|
|
451
|
-
|
|
467
|
+
${
|
|
468
|
+
this.currentTicket
|
|
469
|
+
? html`<temba-modax
|
|
452
470
|
header="Add Note"
|
|
453
471
|
id="note-dialog"
|
|
454
472
|
@temba-submitted=${this.refresh}
|
|
@@ -460,6 +478,8 @@ export class ContactChat extends RapidElement {
|
|
|
460
478
|
@temba-submitted=${this.handleTicketAssigned}
|
|
461
479
|
endpoint="/ticket/assign/${this.currentTicket.uuid}/"
|
|
462
480
|
/></temba-modax>`
|
|
481
|
+
: null
|
|
482
|
+
}`
|
|
463
483
|
: null}
|
|
464
484
|
`;
|
|
465
485
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css, html,
|
|
1
|
+
import { css, html, TemplateResult } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
2
3
|
import { Contact, Group, Ticket } from '../interfaces';
|
|
3
4
|
import { RapidElement } from '../RapidElement';
|
|
4
5
|
import { isDate, timeSince, truncate } from '../utils';
|