@adcops/autocore-react 3.3.87 → 3.3.90

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.
Files changed (112) hide show
  1. package/dist/assets/AxisC.d.ts +4 -0
  2. package/dist/assets/AxisC.d.ts.map +1 -0
  3. package/dist/assets/AxisC.js +1 -0
  4. package/dist/assets/AxisX.js +1 -1
  5. package/dist/assets/AxisY.js +1 -1
  6. package/dist/assets/AxisZ.js +1 -1
  7. package/dist/assets/JogXNeg.d.ts +4 -0
  8. package/dist/assets/JogXNeg.d.ts.map +1 -0
  9. package/dist/assets/JogXNeg.js +1 -0
  10. package/dist/assets/JogXPos.d.ts +4 -0
  11. package/dist/assets/JogXPos.d.ts.map +1 -0
  12. package/dist/assets/JogXPos.js +1 -0
  13. package/dist/assets/JogYNeg.d.ts +4 -0
  14. package/dist/assets/JogYNeg.d.ts.map +1 -0
  15. package/dist/assets/JogYNeg.js +1 -0
  16. package/dist/assets/JogYPos.d.ts +4 -0
  17. package/dist/assets/JogYPos.d.ts.map +1 -0
  18. package/dist/assets/JogYPos.js +1 -0
  19. package/dist/assets/JogZNeg.d.ts +4 -0
  20. package/dist/assets/JogZNeg.d.ts.map +1 -0
  21. package/dist/assets/JogZNeg.js +1 -0
  22. package/dist/assets/JogZPos.d.ts +4 -0
  23. package/dist/assets/JogZPos.d.ts.map +1 -0
  24. package/dist/assets/JogZPos.js +1 -0
  25. package/dist/assets/Off.d.ts +4 -0
  26. package/dist/assets/Off.d.ts.map +1 -0
  27. package/dist/assets/Off.js +1 -0
  28. package/dist/assets/On.d.ts +4 -0
  29. package/dist/assets/On.d.ts.map +1 -0
  30. package/dist/assets/On.js +1 -0
  31. package/dist/assets/index.d.ts +6 -0
  32. package/dist/assets/index.d.ts.map +1 -1
  33. package/dist/assets/index.js +1 -1
  34. package/dist/assets/svg/off.svg +2 -0
  35. package/dist/assets/svg/on.svg +11 -0
  36. package/dist/components/JogPanel.d.ts +2 -2
  37. package/dist/components/JogPanel.d.ts.map +1 -1
  38. package/dist/components/JogPanel.js +1 -1
  39. package/dist/components/ams/AmsProvider.d.ts +10 -0
  40. package/dist/components/ams/AmsProvider.d.ts.map +1 -1
  41. package/dist/components/ams/AssetDetailView.js +1 -1
  42. package/dist/components/ams/AssetEditDialog.d.ts.map +1 -1
  43. package/dist/components/ams/AssetEditDialog.js +1 -1
  44. package/dist/components/ams/AssetRegistryTable.css +12 -0
  45. package/dist/components/ams/AssetRegistryTable.d.ts +1 -0
  46. package/dist/components/ams/AssetRegistryTable.d.ts.map +1 -1
  47. package/dist/components/ams/AssetRegistryTable.js +1 -1
  48. package/dist/components/forms/FormRow.js +1 -1
  49. package/dist/components/forms/FormSection.js +1 -1
  50. package/dist/components/forms/forms.css +18 -18
  51. package/dist/components/tis/ConfigurationDialog.d.ts +21 -0
  52. package/dist/components/tis/ConfigurationDialog.d.ts.map +1 -0
  53. package/dist/components/tis/ConfigurationDialog.js +1 -0
  54. package/dist/components/tis/ResultHistoryTable.js +1 -1
  55. package/dist/components/tis/TestDataView.d.ts +27 -0
  56. package/dist/components/tis/TestDataView.d.ts.map +1 -1
  57. package/dist/components/tis/TestDataView.js +1 -1
  58. package/dist/components/tis/TestSetupForm.d.ts +37 -0
  59. package/dist/components/tis/TestSetupForm.d.ts.map +1 -1
  60. package/dist/components/tis/TestSetupForm.js +1 -1
  61. package/dist/components/tis/TisProvider.d.ts +25 -0
  62. package/dist/components/tis/TisProvider.d.ts.map +1 -1
  63. package/dist/components/tis/TisProvider.js +1 -1
  64. package/dist/components/tis-editor/TisConfigEditor.css +20 -0
  65. package/dist/components/tis-editor/editor/ConfigurationsEditor.d.ts +19 -0
  66. package/dist/components/tis-editor/editor/ConfigurationsEditor.d.ts.map +1 -0
  67. package/dist/components/tis-editor/editor/ConfigurationsEditor.js +1 -0
  68. package/dist/components/tis-editor/editor/MethodFormEditor.d.ts.map +1 -1
  69. package/dist/components/tis-editor/editor/MethodFormEditor.js +1 -1
  70. package/dist/components/tis-editor/types.d.ts +13 -0
  71. package/dist/components/tis-editor/types.d.ts.map +1 -1
  72. package/dist/components/tis-editor/validation.d.ts.map +1 -1
  73. package/dist/components/tis-editor/validation.js +1 -1
  74. package/dist/themes/adc-dark/blue/theme.css +3 -2
  75. package/dist/themes/adc-dark/blue/theme.css.map +1 -1
  76. package/package.json +2 -1
  77. package/src/assets/AxisC.tsx +38 -0
  78. package/src/assets/AxisX.tsx +32 -32
  79. package/src/assets/AxisY.tsx +34 -34
  80. package/src/assets/AxisZ.tsx +31 -31
  81. package/src/assets/JogXNeg.tsx +30 -0
  82. package/src/assets/JogXPos.tsx +30 -0
  83. package/src/assets/JogYNeg.tsx +30 -0
  84. package/src/assets/JogYPos.tsx +30 -0
  85. package/src/assets/JogZNeg.tsx +30 -0
  86. package/src/assets/JogZPos.tsx +30 -0
  87. package/src/assets/Off.tsx +14 -0
  88. package/src/assets/On.tsx +26 -0
  89. package/src/assets/index.ts +6 -0
  90. package/src/assets/svg/off.svg +2 -0
  91. package/src/assets/svg/on.svg +11 -0
  92. package/src/components/JogPanel.tsx +18 -28
  93. package/src/components/ams/AmsProvider.tsx +10 -0
  94. package/src/components/ams/AssetDetailView.tsx +1 -1
  95. package/src/components/ams/AssetEditDialog.tsx +25 -10
  96. package/src/components/ams/AssetRegistryTable.css +12 -0
  97. package/src/components/ams/AssetRegistryTable.tsx +68 -12
  98. package/src/components/forms/FormRow.tsx +6 -6
  99. package/src/components/forms/FormSection.tsx +6 -6
  100. package/src/components/forms/forms.css +18 -18
  101. package/src/components/tis/ConfigurationDialog.tsx +128 -0
  102. package/src/components/tis/ResultHistoryTable.tsx +2 -2
  103. package/src/components/tis/TestDataView.tsx +83 -1
  104. package/src/components/tis/TestSetupForm.tsx +167 -10
  105. package/src/components/tis/TisProvider.tsx +53 -0
  106. package/src/components/tis-editor/TisConfigEditor.css +20 -0
  107. package/src/components/tis-editor/editor/ConfigurationsEditor.tsx +242 -0
  108. package/src/components/tis-editor/editor/MethodFormEditor.tsx +4 -0
  109. package/src/components/tis-editor/types.ts +14 -0
  110. package/src/components/tis-editor/validation.ts +29 -0
  111. package/src/themes/adc-dark/_extensions.scss +1 -0
  112. package/src/themes/theme-base/components/panel/_fieldset.scss +2 -2
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgAxisC: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgAxisC;
4
+ //# sourceMappingURL=AxisC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisC.d.ts","sourceRoot":"","sources":["../../src/assets/AxisC.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,QAAQ,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAuBtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisC=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("path",{d:"M15 10a4 4 1 1 0 0 6"}),_jsx("path",{d:"M12 2a10 10 0 1 0 9.5 7"}),_jsx("path",{d:"m11 5 4-5-4-4",transform:"translate(0 2)"})]});export default SvgAxisC;
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisX=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("path",{d:"M5 2l14 12M18 2l-13 12"}),_jsx("path",{d:"M2 22h20M2 22l3-3M2 22l3 3M22 22l-3-3M22 22l-3 3"})]});export default SvgAxisX;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisX=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("path",{d:"M4 18h16M4 18l4-4M4 18l4 4M20 18l-4-4M20 18l-4 4"}),_jsx("path",{d:"M9 2l6 6m0-6l-6 6"})]});export default SvgAxisX;
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisY=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("g",{transform:"rotate(-45 12 12)",children:_jsx("path",{d:"M0 8h22M0 8l4-4M0 8l4 4M23 8l-4-4M23 8l-4 4"})}),_jsx("path",{d:"M13 12l5 7v7M23 12l-5 6"})]});export default SvgAxisY;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisY=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("g",{transform:"rotate(-45 6 12)",children:_jsx("path",{d:"M4 12h16M4 12l4-4M4 12l4 4M20 12l-4-4M20 12l-4 4"})}),_jsx("path",{d:"M15 12l3 4v5 M21 12l-3 4"})]});export default SvgAxisY;
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisZ=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("path",{d:"M18 2v20M15 5l3-3 3 3M15 19l3 3 3-3"}),_jsx("path",{d:"M1 4h10l-10 15h10"})]});export default SvgAxisZ;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgAxisZ=s=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...s,children:[_jsx("path",{d:"M18 4v16M14 8l4-4 4 4M14 16l4 4 4-4"}),_jsx("path",{d:"M2 10h6l-6 6h6"})]});export default SvgAxisZ;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogXNeg: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogXNeg;
4
+ //# sourceMappingURL=JogXNeg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogXNeg.d.ts","sourceRoot":"","sources":["../../src/assets/JogXNeg.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogXNeg=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M10 6 3 12 10 18Z",fill:"currentColor"}),_jsx("path",{d:"M14 6l8 12M22 6l-8 12"})]});export default SvgJogXNeg;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogXPos: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogXPos;
4
+ //# sourceMappingURL=JogXPos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogXPos.d.ts","sourceRoot":"","sources":["../../src/assets/JogXPos.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogXPos=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M2 6l8 12M10 6l-8 12"}),_jsx("path",{d:"M14 6 21 12 14 18Z",fill:"currentColor"})]});export default SvgJogXPos;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogYPos: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogYPos;
4
+ //# sourceMappingURL=JogYNeg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogYNeg.d.ts","sourceRoot":"","sources":["../../src/assets/JogYNeg.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogYPos=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M21 3 21 11 13 3Z",fill:"currentColor"}),_jsx("path",{d:"M4 12l3 4 3-4M7 16v5"})]});export default SvgJogYPos;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogYNeg: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogYNeg;
4
+ //# sourceMappingURL=JogYPos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogYPos.d.ts","sourceRoot":"","sources":["../../src/assets/JogYPos.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogYNeg=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M20 3l-3 4-3-4M17 7v5"}),_jsx("path",{d:"M3 21 3 13 11 21Z",fill:"currentColor"})]});export default SvgJogYNeg;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogZNeg: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogZNeg;
4
+ //# sourceMappingURL=JogZNeg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogZNeg.d.ts","sourceRoot":"","sources":["../../src/assets/JogZNeg.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogZNeg=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M6 2h12L6 10h12"}),_jsx("path",{d:"M5 14h14l-7 7Z",fill:"currentColor"})]});export default SvgJogZNeg;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const SvgJogZPos: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJogZPos;
4
+ //# sourceMappingURL=JogZPos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JogZPos.d.ts","sourceRoot":"","sources":["../../src/assets/JogZPos.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAkBxD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SvgJogZPos=o=>_jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...o,children:[_jsx("path",{d:"M5 10 12 3 19 10Z",fill:"currentColor"}),_jsx("path",{d:"M6 14h12L6 22h12"})]});export default SvgJogZPos;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const Off: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default Off;
4
+ //# sourceMappingURL=Off.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Off.d.ts","sourceRoot":"","sources":["../../src/assets/Off.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,GAAG,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CASjD,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";export const Off=r=>_jsx("svg",{viewBox:"0 0 354.487 354.487",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...r,children:_jsx("path",{d:"M177.241,0C79.504,0,0,79.51,0,177.241c0,97.736,79.51,177.246,177.241,177.246c97.731,0,177.246-79.516,177.246-177.246 C354.487,79.504,274.979,0,177.241,0z M177.241,311.444c-73.994,0-134.198-60.203-134.198-134.203 c0-73.995,60.204-134.199,134.198-134.199c74,0,134.204,60.204,134.204,134.199C311.445,251.241,251.241,311.444,177.241,311.444z"})});export default Off;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from "react";
2
+ export declare const On: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default On;
4
+ //# sourceMappingURL=On.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"On.d.ts","sourceRoot":"","sources":["../../src/assets/On.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,EAAE,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,4CAchD,CAAC;AAEF,eAAe,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";export const On=r=>_jsx("svg",{viewBox:"0 0 72 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:_jsx("path",{d:"M36 16L36 56",stroke:"currentColor",strokeLinecap:"round",strokeWidth:3.6})});export default On;
@@ -3,6 +3,12 @@ export { default as Distance } from "./Distance";
3
3
  export { default as JogLong } from "./JogLong";
