@kosdev-code/kos-ddk-model-components 2.0.8 → 2.0.9
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/components/software/software.d.ts.map +1 -1
- package/index.cjs +1 -7
- package/index.js +1 -9
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/software/software.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/software/software.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ;;CA0BnB,CAAC"}
|
package/index.cjs
CHANGED
|
@@ -401,13 +401,7 @@
|
|
|
401
401
|
letter-spacing: 0.44px;
|
|
402
402
|
white-space: nowrap;
|
|
403
403
|
overflow: hidden;
|
|
404
|
-
`,Io=l.kosComponent(({setupStepContainer:e,onStepSelected:t,...n})=>{const{t:r,labelMap:s}=no({defaultNamespace:"setup",extensionPoint:B.EXTENSION_POINT_SETUP}),c=e==null?void 0:e.currentStep,d=(e==null?void 0:e.data.map(i=>o.jsxs(Po,{onPointerDown:()=>{e.setCurrentStep(i.id),t(i.id)},children:[o.jsx(a.StatusIndicator,{size:"large",status:c===i?"active":i.complete?"completed":"pending"}),o.jsx(To,{children:r(s[i.name]??i.titleKey)})]},i.id)))||[];return o.jsx(a.Sidebar,{...n,children:d})}),wr=uo(Io),jr=l.kosComponent(()=>{const{model:e}=l.useSoftwareInfo();return(e==null?void 0:e.nodes)&&e.nodes.map((t,n)=>o.jsxs(a.FrameContainer,{name:t.nodeName,children:[o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${t.kosVersion}`,tableData:[]})},"kosVersion"),Object.keys(t.group).map((r,s)=>o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:["name","version"],tableHead:r==="undefined"?"":r,tableData:t.group[r]})},s))]},n))})
|
|
405
|
-
display: flex;
|
|
406
|
-
justify-content: space-between;
|
|
407
|
-
align-items: center;
|
|
408
|
-
padding: 8px;
|
|
409
|
-
width: 100%;
|
|
410
|
-
`;const Fe=y(a.LabelInformation)`
|
|
404
|
+
`,Io=l.kosComponent(({setupStepContainer:e,onStepSelected:t,...n})=>{const{t:r,labelMap:s}=no({defaultNamespace:"setup",extensionPoint:B.EXTENSION_POINT_SETUP}),c=e==null?void 0:e.currentStep,d=(e==null?void 0:e.data.map(i=>o.jsxs(Po,{onPointerDown:()=>{e.setCurrentStep(i.id),t(i.id)},children:[o.jsx(a.StatusIndicator,{size:"large",status:c===i?"active":i.complete?"completed":"pending"}),o.jsx(To,{children:r(s[i.name]??i.titleKey)})]},i.id)))||[];return o.jsx(a.Sidebar,{...n,children:d})}),wr=uo(Io),jr=l.kosComponent(()=>{const{model:e}=l.useSoftwareInfo();return(e==null?void 0:e.nodes)&&e.nodes.map((t,n)=>o.jsxs(a.FrameContainer,{name:t.nodeName,children:[o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${t.kosVersion}`,tableData:[]})},"kosVersion"),Object.keys(t.group).map((r,s)=>o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:["name","version"],tableHead:r==="undefined"?"":r,tableData:t.group[r]})},s))]},n))}),Fe=y(a.LabelInformation)`
|
|
411
405
|
white-space: pre-wrap;
|
|
412
406
|
`,Ao=l.kosComponent(({pump:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[r,s]=u.useState("preparation-idle"),[c,d]=u.useState(),[i,p]=u.useState(),[m,x]=u.useState(),{clearFuture:g,future:h}=N(e);u.useEffect(()=>{switch(h==null?void 0:h.endState){case"CANCEL":switch(r){case"preparation-in-progress":s("preparation-idle");break;default:d("calibration-canceled"),s("failure")}break;case"SUCCESS":switch(r){case"preparation-in-progress":s("preparation-success");break;case"calibration-in-progress":s("calibration-input");break;case"verification-in-progress":s("verification-input");break}break;case"FAIL":case"ABORT":d(""),s("failure");break}},[h==null?void 0:h.endState,h==null?void 0:h.reason,r]);const b=u.useMemo(()=>({"preparation-idle":{information:o.jsx(Fe,{children:n("preparation-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>{g(),e.performPreCalibrate(),s("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:o.jsx(a.LabelInformation,{children:n("preparation-progress-info")}),footer:o.jsx(a.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:o.jsx(a.LabelInformation,{children:n("preparation-success-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>s("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:o.jsx(Fe,{children:n("calibration-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>{g(),e.performCalibrate(),s("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:o.jsx(a.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("calibration-input-info")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:f=>{f!==void 0&&p(f)},value:i!==void 0?i:""})]}),footer:o.jsx(a.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&s("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:o.jsx(Fe,{children:n("verification-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:async()=>{i!==void 0&&(g(),e.performVerify(i,h==null?void 0:h.clientData),s("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:o.jsx(a.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("verification-input-info")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:f=>{f!==void 0&&x(f)},value:m!==void 0?m:""})]}),footer:o.jsx(a.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;g();const[f,j]=await e.performComplete(i,m,h==null?void 0:h.clientData);f?(d(f),s("failure")):s("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:o.jsx(a.LabelInformation,{children:n("verification-success-info")}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:o.jsx(a.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:e.name}})}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"},failure:{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("calibration-failed")}),o.jsx(a.BodyMediumInformation,{children:n(`error.${c||"unknownError"}`)})]}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"}}),[g,c,h==null?void 0:h.clientData,t,e,n,i,m]);let v;switch(r){case"preparation-in-progress":v="preparation-progress-title";break;case"calibration-in-progress":v="calibration-progress-title";break;case"verification-in-progress":v="verification-progress-title";break;default:v="initiating"}return o.jsxs(o.Fragment,{children:[o.jsx(a.WorkflowModal,{title:n("title",{data:{ingredient:e.name}}),...b[r],onClose:()=>t()}),h&&o.jsx(F,{title:n(v),future:h})]})}),Sr=l.KosLog.createLogger({name:"state-experience"});Sr.debug("state-experience component loaded");const kr=y.div``,Pr=l.kosComponent(()=>{const{getExtensions:e}=re(),{model:t}=qe(),[n,r]=u.useState(null);return u.useEffect(()=>l.kosAutoEffect(()=>{const d=e(B.EXTENSION_POINT_TROUBLE_ACTION).reduce((g,h)=>{const b=h;return g[b.data.stateKey??b.data.troubleType]={extension:B.EXTENSION_POINT_TROUBLE_ACTION,module:b.id,namespace:b.data.namespace,title:b.data.title,stateValue:b.data.stateValue??b.data.troubleType},g},{}),i=t==null?void 0:t.activeTroubleType,p=t==null?void 0:t.activeTrouble,m=i?d[i]:void 0,x=m?o.jsx(O.DynamicComponent,{...m,props:{trouble:p}}):null;r(x)}),[e,t]),o.jsx(kr,{children:n})}),Tr=[0,6],Do=()=>{const{regionModel:e}=l.useKosRegions(),{model:t}=l.useKosTime(),[n,r]=u.useState(new Date),s=n.getFullYear(),c=l.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(e==null?void 0:e.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Tr,yearsRange:[s-10,s+10]}}),d=u.useCallback((m,x)=>{switch(m){case"year":c.dateActions.setYear(x.id);break;case"month":c.dateActions.setMonth(x.id);break;case"day":c.dateActions.setDay(x.id);break}},[c.dateActions]),i=u.useCallback(()=>{c.dateActions.setYear(n.getFullYear()),c.dateActions.setMonth(n.getMonth()),c.dateActions.setDay(n.getDate())},[n,c.dateActions]),p=u.useCallback(async({day:m,month:x,year:g})=>{c.dateActions.setYear(g),c.dateActions.setMonth(x),c.dateActions.setDay(m),await(t==null?void 0:t.updateSystemDate({day:m,month:x,year:g})),r(new Date)},[c.dateActions,t]);return o.jsx(Yt,{onDiscard:i,onChange:d,onSave:p})},Fo=l.kosComponent(({...e})=>{var i;const{regionModel:t}=l.useKosRegions(),{model:n}=l.useKosTime(),{t:r}=l.useKosTranslation("common"),s=t==null?void 0:t.allTimeZones.map(p=>({id:p,label:p.replace(/_/g," ")})),c=(i=t==null?void 0:t.timeZones)==null?void 0:i.map(p=>({id:p,label:p.replace(/_/g," ")})),d=[{id:"region",label:r("suggested"),items:c||[]},{id:"all",label:r("all"),items:s||[]}];return o.jsx(a.SwitchPickerCard,{...e,label:r("time-zone"),data:d,displayValue:(n==null?void 0:n.timezone).replace("_"," "),loop:!1,selectedItemId:n==null?void 0:n.timezone,onSave:n==null?void 0:n.updateSystemTimezone,closeButtonLabel:r("close","Close")||void 0,cancelButtonLabel:r("discard-changes","Discard Changes")||void 0,proceedButtonLabel:r("save","Save")||void 0})}),Ir=l.kosComponent(({showHeading:e})=>{var b,v,f,j,T,P,w,S;const{t}=l.useKosTranslation("region"),{regionModel:n}=l.useKosRegions(),{model:r}=l.useKosTime(),{amPmOptions:s,formattedTime:c,hourOptions:d,minuteOptions:i,setTime:p,time:m}=l.useRegionTimeProps(),x=m.getHours(),g=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x<12?x:x-12,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0},{id:"ampm",items:s,selectedItemId:x<12?"AM":"PM"}],[s,d,i,m,x]),h=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0}],[d,i,m,x]);return u.useEffect(()=>{const C=setInterval(()=>{p(new Date)},3e4);return()=>{clearInterval(C)}},[p]),o.jsxs(a.TabContainer,{children:[e&&o.jsx(a.SettingsSubheading,{children:t("time-settings","Time Settings")}),((b=n==null?void 0:n.dateFormatOptions)==null?void 0:b.length)&&o.jsx(a.SwitchCard,{label:t("date-format","Date Format"),value:(f=(v=n==null?void 0:n.dateFormatOptions)==null?void 0:v.find(C=>C.format===n.selectedDateFormat))==null?void 0:f.id,options:(j=n==null?void 0:n.dateFormatOptions)==null?void 0:j.map(C=>({label:C.format.toUpperCase(),...C})),onChange:C=>C&&(n==null?void 0:n.setSelectedDateFormat(String(C)))}),o.jsx(Do,{}),o.jsx(Fo,{}),((T=n==null?void 0:n.timeFormatOptions)==null?void 0:T.length)&&o.jsx(a.SwitchCard,{label:t("time-format","Time Format"),value:(w=(P=n==null?void 0:n.timeFormatOptions)==null?void 0:P.find(C=>C.format===n.selectedTimeFormat))==null?void 0:w.id,options:(S=n==null?void 0:n.timeFormatOptions)==null?void 0:S.map(C=>({label:C!=null&&C.ampm?"12 HR":"24 HR",...C})).reverse(),onChange:C=>C&&(n==null?void 0:n.setSelectedTimeFormat(String(C)))}),o.jsx(a.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?g:h,icon:U.TimeIcon,displayValue:c,label:t("current-time","Current Time"),closeButtonLabel:t("close","Close")||void 0,cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,proceedButtonLabel:t("save","Save")||void 0,onSave:C=>{const D=n!=null&&n.is12HourTimeFormat?C.ampm==="AM"?C.hr:C.hr+12:C.hr,E=C.min,A=new Date(m);A.setHours(D),A.setMinutes(E),p(A),r==null||r.updateSystemTime({hour:D,min:E,sec:0})}})]})}),Ar=ze(l.kosComponent(({settings:e,showHeading:t})=>{const{t:n}=l.useKosTranslation("dispenser-profile");return o.jsxs(a.TabContainer,{children:[t&&o.jsx(a.SettingsSubheading,{children:n("water-settings","Water Settings")}),o.jsx(te,{label:n("plain-water","Plain Water"),configProperty:e.hidePlainWaterBev}),o.jsx(te,{label:n("carbonated-water","Carbonated Water"),configProperty:e.hideCarbWaterBev})]})})),Dr=y.div`
|
|
413
407
|
display: flex;
|
package/index.js
CHANGED
|
@@ -3705,15 +3705,7 @@ const Ws = y.div`
|
|
|
3705
3705
|
}
|
|
3706
3706
|
) }, r))
|
|
3707
3707
|
] }, n));
|
|
3708
|
-
})
|
|
3709
|
-
y.div`
|
|
3710
|
-
display: flex;
|
|
3711
|
-
justify-content: space-between;
|
|
3712
|
-
align-items: center;
|
|
3713
|
-
padding: 8px;
|
|
3714
|
-
width: 100%;
|
|
3715
|
-
`;
|
|
3716
|
-
const Qe = y(F)`
|
|
3708
|
+
}), Qe = y(F)`
|
|
3717
3709
|
white-space: pre-wrap;
|
|
3718
3710
|
`, mi = I(
|
|
3719
3711
|
({ pump: e, onComplete: t }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ddk-model-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"kos": {
|
|
21
21
|
"build": {
|
|
22
|
-
"gitHash": "
|
|
22
|
+
"gitHash": "0d2f69d67b07f4d9d616441a9e794f31f22504c6"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|