@workday/canvas-kit-react 8.0.0-alpha.250-next.19 → 8.0.0-alpha.251-next.20
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/common/lib/utils/components.ts +43 -22
- package/common/lib/utils/models.ts +8 -0
- package/dist/commonjs/banner/lib/Banner.d.ts +0 -9
- package/dist/commonjs/banner/lib/Banner.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +0 -155
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/ListBox.d.ts +0 -57
- package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.d.ts +28 -17
- package/dist/commonjs/common/lib/utils/components.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/components.js +10 -5
- package/dist/commonjs/common/lib/utils/models.d.ts +8 -0
- package/dist/commonjs/common/lib/utils/models.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/models.js +3 -0
- package/dist/commonjs/modal/lib/hooks/useModalModel.js +1 -1
- package/dist/es6/banner/lib/Banner.d.ts +0 -9
- package/dist/es6/banner/lib/Banner.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +0 -155
- package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts.map +1 -1
- package/dist/es6/collection/lib/ListBox.d.ts +0 -57
- package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/components.d.ts +28 -17
- package/dist/es6/common/lib/utils/components.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/components.js +10 -5
- package/dist/es6/common/lib/utils/models.d.ts +8 -0
- package/dist/es6/common/lib/utils/models.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/models.js +3 -0
- package/dist/es6/modal/lib/hooks/useModalModel.js +1 -1
- package/modal/lib/hooks/useModalModel.ts +1 -1
- package/package.json +3 -3
|
@@ -237,7 +237,7 @@ export const createContainer = <
|
|
|
237
237
|
Context?: React.Context<any>;
|
|
238
238
|
} & {defaultConfig?: Record<string, any>},
|
|
239
239
|
TDefaultContext extends {state: Record<string, any>; events: Record<string, any>},
|
|
240
|
-
TElemPropsHook
|
|
240
|
+
TElemPropsHook,
|
|
241
241
|
SubComponents = {}
|
|
242
242
|
>({
|
|
243
243
|
displayName,
|
|
@@ -252,13 +252,15 @@ export const createContainer = <
|
|
|
252
252
|
defaultContext?: TDefaultContext;
|
|
253
253
|
subComponents?: SubComponents;
|
|
254
254
|
}) => {
|
|
255
|
-
|
|
256
|
-
modelHook.Context
|
|
257
|
-
|
|
255
|
+
assert(
|
|
256
|
+
modelHook.Context,
|
|
257
|
+
'createContainer only works on models with context. Please use `createModelHook` to create the `modelHook`'
|
|
258
|
+
);
|
|
259
|
+
const Context = modelHook.Context;
|
|
258
260
|
|
|
259
261
|
return <Props>(
|
|
260
262
|
Component: (
|
|
261
|
-
props: Props
|
|
263
|
+
props: CompoundProps<Props, TElemPropsHook, E>,
|
|
262
264
|
Element: E extends undefined ? never : E,
|
|
263
265
|
model: TModelHook extends (config: infer TConfig) => infer TModel ? TModel : never
|
|
264
266
|
) => JSX.Element | null
|
|
@@ -272,7 +274,7 @@ export const createContainer = <
|
|
|
272
274
|
E extends undefined ? React.FC : E,
|
|
273
275
|
Props & TConfig,
|
|
274
276
|
TModel
|
|
275
|
-
>
|
|
277
|
+
>
|
|
276
278
|
: never) &
|
|
277
279
|
SubComponents => {
|
|
278
280
|
const ReturnedComponent = React.forwardRef<E, Props & {as?: React.ElementType} & {model?: any}>(
|
|
@@ -280,14 +282,14 @@ export const createContainer = <
|
|
|
280
282
|
const localModel = useDefaultModel(model, props, modelHook);
|
|
281
283
|
const elemProps = ((modelHook as any).getElemProps || defaultGetElemProps)(props);
|
|
282
284
|
const finalElemProps = elemPropsHook
|
|
283
|
-
? elemPropsHook(localModel, elemProps, ref)
|
|
285
|
+
? (elemPropsHook as any)(localModel, elemProps, ref)
|
|
284
286
|
: elemProps;
|
|
285
287
|
|
|
286
288
|
return React.createElement(
|
|
287
289
|
Context.Provider,
|
|
288
290
|
{value: localModel},
|
|
289
291
|
Component(
|
|
290
|
-
finalElemProps
|
|
292
|
+
finalElemProps,
|
|
291
293
|
// Cast to `any` to avoid: "ts(2345): Type 'undefined' is not assignable to type 'E extends
|
|
292
294
|
// undefined ? never : E'" I'm not sure I can actually cast to this conditional type and it
|
|
293
295
|
// doesn't actually matter, so cast to `any` it is.
|
|
@@ -303,9 +305,13 @@ export const createContainer = <
|
|
|
303
305
|
// we'll cast to `Record<string, any>` for assignment. Note the lack of type checking
|
|
304
306
|
// properties. Take care when changing the runtime of this function.
|
|
305
307
|
(ReturnedComponent as Record<string, any>)[key] = (subComponents as Record<string, any>)[key];
|
|
308
|
+
// Add a displayName if one isn't already created. This prevents us from having to add
|
|
309
|
+
// `displayName` to subcomponents if a container component has a `displayName`
|
|
310
|
+
if (displayName && !(subComponents as Record<string, any>)[key].displayName) {
|
|
311
|
+
(subComponents as Record<string, any>)[key].displayName = `${displayName}.${key}`;
|
|
312
|
+
}
|
|
306
313
|
});
|
|
307
314
|
ReturnedComponent.displayName = displayName;
|
|
308
|
-
(ReturnedComponent as any).Context = Context;
|
|
309
315
|
|
|
310
316
|
// Cast as `any`. We have already specified the return type. Be careful making changes to this
|
|
311
317
|
// file due to this `any` `ReturnedComponent` is a `React.ForwardRefExoticComponent`, but we want
|
|
@@ -314,9 +320,30 @@ export const createContainer = <
|
|
|
314
320
|
};
|
|
315
321
|
};
|
|
316
322
|
|
|
323
|
+
/**
|
|
324
|
+
* If elemProps returns `null` for a prop, that prop is to be removed from the prop
|
|
325
|
+
* list. This is useful for passing props to an elemProp hook that should not be exposed
|
|
326
|
+
* to the DOM element
|
|
327
|
+
*/
|
|
317
328
|
type RemoveNull<T> = {[K in keyof T]: Exclude<T[K], null>};
|
|
318
329
|
|
|
319
|
-
|
|
330
|
+
/**
|
|
331
|
+
* Props for the compound component based on props, elemPropsHook, and element. It will
|
|
332
|
+
* return a prop interface according to all these inputs. The following will be added to
|
|
333
|
+
* the passed in `Props` type:
|
|
334
|
+
* - The prop interface returned by the `elemPropsHook` function
|
|
335
|
+
* - if there is no detected `ref` in the `Props` interface, a `ref` will be added based on the element type E
|
|
336
|
+
* - if there is no detected `children` in the `Props` interface, `children` will be added based on `ReactNode`
|
|
337
|
+
*/
|
|
338
|
+
type CompoundProps<Props, TElemPropsHook, E> = Props &
|
|
339
|
+
(TElemPropsHook extends (...args: any[]) => infer TProps // try to infer TProps returned from the elemPropsHook function
|
|
340
|
+
? RemoveNull<TProps extends {ref: any} ? TProps : TProps & {ref: ExtractRef<E>}>
|
|
341
|
+
: {ref: ExtractRef<E>}) &
|
|
342
|
+
(Props extends {children: any}
|
|
343
|
+
? {}
|
|
344
|
+
: {
|
|
345
|
+
children?: React.ReactNode;
|
|
346
|
+
});
|
|
320
347
|
|
|
321
348
|
export const createSubcomponent = <
|
|
322
349
|
E extends
|
|
@@ -336,6 +363,7 @@ export const createSubcomponent = <
|
|
|
336
363
|
elemPropsHook,
|
|
337
364
|
subComponents,
|
|
338
365
|
}: {
|
|
366
|
+
/** @deprecated You no longer need to use displayName. A `displayName` will be automatically added if it belongs to a container */
|
|
339
367
|
displayName?: string;
|
|
340
368
|
modelHook: TModelHook;
|
|
341
369
|
elemPropsHook?: TElemPropsHook;
|
|
@@ -348,17 +376,7 @@ export const createSubcomponent = <
|
|
|
348
376
|
|
|
349
377
|
return <Props = {}>(
|
|
350
378
|
Component: (
|
|
351
|
-
props: Props
|
|
352
|
-
(TElemPropsHook extends (...args: any[]) => infer TProps // try to infer TProps returned from the elemPropsHook function
|
|
353
|
-
? TProps extends {ref: infer R}
|
|
354
|
-
? TProps
|
|
355
|
-
: TProps & {ref: ExtractRef<E>}
|
|
356
|
-
: {ref: ExtractRef<E>}) &
|
|
357
|
-
(Props extends {children: any}
|
|
358
|
-
? {}
|
|
359
|
-
: {
|
|
360
|
-
children?: React.ReactNode;
|
|
361
|
-
}),
|
|
379
|
+
props: CompoundProps<Props, TElemPropsHook, E>,
|
|
362
380
|
Element: E extends undefined ? never : E,
|
|
363
381
|
model: TModelHook extends (...args: any[]) => infer TModel ? TModel : never
|
|
364
382
|
) => JSX.Element | null
|
|
@@ -398,7 +416,10 @@ export const createSubcomponent = <
|
|
|
398
416
|
// properties. Take care when changing the runtime of this function.
|
|
399
417
|
(ReturnedComponent as Record<string, any>)[key] = (subComponents as Record<string, any>)[key];
|
|
400
418
|
});
|
|
401
|
-
|
|
419
|
+
|
|
420
|
+
if (displayName) {
|
|
421
|
+
ReturnedComponent.displayName = displayName;
|
|
422
|
+
}
|
|
402
423
|
|
|
403
424
|
// Cast as `any`. We have already specified the return type. Be careful making changes to this
|
|
404
425
|
// file due to this `any` `ReturnedComponent` is a `React.ForwardRefExoticComponent`, but we want
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated The returned model is now inferred from `createModelHook`
|
|
6
|
+
*/
|
|
4
7
|
export type Model<State, Events extends IEvent> = {
|
|
5
8
|
state: State;
|
|
6
9
|
events: Events;
|
|
@@ -60,6 +63,8 @@ type ToCallbackConfig<
|
|
|
60
63
|
* // additional config your model requires goes here
|
|
61
64
|
* id?: string
|
|
62
65
|
* } & Partial<ToModelConfig<State, Events, typeof eventMap>>
|
|
66
|
+
*
|
|
67
|
+
* @deprecated `createModelHook` now infers the config type
|
|
63
68
|
*/
|
|
64
69
|
export type ToModelConfig<
|
|
65
70
|
TState extends Record<string, any>,
|
|
@@ -91,6 +96,8 @@ export type ToModelConfig<
|
|
|
91
96
|
* onOpen: 'open'
|
|
92
97
|
* }
|
|
93
98
|
* })
|
|
99
|
+
*
|
|
100
|
+
* @deprecated `createModelHook` uses Template Literal Types to create event map types
|
|
94
101
|
*/
|
|
95
102
|
export const createEventMap = <TEvents extends IEvent>() => <
|
|
96
103
|
TGuardMap extends Record<string, keyof TEvents>,
|
|
@@ -124,6 +131,7 @@ const keys = <T extends object>(input: T) => Object.keys(input) as (keyof T)[];
|
|
|
124
131
|
* }
|
|
125
132
|
* }
|
|
126
133
|
* })
|
|
134
|
+
* @deprecated Use `createModelHook` instead
|
|
127
135
|
*/
|
|
128
136
|
export const useEventMap = <
|
|
129
137
|
TEvents extends IEvent,
|
|
@@ -19,15 +19,6 @@ export declare const Banner: import("../../common").ElementComponentM<"button",
|
|
|
19
19
|
};
|
|
20
20
|
events: {};
|
|
21
21
|
}> & {
|
|
22
|
-
Context: React.Context<{
|
|
23
|
-
state: {
|
|
24
|
-
id: string;
|
|
25
|
-
hasError: boolean;
|
|
26
|
-
isSticky: boolean;
|
|
27
|
-
};
|
|
28
|
-
events: {};
|
|
29
|
-
}>;
|
|
30
|
-
} & {
|
|
31
22
|
Icon: import("../../common").ElementComponentM<"span", import("./BannerIcon").BannerIconProps, {
|
|
32
23
|
state: {
|
|
33
24
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../../banner/lib/Banner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAC,MAAM,kCAAkC,CAAC;AAQtD,MAAM,WAAW,WAAY,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAYD,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../../banner/lib/Banner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAC,MAAM,kCAAkC,CAAC;AAQtD,MAAM,WAAW,WAAY,SAAQ,YAAY,CAAC,OAAO,IAAI,EAAE,KAAK,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAYD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDjB,CAAC"}
|
|
@@ -1434,161 +1434,6 @@ export declare const Breadcrumbs: import("../../common").ElementComponentM<"nav"
|
|
|
1434
1434
|
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
1435
1435
|
getId: (item: any) => string;
|
|
1436
1436
|
}> & {
|
|
1437
|
-
Context: React.Context<{
|
|
1438
|
-
state: {
|
|
1439
|
-
hiddenIds: string[];
|
|
1440
|
-
nonInteractiveIds: string[];
|
|
1441
|
-
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
1442
|
-
itemWidthCache: Record<string, number>;
|
|
1443
|
-
containerWidth: number;
|
|
1444
|
-
overflowTargetWidth: number;
|
|
1445
|
-
selectedIds: import("../../collection/lib/useSelectionListModel").SelectedIds;
|
|
1446
|
-
unselectedIds: string[];
|
|
1447
|
-
cursorId: string;
|
|
1448
|
-
columnCount: number;
|
|
1449
|
-
UNSTABLE_virtual: {
|
|
1450
|
-
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
1451
|
-
totalSize: number;
|
|
1452
|
-
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
1453
|
-
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
1454
|
-
measure: () => void;
|
|
1455
|
-
};
|
|
1456
|
-
UNSTABLE_defaultItemHeight: number;
|
|
1457
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
1458
|
-
id: string;
|
|
1459
|
-
indexRef: React.MutableRefObject<number>;
|
|
1460
|
-
isVirtualized: boolean;
|
|
1461
|
-
items: import("../..").Item<any>[];
|
|
1462
|
-
};
|
|
1463
|
-
events: {
|
|
1464
|
-
select(data: {
|
|
1465
|
-
id: string;
|
|
1466
|
-
}): void;
|
|
1467
|
-
setContainerWidth(data: {
|
|
1468
|
-
width?: number | undefined;
|
|
1469
|
-
}): void;
|
|
1470
|
-
/**
|
|
1471
|
-
* ### Breadcrumbs Link
|
|
1472
|
-
* ---
|
|
1473
|
-
* [View Developer Docs](https://canvas.workdaydesign.com/components/navigation/breadcrumbs/#breadcrumbslink)
|
|
1474
|
-
*
|
|
1475
|
-
* The hyperlink element in each `Breadcrumbs.Item`.
|
|
1476
|
-
*/
|
|
1477
|
-
setOverflowTargetWidth(data: {
|
|
1478
|
-
width: number;
|
|
1479
|
-
}): void;
|
|
1480
|
-
addItemWidth(data: {
|
|
1481
|
-
id: string;
|
|
1482
|
-
width: number;
|
|
1483
|
-
}): void;
|
|
1484
|
-
removeItemWidth(data: {
|
|
1485
|
-
id: string;
|
|
1486
|
-
}): void;
|
|
1487
|
-
addHiddenKey(data: {
|
|
1488
|
-
id: string;
|
|
1489
|
-
}): void;
|
|
1490
|
-
removeHiddenKey(data: {
|
|
1491
|
-
id: string;
|
|
1492
|
-
}): void;
|
|
1493
|
-
selectAll(): void;
|
|
1494
|
-
unselectAll(): void;
|
|
1495
|
-
registerItem(data: {
|
|
1496
|
-
item: any;
|
|
1497
|
-
textValue: string;
|
|
1498
|
-
}): void;
|
|
1499
|
-
goTo(data: {
|
|
1500
|
-
id: string;
|
|
1501
|
-
}): void;
|
|
1502
|
-
goToNext(): void;
|
|
1503
|
-
goToPrevious(): void;
|
|
1504
|
-
goToPreviousRow(): void;
|
|
1505
|
-
goToNextRow(): void;
|
|
1506
|
-
goToFirst(): void;
|
|
1507
|
-
goToLast(): void;
|
|
1508
|
-
goToFirstOfRow(): void;
|
|
1509
|
-
goToLastOfRow(): void;
|
|
1510
|
-
goToNextPage(): void;
|
|
1511
|
-
goToPreviousPage(): void;
|
|
1512
|
-
unregisterItem(data: {
|
|
1513
|
-
id: string;
|
|
1514
|
-
}): void;
|
|
1515
|
-
updateItemHeight(data: {
|
|
1516
|
-
value: number;
|
|
1517
|
-
}): void;
|
|
1518
|
-
};
|
|
1519
|
-
menu: {
|
|
1520
|
-
state: {
|
|
1521
|
-
stackRef: React.RefObject<HTMLDivElement>;
|
|
1522
|
-
targetRef: React.RefObject<HTMLButtonElement>;
|
|
1523
|
-
initialFocusRef: React.RefObject<any> | undefined;
|
|
1524
|
-
returnFocusRef: React.RefObject<any> | undefined;
|
|
1525
|
-
placement: import("@popperjs/core").Placement;
|
|
1526
|
-
id: string;
|
|
1527
|
-
visibility: import("../..").Visibility;
|
|
1528
|
-
selectedIds: import("../../collection/lib/useSelectionListModel").SelectedIds;
|
|
1529
|
-
unselectedIds: string[];
|
|
1530
|
-
cursorId: string;
|
|
1531
|
-
columnCount: number;
|
|
1532
|
-
UNSTABLE_virtual: {
|
|
1533
|
-
virtualItems: import("../../collection/lib/react-virtual").VirtualItem[];
|
|
1534
|
-
totalSize: number;
|
|
1535
|
-
scrollToOffset: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
1536
|
-
scrollToIndex: (index: number, options?: import("../../collection/lib/react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
1537
|
-
measure: () => void;
|
|
1538
|
-
};
|
|
1539
|
-
UNSTABLE_defaultItemHeight: number;
|
|
1540
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
1541
|
-
orientation: import("../../collection/lib/useBaseListModel").Orientation;
|
|
1542
|
-
indexRef: React.MutableRefObject<number>;
|
|
1543
|
-
nonInteractiveIds: string[];
|
|
1544
|
-
isVirtualized: boolean;
|
|
1545
|
-
items: import("../..").Item<any>[];
|
|
1546
|
-
mode: "multiple" | "single";
|
|
1547
|
-
};
|
|
1548
|
-
events: {
|
|
1549
|
-
updatePlacement(data: {
|
|
1550
|
-
placement: import("@popperjs/core").Placement;
|
|
1551
|
-
}): void;
|
|
1552
|
-
show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
1553
|
-
hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void;
|
|
1554
|
-
select(data: {
|
|
1555
|
-
id: string;
|
|
1556
|
-
}): void;
|
|
1557
|
-
selectAll(): void;
|
|
1558
|
-
unselectAll(): void;
|
|
1559
|
-
registerItem(data: {
|
|
1560
|
-
item: any;
|
|
1561
|
-
textValue: string;
|
|
1562
|
-
}): void;
|
|
1563
|
-
goTo(data: {
|
|
1564
|
-
id: string;
|
|
1565
|
-
}): void;
|
|
1566
|
-
goToNext(): void;
|
|
1567
|
-
goToPrevious(): void;
|
|
1568
|
-
goToPreviousRow(): void;
|
|
1569
|
-
goToNextRow(): void;
|
|
1570
|
-
goToFirst(): void;
|
|
1571
|
-
goToLast(): void;
|
|
1572
|
-
goToFirstOfRow(): void;
|
|
1573
|
-
goToLastOfRow(): void;
|
|
1574
|
-
goToNextPage(): void;
|
|
1575
|
-
goToPreviousPage(): void;
|
|
1576
|
-
unregisterItem(data: {
|
|
1577
|
-
id: string;
|
|
1578
|
-
}): void;
|
|
1579
|
-
updateItemHeight(data: {
|
|
1580
|
-
value: number;
|
|
1581
|
-
}): void;
|
|
1582
|
-
};
|
|
1583
|
-
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
1584
|
-
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
1585
|
-
getId: (item: any) => string;
|
|
1586
|
-
};
|
|
1587
|
-
selection: import("../../collection/lib/useSelectionListModel").SelectionManager;
|
|
1588
|
-
navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
|
|
1589
|
-
getId: (item: any) => string;
|
|
1590
|
-
}>;
|
|
1591
|
-
} & {
|
|
1592
1437
|
/**
|
|
1593
1438
|
* ### Breadcrumbs List
|
|
1594
1439
|
* ---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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWL,CAAC"}
|
|
@@ -876,63 +876,6 @@ export declare const ListBox: import("../../common").ElementComponentM<"ul", Lis
|
|
|
876
876
|
navigation: import("./useCursorListModel").NavigationManager;
|
|
877
877
|
getId: (item: any) => string;
|
|
878
878
|
}> & {
|
|
879
|
-
Context: React.Context<{
|
|
880
|
-
state: {
|
|
881
|
-
selectedIds: import("./useSelectionListModel").SelectedIds;
|
|
882
|
-
unselectedIds: string[];
|
|
883
|
-
cursorId: string;
|
|
884
|
-
columnCount: number;
|
|
885
|
-
UNSTABLE_virtual: {
|
|
886
|
-
virtualItems: import("./react-virtual").VirtualItem[];
|
|
887
|
-
totalSize: number;
|
|
888
|
-
scrollToOffset: (index: number, options?: import("./react-virtual").ScrollToOffsetOptions | undefined) => void;
|
|
889
|
-
scrollToIndex: (index: number, options?: import("./react-virtual").ScrollToIndexOptions | undefined) => void;
|
|
890
|
-
measure: () => void;
|
|
891
|
-
};
|
|
892
|
-
UNSTABLE_defaultItemHeight: number;
|
|
893
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
894
|
-
id: string;
|
|
895
|
-
orientation: import("./useBaseListModel").Orientation;
|
|
896
|
-
indexRef: React.MutableRefObject<number>;
|
|
897
|
-
nonInteractiveIds: string[];
|
|
898
|
-
isVirtualized: boolean;
|
|
899
|
-
items: import("./useBaseListModel").Item<any>[];
|
|
900
|
-
};
|
|
901
|
-
events: {
|
|
902
|
-
select(data: {
|
|
903
|
-
id: string;
|
|
904
|
-
}): void;
|
|
905
|
-
selectAll(): void;
|
|
906
|
-
unselectAll(): void;
|
|
907
|
-
registerItem(data: {
|
|
908
|
-
item: any;
|
|
909
|
-
textValue: string;
|
|
910
|
-
}): void;
|
|
911
|
-
goTo(data: {
|
|
912
|
-
id: string;
|
|
913
|
-
}): void;
|
|
914
|
-
goToNext(): void;
|
|
915
|
-
goToPrevious(): void;
|
|
916
|
-
goToPreviousRow(): void;
|
|
917
|
-
goToNextRow(): void;
|
|
918
|
-
goToFirst(): void;
|
|
919
|
-
goToLast(): void;
|
|
920
|
-
goToFirstOfRow(): void;
|
|
921
|
-
goToLastOfRow(): void;
|
|
922
|
-
goToNextPage(): void;
|
|
923
|
-
goToPreviousPage(): void;
|
|
924
|
-
unregisterItem(data: {
|
|
925
|
-
id: string;
|
|
926
|
-
}): void;
|
|
927
|
-
updateItemHeight(data: {
|
|
928
|
-
value: number;
|
|
929
|
-
}): void;
|
|
930
|
-
};
|
|
931
|
-
selection: import("./useSelectionListModel").SelectionManager;
|
|
932
|
-
navigation: import("./useCursorListModel").NavigationManager;
|
|
933
|
-
getId: (item: any) => string;
|
|
934
|
-
}>;
|
|
935
|
-
} & {
|
|
936
879
|
/**
|
|
937
880
|
* Extremely simple ListBox item that contains no functionality other than registering items and
|
|
938
881
|
* adding aria virtualization attributes. If you need more functionality, create your own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBox.d.ts","sourceRoot":"","sources":["../../../../collection/lib/ListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAM/D,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtB,CAAC;AAWH;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"ListBox.d.ts","sourceRoot":"","sources":["../../../../collection/lib/ListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAM/D,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtB,CAAC;AAWH;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhB;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBL,CAAC"}
|
|
@@ -169,41 +169,52 @@ export declare const createContainer: <E extends "symbol" | "object" | "s" | "bi
|
|
|
169
169
|
}, TDefaultContext extends {
|
|
170
170
|
state: Record<string, any>;
|
|
171
171
|
events: Record<string, any>;
|
|
172
|
-
}, TElemPropsHook
|
|
172
|
+
}, TElemPropsHook, SubComponents = {}>({ displayName, modelHook, elemPropsHook, defaultContext, subComponents, }: {
|
|
173
173
|
displayName?: string | undefined;
|
|
174
174
|
modelHook: TModelHook;
|
|
175
175
|
elemPropsHook?: TElemPropsHook | undefined;
|
|
176
176
|
defaultContext?: TDefaultContext | undefined;
|
|
177
177
|
subComponents?: SubComponents | undefined;
|
|
178
|
-
}) => <Props>(Component: (props: Props &
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
}) => <Props>(Component: (props: CompoundProps<Props, TElemPropsHook, E>, Element: E extends undefined ? never : E, model: TModelHook extends (config: infer TConfig) => infer TModel ? TModel : never) => JSX.Element | null) => (TModelHook extends (config: infer TConfig_1) => infer TModel_1 ? E extends undefined ? ComponentM<Props & TConfig_1, TModel_1> : ElementComponentM<E extends undefined ? React.FC<{}> : E, Props & TConfig_1, TModel_1> : never) & SubComponents;
|
|
179
|
+
/**
|
|
180
|
+
* If elemProps returns `null` for a prop, that prop is to be removed from the prop
|
|
181
|
+
* list. This is useful for passing props to an elemProp hook that should not be exposed
|
|
182
|
+
* to the DOM element
|
|
183
|
+
*/
|
|
183
184
|
declare type RemoveNull<T> = {
|
|
184
185
|
[K in keyof T]: Exclude<T[K], null>;
|
|
185
186
|
};
|
|
187
|
+
/**
|
|
188
|
+
* Props for the compound component based on props, elemPropsHook, and element. It will
|
|
189
|
+
* return a prop interface according to all these inputs. The following will be added to
|
|
190
|
+
* the passed in `Props` type:
|
|
191
|
+
* - The prop interface returned by the `elemPropsHook` function
|
|
192
|
+
* - if there is no detected `ref` in the `Props` interface, a `ref` will be added based on the element type E
|
|
193
|
+
* - if there is no detected `children` in the `Props` interface, `children` will be added based on `ReactNode`
|
|
194
|
+
*/
|
|
195
|
+
declare type CompoundProps<Props, TElemPropsHook, E> = Props & (TElemPropsHook extends (...args: any[]) => infer TProps ? RemoveNull<TProps extends {
|
|
196
|
+
ref: any;
|
|
197
|
+
} ? TProps : TProps & {
|
|
198
|
+
ref: ExtractRef<E>;
|
|
199
|
+
}> : {
|
|
200
|
+
ref: ExtractRef<E>;
|
|
201
|
+
}) & (Props extends {
|
|
202
|
+
children: any;
|
|
203
|
+
} ? {} : {
|
|
204
|
+
children?: React.ReactNode;
|
|
205
|
+
});
|
|
186
206
|
export declare const createSubcomponent: <E extends "symbol" | "object" | "s" | "big" | "link" | "small" | "sub" | "sup" | "circle" | "stop" | "path" | "style" | "map" | "filter" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | ElementComponentM<any, any, any> | undefined = undefined>(as?: E | undefined) => <TElemPropsHook, TModelHook extends ((config: any) => {
|
|
187
207
|
state: any;
|
|
188
208
|
events: any;
|
|
189
209
|
}) & {
|
|
190
210
|
Context?: React.Context<any> | undefined;
|
|
191
211
|
}, SubComponents = {}>({ displayName, modelHook, elemPropsHook, subComponents, }: {
|
|
212
|
+
/** @deprecated You no longer need to use displayName. A `displayName` will be automatically added if it belongs to a container */
|
|
192
213
|
displayName?: string | undefined;
|
|
193
214
|
modelHook: TModelHook;
|
|
194
215
|
elemPropsHook?: TElemPropsHook | undefined;
|
|
195
216
|
subComponents?: SubComponents | undefined;
|
|
196
|
-
}) => <Props = {}>(Component: (props: Props
|
|
197
|
-
ref: infer R;
|
|
198
|
-
} ? TProps : TProps & {
|
|
199
|
-
ref: ExtractRef<E>;
|
|
200
|
-
} : {
|
|
201
|
-
ref: ExtractRef<E>;
|
|
202
|
-
}) & (Props extends {
|
|
203
|
-
children: any;
|
|
204
|
-
} ? {} : {
|
|
205
|
-
children?: React.ReactNode;
|
|
206
|
-
}), Element: E extends undefined ? never : E, model: TModelHook extends (...args: any[]) => infer TModel ? TModel : never) => JSX.Element | null) => (TModelHook extends (...args: any[]) => infer TModel_1 ? ElementComponentM<E extends undefined ? React.FC<{}> : E, Props, TModel_1> : never) & SubComponents;
|
|
217
|
+
}) => <Props = {}>(Component: (props: CompoundProps<Props, TElemPropsHook, E>, Element: E extends undefined ? never : E, model: TModelHook extends (...args: any[]) => infer TModel ? TModel : never) => JSX.Element | null) => (TModelHook extends (...args: any[]) => infer TModel_1 ? ElementComponentM<E extends undefined ? React.FC<{}> : E, Props, TModel_1> : never) & SubComponents;
|
|
207
218
|
/**
|
|
208
219
|
* Factory function that creates components to be exported. It enforces React ref forwarding, `as`
|
|
209
220
|
* prop, display name, and sub-components, and handles proper typing without much boiler plate. The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B;;GAEG;AACH,oBAAY,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,aAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACpC,KAAK,GACL,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAC9B,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAClB,KAAK,CAAC,GAAG,CACP,CAAC,SAAS,MAAM,iBAAiB,GAC7B,iBAAiB,CAAC,CAAC,CAAC,GACpB,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GACxC,CAAC,SAAS,MAAM,iBAAiB,GAC/B,iBAAiB,CAAC,CAAC,CAAC,GACpB,CAAC,GACH,CAAC,CACN,CAAC;AAEN;;;;GAIG;AACH,oBAAY,cAAc,CAAC,CAAC,EAAE,WAAW,SAAS,KAAK,CAAC,WAAW,IAAI,CAAC,GACtE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG;IACxD;;;;;OAKG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC;AAEJ;;;;;;;GAOG;AACH,aAAK,qBAAqB,CACxB,CAAC,SAAS,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CA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E,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,GACzB,YAAY,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -41,8 +41,8 @@ function defaultGetElemProps(input) {
|
|
|
41
41
|
}
|
|
42
42
|
var createContainer = function (as) { return function (_a) {
|
|
43
43
|
var displayName = _a.displayName, modelHook = _a.modelHook, elemPropsHook = _a.elemPropsHook, defaultContext = _a.defaultContext, subComponents = _a.subComponents;
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
assert_1.assert(modelHook.Context, 'createContainer only works on models with context. Please use `createModelHook` to create the `modelHook`');
|
|
45
|
+
var Context = modelHook.Context;
|
|
46
46
|
return function (Component) {
|
|
47
47
|
var ReturnedComponent = react_1.default.forwardRef(function (_a, ref) {
|
|
48
48
|
var asOverride = _a.as, model = _a.model, props = __rest(_a, ["as", "model"]);
|
|
@@ -62,9 +62,13 @@ var createContainer = function (as) { return function (_a) {
|
|
|
62
62
|
// we'll cast to `Record<string, any>` for assignment. Note the lack of type checking
|
|
63
63
|
// properties. Take care when changing the runtime of this function.
|
|
64
64
|
ReturnedComponent[key] = subComponents[key];
|
|
65
|
+
// Add a displayName if one isn't already created. This prevents us from having to add
|
|
66
|
+
// `displayName` to subcomponents if a container component has a `displayName`
|
|
67
|
+
if (displayName && !subComponents[key].displayName) {
|
|
68
|
+
subComponents[key].displayName = displayName + "." + key;
|
|
69
|
+
}
|
|
65
70
|
});
|
|
66
71
|
ReturnedComponent.displayName = displayName;
|
|
67
|
-
ReturnedComponent.Context = Context;
|
|
68
72
|
// Cast as `any`. We have already specified the return type. Be careful making changes to this
|
|
69
73
|
// file due to this `any` `ReturnedComponent` is a `React.ForwardRefExoticComponent`, but we want
|
|
70
74
|
// it to be either an `Component` or `ElementComponent`
|
|
@@ -72,7 +76,6 @@ var createContainer = function (as) { return function (_a) {
|
|
|
72
76
|
};
|
|
73
77
|
}; };
|
|
74
78
|
exports.createContainer = createContainer;
|
|
75
|
-
// export type ModelComponentFn<TModelHook, TElemPropsHook, SubComponents> = <Props={}>(Component: ())
|
|
76
79
|
var createSubcomponent = function (as) { return function (_a) {
|
|
77
80
|
var displayName = _a.displayName, modelHook = _a.modelHook, elemPropsHook = _a.elemPropsHook, subComponents = _a.subComponents;
|
|
78
81
|
assert_1.assert(modelHook.Context, 'createSubcomponent only works on models with context. Please use `createModelHook` to create the `modelHook`');
|
|
@@ -95,7 +98,9 @@ var createSubcomponent = function (as) { return function (_a) {
|
|
|
95
98
|
// properties. Take care when changing the runtime of this function.
|
|
96
99
|
ReturnedComponent[key] = subComponents[key];
|
|
97
100
|
});
|
|
98
|
-
|
|
101
|
+
if (displayName) {
|
|
102
|
+
ReturnedComponent.displayName = displayName;
|
|
103
|
+
}
|
|
99
104
|
// Cast as `any`. We have already specified the return type. Be careful making changes to this
|
|
100
105
|
// file due to this `any` `ReturnedComponent` is a `React.ForwardRefExoticComponent`, but we want
|
|
101
106
|
// it to be either an `Component` or `ElementComponent`
|