4
4
  export { default as JogMedium } from "./JogMedium";
5
5
  export { default as JogShort } from "./JogShort";
6
+ export { default as JogXPos } from "./JogXPos";
7
+ export { default as JogXNeg } from "./JogXNeg";
8
+ export { default as JogYPos } from "./JogYPos";
9
+ export { default as JogYNeg } from "./JogYNeg";
10
+ export { default as JogZPos } from "./JogZPos";
11
+ export { default as JogZNeg } from "./JogZNeg";
6
12
  export { default as PythonLogo } from "./PythonLogo";
7
13
  export { default as Rotation3D } from "./Rotation3D";
8
14
  export { default as RotationCcw } from "./RotationCcw";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -1 +1 @@
1
- export{default as BlocklyLogo}from"./BlocklyLogo";export{default as Distance}from"./Distance";export{default as JogLong}from"./JogLong";export{default as JogMedium}from"./JogMedium";export{default as JogShort}from"./JogShort";export{default as PythonLogo}from"./PythonLogo";export{default as Rotation3D}from"./Rotation3D";export{default as RotationCcw}from"./RotationCcw";export{default as RotationCcwA}from"./RotationCcwA";export{default as RotationCcwB}from"./RotationCcwB";export{default as RotationCcwC}from"./RotationCcwC";export{default as RotationCw}from"./RotationCw";export{default as RotationCwA}from"./RotationCwA";export{default as RotationCwB}from"./RotationCwB";export{default as RotationCwC}from"./RotationCwC";export{default as Run}from"./Run";export{default as Speed}from"./Speed";export{default as SpeedFast}from"./SpeedFast";export{default as SpeedMedium}from"./SpeedMedium";export{default as SpeedNone}from"./SpeedNone";export{default as SpeedSlow}from"./SpeedSlow";export{default as Walk}from"./Walk";
1
+ export{default as BlocklyLogo}from"./BlocklyLogo";export{default as Distance}from"./Distance";export{default as JogLong}from"./JogLong";export{default as JogMedium}from"./JogMedium";export{default as JogShort}from"./JogShort";export{default as JogXPos}from"./JogXPos";export{default as JogXNeg}from"./JogXNeg";export{default as JogYPos}from"./JogYPos";export{default as JogYNeg}from"./JogYNeg";export{default as JogZPos}from"./JogZPos";export{default as JogZNeg}from"./JogZNeg";export{default as PythonLogo}from"./PythonLogo";export{default as Rotation3D}from"./Rotation3D";export{default as RotationCcw}from"./RotationCcw";export{default as RotationCcwA}from"./RotationCcwA";export{default as RotationCcwB}from"./RotationCcwB";export{default as RotationCcwC}from"./RotationCcwC";export{default as RotationCw}from"./RotationCw";export{default as RotationCwA}from"./RotationCwA";export{default as RotationCwB}from"./RotationCwB";export{default as RotationCwC}from"./RotationCwC";export{default as Run}from"./Run";export{default as Speed}from"./Speed";export{default as SpeedFast}from"./SpeedFast";export{default as SpeedMedium}from"./SpeedMedium";export{default as SpeedNone}from"./SpeedNone";export{default as SpeedSlow}from"./SpeedSlow";export{default as Walk}from"./Walk";
@@ -0,0 +1,2 @@
1
+ <svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
2
+ xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 354.487 354.487" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <path d="M177.241,0C79.504,0,0,79.51,0,177.241c0,97.736,79.51,177.246,177.241,177.246c97.731,0,177.246-79.516,177.246-177.246 C354.487,79.504,274.979,0,177.241,0z M177.241,311.444c-73.994,0-134.198-60.203-134.198-134.203 c0-73.995,60.204-134.199,134.198-134.199c74,0,134.204,60.204,134.204,134.199C311.445,251.241,251.241,311.444,177.241,311.444z"></path> </g> </g></svg>
@@ -0,0 +1,11 @@
1
+ <svg viewBox="0 0 72 72" id="emoji" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
3
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" stroke="#CCCCCC"
4
+ stroke-width="0.43200000000000005"></g>
5
+ <g id="SVGRepo_iconCarrier">
6
+ <g id="color"></g>
7
+ <g id="line">
8
+ <path stroke="#000000" stroke-linecap="round" stroke-width="3.6" d="M36 16L36 56"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -87,9 +87,9 @@ export declare const DefaultRotationJogButtons: (JogPanelButtonDefinition | unde
87
87
  * Example:
88
88
  * ```
89
89
  * export const kDefaultButtonDefinitions : (JogPanelButtonDefinition | undefined)[][] = [
90
- * [{ icon: "pi pi-arrow-up-left", action: JogPanelAction.yPositive, alt: "Y Positive" }, { icon: "pi pi-arrow-up", action: JogPanelAction.zPositive, alt: "Z Positive" }, undefined],
90
+ * [undefined, { icon: "pi pi-arrow-up", action: JogPanelAction.zPositive, alt: "Z Positive" }, { icon: "pi pi-arrow-down-left", action: JogPanelAction.yNegative, alt: "Y Negative" }],
91
91
  * [{ icon: "pi pi-arrow-left", action: JogPanelAction.xNegative, alt: "X Negative" }, undefined, { icon: "pi pi-arrow-right", action: JogPanelAction.xPositive, alt: "X Positive" }],
92
- * [undefined, { icon: "pi pi-arrow-down", action: JogPanelAction.zNegative, alt: "Z Negative" }, { icon: "pi pi-arrow-down-right", action: JogPanelAction.yNegative, alt: "Y Negative" }],
92
+ * [{ icon: "pi pi-arrow-up-right", action: JogPanelAction.yPositive, alt: "Y Positive" }, { icon: "pi pi-arrow-down", action: JogPanelAction.zNegative, alt: "Z Negative" }, undefined],
93
93
  * ];
94
94
  * ```
95
95
  *
@@ -1 +1 @@
1
- {"version":3,"file":"JogPanel.d.ts","sourceRoot":"","sources":["../../src/components/JogPanel.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,gBAAgB,CAAC;AAQxB;;GAEG;AACH,oBAAY,cAAc;IACtB,mCAAmC;IACnC,OAAO,IAAO;IAEd,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,KAAO;IAEhB,SAAS,KAAO;IAEhB,SAAS,KAAO;IAEhB,2BAA2B;IAC3B,IAAI,MAAO;CACd;AAGD;;GAEG;AACH,oBAAY,iBAAiB;IACzB,KAAK,IAAO;IACZ,MAAM,KAAO;IACb,IAAI,KAAO;CACd;AAED;;GAEG;AACH,oBAAY,cAAc;IACtB,IAAI,IAAO;IACX,MAAM,KAAO;IACb,IAAI,KAAO;CACd;AAGD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAA;CACzB;AAkBD;;GAEG;AACH,UAAU,aAAa;IACnB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,iBAAiB,EAAE,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IAC1E,kBAAkB,EAAG,iBAAiB,CAAC;IACvC,eAAe,EAAG,cAAc,CAAC;IACjC,mBAAmB,EAAG,OAAO,CAAC;IAC9B,gBAAgB,EAAG,OAAO,CAAC;CAC9B;AAGD,UAAU,aAAa;IACnB,WAAW,EAAG,iBAAiB,CAAC;IAChC,QAAQ,EAAG,cAAc,CAAA;CAC5B;AAGD;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAG,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAI9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAG,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAIhF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEvE,MAAM,CAAC,YAAY,EAAG,aAAa,CAQjC;IAGF,OAAO,CAAC,gBAAgB,CAItB;IAEF,OAAO,CAAC,aAAa,CAInB;gBAGU,KAAK,EAAE,aAAa;IAUhC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAWrB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,kBAAkB;IAQ1B,QAAQ;IAQR,OAAO,CAAC,YAAY;IAiDpB,cAAc,CAAC,GAAG,EAAG,MAAM,EAAE,GAAG,EAAG,MAAM;IAmCzC,MAAM;CAiIT;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"JogPanel.d.ts","sourceRoot":"","sources":["../../src/components/JogPanel.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,gBAAgB,CAAC;AASxB;;GAEG;AACH,oBAAY,cAAc;IACtB,mCAAmC;IACnC,OAAO,IAAO;IAEd,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,IAAO;IAEhB,SAAS,KAAO;IAEhB,SAAS,KAAO;IAEhB,SAAS,KAAO;IAEhB,2BAA2B;IAC3B,IAAI,MAAO;CACd;AAGD;;GAEG;AACH,oBAAY,iBAAiB;IACzB,KAAK,IAAO;IACZ,MAAM,KAAO;IACb,IAAI,KAAO;CACd;AAED;;GAEG;AACH,oBAAY,cAAc;IACtB,IAAI,IAAO;IACX,MAAM,KAAO;IACb,IAAI,KAAO;CACd;AAGD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAA;CACzB;AAkBD;;GAEG;AACH,UAAU,aAAa;IACnB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,iBAAiB,EAAE,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IAC1E,kBAAkB,EAAG,iBAAiB,CAAC;IACvC,eAAe,EAAG,cAAc,CAAC;IACjC,mBAAmB,EAAG,OAAO,CAAC;IAC9B,gBAAgB,EAAG,OAAO,CAAC;CAC9B;AAGD,UAAU,aAAa;IACnB,WAAW,EAAG,iBAAiB,CAAC;IAChC,QAAQ,EAAG,cAAc,CAAA;CAC5B;AAGD;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAG,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAI9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAG,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAAE,EAIhF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAEvE,MAAM,CAAC,YAAY,EAAG,aAAa,CAQjC;IAGF,OAAO,CAAC,gBAAgB,CAItB;IAEF,OAAO,CAAC,aAAa,CAInB;gBAGU,KAAK,EAAE,aAAa;IAUhC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAWrB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,kBAAkB;IAQ1B,QAAQ;IAQR,OAAO,CAAC,YAAY;IAiDpB,cAAc,CAAC,GAAG,EAAG,MAAM,EAAE,GAAG,EAAG,MAAM;IAwBzC,MAAM;CAiIT;AAED,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React from"react";import{Button}from"primereact/button";import{SelectButton}from"primereact/selectbutton";import{Tooltip}from"primereact/tooltip";import"./JogPanel.css";import{Distance,JogShort,JogMedium,JogLong}from"../assets";import{Speed,SpeedSlow,SpeedMedium,SpeedFast}from"../assets";import{RotationCcwA,RotationCcwB,RotationCcwC}from"../assets";import{RotationCwA,RotationCwB,RotationCwC}from"../assets";export var JogPanelAction;!function(t){t[t.Invalid=0]="Invalid",t[t.xPositive=1]="xPositive",t[t.xNegative=2]="xNegative",t[t.yPositive=3]="yPositive",t[t.yNegative=4]="yNegative",t[t.zPositive=5]="zPositive",t[t.zNegative=6]="zNegative",t[t.aPositive=7]="aPositive",t[t.aNegative=8]="aNegative",t[t.bPositive=9]="bPositive",t[t.bNegative=16]="bNegative",t[t.cPositive=17]="cPositive",t[t.cNegative=18]="cNegative",t[t.Stop=255]="Stop"}(JogPanelAction||(JogPanelAction={}));export var JogDistanceAction;!function(t){t[t.Short=0]="Short",t[t.Medium=16]="Medium",t[t.Long=32]="Long"}(JogDistanceAction||(JogDistanceAction={}));export var JogSpeedAction;!function(t){t[t.Slow=0]="Slow",t[t.Medium=16]="Medium",t[t.Fast=32]="Fast"}(JogSpeedAction||(JogSpeedAction={}));export const DefaultLinearJogButtons=[[{icon:"pi pi-arrow-up-left",action:JogPanelAction.yPositive,alt:"Y Positive"},{icon:"pi pi-arrow-up",action:JogPanelAction.zPositive,alt:"Z Positive"},void 0],[{icon:"pi pi-arrow-left",action:JogPanelAction.xNegative,alt:"X Negative"},void 0,{icon:"pi pi-arrow-right",action:JogPanelAction.xPositive,alt:"X Positive"}],[void 0,{icon:"pi pi-arrow-down",action:JogPanelAction.zNegative,alt:"Z Negative"},{icon:"pi pi-arrow-down-right",action:JogPanelAction.yNegative,alt:"Y Negative"}]];export const DefaultRotationJogButtons=[[{icon:"pi",action:JogPanelAction.bPositive,alt:"Rot B Positive"},{icon:"pi",action:JogPanelAction.cPositive,alt:"Rot C Positive"},void 0],[{icon:"pi",action:JogPanelAction.aNegative,alt:"Rot A Negative"},void 0,{icon:"pi",action:JogPanelAction.aPositive,alt:"Rot A Positive"}],[void 0,{icon:"pi",action:JogPanelAction.cNegative,alt:"Rot C Negative"},{icon:"pi ",action:JogPanelAction.bNegative,alt:"Rot B Negative"}]];export class JogPanel extends React.Component{constructor(t){super(t),Object.defineProperty(this,"jogDistanceItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogDistanceAction.Short},{name:"M",value:JogDistanceAction.Medium},{name:"L",value:JogDistanceAction.Long}]}),Object.defineProperty(this,"jogSpeedItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogSpeedAction.Slow},{name:"M",value:JogSpeedAction.Medium},{name:"F",value:JogSpeedAction.Fast}]}),this.state={jogDistance:t.defaultJogDistance,jogSpeed:t.defaultJogSpeed}}handleClicked(t){null!=t&&this.props.onClicked&&this.props.onClicked(t)}handleDistanceChanged(t){this.setState({jogDistance:t}),this.props.onJogDistanceChanged&&this.props.onJogDistanceChanged(t)}handleSpeedChanged(t){this.setState({jogSpeed:t}),this.props.onJogSpeedChanged&&this.props.onJogSpeedChanged(t)}emptyRow(){return _jsxs("div",{className:"grid-row",children:[_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"})]})}actionToIcon(t){return t==JogPanelAction.Invalid||t==JogPanelAction.Stop?_jsx("i",{}):t==JogPanelAction.xNegative?_jsx("i",{className:"pi pi-arrow-left"}):t==JogPanelAction.xPositive?_jsx("i",{className:"pi pi-arrow-right"}):t==JogPanelAction.yNegative?_jsx("i",{className:"pi pi-arrow-up-left"}):t==JogPanelAction.yPositive?_jsx("i",{className:"pi pi-arrow-down-right"}):t==JogPanelAction.zNegative?_jsx("i",{className:"pi pi-up"}):t==JogPanelAction.zPositive?_jsx("i",{className:"pi pi-down"}):t==JogPanelAction.aNegative?_jsx(RotationCcwA,{}):t==JogPanelAction.aPositive?_jsx(RotationCwA,{}):t==JogPanelAction.bNegative?_jsx(RotationCcwB,{}):t==JogPanelAction.bPositive?_jsx(RotationCwB,{}):t==JogPanelAction.cNegative?_jsx(RotationCcwC,{}):t==JogPanelAction.cPositive?_jsx(RotationCwC,{}):_jsx("i",{})}standardButton(t,i){if(void 0!==this.props.buttonDefinitions&&void 0!==this.props.buttonDefinitions[t]&&void 0!==this.props.buttonDefinitions[t][i]&&void 0!==this.props.buttonDefinitions[t][i]?.action){const o=this.props.buttonDefinitions[t][i]?.action;return void 0!==o&&o<JogPanelAction.aPositive?_jsx(Button,{icon:this.props.buttonDefinitions[t][i]?.icon,tooltip:this.props.buttonDefinitions[t][i]?.alt,onClick:()=>this.handleClicked(o),className:"button-item"},`${t}-${i}`):_jsx(Button,{tooltip:this.props.buttonDefinitions[t][i]?.alt,onClick:()=>this.handleClicked(o),className:"button-item",icon:()=>this.actionToIcon(o)},`${t}-${i}`)}return _jsx(Button,{icon:"pi",disabled:!0,className:"button-item empty-slot"},`${t}-${i}`)}render(){return _jsxs("div",{className:"jogpanel-container",children:[_jsx(Tooltip,{target:".distance-selector-button"}),_jsxs("div",{className:"grid-container",children:[_jsxs("div",{className:"grid-row",children:[this.standardButton(0,0),this.standardButton(0,1),this.standardButton(0,2)]},"0"),_jsxs("div",{className:"grid-row",children:[this.standardButton(1,0),this.standardButton(1,1),this.standardButton(1,2)]},"1"),_jsxs("div",{className:"grid-row",children:[this.standardButton(2,0),this.standardButton(2,1),this.standardButton(2,2)]},"2")]}),this.props.showDistanceControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Distance,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogDistance,onChange:t=>this.handleDistanceChanged(t.value),optionLabel:"name",options:this.jogDistanceItems,allowEmpty:!1,itemTemplate:t=>t.value==JogDistanceAction.Short?_jsx(JogShort,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Short Distance","data-pr-position":"bottom",fill:"white"}):t.value==JogDistanceAction.Medium?_jsx(JogMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Distance","data-pr-position":"bottom",fill:"white"}):_jsx(JogLong,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Long Distance","data-pr-position":"bottom",fill:"white"})})]}),this.props.showSpeedControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Speed,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogSpeed,onChange:t=>this.handleSpeedChanged(t.value),optionLabel:"name",options:this.jogSpeedItems,allowEmpty:!1,itemTemplate:t=>t.value==JogSpeedAction.Slow?_jsx(SpeedSlow,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Slow Speed","data-pr-position":"bottom",fill:"white"}):t.value==JogSpeedAction.Medium?_jsx(SpeedMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Speed","data-pr-position":"bottom",fill:"white"}):_jsx(SpeedFast,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Fast Speed","data-pr-position":"bottom",fill:"white"})})]})]})}}Object.defineProperty(JogPanel,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{onClicked:void 0,onJogDistanceChanged:void 0,buttonDefinitions:DefaultLinearJogButtons,defaultJogDistance:JogDistanceAction.Short,defaultJogSpeed:JogSpeedAction.Medium,showDistanceControl:!0,showSpeedControl:!0}});export default JogPanel;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React from"react";import{Button}from"primereact/button";import{SelectButton}from"primereact/selectbutton";import{Tooltip}from"primereact/tooltip";import"./JogPanel.css";import{Distance,JogShort,JogMedium,JogLong}from"../assets";import{Speed,SpeedSlow,SpeedMedium,SpeedFast}from"../assets";import{RotationCcwA,RotationCcwB,RotationCcwC}from"../assets";import{RotationCwA,RotationCwB,RotationCwC}from"../assets";import{JogXPos,JogXNeg,JogYPos,JogYNeg,JogZPos,JogZNeg}from"../assets";export var JogPanelAction;!function(t){t[t.Invalid=0]="Invalid",t[t.xPositive=1]="xPositive",t[t.xNegative=2]="xNegative",t[t.yPositive=3]="yPositive",t[t.yNegative=4]="yNegative",t[t.zPositive=5]="zPositive",t[t.zNegative=6]="zNegative",t[t.aPositive=7]="aPositive",t[t.aNegative=8]="aNegative",t[t.bPositive=9]="bPositive",t[t.bNegative=16]="bNegative",t[t.cPositive=17]="cPositive",t[t.cNegative=18]="cNegative",t[t.Stop=255]="Stop"}(JogPanelAction||(JogPanelAction={}));export var JogDistanceAction;!function(t){t[t.Short=0]="Short",t[t.Medium=16]="Medium",t[t.Long=32]="Long"}(JogDistanceAction||(JogDistanceAction={}));export var JogSpeedAction;!function(t){t[t.Slow=0]="Slow",t[t.Medium=16]="Medium",t[t.Fast=32]="Fast"}(JogSpeedAction||(JogSpeedAction={}));export const DefaultLinearJogButtons=[[void 0,{icon:"pi pi-arrow-up",action:JogPanelAction.zPositive,alt:"Z Positive"},{icon:"pi pi-arrow-down-left",action:JogPanelAction.yNegative,alt:"Y Negative"}],[{icon:"pi pi-arrow-left",action:JogPanelAction.xNegative,alt:"X Negative"},void 0,{icon:"pi pi-arrow-right",action:JogPanelAction.xPositive,alt:"X Positive"}],[{icon:"pi pi-arrow-up-right",action:JogPanelAction.yPositive,alt:"Y Positive"},{icon:"pi pi-arrow-down",action:JogPanelAction.zNegative,alt:"Z Negative"},void 0]];export const DefaultRotationJogButtons=[[{icon:"pi",action:JogPanelAction.bPositive,alt:"Rot B Positive"},{icon:"pi",action:JogPanelAction.cPositive,alt:"Rot C Positive"},void 0],[{icon:"pi",action:JogPanelAction.aNegative,alt:"Rot A Negative"},void 0,{icon:"pi",action:JogPanelAction.aPositive,alt:"Rot A Positive"}],[void 0,{icon:"pi",action:JogPanelAction.cNegative,alt:"Rot C Negative"},{icon:"pi ",action:JogPanelAction.bNegative,alt:"Rot B Negative"}]];export class JogPanel extends React.Component{constructor(t){super(t),Object.defineProperty(this,"jogDistanceItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogDistanceAction.Short},{name:"M",value:JogDistanceAction.Medium},{name:"L",value:JogDistanceAction.Long}]}),Object.defineProperty(this,"jogSpeedItems",{enumerable:!0,configurable:!0,writable:!0,value:[{name:"S",value:JogSpeedAction.Slow},{name:"M",value:JogSpeedAction.Medium},{name:"F",value:JogSpeedAction.Fast}]}),this.state={jogDistance:t.defaultJogDistance,jogSpeed:t.defaultJogSpeed}}handleClicked(t){null!=t&&this.props.onClicked&&this.props.onClicked(t)}handleDistanceChanged(t){this.setState({jogDistance:t}),this.props.onJogDistanceChanged&&this.props.onJogDistanceChanged(t)}handleSpeedChanged(t){this.setState({jogSpeed:t}),this.props.onJogSpeedChanged&&this.props.onJogSpeedChanged(t)}emptyRow(){return _jsxs("div",{className:"grid-row",children:[_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"}),_jsx("div",{className:"button-item empty-slot"})]})}actionToIcon(t){return t==JogPanelAction.Invalid||t==JogPanelAction.Stop?_jsx("i",{}):t==JogPanelAction.xNegative?_jsx(JogXNeg,{}):t==JogPanelAction.xPositive?_jsx(JogXPos,{}):t==JogPanelAction.yNegative?_jsx(JogYNeg,{}):t==JogPanelAction.yPositive?_jsx(JogYPos,{}):t==JogPanelAction.zNegative?_jsx(JogZNeg,{}):t==JogPanelAction.zPositive?_jsx(JogZPos,{}):t==JogPanelAction.aNegative?_jsx(RotationCcwA,{}):t==JogPanelAction.aPositive?_jsx(RotationCwA,{}):t==JogPanelAction.bNegative?_jsx(RotationCcwB,{}):t==JogPanelAction.bPositive?_jsx(RotationCwB,{}):t==JogPanelAction.cNegative?_jsx(RotationCcwC,{}):t==JogPanelAction.cPositive?_jsx(RotationCwC,{}):_jsx("i",{})}standardButton(t,o){if(void 0!==this.props.buttonDefinitions&&void 0!==this.props.buttonDefinitions[t]&&void 0!==this.props.buttonDefinitions[t][o]&&void 0!==this.props.buttonDefinitions[t][o]?.action){const e=this.props.buttonDefinitions[t][o]?.action;return _jsx(Button,{tooltip:this.props.buttonDefinitions[t][o]?.alt,onClick:()=>this.handleClicked(e),className:"button-item",icon:()=>this.actionToIcon(e)},`${t}-${o}`)}return _jsx(Button,{icon:"pi",disabled:!0,className:"button-item empty-slot"},`${t}-${o}`)}render(){return _jsxs("div",{className:"jogpanel-container",children:[_jsx(Tooltip,{target:".distance-selector-button"}),_jsxs("div",{className:"grid-container",children:[_jsxs("div",{className:"grid-row",children:[this.standardButton(0,0),this.standardButton(0,1),this.standardButton(0,2)]},"0"),_jsxs("div",{className:"grid-row",children:[this.standardButton(1,0),this.standardButton(1,1),this.standardButton(1,2)]},"1"),_jsxs("div",{className:"grid-row",children:[this.standardButton(2,0),this.standardButton(2,1),this.standardButton(2,2)]},"2")]}),this.props.showDistanceControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Distance,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogDistance,onChange:t=>this.handleDistanceChanged(t.value),optionLabel:"name",options:this.jogDistanceItems,allowEmpty:!1,itemTemplate:t=>t.value==JogDistanceAction.Short?_jsx(JogShort,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Short Distance","data-pr-position":"bottom",fill:"white"}):t.value==JogDistanceAction.Medium?_jsx(JogMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Distance","data-pr-position":"bottom",fill:"white"}):_jsx(JogLong,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Long Distance","data-pr-position":"bottom",fill:"white"})})]}),this.props.showSpeedControl&&_jsxs("div",{className:"distance-selector p-inputgroup flex-1",children:[_jsx("span",{className:"p-inputgroup-addon",children:_jsx(Speed,{width:16,height:16,fill:"white"})}),_jsx(SelectButton,{value:this.state.jogSpeed,onChange:t=>this.handleSpeedChanged(t.value),optionLabel:"name",options:this.jogSpeedItems,allowEmpty:!1,itemTemplate:t=>t.value==JogSpeedAction.Slow?_jsx(SpeedSlow,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Slow Speed","data-pr-position":"bottom",fill:"white"}):t.value==JogSpeedAction.Medium?_jsx(SpeedMedium,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Medium Speed","data-pr-position":"bottom",fill:"white"}):_jsx(SpeedFast,{className:"distance-selector-button",width:16,height:16,"data-pr-tooltip":"Fast Speed","data-pr-position":"bottom",fill:"white"})})]})]})}}Object.defineProperty(JogPanel,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{onClicked:void 0,onJogDistanceChanged:void 0,buttonDefinitions:DefaultLinearJogButtons,defaultJogDistance:JogDistanceAction.Short,defaultJogSpeed:JogSpeedAction.Medium,showDistanceControl:!0,showSpeedControl:!0}});export default JogPanel;
@@ -25,6 +25,16 @@ export interface AmsRole {
25
25
  * feeding NI bridge channel calibration). Empty for purely
