dce-reactkit 3.1.4 → 3.1.5
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/cjs/index.js +186 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ItemPicker/NestableItemList.d.ts +17 -0
- package/dist/cjs/types/components/ItemPicker/index.d.ts +18 -0
- package/dist/cjs/types/components/ItemPicker/types/PickableItem.d.ts +16 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.js +187 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ItemPicker/NestableItemList.d.ts +17 -0
- package/dist/esm/types/components/ItemPicker/index.d.ts +18 -0
- package/dist/esm/types/components/ItemPicker/types/PickableItem.d.ts +16 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +60 -27
- package/package.json +1 -1
- package/src/components/ItemPicker/NestableItemList.tsx +288 -0
- package/src/components/ItemPicker/index.tsx +85 -0
- package/src/components/ItemPicker/types/PickableItem.tsx +30 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An item that can be chosen (for use within ItemPicker)
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
type PickableItem = (
|
|
6
|
+
{
|
|
7
|
+
// Unique id of the item
|
|
8
|
+
id: number | string,
|
|
9
|
+
// Name of the item (human readable)
|
|
10
|
+
name: string,
|
|
11
|
+
// Link to view the item in the browser
|
|
12
|
+
link?: string,
|
|
13
|
+
}
|
|
14
|
+
& (
|
|
15
|
+
| {
|
|
16
|
+
// True if this is a group of items
|
|
17
|
+
isGroup: false,
|
|
18
|
+
// True if item is checked
|
|
19
|
+
checked: boolean,
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
// True if this is a group of items
|
|
23
|
+
isGroup: true,
|
|
24
|
+
// List of sub-items
|
|
25
|
+
children: PickableItem[],
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export default PickableItem;
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import PopSuccessMark from './components/PopSuccessMark';
|
|
|
13
13
|
import PopFailureMark from './components/PopFailureMark';
|
|
14
14
|
import PopPendingMark from './components/PopPendingMark';
|
|
15
15
|
import CopiableBox from './components/CopiableBox';
|
|
16
|
+
import ItemPicker from './components/ItemPicker';
|
|
16
17
|
|
|
17
18
|
// Import errors
|
|
18
19
|
import ErrorWithCode from './errors/ErrorWithCode';
|
|
@@ -73,6 +74,7 @@ export {
|
|
|
73
74
|
PopFailureMark,
|
|
74
75
|
PopPendingMark,
|
|
75
76
|
CopiableBox,
|
|
77
|
+
ItemPicker,
|
|
76
78
|
// Global functions
|
|
77
79
|
alert,
|
|
78
80
|
confirm,
|