@plasmicapp/react-web 0.2.117 → 0.2.118
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/all.d.ts +191 -45
- package/dist/index-common.d.ts +2 -1
- package/dist/react-web.cjs.development.js +31 -0
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +1 -0
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +3 -2
- package/skinny/dist/index-common.d.ts +2 -1
- package/skinny/dist/index.js +1 -0
- package/skinny/dist/index.js.map +1 -1
package/dist/all.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties, Key, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$1, SyntheticEvent } from 'react';
|
|
2
|
+
import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties, Key as Key$1, ReactNode, ReactElement, FocusEvent, KeyboardEvent as KeyboardEvent$1, SyntheticEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
// LICENSE is MIT
|
|
5
5
|
//
|
|
@@ -17,6 +17,152 @@ type Argument = Value | Mapping | Argument[];
|
|
|
17
17
|
|
|
18
18
|
declare function classNames$1(...args: Argument[]): string;
|
|
19
19
|
|
|
20
|
+
declare type FetcherResponse<Data = unknown> = Data | Promise<Data>;
|
|
21
|
+
declare type BareFetcher<Data = unknown> = (...args: any[]) => FetcherResponse<Data>;
|
|
22
|
+
declare type Fetcher$1<Data = unknown, SWRKey extends Key = Key> = SWRKey extends () => readonly [...infer Args] | null | undefined | false ? (...args: [...Args]) => FetcherResponse<Data> : SWRKey extends readonly [...infer Args] ? (...args: [...Args]) => FetcherResponse<Data> : SWRKey extends () => infer Arg | null | undefined | false ? (...args: [Arg]) => FetcherResponse<Data> : SWRKey extends null | undefined | false ? never : SWRKey extends infer Arg ? (...args: [Arg]) => FetcherResponse<Data> : never;
|
|
23
|
+
interface InternalConfiguration {
|
|
24
|
+
cache: Cache;
|
|
25
|
+
mutate: ScopedMutator;
|
|
26
|
+
}
|
|
27
|
+
interface PublicConfiguration<Data = any, Error = any, Fn extends Fetcher$1 = BareFetcher> {
|
|
28
|
+
errorRetryInterval: number;
|
|
29
|
+
errorRetryCount?: number;
|
|
30
|
+
loadingTimeout: number;
|
|
31
|
+
focusThrottleInterval: number;
|
|
32
|
+
dedupingInterval: number;
|
|
33
|
+
refreshInterval?: number | ((latestData: Data | undefined) => number);
|
|
34
|
+
refreshWhenHidden?: boolean;
|
|
35
|
+
refreshWhenOffline?: boolean;
|
|
36
|
+
revalidateOnFocus: boolean;
|
|
37
|
+
revalidateOnReconnect: boolean;
|
|
38
|
+
revalidateOnMount?: boolean;
|
|
39
|
+
revalidateIfStale: boolean;
|
|
40
|
+
shouldRetryOnError: boolean | ((err: Error) => boolean);
|
|
41
|
+
suspense?: boolean;
|
|
42
|
+
fallbackData?: Data;
|
|
43
|
+
fetcher?: Fn;
|
|
44
|
+
use?: Middleware[];
|
|
45
|
+
fallback: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
isPaused: () => boolean;
|
|
49
|
+
onLoadingSlow: (key: string, config: Readonly<PublicConfiguration<Data, Error, Fn>>) => void;
|
|
50
|
+
onSuccess: (data: Data, key: string, config: Readonly<PublicConfiguration<Data, Error, Fn>>) => void;
|
|
51
|
+
onError: (err: Error, key: string, config: Readonly<PublicConfiguration<Data, Error, Fn>>) => void;
|
|
52
|
+
onErrorRetry: (err: Error, key: string, config: Readonly<PublicConfiguration<Data, Error, Fn>>, revalidate: Revalidator, revalidateOpts: Required<RevalidatorOptions>) => void;
|
|
53
|
+
onDiscarded: (key: string) => void;
|
|
54
|
+
compare: (a: Data | undefined, b: Data | undefined) => boolean;
|
|
55
|
+
isOnline: () => boolean;
|
|
56
|
+
isVisible: () => boolean;
|
|
57
|
+
}
|
|
58
|
+
declare type FullConfiguration = InternalConfiguration & PublicConfiguration;
|
|
59
|
+
interface SWRHook {
|
|
60
|
+
<Data = any, Error = any, SWRKey extends Key = null>(key: SWRKey): SWRResponse<Data, Error>;
|
|
61
|
+
<Data = any, Error = any, SWRKey extends Key = null>(key: SWRKey, fetcher: Fetcher$1<Data, SWRKey> | null): SWRResponse<Data, Error>;
|
|
62
|
+
<Data = any, Error = any, SWRKey extends Key = null>(key: SWRKey, config: SWRConfiguration<Data, Error, Fetcher$1<Data, SWRKey>> | undefined): SWRResponse<Data, Error>;
|
|
63
|
+
<Data = any, Error = any, SWRKey extends Key = null>(key: SWRKey, fetcher: Fetcher$1<Data, SWRKey> | null, config: SWRConfiguration<Data, Error, Fetcher$1<Data, SWRKey>> | undefined): SWRResponse<Data, Error>;
|
|
64
|
+
<Data = any, Error = any>(key: Key): SWRResponse<Data, Error>;
|
|
65
|
+
<Data = any, Error = any>(key: Key, fetcher: BareFetcher<Data> | null): SWRResponse<Data, Error>;
|
|
66
|
+
<Data = any, Error = any>(key: Key, config: SWRConfiguration<Data, Error, BareFetcher<Data>> | undefined): SWRResponse<Data, Error>;
|
|
67
|
+
<Data = any, Error = any>(key: Key, fetcher: BareFetcher<Data> | null, config: SWRConfiguration<Data, Error, BareFetcher<Data>> | undefined): SWRResponse<Data, Error>;
|
|
68
|
+
}
|
|
69
|
+
declare type Middleware = (useSWRNext: SWRHook) => <Data = any, Error = any>(key: Key, fetcher: BareFetcher<Data> | null, config: SWRConfiguration<Data, Error, BareFetcher<Data>>) => SWRResponse<Data, Error>;
|
|
70
|
+
declare type ArgumentsTuple = [any, ...unknown[]] | readonly [any, ...unknown[]];
|
|
71
|
+
declare type Arguments = string | ArgumentsTuple | Record<any, any> | null | undefined | false;
|
|
72
|
+
declare type Key = Arguments | (() => Arguments);
|
|
73
|
+
declare type MutatorCallback<Data = any> = (currentData?: Data) => Promise<undefined | Data> | undefined | Data;
|
|
74
|
+
declare type MutatorOptions<Data = any> = {
|
|
75
|
+
revalidate?: boolean;
|
|
76
|
+
populateCache?: boolean | ((result: any, currentData: Data) => Data);
|
|
77
|
+
optimisticData?: Data | ((currentData?: Data) => Data);
|
|
78
|
+
rollbackOnError?: boolean;
|
|
79
|
+
};
|
|
80
|
+
interface ScopedMutator<Data = any> {
|
|
81
|
+
/** This is used for bound mutator */
|
|
82
|
+
(key: Key, data?: Data | Promise<Data> | MutatorCallback<Data>, opts?: boolean | MutatorOptions<Data>): Promise<Data | undefined>;
|
|
83
|
+
/** This is used for global mutator */
|
|
84
|
+
<T = any>(key: Key, data?: T | Promise<T> | MutatorCallback<T>, opts?: boolean | MutatorOptions<Data>): Promise<T | undefined>;
|
|
85
|
+
}
|
|
86
|
+
declare type KeyedMutator<Data> = (data?: Data | Promise<Data> | MutatorCallback<Data>, opts?: boolean | MutatorOptions<Data>) => Promise<Data | undefined>;
|
|
87
|
+
declare type SWRConfiguration<Data = any, Error = any, Fn extends BareFetcher<any> = BareFetcher<any>> = Partial<PublicConfiguration<Data, Error, Fn>>;
|
|
88
|
+
interface SWRResponse<Data = any, Error = any> {
|
|
89
|
+
data?: Data;
|
|
90
|
+
error?: Error;
|
|
91
|
+
mutate: KeyedMutator<Data>;
|
|
92
|
+
isValidating: boolean;
|
|
93
|
+
}
|
|
94
|
+
interface RevalidatorOptions {
|
|
95
|
+
retryCount?: number;
|
|
96
|
+
dedupe?: boolean;
|
|
97
|
+
}
|
|
98
|
+
declare type Revalidator = (revalidateOpts?: RevalidatorOptions) => Promise<boolean> | void;
|
|
99
|
+
interface Cache<Data = any> {
|
|
100
|
+
get(key: Key): Data | null | undefined;
|
|
101
|
+
set(key: Key, value: Data): void;
|
|
102
|
+
delete(key: Key): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function usePlasmicDataConfig(): FullConfiguration;
|
|
106
|
+
|
|
107
|
+
interface Pagination {
|
|
108
|
+
pageSize: number;
|
|
109
|
+
pageIndex: number;
|
|
110
|
+
}
|
|
111
|
+
interface DataSourceSchema {
|
|
112
|
+
tables: TableSchema[];
|
|
113
|
+
}
|
|
114
|
+
interface TableSchema {
|
|
115
|
+
id: string;
|
|
116
|
+
label?: string;
|
|
117
|
+
fields: TableFieldSchema[];
|
|
118
|
+
}
|
|
119
|
+
interface TableFieldSchema {
|
|
120
|
+
id: string;
|
|
121
|
+
label?: string;
|
|
122
|
+
type: TableFieldType;
|
|
123
|
+
}
|
|
124
|
+
declare type TableFieldType = 'text' | 'boolean' | 'number' | 'datetime' | 'unknown';
|
|
125
|
+
interface SingleRowResult<T = any> {
|
|
126
|
+
data: T;
|
|
127
|
+
schema?: TableSchema;
|
|
128
|
+
}
|
|
129
|
+
interface ManyRowsResult<T = any> {
|
|
130
|
+
data: T[];
|
|
131
|
+
total?: number;
|
|
132
|
+
schema?: TableSchema;
|
|
133
|
+
paginate?: Pagination;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface DataOp {
|
|
137
|
+
sourceId: string;
|
|
138
|
+
opId: string;
|
|
139
|
+
userArgs?: Record<string, any>;
|
|
140
|
+
cacheKey?: string;
|
|
141
|
+
invalidatedKeys?: string[];
|
|
142
|
+
}
|
|
143
|
+
declare function executePlasmicDataOp<T = any>(op: DataOp, opts?: {
|
|
144
|
+
userAuthToken?: string;
|
|
145
|
+
includeSchema?: boolean;
|
|
146
|
+
paginate?: Pagination;
|
|
147
|
+
}): Promise<T>;
|
|
148
|
+
|
|
149
|
+
declare function Fetcher(props: {
|
|
150
|
+
dataOp?: DataOp;
|
|
151
|
+
name?: string;
|
|
152
|
+
children?: React__default.ReactNode;
|
|
153
|
+
includeSchema?: boolean;
|
|
154
|
+
pageIndex?: number;
|
|
155
|
+
pageSize?: number;
|
|
156
|
+
}): JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare function usePlasmicDataOp<T = any, E = any>(dataOp: DataOp | undefined, opts?: {
|
|
159
|
+
includeSchema?: boolean;
|
|
160
|
+
paginate?: Pagination;
|
|
161
|
+
}): SWRResponse<T, E>;
|
|
162
|
+
declare function usePlasmicDataMutationOp<T = any>(dataOp: DataOp | undefined, opts?: {
|
|
163
|
+
includeSchema?: boolean;
|
|
164
|
+
}): () => Promise<T | undefined>;
|
|
165
|
+
|
|
20
166
|
declare function pick<T extends {}>(obj: T, ...keys: (string | number | symbol)[]): Partial<T>;
|
|
21
167
|
declare function omit<T extends {}>(obj: T, ...keys: (keyof T)[]): Partial<T>;
|
|
22
168
|
|
|
@@ -466,7 +612,7 @@ interface InputBase {
|
|
|
466
612
|
|
|
467
613
|
type SelectionMode = 'none' | 'single' | 'multiple';
|
|
468
614
|
type SelectionBehavior = 'toggle' | 'replace';
|
|
469
|
-
type Selection = 'all' | Set<Key>;
|
|
615
|
+
type Selection = 'all' | Set<Key$1>;
|
|
470
616
|
|
|
471
617
|
type FocusStrategy = 'first' | 'last';
|
|
472
618
|
type DisabledBehavior = 'selection' | 'all';
|
|
@@ -493,32 +639,32 @@ interface Collection<T> extends Iterable<T> {
|
|
|
493
639
|
readonly size: number,
|
|
494
640
|
|
|
495
641
|
/** Iterate over all keys in the collection. */
|
|
496
|
-
getKeys(): Iterable<Key>,
|
|
642
|
+
getKeys(): Iterable<Key$1>,
|
|
497
643
|
|
|
498
644
|
/** Get an item by its key. */
|
|
499
|
-
getItem(key: Key): T,
|
|
645
|
+
getItem(key: Key$1): T,
|
|
500
646
|
|
|
501
647
|
/** Get an item by the index of its key. */
|
|
502
648
|
at(idx: number): T,
|
|
503
649
|
|
|
504
650
|
/** Get the key that comes before the given key in the collection. */
|
|
505
|
-
getKeyBefore(key: Key): Key | null,
|
|
651
|
+
getKeyBefore(key: Key$1): Key$1 | null,
|
|
506
652
|
|
|
507
653
|
/** Get the key that comes after the given key in the collection. */
|
|
508
|
-
getKeyAfter(key: Key): Key | null,
|
|
654
|
+
getKeyAfter(key: Key$1): Key$1 | null,
|
|
509
655
|
|
|
510
656
|
/** Get the first key in the collection. */
|
|
511
|
-
getFirstKey(): Key | null,
|
|
657
|
+
getFirstKey(): Key$1 | null,
|
|
512
658
|
|
|
513
659
|
/** Get the last key in the collection. */
|
|
514
|
-
getLastKey(): Key | null
|
|
660
|
+
getLastKey(): Key$1 | null
|
|
515
661
|
}
|
|
516
662
|
|
|
517
663
|
interface Node<T> {
|
|
518
664
|
/** The type of item this node represents. */
|
|
519
665
|
type: string,
|
|
520
666
|
/** A unique key for the node. */
|
|
521
|
-
key: Key,
|
|
667
|
+
key: Key$1,
|
|
522
668
|
/** The object value the node was created from. */
|
|
523
669
|
value: T,
|
|
524
670
|
/** The level of depth this node is at in the heirarchy. */
|
|
@@ -538,11 +684,11 @@ interface Node<T> {
|
|
|
538
684
|
/** A function that should be called to wrap the rendered node. */
|
|
539
685
|
wrapper?: (element: ReactElement) => ReactElement,
|
|
540
686
|
/** The key of the parent node. */
|
|
541
|
-
parentKey?: Key,
|
|
687
|
+
parentKey?: Key$1,
|
|
542
688
|
/** The key of the node before this node. */
|
|
543
|
-
prevKey?: Key,
|
|
689
|
+
prevKey?: Key$1,
|
|
544
690
|
/** The key of the node after this node. */
|
|
545
|
-
nextKey?: Key,
|
|
691
|
+
nextKey?: Key$1,
|
|
546
692
|
/** Additional properties specific to a particular node type. */
|
|
547
693
|
props?: any,
|
|
548
694
|
/** @private */
|
|
@@ -1285,11 +1431,11 @@ interface FocusState {
|
|
|
1285
1431
|
/** Sets whether the collection is focused. */
|
|
1286
1432
|
setFocused(isFocused: boolean): void;
|
|
1287
1433
|
/** The current focused key in the collection. */
|
|
1288
|
-
readonly focusedKey: Key;
|
|
1434
|
+
readonly focusedKey: Key$1;
|
|
1289
1435
|
/** Whether the first or last child of the focused key should receive focus. */
|
|
1290
1436
|
readonly childFocusStrategy: FocusStrategy;
|
|
1291
1437
|
/** Sets the focused key, and optionally, whether the first or last child of that key should receive focus. */
|
|
1292
|
-
setFocusedKey(key: Key, child?: FocusStrategy): void;
|
|
1438
|
+
setFocusedKey(key: Key$1, child?: FocusStrategy): void;
|
|
1293
1439
|
}
|
|
1294
1440
|
interface MultipleSelectionState extends FocusState {
|
|
1295
1441
|
/** The type of selection that is allowed in the collection. */
|
|
@@ -1305,7 +1451,7 @@ interface MultipleSelectionState extends FocusState {
|
|
|
1305
1451
|
/** Sets the selected keys in the collection. */
|
|
1306
1452
|
setSelectedKeys(keys: Selection): void;
|
|
1307
1453
|
/** The currently disabled keys in the collection. */
|
|
1308
|
-
readonly disabledKeys: Set<Key>;
|
|
1454
|
+
readonly disabledKeys: Set<Key$1>;
|
|
1309
1455
|
/** Whether `disabledKeys` applies to selection, actions, or both. */
|
|
1310
1456
|
readonly disabledBehavior: DisabledBehavior;
|
|
1311
1457
|
}
|
|
@@ -1317,31 +1463,31 @@ interface MultipleSelectionManager extends FocusState {
|
|
|
1317
1463
|
/** Whether the collection allows empty selection. */
|
|
1318
1464
|
readonly disallowEmptySelection?: boolean;
|
|
1319
1465
|
/** The currently selected keys in the collection. */
|
|
1320
|
-
readonly selectedKeys: Set<Key>;
|
|
1466
|
+
readonly selectedKeys: Set<Key$1>;
|
|
1321
1467
|
/** Whether the selection is empty. */
|
|
1322
1468
|
readonly isEmpty: boolean;
|
|
1323
1469
|
/** Whether all items in the collection are selected. */
|
|
1324
1470
|
readonly isSelectAll: boolean;
|
|
1325
1471
|
/** The first selected key in the collection. */
|
|
1326
|
-
readonly firstSelectedKey: Key | null;
|
|
1472
|
+
readonly firstSelectedKey: Key$1 | null;
|
|
1327
1473
|
/** The last selected key in the collection. */
|
|
1328
|
-
readonly lastSelectedKey: Key | null;
|
|
1474
|
+
readonly lastSelectedKey: Key$1 | null;
|
|
1329
1475
|
/** The currently disabled keys in the collection. */
|
|
1330
|
-
readonly disabledKeys: Set<Key>;
|
|
1476
|
+
readonly disabledKeys: Set<Key$1>;
|
|
1331
1477
|
/** Whether `disabledKeys` applies to selection, actions, or both. */
|
|
1332
1478
|
readonly disabledBehavior: DisabledBehavior;
|
|
1333
1479
|
/** Returns whether a key is selected. */
|
|
1334
|
-
isSelected(key: Key): boolean;
|
|
1480
|
+
isSelected(key: Key$1): boolean;
|
|
1335
1481
|
/** Returns whether the current selection is equal to the given selection. */
|
|
1336
|
-
isSelectionEqual(selection: Set<Key>): boolean;
|
|
1482
|
+
isSelectionEqual(selection: Set<Key$1>): boolean;
|
|
1337
1483
|
/** Extends the selection to the given key. */
|
|
1338
|
-
extendSelection(toKey: Key): void;
|
|
1484
|
+
extendSelection(toKey: Key$1): void;
|
|
1339
1485
|
/** Toggles whether the given key is selected. */
|
|
1340
|
-
toggleSelection(key: Key): void;
|
|
1486
|
+
toggleSelection(key: Key$1): void;
|
|
1341
1487
|
/** Replaces the selection with only the given key. */
|
|
1342
|
-
replaceSelection(key: Key): void;
|
|
1488
|
+
replaceSelection(key: Key$1): void;
|
|
1343
1489
|
/** Replaces the selection with the given keys. */
|
|
1344
|
-
setSelectedKeys(keys: Iterable<Key>): void;
|
|
1490
|
+
setSelectedKeys(keys: Iterable<Key$1>): void;
|
|
1345
1491
|
/** Selects all items in the collection. */
|
|
1346
1492
|
selectAll(): void;
|
|
1347
1493
|
/** Removes all keys from the selection. */
|
|
@@ -1352,11 +1498,11 @@ interface MultipleSelectionManager extends FocusState {
|
|
|
1352
1498
|
* Toggles, replaces, or extends selection to the given key depending
|
|
1353
1499
|
* on the pointer event and collection's selection mode.
|
|
1354
1500
|
*/
|
|
1355
|
-
select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void;
|
|
1501
|
+
select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
|
|
1356
1502
|
/** Returns whether the given key can be selected. */
|
|
1357
|
-
canSelectItem(key: Key): boolean;
|
|
1503
|
+
canSelectItem(key: Key$1): boolean;
|
|
1358
1504
|
/** Returns whether the given key is non-interactive, i.e. both selection and actions are disabled. */
|
|
1359
|
-
isDisabled(key: Key): boolean;
|
|
1505
|
+
isDisabled(key: Key$1): boolean;
|
|
1360
1506
|
/** Sets the selection behavior for the collection. */
|
|
1361
1507
|
setSelectionBehavior(selectionBehavior: SelectionBehavior): void;
|
|
1362
1508
|
}
|
|
@@ -1395,17 +1541,17 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
1395
1541
|
/**
|
|
1396
1542
|
* The current focused key in the collection.
|
|
1397
1543
|
*/
|
|
1398
|
-
get focusedKey(): Key;
|
|
1544
|
+
get focusedKey(): Key$1;
|
|
1399
1545
|
/** Whether the first or last child of the focused key should receive focus. */
|
|
1400
1546
|
get childFocusStrategy(): FocusStrategy;
|
|
1401
1547
|
/**
|
|
1402
1548
|
* Sets the focused key.
|
|
1403
1549
|
*/
|
|
1404
|
-
setFocusedKey(key: Key, childFocusStrategy?: FocusStrategy): void;
|
|
1550
|
+
setFocusedKey(key: Key$1, childFocusStrategy?: FocusStrategy): void;
|
|
1405
1551
|
/**
|
|
1406
1552
|
* The currently selected keys in the collection.
|
|
1407
1553
|
*/
|
|
1408
|
-
get selectedKeys(): Set<Key>;
|
|
1554
|
+
get selectedKeys(): Set<Key$1>;
|
|
1409
1555
|
/**
|
|
1410
1556
|
* The raw selection value for the collection.
|
|
1411
1557
|
* Either 'all' for select all, or a set of keys.
|
|
@@ -1414,7 +1560,7 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
1414
1560
|
/**
|
|
1415
1561
|
* Returns whether a key is selected.
|
|
1416
1562
|
*/
|
|
1417
|
-
isSelected(key: Key): boolean;
|
|
1563
|
+
isSelected(key: Key$1): boolean;
|
|
1418
1564
|
/**
|
|
1419
1565
|
* Whether the selection is empty.
|
|
1420
1566
|
*/
|
|
@@ -1423,26 +1569,26 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
1423
1569
|
* Whether all items in the collection are selected.
|
|
1424
1570
|
*/
|
|
1425
1571
|
get isSelectAll(): boolean;
|
|
1426
|
-
get firstSelectedKey(): Key | null;
|
|
1427
|
-
get lastSelectedKey(): Key | null;
|
|
1428
|
-
get disabledKeys(): Set<Key>;
|
|
1572
|
+
get firstSelectedKey(): Key$1 | null;
|
|
1573
|
+
get lastSelectedKey(): Key$1 | null;
|
|
1574
|
+
get disabledKeys(): Set<Key$1>;
|
|
1429
1575
|
get disabledBehavior(): DisabledBehavior;
|
|
1430
1576
|
/**
|
|
1431
1577
|
* Extends the selection to the given key.
|
|
1432
1578
|
*/
|
|
1433
|
-
extendSelection(toKey: Key): void;
|
|
1579
|
+
extendSelection(toKey: Key$1): void;
|
|
1434
1580
|
/**
|
|
1435
1581
|
* Toggles whether the given key is selected.
|
|
1436
1582
|
*/
|
|
1437
|
-
toggleSelection(key: Key): void;
|
|
1583
|
+
toggleSelection(key: Key$1): void;
|
|
1438
1584
|
/**
|
|
1439
1585
|
* Replaces the selection with only the given key.
|
|
1440
1586
|
*/
|
|
1441
|
-
replaceSelection(key: Key): void;
|
|
1587
|
+
replaceSelection(key: Key$1): void;
|
|
1442
1588
|
/**
|
|
1443
1589
|
* Replaces the selection with the given keys.
|
|
1444
1590
|
*/
|
|
1445
|
-
setSelectedKeys(keys: Iterable<Key>): void;
|
|
1591
|
+
setSelectedKeys(keys: Iterable<Key$1>): void;
|
|
1446
1592
|
/**
|
|
1447
1593
|
* Selects all items in the collection.
|
|
1448
1594
|
*/
|
|
@@ -1455,20 +1601,20 @@ declare class SelectionManager implements MultipleSelectionManager {
|
|
|
1455
1601
|
* Toggles between select all and an empty selection.
|
|
1456
1602
|
*/
|
|
1457
1603
|
toggleSelectAll(): void;
|
|
1458
|
-
select(key: Key, e?: PressEvent | LongPressEvent | PointerEvent): void;
|
|
1604
|
+
select(key: Key$1, e?: PressEvent | LongPressEvent | PointerEvent): void;
|
|
1459
1605
|
/**
|
|
1460
1606
|
* Returns whether the current selection is equal to the given selection.
|
|
1461
1607
|
*/
|
|
1462
|
-
isSelectionEqual(selection: Set<Key>): boolean;
|
|
1463
|
-
canSelectItem(key: Key): boolean;
|
|
1464
|
-
isDisabled(key: Key): boolean;
|
|
1608
|
+
isSelectionEqual(selection: Set<Key$1>): boolean;
|
|
1609
|
+
canSelectItem(key: Key$1): boolean;
|
|
1610
|
+
isDisabled(key: Key$1): boolean;
|
|
1465
1611
|
}
|
|
1466
1612
|
|
|
1467
1613
|
interface ListState<T> {
|
|
1468
1614
|
/** A collection of items in the list. */
|
|
1469
1615
|
collection: Collection<Node<T>>;
|
|
1470
1616
|
/** A set of items that are disabled. */
|
|
1471
|
-
disabledKeys: Set<Key>;
|
|
1617
|
+
disabledKeys: Set<Key$1>;
|
|
1472
1618
|
/** A selection manager to read and update multiple selection state. */
|
|
1473
1619
|
selectionManager: SelectionManager;
|
|
1474
1620
|
}
|
|
@@ -1637,4 +1783,4 @@ interface TriggeredOverlayContextValue {
|
|
|
1637
1783
|
}
|
|
1638
1784
|
declare const TriggeredOverlayContext: React.Context<TriggeredOverlayContextValue | undefined>;
|
|
1639
1785
|
|
|
1640
|
-
export { $State$1 as $State, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateValueProp, dlv as get, getDataProps, hasVariant, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, set, setPlumeStrictMode, useButton, useCanvasDollarState, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
|
1786
|
+
export { $State$1 as $State, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DataOp, DataSourceSchema, DropdownMenu, Fetcher, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, ManyRowsResult, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, Pagination, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, SingleRowResult, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TableFieldSchema, TableFieldType, TableSchema, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, executePlasmicDataOp, genTranslatableString, generateStateOnChangeProp, generateStateValueProp, dlv as get, getDataProps, hasVariant, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, set, setPlumeStrictMode, useButton, useCanvasDollarState, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, usePlasmicDataConfig, usePlasmicDataMutationOp, usePlasmicDataOp, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
package/dist/index-common.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _classNames from "classnames";
|
|
2
|
-
export
|
|
2
|
+
export { DataOp, DataSourceSchema, executePlasmicDataOp, Fetcher, ManyRowsResult, Pagination, SingleRowResult, TableFieldSchema, TableFieldType, TableSchema, usePlasmicDataConfig, usePlasmicDataMutationOp, usePlasmicDataOp, } from "@plasmicapp/data-sources";
|
|
3
3
|
export { omit, pick } from "./common";
|
|
4
4
|
export { HTMLElementRefOf, StrictProps } from "./react-utils";
|
|
5
5
|
export { createPlasmicElementProxy, deriveRenderOpts, Flex, hasVariant, makeFragment, mergeVariantsWithStates, MultiChoiceArg, SingleBooleanChoiceArg, SingleChoiceArg, wrapWithClassName, } from "./render/elements";
|
|
@@ -16,3 +16,4 @@ export { genTranslatableString, Trans } from "./render/translation";
|
|
|
16
16
|
export { useTrigger } from "./render/triggers";
|
|
17
17
|
export * from "./states/helpers";
|
|
18
18
|
export { $State, default as useDollarState, useCanvasDollarState, } from "./states/valtio";
|
|
19
|
+
export declare const classNames: typeof _classNames;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
7
|
var classNames$1 = _interopDefault(require('classnames'));
|
|
8
|
+
var dataSources = require('@plasmicapp/data-sources');
|
|
8
9
|
var _get = _interopDefault(require('dlv'));
|
|
9
10
|
var React = require('react');
|
|
10
11
|
var React__default = _interopDefault(React);
|
|
@@ -3729,6 +3730,36 @@ function useTriggeredOverlay(plasmicClass, props, config, outerRef, isDismissabl
|
|
|
3729
3730
|
};
|
|
3730
3731
|
}
|
|
3731
3732
|
|
|
3733
|
+
Object.defineProperty(exports, 'Fetcher', {
|
|
3734
|
+
enumerable: true,
|
|
3735
|
+
get: function () {
|
|
3736
|
+
return dataSources.Fetcher;
|
|
3737
|
+
}
|
|
3738
|
+
});
|
|
3739
|
+
Object.defineProperty(exports, 'executePlasmicDataOp', {
|
|
3740
|
+
enumerable: true,
|
|
3741
|
+
get: function () {
|
|
3742
|
+
return dataSources.executePlasmicDataOp;
|
|
3743
|
+
}
|
|
3744
|
+
});
|
|
3745
|
+
Object.defineProperty(exports, 'usePlasmicDataConfig', {
|
|
3746
|
+
enumerable: true,
|
|
3747
|
+
get: function () {
|
|
3748
|
+
return dataSources.usePlasmicDataConfig;
|
|
3749
|
+
}
|
|
3750
|
+
});
|
|
3751
|
+
Object.defineProperty(exports, 'usePlasmicDataMutationOp', {
|
|
3752
|
+
enumerable: true,
|
|
3753
|
+
get: function () {
|
|
3754
|
+
return dataSources.usePlasmicDataMutationOp;
|
|
3755
|
+
}
|
|
3756
|
+
});
|
|
3757
|
+
Object.defineProperty(exports, 'usePlasmicDataOp', {
|
|
3758
|
+
enumerable: true,
|
|
3759
|
+
get: function () {
|
|
3760
|
+
return dataSources.usePlasmicDataOp;
|
|
3761
|
+
}
|
|
3762
|
+
});
|
|
3732
3763
|
exports.get = _get;
|
|
3733
3764
|
Object.defineProperty(exports, 'PlasmicDataSourceContextProvider', {
|
|
3734
3765
|
enumerable: true,
|