@nyaruka/temba-components 0.107.0 → 0.108.0
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 +16 -0
- package/demo/index.html +2 -2
- package/dist/temba-components.js +78 -34
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/dialog/Modax.js +3 -1
- package/out-tsc/src/dialog/Modax.js.map +1 -1
- package/out-tsc/src/progress/ProgressBar.js +78 -31
- package/out-tsc/src/progress/ProgressBar.js.map +1 -1
- package/out-tsc/src/progress/StartProgress.js +150 -0
- package/out-tsc/src/progress/StartProgress.js.map +1 -0
- package/out-tsc/src/utils/index.js +3 -0
- package/out-tsc/src/utils/index.js.map +1 -1
- package/out-tsc/temba-modules.js +2 -2
- package/out-tsc/temba-modules.js.map +1 -1
- package/package.json +1 -1
- package/src/dialog/Modax.ts +5 -1
- package/src/progress/ProgressBar.ts +79 -33
- package/src/progress/StartProgress.ts +158 -0
- package/src/utils/index.ts +4 -0
- package/temba-modules.ts +2 -2
- package/out-tsc/src/progress/FlowStartProgress.js +0 -60
- package/out-tsc/src/progress/FlowStartProgress.js.map +0 -1
- package/src/progress/FlowStartProgress.ts +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,24 @@ 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.108.0](https://github.com/nyaruka/temba-components/compare/v0.107.1...v0.108.0)
|
|
8
|
+
|
|
9
|
+
- Switch to generic StartProgress widget [`#456`](https://github.com/nyaruka/temba-components/pull/456)
|
|
10
|
+
- Honor status over total count for progress [`409608a`](https://github.com/nyaruka/temba-components/commit/409608a8519974502c5b97b8ddc210af3575f294)
|
|
11
|
+
- Soften progress curvature [`a848a5d`](https://github.com/nyaruka/temba-components/commit/a848a5d1515787e4e6c03e28c428f5a9ae352f63)
|
|
12
|
+
- Use Queued status for waiting message [`bbf9684`](https://github.com/nyaruka/temba-components/commit/bbf9684577cbd86762976262e87072d85bb496aa)
|
|
13
|
+
|
|
14
|
+
#### [v0.107.1](https://github.com/nyaruka/temba-components/compare/v0.107.0...v0.107.1)
|
|
15
|
+
|
|
16
|
+
> 16 September 2024
|
|
17
|
+
|
|
18
|
+
- Fix widths for large pcts on progress bar [`#454`](https://github.com/nyaruka/temba-components/pull/454)
|
|
19
|
+
- Better handling for empty case [`25bcf3b`](https://github.com/nyaruka/temba-components/commit/25bcf3bdf76cc616f22d9bfc0f66dd6e18d91e5f)
|
|
20
|
+
|
|
7
21
|
#### [v0.107.0](https://github.com/nyaruka/temba-components/compare/v0.106.0...v0.107.0)
|
|
8
22
|
|
|
23
|
+
> 14 September 2024
|
|
24
|
+
|
|
9
25
|
- Add flow start progress [`#453`](https://github.com/nyaruka/temba-components/pull/453)
|
|
10
26
|
- Calculate a naiive eta [`fc2d480`](https://github.com/nyaruka/temba-components/commit/fc2d480aba07bf5267844a0d370423893d03d009)
|
|
11
27
|
|
package/demo/index.html
CHANGED
|
@@ -144,8 +144,6 @@
|
|
|
144
144
|
</temba-dropdown>
|
|
145
145
|
|
|
146
146
|
<div class="header">temba-components</div>
|
|
147
|
-
|
|
148
|
-
|
|
149
147
|
<!--temba-image-picker name="avatar" label="Profile Picture" shape="circle"></temba-image-picker-->
|
|
150
148
|
<!--temba-webchat channel="9e6b37a8-c649-48b3-92d1-dfa7c00b85dc"></temba-webchat-->
|
|
151
149
|
<!-- temba-template-editor url="/static/api/templates.json" lang="eng" template="580b124f-32cb-4003-b9e5-9eb783e29101"
|
|
@@ -154,6 +152,8 @@
|
|
|
154
152
|
|
|
155
153
|
<temba-tabs collapses index="0">
|
|
156
154
|
<temba-tab name="Overview" icon="default">
|
|
155
|
+
<temba-progress style="margin-bottom:8px" total="100" current="25" eta="2030-09-17T07:00:00.000Z"></temba-progress>
|
|
156
|
+
|
|
157
157
|
<div style="display:flex;flex-wrap: wrap;">
|
|
158
158
|
<temba-checkbox label="Check this out" checked></temba-checkbox>
|
|
159
159
|
<temba-select placeholder="Select a color" clearable>
|
package/dist/temba-components.js
CHANGED
|
@@ -1424,7 +1424,7 @@ let br=Ks,yr=!1;const _r=["es","fr","pt"],{setLocale:xr}=(t=>(function(t){if(yr)
|
|
|
1424
1424
|
flex-direction: row;
|
|
1425
1425
|
margin-left: 0.6em;
|
|
1426
1426
|
}
|
|
1427
|
-
`}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&(this.open?window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500):this.setBody(""))),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return j`<temba-loading units="6" size="8"></temba-loading>`}updatePrimaryButton(){const t=this.shadowRoot.querySelector("#wizard-form");t&&(this.wizardStep=parseInt(t.dataset.step),this.wizardStepCount=parseInt(t.dataset.steps)),this.noSubmit||this.updateComplete.then((()=>{const t=this.shadowRoot.querySelector("input[type='submit'],button[type='submit']");this.buttons=t?[{type:ml.SECONDARY,name:"Cancel",closes:!0},{type:ml.PRIMARY,name:t.value}]:[{type:ml.SECONDARY,name:"Ok",closes:!0}],this.submitting=!1}))}setBody(t){const e=this.shadowRoot.querySelector(".scripts");for(const t of e.children)t.remove();const i=this.ownerDocument.createElement("div");i.innerHTML=t;const o=i.getElementsByTagName("script"),n=[];for(let t=o.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=o[t].innerText;o[t].src&&-1===o[t].src.indexOf("web-dev-server")?(e.src=o[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},n.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),n.push(e)),o[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=$r(i.innerHTML)),this.updateComplete.then((()=>{for(const t of n)e.appendChild(t)})),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),jt(this.endpoint,null,this.getHeaders()).then((t=>{0==t.body.indexOf("<!DOCTYPE HTML>")?document.location=t.url:(this.setBody(t.body),this.fetching=!1,this.updateComplete.then((()=>{this.updatePrimaryButton(),this.fireCustomEvent(Le.Loaded,{body:this.getBody()})})))}))}submit(t={}){this.submitting=!0;const e=this.shadowRoot.querySelector("form");let i=e?function(t){const e=[];for(let i=0;i<t.elements.length;i++){const o=t.elements[i];if(o.name&&!o.disabled&&"file"!==o.type&&"reset"!==o.type&&"submit"!==o.type&&"button"!==o.type)if("select-multiple"===o.type)for(let t=0;t<o.options.length;t++)o.options[t].selected&&o.options[t].value&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(o.options[t].value));else if("checkbox"!==o.type&&"radio"!==o.type||o.checked){let t=o.value;!t&&o.checked&&(t="1"),t&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(t))}}return e.join("&")}(e):"";t&&Object.keys(t).forEach((e=>{i+=(i.length>1?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t[e])})),Qt(this.endpoint,i,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?this.updateComplete.then((()=>{this.open=!1,this.fireCustomEvent(Le.Submitted)})):(this.fireCustomEvent(Le.Redirected,{url:e}),this.open=!1):this.setBody(t.body)&&this.updateComplete.then((()=>{this.updatePrimaryButton()}))}),1e3)})).catch((t=>{console.error(t)}))}handleDialogClick(t){const e=t.detail.button,i=t.detail.detail;e.disabled||e.submitting||(e.primary||e.destructive)&&(this.suspendSubmit||this.submit()),i.closes&&(this.open=!1,this.fetching=!1,this.cancelName=void 0)}handleDialogHidden(){this.open=!1,this.fetching=!1}isDestructive(){return this.endpoint&&this.endpoint.indexOf("delete")>-1}handleGotoStep(t){const e=t.target.dataset.gotoStep;e&&this.submit({wizard_goto_step:e})}getBody(){return this.shadowRoot.querySelector(".modax-body")}render(){const t=[],e=this.shadowRoot.querySelector("#wizard-form");if(e){const i=(e.getAttribute("data-completed")||"").split(",").filter((t=>t.length>0));for(let e=0;e<this.wizardStepCount;e++)t.push(j`<div
|
|
1427
|
+
`}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&(this.open?window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500):this.setBody(""))),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return j`<temba-loading units="6" size="8"></temba-loading>`}updatePrimaryButton(){const t=this.shadowRoot.querySelector("#wizard-form");t&&(this.wizardStep=parseInt(t.dataset.step),this.wizardStepCount=parseInt(t.dataset.steps)),this.noSubmit||this.updateComplete.then((()=>{const t=this.shadowRoot.querySelector("input[type='submit'],button[type='submit']");this.buttons=t?[{type:ml.SECONDARY,name:"Cancel",closes:!0},{type:ml.PRIMARY,name:t.value}]:[{type:ml.SECONDARY,name:"Ok",closes:!0}],this.submitting=!1}))}setBody(t){const e=this.shadowRoot.querySelector(".scripts");for(const t of e.children)t.remove();const i=this.ownerDocument.createElement("div");i.innerHTML=t;const o=i.getElementsByTagName("script"),n=[];for(let t=o.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=o[t].innerText;o[t].src&&-1===o[t].src.indexOf("web-dev-server")?(e.src=o[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},n.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),n.push(e)),o[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=$r(i.innerHTML)),this.updateComplete.then((()=>{for(const t of n)e.appendChild(t)})),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),jt(this.endpoint,null,this.getHeaders()).then((t=>{0==t.body.indexOf("<!DOCTYPE HTML>")?document.location=t.url:(this.setBody(t.body),this.fetching=!1,this.updateComplete.then((()=>{this.updatePrimaryButton(),this.fireCustomEvent(Le.Loaded,{body:this.getBody()})})))}))}submit(t={}){this.submitting=!0;const e=this.shadowRoot.querySelector("form");let i=e?function(t){const e=[];for(let i=0;i<t.elements.length;i++){const o=t.elements[i];if(o.name&&!o.disabled&&"file"!==o.type&&"reset"!==o.type&&"submit"!==o.type&&"button"!==o.type)if("select-multiple"===o.type)for(let t=0;t<o.options.length;t++)o.options[t].selected&&o.options[t].value&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(o.options[t].value));else if("checkbox"!==o.type&&"radio"!==o.type||o.checked){let t=o.value;!t&&o.checked&&(t="1"),t&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(t))}}return e.join("&")}(e):"";t&&Object.keys(t).forEach((e=>{i+=(i.length>1?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t[e])})),Qt(this.endpoint,i,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?this.updateComplete.then((()=>{this.open=!1,this.fireCustomEvent(Le.Submitted)})):(this.fireCustomEvent(Le.Redirected,{url:e}),this.open=!1):this.setBody(t.body)&&this.updateComplete.then((()=>{this.updatePrimaryButton()}))}),1e3)})).catch((t=>{console.error(t)}))}handleDialogClick(t){const e=t.detail.button,i=t.detail.detail;e.disabled||e.submitting||(e.primary||e.destructive)&&(this.suspendSubmit||this.submit()),i.closes&&(this.open=!1,this.fetching=!1,this.cancelName=void 0)}handleDialogHidden(){this.open=!1,this.fetching=!1}isDestructive(){return this.endpoint&&(this.endpoint.indexOf("delete")>-1||this.endpoint.indexOf("interrupt")>-1)}handleGotoStep(t){const e=t.target.dataset.gotoStep;e&&this.submit({wizard_goto_step:e})}getBody(){return this.shadowRoot.querySelector(".modax-body")}render(){const t=[],e=this.shadowRoot.querySelector("#wizard-form");if(e){const i=(e.getAttribute("data-completed")||"").split(",").filter((t=>t.length>0));for(let e=0;e<this.wizardStepCount;e++)t.push(j`<div
|
|
1428
1428
|
data-goto-step=${i[e]}
|
|
1429
1429
|
@click=${this.handleGotoStep.bind(this)}
|
|
1430
1430
|
class="${Vt({"step-ball":!0,active:this.wizardStep-1===e,complete:e<i.length})}"
|
|
@@ -7961,33 +7961,53 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7961
7961
|
>.
|
|
7962
7962
|
</div></temba-alert
|
|
7963
7963
|
>
|
|
7964
|
-
</div>`:null}}t([ge({type:Number})],Ec.prototype,"backlogSize",void 0),t([ge({type:String})],Ec.prototype,"endpoint",void 0),t([ge({type:Object})],Ec.prototype,"firstFetch",void 0),t([ge({type:Object})],Ec.prototype,"lastFetch",void 0),t([ge({type:Number})],Ec.prototype,"fetches",void 0),t([ge({type:Number})],Ec.prototype,"msgsPerSecond",void 0),t([ge({type:Object})],Ec.prototype,"estimatedCompletionDate",void 0);class Tc extends ue{constructor(){super(...arguments),this.total=100,this.current=0,this.pct=0,this.done=!1,this.showEstimatedCompletion=!1}updated(t){t.has("eta")&&this.eta&&(this.estimatedCompletionDate=new Date(this.eta),this.showEstimatedCompletion=this.estimatedCompletionDate>new Date),t.has("current")
|
|
7965
|
-
<
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7964
|
+
</div>`:null}}t([ge({type:Number})],Ec.prototype,"backlogSize",void 0),t([ge({type:String})],Ec.prototype,"endpoint",void 0),t([ge({type:Object})],Ec.prototype,"firstFetch",void 0),t([ge({type:Object})],Ec.prototype,"lastFetch",void 0),t([ge({type:Number})],Ec.prototype,"fetches",void 0),t([ge({type:Number})],Ec.prototype,"msgsPerSecond",void 0),t([ge({type:Object})],Ec.prototype,"estimatedCompletionDate",void 0);class Tc extends ue{constructor(){super(...arguments),this.total=100,this.current=0,this.pct=0,this.done=!1,this.showEstimatedCompletion=!1,this.showPercentage=!1}updated(t){if(t.has("eta")&&this.eta&&(this.estimatedCompletionDate=new Date(this.eta),this.showEstimatedCompletion=this.estimatedCompletionDate>new Date),t.has("current")){const t=Math.floor(Math.min(this.current/this.total*100,100));Number.isNaN(t)?this.showPercentage=!1:(this.pct=t,this.showPercentage=!0),this.done=this.pct>=100}}render(){return j`<div class="wrapper ${this.done?"complete":""}">
|
|
7965
|
+
<div class="meter ${this.done?"done":""}">
|
|
7966
|
+
${this.message?j`<div class="message">${this.message}</div>`:null}
|
|
7967
|
+
<span class="complete" style="flex-basis: ${this.pct}%"></span>
|
|
7968
|
+
<div class="incomplete"></div>
|
|
7969
|
+
</div>
|
|
7970
|
+
|
|
7971
|
+
${this.showPercentage||this.showEstimatedCompletion?j`<div class="etc">
|
|
7972
|
+
<div>
|
|
7973
|
+
${this.estimatedCompletionDate&&this.showEstimatedCompletion&&!this.done?j`<temba-date
|
|
7974
|
+
value="${this.estimatedCompletionDate.toISOString()}"
|
|
7975
|
+
display="countdown"
|
|
7976
|
+
></temba-date>`:j`${this.pct}%`}
|
|
7977
|
+
</div>
|
|
7972
7978
|
</div>`:null}
|
|
7979
|
+
|
|
7980
|
+
<slot></slot>
|
|
7973
7981
|
</div>`}}Tc.styles=r`
|
|
7974
|
-
.
|
|
7982
|
+
.wrapper {
|
|
7975
7983
|
display: flex;
|
|
7976
7984
|
box-sizing: content-box;
|
|
7977
|
-
height: 8px;
|
|
7978
|
-
position: relative;
|
|
7979
7985
|
background: #f1f1f1;
|
|
7980
7986
|
border-radius: var(--curvature);
|
|
7981
|
-
padding: 4px;
|
|
7982
7987
|
box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.05);
|
|
7988
|
+
overflow: hidden;
|
|
7989
|
+
min-height: 1.5rem;
|
|
7990
|
+
}
|
|
7991
|
+
|
|
7992
|
+
.message {
|
|
7993
|
+
padding: 0 0.25rem;
|
|
7994
|
+
color: rgba(0, 0, 0, 0.4);
|
|
7995
|
+
}
|
|
7996
|
+
|
|
7997
|
+
.meter {
|
|
7998
|
+
flex-grow: 1;
|
|
7999
|
+
display: flex;
|
|
8000
|
+
box-sizing: content-box;
|
|
8001
|
+
position: relative;
|
|
8002
|
+
border-top-right-radius: 0;
|
|
8003
|
+
border-bottom-right-radius: 0;
|
|
8004
|
+
padding: 4px;
|
|
8005
|
+
min-height: 6px;
|
|
7983
8006
|
}
|
|
7984
8007
|
.meter > span {
|
|
7985
8008
|
display: block;
|
|
7986
8009
|
height: 100%;
|
|
7987
|
-
border-
|
|
7988
|
-
border-bottom-right-radius: var(--curvature);
|
|
7989
|
-
border-top-left-radius: var(--curvature);
|
|
7990
|
-
border-bottom-left-radius: var(--curvature);
|
|
8010
|
+
border-radius: calc(var(--curvature) * 0.8);
|
|
7991
8011
|
background-color: var(--color-primary-dark);
|
|
7992
8012
|
background-image: linear-gradient(
|
|
7993
8013
|
center bottom,
|
|
@@ -7998,6 +8018,7 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7998
8018
|
position: relative;
|
|
7999
8019
|
overflow: hidden;
|
|
8000
8020
|
}
|
|
8021
|
+
|
|
8001
8022
|
.meter > span:after,
|
|
8002
8023
|
.animate > span > span {
|
|
8003
8024
|
content: '';
|
|
@@ -8018,7 +8039,7 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8018
8039
|
);
|
|
8019
8040
|
z-index: 1;
|
|
8020
8041
|
background-size: 50px 50px;
|
|
8021
|
-
animation: move
|
|
8042
|
+
animation: move 8s linear infinite;
|
|
8022
8043
|
border-top-right-radius: var(--curvature);
|
|
8023
8044
|
border-bottom-right-radius: var(--curvature);
|
|
8024
8045
|
border-top-left-radius: var(--curvature);
|
|
@@ -8039,27 +8060,35 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8039
8060
|
}
|
|
8040
8061
|
}
|
|
8041
8062
|
|
|
8042
|
-
.complete {
|
|
8043
|
-
transition:
|
|
8063
|
+
.meter .complete {
|
|
8064
|
+
transition: flex-basis 2s;
|
|
8044
8065
|
}
|
|
8045
8066
|
|
|
8046
|
-
.incomplete {
|
|
8067
|
+
.meter .incomplete {
|
|
8047
8068
|
flex-grow: 1;
|
|
8048
8069
|
}
|
|
8049
8070
|
|
|
8050
8071
|
.etc {
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
padding-top: 1px;
|
|
8054
|
-
padding-left: 8px;
|
|
8055
|
-
padding-right: 8px;
|
|
8056
|
-
margin-top: -4px;
|
|
8057
|
-
margin-bottom: -4px;
|
|
8058
|
-
margin-right: -4px;
|
|
8059
|
-
margin-left: 0.5em;
|
|
8072
|
+
display: flex;
|
|
8073
|
+
flex-direction: row;
|
|
8060
8074
|
background: rgba(0, 0, 0, 0.07);
|
|
8061
8075
|
font-weight: bold;
|
|
8062
8076
|
white-space: nowrap;
|
|
8077
|
+
color: rgba(0, 0, 0, 0.5);
|
|
8078
|
+
align-self: center;
|
|
8079
|
+
padding: 0px 6px;
|
|
8080
|
+
align-self: stretch;
|
|
8081
|
+
align-items: center;
|
|
8082
|
+
}
|
|
8083
|
+
|
|
8084
|
+
.etc > div {
|
|
8085
|
+
font-size: 0.7em;
|
|
8086
|
+
}
|
|
8087
|
+
|
|
8088
|
+
.wrapper *::last-child {
|
|
8089
|
+
border-top-right-radius: var(--curvature);
|
|
8090
|
+
border-bottom-right-radius: var(--curvature);
|
|
8091
|
+
overflow: hidden;
|
|
8063
8092
|
}
|
|
8064
8093
|
|
|
8065
8094
|
.meter.done > span:after,
|
|
@@ -8070,11 +8099,26 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8070
8099
|
.meter.done > span {
|
|
8071
8100
|
background: rgb(var(--success-rgb));
|
|
8072
8101
|
}
|
|
8073
|
-
`,t([ge({type:Number})],Tc.prototype,"total",void 0),t([ge({type:Number})],Tc.prototype,"current",void 0),t([ge({type:Number})],Tc.prototype,"pct",void 0),t([ge({type:Boolean})],Tc.prototype,"done",void 0),t([ge({type:String})],Tc.prototype,"eta",void 0),t([ge({type:String,attribute:!1})],Tc.prototype,"estimatedCompletionDate",void 0),t([ge({type:Boolean})],Tc.prototype,"showEstimatedCompletion",void 0);class $c extends ue{constructor(){super(...arguments),this.refreshes=0}updated(t){super.updated(t),t.has("
|
|
8102
|
+
`,t([ge({type:Number})],Tc.prototype,"total",void 0),t([ge({type:Number})],Tc.prototype,"current",void 0),t([ge({type:Number})],Tc.prototype,"pct",void 0),t([ge({type:Boolean})],Tc.prototype,"done",void 0),t([ge({type:String})],Tc.prototype,"eta",void 0),t([ge({type:String,attribute:!1})],Tc.prototype,"estimatedCompletionDate",void 0),t([ge({type:Boolean})],Tc.prototype,"showEstimatedCompletion",void 0),t([ge({type:Boolean})],Tc.prototype,"showPercentage",void 0),t([ge({type:String})],Tc.prototype,"message",void 0);class $c extends ue{constructor(){super(...arguments),this.refreshes=0,this.complete=!1,this.running=!1}updated(t){super.updated(t),t.has("id")&&this.refresh()}interruptStart(){var t,e;t=this.interruptTitle,e=this.interruptEndpoint,window.showModax(t,e)}refresh(){Wt(this.statusEndpoint).then((t=>{if(t.length>0){this.refreshes++;const e=t[0];if(this.current=e.progress.current,this.total=e.progress.total,this.complete="Completed"==e.status||"Failed"==e.status||"Interrupted"==e.status,this.running="Started"===e.status,"Pending"===e.status?this.message="Preparing to start..":"Queued"===e.status?this.message="Waiting..":this.message=null,"Started"===e.status){const t=(new Date).getTime()-new Date(e.modified_on).getTime(),i=this.current/t;if(i>.1){const t=new Date((new Date).getTime()+(this.total-this.current)/i),e=new Date;e.setMonth(e.getMonth()+2),this.eta=t>e?null:t.toISOString()}}!this.complete&&this.current<this.total&&setTimeout((()=>{this.refresh()}),Math.min(1e3*this.refreshes,6e4)),this.complete&&this.scheduleRemoval()}}))}scheduleRemoval(){setTimeout((()=>{this.remove()}),5e3)}render(){return j`<temba-progress
|
|
8074
8103
|
total=${this.total}
|
|
8075
|
-
current=${this.
|
|
8104
|
+
current=${this.current}
|
|
8076
8105
|
eta=${this.eta}
|
|
8077
|
-
|
|
8106
|
+
message=${this.message}
|
|
8107
|
+
>
|
|
8108
|
+
${this.running?j`<temba-icon
|
|
8109
|
+
name="close"
|
|
8110
|
+
@click=${this.interruptStart}
|
|
8111
|
+
></temba-icon>`:null}
|
|
8112
|
+
</temba-progress>`}}function Oc(t,e){window.customElements.get(t)||window.customElements.define(t,e)}$c.styles=r`
|
|
8113
|
+
temba-icon[name='close'] {
|
|
8114
|
+
cursor: pointer;
|
|
8115
|
+
margin: 0 4px;
|
|
8116
|
+
}
|
|
8117
|
+
|
|
8118
|
+
temba-icon[name='close']:hover {
|
|
8119
|
+
color: var(--color-primary-dark);
|
|
8120
|
+
}
|
|
8121
|
+
`,t([ge({type:String})],$c.prototype,"id",void 0),t([ge({type:Number})],$c.prototype,"current",void 0),t([ge({type:Number})],$c.prototype,"total",void 0),t([ge({type:Number})],$c.prototype,"refreshes",void 0),t([ge({type:String})],$c.prototype,"eta",void 0),t([ge({type:Boolean})],$c.prototype,"complete",void 0),t([ge({type:Boolean})],$c.prototype,"running",void 0),t([ge({type:String})],$c.prototype,"message",void 0),t([ge({type:String})],$c.prototype,"statusEndpoint",void 0),t([ge({type:String})],$c.prototype,"interruptTitle",void 0),t([ge({type:String})],$c.prototype,"interruptEndpoint",void 0),Oc("temba-anchor",wh),Oc("temba-alert",dh),Oc("temba-store",wr),Oc("temba-textinput",ze),Oc("temba-datepicker",Uh),Oc("temba-date",Kh),Oc("temba-completion",ul),Oc("temba-checkbox",be),Oc("temba-select",dl),Oc("temba-options",kr),Oc("temba-loading",yl),Oc("temba-lightbox",ic),Oc("temba-button",vl),Oc("temba-omnibox",fh),Oc("temba-tip",yh),Oc("temba-contact-name",Eh),Oc("temba-contact-name-fetch",Fh),Oc("temba-contact-field",Lh),Oc("temba-contact-fields",$h),Oc("temba-field-manager",Vh),Oc("temba-urn",Th),Oc("temba-content-menu",Yh),Oc("temba-field",bl),Oc("temba-dialog",gl),Oc("temba-modax",fl),Oc("temba-charcount",Tl),Oc("temba-contact-chat",rh),Oc("temba-contact-details",class extends Ll{static get styles(){return r`
|
|
8078
8122
|
.urn {
|
|
8079
8123
|
display: flex;
|
|
8080
8124
|
padding: 0.4em 1em 0.8em 1em;
|
|
@@ -8193,7 +8237,7 @@ const{I:gc}=rt,fc=()=>document.createComment(""),vc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8193
8237
|
</div>`}}renderHeader(){return j`<div class="header">
|
|
8194
8238
|
<temba-icon name="notification"></temba-icon>
|
|
8195
8239
|
<div class="title">Notifications</div>
|
|
8196
|
-
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),Oc("temba-list",ah),Oc("temba-sortable-list",Hh),Oc("temba-run-list",Rh),Oc("temba-flow-details",qh),Oc("temba-label",Sh),Oc("temba-menu",xh),Oc("temba-remote",tc),Oc("temba-contact-search",uh),Oc("temba-icon",ph),Oc("temba-dropdown",kh),Oc("temba-tabs",Ah),Oc("temba-tab",Ch),Oc("temba-contact-badges",Mh),Oc("temba-contact-pending",Dh),Oc("temba-contact-tickets",Ph),Oc("temba-slider",Nh),Oc("temba-content-menu",Yh),Oc("temba-compose",ec),Oc("temba-color-picker",oc),Oc("temba-resizer",nc),Oc("temba-thumbnail",rc),Oc("temba-webchat",hc),Oc("temba-image-picker",dc),Oc("temba-mask",uc),Oc("temba-user",pc),Oc("temba-template-editor",mc),Oc("temba-toast",kc),Oc("temba-chat",ql),Oc("temba-media-picker",Cc),Oc("temba-contact-notepad",Sc),Oc("temba-outbox-monitor",Ec),Oc("temba-progress",Tc),Oc("temba-
|
|
8240
|
+
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),Oc("temba-list",ah),Oc("temba-sortable-list",Hh),Oc("temba-run-list",Rh),Oc("temba-flow-details",qh),Oc("temba-label",Sh),Oc("temba-menu",xh),Oc("temba-remote",tc),Oc("temba-contact-search",uh),Oc("temba-icon",ph),Oc("temba-dropdown",kh),Oc("temba-tabs",Ah),Oc("temba-tab",Ch),Oc("temba-contact-badges",Mh),Oc("temba-contact-pending",Dh),Oc("temba-contact-tickets",Ph),Oc("temba-slider",Nh),Oc("temba-content-menu",Yh),Oc("temba-compose",ec),Oc("temba-color-picker",oc),Oc("temba-resizer",nc),Oc("temba-thumbnail",rc),Oc("temba-webchat",hc),Oc("temba-image-picker",dc),Oc("temba-mask",uc),Oc("temba-user",pc),Oc("temba-template-editor",mc),Oc("temba-toast",kc),Oc("temba-chat",ql),Oc("temba-media-picker",Cc),Oc("temba-contact-notepad",Sc),Oc("temba-outbox-monitor",Ec),Oc("temba-progress",Tc),Oc("temba-start-progress",$c);class Lc extends lt{static get styles(){return r`
|
|
8197
8241
|
:host {
|
|
8198
8242
|
line-height: normal;
|
|
8199
8243
|
}
|