@nyaruka/temba-components 0.31.4 → 0.31.7
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 +21 -0
- package/dist/{a4ce5e6b.js → 56002f06.js} +92 -15
- package/dist/index.js +92 -15
- package/dist/static/icons/symbol-defs.svg +7 -3
- 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/ContactNameFetch.js +1 -1
- package/out-tsc/src/contacts/ContactNameFetch.js.map +1 -1
- package/out-tsc/src/contacts/events.js +1 -2
- package/out-tsc/src/contacts/events.js.map +1 -1
- package/out-tsc/src/dialog/Dialog.js +12 -1
- package/out-tsc/src/dialog/Dialog.js.map +1 -1
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/list/RunList.js +3 -2
- package/out-tsc/src/list/RunList.js.map +1 -1
- package/out-tsc/src/list/TembaMenu.js +102 -17
- package/out-tsc/src/list/TembaMenu.js.map +1 -1
- package/out-tsc/src/tabpane/TabPane.js +6 -0
- package/out-tsc/src/tabpane/TabPane.js.map +1 -1
- package/out-tsc/src/vectoricon/VectorIcon.js +2 -3
- package/out-tsc/src/vectoricon/VectorIcon.js.map +1 -1
- package/package.json +1 -1
- package/src/contacts/ContactNameFetch.ts +1 -1
- package/src/contacts/events.ts +1 -2
- package/src/dialog/Dialog.ts +12 -1
- package/src/interfaces.ts +1 -0
- package/src/list/RunList.ts +3 -2
- package/src/list/TembaMenu.ts +106 -17
- package/src/tabpane/TabPane.ts +6 -0
- package/src/vectoricon/VectorIcon.ts +2 -3
- package/static/icons/Read Me.txt +1 -1
- package/static/icons/SVG/menu-collapse.svg +5 -0
- package/static/icons/SVG/zapier.svg +2 -1
- package/static/icons/demo-external-svg.html +144 -139
- package/static/icons/demo-files/demo.css +4 -4
- package/static/icons/demo.html +151 -142
- package/static/icons/selection.json +250 -200
- package/static/icons/symbol-defs.svg +7 -3
package/src/list/TembaMenu.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface MenuItem {
|
|
|
17
17
|
level?: number;
|
|
18
18
|
trigger?: string;
|
|
19
19
|
href?: string;
|
|
20
|
+
show_header?: boolean;
|
|
20
21
|
items?: MenuItem[];
|
|
21
22
|
inline?: boolean;
|
|
22
23
|
type?: string;
|
|
@@ -129,6 +130,9 @@ export class TembaMenu extends RapidElement {
|
|
|
129
130
|
.level-0 > .top {
|
|
130
131
|
padding-top: var(--menu-padding);
|
|
131
132
|
background: var(--color-primary-dark);
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
align-items: center;
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
.level-0 > .empty {
|
|
@@ -395,7 +399,7 @@ export class TembaMenu extends RapidElement {
|
|
|
395
399
|
}
|
|
396
400
|
|
|
397
401
|
.fully-collapsed .level-1 {
|
|
398
|
-
margin-left: -
|
|
402
|
+
margin-left: -208px;
|
|
399
403
|
pointer-events: none;
|
|
400
404
|
border: none;
|
|
401
405
|
overflow: hidden;
|
|
@@ -421,6 +425,54 @@ export class TembaMenu extends RapidElement {
|
|
|
421
425
|
margin-left: 0.75em;
|
|
422
426
|
margin-right: 0.75em;
|
|
423
427
|
}
|
|
428
|
+
|
|
429
|
+
.expand-icon {
|
|
430
|
+
transform: rotate(180deg);
|
|
431
|
+
--icon-color: rgba(255, 255, 255, 0.5);
|
|
432
|
+
cursor: pointer;
|
|
433
|
+
max-height: 0px;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
opacity: 0;
|
|
436
|
+
transition: all 400ms ease-in-out 400ms;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.expand-icon:hover {
|
|
440
|
+
--icon-color: #fff;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.fully-collapsed .expand-icon {
|
|
444
|
+
padding-top: 0.5em;
|
|
445
|
+
max-height: 2em;
|
|
446
|
+
opacity: 1;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.section-header {
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.section-header .section {
|
|
455
|
+
flex-grow: 1;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.section-header temba-icon {
|
|
459
|
+
--icon-color: #ddd;
|
|
460
|
+
cursor: pointer;
|
|
461
|
+
padding-bottom: 0.5em;
|
|
462
|
+
padding-right: 0.5em;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.section-header temba-icon:hover {
|
|
466
|
+
--icon-color: var(--color-link-primary);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
slot[name='header'] {
|
|
470
|
+
display: none;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
slot[name='header'].show-header {
|
|
474
|
+
display: block;
|
|
475
|
+
}
|
|
424
476
|
`;
|
|
425
477
|
}
|
|
426
478
|
|
|
@@ -524,21 +576,24 @@ export class TembaMenu extends RapidElement {
|
|
|
524
576
|
private fireNoPath(missingId: string) {
|
|
525
577
|
const item = this.getMenuItem();
|
|
526
578
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
579
|
+
if (item) {
|
|
580
|
+
const details = {
|
|
581
|
+
item: item.id,
|
|
582
|
+
selection: '/' + this.selection.join('/'),
|
|
583
|
+
endpoint: item.endpoint,
|
|
584
|
+
path:
|
|
585
|
+
missingId + '/' + this.pending.join('/') + document.location.search,
|
|
586
|
+
};
|
|
533
587
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
588
|
+
// remove any excess from our selection
|
|
589
|
+
const selection = this.selection.join('/');
|
|
590
|
+
selection.replace(details.path, '');
|
|
591
|
+
this.selection = selection.split('/');
|
|
538
592
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
593
|
+
this.fireCustomEvent(CustomEventType.NoPath, details);
|
|
594
|
+
this.pending = [];
|
|
595
|
+
this.requestUpdate('root');
|
|
596
|
+
}
|
|
542
597
|
}
|
|
543
598
|
|
|
544
599
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -645,7 +700,7 @@ export class TembaMenu extends RapidElement {
|
|
|
645
700
|
}
|
|
646
701
|
|
|
647
702
|
if (menuItem.endpoint) {
|
|
648
|
-
this.loadItems(menuItem,
|
|
703
|
+
this.loadItems(menuItem, true);
|
|
649
704
|
this.dispatchEvent(new Event('change'));
|
|
650
705
|
} else {
|
|
651
706
|
if (this.pending && this.pending.length > 0) {
|
|
@@ -744,6 +799,14 @@ export class TembaMenu extends RapidElement {
|
|
|
744
799
|
}
|
|
745
800
|
}
|
|
746
801
|
|
|
802
|
+
public handleExpand() {
|
|
803
|
+
this.collapsed = false;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
public handleCollapse() {
|
|
807
|
+
this.collapsed = true;
|
|
808
|
+
}
|
|
809
|
+
|
|
747
810
|
public async setFocusedItem(path: string) {
|
|
748
811
|
const focusedPath = path.split('/').filter(step => !!step);
|
|
749
812
|
|
|
@@ -923,7 +986,15 @@ export class TembaMenu extends RapidElement {
|
|
|
923
986
|
|
|
924
987
|
levels.push(
|
|
925
988
|
html`<div class="level level-0 ${this.submenu ? 'hidden' : ''}">
|
|
926
|
-
<div class="top"
|
|
989
|
+
<div class="top">
|
|
990
|
+
<div class="expand-icon" @click=${this.handleExpand}>
|
|
991
|
+
<temba-icon
|
|
992
|
+
name="menu-collapse"
|
|
993
|
+
class="expand"
|
|
994
|
+
size="1.4"
|
|
995
|
+
></temba-icon>
|
|
996
|
+
</div>
|
|
997
|
+
</div>
|
|
927
998
|
|
|
928
999
|
${items
|
|
929
1000
|
.filter(item => !item.bottom)
|
|
@@ -972,7 +1043,25 @@ export class TembaMenu extends RapidElement {
|
|
|
972
1043
|
})}"
|
|
973
1044
|
>
|
|
974
1045
|
${!this.submenu
|
|
975
|
-
? html
|
|
1046
|
+
? html`
|
|
1047
|
+
<slot
|
|
1048
|
+
class="${getClasses({
|
|
1049
|
+
'show-header': selected.show_header,
|
|
1050
|
+
})}"
|
|
1051
|
+
name="header"
|
|
1052
|
+
></slot>
|
|
1053
|
+
<div class="section-header">
|
|
1054
|
+
<div class="section">${selected.name}</div>
|
|
1055
|
+
|
|
1056
|
+
${index == 0 && !this.collapsed
|
|
1057
|
+
? html`<temba-icon
|
|
1058
|
+
name="menu-collapse"
|
|
1059
|
+
size="1.1"
|
|
1060
|
+
@click=${this.handleCollapse}
|
|
1061
|
+
></temba-icon>`
|
|
1062
|
+
: null}
|
|
1063
|
+
</div>
|
|
1064
|
+
`
|
|
976
1065
|
: null}
|
|
977
1066
|
${items.map((item: MenuItem) => {
|
|
978
1067
|
if (item.inline && item.items) {
|
package/src/tabpane/TabPane.ts
CHANGED
|
@@ -16,6 +16,7 @@ export class TabPane extends RapidElement {
|
|
|
16
16
|
|
|
17
17
|
.tabs {
|
|
18
18
|
display: flex;
|
|
19
|
+
padding-left: 0.18em;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.tab {
|
|
@@ -32,6 +33,7 @@ export class TabPane extends RapidElement {
|
|
|
32
33
|
color: var(--color-text-dark);
|
|
33
34
|
--icon-color: var(--color-text-dark);
|
|
34
35
|
white-space: nowrap;
|
|
36
|
+
transition: all 100ms ease-in-out;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
.tab.hidden {
|
|
@@ -70,6 +72,8 @@ export class TabPane extends RapidElement {
|
|
|
70
72
|
cursor: default;
|
|
71
73
|
box-shadow: 2px 1px 3px 2px rgba(0, 0, 0, 0.07);
|
|
72
74
|
background: #fff;
|
|
75
|
+
transform: scale(1.05) translateY(-0.05em);
|
|
76
|
+
z-index: 0;
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
.pane {
|
|
@@ -81,10 +85,12 @@ export class TabPane extends RapidElement {
|
|
|
81
85
|
box-shadow: 2px 5px 12px 2px rgba(0, 0, 0, 0.09),
|
|
82
86
|
3px 3px 2px 1px rgba(0, 0, 0, 0.05);
|
|
83
87
|
min-height: 0;
|
|
88
|
+
z-index: 1;
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
.pane.first {
|
|
87
92
|
border-top-left-radius: 0px;
|
|
93
|
+
overflow: hidden;
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
.badge {
|
|
@@ -4,7 +4,7 @@ import { property } from 'lit/decorators';
|
|
|
4
4
|
import { getClasses } from '../utils';
|
|
5
5
|
|
|
6
6
|
// for cache busting, increase whenever the icon set changes
|
|
7
|
-
const ICON_VERSION =
|
|
7
|
+
const ICON_VERSION = 15;
|
|
8
8
|
|
|
9
9
|
export class VectorIcon extends LitElement {
|
|
10
10
|
@property({ type: String })
|
|
@@ -51,7 +51,6 @@ export class VectorIcon extends LitElement {
|
|
|
51
51
|
return css`
|
|
52
52
|
:host {
|
|
53
53
|
margin: auto;
|
|
54
|
-
--color1: var(--icon-color);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
.sheet {
|
|
@@ -90,7 +89,7 @@ export class VectorIcon extends LitElement {
|
|
|
90
89
|
|
|
91
90
|
.clickable:hover {
|
|
92
91
|
cursor: pointer;
|
|
93
|
-
fill: var(--color-link-primary);
|
|
92
|
+
fill: var(--color-link-primary) !important;
|
|
94
93
|
background: rgb(255, 255, 255);
|
|
95
94
|
}
|
|
96
95
|
|
package/static/icons/Read Me.txt
CHANGED
|
@@ -4,7 +4,7 @@ If you prefer using PNGs, PDFs, or CSS sprites, refer to the Preferences panel o
|
|
|
4
4
|
|
|
5
5
|
*demo.html* lists the icons that you selected. To insert your icons as inline SVGs (with the <use> element), copy the <svg> element (that contains symbol definitions) from the source of the demo.html file, below your own HTML's <body> tag. After copying this SVG, you can reference your glyphs like the following:
|
|
6
6
|
|
|
7
|
-
<svg class="icon icon-
|
|
7
|
+
<svg class="icon icon-zapier"><use xlink:href="#icon-zapier"></use></svg>
|
|
8
8
|
|
|
9
9
|
You can get this code from the SVG tab of the IcoMoon app, or by referring to the source of the demo.html file. To see how you can change the color/size of your icons using CSS, refer to the example provided in the *style.css* file.
|
|
10
10
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<!-- Generated by IcoMoon.io -->
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
3
|
+
<title>menu-collapse</title>
|
|
4
|
+
<path d="M21 15.609l-1.406 1.406-5.016-5.016 5.016-5.016 1.406 1.406-3.563 3.609zM3 6h12.984v2.016h-12.984v-2.016zM3 12.984v-1.969h9.984v1.969h-9.984zM3 18v-2.016h12.984v2.016h-12.984z"></path>
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!-- Generated by IcoMoon.io -->
|
|
2
2
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
3
3
|
<title>zapier</title>
|
|
4
|
-
<path fill="#
|
|
4
|
+
<path fill="#474747" d="M4.8 0h22.4c2.651 0 4.8 2.149 4.8 4.8v22.4c0 2.651-2.149 4.8-4.8 4.8h-22.4c-2.651 0-4.8-2.149-4.8-4.8v-22.4c0-2.651 2.149-4.8 4.8-4.8z"></path>
|
|
5
|
+
<path fill="#fff" d="M4.8 20.8h22.4v6.4h-22.4v-6.4z"></path>
|
|
5
6
|
</svg>
|