@kosdev-code/kos-ddk-model-components 3.0.5 → 3.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AA6BxC,UAAU,KAAK;IACb,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AA+CD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAqQrD,CAAC"}
1
+ {"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AA6BxC,UAAU,KAAK;IACb,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AA+CD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAsQrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"macro-holder-card.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/holders/macro-holder-card.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAuHpE,UAAU,oBAAoB;IAC5B,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAID,eAAO,MAAM,eAAe,2DAMvB,oBAAoB;;CA+IxB,CAAC"}
1
+ {"version":3,"file":"macro-holder-card.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/holders/macro-holder-card.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAwHpE,UAAU,oBAAoB;IAC5B,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAID,eAAO,MAAM,eAAe,2DAMvB,oBAAoB;;CAoKxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"remote-nns-modal.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/remote-nns-modal/remote-nns-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAcxC,UAAU,mBAAoB,SAAQ,eAAe;IACnD,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,gCACI,mBAAmB;;CAqLjD,CAAC"}
1
+ {"version":3,"file":"remote-nns-modal.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/remote-nns-modal/remote-nns-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAcxC,UAAU,mBAAoB,SAAQ,eAAe;IACnD,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,gCACI,mBAAmB;;CAoLjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"replace-pump.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/replace-pump/replace-pump.tsx"],"names":[],"mappings":"AACA,OAAO,EAUL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAuB/D,UAAU,gBAAiB,SAAQ,eAAe;IAChD,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,0BACC,gBAAgB;;CAuGxC,CAAC"}
1
+ {"version":3,"file":"replace-pump.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/replace-pump/replace-pump.tsx"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAc/D,UAAU,gBAAiB,SAAQ,eAAe;IAChD,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,WAAW,0BACC,gBAAgB;;CAuGxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"setup-sidebar.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/setup-sidebar/setup-sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EAEb,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,uBAAuB,EAExB,MAAM,kCAAkC,CAAC;AAE1C,eAAO,MAAM,QAAQ;;;qFAKpB,CAAC;AAEF,eAAO,MAAM,SAAS;;;qFASrB,CAAC;AAEF,KAAK,iBAAiB,GAAG,YAAY,GACnC,uBAAuB,GAAG;IAAE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAAC;AAEzE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CA+BpE,CAAC;AAEL,eAAO,MAAM,YAAY,4GAA2C,CAAC"}
1
+ {"version":3,"file":"setup-sidebar.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/setup-sidebar/setup-sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EAEb,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,uBAAuB,EAExB,MAAM,kCAAkC,CAAC;AAE1C,eAAO,MAAM,QAAQ;;;qFAMpB,CAAC;AAEF,eAAO,MAAM,SAAS;;;qFASrB,CAAC;AAEF,KAAK,iBAAiB,GAAG,YAAY,GACnC,uBAAuB,GAAG;IAAE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAAC;AAEzE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CA+BpE,CAAC;AAEL,eAAO,MAAM,YAAY,4GAA2C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './input-step';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ddk-model-components/src/components/spm-field-calibration/input-step/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface InputStepProps {
2
+ fixed?: number;
3
+ min?: number;
4
+ max?: number;
5
+ step?: number;
6
+ value: number;
7
+ onChange: (value: number) => void;
8
+ }
9
+ export declare const InputStep: ({ fixed, step, min, max, value, onChange, }: InputStepProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=input-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-step.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ddk-model-components/src/components/spm-field-calibration/input-step/input-step.tsx"],"names":[],"mappings":"AA+BA,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,SAAS,GAAI,6CAOvB,cAAc,qDAsBhB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"spm-field-calibration-modal.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/spm-field-calibration/spm-field-calibration-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA4BnE,UAAU,6BAA8B,SAAQ,eAAe;IAC7D,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,wBAAwB,0BACZ,6BAA6B;;CA4TrD,CAAC"}
1
+ {"version":3,"file":"spm-field-calibration-modal.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ddk-model-components/src/components/spm-field-calibration/spm-field-calibration-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA4BnE,UAAU,6BAA8B,SAAQ,eAAe;IAC7D,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,wBAAwB,0BACZ,6BAA6B;;CAuYrD,CAAC"}
package/index.cjs CHANGED
@@ -215,7 +215,7 @@ class GenericTroubleAction extends TroubleAction {
215
215
  }
216
216
  const TROUBLE_PRIME = "PrimeTrouble";
217
217
  const TROUBLE_PURGE = "PurgeTrouble";
218
- const Container$4 = styled.div`
218
+ const Container$3 = styled.div`
219
219
  display: flex;
220
220
  flex-direction: column;
221
221
  overflow-y: auto;
@@ -235,7 +235,7 @@ const AgitatorModal = kosUiSdk.kosComponent(
235
235
  contain: componentModeOverride !== "compact",
236
236
  onClosed: onComplete,
237
237
  show: !closing,
238
- children: /* @__PURE__ */ jsxRuntime.jsxs(Container$4, { children: [
238
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Container$3, { children: [
239
239
  /* @__PURE__ */ jsxRuntime.jsx(
240
240
  kosDdkComponents.Header,
241
241
  {
@@ -560,7 +560,7 @@ const CalibrateModal = kosUiSdk.kosComponent(
560
560
  setState("failure");
561
561
  break;
562
562
  }
563
- }, [future?.endState, future?.reason, state]);
563
+ }, [future, future?.endState, future?.reason, state]);
564
564
  const workflow = React.useMemo(() => {
565
565
  return {
566
566
  "high-flow-test-idle": {
@@ -711,7 +711,7 @@ const CalibrateModal = kosUiSdk.kosComponent(
711
711
  failure: {
712
712
  information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
713
713
  /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-failed") }),
714
- /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.BodyMediumInformation, { children: t(`error.${error || "unknownError"}`) })
714
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.BodyMediumInformation, { children: t(`error.${error}`) })
715
715
  ] }),
716
716
  footer: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("exit-calibration") }),
717
717
  status: "error"
@@ -6948,8 +6948,8 @@ const HolderCard = kosUiSdk.kosComponent(
6948
6948
  const data = useTroubleData(troubleModel);
6949
6949
  const hasFuelGuage = holder.hasFuelGuage;
6950
6950
  const fillPercent = holder.fillPercent;
6951
- const holderColor = holder.removed ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : disabled ? "var(--ddk-generic-color-grey-50)" : hasTroubles ? `${troubleModel?.color}` : assigned ? void 0 : "var(--ddk-component-dashboard-card-background-color-unassigned)";
6952
- const holderHeaderColor = holder.removed ? "var(--ddk-component-dashboard-card-header-background-color)" : void 0;
6951
+ const holderColor = holder.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : disabled ? "var(--ddk-component-dashboard-card-background-color-disabled)" : hasTroubles ? `${troubleModel?.color}` : holder.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0;
6952
+ const holderHeaderColor = !isCompact && holder.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0;
6953
6953
  const isLight = isLightColor$1(holderColor);
6954
6954
  const fontColor = disabled ? "white" : holder.unassigned ? "var(--ddk-generic-color-grey-30)" : hasTroubles ? getFontColor$1(isLight) : assigned ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)";
6955
6955
  const footerFontColor = disabled ? "white" : hasTroubles ? getFooterFontColor(isLight, holder) : assigned ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)";
@@ -7134,7 +7134,7 @@ const HolderGroupView = kosUiSdk.kosComponent(
7134
7134
  const log$1 = kosUiSdk.KosLog.createLogger({ name: "holder-group-view" });
7135
7135
  log$1.debug("holder-group-view component loaded");
7136
7136
  const EXCLUDE_MACROS = ["water", "carb", "ns", "nns"];
7137
- const Container$3 = styled.div`
7137
+ const Container$2 = styled.div`
7138
7138
  display: flex;
7139
7139
  flex-direction: column;
7140
7140
  overflow-y: auto;
@@ -7208,9 +7208,10 @@ const MacroHolderCard = kosUiSdk.kosComponent(
7208
7208
  const troubleCount = visibleTroubles?.length ?? 0;
7209
7209
  const troubleModel = visibleTroubles?.[0];
7210
7210
  const hasTroubles = visibleTroubles ? visibleTroubles.length > 0 : false;
7211
- const holderColor = hasTroubles ? `${troubleModel?.color}` : void 0;
7211
+ const holderColor = holder.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : hasTroubles ? `${troubleModel?.color}` : holder.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0;
7212
+ const holderHeaderColor = !isCompact && holder.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0;
7212
7213
  const isLight = isLightColor(holderColor);
7213
- const fontColor = hasTroubles ? getFontColor(isLight) : assigned ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)";
7214
+ const fontColor = holder.unassigned ? "var(--ddk-generic-color-grey-30)" : hasTroubles ? getFontColor(isLight) : assigned ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)";
7214
7215
  const abbreviatedName = kosDdkComponents.useAbbreviation(
7215
7216
  holder.name,
7216
7217
  componentModeOverride === "compact"
@@ -7227,8 +7228,8 @@ const MacroHolderCard = kosUiSdk.kosComponent(
7227
7228
  const key = kosUiSdk.ExtensionManager.executeDashboardKeyFactory(holder) || "";
7228
7229
  const exts = getExtensions(DashboardPumpDetailExtension.id);
7229
7230
  const details = exts.filter((ext) => !!ext.data).reduce((acc, ext) => {
7230
- const data = ext.data;
7231
- acc[data.dashboardKey] = ext.data;
7231
+ const data2 = ext.data;
7232
+ acc[data2.dashboardKey] = ext.data;
7232
7233
  return acc;
7233
7234
  }, {});
7234
7235
  const hasExtension = !!details[key];
@@ -7246,7 +7247,11 @@ const MacroHolderCard = kosUiSdk.kosComponent(
7246
7247
  );
7247
7248
  const MainContent = HolderContent ? /* @__PURE__ */ jsxRuntime.jsx(HolderContent, { holder, onComplete: () => setShowModal(false) }) : hasExtension && DashboardPumpDetailComponent ? /* @__PURE__ */ jsxRuntime.jsx(DashboardPumpDetailComponent, { module: details[key]?.id, holder }) : null;
7248
7249
  const troubleLabels = troubleLabelFactory(troubleModel);
7249
- const footer = hasTroubles ? /* @__PURE__ */ jsxRuntime.jsx(Footer$2, { color: fontColor, children: t(troubleLabels.summary) }) : null;
7250
+ const data = useTroubleData(troubleModel);
7251
+ const footer = hasTroubles ? /* @__PURE__ */ jsxRuntime.jsx(Footer$2, { color: fontColor, children: t(troubleLabels.summary, {
7252
+ context: troubleModel?.deferred ? "queued" : void 0,
7253
+ data
7254
+ }) }) : null;
7250
7255
  const handleCardSelect = React.useCallback(() => {
7251
7256
  if (holder.sortedPumps.length > 0) {
7252
7257
  if (role === "technician") {
@@ -7263,6 +7268,7 @@ const MacroHolderCard = kosUiSdk.kosComponent(
7263
7268
  kosDdkComponents.HolderDashboardCard,
7264
7269
  {
7265
7270
  avatar,
7271
+ headerBackgroundColor: holderHeaderColor,
7266
7272
  backgroundColor: holderColor,
7267
7273
  body: hasTroubles ? null : macroSummaryContent,
7268
7274
  footer,
@@ -7281,7 +7287,7 @@ const MacroHolderCard = kosUiSdk.kosComponent(
7281
7287
  ...modalOptions,
7282
7288
  show: showModal,
7283
7289
  onClose: () => setShowModal(false),
7284
- children: /* @__PURE__ */ jsxRuntime.jsxs(Container$3, { children: [
7290
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Container$2, { children: [
7285
7291
  /* @__PURE__ */ jsxRuntime.jsx(
7286
7292
  kosDdkComponents.Header,
7287
7293
  {
@@ -8283,7 +8289,7 @@ const WaterPumpCard = kosUiSdk.kosComponent(
8283
8289
  ] });
8284
8290
  }
8285
8291
  );
8286
- const Container$2 = styled.section`
8292
+ const Container$1 = styled.section`
8287
8293
  align-items: center;
8288
8294
  display: flex;
8289
8295
  flex-direction: column;
@@ -8326,7 +8332,7 @@ const RebootView = ({ onComplete }) => {
8326
8332
  CloseButton: kosDdkComponents.CompactCloseButton
8327
8333
  }
8328
8334
  ),
8329
- /* @__PURE__ */ jsxRuntime.jsxs(Container$2, { children: [
8335
+ /* @__PURE__ */ jsxRuntime.jsxs(Container$1, { children: [
8330
8336
  /* @__PURE__ */ jsxRuntime.jsxs(Content, { children: [
8331
8337
  /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.QuestionIconStyle, {}),
8332
8338
  /* @__PURE__ */ jsxRuntime.jsx(TextContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.UtilityModalHeading, { children: t("modal-heading", "Are you sure you want to reboot dispenser?") }) })
@@ -8357,10 +8363,13 @@ const RemoteNNSModal = kosUiSdk.kosComponent(
8357
8363
  const holder = remoteTray.holder;
8358
8364
  const pumps = holder.pumps.data.filter((pump) => pump.childPump);
8359
8365
  const disabling = remoteTray.remoteTrayEnabled.value === true;
8360
- const readyToSubmit = () => pumps.every((pump) => {
8361
- const value = pumpCodes[pump.name];
8362
- return value !== void 0 && value !== null && value !== "";
8363
- });
8366
+ const readyToSubmit = React.useCallback(
8367
+ () => pumps.every((pump) => {
8368
+ const value = pumpCodes[pump.name];
8369
+ return value !== void 0 && value !== null && value !== "";
8370
+ }),
8371
+ [pumpCodes, pumps]
8372
+ );
8364
8373
  const changePumpCode = React.useCallback((pumpName, pumpCode) => {
8365
8374
  setPumpCodes((pumpCodes2) => {
8366
8375
  return { ...pumpCodes2, [pumpName]: pumpCode };
@@ -8410,13 +8419,7 @@ const RemoteNNSModal = kosUiSdk.kosComponent(
8410
8419
  } else {
8411
8420
  setState("pump");
8412
8421
  }
8413
- }, [
8414
- disabling,
8415
- pumpCodes,
8416
- pumps,
8417
- remoteTray.remoteTrayEnabled,
8418
- toggleRemoteTray
8419
- ]);
8422
+ }, [pumpCodes, pumps, toggleRemoteTray]);
8420
8423
  const workflow = React.useMemo(() => {
8421
8424
  return {
8422
8425
  idle: {
@@ -8475,14 +8478,16 @@ const RemoteNNSModal = kosUiSdk.kosComponent(
8475
8478
  }
8476
8479
  };
8477
8480
  }, [
8478
- changePumpCode,
8479
8481
  disabling,
8482
+ handlePumpCodeChange,
8480
8483
  onComplete,
8481
8484
  pumpCodes,
8482
8485
  pumpErrors,
8483
8486
  pumps,
8487
+ readyToSubmit,
8484
8488
  submit,
8485
- t
8489
+ t,
8490
+ toggleRemoteTray
8486
8491
  ]);
8487
8492
  return /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.WorkflowModal, { ...workflow[state], onClose: () => onComplete() });
8488
8493
  }
@@ -8530,14 +8535,6 @@ const ReplaceLine = kosUiSdk.kosComponent(
8530
8535
  return /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.StatusBar, { show: status !== void 0, onClose: close, children: status === "failure" ? /* @__PURE__ */ jsxRuntime.jsx(FailureMessage, { children: t(error || "unknownError") }) : status === "success" ? /* @__PURE__ */ jsxRuntime.jsx(SuccessMessage, { children: t("success") }) : null });
8531
8536
  }
8532
8537
  );
8533
- const Container$1 = styled.div`
8534
- display: flex;
8535
- flex-direction: column;
8536
- overflow-y: auto;
8537
- overflow-x: hidden;
8538
- gap: 32px;
8539
- height: 100%;
8540
- `;
8541
8538
  const ReplacePump = kosUiSdk.kosComponent(
8542
8539
  ({ pump, onComplete }) => {
8543
8540
  const [closing, setClosing] = React.useState(false);
@@ -8583,7 +8580,7 @@ const ReplacePump = kosUiSdk.kosComponent(
8583
8580
  contain: componentModeOverride !== "compact",
8584
8581
  onClosed: onComplete,
8585
8582
  show: !closing,
8586
- children: /* @__PURE__ */ jsxRuntime.jsxs(Container$1, { children: [
8583
+ children: /* @__PURE__ */ jsxRuntime.jsxs(kosDdkComponents.ModalContainer, { children: [
8587
8584
  /* @__PURE__ */ jsxRuntime.jsx(
8588
8585
  kosDdkComponents.Header,
8589
8586
  {
@@ -8788,15 +8785,16 @@ const StepItem = styled.div`
8788
8785
  display: flex;
8789
8786
  gap: 8px;
8790
8787
  align-items: center;
8788
+ padding: var(--ddk-component-setup-sidebar-step-item-padding);
8791
8789
  `;
8792
8790
  const StepTitle = styled.div`
8793
- color: var(--ddk-generic-color-grey-100, #171717);
8794
- font-size: var(--ddk-component-sidebar-font-size-medium);
8795
- font-style: normal;
8796
- font-weight: 600;
8797
- line-height: 135%;
8798
- letter-spacing: 0.44px;
8799
- white-space: nowrap;
8791
+ color: var(--ddk-component-step-title-color);
8792
+ font-size: var(--ddk-component-step-title-font-weight);
8793
+ font-style: var(--ddk-component-step-title-font-weight);
8794
+ font-weight: var(--ddk-component-step-title-font-weight);
8795
+ line-height: var(--ddk-component-step-title-line-height);
8796
+ letter-spacing: var(--ddk-component-step-title-letter-spacing);
8797
+ white-space: var(--ddk-component-step-title-white-space);
8800
8798
  overflow: hidden;
8801
8799
  `;
8802
8800
  const SetupSidebarComp = kosUiSdk.kosComponent(({ setupStepContainer, onStepSelected, ...props }) => {
@@ -8851,9 +8849,55 @@ const Software = kosUiSdk.kosComponent(() => {
8851
8849
  ) }, index2))
8852
8850
  ] }, index));
8853
8851
  });
8854
- const LabelInformationPreformatted = styled(kosDdkComponents.LabelInformation)`
8855
- white-space: pre-wrap;
8852
+ const InputStepContainer = styled.div`
8853
+ align-items: center;
8854
+ display: flex;
8855
+ gap: 32px;
8856
+ width: 100%;
8857
+ `;
8858
+ const ValueContainer = styled(kosDdkComponents.HeadingExtraLarge)`
8859
+ border-bottom: 1px solid var(--ddk-semantic-control-border-color-default);
8860
+ border-top: 1px solid var(--ddk-semantic-control-border-color-default);
8861
+ color: var(--ddk-semantic-control-color-default);
8862
+ display: flex;
8863
+ flex: 1;
8864
+ justify-content: center;
8865
+ padding: 24px 0;
8866
+ `;
8867
+ const IconButton = styled(kosDdkComponents.Button)`
8868
+ font-size: var(--ddk-component-input-step-font-size);
8869
+ font-weight: var(--ddk-component-input-step-font-weight);
8870
+ width: var(--ddk-component-input-step-button-width);
8871
+ height: var(--ddk-component-input-step-button-height);
8872
+ min-width: var(--ddk-component-input-step-button-width);
8873
+ min-height: var(--ddk-component-input-step-button-height);
8874
+ border-radius: var(--ddk-component-input-step-button-border-radius);
8856
8875
  `;
8876
+ const InputStep = ({
8877
+ fixed = 1,
8878
+ step = 0.1,
8879
+ min = 0,
8880
+ max = 100,
8881
+ value,
8882
+ onChange
8883
+ }) => {
8884
+ const increase = React.useCallback(() => {
8885
+ let nextValue = value + step;
8886
+ if (nextValue > max) nextValue = max;
8887
+ onChange(nextValue);
8888
+ }, [max, onChange, step, value]);
8889
+ const decrease = React.useCallback(() => {
8890
+ let nextValue = value - step;
8891
+ if (nextValue < min) nextValue = min;
8892
+ onChange(nextValue);
8893
+ }, [min, onChange, step, value]);
8894
+ return /* @__PURE__ */ jsxRuntime.jsxs(InputStepContainer, { children: [
8895
+ /* @__PURE__ */ jsxRuntime.jsx(IconButton, { onPointerDown: decrease, children: "-" }),
8896
+ /* @__PURE__ */ jsxRuntime.jsx(ValueContainer, { children: value.toFixed(fixed) }),
8897
+ /* @__PURE__ */ jsxRuntime.jsx(IconButton, { onPointerDown: increase, children: "+" })
8898
+ ] });
8899
+ };
8900
+ const DEFAULT_CALIBRATION_VALUE = 8;
8857
8901
  const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
8858
8902
  ({ pump, onComplete }) => {
8859
8903
  const { t } = kosUiSdk.useKosTranslation("common", {
@@ -8863,6 +8907,12 @@ const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
8863
8907
  const [error, setError] = React.useState();
8864
8908
  const [volume1, setVolume1] = React.useState();
8865
8909
  const [volume2, setVolume2] = React.useState();
8910
+ const { calibrateVolume } = usePumpCalibration(pump);
8911
+ React.useEffect(() => {
8912
+ if (!calibrateVolume) return;
8913
+ if (volume1 === void 0) setVolume1(calibrateVolume.toString());
8914
+ if (volume2 === void 0) setVolume2(calibrateVolume.toString());
8915
+ }, [calibrateVolume, volume1, volume2]);
8866
8916
  const { clearFuture, future } = useFutureContainer(pump);
8867
8917
  React.useEffect(() => {
8868
8918
  switch (future?.endState) {
@@ -8899,19 +8949,28 @@ const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
8899
8949
  const workflow = React.useMemo(() => {
8900
8950
  return {
8901
8951
  "preparation-idle": {
8902
- information: /* @__PURE__ */ jsxRuntime.jsx(LabelInformationPreformatted, { children: t("preparation-idle-info") }),
8903
- footer: /* @__PURE__ */ jsxRuntime.jsx(
8904
- kosDdkComponents.Button,
8905
- {
8906
- onPointerDown: () => {
8907
- clearFuture();
8908
- pump.performPreCalibrate();
8909
- setState("preparation-in-progress");
8910
- },
8911
- children: t("preparation-action")
8912
- }
8913
- ),
8914
- status: "information"
8952
+ information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8953
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("preparation-idle-step") }),
8954
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InfoMessage, { children: t("preparation-idle-alert") }),
8955
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InstructionCard, { children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { children: [
8956
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: t("preparation-idle-info-1") }),
8957
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: t("preparation-idle-info-2") })
8958
+ ] }) })
8959
+ ] }),
8960
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8961
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("cancel") }),
8962
+ /* @__PURE__ */ jsxRuntime.jsx(
8963
+ kosDdkComponents.Button,
8964
+ {
8965
+ onPointerDown: () => {
8966
+ clearFuture();
8967
+ pump.performPreCalibrate();
8968
+ setState("preparation-in-progress");
8969
+ },
8970
+ children: t("preparation-action")
8971
+ }
8972
+ )
8973
+ ] })
8915
8974
  },
8916
8975
  "preparation-in-progress": {
8917
8976
  information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("preparation-progress-info") }),
@@ -8925,19 +8984,25 @@ const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
8925
8984
  },
8926
8985
  "preparation-failed": {},
8927
8986
  "calibration-idle": {
8928
- information: /* @__PURE__ */ jsxRuntime.jsx(LabelInformationPreformatted, { children: t("calibration-idle-info") }),
8929
- footer: /* @__PURE__ */ jsxRuntime.jsx(
8930
- kosDdkComponents.Button,
8931
- {
8932
- onPointerDown: () => {
8933
- clearFuture();
8934
- pump.performCalibrate();
8935
- setState("calibration-in-progress");
8936
- },
8937
- children: t("calibrate")
8938
- }
8939
- ),
8940
- status: "information"
8987
+ information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8988
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-idle-step") }),
8989
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InfoMessage, { children: t("calibration-idle-alert") }),
8990
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InstructionCard, { children: t("calibration-idle-info-1") })
8991
+ ] }),
8992
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8993
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("cancel") }),
8994
+ /* @__PURE__ */ jsxRuntime.jsx(
8995
+ kosDdkComponents.Button,
8996
+ {
8997
+ onPointerDown: () => {
8998
+ clearFuture();
8999
+ pump.performCalibrate();
9000
+ setState("calibration-in-progress");
9001
+ },
9002
+ children: t("calibrate")
9003
+ }
9004
+ )
9005
+ ] })
8941
9006
  },
8942
9007
  "calibration-in-progress": {
8943
9008
  information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-progress-info") }),
@@ -8947,49 +9012,64 @@ const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
8947
9012
  information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8948
9013
  /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-input-info") }),
8949
9014
  /* @__PURE__ */ jsxRuntime.jsx(
8950
- kosDdkComponents.InputCard,
9015
+ InputStep,
8951
9016
  {
8952
- label: "Volume",
8953
- unitValue: "ml",
8954
- layout: "num",
8955
9017
  onChange: (value) => {
8956
- if (value === void 0) return;
8957
- setVolume1(value);
9018
+ setVolume1(value.toString());
8958
9019
  },
8959
- value: volume1 !== void 0 ? volume1 : ""
9020
+ value: volume1 !== void 0 ? Number(volume1) : DEFAULT_CALIBRATION_VALUE
8960
9021
  }
8961
9022
  )
8962
9023
  ] }),
8963
- footer: /* @__PURE__ */ jsxRuntime.jsx(
8964
- kosDdkComponents.Button,
8965
- {
8966
- disabled: volume1 === void 0,
8967
- onPointerDown: () => {
8968
- if (volume1 === void 0) return;
8969
- setState("verification-idle");
8970
- },
8971
- children: t("proceed")
8972
- }
8973
- ),
9024
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9025
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("cancel") }),
9026
+ /* @__PURE__ */ jsxRuntime.jsx(
9027
+ kosDdkComponents.Button,
9028
+ {
9029
+ disabled: volume1 === void 0,
9030
+ onPointerDown: () => {
9031
+ if (volume1 === void 0) return;
9032
+ setState("calibration-input-confirmation");
9033
+ },
9034
+ children: t("proceed")
9035
+ }
9036
+ )
9037
+ ] })
9038
+ },
9039
+ "calibration-input-confirmation": {
9040
+ information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-confirm-info", {
9041
+ data: { volume: Number(volume1).toFixed(1) }
9042
+ }) }),
9043
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9044
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: () => setState("calibration-input"), children: t("go-back") }),
9045
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: () => setState("verification-idle"), children: t("confirm-and-proceed") })
9046
+ ] }),
8974
9047
  status: "information"
8975
9048
  },
8976
- // Todo: calibration-input-confirmation if necessary...
8977
- "calibration-input-confirmation": {},
8978
9049
  "verification-idle": {
8979
- information: /* @__PURE__ */ jsxRuntime.jsx(LabelInformationPreformatted, { children: t("verification-idle-info") }),
8980
- footer: /* @__PURE__ */ jsxRuntime.jsx(
8981
- kosDdkComponents.Button,
8982
- {
8983
- onPointerDown: async () => {
8984
- if (volume1 === void 0) return;
8985
- clearFuture();
8986
- pump.performVerify(volume1, future?.clientData);
8987
- setState("verification-in-progress");
8988
- },
8989
- children: t("initiate-verification-pour")
8990
- }
8991
- ),
8992
- status: "information"
9050
+ information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9051
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("verification-idle-step") }),
9052
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InfoMessage, { children: t("verification-idle-alert") }),
9053
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.InstructionCard, { children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { children: [
9054
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: t("verification-idle-info-1") }),
9055
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: t("verification-idle-info-2") })
9056
+ ] }) })
9057
+ ] }),
9058
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9059
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("cancel") }),
9060
+ /* @__PURE__ */ jsxRuntime.jsx(
9061
+ kosDdkComponents.Button,
9062
+ {
9063
+ onPointerDown: async () => {
9064
+ if (volume1 === void 0) return;
9065
+ clearFuture();
9066
+ pump.performVerify(volume1, future?.clientData);
9067
+ setState("verification-in-progress");
9068
+ },
9069
+ children: t("initiate-verification-pour")
9070
+ }
9071
+ )
9072
+ ] })
8993
9073
  },
8994
9074
  "verification-in-progress": {
8995
9075
  information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("verification-progress-info") }),
@@ -9000,45 +9080,59 @@ const SPMFieldCalibrationModal = kosUiSdk.kosComponent(
9000
9080
  information: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9001
9081
  /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("verification-input-info") }),
9002
9082
  /* @__PURE__ */ jsxRuntime.jsx(
9003
- kosDdkComponents.InputCard,
9083
+ InputStep,
9004
9084
  {
9005
- label: "Volume",
9006
- unitValue: "ml",
9007
- layout: "num",
9008
9085
  onChange: (value) => {
9009
- if (value === void 0) return;
9010
- setVolume2(value);
9086
+ setVolume2(value.toString());
9011
9087
  },
9012
- value: volume2 !== void 0 ? volume2 : ""
9088
+ value: volume2 !== void 0 ? Number(volume2) : DEFAULT_CALIBRATION_VALUE
9089
+ }
9090
+ )
9091
+ ] }),
9092
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9093
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("cancel") }),
9094
+ /* @__PURE__ */ jsxRuntime.jsx(
9095
+ kosDdkComponents.Button,
9096
+ {
9097
+ disabled: volume2 === void 0,
9098
+ onPointerDown: async () => {
9099
+ setState("verification-input-confirmation");
9100
+ },
9101
+ children: t("proceed")
9102
+ }
9103
+ )
9104
+ ] })
9105
+ },
9106
+ "verification-input-confirmation": {
9107
+ information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("calibration-confirm-info", {
9108
+ data: { volume: Number(volume2).toFixed(1) }
9109
+ }) }),
9110
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9111
+ /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: () => setState("verification-input"), children: t("go-back") }),
9112
+ /* @__PURE__ */ jsxRuntime.jsx(
9113
+ kosDdkComponents.Button,
9114
+ {
9115
+ onPointerDown: async () => {
9116
+ if (volume1 === void 0 || volume2 === void 0) return;
9117
+ clearFuture();
9118
+ const [error2, data] = await pump.performComplete(
9119
+ volume1,
9120
+ volume2,
9121
+ future?.clientData
9122
+ );
9123
+ if (error2) {
9124
+ setError(error2);
9125
+ setState("failure");
9126
+ } else {
9127
+ setState("verification-success");
9128
+ }
9129
+ },
9130
+ children: t("confirm-and-proceed")
9013
9131
  }
9014
9132
  )
9015
9133
  ] }),
9016
- footer: /* @__PURE__ */ jsxRuntime.jsx(
9017
- kosDdkComponents.Button,
9018
- {
9019
- disabled: volume2 === void 0,
9020
- onPointerDown: async () => {
9021
- if (volume1 === void 0 || volume2 === void 0) return;
9022
- clearFuture();
9023
- const [error2, data] = await pump.performComplete(
9024
- volume1,
9025
- volume2,
9026
- future?.clientData
9027
- );
9028
- if (error2) {
9029
- setError(error2);
9030
- setState("failure");
9031
- } else {
9032
- setState("verification-success");
9033
- }
9034
- },
9035
- children: t("proceed")
9036
- }
9037
- ),
9038
9134
  status: "information"
9039
9135
  },
9040
- // Todo: verification-input-confirmation if necessary...
9041
- "verification-input-confirmation": {},
9042
9136
  "verification-success": {
9043
9137
  information: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.LabelInformation, { children: t("verification-success-info") }),
9044
9138
  footer: /* @__PURE__ */ jsxRuntime.jsx(kosDdkComponents.Button, { onPointerDown: onComplete, children: t("exit-calibration") }),