26
26
  * test-method-driven roles. */
27
27
  used_by_modules: string[];
28
+ /** Optional per-field seed values declared on the asset_ref's
29
+ * `defaults` map. AIS uses these to pre-fill nameplate inputs when
30
+ * the operator creates a new asset for this role — the operator
31
+ * confirms or edits, the values are never enforced. Absent when no
32
+ * asset_ref declared defaults (the common case, since built-in
33
+ * load_cell etc. didn't support defaults before the feature
34
+ * landed). Keys are field names from the asset_type's schema;
35
+ * values are untyped JSON (numbers, strings, booleans) matching
36
+ * the field's declared `type`. */
37
+ defaults?: Record<string, any>;
28
38
  }
29
39
  export type AmsRoleRegistry = {
30
40
  [assetType: string]: AmsRole[];
@@ -1 +1 @@
1
- {"version":3,"file":"AmsProvider.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AmsProvider.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAOV,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAQf,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACpB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;oCAKgC;IAChC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B;AACD,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,SAAS;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,iBAAiB,CAAC;IACjD,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACpD,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACzE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;CACxD;AA0BD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoIlD,CAAC;AAMF,eAAO,MAAM,MAAM,uBAAwC,CAAC;AAC5D,eAAO,MAAM,aAAa,yBAAyC,CAAC;AACpE,eAAO,MAAM,WAAW,uBAAyC,CAAC;AAClE,eAAO,MAAM,YAAY,iBAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,uBAAyC,CAAC;AACnE,eAAO,MAAM,eAAe,wCA9KF,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAiLvD,CAAC"}
1
+ {"version":3,"file":"AmsProvider.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AmsProvider.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAOV,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAQf,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACpB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;oCAKgC;IAChC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;uCAQmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AACD,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,SAAS;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,iBAAiB,CAAC;IACjD,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACpD,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACzE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;CACxD;AA0BD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoIlD,CAAC;AAMF,eAAO,MAAM,MAAM,uBAAwC,CAAC;AAC5D,eAAO,MAAM,aAAa,yBAAyC,CAAC;AACpE,eAAO,MAAM,WAAW,uBAAyC,CAAC;AAClE,eAAO,MAAM,YAAY,iBAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,uBAAyC,CAAC;AACnE,eAAO,MAAM,eAAe,wCA9KF,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAiLvD,CAAC"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React,{useContext,useEffect,useState}from"react";import{Button}from"primereact/button";import{DataTable}from"primereact/datatable";import{Column}from"primereact/column";import{ConfirmDialog,confirmDialog}from"primereact/confirmdialog";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";import{CalibrationEntryDialog}from"./CalibrationEntryDialog";import{AssetEditDialog}from"./AssetEditDialog";export const AssetDetailView=()=>{const{selection:e,schemas:t,roles:s,readAsset:i,listCalibrations:a,readCalibration:r,readUsage:l,refreshAssets:n,setSelection:o}=useAms(),{invoke:d}=useContext(EventEmitterContext),[c,m]=useState(null),[p,u]=useState([]),[_,h]=useState(null),[x,f]=useState(!1),[y,j]=useState(null),[b,g]=useState(!1),[v,C]=useState(!1),S=async()=>{if(!e.assetId)return m(null),u([]),void h(null);const t=await i(e.assetId);m(t);const s=await a(e.assetId),n=await Promise.all(s.map(t=>r(e.assetId,t)));u(n.filter(Boolean));const o=await l(e.assetId);h(o)};if(useEffect(()=>{S()},[e.assetId]),!e.assetId)return _jsx("div",{style:{padding:"1rem",color:"#9ca3af"},children:"Select an asset from the registry to see its details."});if(!c)return _jsx("div",{style:{padding:"1rem"},children:"Loading…"});const w=t[c.asset_type]?.label??c.asset_type,A=s[c.asset_type]?.find(e=>e.location===c.location),D=A?A.label??A.location:c.location,E=Array.isArray(t[c.asset_type]?.fields)?t[c.asset_type].fields:[],k=c.custom??{},I=A?.used_by_modules??[];return _jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr auto 1fr",gap:"0.5rem 1.5rem",alignItems:"baseline"},children:[_jsx("strong",{children:"Asset ID"})," ",_jsx("span",{children:c.asset_id}),_jsx("strong",{children:"Type"})," ",_jsx("span",{children:w}),_jsx("strong",{children:"Serial"})," ",_jsx("span",{children:c.serial||_jsx("em",{style:{color:"#9ca3af"},children:"(none)"})}),_jsx("strong",{children:"Role"})," ",_jsx("span",{children:D||_jsx("em",{style:{color:"#9ca3af"},children:"(none)"})}),_jsx("strong",{children:"Status"})," ",_jsx("span",{children:c.status}),_jsx("strong",{children:"Installed"}),_jsx("span",{children:c.install_date?new Date(c.install_date).toLocaleString():"—"}),_jsx("strong",{children:"Current Cal"}),_jsx("span",{children:c.current_calibration_id??_jsx("em",{style:{color:"#f59e0b"},children:"none"})}),_jsx("strong",{children:"Cycles"})," ",_jsx("span",{children:_?.cycles??0})]}),I.length>0&&_jsxs("div",{style:{fontSize:"0.875rem",color:"#34d399"},children:["✓ Feeds module ",1===I.length?"config":"configs",":"," ",_jsx("strong",{children:I.join(", ")})," — ","their ",_jsxs("code",{children:["$","${ams.by_location."+c.location+".*}"]})," ","placeholders will resolve to the values below."]}),E.length>0&&_jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:"Nameplate"}),_jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.25rem 1rem",alignItems:"baseline",fontSize:"0.9rem"},children:E.map(e=>{const t=k[e.name],s=null!=t&&""!==t,i=e.label??e.name,a=s?e.units?`${t} ${e.units}`:String(t):"(not set)";return _jsxs(React.Fragment,{children:[_jsx("strong",{title:e.description??void 0,children:i}),_jsx("span",{style:{color:s?void 0:"#f59e0b"},children:a})]},e.name)})})]}),_jsx(SubLocationsPanel,{schema:t[c.asset_type]?.sub_locations,values:c.sub_locations}),_jsx(SubLocationsCalibrationPanel,{schema:t[c.asset_type]?.sub_locations,currentCalibration:p.find(e=>e.cal_id===c.current_calibration_id)}),_jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_jsx("h4",{style:{margin:0},children:"Calibration History"}),_jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[_jsx(Button,{label:"Edit",icon:"pi pi-pencil",outlined:!0,onClick:()=>C(!0),tooltip:"Edit role, nameplate, and per-axis values. Type, serial, and install date are immutable.",tooltipOptions:{position:"left"}}),"active"===c.status&&_jsx(Button,{label:"Retire",icon:"pi pi-power-off",severity:"warning",outlined:!0,onClick:async()=>{if(c)try{const e=await d("ams.update_asset",MessageType.Request,{asset_id:c.asset_id,status:"retired"});e?.success&&(await n(),await S())}catch(e){}},tooltip:"Mark inactive. The asset stays on disk; deletion is a separate action available after retirement.",tooltipOptions:{position:"left"}}),"retired"===c.status&&_jsx(Button,{label:"Delete",icon:"pi pi-trash",severity:"danger",outlined:!0,loading:b,onClick:()=>{c&&confirmDialog({message:_jsxs("div",{children:[_jsxs("p",{style:{marginTop:0},children:["Permanently delete asset ",_jsx("code",{children:c.asset_id}),"?"]}),_jsx("p",{style:{marginBottom:0,fontSize:"0.875rem",color:"#9ca3af"},children:"This removes the AMS record (nameplate, calibration history, usage counters). Historical test records that referenced this asset are unaffected — they carry the full asset and calibration data inline."})]}),header:"Delete asset",icon:"pi pi-exclamation-triangle",acceptLabel:"Delete",rejectLabel:"Cancel",acceptClassName:"p-button-danger",accept:()=>{(async()=>{if(c){g(!0);try{const e=await d("ams.delete_asset",MessageType.Request,{asset_id:c.asset_id});e?.success?(o({assetType:null,assetId:null}),await n()):alert(`Delete failed: ${e?.error_message??"unknown error"}`)}catch(e){alert(`Delete threw: ${e?.message??e}`)}finally{g(!1)}}})()}})},tooltip:"Permanent. Removes the AMS record; historical test snapshots are preserved inline.",tooltipOptions:{position:"left"}}),_jsx(Button,{label:"+ Calibration",icon:"pi pi-plus",onClick:()=>{j(null),f(!0)}})]})]}),_jsx(ConfirmDialog,{}),_jsxs(DataTable,{value:p,size:"small",stripedRows:!0,emptyMessage:"No calibrations recorded for this asset.",children:[_jsx(Column,{field:"cal_id",header:"Cal ID"}),_jsx(Column,{field:"performed_at",header:"Performed",body:e=>e.performed_at?new Date(e.performed_at).toLocaleString():"—"}),_jsx(Column,{field:"performed_by",header:"By"}),_jsx(Column,{field:"expires_at",header:"Expires",body:e=>e.expires_at?new Date(e.expires_at).toLocaleDateString():"—"}),_jsx(Column,{field:"cert_ref",header:"Cert"}),_jsx(Column,{header:"Values",body:e=>_jsx("code",{style:{fontSize:"0.75rem"},children:JSON.stringify(e.values)})}),_jsx(Column,{header:"",style:{width:"5rem"},body:e=>e.cal_id===c.current_calibration_id?_jsx(Button,{icon:"pi pi-pencil",text:!0,rounded:!0,size:"small",tooltip:"Edit this calibration (fixes a typo in place).",tooltipOptions:{position:"left"},onClick:()=>{j(e),f(!0)}}):null})]}),_jsx(CalibrationEntryDialog,{visible:x,assetId:c.asset_id,assetType:c.asset_type,editing:y,onHide:()=>{f(!1),j(null)},onAdded:()=>{S()}}),_jsx(AssetEditDialog,{visible:v,asset:c,onHide:()=>C(!1),onSaved:async()=>{await n(),await S()}})]})};const SubLocationsPanel=({schema:e,values:t})=>{if(!e||!Array.isArray(e.keys)||!Array.isArray(e.fields))return null;const s=t&&"object"==typeof t?t:{};return _jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:e.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:e.key_label??"Key"}),e.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:""]},e.name))]})}),_jsx("tbody",{children:e.keys.map(t=>{const i=s[t]??{};return _jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:t}),e.fields.map(e=>{const t=i[e.name],s=null!=t&&""!==t;return _jsx("td",{style:{padding:"0.25rem 0.5rem",color:s?void 0:"#f59e0b"},children:s?String(t):"(not set)"},e.name)})]},t)})})]})})]})},SubLocationsCalibrationPanel=({schema:e,currentCalibration:t})=>{if(!e||!Array.isArray(e.keys)||!Array.isArray(e.calibration_fields)||0===e.calibration_fields.length)return null;if(!t)return null;const s=t.values&&"object"==typeof t.values?t.values:{};return _jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:"Current Calibration — Per-axis Values"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:e.key_label??"Key"}),e.calibration_fields.map(e=>_jsxs("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:""]},e.name))]})}),_jsx("tbody",{children:e.keys.map(t=>{const i=s[t]??{};return _jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:t}),e.calibration_fields.map(e=>{const t=i[e.name],s=null!=t&&""!==t;return _jsx("td",{style:{padding:"0.25rem 0.5rem",color:s?void 0:"#f59e0b"},children:s?String(t):"(not set)"},e.name)})]},t)})})]})})]})};
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import React,{useContext,useEffect,useState}from"react";import{Button}from"primereact/button";import{DataTable}from"primereact/datatable";import{Column}from"primereact/column";import{ConfirmDialog,confirmDialog}from"primereact/confirmdialog";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";import{CalibrationEntryDialog}from"./CalibrationEntryDialog";import{AssetEditDialog}from"./AssetEditDialog";export const AssetDetailView=()=>{const{selection:e,schemas:t,roles:s,readAsset:i,listCalibrations:a,readCalibration:r,readUsage:l,refreshAssets:n,setSelection:o}=useAms(),{invoke:d}=useContext(EventEmitterContext),[c,m]=useState(null),[p,u]=useState([]),[_,h]=useState(null),[x,f]=useState(!1),[y,j]=useState(null),[b,g]=useState(!1),[v,C]=useState(!1),S=async()=>{if(!e.assetId)return m(null),u([]),void h(null);const t=await i(e.assetId);m(t);const s=await a(e.assetId),n=await Promise.all(s.map(t=>r(e.assetId,t)));u(n.filter(Boolean));const o=await l(e.assetId);h(o)};if(useEffect(()=>{S()},[e.assetId]),!e.assetId)return _jsx("div",{style:{padding:"1rem",color:"#9ca3af"},children:"Select an asset from the registry to see its details."});if(!c)return _jsx("div",{style:{padding:"1rem"},children:"Loading…"});const w=t[c.asset_type]?.label??c.asset_type,A=s[c.asset_type]?.find(e=>e.location===c.location),D=A?A.label??A.location:c.location,E=Array.isArray(t[c.asset_type]?.fields)?t[c.asset_type].fields:[],k=c.custom??{},I=A?.used_by_modules??[];return _jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr auto 1fr",gap:"0.5rem 1.5rem",alignItems:"baseline"},children:[_jsx("strong",{children:"Asset ID"})," ",_jsx("span",{children:c.asset_id}),_jsx("strong",{children:"Type"})," ",_jsx("span",{children:w}),_jsx("strong",{children:"Serial"})," ",_jsx("span",{children:c.serial||_jsx("em",{style:{color:"#9ca3af"},children:"(none)"})}),_jsx("strong",{children:"Role"})," ",_jsx("span",{children:D||_jsx("em",{style:{color:"#9ca3af"},children:"(none)"})}),_jsx("strong",{children:"Status"})," ",_jsx("span",{children:c.status}),_jsx("strong",{children:"Installed"}),_jsx("span",{children:c.install_date?new Date(c.install_date).toLocaleString():"—"}),_jsx("strong",{children:"Current Cal"}),_jsx("span",{children:c.current_calibration_id??_jsx("em",{style:{color:"#f59e0b"},children:"none"})}),_jsx("strong",{children:"Cycles"})," ",_jsx("span",{children:_?.cycles??0})]}),I.length>0&&_jsxs("div",{style:{fontSize:"0.875rem",color:"#34d399"},children:["✓ Feeds module ",1===I.length?"config":"configs",":"," ",_jsx("strong",{children:I.join(", ")})," — ","their ",_jsxs("code",{children:["$","${ams.by_location."+c.location+".*}"]})," ","placeholders will resolve to the values below."]}),E.length>0&&_jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:"Nameplate"}),_jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.25rem 1rem",alignItems:"baseline",fontSize:"0.9rem"},children:E.map(e=>{const t=k[e.name],s=null!=t&&""!==t,i=e.label??e.name,a=s?e.units?`${t} ${e.units}`:String(t):"(not set)";return _jsxs(React.Fragment,{children:[_jsx("strong",{title:e.description??void 0,children:i}),_jsx("span",{style:{color:s?void 0:"#f59e0b"},children:a})]},e.name)})})]}),_jsx(SubLocationsPanel,{schema:t[c.asset_type]?.sub_locations,values:c.sub_locations}),_jsx(SubLocationsCalibrationPanel,{schema:t[c.asset_type]?.sub_locations,currentCalibration:p.find(e=>e.cal_id===c.current_calibration_id)}),_jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_jsx("h4",{style:{margin:0},children:"Calibration History"}),_jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[_jsx(Button,{label:"Edit",icon:"pi pi-pencil",outlined:!0,onClick:()=>C(!0),tooltip:"Edit serial, role, nameplate, and per-axis values. Type and install date are immutable.",tooltipOptions:{position:"left"}}),"active"===c.status&&_jsx(Button,{label:"Retire",icon:"pi pi-power-off",severity:"warning",outlined:!0,onClick:async()=>{if(c)try{const e=await d("ams.update_asset",MessageType.Request,{asset_id:c.asset_id,status:"retired"});e?.success&&(await n(),await S())}catch(e){}},tooltip:"Mark inactive. The asset stays on disk; deletion is a separate action available after retirement.",tooltipOptions:{position:"left"}}),"retired"===c.status&&_jsx(Button,{label:"Delete",icon:"pi pi-trash",severity:"danger",outlined:!0,loading:b,onClick:()=>{c&&confirmDialog({message:_jsxs("div",{children:[_jsxs("p",{style:{marginTop:0},children:["Permanently delete asset ",_jsx("code",{children:c.asset_id}),"?"]}),_jsx("p",{style:{marginBottom:0,fontSize:"0.875rem",color:"#9ca3af"},children:"This removes the AMS record (nameplate, calibration history, usage counters). Historical test records that referenced this asset are unaffected — they carry the full asset and calibration data inline."})]}),header:"Delete asset",icon:"pi pi-exclamation-triangle",acceptLabel:"Delete",rejectLabel:"Cancel",acceptClassName:"p-button-danger",accept:()=>{(async()=>{if(c){g(!0);try{const e=await d("ams.delete_asset",MessageType.Request,{asset_id:c.asset_id});e?.success?(o({assetType:null,assetId:null}),await n()):alert(`Delete failed: ${e?.error_message??"unknown error"}`)}catch(e){alert(`Delete threw: ${e?.message??e}`)}finally{g(!1)}}})()}})},tooltip:"Permanent. Removes the AMS record; historical test snapshots are preserved inline.",tooltipOptions:{position:"left"}}),_jsx(Button,{label:"+ Calibration",icon:"pi pi-plus",onClick:()=>{j(null),f(!0)}})]})]}),_jsx(ConfirmDialog,{}),_jsxs(DataTable,{value:p,size:"small",stripedRows:!0,emptyMessage:"No calibrations recorded for this asset.",children:[_jsx(Column,{field:"cal_id",header:"Cal ID"}),_jsx(Column,{field:"performed_at",header:"Performed",body:e=>e.performed_at?new Date(e.performed_at).toLocaleString():"—"}),_jsx(Column,{field:"performed_by",header:"By"}),_jsx(Column,{field:"expires_at",header:"Expires",body:e=>e.expires_at?new Date(e.expires_at).toLocaleDateString():"—"}),_jsx(Column,{field:"cert_ref",header:"Cert"}),_jsx(Column,{header:"Values",body:e=>_jsx("code",{style:{fontSize:"0.75rem"},children:JSON.stringify(e.values)})}),_jsx(Column,{header:"",style:{width:"5rem"},body:e=>e.cal_id===c.current_calibration_id?_jsx(Button,{icon:"pi pi-pencil",text:!0,rounded:!0,size:"small",tooltip:"Edit this calibration (fixes a typo in place).",tooltipOptions:{position:"left"},onClick:()=>{j(e),f(!0)}}):null})]}),_jsx(CalibrationEntryDialog,{visible:x,assetId:c.asset_id,assetType:c.asset_type,editing:y,onHide:()=>{f(!1),j(null)},onAdded:()=>{S()}}),_jsx(AssetEditDialog,{visible:v,asset:c,onHide:()=>C(!1),onSaved:async()=>{await n(),await S()}})]})};const SubLocationsPanel=({schema:e,values:t})=>{if(!e||!Array.isArray(e.keys)||!Array.isArray(e.fields))return null;const s=t&&"object"==typeof t?t:{};return _jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:e.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:e.key_label??"Key"}),e.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:""]},e.name))]})}),_jsx("tbody",{children:e.keys.map(t=>{const i=s[t]??{};return _jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:t}),e.fields.map(e=>{const t=i[e.name],s=null!=t&&""!==t;return _jsx("td",{style:{padding:"0.25rem 0.5rem",color:s?void 0:"#f59e0b"},children:s?String(t):"(not set)"},e.name)})]},t)})})]})})]})},SubLocationsCalibrationPanel=({schema:e,currentCalibration:t})=>{if(!e||!Array.isArray(e.keys)||!Array.isArray(e.calibration_fields)||0===e.calibration_fields.length)return null;if(!t)return null;const s=t.values&&"object"==typeof t.values?t.values:{};return _jsxs("div",{children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:"Current Calibration — Per-axis Values"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:e.key_label??"Key"}),e.calibration_fields.map(e=>_jsxs("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:""]},e.name))]})}),_jsx("tbody",{children:e.keys.map(t=>{const i=s[t]??{};return _jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:t}),e.calibration_fields.map(e=>{const t=i[e.name],s=null!=t&&""!==t;return _jsx("td",{style:{padding:"0.25rem 0.5rem",color:s?void 0:"#f59e0b"},children:s?String(t):"(not set)"},e.name)})]},t)})})]})})]})};
@@ -1 +1 @@
1
- {"version":3,"file":"AssetEditDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AssetEditDialog.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAkCxE,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB;;yDAEqD;IACrD,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AA8DD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAypB1D,CAAC"}
1
+ {"version":3,"file":"AssetEditDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AssetEditDialog.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAkCxE,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB;;yDAEqD;IACrD,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AA8DD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuqB1D,CAAC"}
@@ -1 +1 @@
1
- import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import React,{useContext,useEffect,useMemo,useState}from"react";import{Button}from"primereact/button";import{Calendar}from"primereact/calendar";import{Dialog}from"primereact/dialog";import{Dropdown}from"primereact/dropdown";import{InputText}from"primereact/inputtext";import{InputTextarea}from"primereact/inputtextarea";import{TabPanel,TabView}from"primereact/tabview";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";const ROLE_OTHER="__other__";function fieldsFor(e,t){const r=e?.[t]?.fields;return Array.isArray(r)?r:[]}function subLocationsFor(e,t){const r=e?.[t]?.sub_locations;return r&&Array.isArray(r.keys)&&Array.isArray(r.fields)?r:null}function calibrationFieldsFor(e,t){const r=e?.[t]?.calibration_fields;return Array.isArray(r)?r:[]}function perAxisCalibrationFieldsFor(e){return e?.calibration_fields??[]}function coerceField(e,t){if(void 0!==t&&""!==t)switch(e.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const e=Number(t);return Number.isFinite(e)?e:void 0}case"bool":return"true"===t||"1"===t;default:return t}}function seedFromCustom(e,t){if(!e)return"";const r=e[t];return null==r?"":String(r)}export const AssetEditDialog=({visible:e,asset:t,onHide:r,onSaved:s})=>{const{schemas:n,roles:a,readCalibration:o}=useAms(),{invoke:i}=useContext(EventEmitterContext),l=t?.asset_type??"",d=useMemo(()=>fieldsFor(n,l),[n,l]),c=useMemo(()=>subLocationsFor(n,l),[n,l]),u=useMemo(()=>calibrationFieldsFor(n,l),[n,l]),m=useMemo(()=>perAxisCalibrationFieldsFor(c),[c]),p=m.length>0,_=p||u.length>0,f=useMemo(()=>l?a[l]??[]:[],[l,a]),x=f.length>0,h=useMemo(()=>{const e=f.map(e=>({label:e.label??e.location,value:e.location}));return e.push({label:"Other (advanced — type a custom role)",value:ROLE_OTHER}),e},[f]),[g,y]=useState(""),[b,v]=useState(""),[j,C]=useState({}),[T,S]=useState({}),[F,E]=useState(!1),[w,A]=useState(null),[R,k]=useState(0),[I,O]=useState(null),[$,L]=useState(""),[M,q]=useState(null),[D,H]=useState(""),[B,P]=useState(""),[z,N]=useState({}),[K,V]=useState({});useEffect(()=>{if(!e||!t)return;A(null),E(!1),k(0);const r="string"==typeof t.location?t.location:"",s=f.find(e=>e.location===r);""===r?(y(""),v("")):s?(y(r),v(r)):(y(ROLE_OTHER),v(r));const n={};for(const e of d)n[e.name]=seedFromCustom(t.custom,e.name);C(n);const a={};if(c){const e=t.sub_locations&&"object"==typeof t.sub_locations?t.sub_locations:{};for(const t of c.keys){const r=e[t]&&"object"==typeof e[t]?e[t]:{},s={};for(const e of c.fields){const t=r[e.name];s[e.name]=null==t?"":String(t)}a[t]=s}}S(a),O(null),L(""),q(null),H(""),P(""),N({}),V({});const i="string"==typeof t.current_calibration_id?t.current_calibration_id:"";if(!i)return;let l=!1;return(async()=>{const e=await o(t.asset_id,i);if(l||!e)return;O(e),L("string"==typeof e.performed_by?e.performed_by:""),H("string"==typeof e.cert_ref?e.cert_ref:""),P("string"==typeof e.notes?e.notes:""),q(e.expires_at?new Date(e.expires_at):null);const r=e.values&&"object"==typeof e.values?e.values:{};if(p&&c){const e={};for(const t of c.keys){const s=r[t]&&"object"==typeof r[t]?r[t]:{},n={};for(const e of m){const t=s[e.name];n[e.name]=null==t?"":String(t)}e[t]=n}V(e)}else{const e={};for(const t of u){const s=r[t.name];e[t.name]=null==s?"":String(s)}N(e)}})(),()=>{l=!0}},[e,t,d,c,f,u,m,p,o]);const W=()=>{if(p&&c){const e={};for(const t of c.keys){const r={};for(const e of m){const s=coerceField(e,K[t]?.[e.name]??"");void 0!==s&&(r[e.name]=s)}e[t]=r}return e}const e={};for(const t of u){const r=coerceField(t,z[t.name]??"");void 0!==r&&(e[t.name]=r)}return e},X=!t?.asset_id||F||x&&(""===g||g===ROLE_OTHER&&!b.trim())||d.some(e=>e.required&&!j[e.name]?.toString().trim())||(c?.keys.some(e=>c.fields.some(t=>t.required&&!T[e]?.[t.name]?.toString().trim()))??!1);if(!t)return null;const G=n[l]?.label??l;return _jsxs(Dialog,{header:`Edit Asset — ${t.asset_id}`,visible:e,style:{width:"32rem"},onHide:()=>{F||r()},footer:_jsxs(_Fragment,{children:[_jsx(Button,{label:"Cancel",severity:"secondary",onClick:r,disabled:F}),_jsx(Button,{label:"Save",icon:"pi pi-check",onClick:async()=>{if(!t?.asset_id)return;E(!0),A(null);const e={};for(const t of d){const r=coerceField(t,j[t.name]??"");void 0!==r&&(e[t.name]=r)}let n;if(c){n={};for(const e of c.keys){const t={};for(const r of c.fields){const s=coerceField(r,T[e]?.[r.name]??"");void 0!==s&&(t[r.name]=s)}n[e]=t}}const a={asset_id:t.asset_id,location:b,custom:e};n&&(a.sub_locations=n);try{const e=await i("ams.update_asset",MessageType.Request,a);if(!e?.success)return void A(e?.error_message??"update_asset failed");if(I){const e={asset_id:t.asset_id,cal_id:I.cal_id,performed_by:$,expires_at:M?M.toISOString():null,cert_ref:D,notes:B,values:W()},r=await i("ams.update_calibration",MessageType.Request,e);if(!r?.success)return A(r?.error_message??"update_calibration failed"),void k(1)}s?.(),r()}catch(e){A(String(e?.message??e))}finally{E(!1)}},loading:F,disabled:X})]}),children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.25rem 1rem",fontSize:"0.875rem",color:"var(--text-secondary-color)",marginBottom:"0.75rem"},children:[_jsx("span",{children:"Type"})," ",_jsx("span",{children:G}),_jsx("span",{children:"Serial"})," ",_jsx("span",{children:t.serial||_jsx("em",{children:"(none)"})}),t.install_date&&_jsxs(_Fragment,{children:[_jsx("span",{children:"Installed"}),_jsx("span",{children:new Date(t.install_date).toLocaleString()})]})]}),_jsxs(TabView,{activeIndex:R,onTabChange:e=>k(e.index),children:[_jsxs(TabPanel,{header:"Asset",children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[x&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Role *"}),_jsx(Dropdown,{value:g,options:h,onChange:e=>{var t;(t=e.value)===ROLE_OTHER?y(ROLE_OTHER):(y(t),v(t))},placeholder:"Choose where this asset is mounted"}),g===ROLE_OTHER&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Custom role"}),_jsx(InputText,{value:b,placeholder:"e.g. tsdr_secondary",onChange:e=>v(e.target.value)})]})]}),d.map(e=>{const t=e.label??e.name,r=e.units?`${t} [${e.units}]${e.required?" *":""}`:`${t}${e.required?" *":""}`,s="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:r}),"bool"===e.type?_jsx(Dropdown,{value:j[e.name]??"",options:[{label:"true",value:"true"},{label:"false",value:"false"}],onChange:t=>C(r=>({...r,[e.name]:t.value})),placeholder:"—"}):_jsx(InputText,{value:j[e.name]??"",keyfilter:s?"num":void 0,placeholder:e.description??void 0,onChange:t=>C(r=>({...r,[e.name]:t.target.value}))})]},e.name)})]}),c&&_jsxs("div",{style:{marginTop:"1.5rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:c.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:c.key_label??"Key"}),c.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:c.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),c.fields.map(t=>{const r=T[e]?.[t.name]??"",s="string"!==t.type&&"bool"!==t.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:r,keyfilter:s?"num":void 0,onChange:r=>{const s=r.target.value;S(r=>({...r,[e]:{...r[e]??{},[t.name]:s}}))},style:{width:"100%"}})},t.name)})]},e))})]})})]})]}),I&&_jsxs(TabPanel,{header:`Calibration (${I.cal_id})`,children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[_jsx("label",{children:"Performed by"}),_jsx(InputText,{value:$,onChange:e=>L(e.target.value)}),_jsx("label",{children:"Expires at"}),_jsx(Calendar,{value:M,onChange:e=>q(e.value??null),showIcon:!0,dateFormat:"yy-mm-dd"}),_jsx("label",{children:"Certificate ref"}),_jsx(InputText,{value:D,onChange:e=>H(e.target.value),placeholder:"e.g. ADC-CAL-2026-1043"}),_jsx("label",{children:"Notes"}),_jsx(InputTextarea,{value:B,rows:3,onChange:e=>P(e.target.value),autoResize:!0})]}),_&&_jsxs("div",{style:{marginTop:"1rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:p?c?.label??"Per-axis calibration":"Calibration values"}),_jsx("div",p&&c?{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:c.key_label??"Key"}),m.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:c.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),m.map(t=>{const r=K[e]?.[t.name]??"",s="string"!==t.type&&"bool"!==t.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:r,keyfilter:s?"num":void 0,onChange:r=>{const s=r.target.value;V(r=>({...r,[e]:{...r[e]??{},[t.name]:s}}))},style:{width:"100%"}})},t.name)})]},e))})]})}:{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:u.map(e=>{const t=e.label??e.name,r=e.units?`${t} [${e.units}]${e.required?" *":""}`:`${t}${e.required?" *":""}`,s="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:r}),_jsx(InputText,{value:z[e.name]??"",keyfilter:s?"num":void 0,onChange:t=>N(r=>({...r,[e.name]:t.target.value}))})]},e.name)})})]})]})]}),w&&_jsx("div",{style:{marginTop:"1rem",color:"#ef4444"},children:w})]})};
1
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import React,{useContext,useEffect,useMemo,useState}from"react";import{Button}from"primereact/button";import{Calendar}from"primereact/calendar";import{Dialog}from"primereact/dialog";import{Dropdown}from"primereact/dropdown";import{InputText}from"primereact/inputtext";import{InputTextarea}from"primereact/inputtextarea";import{TabPanel,TabView}from"primereact/tabview";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";const ROLE_OTHER="__other__";function fieldsFor(e,t){const r=e?.[t]?.fields;return Array.isArray(r)?r:[]}function subLocationsFor(e,t){const r=e?.[t]?.sub_locations;return r&&Array.isArray(r.keys)&&Array.isArray(r.fields)?r:null}function calibrationFieldsFor(e,t){const r=e?.[t]?.calibration_fields;return Array.isArray(r)?r:[]}function perAxisCalibrationFieldsFor(e){return e?.calibration_fields??[]}function coerceField(e,t){if(void 0!==t&&""!==t)switch(e.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const e=Number(t);return Number.isFinite(e)?e:void 0}case"bool":return"true"===t||"1"===t;default:return t}}function seedFromCustom(e,t){if(!e)return"";const r=e[t];return null==r?"":String(r)}export const AssetEditDialog=({visible:e,asset:t,onHide:r,onSaved:s})=>{const{schemas:n,roles:a,readCalibration:o}=useAms(),{invoke:i}=useContext(EventEmitterContext),l=t?.asset_type??"",d=useMemo(()=>fieldsFor(n,l),[n,l]),c=useMemo(()=>subLocationsFor(n,l),[n,l]),u=useMemo(()=>calibrationFieldsFor(n,l),[n,l]),m=useMemo(()=>perAxisCalibrationFieldsFor(c),[c]),p=m.length>0,_=p||u.length>0,f=useMemo(()=>l?a[l]??[]:[],[l,a]),x=f.length>0,h=useMemo(()=>{const e=f.map(e=>({label:e.label??e.location,value:e.location}));return e.push({label:"Other (advanced — type a custom role)",value:ROLE_OTHER}),e},[f]),[g,y]=useState(""),[b,v]=useState(""),[j,C]=useState(""),[T,S]=useState({}),[F,E]=useState({}),[w,A]=useState(!1),[R,k]=useState(null),[I,O]=useState(0),[$,L]=useState(null),[M,q]=useState(""),[D,H]=useState(null),[B,P]=useState(""),[z,N]=useState(""),[K,V]=useState({}),[W,X]=useState({});useEffect(()=>{if(!e||!t)return;k(null),A(!1),O(0),C("string"==typeof t.serial?t.serial:"");const r="string"==typeof t.location?t.location:"",s=f.find(e=>e.location===r);""===r?(y(""),v("")):s?(y(r),v(r)):(y(ROLE_OTHER),v(r));const n={};for(const e of d)n[e.name]=seedFromCustom(t.custom,e.name);S(n);const a={};if(c){const e=t.sub_locations&&"object"==typeof t.sub_locations?t.sub_locations:{};for(const t of c.keys){const r=e[t]&&"object"==typeof e[t]?e[t]:{},s={};for(const e of c.fields){const t=r[e.name];s[e.name]=null==t?"":String(t)}a[t]=s}}E(a),L(null),q(""),H(null),P(""),N(""),V({}),X({});const i="string"==typeof t.current_calibration_id?t.current_calibration_id:"";if(!i)return;let l=!1;return(async()=>{const e=await o(t.asset_id,i);if(l||!e)return;L(e),q("string"==typeof e.performed_by?e.performed_by:""),P("string"==typeof e.cert_ref?e.cert_ref:""),N("string"==typeof e.notes?e.notes:""),H(e.expires_at?new Date(e.expires_at):null);const r=e.values&&"object"==typeof e.values?e.values:{};if(p&&c){const e={};for(const t of c.keys){const s=r[t]&&"object"==typeof r[t]?r[t]:{},n={};for(const e of m){const t=s[e.name];n[e.name]=null==t?"":String(t)}e[t]=n}X(e)}else{const e={};for(const t of u){const s=r[t.name];e[t.name]=null==s?"":String(s)}V(e)}})(),()=>{l=!0}},[e,t,d,c,f,u,m,p,o]);const G=()=>{if(p&&c){const e={};for(const t of c.keys){const r={};for(const e of m){const s=coerceField(e,W[t]?.[e.name]??"");void 0!==s&&(r[e.name]=s)}e[t]=r}return e}const e={};for(const t of u){const r=coerceField(t,K[t.name]??"");void 0!==r&&(e[t.name]=r)}return e},J=!t?.asset_id||w||x&&(""===g||g===ROLE_OTHER&&!b.trim())||d.some(e=>e.required&&!T[e.name]?.toString().trim())||(c?.keys.some(e=>c.fields.some(t=>t.required&&!F[e]?.[t.name]?.toString().trim()))??!1);if(!t)return null;const Q=n[l]?.label??l;return _jsxs(Dialog,{header:`Edit Asset — ${t.asset_id}`,visible:e,style:{width:"32rem"},onHide:()=>{w||r()},footer:_jsxs(_Fragment,{children:[_jsx(Button,{label:"Cancel",severity:"secondary",onClick:r,disabled:w}),_jsx(Button,{label:"Save",icon:"pi pi-check",onClick:async()=>{if(!t?.asset_id)return;A(!0),k(null);const e={};for(const t of d){const r=coerceField(t,T[t.name]??"");void 0!==r&&(e[t.name]=r)}let n;if(c){n={};for(const e of c.keys){const t={};for(const r of c.fields){const s=coerceField(r,F[e]?.[r.name]??"");void 0!==s&&(t[r.name]=s)}n[e]=t}}const a={asset_id:t.asset_id,location:b,serial:j,custom:e};n&&(a.sub_locations=n);try{const e=await i("ams.update_asset",MessageType.Request,a);if(!e?.success)return void k(e?.error_message??"update_asset failed");if($){const e={asset_id:t.asset_id,cal_id:$.cal_id,performed_by:M,expires_at:D?D.toISOString():null,cert_ref:B,notes:z,values:G()},r=await i("ams.update_calibration",MessageType.Request,e);if(!r?.success)return k(r?.error_message??"update_calibration failed"),void O(1)}s?.(),r()}catch(e){k(String(e?.message??e))}finally{A(!1)}},loading:w,disabled:J})]}),children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.25rem 1rem",fontSize:"0.875rem",color:"var(--text-secondary-color)",marginBottom:"0.75rem"},children:[_jsx("span",{children:"Type"})," ",_jsx("span",{children:Q}),t.install_date&&_jsxs(_Fragment,{children:[_jsx("span",{children:"Installed"}),_jsx("span",{children:new Date(t.install_date).toLocaleString()})]})]}),_jsxs(TabView,{activeIndex:I,onTabChange:e=>O(e.index),children:[_jsxs(TabPanel,{header:"Asset",children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[_jsx("label",{children:"Serial"}),_jsx(InputText,{value:j,placeholder:"(none)",onChange:e=>C(e.target.value)}),x&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Role *"}),_jsx(Dropdown,{value:g,options:h,onChange:e=>{var t;(t=e.value)===ROLE_OTHER?y(ROLE_OTHER):(y(t),v(t))},placeholder:"Choose where this asset is mounted"}),g===ROLE_OTHER&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Custom role"}),_jsx(InputText,{value:b,placeholder:"e.g. tsdr_secondary",onChange:e=>v(e.target.value)})]})]}),d.map(e=>{const t=e.label??e.name,r=e.units?`${t} [${e.units}]${e.required?" *":""}`:`${t}${e.required?" *":""}`,s="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:r}),"bool"===e.type?_jsx(Dropdown,{value:T[e.name]??"",options:[{label:"true",value:"true"},{label:"false",value:"false"}],onChange:t=>S(r=>({...r,[e.name]:t.value})),placeholder:"—"}):_jsx(InputText,{value:T[e.name]??"",keyfilter:s?"num":void 0,placeholder:e.description??void 0,onChange:t=>S(r=>({...r,[e.name]:t.target.value}))})]},e.name)})]}),c&&_jsxs("div",{style:{marginTop:"1.5rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:c.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:c.key_label??"Key"}),c.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:c.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),c.fields.map(t=>{const r=F[e]?.[t.name]??"",s="string"!==t.type&&"bool"!==t.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:r,keyfilter:s?"num":void 0,onChange:r=>{const s=r.target.value;E(r=>({...r,[e]:{...r[e]??{},[t.name]:s}}))},style:{width:"100%"}})},t.name)})]},e))})]})})]})]}),$&&_jsxs(TabPanel,{header:`Calibration (${$.cal_id})`,children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[_jsx("label",{children:"Performed by"}),_jsx(InputText,{value:M,onChange:e=>q(e.target.value)}),_jsx("label",{children:"Expires at"}),_jsx(Calendar,{value:D,onChange:e=>H(e.value??null),showIcon:!0,dateFormat:"yy-mm-dd"}),_jsx("label",{children:"Certificate ref"}),_jsx(InputText,{value:B,onChange:e=>P(e.target.value),placeholder:"e.g. ADC-CAL-2026-1043"}),_jsx("label",{children:"Notes"}),_jsx(InputTextarea,{value:z,rows:3,onChange:e=>N(e.target.value),autoResize:!0})]}),_&&_jsxs("div",{style:{marginTop:"1rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:p?c?.label??"Per-axis calibration":"Calibration values"}),_jsx("div",p&&c?{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:c.key_label??"Key"}),m.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:c.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),m.map(t=>{const r=W[e]?.[t.name]??"",s="string"!==t.type&&"bool"!==t.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:r,keyfilter:s?"num":void 0,onChange:r=>{const s=r.target.value;X(r=>({...r,[e]:{...r[e]??{},[t.name]:s}}))},style:{width:"100%"}})},t.name)})]},e))})]})}:{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:u.map(e=>{const t=e.label??e.name,r=e.units?`${t} [${e.units}]${e.required?" *":""}`:`${t}${e.required?" *":""}`,s="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:r}),_jsx(InputText,{value:K[e.name]??"",keyfilter:s?"num":void 0,onChange:t=>V(r=>({...r,[e.name]:t.target.value}))})]},e.name)})})]})]})]}),R&&_jsx("div",{style:{marginTop:"1rem",color:"#ef4444"},children:R})]})};
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Touch-friendly row sizing for the AMS asset list.
3
+ *
4
+ * The shop-floor HMI is a touchscreen and operators were mis-tapping
5
+ * the dense default DataTable rows. Adding vertical padding to each
6
+ * body cell enlarges the per-row touch target without changing the
7
+ * column layout or text size.
8
+ */
9
+ .ams-asset-table .p-datatable-tbody > tr > td {
10
+ padding-top: 0.9rem;
11
+ padding-bottom: 0.9rem;
12
+ }
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
+ import './AssetRegistryTable.css';
2
3
  export declare const AssetRegistryTable: React.FC;
