Skip to content

Commit efe899b

Browse files
committed
Merge branch 'v4' into feature/dcc-refactor-textarea-tooltip
2 parents b05416d + 6177cff commit efe899b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1998
-1103
lines changed

@plotly/dash-generator-test-component-typescript/generator.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,28 @@ describe('Test Typescript component metadata generation', () => {
197197
expect(propType.value.value[0].name).toBe('string');
198198
expect(propType.value.value[1].name).toBe('shape');
199199
});
200+
test('Union of primitives and arrays of primitives', () => {
201+
const propType = R.path(
202+
propPath('TypeScriptComponent', 'array_primitive_mix').concat(
203+
'type'
204+
),
205+
metadata
206+
);
207+
expect(propType.name).toBe('union');
208+
expect(propType.value.length).toBe(4);
209+
expect(propType.value[0].name).toBe('string');
210+
expect(propType.value[1].name).toBe('number');
211+
expect(propType.value[2].name).toBe('bool');
212+
expect(propType.value[3].name).toBe('arrayOf');
213+
214+
// Verify that the array element type is a union of string, number, and boolean
215+
const arrayElementType = propType.value[3].value;
216+
expect(arrayElementType.name).toBe('union');
217+
expect(arrayElementType.value.length).toBe(3);
218+
expect(arrayElementType.value[0].name).toBe('string');
219+
expect(arrayElementType.value[1].name).toBe('number');
220+
expect(arrayElementType.value[2].name).toBe('bool');
221+
});
200222
test('Obj properties', () => {
201223
const propType = R.path(
202224
propPath('TypeScriptComponent', 'obj').concat('type', 'value'),

@plotly/dash-generator-test-component-typescript/src/components/TypeScriptComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const TypeScriptComponent = ({
1212
bool_default = true,
1313
null_default = null,
1414
obj_default = { a: 'a', b: 3 },
15+
array_primitive_mix = 1,
1516
...props
1617
}: TypescriptComponentProps) => {
1718
return <div id={id}>{required_string}</div>;

@plotly/dash-generator-test-component-typescript/src/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export type TypescriptComponentProps = {
2929
union?: number | string;
3030
union_shape?: {a: string} | string;
3131
array_union_shape?: ({a: string} | string)[];
32+
array_primitive_mix?:
33+
| string
34+
| number
35+
| (string | number | boolean)[]
36+
| boolean;
3237
element?: JSX.Element;
3338
array_elements?: JSX.Element[];
3439

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [4.0.0rc1] - 2025-09-22
6+
7+
## Added
8+
- [#3440](https://github.com/plotly/dash/pull/3440) Modernize dcc.Dropdown
9+
510
## [4.0.0rc0] - 2025-09-11
611
- [#3398](https://github.com/plotly/dash/pull/3398) Modernize dcc.Input
712
- [#3414](https://github.com/plotly/dash/pull/3414) Modernize dcc.Slider

0 commit comments

Comments
 (0)