@nyaruka/temba-components 0.48.2 → 0.48.4

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,8 +4,23 @@ 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.48.4](https://github.com/nyaruka/temba-components/compare/v0.48.3...v0.48.4)
8
+
9
+ - Wrap menu targets in links where we have hrefs [`#311`](https://github.com/nyaruka/temba-components/pull/311)
10
+ - Update screenshots [`85d07b1`](https://github.com/nyaruka/temba-components/commit/85d07b1b9200846d4a219127d2e57a9d295e7539)
11
+
12
+ #### [v0.48.3](https://github.com/nyaruka/temba-components/compare/v0.48.2...v0.48.3)
13
+
14
+ > 12 April 2023
15
+
16
+ - Better ticket view on narrow windows [`#310`](https://github.com/nyaruka/temba-components/pull/310)
17
+ - Tweak ticket layout a bit more [`c56ce1c`](https://github.com/nyaruka/temba-components/commit/c56ce1c94e647d4c38d627a7e3ae720aa482e9b2)
18
+ - Updated screenshots [`e20e199`](https://github.com/nyaruka/temba-components/commit/e20e199496501a181c6cf8a2f463dd43e3d27e1b)
19
+
7
20
  #### [v0.48.2](https://github.com/nyaruka/temba-components/compare/v0.48.1...v0.48.2)
8
21
 
22
+ > 10 April 2023
23
+
9
24
  - Allow ticket summary to be expanded [`#306`](https://github.com/nyaruka/temba-components/pull/306)
10
25
  - compose - switch from array of content_type:url to array of uuid when sending broadcast [`#289`](https://github.com/nyaruka/temba-components/pull/289)
11
26
  - - merged main and regenerated screenshots [`aa3a79e`](https://github.com/nyaruka/temba-components/commit/aa3a79e76c3a0e9443aefdca5f52944c76572fbc)
@@ -2857,7 +2857,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2857
2857
  >
2858
2858
  <div style="flex: 1; color:#333;">
2859
2859
  <div
2860
- style="font-weight:400;line-height:1.6;border:0px solid purple;"
2860
+ style="font-weight:400;line-height:1.6;display:-webkit-box;-webkit-box-orient: vertical; -webkit-line-clamp: 1;overflow: hidden;"
2861
2861
  >
2862
2862
  ${t.name}
2863
2863
  </div>
@@ -3787,6 +3787,11 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3787
3787
  --icon-color: var(--color-link-primary);
3788
3788
  }
3789
3789
 
3790
+ a {
3791
+ text-decoration: none;
3792
+ color: var(--color-text-dark);
3793
+ }
3794
+
3790
3795
  slot[name='header'] {
3791
3796
  display: none;
3792
3797
  }
@@ -3809,7 +3814,8 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3809
3814
  name="${t.collapsed_icon}"
3810
3815
  class="collapse-icon"
3811
3816
  ></temba-icon>`:null,r=ee({["menu-"+t.id]:!0,"child-selected":n,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!o&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id});t.avatar&&(o=xe({name:t.avatar}));const a=D`
3812
- <div
3817
+ <a
3818
+ href=${ct(t.href?t.href:void 0)}
3813
3819
  id="menu-${t.id}"
3814
3820
  class="${r}"
3815
3821
  @click=${i=>{this.pressedItem=null,this.handleItemClicked(i,t,e)}}
@@ -3839,7 +3845,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3839
3845
  `:D`<div class="count"></div>`}`:null}
3840
3846
  </div>
3841
3847
  <div class="right"></div>
3842
- </div>
3848
+ </a>
3843
3849
  `;return t.popup?D`
3844
3850
  <temba-dropdown offsetx="10" arrowoffset="8" mask>
3845
3851
  <div slot="toggle">${a}</div>
@@ -4841,8 +4847,15 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4841
4847
  0 0 0px 2px var(--color-link-primary);
4842
4848
  }
4843
4849
 
4850
+ .header {
4851
+ display: flex;
4852
+ flex-direction: row;
4853
+ flex-grow: 1;
4854
+ }
4855
+
4844
4856
  .tickets {
4845
4857
  display: flex;
4858
+ flex-direction: column;
4846
4859
  padding: 0.3em 0.8em;
4847
4860
  }
4848
4861
 
@@ -4853,65 +4866,42 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4853
4866
  .ticket {
4854
4867
  background: #fff;
4855
4868
  display: flex;
4869
+ flex-direction: column;
4856
4870
  margin-bottom: 0.5em;
4857
4871
  border-radius: var(--curvature);
4858
4872
  display: flex;
4859
- flex-direction: row;
4860
- align-items: center;
4873
+ flex-direction: column;
4874
+ align-items: stretch;
4861
4875
  box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.055),
4862
4876
  0 0 0px 1px rgba(0, 0, 0, 0.02);
4863
4877
  transition: all 200ms ease-in-out;
4864
4878
  }
4865
4879
 
4866
- .ticket .body {
4867
- flex-grow: 5;
4868
- white-space: nowrap;
4869
- overflow: hidden;
4870
- text-overflow: ellipsis;
4871
- width: 200px;
4872
- }
4873
-
4874
4880
  .ticket .topic {
4875
- flex-grow: 1;
4876
- white-space: nowrap;
4877
4881
  overflow: hidden;
4878
4882
  text-overflow: ellipsis;
4879
- margin: 0 0.75em;
4880
- width: 60px;
4881
- }
4882
-
4883
- .ticket.expanded .topic {
4884
- display: none;
4885
- }
4886
-
4887
- .ticket.expanded .topic-expanded {
4883
+ margin: 0.5em 0.75em 0.5em 0.75em;
4888
4884
  display: -webkit-box;
4889
- }
4890
-
4891
- .topic-expanded {
4892
- flex-grow: 1;
4893
- display: none;
4894
- -webkit-line-clamp: 1;
4895
4885
  -webkit-box-orient: vertical;
4896
- overflow: hidden;
4897
- }
4898
-
4899
- .ticket.expanded {
4900
- flex-direction: column-reverse;
4901
- align-items: stretch;
4886
+ -webkit-line-clamp: 1;
4887
+ flex-grow: 2;
4902
4888
  }
4903
4889
 
4904
- .ticket.expanded .body {
4905
- display: block;
4906
- max-height: 40vh;
4890
+ .ticket .body {
4891
+ max-height: 0px;
4907
4892
  overflow-y: auto;
4908
4893
  -webkit-line-clamp: none;
4909
- border-top: 1px solid #e6e6e6;
4910
- // 6px solid #f9f9f9;
4911
- margin-bottom: 0.5em;
4912
- padding: 0.5em 1em 0em 1em;
4913
4894
  white-space: normal;
4914
4895
  width: initial;
4896
+ padding: 0.5em 0.75em 0em 0.75em;
4897
+ max-height: 40vh;
4898
+ display: none;
4899
+ margin-bottom: 0.5em;
4900
+ border-top: 1px solid #e6e6e6;
4901
+ }
4902
+
4903
+ .ticket.expanded .body {
4904
+ display: block;
4915
4905
  }
4916
4906
 
4917
4907
  .status {
@@ -4998,16 +4988,16 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4998
4988
  .details {
4999
4989
  display: flex;
5000
4990
  align-items: center;
5001
- padding: 0.5em 1em;
5002
4991
  flex-shrink: 1;
4992
+ margin-right: 0.5em;
5003
4993
  }
5004
4994
 
5005
4995
  .details .date {
5006
- padding: 0em 0.75em;
4996
+ padding: 0em 0.5em;
5007
4997
  }
5008
4998
 
5009
4999
  .details .toggle {
5010
- padding-right: 0.75em;
5000
+ padding-right: 0.5em;
5011
5001
  }
5012
5002
  `}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==bt.Open&&e.status==bt.Closed?-1:e.status==bt.Open&&t.status==bt.Closed?1:t.status==bt.Closed&&e.status==bt.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}renderUser(t){return t?D`<div class="user">
5013
5003
  <div class="avatar">${xe({user:t})}</div>
@@ -5017,98 +5007,98 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5017
5007
  @click=${()=>{this.clickable?this.fireCustomEvent(_t.ButtonClicked,{ticket:t}):this.expandable&&(this.expanded=!this.expanded)}}
5018
5008
  class="ticket ${t.status} ${ee({clickable:this.clickable,expandable:this.expandable,expanded:this.expanded})}"
5019
5009
  >
5020
- <div class="topic">${t.topic.name}</div>
5021
- <div class="body">${t.body}</div>
5022
-
5023
- <div class="details">
5024
- <div class="topic-expanded">${t.topic.name}</div>
5025
-
5026
- <div class="date">
5027
- <temba-date value="${e}" display="duration"></temba-date>
5028
- </div>
5010
+ <div class="header">
5011
+ <div class="topic">${t.topic.name}</div>
5029
5012
 
5030
- ${t.status===bt.Closed?D`<div class="reopen">
5031
- <temba-button
5032
- primary
5033
- small
5034
- name="Reopen"
5035
- @click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleReopen(t.uuid)}}
5036
- ></temba-button>
5037
- </div>`:D`
5038
- <div>
5039
- <temba-dropdown
5040
- drop_align="right"
5041
- arrowsize="8"
5042
- arrowoffset="-44"
5043
- offsety="8"
5044
- offsetx=${t.assignee?-42:-28}
5045
- >
5046
- <div slot="toggle" class="toggle">
5047
- ${t.assignee?D`
5048
- <div style="font-size:0.5em">
5049
- ${xe({name:t.assignee.name,position:"left"})}
5050
- </div>
5051
- `:D`
5052
- <temba-button
5053
- name="Assign"
5054
- primary
5055
- small
5056
- ></temba-button>
5057
- `}
5058
- </div>
5013
+ <div class="details">
5014
+ <div class="date">
5015
+ <temba-date value="${e}" display="duration"></temba-date>
5016
+ </div>
5059
5017
 
5060
- <div
5061
- slot="dropdown"
5062
- class="dropdown"
5063
- @click=${t=>{_e(t)}}
5018
+ ${t.status===bt.Closed?D`<div class="reopen">
5019
+ <temba-button
5020
+ primary
5021
+ small
5022
+ name="Reopen"
5023
+ @click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleReopen(t.uuid)}}
5024
+ ></temba-button>
5025
+ </div>`:D`
5026
+ <div>
5027
+ <temba-dropdown
5028
+ drop_align="right"
5029
+ arrowsize="8"
5030
+ arrowoffset="-44"
5031
+ offsety="8"
5032
+ offsetx=${t.assignee?-42:-28}
5064
5033
  >
5065
- ${t.assignee?D`
5066
- <div
5067
- class="assigned option-group ${n&&t.assignee.email==n.email?"current-user":""}"
5068
- >
5069
- ${this.renderUser(i.find((e=>e.email===t.assignee.email)))}
5034
+ <div slot="toggle" class="toggle">
5035
+ ${t.assignee?D`
5036
+ <div style="font-size:0.5em">
5037
+ ${xe({name:t.assignee.name,position:"left"})}
5038
+ </div>
5039
+ `:D`
5070
5040
  <temba-button
5071
- name="Unassign"
5041
+ name="Assign"
5072
5042
  primary
5073
5043
  small
5074
- @click=${e=>{_e(e),this.handleTicketAssignment(t.uuid,null)}}
5075
5044
  ></temba-button>
5076
- </div>
5077
- `:null}
5078
- ${!n||t.assignee&&n.email===t.assignee.email?null:D`
5079
- <div
5080
- class="current-user option-group"
5081
- @click=${e=>{_e(e),this.handleTicketAssignment(t.uuid,n.email)}}
5082
- >
5083
- ${this.renderUser(n)}
5084
- </div>
5085
- `}
5045
+ `}
5046
+ </div>
5086
5047
 
5087
- <div class="options option-group">
5088
- ${this.store.getAssignableUsers().map((e=>t.assignee&&e.email===t.assignee.email||e.email===this.agent?null:D`<div
5089
- @click=${i=>{_e(i),this.handleTicketAssignment(t.uuid,e.email)}}
5090
- >
5091
- ${this.renderUser(e)}
5092
- </div>`))}
5048
+ <div
5049
+ slot="dropdown"
5050
+ class="dropdown"
5051
+ @click=${t=>{_e(t)}}
5052
+ >
5053
+ ${t.assignee?D`
5054
+ <div
5055
+ class="assigned option-group ${n&&t.assignee.email==n.email?"current-user":""}"
5056
+ >
5057
+ ${this.renderUser(i.find((e=>e.email===t.assignee.email)))}
5058
+ <temba-button
5059
+ name="Unassign"
5060
+ primary
5061
+ small
5062
+ @click=${e=>{_e(e),this.handleTicketAssignment(t.uuid,null)}}
5063
+ ></temba-button>
5064
+ </div>
5065
+ `:null}
5066
+ ${!n||t.assignee&&n.email===t.assignee.email?null:D`
5067
+ <div
5068
+ class="current-user option-group"
5069
+ @click=${e=>{_e(e),this.handleTicketAssignment(t.uuid,n.email)}}
5070
+ >
5071
+ ${this.renderUser(n)}
5072
+ </div>
5073
+ `}
5074
+
5075
+ <div class="options option-group">
5076
+ ${this.store.getAssignableUsers().map((e=>t.assignee&&e.email===t.assignee.email||e.email===this.agent?null:D`<div
5077
+ @click=${i=>{_e(i),this.handleTicketAssignment(t.uuid,e.email)}}
5078
+ >
5079
+ ${this.renderUser(e)}
5080
+ </div>`))}
5081
+ </div>
5093
5082
  </div>
5094
- </div>
5095
- </temba-dropdown>
5096
- </div>
5097
- <temba-tip
5098
- text="Resolve"
5099
- position="left"
5100
- style="width:1.5em"
5101
- class="resolve"
5102
- >
5103
- <temba-icon
5104
- size="1.25"
5105
- name="${at.check}"
5106
- @click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleClose(t.uuid)}}
5107
- ?clickable=${open}
5108
- />
5109
- </temba-tip>
5110
- `}
5083
+ </temba-dropdown>
5084
+ </div>
5085
+ <temba-tip
5086
+ text="Resolve"
5087
+ position="left"
5088
+ style="width:1.5em"
5089
+ class="resolve"
5090
+ >
5091
+ <temba-icon
5092
+ size="1.25"
5093
+ name="${at.check}"
5094
+ @click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleClose(t.uuid)}}
5095
+ ?clickable=${open}
5096
+ />
5097
+ </temba-tip>
5098
+ `}
5099
+ </div>
5111
5100
  </div>
5101
+ <div class="body">${t.body}</div>
5112
5102
  </div>
5113
5103
  `}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return D`${t}`}return D`<slot name="empty"></slot>`}}t([st({type:String})],gl.prototype,"agent",void 0),t([st({type:String})],gl.prototype,"contact",void 0),t([st({type:String})],gl.prototype,"ticket",void 0),t([st({type:Boolean})],gl.prototype,"clickable",void 0),t([st({type:Boolean})],gl.prototype,"expandable",void 0),t([st({type:Boolean})],gl.prototype,"expanded",void 0),t([st({type:Object,attribute:!1})],gl.prototype,"data",void 0);class vl extends lt{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
5114
5104
  :host {