@ailife-dev-vue/uiplus 0.0.12-snapshot → 0.0.14-snapshot

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 CHANGED
@@ -7,6 +7,7 @@ import { ComponentProvideOptions } from 'vue';
7
7
  import { Composer } from 'vue-i18n';
8
8
  import { ComputedRef } from 'vue';
9
9
  import { CreateComponentPublicInstanceWithMixins } from 'vue';
10
+ import { CSSProperties } from 'vue';
10
11
  import { DefineComponent } from 'vue';
11
12
  import { ExtractPropTypes } from 'vue';
12
13
  import { GlobalComponents } from 'vue';
@@ -19,6 +20,7 @@ import { PropType } from 'vue';
19
20
  import { PublicProps } from 'vue';
20
21
  import { Ref } from 'vue';
21
22
  import { VNodeProps } from 'vue';
23
+ import { WatchSource } from 'vue';
22
24
 
23
25
  export declare type ActionStatusbarCommandPayload = HilinkDeviceControlPayload;
24
26
 
@@ -201,6 +203,17 @@ declare const boolPanelCardProps: {
201
203
  };
202
204
  };
203
205
 
206
+ /** 半卡主/副标题默认 fit 参数,供文档与接入方引用 */
207
+ export declare const CARD_TITLE_TEXT_FIT_DEFAULTS: {
208
+ readonly titleMode: CardTitleTextLineMode;
209
+ readonly subtitleMode: CardTitleTextLineMode;
210
+ readonly titleBaseFontSize: 16;
211
+ readonly subtitleBaseFontSize: 12;
212
+ readonly titleMinFontSize: 12;
213
+ readonly subtitleMinFontSize: 9;
214
+ readonly lineHeightRatio: 1.2;
215
+ };
216
+
204
217
  export declare type CardsProps = ExtractPropTypes<typeof cardsProps>;
205
218
 
206
219
  declare const cardsProps: {
@@ -211,6 +224,8 @@ declare const cardsProps: {
211
224
  };
212
225
  };
213
226
 
