@nar-bus/ui-shared 1.21.2 → 2.0.0
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/dist/adapters/api-adapter.d.ts +5 -5
- package/dist/adapters/api-adapter.d.ts.map +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/real-adapter.d.ts +5 -5
- package/dist/adapters/real-adapter.d.ts.map +1 -1
- package/dist/adapters/traceId.d.ts +24 -0
- package/dist/adapters/traceId.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +41 -0
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/api/apiClient.d.ts +22 -5
- package/dist/api/apiClient.d.ts.map +1 -1
- package/dist/api/searchRequest.d.ts +1 -1
- package/dist/components/CronBuilder.d.ts +28 -1
- package/dist/components/CronBuilder.d.ts.map +1 -1
- package/dist/components/MeterStatusBadge.d.ts.map +1 -1
- package/dist/components/OrderCreateSheet.d.ts +100 -1
- package/dist/components/OrderCreateSheet.d.ts.map +1 -1
- package/dist/components/OrderDetailSheet.d.ts +15 -1
- package/dist/components/OrderDetailSheet.d.ts.map +1 -1
- package/dist/components/detail-layout/ReadingHeatmap.d.ts +20 -2
- package/dist/components/detail-layout/ReadingHeatmap.d.ts.map +1 -1
- package/dist/components/detail-layout/TriColumnSymmetric.d.ts +16 -1
- package/dist/components/detail-layout/TriColumnSymmetric.d.ts.map +1 -1
- package/dist/components/detail-layout/adapters.d.ts.map +1 -1
- package/dist/components/detail-layout/types.d.ts +46 -18
- package/dist/components/detail-layout/types.d.ts.map +1 -1
- package/dist/components/form-sheet/FormSheet.d.ts +1 -1
- package/dist/components/form-sheet/ReadonlySheet.d.ts +1 -1
- package/dist/components/hourly-month-grid/HourStrip.d.ts.map +1 -1
- package/dist/components/hourly-month-grid/HourlyGridLegend.d.ts +4 -2
- package/dist/components/hourly-month-grid/HourlyGridLegend.d.ts.map +1 -1
- package/dist/components/hourly-month-grid/HourlyMonthGrid.d.ts +45 -0
- package/dist/components/hourly-month-grid/HourlyMonthGrid.d.ts.map +1 -1
- package/dist/components/hourly-month-grid/index.d.ts +1 -1
- package/dist/components/hourly-month-grid/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/order-forms/RelayForms.d.ts +31 -3
- package/dist/components/order-forms/RelayForms.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useEnumValues.d.ts +66 -1
- package/dist/hooks/useEnumValues.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12669 -12172
- package/dist/mocks/periodic-jobs.json.d.ts +5 -5
- package/dist/types/audit.types.d.ts +27 -0
- package/dist/types/audit.types.d.ts.map +1 -0
- package/dist/types/auth.types.d.ts +98 -9
- package/dist/types/auth.types.d.ts.map +1 -1
- package/dist/types/brand-model.types.d.ts +25 -1
- package/dist/types/brand-model.types.d.ts.map +1 -1
- package/dist/types/calendar.types.d.ts +3 -0
- package/dist/types/calendar.types.d.ts.map +1 -1
- package/dist/types/directive.types.d.ts +3 -0
- package/dist/types/directive.types.d.ts.map +1 -1
- package/dist/types/firmware.types.d.ts +5 -1
- package/dist/types/firmware.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/location.types.d.ts +21 -1
- package/dist/types/location.types.d.ts.map +1 -1
- package/dist/types/management.types.d.ts +165 -9
- package/dist/types/management.types.d.ts.map +1 -1
- package/dist/types/meter.types.d.ts +122 -1
- package/dist/types/meter.types.d.ts.map +1 -1
- package/dist/types/modem.types.d.ts +67 -3
- package/dist/types/modem.types.d.ts.map +1 -1
- package/dist/types/order.types.d.ts +15 -0
- package/dist/types/order.types.d.ts.map +1 -1
- package/dist/types/parser-template.types.d.ts +9 -2
- package/dist/types/parser-template.types.d.ts.map +1 -1
- package/dist/types/protocol.types.d.ts +3 -0
- package/dist/types/protocol.types.d.ts.map +1 -1
- package/dist/types/reading-setting.types.d.ts +3 -0
- package/dist/types/reading-setting.types.d.ts.map +1 -1
- package/dist/types/server-config.types.d.ts +7 -0
- package/dist/types/server-config.types.d.ts.map +1 -1
- package/dist/types/simcard.types.d.ts +3 -0
- package/dist/types/simcard.types.d.ts.map +1 -1
- package/dist/utils/orderReason.d.ts +50 -0
- package/dist/utils/orderReason.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* STORY-222 / D-230 / AD-DETAIL-5
|
|
3
|
-
*
|
|
4
|
-
* Type contract underpinning the shared detail-layout component family.
|
|
5
|
-
*
|
|
6
|
-
* `DetailEntity` is a **discriminated union** on `kind` ("modem" | "meter").
|
|
7
|
-
* The compiler narrows to the per-kind variant inside `if (entity.kind === ...)`
|
|
8
|
-
* branches, so consumers can access modem-only fields (`firmware`, `protocol`,
|
|
9
|
-
* `signalStrength`, `meterCount`) or meter-only fields (`meterType`, `modemSlug`)
|
|
10
|
-
* without optional chaining and without accidentally reaching across kinds.
|
|
11
|
-
*
|
|
12
|
-
* Mock builders + entity literals + the deterministic PRNG live under
|
|
13
|
-
* `ui/lena-ui-kit/src/_preview/DetailLayout/mockData.ts` (preview-only Storybook
|
|
14
|
-
* fixtures). The production adapter contract lives in `./adapters.ts` and is
|
|
15
|
-
* wired against real `ModemDetail` / `MeterDetail` hook output by STORY-223.
|
|
16
|
-
*/
|
|
1
|
+
import { ActiveOrdersByPriority, ModemOrderSuitability } from '../../types';
|
|
17
2
|
export type DayStatus = "ok" | "warn" | "crit" | "noData";
|
|
18
3
|
export interface ReadingDay {
|
|
19
4
|
/** ISO yyyy-mm-dd. */
|
|
@@ -32,6 +17,17 @@ export interface AlarmEntry {
|
|
|
32
17
|
/** ISO datetime. */
|
|
33
18
|
at: string;
|
|
34
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* NB-DETAIL-LIFECYCLE-01 — header lifecycle value. The four canonical values
|
|
22
|
+
* keep their coarse fold (and tone); any other backend code (`SCRAPPED`, a
|
|
23
|
+
* status added later, …) travels VERBATIM instead of being folded into
|
|
24
|
+
* `INACTIVE` ("Pasif"). The badge reads `detail_status.lifecycle.<code>` and
|
|
25
|
+
* falls back to the raw code with a neutral tone. `(string & {})` keeps the
|
|
26
|
+
* four literals visible to autocomplete.
|
|
27
|
+
*/
|
|
28
|
+
export type DetailLifecycle = "ACTIVE" | "INACTIVE" | "MAINTENANCE" | "FAULTY" | (string & {});
|
|
29
|
+
/** NB-DETAIL-LIFECYCLE-01 — consumer-chosen tone for the lifecycle badge. */
|
|
30
|
+
export type DetailLifecycleTone = "ok" | "warn" | "crit" | "muted";
|
|
35
31
|
interface DetailEntityBase {
|
|
36
32
|
slug: string;
|
|
37
33
|
serial: string;
|
|
@@ -42,8 +38,16 @@ interface DetailEntityBase {
|
|
|
42
38
|
district: string;
|
|
43
39
|
};
|
|
44
40
|
tags: string[];
|
|
41
|
+
/**
|
|
42
|
+
* NB-DETAIL-LIFECYCLE-01 — overrides the lifecycle badge text (already
|
|
43
|
+
* translated). Omitted → `detail_status.lifecycle.<status.lifecycle>`, then
|
|
44
|
+
* the raw code.
|
|
45
|
+
*/
|
|
46
|
+
lifecycleLabel?: string;
|
|
47
|
+
/** NB-DETAIL-LIFECYCLE-01 — overrides the lifecycle badge tone. */
|
|
48
|
+
lifecycleTone?: DetailLifecycleTone;
|
|
45
49
|
status: {
|
|
46
|
-
lifecycle:
|
|
50
|
+
lifecycle: DetailLifecycle;
|
|
47
51
|
network: "CONNECTED" | "DISCONNECTED" | "UNKNOWN";
|
|
48
52
|
power?: "ON" | "OFF" | "UNKNOWN";
|
|
49
53
|
/**
|
|
@@ -71,12 +75,36 @@ export interface ModemDetailEntity extends DetailEntityBase {
|
|
|
71
75
|
kind: "modem";
|
|
72
76
|
firmware?: string;
|
|
73
77
|
protocol?: string;
|
|
74
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Transport-layer port (TCP/MQTT). Optional — only rendered when present,
|
|
80
|
+
* labelled "Port". Superseded in the identity card by `reportedPort` when
|
|
81
|
+
* that field is set (the two-row layout below).
|
|
82
|
+
*/
|
|
75
83
|
port?: number;
|
|
84
|
+
/**
|
|
85
|
+
* NB-DETAIL-TCPPORT-01 (LHA-604 K10) — the protocol's default port, shown
|
|
86
|
+
* as its own row right under "Protocol". `undefined` → no row; `null` → "—".
|
|
87
|
+
*/
|
|
88
|
+
protocolDefaultPort?: number | null;
|
|
89
|
+
/**
|
|
90
|
+
* NB-DETAIL-TCPPORT-01 — the port the device reported, labelled as such so it
|
|
91
|
+
* cannot be confused with the default. When set (`null` → "—") it replaces the
|
|
92
|
+
* plain "Port" row; `undefined` keeps the legacy `port` row.
|
|
93
|
+
*/
|
|
94
|
+
reportedPort?: number | null;
|
|
76
95
|
/** RSSI 0..100. */
|
|
77
96
|
signalStrength?: number;
|
|
78
97
|
/** Number of meters bound to this modem. */
|
|
79
98
|
meterCount?: number;
|
|
99
|
+
/**
|
|
100
|
+
* NB-DETAIL-ORDERS-01 — order-processing suitability. When present the
|
|
101
|
+
* "Active Orders" quick-stat gains a status dot (SUITABLE green · NO_ORDERS
|
|
102
|
+
* grey · NOT_SUITABLE red · UNKNOWN amber) and a hover/focus tooltip.
|
|
103
|
+
* Absent / null → the tile renders exactly as before.
|
|
104
|
+
*/
|
|
105
|
+
orderSuitability?: ModemOrderSuitability | null;
|
|
106
|
+
/** NB-DETAIL-ORDERS-01 — per-priority split, listed in the same tooltip. */
|
|
107
|
+
activeOrdersByPriority?: ActiveOrdersByPriority | null;
|
|
80
108
|
}
|
|
81
109
|
export interface MeterDetailEntity extends DetailEntityBase {
|
|
82
110
|
kind: "meter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAMjF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,CAAC;IAClB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/F,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;;OAI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AAG,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,IAAI,EAAE,OAAO,CAAC;IACd,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAMjE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAM/E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAOA;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,SAAI,GAAG,MAAM,CAKzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { SheetCloseReason } from '
|
|
2
|
+
import { SheetCloseReason } from '@nar-bus/ui-kit';
|
|
3
3
|
import { FormSheetGradient } from './gradientHeader';
|
|
4
4
|
export type { FormSheetGradient };
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { SheetCloseReason } from '
|
|
2
|
+
import { SheetCloseReason } from '@nar-bus/ui-kit';
|
|
3
3
|
import { FormSheetGradient } from './gradientHeader';
|
|
4
4
|
/**
|
|
5
5
|
* ReadonlySheet — a footer-less view drawer (same header chrome as `FormSheet`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HourStrip.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourStrip.tsx"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"HourStrip.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourStrip.tsx"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,KAAK,EAAE,CAAC,cAAc,GAAG,SAAS,CAAC,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,EAAE,cAAc,+BAqChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HourlyGridStatusColor } from './HourlyMonthGrid';
|
|
1
|
+
import { HourlyGridMarker, HourlyGridStatusColor } from './HourlyMonthGrid';
|
|
2
2
|
export interface HourlyGridLegendItem {
|
|
3
3
|
status: string;
|
|
4
4
|
label: string;
|
|
@@ -6,7 +6,9 @@ export interface HourlyGridLegendItem {
|
|
|
6
6
|
export interface HourlyGridLegendProps {
|
|
7
7
|
items: HourlyGridLegendItem[];
|
|
8
8
|
statusColors?: Record<string, HourlyGridStatusColor>;
|
|
9
|
+
/** Corner markers to explain, drawn after the status items. Pass the same objects the cells carry. */
|
|
10
|
+
markers?: HourlyGridMarker[];
|
|
9
11
|
className?: string;
|
|
10
12
|
}
|
|
11
|
-
export declare function HourlyGridLegend({ items, statusColors, className }: HourlyGridLegendProps): import("react").JSX.Element;
|
|
13
|
+
export declare function HourlyGridLegend({ items, statusColors, markers, className }: HourlyGridLegendProps): import("react").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=HourlyGridLegend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HourlyGridLegend.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourlyGridLegend.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HourlyGridLegend.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourlyGridLegend.tsx"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACrD,sGAAsG;IACtG,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,qBAAqB,+BAsBlG"}
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Named marker tones resolve to the theme's status tokens. Any other string is
|
|
4
|
+
* used verbatim as a CSS colour (a token reference such as `var(--my-accent)`
|
|
5
|
+
* or a literal), so a consumer is never forced to mirror package token names.
|
|
6
|
+
*/
|
|
7
|
+
export type HourlyGridMarkerTone = "info" | "success" | "warning" | "danger" | "neutral";
|
|
8
|
+
/**
|
|
9
|
+
* Corner marker on an hourly cell — a layer ORTHOGONAL to `status`
|
|
10
|
+
* (NB-HOURLYGRID-BADGE-01). `status` stays what it is: the cell's production
|
|
11
|
+
* method and its colour key. The marker flags something that happened TO the
|
|
12
|
+
* hour on top of that (MDM OSF: a meter-fault window applied vs. declared but
|
|
13
|
+
* not applied, LMA-519 C12.2) without inventing compound status values.
|
|
14
|
+
*
|
|
15
|
+
* `label` is human text: it is appended to the cell's accessible name (and to
|
|
16
|
+
* the HourStrip button's title), and `HourlyGridLegend` can explain it via its
|
|
17
|
+
* `markers` prop. The cell `tooltip` is consumer-owned and left untouched.
|
|
18
|
+
*/
|
|
19
|
+
export interface HourlyGridMarker {
|
|
20
|
+
tone: HourlyGridMarkerTone | (string & {});
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* `"solid"` fills the dot, `"outline"` draws a ring — a second, non-colour
|
|
24
|
+
* cue so two markers can be told apart without relying on hue alone
|
|
25
|
+
* (WCAG 1.4.1). @default "solid"
|
|
26
|
+
*/
|
|
27
|
+
variant?: "solid" | "outline";
|
|
28
|
+
}
|
|
2
29
|
export interface HourlyGridCell {
|
|
3
30
|
value: number | null;
|
|
4
31
|
status: string;
|
|
5
32
|
tooltip?: string;
|
|
6
33
|
locked?: boolean;
|
|
34
|
+
/** Optional corner marker, independent of `status`. Absent → the cell renders exactly as before. */
|
|
35
|
+
marker?: HourlyGridMarker;
|
|
7
36
|
}
|
|
8
37
|
export interface HourlyGridRow {
|
|
9
38
|
day: number;
|
|
@@ -49,5 +78,21 @@ export interface HourlyMonthGridProps {
|
|
|
49
78
|
}
|
|
50
79
|
/** Prop override → default token map → `missing` for unknown/absent status. */
|
|
51
80
|
export declare function resolveStatusColor(status: string | undefined, statusColors?: Record<string, HourlyGridStatusColor>): HourlyGridStatusColor;
|
|
81
|
+
/** Named tone → status token; any other non-blank string passes through as a CSS colour. */
|
|
82
|
+
export declare function resolveMarkerColor(tone: string): string;
|
|
83
|
+
/** Trimmed marker label, "" when absent — tolerant of untyped (JS) callers. */
|
|
84
|
+
export declare function markerLabel(marker: HourlyGridMarker | undefined): string;
|
|
85
|
+
/** `", <label>"` for an accessible name, or "" — so an unmarked cell's name is byte-identical. */
|
|
86
|
+
export declare function markerAriaSuffix(marker: HourlyGridMarker | undefined): string;
|
|
87
|
+
/**
|
|
88
|
+
* The corner dot itself, shared by grid cells, HourStrip and the legend.
|
|
89
|
+
* Decorative (`aria-hidden`): the label already rides in the owning control's
|
|
90
|
+
* accessible name, so announcing the dot would read it twice. The colour is
|
|
91
|
+
* handed over as a custom property and painted with it in CSS, so one rule
|
|
92
|
+
* serves both variants.
|
|
93
|
+
*/
|
|
94
|
+
export declare function HourlyGridMarkerDot({ marker }: {
|
|
95
|
+
marker: HourlyGridMarker;
|
|
96
|
+
}): import("react").JSX.Element;
|
|
52
97
|
export declare function HourlyMonthGrid({ rows, daysInMonth, statusColors, onCellClick, selectedCell, renderCellDetail, showTotals, formatValue, formatTotal, lockBoundaryDay, maxHeight, dayLabel, totalLabel, className, }: HourlyMonthGridProps): import("react").JSX.Element;
|
|
53
98
|
//# sourceMappingURL=HourlyMonthGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HourlyMonthGrid.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourlyMonthGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7E,OAAO,uBAAuB,CAAC;AAK/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HourlyMonthGrid.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/HourlyMonthGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;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,WAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAiB,EACjB,WAAgC,EAChC,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,GACV,EAAE,oBAAoB,+BA8KtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { HourlyMonthGrid } from './HourlyMonthGrid';
|
|
2
|
-
export type { HourlyMonthGridProps, HourlyGridCell, HourlyGridRow, HourlyGridStatusColor, } from './HourlyMonthGrid';
|
|
2
|
+
export type { HourlyMonthGridProps, HourlyGridCell, HourlyGridRow, HourlyGridStatusColor, HourlyGridMarker, HourlyGridMarkerTone, } from './HourlyMonthGrid';
|
|
3
3
|
export { HourStrip } from './HourStrip';
|
|
4
4
|
export type { HourStripProps } from './HourStrip';
|
|
5
5
|
export { HourlyGridLegend } from './HourlyGridLegend';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hourly-month-grid/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -19,13 +19,13 @@ export type { TimelineProps, TimelineEntry, TimelineStatus } from './Timeline';
|
|
|
19
19
|
export { LiveMonitorPanel } from './LiveMonitorPanel';
|
|
20
20
|
export type { LiveMonitorPanelProps } from './LiveMonitorPanel';
|
|
21
21
|
export { OrderCreateSheet } from './OrderCreateSheet';
|
|
22
|
-
export type { OrderCreateSheetProps, OrderCreateMode, OrderCreateTargetEntity, BulkOrderSubmitPayload, } from './OrderCreateSheet';
|
|
22
|
+
export type { OrderCreateSheetProps, OrderCreateMode, OrderCreateTargetEntity, BulkOrderSubmitPayload, OrderCreateError, OrderCreateTarget, } from './OrderCreateSheet';
|
|
23
23
|
export { OrderDetailSheet } from './OrderDetailSheet';
|
|
24
24
|
export type { OrderDetailSheetProps } from './OrderDetailSheet';
|
|
25
25
|
export { MapView } from './MapView';
|
|
26
26
|
export type { MapViewProps } from './MapView';
|
|
27
|
-
export { CronBuilder } from './CronBuilder';
|
|
28
|
-
export type { CronBuilderProps } from './CronBuilder';
|
|
27
|
+
export { CronBuilder, hasCronDayOrSemantics } from './CronBuilder';
|
|
28
|
+
export type { CronBuilderProps, CronDayFieldSemantics } from './CronBuilder';
|
|
29
29
|
export { NotificationBell } from './NotificationBell';
|
|
30
30
|
export type { NotificationBellProps } from './NotificationBell';
|
|
31
31
|
export { RealTimeStatusBar } from './RealTimeStatusBar';
|
|
@@ -51,7 +51,7 @@ export type { TopErrorCodesMiniProps, TopErrorCodesMiniState, ErrorCodeEntry, }
|
|
|
51
51
|
export { DetailSection, DetailFieldRow, DetailFieldGrid, DetailPill, DetailContentBlock, DetailTile, } from './detail-glass';
|
|
52
52
|
export type { DetailSectionProps, DetailFieldRowProps, DetailFieldGridProps, DetailPillProps, DetailPillTone, DetailContentBlockProps, DetailTileProps, DetailTileTone, } from './detail-glass';
|
|
53
53
|
export { HourlyMonthGrid, HourStrip, HourlyGridLegend } from './hourly-month-grid';
|
|
54
|
-
export type { HourlyMonthGridProps, HourlyGridCell, HourlyGridRow, HourlyGridStatusColor, HourStripProps, HourlyGridLegendProps, HourlyGridLegendItem, } from './hourly-month-grid';
|
|
54
|
+
export type { HourlyMonthGridProps, HourlyGridCell, HourlyGridRow, HourlyGridStatusColor, HourlyGridMarker, HourlyGridMarkerTone, HourStripProps, HourlyGridLegendProps, HourlyGridLegendItem, } from './hourly-month-grid';
|
|
55
55
|
export { FormSection, FormFieldStack, FormFieldRow, FormSectionGroup, } from './form-glass';
|
|
56
56
|
export type { FormSectionProps, FormFieldStackProps, FormFieldRowProps, FormSectionGroupProps, } from './form-glass';
|
|
57
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW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f,cAAc,GACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,cAAc,CAAC"}
|
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
interface FormProps {
|
|
2
2
|
params: Record<string, string>;
|
|
3
3
|
onChange: (key: string, value: string) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Relay picker options. OPTIONAL override — when omitted the form fetches the
|
|
6
|
+
* modem's relays itself from `/api/modems/{modemId}/relays` (see
|
|
7
|
+
* `useRelayOptions`). Supply this only to bypass that fetch.
|
|
8
|
+
*
|
|
9
|
+
* `value` MUST be the relay's `relayNo` (the physical channel), NOT
|
|
10
|
+
* `RelayAssignment.id` (the database row id) — `relayNo` is what becomes
|
|
11
|
+
* `IoInterfaceInfo.id` in the MASS command. The two differ: a record
|
|
12
|
+
* `{ id: 42, relayNo: 1 }` must yield `value: "1"`.
|
|
13
|
+
*/
|
|
4
14
|
relayOptions?: Array<{
|
|
5
15
|
value: string;
|
|
6
16
|
label: string;
|
|
7
17
|
}>;
|
|
18
|
+
/** Modem whose relays to offer. Ignored when `relayOptions` is supplied. */
|
|
19
|
+
modemId?: number;
|
|
8
20
|
}
|
|
9
21
|
/** RelayQueryForm — select relays to query */
|
|
10
|
-
export declare function RelayQueryForm({ params, onChange, relayOptions }: FormProps): import("react").JSX.Element;
|
|
11
|
-
/** RelayChangeForm — select relays and set ON/OFF status
|
|
12
|
-
|
|
22
|
+
export declare function RelayQueryForm({ params, onChange, relayOptions, modemId }: FormProps): import("react").JSX.Element;
|
|
23
|
+
/** RelayChangeForm — select relays and set ON/OFF status
|
|
24
|
+
*
|
|
25
|
+
* NB-RELAY-PARAM-01 (N+17, LHA-645): this form used to emit
|
|
26
|
+
* `onChange("ioInterfaceChanges", ...)` with `status: "true" | "false"` and a
|
|
27
|
+
* STRING id. MassCommandBuilder reads `ctx.params.get("ioInterfaces")` and
|
|
28
|
+
* converts to `List<IoInterfaceInfo>` (`status` = Integer 1/0), so the key never
|
|
29
|
+
* matched: `get("ioInterfaces")` returned null and the relay command reached the
|
|
30
|
+
* device with an EMPTY ioInterfaces list. Fixed here: key, id type and status type.
|
|
31
|
+
*
|
|
32
|
+
* The JSON.stringify stays. The shared order-forms `FormProps.onChange` contract
|
|
33
|
+
* is string-valued across all 11 forms, and OrderCreateSheet's FIX-166
|
|
34
|
+
* parsedParams loop parses any `[`/`{`-leading param back before the POST — so a
|
|
35
|
+
* REAL array goes on the wire, exactly as it already does for astroRelay
|
|
36
|
+
* (pinned by OrderCreateSheet.astro-wire.test.tsx, and now by
|
|
37
|
+
* OrderCreateSheet.relay-wire.test.tsx). Widening the onChange signature to carry
|
|
38
|
+
* a live array would break all 11 forms and buy nothing.
|
|
39
|
+
*/
|
|
40
|
+
export declare function RelayChangeForm({ params, onChange, relayOptions, modemId }: FormProps): import("react").JSX.Element;
|
|
13
41
|
export {};
|
|
14
42
|
//# sourceMappingURL=RelayForms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelayForms.d.ts","sourceRoot":"","sources":["../../../src/components/order-forms/RelayForms.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RelayForms.d.ts","sourceRoot":"","sources":["../../../src/components/order-forms/RelayForms.tsx"],"names":[],"mappings":"AASA,UAAU,SAAS;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAiED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,SAAS,+BAiBpF;AAiCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,SAAS,+BA+GrF"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { useSSE, setSSEDefaultMode } from './useSSE';
|
|
|
7
7
|
export type { SSEConnectionState, SSEOptions, SSEMode, SSEModeOption } from './useSSE';
|
|
8
8
|
export { useNotifications } from './useNotifications';
|
|
9
9
|
export type { UseNotificationsReturn } from './useNotifications';
|
|
10
|
-
export { useEnumValues } from './useEnumValues';
|
|
10
|
+
export { useEnumValues, fetchEnumValues, enumValuesQueryOptions } from './useEnumValues';
|
|
11
11
|
export type { EnumOption, UseEnumValuesReturn } from './useEnumValues';
|
|
12
12
|
export { useOrderDetail } from './useOrderDetail';
|
|
13
13
|
export type { UseOrderDetailOptions } from './useOrderDetail';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBA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EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
export interface EnumOption {
|
|
2
2
|
value: string;
|
|
3
3
|
label: string;
|
|
4
|
+
/**
|
|
5
|
+
* NB-ENUM-EN-01 — the English display label: the catalogue's `enumValueEn` when
|
|
6
|
+
* the value has one, otherwise `label` — so it is never blank. In an English UI
|
|
7
|
+
* show `option.labelEn` instead of `option.label`.
|
|
8
|
+
*
|
|
9
|
+
* Optional in the type only because consumers build `EnumOption`s themselves
|
|
10
|
+
* (tests, mocks, their own cache warm-up); `useEnumValues` always fills it.
|
|
11
|
+
*/
|
|
12
|
+
labelEn?: string;
|
|
13
|
+
/**
|
|
14
|
+
* NB-ENUM-EN-01 — the English label exactly as the catalogue stores it, `null`
|
|
15
|
+
* when the value has no translation. Read it when an untranslated value should
|
|
16
|
+
* fall back to something other than the Turkish `label` (e.g. a humanized key).
|
|
17
|
+
*/
|
|
18
|
+
enumValueEn?: string | null;
|
|
4
19
|
/**
|
|
5
20
|
* NB-ENUMOPT-RELKEY-01 — the backend `EnumValueResponse.relationKey` classifies
|
|
6
21
|
* an option (e.g. `FIELD_OPERATION_TITLE` values carry `relationKey="MODEM"`).
|
|
@@ -10,15 +25,65 @@ export interface EnumOption {
|
|
|
10
25
|
relationKey?: string | null;
|
|
11
26
|
}
|
|
12
27
|
export interface UseEnumValuesReturn {
|
|
28
|
+
/** The catalogue, sorted by `sortOrder`. `[]` while loading and after a failed fetch — see `isError`. */
|
|
13
29
|
options: EnumOption[];
|
|
14
30
|
isLoading: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* True when the last fetch failed (server error envelope or transport error) and
|
|
33
|
+
* there is no catalogue to show. Lets a mandatory picker say "could not load"
|
|
34
|
+
* instead of looking like an empty catalogue. Cleared by the next successful fetch.
|
|
35
|
+
*
|
|
36
|
+
* Optional in the type only because consumers declare `UseEnumValuesReturn` on their
|
|
37
|
+
* own wrappers and mocks; `useEnumValues` always fills it.
|
|
38
|
+
*/
|
|
39
|
+
isError?: boolean;
|
|
15
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Fetches one enum catalogue and maps it to `EnumOption`s, sorted by `sortOrder`.
|
|
43
|
+
*
|
|
44
|
+
* An error envelope REJECTS instead of resolving to `[]`. The API client reports a
|
|
45
|
+
* failed request as `{ status: "error" }` rather than throwing; resolving that to an
|
|
46
|
+
* empty list made TanStack cache "this catalogue has no values" as a SUCCESS for the
|
|
47
|
+
* full stale time, so a mandatory picker stayed empty for five minutes after a
|
|
48
|
+
* transient error, even once the server had recovered. Rejecting lets the query's
|
|
49
|
+
* retry/error semantics run and leaves nothing in the cache, so the next mount or
|
|
50
|
+
* refetch asks the server again. (HES fixed the same bug in its own prefetch copy,
|
|
51
|
+
* FIX-817 — this is the package-side root fix.)
|
|
52
|
+
*
|
|
53
|
+
* The rejection value is the envelope's `ApiError` (`{ code, … }`), or
|
|
54
|
+
* `{ code: "UNKNOWN_ERROR" }` when the envelope carries none.
|
|
55
|
+
*/
|
|
56
|
+
export declare function fetchEnumValues(enumCode: string): Promise<EnumOption[]>;
|
|
57
|
+
/**
|
|
58
|
+
* The exact query `useEnumValues` runs — key, fetch and stale time — for a consumer
|
|
59
|
+
* that warms the cache ahead of time:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* void queryClient.prefetchQuery(enumValuesQueryOptions("ORDER_STATUS"));
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* A prefetch built from this writes what the hook would write (same `EnumOption`
|
|
66
|
+
* shape, `labelEn` included) and follows the same error rule: a failed prefetch
|
|
67
|
+
* caches nothing, so the hook fetches on demand instead of serving a cached `[]`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function enumValuesQueryOptions(enumCode: string): {
|
|
70
|
+
queryKey: readonly ["enums", "values", string];
|
|
71
|
+
queryFn: () => Promise<EnumOption[]>;
|
|
72
|
+
staleTime: number;
|
|
73
|
+
};
|
|
16
74
|
/**
|
|
17
75
|
* Fetches enum values from the management API for a given enum definition code.
|
|
18
76
|
* Uses TanStack Query with 5-minute stale time for caching.
|
|
19
77
|
*
|
|
78
|
+
* Each option carries the Turkish `label` and the English `labelEn` (NB-ENUM-EN-01);
|
|
79
|
+
* the hook does not pick one for you — `label` stays what it always was.
|
|
80
|
+
*
|
|
81
|
+
* A failed fetch is an error, not an empty catalogue: `options` is `[]` and
|
|
82
|
+
* `isError` is true, and nothing is cached, so the next mount refetches (see
|
|
83
|
+
* `fetchEnumValues`). Retries follow the app's QueryClient defaults.
|
|
84
|
+
*
|
|
20
85
|
* @param enumCode — The enum definition code (e.g. "LIFECYCLE_STATUS", "PHASE_TYPE")
|
|
21
|
-
* @returns { options, isLoading } — SelectOption-compatible array
|
|
86
|
+
* @returns { options, isLoading, isError } — SelectOption-compatible array
|
|
22
87
|
*/
|
|
23
88
|
export declare function useEnumValues(enumCode: string): UseEnumValuesReturn;
|
|
24
89
|
//# sourceMappingURL=useEnumValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEnumValues.d.ts","sourceRoot":"","sources":["../../src/hooks/useEnumValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEnumValues.d.ts","sourceRoot":"","sources":["../../src/hooks/useEnumValues.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,yGAAyG;IACzG,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA+CD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAW7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM;;;;EAMtD;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAanE"}
|