@nar-bus/lena-ui-shared 1.3.13 → 1.3.14
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/index.d.ts +94 -14
- package/dist/index.js +4247 -4136
- package/dist/index.js.map +1 -1
- package/dist/theme.css +13 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1248,11 +1248,11 @@ declare interface DetailPageMetadataFooterProps {
|
|
|
1248
1248
|
export declare const deviceStatusColors: {
|
|
1249
1249
|
readonly ACTIVE: "bg-status-success/10 text-status-success-foreground border-status-success/30 ring-status-success/30";
|
|
1250
1250
|
readonly INACTIVE: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30 ring-status-neutral/30";
|
|
1251
|
-
readonly MAINTENANCE: "bg-status-warning/10 text-status-warning border-status-warning/30 ring-status-warning/30";
|
|
1252
|
-
readonly FAULTY: "bg-status-error/10 text-status-error border-status-error/30 ring-status-error/30";
|
|
1251
|
+
readonly MAINTENANCE: "bg-status-warning/10 text-status-warning-foreground border-status-warning/30 ring-status-warning/30";
|
|
1252
|
+
readonly FAULTY: "bg-status-error/10 text-status-error-foreground border-status-error/30 ring-status-error/30";
|
|
1253
1253
|
readonly ONLINE: "bg-status-success/10 text-status-success-foreground border-status-success/30 ring-status-success/30";
|
|
1254
1254
|
readonly OFFLINE: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30 ring-status-neutral/30";
|
|
1255
|
-
readonly PENDING: "bg-status-warning/10 text-status-warning border-status-warning/30 ring-status-warning/30";
|
|
1255
|
+
readonly PENDING: "bg-status-warning/10 text-status-warning-foreground border-status-warning/30 ring-status-warning/30";
|
|
1256
1256
|
readonly CONNECTED: "bg-status-success/10 text-status-success-foreground border-status-success/30 ring-status-success/30";
|
|
1257
1257
|
readonly DISCONNECTED: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30 ring-status-neutral/30";
|
|
1258
1258
|
};
|
|
@@ -1368,6 +1368,49 @@ export declare interface EnumPrefetcherProps {
|
|
|
1368
1368
|
fetcher: EnumFetcher;
|
|
1369
1369
|
}
|
|
1370
1370
|
|
|
1371
|
+
export declare function EnumSelectField<TFieldValues extends FieldValues>({ enumKey, fallback, ...rest }: EnumSelectFieldProps<TFieldValues>): JSX.Element;
|
|
1372
|
+
|
|
1373
|
+
declare interface EnumSelectFieldProps<TFieldValues extends FieldValues> {
|
|
1374
|
+
name: FieldPath<TFieldValues>;
|
|
1375
|
+
control: Control<TFieldValues>;
|
|
1376
|
+
/** Enum cache key — backend'den tanımlanan enum code'u */
|
|
1377
|
+
enumKey: string;
|
|
1378
|
+
/** Cache yüklenmeden önce gösterilecek fallback options */
|
|
1379
|
+
fallback?: SelectOption[];
|
|
1380
|
+
label?: string;
|
|
1381
|
+
description?: string;
|
|
1382
|
+
required?: boolean;
|
|
1383
|
+
placeholder?: string;
|
|
1384
|
+
searchPlaceholder?: string;
|
|
1385
|
+
emptyText?: string;
|
|
1386
|
+
disabled?: boolean;
|
|
1387
|
+
className?: string;
|
|
1388
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1389
|
+
errorHint?: string;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
export declare function EnumText({ enumKey, value, fallback, className }: EnumTextProps): JSX.Element;
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* EnumText — Enum cache'den label resolve eden display component.
|
|
1396
|
+
*
|
|
1397
|
+
* Static label map'lerin drop-in replacement'ı:
|
|
1398
|
+
* ```tsx
|
|
1399
|
+
* // ÖNCE: {protocolTypeLabels[protocol.protocolType]}
|
|
1400
|
+
* // SONRA: <EnumText enumKey="PROTOCOL_TYPE" value={protocol.protocolType} />
|
|
1401
|
+
* ```
|
|
1402
|
+
*/
|
|
1403
|
+
export declare interface EnumTextProps {
|
|
1404
|
+
/** Enum cache key (e.g., 'PROTOCOL_TYPE') */
|
|
1405
|
+
enumKey: string;
|
|
1406
|
+
/** Backend'den gelen raw enum value (e.g., 'DLMS') */
|
|
1407
|
+
value: string | undefined | null;
|
|
1408
|
+
/** Fallback text when value is empty */
|
|
1409
|
+
fallback?: string;
|
|
1410
|
+
/** Optional className */
|
|
1411
|
+
className?: string;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1371
1414
|
/**
|
|
1372
1415
|
* Error Boundary Component
|
|
1373
1416
|
* Catches JavaScript errors in child component tree and displays fallback UI
|
|
@@ -1444,6 +1487,12 @@ export declare interface FieldConfig {
|
|
|
1444
1487
|
type: FieldType;
|
|
1445
1488
|
/** Options for enum fields */
|
|
1446
1489
|
options?: SelectOption[];
|
|
1490
|
+
/**
|
|
1491
|
+
* Enum cache key — otomatik olarak cache'den resolve edilir.
|
|
1492
|
+
* `type: 'enum'` ile birlikte kullanılır. `options` yerine tercih edilmeli.
|
|
1493
|
+
* @example { field: 'status', type: 'enum', enumKey: 'METER_STATUS' }
|
|
1494
|
+
*/
|
|
1495
|
+
enumKey?: string;
|
|
1447
1496
|
/** Async function to load options */
|
|
1448
1497
|
loadOptions?: () => Promise<SelectOption[]>;
|
|
1449
1498
|
/** Placeholder text for input */
|
|
@@ -1748,16 +1797,23 @@ export declare type GradientPair = [topColor: string, bottomColor: string];
|
|
|
1748
1797
|
|
|
1749
1798
|
declare function Header({ children, icon: Icon, iconClassName, subtitle, actions, gradient, className, }: LenaPanelHeaderProps): JSX.Element;
|
|
1750
1799
|
|
|
1751
|
-
export declare function HeaderCreateButton({ label, icon, children, contentClassName, className, }: HeaderCreateButtonProps): JSX.Element;
|
|
1800
|
+
export declare function HeaderCreateButton({ label, icon, searchPlaceholder, emptyText, children, contentClassName, className, }: HeaderCreateButtonProps): JSX.Element;
|
|
1752
1801
|
|
|
1753
1802
|
export declare interface HeaderCreateButtonProps {
|
|
1754
1803
|
/** Button label text */
|
|
1755
1804
|
label: string;
|
|
1756
1805
|
/** Custom icon — defaults to Plus */
|
|
1757
1806
|
icon?: ReactNode;
|
|
1758
|
-
/**
|
|
1807
|
+
/** Placeholder for search input */
|
|
1808
|
+
searchPlaceholder?: string;
|
|
1809
|
+
/** Empty state text when no results match */
|
|
1810
|
+
emptyText?: string;
|
|
1811
|
+
/**
|
|
1812
|
+
* Command palette content — use CommandGroup + CommandItem from lena-ui-shared.
|
|
1813
|
+
* Each CommandItem's onSelect should call the provided `onClose` or manage its own state.
|
|
1814
|
+
*/
|
|
1759
1815
|
children: ReactNode;
|
|
1760
|
-
/** Additional class for
|
|
1816
|
+
/** Additional class for PopoverContent */
|
|
1761
1817
|
contentClassName?: string;
|
|
1762
1818
|
/** Additional class for the trigger button */
|
|
1763
1819
|
className?: string;
|
|
@@ -2506,10 +2562,10 @@ export declare interface PreviewSheetProps {
|
|
|
2506
2562
|
}
|
|
2507
2563
|
|
|
2508
2564
|
export declare const priorityColors: {
|
|
2509
|
-
readonly HIGH: "bg-status-error/10 text-status-error border-status-error/30 ring-status-error/30";
|
|
2510
|
-
readonly MEDIUM: "bg-status-warning/10 text-status-warning border-status-warning/30 ring-status-warning/30";
|
|
2565
|
+
readonly HIGH: "bg-status-error/10 text-status-error-foreground border-status-error/30 ring-status-error/30";
|
|
2566
|
+
readonly MEDIUM: "bg-status-warning/10 text-status-warning-foreground border-status-warning/30 ring-status-warning/30";
|
|
2511
2567
|
readonly LOW: "bg-status-info/10 text-status-info-foreground border-status-info/30 ring-status-info/30";
|
|
2512
|
-
readonly CRITICAL: "bg-status-error/10 text-status-error border-status-error/30 ring-status-error/30";
|
|
2568
|
+
readonly CRITICAL: "bg-status-error/10 text-status-error-foreground border-status-error/30 ring-status-error/30";
|
|
2513
2569
|
readonly NORMAL: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30 ring-status-neutral/30";
|
|
2514
2570
|
};
|
|
2515
2571
|
|
|
@@ -2534,8 +2590,8 @@ declare interface PropertyRowProps {
|
|
|
2534
2590
|
export declare const protocolTypeColors: {
|
|
2535
2591
|
readonly DLMS: "bg-status-info/10 text-status-info-foreground border-status-info/30 ring-status-info/30";
|
|
2536
2592
|
readonly MODBUS: "bg-status-purple/10 text-status-purple-foreground border-status-purple/30 ring-status-purple/30";
|
|
2537
|
-
readonly IEC_62056_21: "bg-accent-cyan/10 text-accent-cyan border-accent-cyan/30 ring-accent-cyan/30";
|
|
2538
|
-
readonly ANSI_C12_18: "bg-status-warning/10 text-status-warning border-status-warning/30 ring-status-warning/30";
|
|
2593
|
+
readonly IEC_62056_21: "bg-accent-cyan/10 text-accent-cyan-foreground border-accent-cyan/30 ring-accent-cyan/30";
|
|
2594
|
+
readonly ANSI_C12_18: "bg-status-warning/10 text-status-warning-foreground border-status-warning/30 ring-status-warning/30";
|
|
2539
2595
|
};
|
|
2540
2596
|
|
|
2541
2597
|
export declare function QuickActionTile({ title, description, icon, href, onClick, variant, badge, className, animationDelay, }: QuickActionTileProps): JSX.Element;
|
|
@@ -3040,11 +3096,11 @@ export declare type StatusColor = keyof typeof statusColors;
|
|
|
3040
3096
|
*/
|
|
3041
3097
|
export declare const statusColors: {
|
|
3042
3098
|
readonly success: "bg-status-success/10 text-status-success-foreground border-status-success/30 ring-status-success/30";
|
|
3043
|
-
readonly warning: "bg-status-warning/10 text-status-warning border-status-warning/30 ring-status-warning/30";
|
|
3044
|
-
readonly error: "bg-status-error/10 text-status-error border-status-error/30 ring-status-error/30";
|
|
3099
|
+
readonly warning: "bg-status-warning/10 text-status-warning-foreground border-status-warning/30 ring-status-warning/30";
|
|
3100
|
+
readonly error: "bg-status-error/10 text-status-error-foreground border-status-error/30 ring-status-error/30";
|
|
3045
3101
|
readonly info: "bg-status-info/10 text-status-info-foreground border-status-info/30 ring-status-info/30";
|
|
3046
3102
|
readonly neutral: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30 ring-status-neutral/30";
|
|
3047
|
-
readonly accent: "bg-accent-cyan/10 text-accent-cyan border-accent-cyan/30 ring-accent-cyan/30";
|
|
3103
|
+
readonly accent: "bg-accent-cyan/10 text-accent-cyan-foreground border-accent-cyan/30 ring-accent-cyan/30";
|
|
3048
3104
|
readonly purple: "bg-status-purple/10 text-status-purple-foreground border-status-purple/30 ring-status-purple/30";
|
|
3049
3105
|
};
|
|
3050
3106
|
|
|
@@ -3600,6 +3656,30 @@ export declare interface UseDoubleClickHandlerOptions<T> {
|
|
|
3600
3656
|
*/
|
|
3601
3657
|
export declare function useEnumDefinitions(): CachedEnumDefinition[];
|
|
3602
3658
|
|
|
3659
|
+
/**
|
|
3660
|
+
* Tek bir enum value'nun label'ını döner.
|
|
3661
|
+
* Cache'de bulunamazsa raw value döner (graceful fallback).
|
|
3662
|
+
*
|
|
3663
|
+
* @example
|
|
3664
|
+
* ```tsx
|
|
3665
|
+
* const label = useEnumLabel('PROTOCOL_TYPE', protocol.protocolType);
|
|
3666
|
+
* <span>{label}</span>
|
|
3667
|
+
* ```
|
|
3668
|
+
*/
|
|
3669
|
+
export declare function useEnumLabel(key: string, value: string | undefined | null): string;
|
|
3670
|
+
|
|
3671
|
+
/**
|
|
3672
|
+
* Tüm enum'un key→label map'ini Record<string, string> olarak döner.
|
|
3673
|
+
* Mevcut static label map'lerin drop-in replacement'ı.
|
|
3674
|
+
*
|
|
3675
|
+
* @example
|
|
3676
|
+
* ```tsx
|
|
3677
|
+
* const protocolTypeLabels = useEnumLabelMap('PROTOCOL_TYPE');
|
|
3678
|
+
* <span>{protocolTypeLabels[protocol.protocolType]}</span>
|
|
3679
|
+
* ```
|
|
3680
|
+
*/
|
|
3681
|
+
export declare function useEnumLabelMap(key: string): Record<string, string>;
|
|
3682
|
+
|
|
3603
3683
|
/**
|
|
3604
3684
|
* Belirli bir enum code'unun SelectOption[] listesini döner.
|
|
3605
3685
|
*
|