@miot-rn/car-component 1.0.1
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/README.md +325 -0
- package/dist/assets/i18n/ar.d.ts +55 -0
- package/dist/assets/i18n/ar.js +55 -0
- package/dist/assets/i18n/bo.d.ts +55 -0
- package/dist/assets/i18n/bo.js +55 -0
- package/dist/assets/i18n/cs.d.ts +55 -0
- package/dist/assets/i18n/cs.js +55 -0
- package/dist/assets/i18n/de.d.ts +55 -0
- package/dist/assets/i18n/de.js +55 -0
- package/dist/assets/i18n/el.d.ts +55 -0
- package/dist/assets/i18n/el.js +55 -0
- package/dist/assets/i18n/en.d.ts +55 -0
- package/dist/assets/i18n/en.js +55 -0
- package/dist/assets/i18n/es.d.ts +55 -0
- package/dist/assets/i18n/es.js +55 -0
- package/dist/assets/i18n/es_us.d.ts +55 -0
- package/dist/assets/i18n/es_us.js +55 -0
- package/dist/assets/i18n/fi.d.ts +55 -0
- package/dist/assets/i18n/fi.js +55 -0
- package/dist/assets/i18n/fr.d.ts +55 -0
- package/dist/assets/i18n/fr.js +55 -0
- package/dist/assets/i18n/he.d.ts +55 -0
- package/dist/assets/i18n/he.js +55 -0
- package/dist/assets/i18n/hu.d.ts +55 -0
- package/dist/assets/i18n/hu.js +55 -0
- package/dist/assets/i18n/id.d.ts +55 -0
- package/dist/assets/i18n/id.js +55 -0
- package/dist/assets/i18n/it.d.ts +55 -0
- package/dist/assets/i18n/it.js +55 -0
- package/dist/assets/i18n/ja.d.ts +55 -0
- package/dist/assets/i18n/ja.js +55 -0
- package/dist/assets/i18n/ko.d.ts +55 -0
- package/dist/assets/i18n/ko.js +55 -0
- package/dist/assets/i18n/nb.d.ts +55 -0
- package/dist/assets/i18n/nb.js +55 -0
- package/dist/assets/i18n/nl.d.ts +55 -0
- package/dist/assets/i18n/nl.js +55 -0
- package/dist/assets/i18n/pl.d.ts +55 -0
- package/dist/assets/i18n/pl.js +55 -0
- package/dist/assets/i18n/pt.d.ts +55 -0
- package/dist/assets/i18n/pt.js +55 -0
- package/dist/assets/i18n/pt_pt.d.ts +55 -0
- package/dist/assets/i18n/pt_pt.js +55 -0
- package/dist/assets/i18n/ro.d.ts +55 -0
- package/dist/assets/i18n/ro.js +55 -0
- package/dist/assets/i18n/ru.d.ts +55 -0
- package/dist/assets/i18n/ru.js +55 -0
- package/dist/assets/i18n/sk.d.ts +55 -0
- package/dist/assets/i18n/sk.js +55 -0
- package/dist/assets/i18n/sv.d.ts +55 -0
- package/dist/assets/i18n/sv.js +55 -0
- package/dist/assets/i18n/th.d.ts +55 -0
- package/dist/assets/i18n/th.js +55 -0
- package/dist/assets/i18n/tr.d.ts +55 -0
- package/dist/assets/i18n/tr.js +55 -0
- package/dist/assets/i18n/uk.d.ts +55 -0
- package/dist/assets/i18n/uk.js +55 -0
- package/dist/assets/i18n/vi.d.ts +55 -0
- package/dist/assets/i18n/vi.js +55 -0
- package/dist/assets/i18n/zh.d.ts +55 -0
- package/dist/assets/i18n/zh.js +55 -0
- package/dist/assets/i18n/zh_hk.d.ts +55 -0
- package/dist/assets/i18n/zh_hk.js +55 -0
- package/dist/assets/i18n/zh_tw.d.ts +55 -0
- package/dist/assets/i18n/zh_tw.js +55 -0
- package/dist/assets/image/dark/car_background_dark.png +0 -0
- package/dist/assets/image/default/car_background.png +0 -0
- package/dist/components/airConditioningCard/index.d.ts +24 -0
- package/dist/components/airConditioningCard/index.js +103 -0
- package/dist/components/carInfoHeader/carImage.d.ts +8 -0
- package/dist/components/carInfoHeader/carImage.js +42 -0
- package/dist/components/carInfoHeader/dualRangeIndicator.d.ts +15 -0
- package/dist/components/carInfoHeader/dualRangeIndicator.js +124 -0
- package/dist/components/carInfoHeader/index.d.ts +37 -0
- package/dist/components/carInfoHeader/index.js +118 -0
- package/dist/components/carInfoHeader/parkingStatus.d.ts +12 -0
- package/dist/components/carInfoHeader/parkingStatus.js +100 -0
- package/dist/components/carInfoHeader/rangeProgressBar.d.ts +14 -0
- package/dist/components/carInfoHeader/rangeProgressBar.js +77 -0
- package/dist/components/carInfoHeader/singleRangeIndicator.d.ts +11 -0
- package/dist/components/carInfoHeader/singleRangeIndicator.js +58 -0
- package/dist/components/cardContainer/index.d.ts +8 -0
- package/dist/components/cardContainer/index.js +22 -0
- package/dist/components/containerWithGap/gapWrap.d.ts +8 -0
- package/dist/components/containerWithGap/gapWrap.js +31 -0
- package/dist/components/containerWithGap/index.d.ts +12 -0
- package/dist/components/containerWithGap/index.js +43 -0
- package/dist/components/flatSelect/FlatOption.d.ts +18 -0
- package/dist/components/flatSelect/FlatOption.js +117 -0
- package/dist/components/flatSelect/FlatSelect.d.ts +14 -0
- package/dist/components/flatSelect/FlatSelect.js +112 -0
- package/dist/components/flatSelect/index.d.ts +2 -0
- package/dist/components/flatSelect/index.js +2 -0
- package/dist/components/flatSelect/index.zh-CN.md +89 -0
- package/dist/components/groupContainer/index.d.ts +9 -0
- package/dist/components/groupContainer/index.js +48 -0
- package/dist/components/otherSettingCard/index.d.ts +8 -0
- package/dist/components/otherSettingCard/index.js +40 -0
- package/dist/components/pageBackground/index.d.ts +7 -0
- package/dist/components/pageBackground/index.js +22 -0
- package/dist/components/seatControl/index.d.ts +34 -0
- package/dist/components/seatControl/index.js +98 -0
- package/dist/components/seatControl/seatCard.d.ts +11 -0
- package/dist/components/seatControl/seatCard.js +24 -0
- package/dist/components/seatControl/seatCardRow.d.ts +29 -0
- package/dist/components/seatControl/seatCardRow.js +48 -0
- package/dist/components/seatControlGroup/index.d.ts +40 -0
- package/dist/components/seatControlGroup/index.js +51 -0
- package/dist/components/steeringWheelHotCard/index.d.ts +17 -0
- package/dist/components/steeringWheelHotCard/index.js +66 -0
- package/dist/components/titleContainer/TitleContainer.d.ts +4 -0
- package/dist/components/titleContainer/TitleContainer.js +148 -0
- package/dist/components/titleContainer/TitleContainer.zh-CN.md +62 -0
- package/dist/components/titleContainer/index.d.ts +1 -0
- package/dist/components/titleContainer/index.js +1 -0
- package/dist/components/titleContainer/interface.d.ts +48 -0
- package/dist/components/titleContainer/interface.js +21 -0
- package/dist/components/warningForRunningCard/index.d.ts +6 -0
- package/dist/components/warningForRunningCard/index.js +20 -0
- package/dist/config/ConnectStatus.d.ts +7 -0
- package/dist/config/ConnectStatus.js +8 -0
- package/dist/config/index.d.ts +16 -0
- package/dist/config/index.js +16 -0
- package/dist/config/seatFunctionType.d.ts +7 -0
- package/dist/config/seatFunctionType.js +24 -0
- package/dist/config/seatGearLevel.d.ts +21 -0
- package/dist/config/seatGearLevel.js +19 -0
- package/dist/config/seatI18nKeys.d.ts +9 -0
- package/dist/config/seatI18nKeys.js +9 -0
- package/dist/config/seatPosition.d.ts +8 -0
- package/dist/config/seatPosition.js +8 -0
- package/dist/config/seatRowConfig.d.ts +6 -0
- package/dist/config/seatRowConfig.js +6 -0
- package/dist/global.d.js +0 -0
- package/dist/hooks/CONNECT_STATUS.d.ts +6 -0
- package/dist/hooks/CONNECT_STATUS.js +5 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/useAirConditionData.d.ts +29 -0
- package/dist/hooks/useAirConditionData.js +89 -0
- package/dist/hooks/useDualRangeData.d.ts +18 -0
- package/dist/hooks/useDualRangeData.js +82 -0
- package/dist/hooks/useParkingStatusData.d.ts +19 -0
- package/dist/hooks/useParkingStatusData.js +100 -0
- package/dist/hooks/useSeatControlData.d.ts +94 -0
- package/dist/hooks/useSeatControlData.js +251 -0
- package/dist/hooks/useSingleRangeData.d.ts +15 -0
- package/dist/hooks/useSingleRangeData.js +97 -0
- package/dist/hooks/useSteeringWheelData.d.ts +11 -0
- package/dist/hooks/useSteeringWheelData.js +56 -0
- package/dist/icons/CarInUsed.d.ts +4 -0
- package/dist/icons/CarInUsed.js +13 -0
- package/dist/icons/DeviceManage.d.ts +4 -0
- package/dist/icons/DeviceManage.js +13 -0
- package/dist/icons/ElectricPower.d.ts +4 -0
- package/dist/icons/ElectricPower.js +13 -0
- package/dist/icons/ErrorStatus.d.ts +4 -0
- package/dist/icons/ErrorStatus.js +13 -0
- package/dist/icons/FuelPower.d.ts +4 -0
- package/dist/icons/FuelPower.js +18 -0
- package/dist/icons/Loading.d.ts +4 -0
- package/dist/icons/Loading.js +16 -0
- package/dist/icons/MijiaLogo.d.ts +4 -0
- package/dist/icons/MijiaLogo.js +16 -0
- package/dist/icons/Minus.d.ts +4 -0
- package/dist/icons/Minus.js +15 -0
- package/dist/icons/ParkingStatus.d.ts +4 -0
- package/dist/icons/ParkingStatus.js +15 -0
- package/dist/icons/SeatGearHeatingLevelOne.d.ts +4 -0
- package/dist/icons/SeatGearHeatingLevelOne.js +22 -0
- package/dist/icons/SeatGearHeatingLevelThree.d.ts +4 -0
- package/dist/icons/SeatGearHeatingLevelThree.js +18 -0
- package/dist/icons/SeatGearHeatingLevelTwo.d.ts +4 -0
- package/dist/icons/SeatGearHeatingLevelTwo.js +22 -0
- package/dist/icons/SeatGearHeatingOff.d.ts +4 -0
- package/dist/icons/SeatGearHeatingOff.js +18 -0
- package/dist/icons/SeatGearVentilationLevelOne.d.ts +4 -0
- package/dist/icons/SeatGearVentilationLevelOne.js +17 -0
- package/dist/icons/SeatGearVentilationLevelThree.d.ts +4 -0
- package/dist/icons/SeatGearVentilationLevelThree.js +13 -0
- package/dist/icons/SeatGearVentilationLevelTwo.d.ts +4 -0
- package/dist/icons/SeatGearVentilationLevelTwo.js +17 -0
- package/dist/icons/SeatGearVentilationOff.d.ts +4 -0
- package/dist/icons/SeatGearVentilationOff.js +16 -0
- package/dist/icons/SentryMode.d.ts +4 -0
- package/dist/icons/SentryMode.js +13 -0
- package/dist/icons/SmartScene.d.ts +4 -0
- package/dist/icons/SmartScene.js +13 -0
- package/dist/icons/SteeringWheelFirstGear.d.ts +4 -0
- package/dist/icons/SteeringWheelFirstGear.js +13 -0
- package/dist/icons/SteeringWheelHot.d.ts +4 -0
- package/dist/icons/SteeringWheelHot.js +13 -0
- package/dist/icons/SteeringWheelSecondGear.d.ts +4 -0
- package/dist/icons/SteeringWheelSecondGear.js +13 -0
- package/dist/icons/SteeringWheelThirdGear.d.ts +4 -0
- package/dist/icons/SteeringWheelThirdGear.js +13 -0
- package/dist/icons/Warning.d.ts +4 -0
- package/dist/icons/Warning.js +13 -0
- package/dist/icons/index.d.ts +24 -0
- package/dist/icons/index.js +27 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +20 -0
- package/dist/modules/MODULES.md +245 -0
- package/dist/modules/airconditionModule/README.md +262 -0
- package/dist/modules/airconditionModule/index.d.ts +17 -0
- package/dist/modules/airconditionModule/index.js +63 -0
- package/dist/modules/carInfoModule/README.md +418 -0
- package/dist/modules/carInfoModule/index.d.ts +26 -0
- package/dist/modules/carInfoModule/index.js +67 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +2 -0
- package/dist/modules/seatModule/README.md +345 -0
- package/dist/modules/seatModule/index.d.ts +15 -0
- package/dist/modules/seatModule/index.js +40 -0
- package/dist/modules/steeringWheelModule/README.md +216 -0
- package/dist/modules/steeringWheelModule/index.d.ts +13 -0
- package/dist/modules/steeringWheelModule/index.js +31 -0
- package/dist/resources/i18n.d.ts +1730 -0
- package/dist/resources/i18n.js +84 -0
- package/dist/resources/images.d.ts +1 -0
- package/dist/resources/images.js +45 -0
- package/dist/spec/index.d.ts +494 -0
- package/dist/spec/index.js +911 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.js +1 -0
- package/dist/utils/checkSameValue.d.ts +1 -0
- package/dist/utils/checkSameValue.js +11 -0
- package/dist/utils/fns.d.ts +5 -0
- package/dist/utils/fns.js +167 -0
- package/dist/utils/get-value-or-default.d.ts +1 -0
- package/dist/utils/get-value-or-default.js +4 -0
- package/dist/utils/getLocalI18n.d.ts +1 -0
- package/dist/utils/getLocalI18n.js +9 -0
- package/dist/utils/i18n.d.ts +1 -0
- package/dist/utils/i18n.js +141 -0
- package/dist/utils/objects.d.ts +2 -0
- package/dist/utils/objects.js +222 -0
- package/dist/utils/spec.d.ts +8 -0
- package/dist/utils/spec.js +171 -0
- package/dist/utils/types.d.ts +3 -0
- package/dist/utils/types.js +25 -0
- package/package.json +27 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SwitchProps, ColorType } from 'miot/ui/hyperOSUI';
|
|
3
|
+
export declare enum RightIconType {
|
|
4
|
+
ARROW = "arrow",
|
|
5
|
+
SELECT = "select",
|
|
6
|
+
FOLD = "fold"
|
|
7
|
+
}
|
|
8
|
+
export declare enum WidgetType {
|
|
9
|
+
SWITCH = "switch"
|
|
10
|
+
}
|
|
11
|
+
type AccessibilityRole = 'none' | 'button' | 'link' | 'search' | 'image' | 'keyboardkey' | 'text' | 'adjustable' | 'imagebutton' | 'header' | 'summary' | 'alert' | 'checkbox' | 'combobox' | 'menu' | 'menubar' | 'menuitem' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'spinbutton' | 'switch' | 'tab' | 'tablist' | 'timer' | 'toolbar';
|
|
12
|
+
export interface AccessibilityPropsType {
|
|
13
|
+
accessible?: boolean;
|
|
14
|
+
accessibilityRole?: AccessibilityRole;
|
|
15
|
+
accessibilityLabel?: string;
|
|
16
|
+
accessibilityHint?: string;
|
|
17
|
+
accessibilityState?: {
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
busy?: boolean;
|
|
22
|
+
expanded?: boolean;
|
|
23
|
+
};
|
|
24
|
+
accessibilityValue?: {
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
now?: number;
|
|
28
|
+
text?: string | number;
|
|
29
|
+
};
|
|
30
|
+
focusable?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface TitleContainerProps {
|
|
33
|
+
type?: WidgetType | string;
|
|
34
|
+
title: string;
|
|
35
|
+
subtitle?: string | React.ReactElement | null;
|
|
36
|
+
value?: boolean;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
onPress?: () => void;
|
|
39
|
+
onValueChange: (val: boolean) => void;
|
|
40
|
+
colorType?: ColorType;
|
|
41
|
+
accessibilitySubtitle?: AccessibilityPropsType;
|
|
42
|
+
accessibilityTitle?: AccessibilityPropsType;
|
|
43
|
+
switchOption?: SwitchProps;
|
|
44
|
+
leftIcon?: React.ReactNode;
|
|
45
|
+
showTitleArrow?: boolean;
|
|
46
|
+
customRenderer?: React.ReactElement;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 列表项右侧图标类型
|
|
3
|
+
*/
|
|
4
|
+
export let RightIconType = /*#__PURE__*/function (RightIconType) {
|
|
5
|
+
RightIconType["ARROW"] = "arrow";
|
|
6
|
+
RightIconType["SELECT"] = "select";
|
|
7
|
+
RightIconType["FOLD"] = "fold";
|
|
8
|
+
return RightIconType;
|
|
9
|
+
}({});
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 右侧控件类型
|
|
13
|
+
*/
|
|
14
|
+
export let WidgetType = /*#__PURE__*/function (WidgetType) {
|
|
15
|
+
WidgetType["SWITCH"] = "switch";
|
|
16
|
+
return WidgetType;
|
|
17
|
+
}({});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 带控件的列表项属性
|
|
21
|
+
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useContext, memo } from 'react';
|
|
2
|
+
import { LargeEntrance, ConfigContext } from 'miot/ui/hyperOSUI';
|
|
3
|
+
import { Warning } from "../../icons";
|
|
4
|
+
import { CardContainer } from "../cardContainer";
|
|
5
|
+
export const WarningForRunningCard = /*#__PURE__*/memo(props => {
|
|
6
|
+
const {
|
|
7
|
+
carRunningTip
|
|
8
|
+
} = props;
|
|
9
|
+
const {
|
|
10
|
+
colorToken
|
|
11
|
+
} = useContext(ConfigContext);
|
|
12
|
+
return /*#__PURE__*/React.createElement(CardContainer, null, /*#__PURE__*/React.createElement(LargeEntrance, {
|
|
13
|
+
leftIconSource: /*#__PURE__*/React.createElement(Warning, {
|
|
14
|
+
fill: colorToken.mjcard_color_yellow_1
|
|
15
|
+
}),
|
|
16
|
+
title: carRunningTip,
|
|
17
|
+
hideRightIcon: true,
|
|
18
|
+
forceHideRightIconOnPressInvalid: true
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ConnectStatus: {
|
|
2
|
+
readonly CONNECTING: "connecting";
|
|
3
|
+
readonly CONNECTED: "connected";
|
|
4
|
+
readonly DISCONNECTED: "disconnected";
|
|
5
|
+
};
|
|
6
|
+
export type ConnectStatusValue = (typeof ConnectStatus)[keyof typeof ConnectStatus];
|
|
7
|
+
export type ConnectStatusKey = keyof typeof ConnectStatus;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const SteeringWheelHotGear: {
|
|
2
|
+
readonly OFF: "OFF";
|
|
3
|
+
readonly Level1: "Level1";
|
|
4
|
+
readonly Level2: "Level2";
|
|
5
|
+
readonly Level3: "Level3";
|
|
6
|
+
readonly Off: "Off";
|
|
7
|
+
readonly 'Level 1': "Level 1";
|
|
8
|
+
readonly 'Level 2': "Level 2";
|
|
9
|
+
readonly 'Level 3': "Level 3";
|
|
10
|
+
};
|
|
11
|
+
export * from './seatGearLevel';
|
|
12
|
+
export * from './seatFunctionType';
|
|
13
|
+
export * from './seatPosition';
|
|
14
|
+
export * from './seatRowConfig';
|
|
15
|
+
export * from './seatI18nKeys';
|
|
16
|
+
export * from './ConnectStatus';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const SteeringWheelHotGear = {
|
|
2
|
+
OFF: 'OFF',
|
|
3
|
+
Level1: 'Level1',
|
|
4
|
+
Level2: 'Level2',
|
|
5
|
+
Level3: 'Level3',
|
|
6
|
+
Off: 'Off',
|
|
7
|
+
'Level 1': 'Level 1',
|
|
8
|
+
'Level 2': 'Level 2',
|
|
9
|
+
'Level 3': 'Level 3'
|
|
10
|
+
};
|
|
11
|
+
export * from "./seatGearLevel";
|
|
12
|
+
export * from "./seatFunctionType";
|
|
13
|
+
export * from "./seatPosition";
|
|
14
|
+
export * from "./seatRowConfig";
|
|
15
|
+
export * from "./seatI18nKeys";
|
|
16
|
+
export * from "./ConnectStatus";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SeatFunctionType: {
|
|
2
|
+
readonly Heating: "heating";
|
|
3
|
+
readonly Ventilation: "ventilation";
|
|
4
|
+
};
|
|
5
|
+
export type SeatFunctionTypeValue = (typeof SeatFunctionType)[keyof typeof SeatFunctionType];
|
|
6
|
+
export declare const HeatingStateOrder: Record<string, number>;
|
|
7
|
+
export declare const VentilationStateOrder: Record<string, number>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 座椅功能类型
|
|
2
|
+
export const SeatFunctionType = {
|
|
3
|
+
Heating: 'heating',
|
|
4
|
+
Ventilation: 'ventilation'
|
|
5
|
+
};
|
|
6
|
+
// 说明:spec description 大小写/命名不统一,这里统一使用小写排序
|
|
7
|
+
export const HeatingStateOrder = {
|
|
8
|
+
off: 100,
|
|
9
|
+
'level 3': 30,
|
|
10
|
+
'level 2': 20,
|
|
11
|
+
'level 1': 10,
|
|
12
|
+
level1: 10,
|
|
13
|
+
level2: 20,
|
|
14
|
+
level3: 30
|
|
15
|
+
};
|
|
16
|
+
export const VentilationStateOrder = {
|
|
17
|
+
off: 100,
|
|
18
|
+
'level 3': 30,
|
|
19
|
+
'level 2': 20,
|
|
20
|
+
'level 1': 10,
|
|
21
|
+
low: 10,
|
|
22
|
+
medium: 20,
|
|
23
|
+
high: 30
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const GearLevel: {
|
|
2
|
+
readonly off: "Off";
|
|
3
|
+
readonly 'level 3': "Three";
|
|
4
|
+
readonly 'level 2': "Two";
|
|
5
|
+
readonly 'level 1': "One";
|
|
6
|
+
readonly level1: "One";
|
|
7
|
+
readonly level2: "Two";
|
|
8
|
+
readonly level3: "Three";
|
|
9
|
+
readonly low: "One";
|
|
10
|
+
readonly medium: "Two";
|
|
11
|
+
readonly high: "Three";
|
|
12
|
+
};
|
|
13
|
+
export type GearLevelKey = string;
|
|
14
|
+
export type GearLevelValue = 'Off' | 'One' | 'Two' | 'Three';
|
|
15
|
+
export declare const SeatGearIconKey: {
|
|
16
|
+
readonly Off: "Off";
|
|
17
|
+
readonly One: "One";
|
|
18
|
+
readonly Two: "Two";
|
|
19
|
+
readonly Three: "Three";
|
|
20
|
+
};
|
|
21
|
+
export type SeatGearIconKeyValue = (typeof SeatGearIconKey)[keyof typeof SeatGearIconKey];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// 规格描述到图标 key 的归一化映射
|
|
2
|
+
export const GearLevel = {
|
|
3
|
+
off: 'Off',
|
|
4
|
+
'level 3': 'Three',
|
|
5
|
+
'level 2': 'Two',
|
|
6
|
+
'level 1': 'One',
|
|
7
|
+
level1: 'One',
|
|
8
|
+
level2: 'Two',
|
|
9
|
+
level3: 'Three',
|
|
10
|
+
low: 'One',
|
|
11
|
+
medium: 'Two',
|
|
12
|
+
high: 'Three'
|
|
13
|
+
};
|
|
14
|
+
export const SeatGearIconKey = {
|
|
15
|
+
Off: 'Off',
|
|
16
|
+
One: 'One',
|
|
17
|
+
Two: 'Two',
|
|
18
|
+
Three: 'Three'
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SeatI18nKeys: {
|
|
2
|
+
readonly GroupTitle: "car_seat";
|
|
3
|
+
readonly FrontLeft: "car_seat_front_left";
|
|
4
|
+
readonly FrontRight: "car_seat_front_right";
|
|
5
|
+
readonly RearLeft: "car_seat_rear_left";
|
|
6
|
+
readonly RearCenter: "car_seat_rear_center";
|
|
7
|
+
readonly RearRight: "car_seat_rear_right";
|
|
8
|
+
};
|
|
9
|
+
export type SeatI18nKey = (typeof SeatI18nKeys)[keyof typeof SeatI18nKeys];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SeatPosition: {
|
|
2
|
+
readonly FrontLeft: "frontLeft";
|
|
3
|
+
readonly FrontRight: "frontRight";
|
|
4
|
+
readonly RearLeft: "rearLeft";
|
|
5
|
+
readonly RearCenter: "rearCenter";
|
|
6
|
+
readonly RearRight: "rearRight";
|
|
7
|
+
};
|
|
8
|
+
export type SeatPositionValue = (typeof SeatPosition)[keyof typeof SeatPosition];
|
package/dist/global.d.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useParkingStatusData, type ParkingStatusInfo, type UseParkingStatusDataProps } from './useParkingStatusData';
|
|
2
|
+
export { useSeatControlData, type SeatControlDataProps, type SeatSpecs, LEVEL_ICONS, TYPE_CONFIG, SEAT_TITLES, } from './useSeatControlData';
|
|
3
|
+
export * from './useSingleRangeData';
|
|
4
|
+
export * from './useDualRangeData';
|
|
5
|
+
export { ConnectStatus } from '../config';
|
|
6
|
+
export type { ButtonStateConfig, ControlButtonConfig, SeatConfig, OnButtonPressParams, } from '../components/seatControlGroup';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useParkingStatusData } from "./useParkingStatusData";
|
|
2
|
+
export { useSeatControlData, LEVEL_ICONS, TYPE_CONFIG, SEAT_TITLES } from "./useSeatControlData";
|
|
3
|
+
export * from "./useSingleRangeData";
|
|
4
|
+
export * from "./useDualRangeData";
|
|
5
|
+
export { ConnectStatus } from "../config";
|
|
6
|
+
|
|
7
|
+
// Re-export types for seat module compatibility
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Spec } from '../types';
|
|
2
|
+
interface UseAirConditionDataProps {
|
|
3
|
+
specHVACStatePropertiesHvacStatus: Spec;
|
|
4
|
+
specHVACStatePropertiesHvacDefrosterStatus: Spec;
|
|
5
|
+
specHVACTemperaturePropertiesInsideTemperature: Spec;
|
|
6
|
+
specHVACTemperaturePropertiesOutsideTemperature: Spec;
|
|
7
|
+
specHVACTemperaturePropertiesHvacTargetTemperature: Spec;
|
|
8
|
+
}
|
|
9
|
+
export declare const useAirConditionData: ({ specHVACStatePropertiesHvacStatus, specHVACStatePropertiesHvacDefrosterStatus, specHVACTemperaturePropertiesInsideTemperature, specHVACTemperaturePropertiesOutsideTemperature, specHVACTemperaturePropertiesHvacTargetTemperature, }: UseAirConditionDataProps) => {
|
|
10
|
+
hvacStatus: any;
|
|
11
|
+
hvacDefrosterStatus: any;
|
|
12
|
+
transformHvacStatus: boolean;
|
|
13
|
+
transformHvacDefrosterStatus: boolean;
|
|
14
|
+
targetTemperature: any;
|
|
15
|
+
onHvacStatusChange: (val: boolean) => void;
|
|
16
|
+
onHvacDefrosterChange: (val: boolean) => void;
|
|
17
|
+
onHvacTemperatureChange: (val: number) => void;
|
|
18
|
+
hvacTitle: string | Record<string, string>;
|
|
19
|
+
hvacDefrosterTitle: string | Record<string, string>;
|
|
20
|
+
airConditionTip: string | Record<string, string>;
|
|
21
|
+
insideCarTip: string | Record<string, string>;
|
|
22
|
+
outsideCarTip: string | Record<string, string>;
|
|
23
|
+
insideTemperature: any;
|
|
24
|
+
outsideTemperature: any;
|
|
25
|
+
temperatureStep: any;
|
|
26
|
+
maxTemperature: any;
|
|
27
|
+
minTemperature: any;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* eslint-disable no-console, @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { useMemo, useCallback } from 'react';
|
|
3
|
+
import { setSpec, useSpecState } from '@miot-rn/common-component/dist/store/useGlobalSpecManager';
|
|
4
|
+
import { getValueBySpecDescription, getSpecValueRange } from '@miot-rn/common-component/dist/specs/instance-parser';
|
|
5
|
+
import { getLocalI18n } from '@miot-rn/common-component/dist/specs/i18n-parser';
|
|
6
|
+
import { checkSameValue } from "../utils/checkSameValue";
|
|
7
|
+
export const useAirConditionData = ({
|
|
8
|
+
specHVACStatePropertiesHvacStatus,
|
|
9
|
+
specHVACStatePropertiesHvacDefrosterStatus,
|
|
10
|
+
specHVACTemperaturePropertiesInsideTemperature,
|
|
11
|
+
specHVACTemperaturePropertiesOutsideTemperature,
|
|
12
|
+
specHVACTemperaturePropertiesHvacTargetTemperature
|
|
13
|
+
}) => {
|
|
14
|
+
const hvacStatus = useSpecState(specHVACStatePropertiesHvacStatus);
|
|
15
|
+
const hvacDefrosterStatus = useSpecState(specHVACStatePropertiesHvacDefrosterStatus);
|
|
16
|
+
const insideTemperature = useSpecState(specHVACTemperaturePropertiesInsideTemperature);
|
|
17
|
+
const outsideTemperature = useSpecState(specHVACTemperaturePropertiesOutsideTemperature);
|
|
18
|
+
const targetTemperature = useSpecState(specHVACTemperaturePropertiesHvacTargetTemperature);
|
|
19
|
+
const {
|
|
20
|
+
airConditionTip,
|
|
21
|
+
insideCarTip,
|
|
22
|
+
outsideCarTip,
|
|
23
|
+
hvacTitle,
|
|
24
|
+
hvacDefrosterTitle
|
|
25
|
+
} = useMemo(() => {
|
|
26
|
+
return {
|
|
27
|
+
airConditionTip: getLocalI18n('car_air_condition_tip'),
|
|
28
|
+
insideCarTip: getLocalI18n('car_inside_car_tip', [Number(insideTemperature)]),
|
|
29
|
+
outsideCarTip: getLocalI18n('car_outside_car_tip', [Number(outsideTemperature)]),
|
|
30
|
+
hvacTitle: getLocalI18n('car_air_condition_name'),
|
|
31
|
+
hvacDefrosterTitle: getLocalI18n('car_air_condition_defog')
|
|
32
|
+
};
|
|
33
|
+
}, [insideTemperature, outsideTemperature]);
|
|
34
|
+
const transformHvacStatus = useMemo(() => {
|
|
35
|
+
return hvacStatus !== undefined && checkSameValue(hvacStatus, getValueBySpecDescription(specHVACStatePropertiesHvacStatus, 'On'));
|
|
36
|
+
}, [hvacStatus, specHVACStatePropertiesHvacStatus]);
|
|
37
|
+
const transformHvacDefrosterStatus = useMemo(() => {
|
|
38
|
+
return hvacDefrosterStatus !== undefined && checkSameValue(hvacDefrosterStatus, getValueBySpecDescription(specHVACStatePropertiesHvacDefrosterStatus, 'Off'), false);
|
|
39
|
+
}, [hvacDefrosterStatus, specHVACStatePropertiesHvacDefrosterStatus]);
|
|
40
|
+
const [minTemperature, maxTemperature, temperatureStep] = useMemo(() => {
|
|
41
|
+
return getSpecValueRange(specHVACTemperaturePropertiesHvacTargetTemperature);
|
|
42
|
+
}, [specHVACTemperaturePropertiesHvacTargetTemperature]);
|
|
43
|
+
const onHvacStatusChange = useCallback(val => {
|
|
44
|
+
const valueDesc = val ? 'On' : 'Off';
|
|
45
|
+
setSpec({
|
|
46
|
+
...specHVACStatePropertiesHvacStatus,
|
|
47
|
+
value: getValueBySpecDescription(specHVACStatePropertiesHvacStatus, valueDesc)
|
|
48
|
+
}).then(res => {
|
|
49
|
+
console.log('onHvacStatusChange---res', res);
|
|
50
|
+
});
|
|
51
|
+
}, [specHVACStatePropertiesHvacStatus]);
|
|
52
|
+
const onHvacDefrosterChange = useCallback(val => {
|
|
53
|
+
const valueDesc = val ? 'Max Defrost' : 'Off';
|
|
54
|
+
setSpec({
|
|
55
|
+
...specHVACStatePropertiesHvacDefrosterStatus,
|
|
56
|
+
value: getValueBySpecDescription(specHVACStatePropertiesHvacDefrosterStatus, valueDesc)
|
|
57
|
+
}).then(res => {
|
|
58
|
+
console.log('onHvacDefrosterChange---res', res);
|
|
59
|
+
});
|
|
60
|
+
}, [specHVACStatePropertiesHvacDefrosterStatus]);
|
|
61
|
+
const onHvacTemperatureChange = useCallback(val => {
|
|
62
|
+
setSpec({
|
|
63
|
+
...specHVACTemperaturePropertiesHvacTargetTemperature,
|
|
64
|
+
value: val
|
|
65
|
+
}).then(res => {
|
|
66
|
+
console.log('onHvacTemperatureChange---res', res);
|
|
67
|
+
});
|
|
68
|
+
}, [specHVACTemperaturePropertiesHvacTargetTemperature]);
|
|
69
|
+
return {
|
|
70
|
+
hvacStatus,
|
|
71
|
+
hvacDefrosterStatus,
|
|
72
|
+
transformHvacStatus,
|
|
73
|
+
transformHvacDefrosterStatus,
|
|
74
|
+
targetTemperature,
|
|
75
|
+
onHvacStatusChange,
|
|
76
|
+
onHvacDefrosterChange,
|
|
77
|
+
onHvacTemperatureChange,
|
|
78
|
+
hvacTitle,
|
|
79
|
+
hvacDefrosterTitle,
|
|
80
|
+
airConditionTip,
|
|
81
|
+
insideCarTip,
|
|
82
|
+
outsideCarTip,
|
|
83
|
+
insideTemperature,
|
|
84
|
+
outsideTemperature,
|
|
85
|
+
temperatureStep,
|
|
86
|
+
maxTemperature,
|
|
87
|
+
minTemperature
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Spec } from '../types';
|
|
2
|
+
export interface DualRangeDisplayData {
|
|
3
|
+
currentElectricRange: number | string;
|
|
4
|
+
electricRange: number;
|
|
5
|
+
unit: string;
|
|
6
|
+
electricColor: string;
|
|
7
|
+
currentFuelRange: number | string;
|
|
8
|
+
fuelRange: number;
|
|
9
|
+
fuelColor: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UseDualRangeDataProps {
|
|
12
|
+
specPowerBatteryPropertiesDCDRangeSOCTypeDisplay: Spec;
|
|
13
|
+
specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange: Spec;
|
|
14
|
+
specPowerRangePropertiesCltcFuelEndurance: Spec;
|
|
15
|
+
specPowerRangePropertiesWltcPureEleCruisingEndurance: Spec;
|
|
16
|
+
specPowerRangePropertiesWltcFuelEndurance: Spec;
|
|
17
|
+
}
|
|
18
|
+
export declare const useDualRangeData: ({ specPowerBatteryPropertiesDCDRangeSOCTypeDisplay, specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange, specPowerRangePropertiesCltcFuelEndurance, specPowerRangePropertiesWltcPureEleCruisingEndurance, specPowerRangePropertiesWltcFuelEndurance, }: UseDualRangeDataProps) => DualRangeDisplayData;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { useMemo, useCallback, useContext } from 'react';
|
|
3
|
+
import { useSpecState } from '@miot-rn/common-component/dist/store/useGlobalSpecManager';
|
|
4
|
+
import { getValueBySpecDescription } from '@miot-rn/common-component/dist/specs/instance-parser';
|
|
5
|
+
import { getLocalI18n } from '@miot-rn/common-component/dist/specs/i18n-parser';
|
|
6
|
+
import { ConfigContext } from 'miot/ui/hyperOSUI';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 双续航数据配置(单位已包含在内)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const useDualRangeData = ({
|
|
13
|
+
specPowerBatteryPropertiesDCDRangeSOCTypeDisplay,
|
|
14
|
+
specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange,
|
|
15
|
+
specPowerRangePropertiesCltcFuelEndurance,
|
|
16
|
+
specPowerRangePropertiesWltcPureEleCruisingEndurance,
|
|
17
|
+
specPowerRangePropertiesWltcFuelEndurance
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
colorToken
|
|
21
|
+
} = useContext(ConfigContext);
|
|
22
|
+
const dcdRangeSOCTypeDisplayValue = useSpecState(specPowerBatteryPropertiesDCDRangeSOCTypeDisplay);
|
|
23
|
+
const cltcEstimatedExtendEangeValue = useSpecState(specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange);
|
|
24
|
+
const cltcFuelEnduranceValue = useSpecState(specPowerRangePropertiesCltcFuelEndurance);
|
|
25
|
+
const wltcPureEleCruisingEnduranceValue = useSpecState(specPowerRangePropertiesWltcPureEleCruisingEndurance);
|
|
26
|
+
const wltcFuelEnduranceValue = useSpecState(specPowerRangePropertiesWltcFuelEndurance);
|
|
27
|
+
const distanceUnit = useMemo(() => {
|
|
28
|
+
const text = getLocalI18n('car_distance_value_km');
|
|
29
|
+
if (typeof text === 'string') {
|
|
30
|
+
const match = text.match(/\[([^\]]+)\]/);
|
|
31
|
+
if (match && match[1]) {
|
|
32
|
+
return match[1];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return 'km';
|
|
36
|
+
}, []);
|
|
37
|
+
const getDualRangeDisplayData = useCallback(() => {
|
|
38
|
+
const electricColor = colorToken.mj_color_function_brandfill_normal;
|
|
39
|
+
const fuelColor = colorToken.mj_color_gray_text_2;
|
|
40
|
+
const dcdType = Number(dcdRangeSOCTypeDisplayValue);
|
|
41
|
+
const cltcEstimatedExtendEange = Number(cltcEstimatedExtendEangeValue);
|
|
42
|
+
const cltcFuelEndurance = Number(cltcFuelEnduranceValue);
|
|
43
|
+
const wltcPureEleCruisingEndurance = Number(wltcPureEleCruisingEnduranceValue);
|
|
44
|
+
const wltcFuelEndurance = Number(wltcFuelEnduranceValue);
|
|
45
|
+
if (dcdType === undefined) {
|
|
46
|
+
return {
|
|
47
|
+
currentElectricRange: '--',
|
|
48
|
+
electricRange: 100,
|
|
49
|
+
unit: distanceUnit,
|
|
50
|
+
currentFuelRange: '--',
|
|
51
|
+
fuelRange: 100,
|
|
52
|
+
electricColor,
|
|
53
|
+
fuelColor
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 1. WLTC Range (Extended Range)
|
|
58
|
+
if (getValueBySpecDescription(specPowerBatteryPropertiesDCDRangeSOCTypeDisplay, 'WLTCRange') === dcdType) {
|
|
59
|
+
return {
|
|
60
|
+
currentElectricRange: Number.isNaN(wltcPureEleCruisingEndurance) ? '--' : wltcPureEleCruisingEndurance,
|
|
61
|
+
electricRange: specPowerRangePropertiesWltcPureEleCruisingEndurance?.prop?.['value-range']?.[1] || 100,
|
|
62
|
+
unit: distanceUnit,
|
|
63
|
+
currentFuelRange: Number.isNaN(wltcFuelEndurance) ? '--' : wltcFuelEndurance,
|
|
64
|
+
fuelRange: specPowerRangePropertiesWltcFuelEndurance?.prop?.['value-range']?.[1] || 100,
|
|
65
|
+
electricColor,
|
|
66
|
+
fuelColor
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 2. CLTC Range (Default for Extended Range)
|
|
71
|
+
return {
|
|
72
|
+
currentElectricRange: Number.isNaN(cltcEstimatedExtendEange) ? '--' : cltcEstimatedExtendEange,
|
|
73
|
+
electricRange: specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange?.prop?.['value-range']?.[1] || 100,
|
|
74
|
+
unit: distanceUnit,
|
|
75
|
+
currentFuelRange: Number.isNaN(cltcFuelEndurance) ? '--' : cltcFuelEndurance,
|
|
76
|
+
fuelRange: specPowerRangePropertiesCltcFuelEndurance?.prop?.['value-range']?.[1] || 100,
|
|
77
|
+
electricColor,
|
|
78
|
+
fuelColor
|
|
79
|
+
};
|
|
80
|
+
}, [dcdRangeSOCTypeDisplayValue, cltcEstimatedExtendEangeValue, cltcFuelEnduranceValue, wltcPureEleCruisingEnduranceValue, wltcFuelEnduranceValue, specPowerBatteryPropertiesDCDRangeSOCTypeDisplay, specPowerBatteryLifeEffectivenessPropertiesCltcEstimatedExtendEange, specPowerRangePropertiesCltcFuelEndurance, specPowerRangePropertiesWltcPureEleCruisingEndurance, specPowerRangePropertiesWltcFuelEndurance, distanceUnit, colorToken]);
|
|
81
|
+
return useMemo(() => getDualRangeDisplayData(), [getDualRangeDisplayData]);
|
|
82
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
3
|
+
import { Spec } from '../types';
|
|
4
|
+
import { ConnectStatusValue } from '../config';
|
|
5
|
+
export interface ParkingStatusInfo {
|
|
6
|
+
parkingIcon?: React.ReactElement;
|
|
7
|
+
parkingStatus: string | Record<string, string>;
|
|
8
|
+
showDivider: boolean;
|
|
9
|
+
textStyle: StyleProp<TextStyle>;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UseParkingStatusDataProps {
|
|
13
|
+
specBodyGearPropertiesGearStatus: Spec;
|
|
14
|
+
specBodyPowerModePropertiesPowerModeState: Spec;
|
|
15
|
+
specDoorCentralLockPropertiesCentralLockState: Spec;
|
|
16
|
+
specSentryInfoPropertiesSentryWorkMode?: Spec;
|
|
17
|
+
connectStatus?: ConnectStatusValue;
|
|
18
|
+
}
|
|
19
|
+
export declare const useParkingStatusData: ({ specBodyGearPropertiesGearStatus, specBodyPowerModePropertiesPowerModeState, specDoorCentralLockPropertiesCentralLockState, specSentryInfoPropertiesSentryWorkMode, connectStatus, }: UseParkingStatusDataProps) => ParkingStatusInfo;
|