227
+ export declare type CardTitleTextLineMode = 1 | 2;
228
+
214
229
  export declare interface Characteristic {
215
230
  characteristicName: string;
216
231
  characteristicType: string;
@@ -476,6 +491,16 @@ export declare const enUS: {
476
491
  'numeric-input-placeholder': string;
477
492
  'numeric-input-invalid': string;
478
493
  };
494
+ connect: {
495
+ disconnected: string;
496
+ connecting: string;
497
+ failed: string;
498
+ connected: string;
499
+ failureDialogContent: string;
500
+ tryLater: string;
501
+ reconnect: string;
502
+ reconnectNow: string;
503
+ };
479
504
  pageBarNew: {
480
505
  scene: {
481
506
  sectionTitle: string;
@@ -641,16 +666,7 @@ export declare const enUS: {
641
666
  placeholderOption4: string;
642
667
  more: string;
643
668
  };
644
- commonBannerNew: {
645
- connect: {
646
- disconnected: string;
647
- connecting: string;
648
- failed: string;
649
- failureDialogContent: string;
650
- tryLater: string;
651
- reconnectNow: string;
652
- };
653
- };
669
+ commonBannerNew: {};
654
670
  generalMode: {
655
671
  actionOpen: string;
656
672
  inUse: string;
@@ -730,6 +746,44 @@ export declare const enUS: {
730
746
  monthSuffix: string;
731
747
  };
732
748
  };
749
+ tableLampMorning: {
750
+ cardTitle: string;
751
+ aria: {
752
+ back: string;
753
+ };
754
+ field: {
755
+ openTime: string;
756
+ duration: string;
757
+ brightness: string;
758
+ };
759
+ timeUnit: {
760
+ hour: string;
761
+ minute: string;
762
+ };
763
+ rangeUnit: {
764
+ minute: string;
765
+ };
766
+ rangeValue: string;
767
+ };
768
+ tableLampSleepy: {
769
+ cardTitle: string;
770
+ aria: {
771
+ back: string;
772
+ };
773
+ field: {
774
+ openTime: string;
775
+ duration: string;
776
+ brightness: string;
777
+ };
778
+ timeUnit: {
779
+ hour: string;
780
+ minute: string;
781
+ };
782
+ rangeUnit: {
783
+ minute: string;
784
+ };
785
+ rangeValue: string;
786
+ };
733
787
  lampCCT: {
734
788
  cardTitle: string;
735
789
  cool: string;
@@ -1279,6 +1333,8 @@ export declare type HilinkDeviceControlFn = (deviceId: string, payloadJson: stri
1279
1333
  */
1280
1334
  export declare type HilinkDeviceControlPayload = Record<string, Record<string, string | number | boolean | Record<string, unknown> | Array<unknown>>> | Array<Record<string, Record<string, string | number | boolean | Record<string, unknown> | Array<unknown>>>>;
1281
1335
 
1336
+ export declare type HilinkDispatchListener = (payload: HilinkDeviceControlPayload) => void;
1337
+
1282
1338
  /** 与宿主约定:`setTitleVisible(visible, callbackName)`,`true` 显示原生标题栏,`false` 隐藏。 */
1283
1339
  export declare type HilinkSetTitleVisibleFn = (visible: boolean, callbackName: string) => void;
1284
1340
 
@@ -1680,6 +1736,9 @@ declare const statusBarProps: {
1680
1736
 
1681
1737
  export declare type StatusBarValue = StatusBarBinaryState;
1682
1738
 
1739
+ /** 订阅组件库内 `sendHilinkDeviceControl` 的下发事件;返回取消订阅函数。 */
1740
+ export declare function subscribeHilinkDeviceControl(listener: HilinkDispatchListener): () => void;
1741
+
1683
1742
  export declare type TableLampFadeTimeCardSize = 'full' | 'half';
1684
1743
 
1685
1744
  export declare type TableLampFadeTimeCommandPayload = HilinkDeviceControlPayload;
@@ -1722,6 +1781,27 @@ declare const tableLampMorningProps: {
1722
1781
  };
1723
1782
  };
1724
1783
 
1784
+ export declare type TableLampSleepyCardSize = 'full' | 'half';
1785
+
1786
+ export declare type TableLampSleepyCommandPayload = HilinkDeviceControlPayload;
1787
+
1788
+ export declare type TableLampSleepyEmits = {
1789
+ (e: 'expanded-change', expanded: boolean): void;
1790
+ };
1791
+
1792
+ export declare type TableLampSleepyProps = ExtractPropTypes<typeof tableLampSleepyProps>;
1793
+
1794
+ declare const tableLampSleepyProps: {
1795
+ cardSize: {
1796
+ type: PropType<TableLampSleepyCardSize>;
1797
+ default: string;
1798
+ };
1799
+ title: {
1800
+ type: StringConstructor;
1801
+ default: string;
1802
+ };
1803
+ };
1804
+
1725
1805
  export declare type TimerCardSize = 'full' | 'half';
1726
1806
 
1727
1807
  declare type TimerCommandPayload = HilinkDeviceControlPayload;
@@ -1974,8 +2054,11 @@ export declare const UpBoolIconCard: {
1974
2054
  cardSize: "full" | "half";
1975
2055
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
1976
2056
  headRef: HTMLDivElement;
2057
+ titleRowRef: HTMLDivElement;
2058
+ titleRef: HTMLDivElement;
1977
2059
  infoTriggerRef: HTMLButtonElement;
1978
2060
  infoTooltipRef: HTMLDivElement;
2061
+ statusRef: HTMLDivElement;
1979
2062
  }, HTMLDivElement, ComponentProvideOptions, {
1980
2063
  P: {};
1981
2064
  B: {};
@@ -2177,8 +2260,12 @@ export declare const UpBoolPanelCard: {
2177
2260
  closeDialogContent: string;
2178
2261
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
2179
2262
  headRef: HTMLDivElement;
2263
+ titleRowRef: HTMLDivElement;
2264
+ titleRef: HTMLDivElement;
2180
2265
  infoTriggerRef: HTMLButtonElement;
2181
2266
  infoTooltipRef: HTMLDivElement;
2267
+ statusRef: HTMLDivElement;
2268
+ dropzoneRef: HTMLDivElement;
2182
2269
  }, HTMLDivElement, ComponentProvideOptions, {
2183
2270
  P: {};
2184
2271
  B: {};
@@ -2375,8 +2462,11 @@ export declare const UpBoolSwitchCard: {
2375
2462
  cardSize: "full" | "half";
2376
2463
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
2377
2464
  headRef: HTMLDivElement;
2465
+ titleRowRef: HTMLDivElement;
2466
+ titleRef: HTMLDivElement;
2378
2467
  infoTriggerRef: HTMLButtonElement;
2379
2468
  infoTooltipRef: HTMLDivElement;
2469
+ statusRef: HTMLDivElement;
2380
2470
  }, HTMLDivElement, ComponentProvideOptions, {
2381
2471
  P: {};
2382
2472
  B: {};
@@ -2523,8 +2613,9 @@ export declare const UpCards: {
2523
2613
  }>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
2524
2614
  collapsedRows: number;
2525
2615
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
2616
+ rootRef: HTMLDivElement;
2526
2617
  gridRef: HTMLDivElement;
2527
- }, HTMLDivElement, ComponentProvideOptions, {
2618
+ }, any, ComponentProvideOptions, {
2528
2619
  P: {};
2529
2620
  B: {};
2530
2621
  D: {};
@@ -3204,7 +3295,11 @@ export declare const UpGeneralEnumDialogCard: {
3204
3295
  subscribes: ProductSubscribe[];
3205
3296
  cardSize: GeneralEnumDialogCardSize;
3206
3297
  visibleEnumValues: (string | number)[];
3207
- }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
3298
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
3299
+ textRef: HTMLDivElement;
3300
+ titleRef: HTMLDivElement;
3301
+ subtitleRef: HTMLDivElement;
3302
+ }, HTMLDivElement, ComponentProvideOptions, {
3208
3303
  P: {};
3209
3304
  B: {};
3210
3305
  D: {};
@@ -3277,6 +3372,9 @@ export declare const UpGeneralEnumDroplistCard: {
3277
3372
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
3278
3373
  rootRef: HTMLDivElement;
3279
3374
  dropdownRef: HTMLDivElement;
3375
+ textRef: HTMLDivElement;
3376
+ titleRef: HTMLDivElement;
3377
+ subtitleRef: HTMLDivElement;
3280
3378
  }, HTMLDivElement, ComponentProvideOptions, {
3281
3379
  P: {};
3282
3380
  B: {};
@@ -3426,6 +3524,7 @@ export declare const UpGeneralEnumTile: {
3426
3524
  moreEnumOptionConfigs: GeneralEnumTileOptionConfig[];
3427
3525
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
3428
3526
  moreDropdownRef: HTMLDivElement;
3527
+ dropzoneRef: HTMLDivElement;
3429
3528
  }, HTMLDivElement, ComponentProvideOptions, {
3430
3529
  P: {};
3431
3530
  B: {};
@@ -3868,7 +3967,7 @@ export declare const UpGeneralReminder: {
3868
3967
  };
3869
3968
  }>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
3870
3969
  enumConfigs: GeneralReminderEnumConfig[];
3871
- }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
3970
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
3872
3971
  P: {};
3873
3972
  B: {};
3874
3973
  D: {};
@@ -4488,6 +4587,7 @@ export declare const UpPageBarNew: {
4488
4587
  productWikiDeviceTransport: PageBarNewProductWikiDeviceTransport;
4489
4588
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
4490
4589
  scrollRef: HTMLDivElement;
4590
+ dropzoneRef: HTMLDivElement;
4491
4591
  }, HTMLDivElement, ComponentProvideOptions, {
4492
4592
  P: {};
4493
4593
  B: {};
@@ -5105,6 +5205,66 @@ title: string;
5105
5205
  cardSize: TableLampMorningCardSize;
5106
5206
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin_2;
5107
5207
 
5208
+ export declare const UpTableLampSleepy: {
5209
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes< {
5210
+ cardSize: {
5211
+ type: PropType<TableLampSleepyCardSize>;
5212
+ default: string;
5213
+ };
5214
+ title: {
5215
+ type: StringConstructor;
5216
+ default: string;
5217
+ };
5218
+ }>> & Readonly<{
5219
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
5220
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
5221
+ "expanded-change": (expanded: boolean) => any;
5222
+ }, PublicProps, {
5223
+ title: string;
5224
+ cardSize: TableLampSleepyCardSize;
5225
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
5226
+ P: {};
5227
+ B: {};
5228
+ D: {};
5229
+ C: {};
5230
+ M: {};
5231
+ Defaults: {};
5232
+ }, Readonly<ExtractPropTypes< {
5233
+ cardSize: {
5234
+ type: PropType<TableLampSleepyCardSize>;
5235
+ default: string;
5236
+ };
5237
+ title: {
5238
+ type: StringConstructor;
5239
+ default: string;
5240
+ };
5241
+ }>> & Readonly<{
5242
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
5243
+ }>, {}, {}, {}, {}, {
5244
+ title: string;
5245
+ cardSize: TableLampSleepyCardSize;
5246
+ }>;
5247
+ __isFragment?: never;
5248
+ __isTeleport?: never;
5249
+ __isSuspense?: never;
5250
+ } & ComponentOptionsBase<Readonly<ExtractPropTypes< {
5251
+ cardSize: {
5252
+ type: PropType<TableLampSleepyCardSize>;
5253
+ default: string;
5254
+ };
5255
+ title: {
5256
+ type: StringConstructor;
5257
+ default: string;
5258
+ };
5259
+ }>> & Readonly<{
5260
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
5261
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
5262
+ "expanded-change": (expanded: boolean) => any;
5263
+ }, string, {
5264
+ title: string;
5265
+ cardSize: TableLampSleepyCardSize;
5266
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin_2;
5267
+
5108
5268
  export declare const UpTimer: {
5109
5269
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes< {
5110
5270
  cardSize: {
@@ -5409,6 +5569,31 @@ bindStatusEnabled: boolean;
5409
5569
  bindStatusValue: string | number;
5410
5570
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin_2;
5411
5571
 
5572
+ export declare function useCardTitleTextFit(
5573
+ /** 文本区容器(`flex:1; min-width:0`),用于 ResizeObserver 与可见宽度早退 */
5574
+ measureWidthRef: Ref<HTMLElement | null>, titleRef: Ref<HTMLElement | null>, subtitleRef: Ref<HTMLElement | null>, options?: UseCardTitleTextFitOptions): {
5575
+ titleStyle: ComputedRef<CSSProperties>;
5576
+ subtitleStyle: ComputedRef<CSSProperties>;
5577
+ titleNeedsEllipsis: Ref<boolean, boolean>;
5578
+ subtitleNeedsEllipsis: Ref<boolean, boolean>;
5579
+ titleUseMultiline: Ref<boolean, boolean>;
5580
+ subtitleUseMultiline: Ref<boolean, boolean>;
5581
+ remeasure: () => void;
5582
+ };
5583
+
5584
+ export declare interface UseCardTitleTextFitOptions {
5585
+ /** 1: 单行;2: 优先单行缩小至 min,仍放不下则固定 min 字号换最多两行。默认主标题 2、副标题 1 */
5586
+ titleMode?: CardTitleTextLineMode;
5587
+ subtitleMode?: CardTitleTextLineMode;
5588
+ titleBaseFontSize?: number;
5589
+ subtitleBaseFontSize?: number;
5590
+ titleMinFontSize?: number;
5591
+ subtitleMinFontSize?: number;
5592
+ lineHeightRatio?: number;
5593
+ hasSubtitle?: MaybeRefOrGetter<boolean>;
5594
+ watchSources?: WatchSource[];
5595
+ }
5596
+
5412
5597
  /**
5413
5598
  * 是否与 `UpConfigProvider` 的 `theme="dark"` 一致:依据 `document.documentElement` 是否包含 `dark` 类。
5414
5599
  * 用于组件内随深浅色切换资源(如图标),并在运行时响应主题切换。
@@ -5567,6 +5752,16 @@ export declare const zhCN: {
5567
5752
  'numeric-input-placeholder': string;
5568
5753
  'numeric-input-invalid': string;
5569
5754
  };
5755
+ connect: {
5756
+ disconnected: string;
5757
+ connecting: string;
5758
+ failed: string;
5759
+ connected: string;
5760
+ failureDialogContent: string;
5761
+ tryLater: string;
5762
+ reconnect: string;
5763
+ reconnectNow: string;
5764
+ };
5570
5765
  pageBarNew: {
5571
5766
  scene: {
5572
5767
  sectionTitle: string;
@@ -5732,16 +5927,7 @@ export declare const zhCN: {
5732
5927
  placeholderOption4: string;
5733
5928
  more: string;
5734
5929
  };
5735
- commonBannerNew: {
5736
- connect: {
5737
- disconnected: string;
5738
- connecting: string;
5739
- failed: string;
5740
- failureDialogContent: string;
5741
- tryLater: string;
5742
- reconnectNow: string;
5743
- };
5744
- };
5930
+ commonBannerNew: {};
5745
5931
  generalMode: {
5746
5932
  actionOpen: string;
5747
5933
  inUse: string;
@@ -5821,6 +6007,44 @@ export declare const zhCN: {
5821
6007
  monthSuffix: string;
5822
6008
  };
5823
6009
  };
6010
+ tableLampMorning: {
6011
+ cardTitle: string;
6012
+ aria: {
6013
+ back: string;
6014
+ };
6015
+ field: {
6016
+ openTime: string;
6017
+ duration: string;
6018
+ brightness: string;
6019
+ };
6020
+ timeUnit: {
6021
+ hour: string;
6022
+ minute: string;
6023
+ };
6024
+ rangeUnit: {
6025
+ minute: string;
6026
+ };
6027
+ rangeValue: string;
6028
+ };
6029
+ tableLampSleepy: {
6030
+ cardTitle: string;
6031
+ aria: {
6032
+ back: string;
6033
+ };
6034
+ field: {
6035
+ openTime: string;
6036
+ duration: string;
6037
+ brightness: string;
6038
+ };
6039
+ timeUnit: {
6040
+ hour: string;
6041
+ minute: string;
6042
+ };
6043
+ rangeUnit: {
6044
+ minute: string;
6045
+ };
6046
+ rangeValue: string;
6047
+ };
5824
6048
  lampCCT: {
5825
6049
  cardTitle: string;
5826
6050
  cool: string;