@kosdev-code/kos-ddk-model-components 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/holders/holder-card.d.ts.map +1 -1
- package/components/index.d.ts +3 -1
- package/components/index.d.ts.map +1 -1
- package/components/notification-card-view/notification-card-view.d.ts.map +1 -1
- package/components/pump-cards/index.d.ts +1 -0
- package/components/pump-cards/index.d.ts.map +1 -1
- package/components/pump-cards/super-pump/index.d.ts +2 -0
- package/components/pump-cards/super-pump/index.d.ts.map +1 -0
- package/components/pump-cards/super-pump/super-pump-card.d.ts +9 -0
- package/components/pump-cards/super-pump/super-pump-card.d.ts.map +1 -0
- package/components/remote-nns-modal/index.d.ts +2 -0
- package/components/remote-nns-modal/index.d.ts.map +1 -0
- package/components/remote-nns-modal/remote-nns-modal.d.ts +11 -0
- package/components/remote-nns-modal/remote-nns-modal.d.ts.map +1 -0
- package/components/remote-tray/detail/remote-tray.d.ts +9 -0
- package/components/remote-tray/detail/remote-tray.d.ts.map +1 -0
- package/components/remote-tray/index.d.ts +3 -0
- package/components/remote-tray/index.d.ts.map +1 -0
- package/components/remote-tray/summary/remote-tray.d.ts +9 -0
- package/components/remote-tray/summary/remote-tray.d.ts.map +1 -0
- package/components/software/software.d.ts.map +1 -1
- package/components/spm-field-calibration/spm-field-calibration-modal.d.ts.map +1 -1
- package/hooks/holder-experience/holder-experience.d.ts.map +1 -1
- package/hooks/troubles/index.d.ts +2 -0
- package/hooks/troubles/index.d.ts.map +1 -1
- package/hooks/troubles/use-trouble-data.d.ts +4 -0
- package/hooks/troubles/use-trouble-data.d.ts.map +1 -0
- package/hooks/troubles/use-trouble-decoration.d.ts +111 -0
- package/hooks/troubles/use-trouble-decoration.d.ts.map +1 -0
- package/index.cjs +80 -57
- package/index.js +1741 -1443
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AA+BxC,UAAU,KAAK;IACb,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AA6CD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAiNrD,CAAC"}
|
package/components/index.d.ts
CHANGED
|
@@ -23,14 +23,16 @@ export * from './future-progress-bar';
|
|
|
23
23
|
export * from './hardware-info';
|
|
24
24
|
export * from './hold-to-pour-button';
|
|
25
25
|
export * from './holders';
|
|
26
|
-
export * from './ice-agitator';
|
|
27
26
|
export * from './ice-agitator-settings-view';
|
|
27
|
+
export * from './ice-agitator';
|
|
28
28
|
export * from './localization-settings';
|
|
29
29
|
export * from './network-test-results';
|
|
30
30
|
export * from './notification-card-view';
|
|
31
31
|
export * from './plugin-tabs';
|
|
32
32
|
export * from './pump-cards';
|
|
33
33
|
export * from './reboot-view';
|
|
34
|
+
export * from './remote-nns-modal';
|
|
35
|
+
export * from './remote-tray';
|
|
34
36
|
export * from './replace-line';
|
|
35
37
|
export * from './replace-pump';
|
|
36
38
|
export * from './rfid-override';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/ddk/kos-ddk-model-components/src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/ddk/kos-ddk-model-components/src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-card-view.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/notification-card-view/notification-card-view.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"notification-card-view.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/notification-card-view/notification-card-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,KAAK;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAYD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CA0D5D,CAAC"}
|
|
@@ -2,6 +2,7 @@ export * from './holder-actions';
|
|
|
2
2
|
export * from './holder-notifications';
|
|
3
3
|
export * from './lfcv-pump-card';
|
|
4
4
|
export * from './msv-pump-card';
|
|
5
|
+
export * from './super-pump';
|
|
5
6
|
export * from './valve-card';
|
|
6
7
|
export * from './water-pump-card';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/pump-cards/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/pump-cards/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ddk/kos-ddk-model-components/src/components/pump-cards/super-pump/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FreestyleHolderExt } from '../../../../../../sdk/kos-freestyle-sdk/src/index.ts';
|
|
2
|
+
import { HolderModel } from '../../../../../../sdk/kos-dispense-sdk/src/index.ts';
|
|
3
|
+
|
|
4
|
+
interface CANSuperPumpProps {
|
|
5
|
+
holder: HolderModel<FreestyleHolderExt>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SuperPumpCard: React.FunctionComponent<CANSuperPumpProps>;
|
|
8
|
+
export default SuperPumpCard;
|
|
9
|
+
//# sourceMappingURL=super-pump-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"super-pump-card.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ddk/kos-ddk-model-components/src/components/pump-cards/super-pump/super-pump-card.tsx"],"names":[],"mappings":";AAQA,OAAO,EACL,KAAK,WAAW,EAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AA2BxC,UAAU,iBAAiB;IACzB,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CA6HjE,CAAC;AAEL,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-nns-modal/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RemoteTrayModel } from '../../../../../sdk/kos-freestyle-sdk/src/index.ts';
|
|
2
|
+
import { ExperienceProps } from '../../../../kos-ddk-components/src/index.ts';
|
|
3
|
+
|
|
4
|
+
interface RemoteNNSModalProps extends ExperienceProps {
|
|
5
|
+
remoteTray: RemoteTrayModel;
|
|
6
|
+
}
|
|
7
|
+
export declare const RemoteNNSModal: (({ remoteTray, onComplete }: RemoteNNSModalProps) => import("@emotion/react/jsx-runtime").JSX.Element) & {
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=remote-nns-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-nns-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-nns-modal/remote-nns-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AASxC,UAAU,mBAAoB,SAAQ,eAAe;IACnD,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,gCACI,mBAAmB;;CAsLjD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FreestyleAssemblyModel, RemoteTrayModel } from '../../../../../../sdk/kos-freestyle-sdk/src/index.ts';
|
|
2
|
+
|
|
3
|
+
interface RemoteTrayProps {
|
|
4
|
+
assembly: FreestyleAssemblyModel;
|
|
5
|
+
cardModel: RemoteTrayModel;
|
|
6
|
+
}
|
|
7
|
+
export declare const RemoteTrayDetail: React.FunctionComponent<RemoteTrayProps>;
|
|
8
|
+
export default RemoteTrayDetail;
|
|
9
|
+
//# sourceMappingURL=remote-tray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-tray.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-tray/detail/remote-tray.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAIxC,UAAU,eAAe;IACvB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAKlE,CAAC;AAEL,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-tray/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FreestyleAssemblyModel, RemoteTrayModel } from '../../../../../../sdk/kos-freestyle-sdk/src/index.ts';
|
|
2
|
+
|
|
3
|
+
interface RemoteTrayProps {
|
|
4
|
+
assembly: FreestyleAssemblyModel;
|
|
5
|
+
cardModel: RemoteTrayModel;
|
|
6
|
+
}
|
|
7
|
+
export declare const RemoteTraySummary: React.FunctionComponent<RemoteTrayProps>;
|
|
8
|
+
export default RemoteTraySummary;
|
|
9
|
+
//# sourceMappingURL=remote-tray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-tray.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-tray/summary/remote-tray.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAUxC,UAAU,eAAe;IACvB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,EAAE,eAAe,CAAC;CAC5B;AAYD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAsBnE,CAAC;AAEL,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/software/software.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"software.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/software/software.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ;;CA0BnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spm-field-calibration-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/spm-field-calibration/spm-field-calibration-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"spm-field-calibration-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/spm-field-calibration/spm-field-calibration-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AA6BhE,UAAU,6BAA8B,SAAQ,eAAe;IAC7D,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,wBAAwB,0BACZ,6BAA6B;;CA4TrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holder-experience.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/holder-experience/holder-experience.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvE,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAazE,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,WAAY,WAAW,SAAS,SAAS;;;;
|
|
1
|
+
{"version":3,"file":"holder-experience.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/holder-experience/holder-experience.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvE,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAazE,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,WAAY,WAAW,SAAS,SAAS;;;;CAyExE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/troubles/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/troubles/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-trouble-data.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/troubles/use-trouble-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGhF,eAAO,MAAM,cAAc,aAAc,YAAY,wBAcpD,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { IKosDataModel } from '../../../../../sdk/kos-ui-sdk/src/index.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for applying visual decorations based on trouble states in KOS models.
|
|
5
|
+
*
|
|
6
|
+
* This hook analyzes trouble states associated with a KOS data model and returns
|
|
7
|
+
* styling properties that can be applied to UI components to visually indicate
|
|
8
|
+
* trouble severity and status. It automatically determines appropriate background
|
|
9
|
+
* and text colors based on the highest priority trouble.
|
|
10
|
+
*
|
|
11
|
+
* @category Hooks
|
|
12
|
+
* @subcategory Trouble Management
|
|
13
|
+
*
|
|
14
|
+
* @param model - The KOS data model to check for troubles. Must implement IKosDataModel.
|
|
15
|
+
* If the model is not trouble-aware, an empty object is returned.
|
|
16
|
+
*
|
|
17
|
+
* @returns An object containing styling and trouble information:
|
|
18
|
+
* - `backgroundColor` - The background color derived from the highest priority trouble
|
|
19
|
+
* - `fontColor` - Appropriate text color (white for dark backgrounds, undefined for light)
|
|
20
|
+
* - `highestTrouble` - Reference to the highest priority trouble model
|
|
21
|
+
* - `initialized` - Whether trouble data has been initialized
|
|
22
|
+
* - `troubleCount` - Total number of visible troubles
|
|
23
|
+
* - `hasTroubles` - Boolean indicating if any troubles exist
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* // Basic usage in a component
|
|
28
|
+
* const MyComponent = ({ model }) => {
|
|
29
|
+
* const { backgroundColor, fontColor, hasTroubles } = useTroubleDecoration(model);
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <div style={{ backgroundColor, color: fontColor }}>
|
|
33
|
+
* {hasTroubles && <TroubleIndicator />}
|
|
34
|
+
* <span>Component content</span>
|
|
35
|
+
* </div>
|
|
36
|
+
* );
|
|
37
|
+
* };
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Using trouble count for badges
|
|
43
|
+
* const TroubleCard = ({ dataModel }) => {
|
|
44
|
+
* const {
|
|
45
|
+
* backgroundColor,
|
|
46
|
+
* fontColor,
|
|
47
|
+
* troubleCount,
|
|
48
|
+
* highestTrouble
|
|
49
|
+
* } = useTroubleDecoration(dataModel);
|
|
50
|
+
*
|
|
51
|
+
* return (
|
|
52
|
+
* <Card style={{ borderColor: backgroundColor }}>
|
|
53
|
+
* {troubleCount > 0 && (
|
|
54
|
+
* <Badge color={backgroundColor} textColor={fontColor}>
|
|
55
|
+
* {troubleCount} issue{troubleCount > 1 ? 's' : ''}
|
|
56
|
+
* </Badge>
|
|
57
|
+
* )}
|
|
58
|
+
* {highestTrouble && (
|
|
59
|
+
* <TroubleDetails trouble={highestTrouble} />
|
|
60
|
+
* )}
|
|
61
|
+
* </Card>
|
|
62
|
+
* );
|
|
63
|
+
* };
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* // Conditional rendering based on initialization
|
|
69
|
+
* const SafeTroubleDisplay = ({ model }) => {
|
|
70
|
+
* const { initialized, hasTroubles, backgroundColor } = useTroubleDecoration(model);
|
|
71
|
+
*
|
|
72
|
+
* if (!initialized) {
|
|
73
|
+
* return <LoadingSpinner />;
|
|
74
|
+
* }
|
|
75
|
+
*
|
|
76
|
+
* if (!hasTroubles) {
|
|
77
|
+
* return <SuccessMessage>No issues detected</SuccessMessage>;
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* return (
|
|
81
|
+
* <Alert severity="warning" style={{ backgroundColor }}>
|
|
82
|
+
* Issues detected - check system status
|
|
83
|
+
* </Alert>
|
|
84
|
+
* );
|
|
85
|
+
* };
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* - This hook only works with trouble-aware models (models that implement the TroubleAware interface)
|
|
90
|
+
* - Colors are automatically adjusted for accessibility (dark text on light backgrounds, light text on dark)
|
|
91
|
+
* - The hook respects role-based visibility filters applied by useVisibleTroubles
|
|
92
|
+
* - Re-renders automatically when trouble states change due to the underlying kosAutoEffect
|
|
93
|
+
*
|
|
94
|
+
* @see {@link useVisibleTroubles} - For accessing the filtered trouble list directly
|
|
95
|
+
* @see {@link isTroubleAware} - For checking if a model supports trouble tracking
|
|
96
|
+
*/
|
|
97
|
+
export declare const useTroubleDecoration: (model?: IKosDataModel) => {
|
|
98
|
+
/** Background color derived from the highest priority trouble, undefined if no troubles */
|
|
99
|
+
backgroundColor?: string;
|
|
100
|
+
/** Text color optimized for contrast against backgroundColor (white for dark backgrounds) */
|
|
101
|
+
fontColor?: string;
|
|
102
|
+
/** Reference to the highest priority trouble model instance */
|
|
103
|
+
highestTrouble?: any;
|
|
104
|
+
/** Whether trouble data has been loaded and initialized */
|
|
105
|
+
initialized?: boolean;
|
|
106
|
+
/** Total count of visible troubles after role-based filtering */
|
|
107
|
+
troubleCount?: number;
|
|
108
|
+
/** Boolean flag indicating if any troubles are present */
|
|
109
|
+
hasTroubles?: boolean;
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=use-trouble-decoration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-trouble-decoration.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/hooks/troubles/use-trouble-decoration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAO7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,eAAO,MAAM,oBAAoB,WACvB,aAAa,KACpB;IACD,2FAA2F;IAC3F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;CAuBvB,CAAC"}
|