@veritree/ui 0.19.2-2 → 0.19.2-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/mixins/floating-ui-content.js +102 -0
- package/mixins/floating-ui-item.js +219 -0
- package/mixins/floating-ui.js +74 -0
- package/mixins/form-control-icon.js +53 -0
- package/mixins/form-control.js +73 -0
- package/package.json +7 -3
- package/src/components/Avatar/VTAvatar.vue +32 -29
- package/src/components/Button/VTButton.vue +9 -5
- package/src/components/Dialog/VTDialog.vue +6 -11
- package/src/components/Dialog/VTDialogClose.vue +9 -9
- package/src/components/Dialog/VTDialogContent.vue +9 -9
- package/src/components/Dialog/VTDialogFooter.vue +5 -5
- package/src/components/Dialog/VTDialogHeader.vue +8 -8
- package/src/components/Dialog/VTDialogMain.vue +8 -8
- package/src/components/Dialog/VTDialogOverlay.vue +8 -8
- package/src/components/Dialog/VTDialogTitle.vue +4 -4
- package/src/components/Disclosure/VTDisclosureContent.vue +1 -1
- package/src/components/Disclosure/VTDisclosureDetails.vue +2 -2
- package/src/components/Disclosure/VTDisclosureHeader.vue +1 -1
- package/src/components/Disclosure/VTDisclosureIcon.vue +1 -1
- package/src/components/Drawer/VTDrawer.vue +14 -16
- package/src/components/Drawer/VTDrawerClose.vue +9 -9
- package/src/components/Drawer/VTDrawerContent.vue +8 -8
- package/src/components/Drawer/VTDrawerFooter.vue +3 -3
- package/src/components/Drawer/VTDrawerHeader.vue +4 -4
- package/src/components/Drawer/VTDrawerMain.vue +5 -5
- package/src/components/Drawer/VTDrawerOverlay.vue +6 -6
- package/src/components/Drawer/VTDrawerTitle.vue +5 -5
- package/src/components/DropdownMenu/VTDropdownMenu.vue +27 -29
- package/src/components/DropdownMenu/VTDropdownMenuContent.vue +27 -70
- package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +8 -5
- package/src/components/DropdownMenu/VTDropdownMenuItem.vue +14 -123
- package/src/components/DropdownMenu/VTDropdownMenuLabel.vue +3 -3
- package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +96 -121
- package/src/components/Form/VTFormFeedback.vue +33 -22
- package/src/components/Form/VTFormGroup.vue +5 -7
- package/src/components/Form/VTFormLabel.vue +22 -0
- package/src/components/Form/VTFormRow.vue +5 -0
- package/src/components/Form/VTInput.vue +40 -0
- package/src/components/Form/VTInputIcon.vue +35 -0
- package/src/components/Form/VTInputPassword.vue +55 -0
- package/src/components/Form/VTTextarea.vue +22 -0
- package/src/components/Listbox/VTListbox.vue +26 -45
- package/src/components/Listbox/VTListboxContent.vue +24 -116
- package/src/components/Listbox/VTListboxItem.vue +10 -182
- package/src/components/Listbox/VTListboxLabel.vue +0 -10
- package/src/components/Listbox/VTListboxList.vue +24 -33
- package/src/components/Listbox/VTListboxSearch.vue +30 -29
- package/src/components/Listbox/VTListboxTrigger.vue +71 -88
- package/src/components/Popover/VTPopover.vue +24 -30
- package/src/components/Popover/VTPopoverContent.vue +24 -59
- package/src/components/Popover/VTPopoverDivider.vue +4 -11
- package/src/components/Popover/VTPopoverItem.vue +21 -14
- package/src/components/Popover/VTPopoverTrigger.vue +126 -21
- package/src/components/Tabs/VTTab.vue +10 -11
- package/src/components/Tabs/VTTabGroup.vue +9 -7
- package/src/components/Tabs/VTTabPanel.vue +4 -5
- package/src/components/Transitions/FadeInOut.vue +2 -2
- package/src/components/Utils/FloatingUi.vue +58 -0
- package/package-lock.json +0 -13
- package/src/components/Modal/VTModal.vue +0 -69
- package/src/utils/genId.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div @keydown.esc.prevent="
|
|
2
|
+
<div :id="id" @keydown.esc.prevent="onKeyEsc">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -8,43 +8,148 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
name: 'VTPopoverTrigger',
|
|
10
10
|
|
|
11
|
-
inject: ['
|
|
11
|
+
inject: ['apiPopover'],
|
|
12
|
+
|
|
13
|
+
data() {
|
|
14
|
+
return {
|
|
15
|
+
expanded: false,
|
|
16
|
+
hasPopup: false,
|
|
17
|
+
controls: null,
|
|
18
|
+
trigger: null,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
12
21
|
|
|
13
22
|
computed: {
|
|
14
|
-
|
|
15
|
-
return this.
|
|
23
|
+
id() {
|
|
24
|
+
return `popover-trigger-${this.apiPopover().id}`;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
componentContent() {
|
|
28
|
+
return this.apiPopover().componentContent;
|
|
16
29
|
},
|
|
17
30
|
},
|
|
18
31
|
|
|
19
32
|
mounted() {
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
const trigger = {
|
|
34
|
+
id: this.id,
|
|
35
|
+
el: this.$el,
|
|
36
|
+
cancel: this.cancel,
|
|
37
|
+
focus: this.focus,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.apiPopover().registerTrigger(trigger);
|
|
41
|
+
|
|
42
|
+
this.setTrigger();
|
|
43
|
+
this.addTriggerEvents();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
destroyed() {
|
|
47
|
+
this.trigger.removeEventListener('click', this.onClick);
|
|
22
48
|
},
|
|
23
49
|
|
|
24
50
|
methods: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
51
|
+
setTrigger() {
|
|
52
|
+
this.trigger = this.$el.querySelector(':first-child');
|
|
53
|
+
},
|
|
28
54
|
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Add event listener to slot element
|
|
57
|
+
*
|
|
58
|
+
* The click event has to be added to the slot child element
|
|
59
|
+
* since we are not setting the onclick on the component
|
|
60
|
+
* itself.
|
|
61
|
+
*
|
|
62
|
+
* Slot must have only one child element. It avoids
|
|
63
|
+
* errors related to adding the event listener.
|
|
64
|
+
*/
|
|
65
|
+
addTriggerEvents() {
|
|
66
|
+
this.trigger.addEventListener('click', (e) => {
|
|
67
|
+
this.onClick(e);
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
init(e) {
|
|
72
|
+
if (!this.componentContent) {
|
|
31
73
|
return;
|
|
32
74
|
}
|
|
33
75
|
|
|
34
|
-
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
}
|
|
76
|
+
if (this.expanded) {
|
|
77
|
+
this.cancel();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.expanded = true;
|
|
82
|
+
|
|
83
|
+
// delay stop propagation to close other visible
|
|
84
|
+
// dropdowns and delay click event to control
|
|
85
|
+
// this dropdown visibility
|
|
86
|
+
setTimeout(() => e.stopImmediatePropagation(), 50);
|
|
87
|
+
setTimeout(() => this.showComponentContent(), 100);
|
|
38
88
|
},
|
|
39
89
|
|
|
40
|
-
|
|
41
|
-
if (this.
|
|
42
|
-
|
|
90
|
+
cancel() {
|
|
91
|
+
if (!this.componentContent) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
this.expanded = false;
|
|
96
|
+
|
|
97
|
+
this.hideComponentContent();
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
focus() {
|
|
101
|
+
if (this.trigger) this.trigger.focus();
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
showComponentContent() {
|
|
105
|
+
this.componentContent.show();
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
hideComponentContent() {
|
|
109
|
+
this.componentContent.hide();
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
toggleAriaHasPopup() {
|
|
113
|
+
if (this.expanded) {
|
|
114
|
+
this.hasPopup = this.componentContent !== null;
|
|
115
|
+
this.controls = this.hasPopup ? this.componentContent.id : null;
|
|
116
|
+
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
this.hasPopup = null;
|
|
121
|
+
this.controls = null;
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
onClick(e) {
|
|
125
|
+
this.init(e);
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
onKeyDownOrUp(e) {
|
|
129
|
+
if (!this.expanded) {
|
|
130
|
+
this.$el.click(e);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const keyCode = e.code;
|
|
134
|
+
const listItemPosition =
|
|
135
|
+
keyCode === 'ArrowDown'
|
|
136
|
+
? 'firstMenuItem'
|
|
137
|
+
: keyCode === 'ArrowUp'
|
|
138
|
+
? 'lastMenuItem'
|
|
139
|
+
: null;
|
|
140
|
+
|
|
141
|
+
// settimeout here is delaying the focusing the element
|
|
142
|
+
// since it is not rendered yet. All items will only
|
|
143
|
+
// be available when the content is fully visible.
|
|
144
|
+
this.$nextTick(() => {
|
|
145
|
+
setTimeout(() => this[listItemPosition].focus(), 100);
|
|
146
|
+
});
|
|
43
147
|
},
|
|
44
148
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.
|
|
149
|
+
// change it to a better name or move the methods inside to another function
|
|
150
|
+
onKeyEsc() {
|
|
151
|
+
this.cancel();
|
|
152
|
+
this.focus();
|
|
48
153
|
},
|
|
49
154
|
},
|
|
50
155
|
};
|
|
@@ -32,7 +32,7 @@ import { keys } from '../../utils/keyboard';
|
|
|
32
32
|
export default {
|
|
33
33
|
name: 'VTTabItem',
|
|
34
34
|
|
|
35
|
-
inject: ['
|
|
35
|
+
inject: ['apiTabs'],
|
|
36
36
|
|
|
37
37
|
props: {
|
|
38
38
|
headless: {
|
|
@@ -43,7 +43,6 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
data() {
|
|
45
45
|
return {
|
|
46
|
-
api: this.api(),
|
|
47
46
|
index: null,
|
|
48
47
|
indexFocus: null,
|
|
49
48
|
selected: false,
|
|
@@ -57,11 +56,11 @@ export default {
|
|
|
57
56
|
},
|
|
58
57
|
|
|
59
58
|
mounted() {
|
|
60
|
-
this.
|
|
59
|
+
this.apiTabs().registerTab(this);
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
this.
|
|
62
|
+
beforeUnmount() {
|
|
63
|
+
this.apiTabs().unregisterTab(this.index);
|
|
65
64
|
},
|
|
66
65
|
|
|
67
66
|
methods: {
|
|
@@ -78,11 +77,11 @@ export default {
|
|
|
78
77
|
},
|
|
79
78
|
|
|
80
79
|
focusFirstTab() {
|
|
81
|
-
this.
|
|
80
|
+
this.apiTabs().focusTab(0);
|
|
82
81
|
},
|
|
83
82
|
|
|
84
83
|
focusLastTab(lastTabIndex) {
|
|
85
|
-
this.
|
|
84
|
+
this.apiTabs().focusTab(lastTabIndex);
|
|
86
85
|
},
|
|
87
86
|
|
|
88
87
|
focusPreviousTab(lastTabIndex) {
|
|
@@ -91,7 +90,7 @@ export default {
|
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
this.
|
|
93
|
+
this.apiTabs().focusTab(this.indexFocus - 1);
|
|
95
94
|
},
|
|
96
95
|
|
|
97
96
|
focusNextTab(lastTabIndex) {
|
|
@@ -100,17 +99,17 @@ export default {
|
|
|
100
99
|
return;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
this.
|
|
102
|
+
this.apiTabs().focusTab(this.indexFocus + 1);
|
|
104
103
|
},
|
|
105
104
|
|
|
106
105
|
onClick() {
|
|
107
|
-
this.
|
|
106
|
+
this.apiTabs().selectTab(this.index);
|
|
108
107
|
this.$emit('change');
|
|
109
108
|
},
|
|
110
109
|
|
|
111
110
|
onKeyDown(event) {
|
|
112
111
|
const key = event.key;
|
|
113
|
-
const lastTabIndex = this.
|
|
112
|
+
const lastTabIndex = this.apiTabs().getTabsLength() - 1;
|
|
114
113
|
|
|
115
114
|
if (this.indexFocus === null) {
|
|
116
115
|
this.indexFocus = this.index;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style scoped>
|
|
8
|
-
.TabGroup.vertical{
|
|
8
|
+
.TabGroup.vertical {
|
|
9
9
|
display: flex;
|
|
10
10
|
}
|
|
11
|
-
.TabGroup.vertical .TabList{
|
|
11
|
+
.TabGroup.vertical .TabList {
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
}
|
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
<script>
|
|
18
18
|
export default {
|
|
19
19
|
name: 'VTTabGroup',
|
|
20
|
+
|
|
20
21
|
props: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
vertical: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
25
26
|
},
|
|
27
|
+
|
|
26
28
|
provide() {
|
|
27
29
|
return {
|
|
28
|
-
|
|
30
|
+
apiTabs: () => {
|
|
29
31
|
const registerTab = (tab) => {
|
|
30
32
|
_register(this.tabs, tab);
|
|
31
33
|
if (tab.index === 0) tab.select();
|
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
export default {
|
|
15
15
|
name: 'VTTabPanel',
|
|
16
16
|
|
|
17
|
-
inject: ['
|
|
17
|
+
inject: ['apiTabs'],
|
|
18
18
|
|
|
19
19
|
data() {
|
|
20
20
|
return {
|
|
21
|
-
api: this.api(),
|
|
22
21
|
index: null,
|
|
23
22
|
visible: false,
|
|
24
23
|
};
|
|
@@ -31,11 +30,11 @@ export default {
|
|
|
31
30
|
},
|
|
32
31
|
|
|
33
32
|
mounted() {
|
|
34
|
-
this.
|
|
33
|
+
this.apiTabs().registerTabPanel(this);
|
|
35
34
|
},
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
this.
|
|
36
|
+
beforeUnmount() {
|
|
37
|
+
this.apiTabs().unregisterTabPanel(this.id);
|
|
39
38
|
},
|
|
40
39
|
|
|
41
40
|
methods: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition
|
|
3
3
|
enter-active-class="duration-300 ease-out"
|
|
4
|
-
enter-class="transform opacity-0"
|
|
4
|
+
enter-from-class="transform opacity-0"
|
|
5
5
|
enter-to-class="opacity-100"
|
|
6
6
|
leave-active-class="duration-300 ease-in"
|
|
7
|
-
leave-class="opacity-100"
|
|
7
|
+
leave-from-class="opacity-100"
|
|
8
8
|
leave-to-class="transform opacity-0"
|
|
9
9
|
@after-enter="afterEnter"
|
|
10
10
|
@after-leave="afterLeave"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport to="body">
|
|
3
|
+
<transition
|
|
4
|
+
enter-active-class="duration-200 ease-out"
|
|
5
|
+
enter-from-class="translate-y-[15px] opacity-0"
|
|
6
|
+
enter-to-class="translate-y-0 opacity-100"
|
|
7
|
+
leave-active-class="duration-200 ease-in"
|
|
8
|
+
leave-from-class="translate-y-0 opacity-100"
|
|
9
|
+
leave-to-class="translate-y-[15px] opacity-0"
|
|
10
|
+
@after-leave="hide"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
v-if="visible"
|
|
14
|
+
:id="id"
|
|
15
|
+
:class="[
|
|
16
|
+
headless
|
|
17
|
+
? null
|
|
18
|
+
: 'shadow-300 absolute z-50 grid overflow-x-hidden rounded-md border-gray-100 bg-white py-2 px-3',
|
|
19
|
+
floatingUiClass ? floatingUiClass : null,
|
|
20
|
+
]"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</transition>
|
|
26
|
+
</Teleport>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
inheritAttrs: false,
|
|
32
|
+
|
|
33
|
+
props: {
|
|
34
|
+
headless: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
id: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
default: null,
|
|
41
|
+
},
|
|
42
|
+
visible: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
floatingUiClass: {
|
|
47
|
+
type: [String, Function],
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
methods: {
|
|
53
|
+
hide() {
|
|
54
|
+
this.$emit('hide');
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
</script>
|
package/package-lock.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@veritree/ui",
|
|
3
|
-
"version": "0.1.9",
|
|
4
|
-
"lockfileVersion": 1,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@veritree/icons": {
|
|
8
|
-
"version": "0.12.0",
|
|
9
|
-
"resolved": "https://registry.npmjs.org/@veritree/icons/-/icons-0.12.0.tgz",
|
|
10
|
-
"integrity": "sha512-vunUKzvS9neslSf3R3y6RYQrcfRpxmp8PnhWWe2peYiyElLIJcb7zAsfCZ+I0Fg5PQ6GZG6StqWy0WF7MJ7VOg=="
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition
|
|
3
|
-
enter-active-class="duration-300 ease-out"
|
|
4
|
-
enter-class="transform opacity-0"
|
|
5
|
-
enter-to-class="opacity-100"
|
|
6
|
-
leave-active-class="duration-300 ease-in"
|
|
7
|
-
leave-class="opacity-100"
|
|
8
|
-
leave-to-class="transform opacity-0"
|
|
9
|
-
@after-enter="afterEnter"
|
|
10
|
-
@after-leave="afterLeave"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
v-if="visible"
|
|
14
|
-
class="fixed inset-0 z-50 flex flex-col justify-center bg-fd-700/75"
|
|
15
|
-
tabindex="-1"
|
|
16
|
-
@keyup.esc="close"
|
|
17
|
-
@click="close"
|
|
18
|
-
>
|
|
19
|
-
<div
|
|
20
|
-
class="relative mx-auto flex max-w-lg flex-col justify-center rounded bg-white"
|
|
21
|
-
@click.stop
|
|
22
|
-
>
|
|
23
|
-
<div class="absolute right-4 top-4">
|
|
24
|
-
<VTButton variant="icon" @click.prevent="close"
|
|
25
|
-
><IconClose class="h-4 w-4"
|
|
26
|
-
/></VTButton>
|
|
27
|
-
</div>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</transition>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { IconClose } from '@veritree/icons';
|
|
36
|
-
import VTButton from '../Button/VTButton.vue';
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'VTModal',
|
|
40
|
-
|
|
41
|
-
components: { IconClose, VTButton },
|
|
42
|
-
|
|
43
|
-
model: {
|
|
44
|
-
prop: 'visible',
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
props: {
|
|
48
|
-
visible: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
methods: {
|
|
55
|
-
close() {
|
|
56
|
-
this.$emit('input', false);
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
afterEnter() {
|
|
60
|
-
this.$emit('shown');
|
|
61
|
-
this.$nextTick(() => this.$el.focus());
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
afterLeave() {
|
|
65
|
-
this.$emit('hidden');
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
</script>
|
package/src/utils/genId.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Generate id
|
|
2
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
|
|
3
|
-
let gen = null;
|
|
4
|
-
|
|
5
|
-
function* idMaker() {
|
|
6
|
-
let index = 0;
|
|
7
|
-
while (true) yield index++;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const genId = () => {
|
|
11
|
-
if (!gen) gen = idMaker();
|
|
12
|
-
return gen.next().value;
|
|
13
|
-
};
|