@doubao-apps/taro-runtime 0.0.32 → 0.0.33
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.
|
@@ -4,6 +4,7 @@ import type { PickerViewProps as TaroPickerViewPropsBase } from '@tarojs/compone
|
|
|
4
4
|
import type { PickerViewProps as LynxPickerViewProps, PickerColumnOption } from '@byted-doubao-apps/framework/components';
|
|
5
5
|
export type TaroPickerViewProps = TaroPickerViewPropsBase & {
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
theme?: LynxPickerViewProps['theme'];
|
|
7
8
|
};
|
|
8
9
|
export type TaroPickerViewColumnProps = {
|
|
9
10
|
children?: ReactNode;
|
|
@@ -35,7 +36,7 @@ export declare function buildOptionsFromRange(range?: Array<string | number>): P
|
|
|
35
36
|
export declare function buildOptionsFromChildren(children?: ReactNode): PickerColumnOption[];
|
|
36
37
|
export declare function resolveSelectedIndexValue(indices: number[] | undefined, columnIndex: number, options: PickerColumnOption[]): number | undefined;
|
|
37
38
|
export declare function mapPickerViewProps(props: TaroPickerViewProps): {
|
|
38
|
-
mapped: Pick<LynxPickerViewProps, 'className' | 'style'> & Record<string, unknown>;
|
|
39
|
+
mapped: Pick<LynxPickerViewProps, 'className' | 'style' | 'theme'> & Record<string, unknown>;
|
|
39
40
|
unsupported: string[];
|
|
40
41
|
pickerViewId: string;
|
|
41
42
|
indicatorItemHeight: number | undefined;
|
|
@@ -38,7 +38,7 @@ export function resolveSelectedIndexValue(indices, columnIndex, options) {
|
|
|
38
38
|
return Math.min(Math.max(Math.trunc(selectedIndex), 0), options.length - 1);
|
|
39
39
|
}
|
|
40
40
|
export function mapPickerViewProps(props) {
|
|
41
|
-
const { value: _value, defaultValue: _defaultValue, children: _children, onChange: _onChange, indicatorStyle, indicatorClass, maskStyle, maskClass, immediateChange, onPickStart, onPickEnd, title, ariaLabel, ...rest } = props;
|
|
41
|
+
const { value: _value, defaultValue: _defaultValue, children: _children, onChange: _onChange, indicatorStyle, indicatorClass, maskStyle, maskClass, immediateChange, onPickStart, onPickEnd, title, ariaLabel, theme, ...rest } = props;
|
|
42
42
|
const unsupported = [];
|
|
43
43
|
const indicatorItemHeight = resolveItemHeightFromIndicatorStyle(indicatorStyle);
|
|
44
44
|
unsupported.push(...getUnsupportedIndicatorStyleWarnings(indicatorStyle, indicatorItemHeight));
|
|
@@ -59,6 +59,12 @@ export function mapPickerViewProps(props) {
|
|
|
59
59
|
if (ariaLabel !== undefined)
|
|
60
60
|
unsupported.push('ariaLabel');
|
|
61
61
|
const mapped = {};
|
|
62
|
+
if (theme === 'light' || theme === 'dark') {
|
|
63
|
+
mapped.theme = theme;
|
|
64
|
+
}
|
|
65
|
+
else if (theme !== undefined) {
|
|
66
|
+
unsupported.push('theme');
|
|
67
|
+
}
|
|
62
68
|
Object.entries(rest).forEach(([key, value]) => {
|
|
63
69
|
const target = BASE_PROP_MAP[key];
|
|
64
70
|
if (target) {
|
package/package.json
CHANGED