3
4
  //# sourceMappingURL=AssetRegistryTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetRegistryTable.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AssetRegistryTable.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmD,MAAM,OAAO,CAAC;AA6HxE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAqftC,CAAC"}
1
+ {"version":3,"file":"AssetRegistryTable.d.ts","sourceRoot":"","sources":["../../../src/components/ams/AssetRegistryTable.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAUxE,OAAO,0BAA0B,CAAC;AA8IlC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAkhBtC,CAAC"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import React,{useContext,useEffect,useMemo,useState}from"react";import{Button}from"primereact/button";import{DataTable}from"primereact/datatable";import{Column}from"primereact/column";import{Dropdown}from"primereact/dropdown";import{InputText}from"primereact/inputtext";import{Dialog}from"primereact/dialog";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";const ROLE_OTHER="__other__",EMPTY_ADD={open:!1,assetType:"",serial:"",roleSelection:"",location:"",customFields:{},subLocationFields:{}};function roleLabel(e){return e.label??e.location}function roleUsageSummary(e){const s=[];return e.used_by.length>0&&s.push(`Used by test method${1===e.used_by.length?"":"s"}: ${e.used_by.join(", ")}`),e.used_by_modules.length>0&&s.push(`Used by module${1===e.used_by_modules.length?"":"s"}: ${e.used_by_modules.join(", ")}`),0===s.length?"Not referenced by any test method or module.":s.join(" • ")}function fieldsFor(e,s){const t=e?.[s]?.fields;return Array.isArray(t)?t:[]}function subLocationsFor(e,s){const t=e?.[s]?.sub_locations;return t&&Array.isArray(t.keys)&&Array.isArray(t.fields)?t:null}function coerceField(e,s){if(void 0!==s&&""!==s)switch(e.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const e=Number(s);return Number.isFinite(e)?e:void 0}case"bool":return"true"===s||"1"===s;default:return s}}export const AssetRegistryTable=()=>{const{schemas:e,roles:s,assets:t,refreshAssets:o,setSelection:l,selection:a}=useAms(),{invoke:r}=useContext(EventEmitterContext),[i,n]=useState(null),[c,d]=useState(null),[u,m]=useState(EMPTY_ADD);useEffect(()=>{const e=e=>{const s=e.detail,t=s?.assetType??"",o=s?.location??"";t&&m({...EMPTY_ADD,open:!0,assetType:t,roleSelection:o,location:o})};return window.addEventListener("ams:prefill-add",e),()=>window.removeEventListener("ams:prefill-add",e)},[]);const p=useMemo(()=>Object.keys(e).map(s=>({label:e[s]?.label??s,value:s})),[e]),y=useMemo(()=>u.assetType?s[u.assetType]??[]:[],[u.assetType,s]),_=y.length>0,h=useMemo(()=>{const e=y.map(e=>({label:roleLabel(e),value:e.location}));return e.push({label:"Other (advanced — type a custom role)",value:ROLE_OTHER}),e},[y]),b=useMemo(()=>u.roleSelection===ROLE_OTHER?null:y.find(e=>e.location===u.roleSelection)??null,[u.roleSelection,y]),f=useMemo(()=>t.filter(e=>(!i||e.asset_type===i)&&(!c||e.status===c)),[t,i,c]),x=useMemo(()=>fieldsFor(e,u.assetType),[e,u.assetType]),g=useMemo(()=>subLocationsFor(e,u.assetType),[e,u.assetType]),j=!u.assetType||_&&(""===u.roleSelection||u.roleSelection===ROLE_OTHER&&!u.location.trim())||x.some(e=>e.required&&!u.customFields[e.name]?.toString().trim())||(g?.keys.some(e=>g.fields.some(s=>s.required&&!u.subLocationFields[e]?.[s.name]?.toString().trim()))??!1);return _jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[_jsxs("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center"},children:[_jsx(Dropdown,{value:i,options:[{label:"All Types",value:null},...p],onChange:e=>n(e.value),placeholder:"Filter by type"}),_jsx(Dropdown,{value:c,options:[{label:"All Statuses",value:null},{label:"Active",value:"active"},{label:"Out for Service",value:"out_for_service"},{label:"Retired",value:"retired"}],onChange:e=>d(e.value),placeholder:"Filter by status"}),_jsx("span",{style:{marginLeft:"auto"},children:_jsx(Button,{icon:"pi pi-plus",label:"Add Asset",onClick:()=>m(e=>({...e,open:!0})),disabled:0===p.length})})]}),_jsxs(DataTable,{value:f,selectionMode:"single",selection:f.find(e=>e.asset_id===a.assetId)??null,onSelectionChange:e=>{const s=e.value;s&&l({assetType:s.asset_type,assetId:s.asset_id})},dataKey:"asset_id",emptyMessage:0===p.length?"AMS not enabled in this project (no asset_types declared).":"No assets registered yet.",size:"small",stripedRows:!0,children:[_jsx(Column,{field:"asset_id",header:"Asset ID"}),_jsx(Column,{field:"asset_type",header:"Type",body:s=>e[s.asset_type]?.label??s.asset_type}),_jsx(Column,{field:"serial",header:"Serial"}),_jsx(Column,{field:"location",header:"Role",body:e=>e.location?((e,t)=>{const o=(s[e]??[]).find(e=>e.location===t);return o?roleLabel(o):t})(e.asset_type,e.location):_jsx("span",{style:{color:"#9ca3af"},children:"—"})}),_jsx(Column,{field:"status",header:"Status"}),_jsx(Column,{header:"Calibration",body:e=>e.current_calibration_id?_jsx("span",{title:e.current_calibration_id,children:"✓"}):_jsx("span",{style:{color:"#f59e0b"},children:"none"})})]}),_jsxs(Dialog,{header:"Add New Asset",visible:u.open,style:{width:"32rem"},onHide:()=>m(EMPTY_ADD),footer:_jsxs(_Fragment,{children:[_jsx(Button,{label:"Cancel",severity:"secondary",onClick:()=>m(EMPTY_ADD)}),_jsx(Button,{label:"Create",icon:"pi pi-check",onClick:async()=>{if(!u.assetType)return;const e={};for(const s of x){const t=u.customFields[s.name];if(void 0!==t&&""!==t)switch(s.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const o=Number(t);Number.isFinite(o)&&(e[s.name]=o);break}case"bool":e[s.name]="true"===t||"1"===t;break;default:e[s.name]=t}}const s={};if(g)for(const e of g.keys){const t={};for(const s of g.fields){const o=coerceField(s,u.subLocationFields[e]?.[s.name]??"");void 0!==o&&(t[s.name]=o)}s[e]=t}const t={asset_type:u.assetType,serial:u.serial,location:u.location,custom:e};g&&(t.sub_locations=s);try{const e=await r("ams.create_asset",MessageType.Request,t);e?.success&&(m(EMPTY_ADD),await o(),e.data?.asset_id&&l({assetType:u.assetType,assetId:e.data.asset_id}))}catch(e){}},disabled:j})]}),children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[_jsx("label",{children:"Type *"}),_jsx(Dropdown,{value:u.assetType,options:p,onChange:e=>(e=>{const t=s[e]??[],o=1===t.length?{roleSelection:t[0].location,location:t[0].location}:{roleSelection:"",location:""};m(s=>({...s,assetType:e,...o,customFields:{},subLocationFields:{}}))})(e.value),placeholder:"Choose asset type"}),_jsx("label",{children:"Serial"}),_jsx(InputText,{value:u.serial,onChange:e=>m(s=>({...s,serial:e.target.value}))}),_&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Role *"}),_jsx(Dropdown,{value:u.roleSelection,options:h,onChange:e=>{return s=e.value,void m(s===ROLE_OTHER?e=>({...e,roleSelection:ROLE_OTHER,location:""}):e=>({...e,roleSelection:s,location:s}));var s},placeholder:"Choose where this asset is mounted"}),u.roleSelection===ROLE_OTHER&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Custom role"}),_jsx(InputText,{value:u.location,placeholder:"e.g. tsdr_secondary",onChange:e=>m(s=>({...s,location:e.target.value}))})]})]}),x.map(e=>{const s=e.label??e.name,t=e.units?`${s} [${e.units}]${e.required?" *":""}`:`${s}${e.required?" *":""}`,o="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:t}),"bool"===e.type?_jsx(Dropdown,{value:u.customFields[e.name]??"",options:[{label:"true",value:"true"},{label:"false",value:"false"}],onChange:s=>m(t=>({...t,customFields:{...t.customFields,[e.name]:s.value}})),placeholder:"—"}):_jsx(InputText,{value:u.customFields[e.name]??"",keyfilter:o?"num":void 0,placeholder:e.description??void 0,onChange:s=>m(t=>({...t,customFields:{...t.customFields,[e.name]:s.target.value}}))})]},e.name)})]}),g&&_jsxs("div",{style:{marginTop:"1.5rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:g.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:g.key_label??"Key"}),g.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:g.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),g.fields.map(s=>{const t=u.subLocationFields[e]?.[s.name]??"",o="string"!==s.type&&"bool"!==s.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:t,keyfilter:o?"num":void 0,onChange:t=>{const o=t.target.value;m(t=>({...t,subLocationFields:{...t.subLocationFields,[e]:{...t.subLocationFields[e]??{},[s.name]:o}}}))},style:{width:"100%"}})},s.name)})]},e))})]})})]}),_jsxs("div",{style:{fontSize:"0.875rem",color:"#9ca3af",marginTop:"1rem"},children:[_&&b&&_jsxs(_Fragment,{children:[b.description&&_jsx("p",{style:{margin:"0 0 0.5rem 0"},children:b.description}),_jsxs("p",{style:{margin:"0 0 0.5rem 0",color:"#34d399"},children:["✓ ",roleUsageSummary(b)]})]}),_&&u.roleSelection===ROLE_OTHER&&_jsx("p",{style:{margin:"0 0 0.5rem 0",color:"#f59e0b"},children:"⚠ No test method on this machine references this custom role yet. The asset will be registered but won't be picked up at start_test unless you add an asset_ref to a test method's project.json."}),!_&&u.assetType&&_jsx("p",{style:{margin:"0 0 0.5rem 0"},children:"This asset type isn't selected by physical role on this machine — test methods reference it by ID instead. Just register the asset and pick it by ID on the Test Setup form when running a test."}),_jsxs("p",{style:{margin:0},children:["The asset_id is generated by the server (format:"," ",_jsxs("code",{children:[u.assetType?e[u.assetType]?.id_prefix??"A-":"A-","YYYYMMDDTHHMMSS"]}),"). Manufacturer serial is recorded for traceability but is not used as the unique key."]})]})]})]})};
1
+ import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import React,{useContext,useEffect,useMemo,useState}from"react";import{Button}from"primereact/button";import{DataTable}from"primereact/datatable";import{Column}from"primereact/column";import{Dropdown}from"primereact/dropdown";import{InputText}from"primereact/inputtext";import{Dialog}from"primereact/dialog";import{EventEmitterContext}from"../../core/EventEmitterContext";import{MessageType}from"../../hub/CommandMessage";import{useAms}from"./AmsProvider";import"./AssetRegistryTable.css";const ROLE_OTHER="__other__",EMPTY_ADD={open:!1,assetType:"",serial:"",roleSelection:"",location:"",customFields:{},subLocationFields:{}};function roleLabel(e){return e.label??e.location}function roleUsageSummary(e){const s=[];return e.used_by.length>0&&s.push(`Used by test method${1===e.used_by.length?"":"s"}: ${e.used_by.join(", ")}`),e.used_by_modules.length>0&&s.push(`Used by module${1===e.used_by_modules.length?"":"s"}: ${e.used_by_modules.join(", ")}`),0===s.length?"Not referenced by any test method or module.":s.join(" • ")}function fieldsFor(e,s){const t=e?.[s]?.fields;return Array.isArray(t)?t:[]}function subLocationsFor(e,s){const t=e?.[s]?.sub_locations;return t&&Array.isArray(t.keys)&&Array.isArray(t.fields)?t:null}function seedCustomFromRoleDefaults(e,s){const t={};if(!e||!e.defaults)return t;const o=new Set(s.map(e=>e.name));for(const[s,l]of Object.entries(e.defaults))o.has(s)&&null!=l&&(t[s]=String(l));return t}function coerceField(e,s){if(void 0!==s&&""!==s)switch(e.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const e=Number(s);return Number.isFinite(e)?e:void 0}case"bool":return"true"===s||"1"===s;default:return s}}export const AssetRegistryTable=()=>{const{schemas:e,roles:s,assets:t,refreshAssets:o,setSelection:l,selection:a}=useAms(),{invoke:n}=useContext(EventEmitterContext),[r,i]=useState(null),[c,d]=useState(null),[u,m]=useState(EMPTY_ADD);useEffect(()=>{const t=t=>{const o=t.detail,l=o?.assetType??"",a=o?.location??"";if(!l)return;const n=(s[l]??[]).find(e=>e.location===a),r=fieldsFor(e,l);m({...EMPTY_ADD,open:!0,assetType:l,roleSelection:a,location:a,customFields:seedCustomFromRoleDefaults(n,r)})};return window.addEventListener("ams:prefill-add",t),()=>window.removeEventListener("ams:prefill-add",t)},[s,e]);const p=useMemo(()=>Object.keys(e).map(s=>({label:e[s]?.label??s,value:s})),[e]),y=useMemo(()=>u.assetType?s[u.assetType]??[]:[],[u.assetType,s]),_=y.length>0,h=useMemo(()=>{const e=y.map(e=>({label:roleLabel(e),value:e.location}));return e.push({label:"Other (advanced — type a custom role)",value:ROLE_OTHER}),e},[y]),f=useMemo(()=>u.roleSelection===ROLE_OTHER?null:y.find(e=>e.location===u.roleSelection)??null,[u.roleSelection,y]),b=useMemo(()=>t.filter(e=>(!r||e.asset_type===r)&&(!c||e.status===c)),[t,r,c]),x=useMemo(()=>fieldsFor(e,u.assetType),[e,u.assetType]),g=useMemo(()=>subLocationsFor(e,u.assetType),[e,u.assetType]),j=!u.assetType||_&&(""===u.roleSelection||u.roleSelection===ROLE_OTHER&&!u.location.trim())||x.some(e=>e.required&&!u.customFields[e.name]?.toString().trim())||(g?.keys.some(e=>g.fields.some(s=>s.required&&!u.subLocationFields[e]?.[s.name]?.toString().trim()))??!1);return _jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[_jsxs("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center"},children:[_jsx(Dropdown,{value:r,options:[{label:"All Types",value:null},...p],onChange:e=>i(e.value),placeholder:"Filter by type"}),_jsx(Dropdown,{value:c,options:[{label:"All Statuses",value:null},{label:"Active",value:"active"},{label:"Out for Service",value:"out_for_service"},{label:"Retired",value:"retired"}],onChange:e=>d(e.value),placeholder:"Filter by status"}),_jsx("span",{style:{marginLeft:"auto"},children:_jsx(Button,{icon:"pi pi-plus",label:"Add Asset",onClick:()=>m(e=>({...e,open:!0})),disabled:0===p.length})})]}),_jsxs(DataTable,{value:b,selectionMode:"single",selection:b.find(e=>e.asset_id===a.assetId)??null,onSelectionChange:e=>{const s=e.value;s&&l({assetType:s.asset_type,assetId:s.asset_id})},dataKey:"asset_id",emptyMessage:0===p.length?"AMS not enabled in this project (no asset_types declared).":"No assets registered yet.",stripedRows:!0,className:"ams-asset-table",children:[_jsx(Column,{field:"asset_id",header:"Asset ID"}),_jsx(Column,{field:"asset_type",header:"Type",body:s=>e[s.asset_type]?.label??s.asset_type}),_jsx(Column,{field:"serial",header:"Serial"}),_jsx(Column,{field:"location",header:"Role",body:e=>e.location?((e,t)=>{const o=(s[e]??[]).find(e=>e.location===t);return o?roleLabel(o):t})(e.asset_type,e.location):_jsx("span",{style:{color:"#9ca3af"},children:"—"})}),_jsx(Column,{field:"status",header:"Status"}),_jsx(Column,{header:"Calibration",body:e=>e.current_calibration_id?_jsx("span",{title:e.current_calibration_id,children:"✓"}):_jsx("span",{style:{color:"#f59e0b"},children:"none"})})]}),_jsxs(Dialog,{header:"Add New Asset",visible:u.open,style:{width:"32rem"},onHide:()=>m(EMPTY_ADD),footer:_jsxs(_Fragment,{children:[_jsx(Button,{label:"Cancel",severity:"secondary",onClick:()=>m(EMPTY_ADD)}),_jsx(Button,{label:"Create",icon:"pi pi-check",onClick:async()=>{if(!u.assetType)return;const e={};for(const s of x){const t=u.customFields[s.name];if(void 0!==t&&""!==t)switch(s.type){case"f32":case"f64":case"i8":case"i16":case"i32":case"i64":case"u8":case"u16":case"u32":case"u64":{const o=Number(t);Number.isFinite(o)&&(e[s.name]=o);break}case"bool":e[s.name]="true"===t||"1"===t;break;default:e[s.name]=t}}const s={};if(g)for(const e of g.keys){const t={};for(const s of g.fields){const o=coerceField(s,u.subLocationFields[e]?.[s.name]??"");void 0!==o&&(t[s.name]=o)}s[e]=t}const t={asset_type:u.assetType,serial:u.serial,location:u.location,custom:e};g&&(t.sub_locations=s);try{const e=await n("ams.create_asset",MessageType.Request,t);e?.success&&(m(EMPTY_ADD),await o(),e.data?.asset_id&&l({assetType:u.assetType,assetId:e.data.asset_id}))}catch(e){}},disabled:j})]}),children:[_jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.5rem 1rem",alignItems:"center"},children:[_jsx("label",{children:"Type *"}),_jsx(Dropdown,{value:u.assetType,options:p,onChange:t=>(t=>{const o=s[t]??[],l=1===o.length?o[0]:void 0,a=l?{roleSelection:l.location,location:l.location}:{roleSelection:"",location:""},n=fieldsFor(e,t);m(e=>({...e,assetType:t,...a,customFields:seedCustomFromRoleDefaults(l,n),subLocationFields:{}}))})(t.value),placeholder:"Choose asset type"}),u.assetType&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Serial"}),_jsx(InputText,{value:u.serial,onChange:e=>m(s=>({...s,serial:e.target.value}))})]}),_&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Role *"}),_jsx(Dropdown,{value:u.roleSelection,options:h,onChange:e=>(e=>{if(e===ROLE_OTHER)return void m(e=>({...e,roleSelection:ROLE_OTHER,location:""}));const s=y.find(s=>s.location===e);m(t=>({...t,roleSelection:e,location:e,customFields:seedCustomFromRoleDefaults(s,x)}))})(e.value),placeholder:"Choose where this asset is mounted"}),u.roleSelection===ROLE_OTHER&&_jsxs(_Fragment,{children:[_jsx("label",{children:"Custom role"}),_jsx(InputText,{value:u.location,placeholder:"e.g. tsdr_secondary",onChange:e=>m(s=>({...s,location:e.target.value}))})]})]}),x.map(e=>{const s=e.label??e.name,t=e.units?`${s} [${e.units}]${e.required?" *":""}`:`${s}${e.required?" *":""}`,o="string"!==e.type&&"bool"!==e.type;return _jsxs(React.Fragment,{children:[_jsx("label",{title:e.description??void 0,children:t}),"bool"===e.type?_jsx(Dropdown,{value:u.customFields[e.name]??"",options:[{label:"true",value:"true"},{label:"false",value:"false"}],onChange:s=>m(t=>({...t,customFields:{...t.customFields,[e.name]:s.value}})),placeholder:"—"}):_jsx(InputText,{value:u.customFields[e.name]??"",keyfilter:o?"num":void 0,placeholder:e.description??void 0,onChange:s=>m(t=>({...t,customFields:{...t.customFields,[e.name]:s.target.value}}))})]},e.name)})]}),g&&_jsxs("div",{style:{marginTop:"1.5rem"},children:[_jsx("h4",{style:{margin:"0 0 0.5rem 0"},children:g.label??"Sub-locations"}),_jsx("div",{style:{overflowX:"auto"},children:_jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[_jsx("thead",{children:_jsxs("tr",{children:[_jsx("th",{style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:g.key_label??"Key"}),g.fields.map(e=>_jsxs("th",{title:e.description??void 0,style:{textAlign:"left",padding:"0.25rem 0.5rem",borderBottom:"1px solid var(--surface-border)"},children:[e.label??e.name,e.units?` [${e.units}]`:"",e.required?" *":""]},e.name))]})}),_jsx("tbody",{children:g.keys.map(e=>_jsxs("tr",{children:[_jsx("td",{style:{padding:"0.25rem 0.5rem",fontWeight:600},children:e}),g.fields.map(s=>{const t=u.subLocationFields[e]?.[s.name]??"",o="string"!==s.type&&"bool"!==s.type;return _jsx("td",{style:{padding:"0.25rem 0.5rem"},children:_jsx(InputText,{value:t,keyfilter:o?"num":void 0,onChange:t=>{const o=t.target.value;m(t=>({...t,subLocationFields:{...t.subLocationFields,[e]:{...t.subLocationFields[e]??{},[s.name]:o}}}))},style:{width:"100%"}})},s.name)})]},e))})]})})]}),_jsxs("div",{style:{fontSize:"0.875rem",color:"#9ca3af",marginTop:"1rem"},children:[_&&f&&_jsxs(_Fragment,{children:[f.description&&_jsx("p",{style:{margin:"0 0 0.5rem 0"},children:f.description}),_jsxs("p",{style:{margin:"0 0 0.5rem 0",color:"#34d399"},children:["✓ ",roleUsageSummary(f)]})]}),_&&u.roleSelection===ROLE_OTHER&&_jsx("p",{style:{margin:"0 0 0.5rem 0",color:"#f59e0b"},children:"⚠ No test method on this machine references this custom role yet. The asset will be registered but won't be picked up at start_test unless you add an asset_ref to a test method's project.json."}),!_&&u.assetType&&_jsx("p",{style:{margin:"0 0 0.5rem 0"},children:"This asset type isn't selected by physical role on this machine — test methods reference it by ID instead. Just register the asset and pick it by ID on the Test Setup form when running a test."}),_jsxs("p",{style:{margin:0},children:["The asset_id is generated by the server (format:"," ",_jsxs("code",{children:[u.assetType?e[u.assetType]?.id_prefix??"A-":"A-","YYYYMMDDTHHMMSS"]}),"). Manufacturer serial is recorded for traceability but is not used as the unique key."]})]})]})]})};
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import*as React from"react";import"./forms.css";export const FormRow=({label:r,required:s,hint:a,error:e,htmlFor:o,children:l})=>_jsxs("div",{className:"ac-form-row"+(e?" ac-form-row--error":""),children:[_jsxs("label",{className:"ac-form-row__label",htmlFor:o,children:[r,s&&_jsx("span",{className:"ac-form-row__required","aria-hidden":!0,children:" *"}),a&&_jsx("small",{className:"ac-form-row__hint",children:a})]}),_jsxs("div",{className:"ac-form-row__field",children:[l,e&&_jsx("small",{className:"ac-form-row__error",children:e})]})]});export default FormRow;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import*as React from"react";import"./forms.css";export const FormRow=({label:r,required:s,hint:a,error:e,htmlFor:o,children:l})=>_jsxs("div",{className:"ac-formrow"+(e?" ac-formrow--error":""),children:[_jsxs("label",{className:"ac-formrow__label",htmlFor:o,children:[r,s&&_jsx("span",{className:"ac-formrow__required","aria-hidden":!0,children:" *"}),a&&_jsx("small",{className:"ac-formrow__hint",children:a})]}),_jsxs("div",{className:"ac-formrow__field",children:[l,e&&_jsx("small",{className:"ac-formrow__error",children:e})]})]});export default FormRow;
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import*as React from"react";import"./forms.css";export const FormSection=({title:s,description:c,actions:e,children:a})=>_jsxs("section",{className:"ac-form-section",children:[(s||e)&&_jsxs("header",{className:"ac-form-section__header",children:[_jsxs("div",{children:[s&&_jsx("h3",{className:"ac-form-section__title",children:s}),c&&_jsx("small",{className:"ac-form-section__desc",children:c})]}),e&&_jsx("div",{className:"ac-form-section__actions",children:e})]}),_jsx("div",{className:"ac-form-section__body",children:a})]});export default FormSection;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import*as React from"react";import"./forms.css";export const FormSection=({title:s,description:c,actions:e,children:a})=>_jsxs("section",{className:"ac-formsection",children:[(s||e)&&_jsxs("header",{className:"ac-formsection__header",children:[_jsxs("div",{children:[s&&_jsx("h3",{className:"ac-formsection__title",children:s}),c&&_jsx("small",{className:"ac-formsection__desc",children:c})]}),e&&_jsx("div",{className:"ac-formsection__actions",children:e})]}),_jsx("div",{className:"ac-formsection__body",children:a})]});export default FormSection;