@5minds/node-red-dashboard-2-processcube-process-progress-bar 1.1.0 → 1.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-dashboard-2-processcube-process-progress-bar",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A ui component for showing progress bars tracking a process",
5
5
  "keywords": [
6
6
  "processcube",
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(".progressBarWrapper[data-v-d9042733]{display:grid;align-items:center;gap:8px;padding:40px;border-radius:8px;border:2px solid #F6F5FA;background:#fff;margin-left:92px;margin-right:92px;margin-bottom:32px}.progressBarWrapper .progressBarStep[data-v-d9042733]{display:flex;align-items:center;gap:8px;padding:16px}.progressBarWrapper .currentStep[data-v-d9042733]{border-radius:15px;border:4px solid #8899C9}.progressBarWrapper .finishedStep[data-v-d9042733]{border-radius:15px;background:#8899c9;color:#fff}.progressBarWrapper hr[data-v-d9042733]{border-radius:2px;border:none;height:4px;background:#4a4759}.progressBarWrapper .coloredConnection[data-v-d9042733]{background:#8899c9}.progressBarWrapper span[data-v-d9042733]{font-size:21px;font-style:normal;font-weight:400;line-height:normal;white-space:nowrap}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(o,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vuex"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vuex","vue"],n):(o=typeof globalThis<"u"?globalThis:o||self,n(o["ui-process-progress-bar"]={},o.vuex,o.Vue))})(this,function(o,n,e){"use strict";const a=(t,s)=>{const c=t.__vccOpts||t;for(const[l,d]of s)c[l]=d;return c},p={name:"UIProcessProgressBar",inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!0,visible:!0})}},created(){this.steps=this.props.steps},computed:{...n.mapState("data",["messages"]),templateColumns(){return{gridTemplateColumns:new Array(this.steps.length).fill("min-content").join(" auto ")}},stepFlowNodeIds(){return this.steps.map(t=>t.flowNodeId)},activeStep(){var t,s;return(s=(t=this.messages[this.id])==null?void 0:t.processProgressBar)==null?void 0:s.activeStep},finishedSteps(){var t,s;return((s=(t=this.messages[this.id])==null?void 0:t.processProgressBar)==null?void 0:s.finishedSteps)??[]}},data(){return{steps:[]}},mounted(){this.$socket.on("widget-load:"+this.id,t=>{this.steps=this.props.steps,this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.on("msg-input:"+this.id,t=>{this.messages[this.id]=t,this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.emit("widget-load",this.id)},unmounted(){var t,s;(t=this.$socket)==null||t.off("widget-load"+this.id),(s=this.$socket)==null||s.off("msg-input:"+this.id)},methods:{}},m=["src"],h=["src"];function f(t,s,c,l,d,r){return e.openBlock(),e.createElementBlock("div",{class:"progressBarWrapper",style:e.normalizeStyle(r.templateColumns)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.steps,(i,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["progressBarStep",{currentStep:i.flowNodeId==r.activeStep,finishedStep:r.finishedSteps.includes(i.flowNodeId)}])},[i.icon&&!r.finishedSteps.includes(i.flowNodeId)?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.icon},null,8,m)):e.createCommentVNode("",!0),i.iconFinished&&r.finishedSteps.includes(i.flowNodeId)?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.iconFinished},null,8,h)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(i.label),1)],2),g!=d.steps.length-1?(e.openBlock(),e.createElementBlock("hr",{key:0,class:e.normalizeClass({coloredConnection:r.finishedSteps.includes(i.flowNodeId)})},null,2)):e.createCommentVNode("",!0)],64))),256))],4)}const u=a(p,[["render",f],["__scopeId","data-v-d9042733"]]);o.UIProcessProgressBar=u,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(".progressBarWrapper[data-v-43e20c14]{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:40px;border-radius:8px;border:2px solid #F6F5FA;background:#fff;margin-left:92px;margin-right:92px;margin-bottom:32px}.progressBarWrapper .progressBarStep[data-v-43e20c14]{display:flex;align-items:center;gap:8px;padding:16px}.progressBarWrapper .currentStep[data-v-43e20c14]{border-radius:15px;border:4px solid #8899C9}.progressBarWrapper .finishedStep[data-v-43e20c14]{border-radius:15px;background:#8899c9;color:#fff}.progressBarWrapper hr[data-v-43e20c14]{flex-grow:2;border-radius:2px;border:none;height:4px;background:#4a4759}.progressBarWrapper .coloredConnection[data-v-43e20c14]{background:#8899c9}.progressBarWrapper span[data-v-43e20c14]{font-size:21px;font-style:normal;font-weight:400;line-height:normal;white-space:nowrap}@media only screen and (max-width: 768px){.progressBarWrapper span[data-v-43e20c14]{font-size:12px}}@media only screen and (min-width: 768px){.progressBarWrapper span[data-v-43e20c14]{font-size:14px}}@media only screen and (min-width: 992px){.progressBarWrapper span[data-v-43e20c14]{font-size:16px}}@media only screen and (min-width: 1200px){.progressBarWrapper span[data-v-43e20c14]{font-size:18px}}@media only screen and (min-width: 1600px){.progressBarWrapper span[data-v-43e20c14]{font-size:21px}}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(o,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vuex"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vuex","vue"],r):(o=typeof globalThis<"u"?globalThis:o||self,r(o["ui-process-progress-bar"]={},o.vuex,o.Vue))})(this,function(o,r,e){"use strict";const a=(t,s)=>{const c=t.__vccOpts||t;for(const[l,d]of s)c[l]=d;return c},p={name:"UIProcessProgressBar",inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!0,visible:!0})}},created(){this.steps=this.props.steps},computed:{...r.mapState("data",["messages"]),stepFlowNodeIds(){return this.steps.map(t=>t.flowNodeId)},activeStep(){var t,s;return(s=(t=this.messages[this.id])==null?void 0:t.processProgressBar)==null?void 0:s.activeStep},finishedSteps(){var t,s;return((s=(t=this.messages[this.id])==null?void 0:t.processProgressBar)==null?void 0:s.finishedSteps)??[]}},data(){return{steps:[]}},mounted(){this.$socket.on("widget-load:"+this.id,t=>{this.steps=this.props.steps,this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.on("msg-input:"+this.id,t=>{this.messages[this.id]=t,this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.emit("widget-load",this.id)},unmounted(){var t,s;(t=this.$socket)==null||t.off("widget-load"+this.id),(s=this.$socket)==null||s.off("msg-input:"+this.id)},methods:{}},h={class:"progressBarWrapper"},m=["src"],f=["src"];function u(t,s,c,l,d,n){return e.openBlock(),e.createElementBlock("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.steps,(i,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["progressBarStep",{currentStep:i.flowNodeId==n.activeStep,finishedStep:n.finishedSteps.includes(i.flowNodeId)}])},[i.icon&&!n.finishedSteps.includes(i.flowNodeId)?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.icon},null,8,m)):e.createCommentVNode("",!0),i.iconFinished&&n.finishedSteps.includes(i.flowNodeId)?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.iconFinished},null,8,f)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(i.label),1)],2),k!=d.steps.length-1?(e.openBlock(),e.createElementBlock("hr",{key:0,class:e.normalizeClass({coloredConnection:n.finishedSteps.includes(i.flowNodeId)})},null,2)):e.createCommentVNode("",!0)],64))),256))])}const g=a(p,[["render",u],["__scopeId","data-v-43e20c14"]]);o.UIProcessProgressBar=g,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="progressBarWrapper" :style="templateColumns">
2
+ <div class="progressBarWrapper">
3
3
  <template v-for="(step, index) in steps">
4
4
  <div class="progressBarStep" :class="{ currentStep: step.flowNodeId == activeStep, finishedStep: finishedSteps.includes(step.flowNodeId) }">
5
5
  <img v-if="step.icon && !finishedSteps.includes(step.flowNodeId)" :src="step.icon" />
@@ -34,9 +34,6 @@ export default {
34
34
  },
35
35
  computed: {
36
36
  ...mapState('data', ['messages']),
37
- templateColumns () {
38
- return { gridTemplateColumns: new Array(this.steps.length).fill("min-content").join(" auto ")};
39
- },
40
37
  stepFlowNodeIds () {
41
38
  return this.steps.map(step => step.flowNodeId);
42
39
  },
@@ -1,5 +1,6 @@
1
1
  .progressBarWrapper {
2
- display: grid;
2
+ display: flex;
3
+ flex-wrap: wrap;
3
4
  align-items: center;
4
5
  gap: 8px;
5
6
  padding: 40px;
@@ -28,6 +29,7 @@
28
29
  }
29
30
 
30
31
  .progressBarWrapper hr {
32
+ flex-grow: 2;
31
33
  border-radius: 2px;
32
34
  border: none;
33
35
  height: 4px;
@@ -45,3 +47,33 @@
45
47
  line-height: normal;
46
48
  white-space: nowrap;
47
49
  }
50
+
51
+ @media only screen and (max-width: 768px) {
52
+ .progressBarWrapper span {
53
+ font-size: 12px;
54
+ }
55
+ }
56
+
57
+ @media only screen and (min-width: 768px) {
58
+ .progressBarWrapper span {
59
+ font-size: 14px;
60
+ }
61
+ }
62
+
63
+ @media only screen and (min-width: 992px) {
64
+ .progressBarWrapper span {
65
+ font-size: 16px;
66
+ }
67
+ }
68
+
69
+ @media only screen and (min-width: 1200px) {
70
+ .progressBarWrapper span {
71
+ font-size: 18px;
72
+ }
73
+ }
74
+
75
+ @media only screen and (min-width: 1600px) {
76
+ .progressBarWrapper span {
77
+ font-size: 21px;
78
+ }
79
+ }