@privyid/persona 0.18.0 → 0.19.0
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/components/avatar/utils/create-image.mjs +1 -1
- package/dist/components/breadcrumbs/Breadcrumb.vue +5 -1
- package/dist/components/breadcrumbs/Breadcrumb.vue.d.ts +1 -1
- package/dist/components/breadcrumbs/BreadcrumbItem.vue +16 -8
- package/dist/components/breadcrumbs/BreadcrumbItem.vue.d.ts +3 -0
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue +14 -6
- package/dist/components/breadcrumbs/BreadcrumbItemDropdown.vue.d.ts +3 -0
- package/dist/components/button/Button.vue +4 -11
- package/dist/components/button/Button.vue.d.ts +6 -6
- package/dist/components/collapse/Collapse.vue +13 -31
- package/dist/components/dropdown/Dropdown.vue.d.ts +3 -3
- package/dist/components/input-file/InputFile.vue.d.ts +1 -1
- package/dist/components/label/Label.vue.d.ts +1 -1
- package/dist/components/nav/Nav.vue +27 -9
- package/dist/components/nav/NavCollapse.vue +78 -0
- package/dist/components/nav/NavCollapse.vue.d.ts +26 -0
- package/dist/components/nav/NavItem.vue +11 -18
- package/dist/components/nav/NavItem.vue.d.ts +9 -2
- package/dist/components/nav/NavItemDropdown.vue.d.ts +1 -1
- package/dist/components/nav/NavSubItem.vue +35 -19
- package/dist/components/nav/NavSubItem.vue.d.ts +2 -1
- package/dist/components/select/Select.vue +17 -3
- package/dist/components/select/Select.vue.d.ts +11 -1
- package/dist/components/sidebar/SidebarNav.vue +33 -27
- package/dist/components/sidebar/SidebarNav.vue.d.ts +2 -1
- package/dist/components/sidebar-menu/SidebarMenu.vue +14 -23
- package/dist/components/sidebar-menu/SidebarMenu.vue.d.ts +2 -5
- package/dist/components/sidebar-menu/index.d.ts +20 -2
- package/dist/components/signature-draw/SignatureDraw.vue +44 -15
- package/dist/components/signature-draw/SignatureDraw.vue.d.ts +3 -0
- package/dist/components/spinner/Spinner.vue +0 -1
- package/dist/components/spinner/SpinnerRing.vue +0 -1
- package/dist/module.json +1 -1
- package/package.json +11 -9
|
@@ -92,11 +92,11 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
92
92
|
variant: StyleVariant;
|
|
93
93
|
size: SizeVariant;
|
|
94
94
|
icon: boolean;
|
|
95
|
+
divider: boolean;
|
|
95
96
|
text: string;
|
|
96
97
|
modelValue: boolean;
|
|
97
98
|
placement: Placement;
|
|
98
99
|
noCaret: boolean;
|
|
99
|
-
divider: boolean;
|
|
100
100
|
menuClass: string | Record<string, any> | unknown[];
|
|
101
101
|
menuSize: MenuSizeVariant;
|
|
102
102
|
}, {}>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li
|
|
3
|
+
ref="root"
|
|
3
4
|
data-testid="nav-subitem"
|
|
4
5
|
class="nav__subitem"
|
|
5
6
|
:class="classNames">
|
|
6
7
|
<div
|
|
7
8
|
class="nav__subitem__parent"
|
|
8
9
|
data-testid="nav-subitem-parent"
|
|
9
|
-
@click.prevent="
|
|
10
|
+
@click.prevent="toggleExpand">
|
|
10
11
|
<span
|
|
11
12
|
v-if="$slots.icon"
|
|
12
13
|
class="nav__link__icon">
|
|
@@ -19,7 +20,9 @@
|
|
|
19
20
|
v-if="collapsible"
|
|
20
21
|
class="nav__link__caret" />
|
|
21
22
|
</div>
|
|
22
|
-
<
|
|
23
|
+
<Collapse :model-value="isExpand">
|
|
24
|
+
<slot />
|
|
25
|
+
</Collapse>
|
|
23
26
|
</li>
|
|
24
27
|
</template>
|
|
25
28
|
|
|
@@ -27,12 +30,16 @@
|
|
|
27
30
|
import {
|
|
28
31
|
defineComponent,
|
|
29
32
|
computed,
|
|
30
|
-
inject
|
|
33
|
+
inject,
|
|
34
|
+
ref,
|
|
35
|
+
onMounted
|
|
31
36
|
} from "vue-demi";
|
|
32
37
|
import { SIDEBAR_SETTINGS } from "../sidebar";
|
|
33
38
|
import IconArrow from "@privyid/persona-icon/vue/chevron-down/16.vue";
|
|
39
|
+
import { templateRef } from "@vueuse/core";
|
|
40
|
+
import Collapse from "../collapse/Collapse.vue";
|
|
34
41
|
export default defineComponent({
|
|
35
|
-
components: { IconArrow },
|
|
42
|
+
components: { IconArrow, Collapse },
|
|
36
43
|
props: {
|
|
37
44
|
text: {
|
|
38
45
|
type: String,
|
|
@@ -45,22 +52,36 @@ export default defineComponent({
|
|
|
45
52
|
},
|
|
46
53
|
setup(props, { slots }) {
|
|
47
54
|
const settings = inject(SIDEBAR_SETTINGS, void 0, true);
|
|
48
|
-
const
|
|
55
|
+
const root = templateRef("root");
|
|
56
|
+
const collapsible = computed(() => props.collapsible && settings?.type !== "narrow");
|
|
57
|
+
const isExpand = ref(!props.collapsible);
|
|
49
58
|
const classNames = computed(() => {
|
|
50
59
|
const result = [];
|
|
51
60
|
if (slots.icon)
|
|
52
61
|
result.push("nav__subitem--icon");
|
|
53
|
-
if (
|
|
54
|
-
result.push("nav__subitem--collapsible
|
|
62
|
+
if (collapsible.value) {
|
|
63
|
+
result.push("nav__subitem--collapsible");
|
|
64
|
+
if (isExpand.value)
|
|
65
|
+
result.push("nav__subitem--expanded");
|
|
66
|
+
else
|
|
67
|
+
result.push("nav__subitem--collapsed");
|
|
68
|
+
}
|
|
55
69
|
return result;
|
|
56
70
|
});
|
|
57
|
-
function
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
container?.classList.toggle("nav__subitem--collapsed");
|
|
61
|
-
}
|
|
71
|
+
function toggleExpand() {
|
|
72
|
+
if (collapsible.value)
|
|
73
|
+
isExpand.value = !isExpand.value;
|
|
62
74
|
}
|
|
63
|
-
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
if (collapsible.value && root.value) {
|
|
77
|
+
isExpand.value = root.value.querySelectorAll(".router-link-active:not(.nav__link--exact),.router-link-exact-active.nav__link--exact").length > 0;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
classNames,
|
|
82
|
+
toggleExpand,
|
|
83
|
+
isExpand
|
|
84
|
+
};
|
|
64
85
|
}
|
|
65
86
|
});
|
|
66
87
|
</script>
|
|
@@ -95,13 +116,8 @@ export default defineComponent({
|
|
|
95
116
|
}
|
|
96
117
|
|
|
97
118
|
&.nav__subitem--collapsed {
|
|
98
|
-
> .sidebar__nav,
|
|
99
|
-
> .nav {
|
|
100
|
-
@apply hidden;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
119
|
.nav__link__caret {
|
|
104
|
-
@apply rotate-0
|
|
120
|
+
@apply rotate-0;
|
|
105
121
|
}
|
|
106
122
|
}
|
|
107
123
|
}
|
|
@@ -9,7 +9,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
}, {
|
|
11
11
|
classNames: import("vue-demi").ComputedRef<string[]>;
|
|
12
|
-
|
|
12
|
+
toggleExpand: () => void;
|
|
13
|
+
isExpand: import("vue-demi").Ref<boolean>;
|
|
13
14
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
14
15
|
text: {
|
|
15
16
|
type: StringConstructor;
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
:placeholder="placeholder"
|
|
16
16
|
:disabled="disabled"
|
|
17
17
|
:readonly="readonly"
|
|
18
|
+
:clearable="clearable"
|
|
19
|
+
@clear.prevent="onClear"
|
|
18
20
|
@focus="onFocus">
|
|
19
21
|
<template
|
|
20
22
|
v-if="!noCaret"
|
|
@@ -171,6 +173,10 @@ export default defineComponent({
|
|
|
171
173
|
type: Boolean,
|
|
172
174
|
default: false
|
|
173
175
|
},
|
|
176
|
+
clearable: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: false
|
|
179
|
+
},
|
|
174
180
|
size: {
|
|
175
181
|
type: String,
|
|
176
182
|
default: "md"
|
|
@@ -209,7 +215,8 @@ export default defineComponent({
|
|
|
209
215
|
const items = props.adapter.setup(context);
|
|
210
216
|
const localModel = ref(findSelected(items.value, props.modelValue));
|
|
211
217
|
const toggleOpen = () => {
|
|
212
|
-
|
|
218
|
+
if (!props.disabled && !props.readonly)
|
|
219
|
+
isOpen.value = !isOpen.value;
|
|
213
220
|
};
|
|
214
221
|
const classNames = computed(() => {
|
|
215
222
|
const result = [];
|
|
@@ -239,7 +246,7 @@ export default defineComponent({
|
|
|
239
246
|
localModel.value = item;
|
|
240
247
|
emit("change", item);
|
|
241
248
|
emit("update:selected", item);
|
|
242
|
-
emit("update:modelValue", item
|
|
249
|
+
emit("update:modelValue", item?.value);
|
|
243
250
|
if (isOpen.value)
|
|
244
251
|
emit("userInput", item);
|
|
245
252
|
}
|
|
@@ -247,8 +254,14 @@ export default defineComponent({
|
|
|
247
254
|
if (!props.disabled && !props.readonly)
|
|
248
255
|
isOpen.value = true;
|
|
249
256
|
}
|
|
257
|
+
function onClear() {
|
|
258
|
+
if (isOpen.value)
|
|
259
|
+
keyword.value = "";
|
|
260
|
+
else
|
|
261
|
+
select();
|
|
262
|
+
}
|
|
250
263
|
function isSelected(item) {
|
|
251
|
-
return isEqual(item.value, localModel.value
|
|
264
|
+
return isEqual(item.value, localModel.value?.value);
|
|
252
265
|
}
|
|
253
266
|
watch(isOpen, (value) => {
|
|
254
267
|
if (!value)
|
|
@@ -272,6 +285,7 @@ export default defineComponent({
|
|
|
272
285
|
toggleOpen,
|
|
273
286
|
select,
|
|
274
287
|
onFocus,
|
|
288
|
+
onClear,
|
|
275
289
|
isSelected
|
|
276
290
|
};
|
|
277
291
|
}
|
|
@@ -46,6 +46,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
46
46
|
type: BooleanConstructor;
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
|
+
clearable: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
49
53
|
size: {
|
|
50
54
|
type: PropType<SizeVariant>;
|
|
51
55
|
default: string;
|
|
@@ -65,8 +69,9 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
65
69
|
search: import("vue-demi").WritableComputedRef<string>;
|
|
66
70
|
items: import("vue-demi").Ref<SelectItem[]>;
|
|
67
71
|
toggleOpen: () => void;
|
|
68
|
-
select: (item
|
|
72
|
+
select: (item?: SelectItem) => void;
|
|
69
73
|
onFocus: () => void;
|
|
74
|
+
onClear: () => void;
|
|
70
75
|
isSelected: (item: SelectItem) => boolean;
|
|
71
76
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:selected" | "userInput")[], "change" | "update:modelValue" | "update:selected" | "userInput", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
72
77
|
modelValue: {
|
|
@@ -112,6 +117,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
112
117
|
type: BooleanConstructor;
|
|
113
118
|
default: boolean;
|
|
114
119
|
};
|
|
120
|
+
clearable: {
|
|
121
|
+
type: BooleanConstructor;
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
115
124
|
size: {
|
|
116
125
|
type: PropType<SizeVariant>;
|
|
117
126
|
default: string;
|
|
@@ -140,6 +149,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
140
149
|
placeholder: string;
|
|
141
150
|
noCaret: boolean;
|
|
142
151
|
selected: SelectItem;
|
|
152
|
+
clearable: boolean;
|
|
143
153
|
emptyText: string;
|
|
144
154
|
loadingText: string;
|
|
145
155
|
sectionLabel: string;
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
v-if="title"
|
|
4
4
|
class="sidebar__title"
|
|
5
5
|
data-testid="sidebar-title"
|
|
6
|
-
:class="{
|
|
6
|
+
:class="{
|
|
7
|
+
'sidebar__title__collapsible': (collapsible && type !== 'narrow'),
|
|
8
|
+
'sidebar__title--collapsed': !isExpand,
|
|
9
|
+
}"
|
|
7
10
|
v-bind="$attrs"
|
|
8
|
-
@click.prevent="
|
|
11
|
+
@click.prevent="toggleExpand">
|
|
9
12
|
<Caption
|
|
10
13
|
weight="bold"
|
|
11
14
|
transform="capitalize">
|
|
@@ -24,17 +27,22 @@
|
|
|
24
27
|
data-testid="sidebar-title-caret"
|
|
25
28
|
class="sidebar__title__caret" />
|
|
26
29
|
</div>
|
|
27
|
-
<
|
|
30
|
+
<Collapse
|
|
28
31
|
v-if="!bottom"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
:model-value="isExpand">
|
|
33
|
+
<Nav
|
|
34
|
+
ref="root"
|
|
35
|
+
class="sidebar__nav"
|
|
36
|
+
:class="{ 'sidebar__nav--collapsed' : !isExpand }"
|
|
37
|
+
data-testid="sidebar-nav"
|
|
38
|
+
vertical
|
|
39
|
+
:title="title"
|
|
40
|
+
:variant="variant"
|
|
41
|
+
:condensed="condensed"
|
|
42
|
+
:align="align">
|
|
43
|
+
<slot />
|
|
44
|
+
</Nav>
|
|
45
|
+
</Collapse>
|
|
38
46
|
<template v-else>
|
|
39
47
|
<div class="sidebar__bottom">
|
|
40
48
|
<Nav
|
|
@@ -56,19 +64,22 @@
|
|
|
56
64
|
import {
|
|
57
65
|
computed,
|
|
58
66
|
defineComponent,
|
|
59
|
-
inject
|
|
67
|
+
inject,
|
|
68
|
+
ref
|
|
60
69
|
} from "vue-demi";
|
|
61
70
|
import Nav from "../nav/Nav.vue";
|
|
62
71
|
import Caption from "../caption/Caption.vue";
|
|
63
72
|
import Text from "../text/Text.vue";
|
|
64
73
|
import { SIDEBAR_SETTINGS } from ".";
|
|
74
|
+
import Collapse from "../collapse/Collapse.vue";
|
|
65
75
|
import IconArrow from "@privyid/persona-icon/vue/chevron-down/16.vue";
|
|
66
76
|
export default defineComponent({
|
|
67
77
|
components: {
|
|
68
78
|
Nav,
|
|
69
79
|
Caption,
|
|
70
80
|
Text,
|
|
71
|
-
IconArrow
|
|
81
|
+
IconArrow,
|
|
82
|
+
Collapse
|
|
72
83
|
},
|
|
73
84
|
inheritAttrs: false,
|
|
74
85
|
props: {
|
|
@@ -102,25 +113,24 @@ export default defineComponent({
|
|
|
102
113
|
const variant = settings?.variant;
|
|
103
114
|
const align = settings?.align;
|
|
104
115
|
const type = settings?.type;
|
|
116
|
+
const isExpand = ref(true);
|
|
105
117
|
const classNames = computed(() => {
|
|
106
118
|
const result = [""];
|
|
107
119
|
if (props.bottom)
|
|
108
120
|
result.push("sidebar__nav--bottom");
|
|
109
121
|
return result;
|
|
110
122
|
});
|
|
111
|
-
function
|
|
112
|
-
if (props.collapsible
|
|
113
|
-
|
|
114
|
-
title?.classList.toggle("sidebar__title--collapsed");
|
|
115
|
-
title?.nextElementSibling?.classList.toggle("sidebar__nav--collapsed");
|
|
116
|
-
}
|
|
123
|
+
function toggleExpand() {
|
|
124
|
+
if (props.collapsible)
|
|
125
|
+
isExpand.value = !isExpand.value;
|
|
117
126
|
}
|
|
118
127
|
return {
|
|
128
|
+
isExpand,
|
|
119
129
|
variant,
|
|
120
130
|
align,
|
|
121
131
|
type,
|
|
122
132
|
classNames,
|
|
123
|
-
|
|
133
|
+
toggleExpand
|
|
124
134
|
};
|
|
125
135
|
}
|
|
126
136
|
});
|
|
@@ -140,10 +150,6 @@ export default defineComponent({
|
|
|
140
150
|
.nav__title {
|
|
141
151
|
@apply hidden;
|
|
142
152
|
}
|
|
143
|
-
|
|
144
|
-
&&--collapsed {
|
|
145
|
-
@apply hidden;
|
|
146
|
-
}
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
&&--narrow {
|
|
@@ -215,7 +221,7 @@ export default defineComponent({
|
|
|
215
221
|
@apply relative z-1 flex items-center justify-between -mb-9 px-3 mt-5;
|
|
216
222
|
|
|
217
223
|
&__collapsible {
|
|
218
|
-
@apply cursor-pointer;
|
|
224
|
+
@apply cursor-pointer select-none;
|
|
219
225
|
}
|
|
220
226
|
|
|
221
227
|
&__caret {
|
|
@@ -224,7 +230,7 @@ export default defineComponent({
|
|
|
224
230
|
|
|
225
231
|
&&--collapsed {
|
|
226
232
|
.sidebar__title__caret {
|
|
227
|
-
@apply rotate-0
|
|
233
|
+
@apply rotate-0;
|
|
228
234
|
}
|
|
229
235
|
}
|
|
230
236
|
|
|
@@ -24,11 +24,12 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
24
24
|
default: boolean;
|
|
25
25
|
};
|
|
26
26
|
}, {
|
|
27
|
+
isExpand: import("vue-demi").Ref<boolean>;
|
|
27
28
|
variant: import("../nav").StyleVariant | undefined;
|
|
28
29
|
align: import("../nav").AlignVariant | undefined;
|
|
29
30
|
type: import(".").TypeVariant | undefined;
|
|
30
31
|
classNames: import("vue-demi").ComputedRef<string[]>;
|
|
31
|
-
|
|
32
|
+
toggleExpand: () => void;
|
|
32
33
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
33
34
|
title: {
|
|
34
35
|
type: StringConstructor;
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
v-for="(submenu, x) in item.submenu"
|
|
47
47
|
:key="x"
|
|
48
48
|
:href="submenu.url"
|
|
49
|
+
:exact="submenu.exact"
|
|
49
50
|
v-bind="submenu.attrs">
|
|
50
51
|
{{ submenu.label }}
|
|
51
52
|
</NavItem>
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
v-else
|
|
56
57
|
v-bind="item.attrs"
|
|
57
58
|
:href="item.url"
|
|
59
|
+
:exact="item.exact"
|
|
58
60
|
:class="{
|
|
59
61
|
'nav__item--no-label': !item.label,
|
|
60
62
|
'nav__item--no-icon': !item.icon
|
|
@@ -73,17 +75,11 @@
|
|
|
73
75
|
{{ item.label }}
|
|
74
76
|
</NavItem>
|
|
75
77
|
</template>
|
|
76
|
-
<
|
|
78
|
+
<NavCollapse
|
|
77
79
|
v-if="menu.maxLength"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<IconLess v-if="expand" />
|
|
82
|
-
<IconMore v-else />
|
|
83
|
-
</template>
|
|
84
|
-
{{ expand ? showLessText : showMoreText }}
|
|
85
|
-
</NavItem>
|
|
86
|
-
<div v-show="expand">
|
|
80
|
+
:show-less-text="showLessText"
|
|
81
|
+
:show-more-text="showMoreText"
|
|
82
|
+
data-testid="sidebar-toggle">
|
|
87
83
|
<template
|
|
88
84
|
v-for="(item, i) in menu.items?.slice(menu.maxLength, menu.items.length)"
|
|
89
85
|
:key="i">
|
|
@@ -107,6 +103,7 @@
|
|
|
107
103
|
v-for="(submenu, x) in item.submenu"
|
|
108
104
|
:key="x"
|
|
109
105
|
:href="submenu.url"
|
|
106
|
+
:exact="submenu.exact"
|
|
110
107
|
v-bind="submenu.attrs">
|
|
111
108
|
{{ submenu.label }}
|
|
112
109
|
</NavItem>
|
|
@@ -116,6 +113,7 @@
|
|
|
116
113
|
v-else
|
|
117
114
|
v-bind="item.attrs"
|
|
118
115
|
:href="item.url"
|
|
116
|
+
:exact="item.exact"
|
|
119
117
|
:class="{
|
|
120
118
|
'nav__item--no-label': !item.label,
|
|
121
119
|
'nav__item--no-icon' : !item.icon,
|
|
@@ -134,7 +132,7 @@
|
|
|
134
132
|
{{ item.label }}
|
|
135
133
|
</NavItem>
|
|
136
134
|
</template>
|
|
137
|
-
</
|
|
135
|
+
</NavCollapse>
|
|
138
136
|
</template>
|
|
139
137
|
<!-- ENDIF -->
|
|
140
138
|
|
|
@@ -162,6 +160,7 @@
|
|
|
162
160
|
v-for="(submenu, x) in item.submenu"
|
|
163
161
|
:key="x"
|
|
164
162
|
:href="submenu.url"
|
|
163
|
+
:exact="submenu.exact"
|
|
165
164
|
v-bind="submenu.attrs">
|
|
166
165
|
{{ submenu.label }}
|
|
167
166
|
</NavItem>
|
|
@@ -171,6 +170,7 @@
|
|
|
171
170
|
v-else
|
|
172
171
|
v-bind="item.attrs"
|
|
173
172
|
:href="item.url"
|
|
173
|
+
:exact="item.exact"
|
|
174
174
|
:class="{
|
|
175
175
|
'nav__item--no-label': !item.label,
|
|
176
176
|
'nav__item--no-icon': !item.icon,
|
|
@@ -201,13 +201,13 @@
|
|
|
201
201
|
|
|
202
202
|
<script>
|
|
203
203
|
import {
|
|
204
|
-
defineComponent
|
|
205
|
-
ref
|
|
204
|
+
defineComponent
|
|
206
205
|
} from "vue-demi";
|
|
207
206
|
import Sidebar from "../sidebar/Sidebar.vue";
|
|
208
207
|
import SidebarNav from "../sidebar/SidebarNav.vue";
|
|
209
208
|
import NavItem from "../nav/NavItem.vue";
|
|
210
209
|
import NavSubItem from "../nav/NavSubItem.vue";
|
|
210
|
+
import NavCollapse from "../nav/NavCollapse.vue";
|
|
211
211
|
import IconMore from "@privyid/persona-icon/vue/chevron-down/16.vue";
|
|
212
212
|
import IconLess from "@privyid/persona-icon/vue/chevron-up/16.vue";
|
|
213
213
|
export default defineComponent({
|
|
@@ -216,6 +216,7 @@ export default defineComponent({
|
|
|
216
216
|
SidebarNav,
|
|
217
217
|
NavItem,
|
|
218
218
|
NavSubItem,
|
|
219
|
+
NavCollapse,
|
|
219
220
|
IconMore,
|
|
220
221
|
IconLess
|
|
221
222
|
},
|
|
@@ -256,16 +257,6 @@ export default defineComponent({
|
|
|
256
257
|
type: String,
|
|
257
258
|
default: "Less"
|
|
258
259
|
}
|
|
259
|
-
},
|
|
260
|
-
setup() {
|
|
261
|
-
const expand = ref(false);
|
|
262
|
-
function toggle() {
|
|
263
|
-
expand.value = !expand.value;
|
|
264
|
-
}
|
|
265
|
-
return {
|
|
266
|
-
expand,
|
|
267
|
-
toggle
|
|
268
|
-
};
|
|
269
260
|
}
|
|
270
261
|
});
|
|
271
262
|
</script>
|
|
@@ -40,10 +40,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
40
40
|
type: StringConstructor;
|
|
41
41
|
default: string;
|
|
42
42
|
};
|
|
43
|
-
}, {
|
|
44
|
-
expand: import("vue-demi").Ref<boolean>;
|
|
45
|
-
toggle: () => void;
|
|
46
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
43
|
+
}, unknown, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
47
44
|
menus: {
|
|
48
45
|
type: PropType<Menu[]>;
|
|
49
46
|
default: () => never[];
|
|
@@ -87,8 +84,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
87
84
|
align: AlignVariant;
|
|
88
85
|
toggleable: ToggleableVariant;
|
|
89
86
|
sticky: boolean;
|
|
90
|
-
menus: Menu[];
|
|
91
87
|
showMoreText: string;
|
|
92
88
|
showLessText: string;
|
|
89
|
+
menus: Menu[];
|
|
93
90
|
}, {}>;
|
|
94
91
|
export default _default;
|
|
@@ -18,7 +18,7 @@ export interface SubMenu {
|
|
|
18
18
|
/**
|
|
19
19
|
* Menu URL
|
|
20
20
|
*/
|
|
21
|
-
url
|
|
21
|
+
url?: string;
|
|
22
22
|
/**
|
|
23
23
|
* Access Role
|
|
24
24
|
*/
|
|
@@ -27,6 +27,11 @@ export interface SubMenu {
|
|
|
27
27
|
* Additional Attribute
|
|
28
28
|
*/
|
|
29
29
|
attrs?: AdditionalAttr;
|
|
30
|
+
/**
|
|
31
|
+
* Active on exact match
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
exact?: boolean;
|
|
30
35
|
}
|
|
31
36
|
export interface MenuItem {
|
|
32
37
|
/**
|
|
@@ -40,7 +45,7 @@ export interface MenuItem {
|
|
|
40
45
|
/**
|
|
41
46
|
* Menu URL
|
|
42
47
|
*/
|
|
43
|
-
url
|
|
48
|
+
url?: string;
|
|
44
49
|
/**
|
|
45
50
|
* Menu Icon
|
|
46
51
|
*/
|
|
@@ -61,6 +66,11 @@ export interface MenuItem {
|
|
|
61
66
|
* Additional attribute
|
|
62
67
|
*/
|
|
63
68
|
attrs?: AdditionalAttr;
|
|
69
|
+
/**
|
|
70
|
+
* Active on exact match
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
exact?: boolean;
|
|
64
74
|
}
|
|
65
75
|
export interface Menu {
|
|
66
76
|
/**
|
|
@@ -77,14 +87,17 @@ export interface Menu {
|
|
|
77
87
|
titleActionUrl?: string;
|
|
78
88
|
/**
|
|
79
89
|
* Enable collapse
|
|
90
|
+
* @default false
|
|
80
91
|
*/
|
|
81
92
|
collapsible?: boolean;
|
|
82
93
|
/**
|
|
83
94
|
* Set to bottom
|
|
95
|
+
* @default false
|
|
84
96
|
*/
|
|
85
97
|
bottom?: boolean;
|
|
86
98
|
/**
|
|
87
99
|
* Enable condensed mode
|
|
100
|
+
* @default false
|
|
88
101
|
*/
|
|
89
102
|
condensed?: boolean;
|
|
90
103
|
/**
|
|
@@ -107,6 +120,11 @@ export interface Menu {
|
|
|
107
120
|
* Additional Attribute
|
|
108
121
|
*/
|
|
109
122
|
attrs?: AdditionalAttr;
|
|
123
|
+
/**
|
|
124
|
+
* Active on exact match
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
exact?: boolean;
|
|
110
128
|
}
|
|
111
129
|
/**
|
|
112
130
|
* Define menus
|
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
<template v-if="ready">
|
|
3
|
+
<component
|
|
4
|
+
:is="view"
|
|
5
|
+
:model-value="modelValue"
|
|
6
|
+
:model-modifiers="modelModifiers"
|
|
7
|
+
:width="width"
|
|
8
|
+
:height="height"
|
|
9
|
+
:color="color"
|
|
10
|
+
:placeholder="placeholder"
|
|
11
|
+
:reset-label="resetLabel"
|
|
12
|
+
:open-draw-label="openDrawLabel"
|
|
13
|
+
:close-draw-label="closeDrawLabel"
|
|
14
|
+
@update:model-value="$emit('update:modelValue', $event)" />
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<div class="signature-draw">
|
|
18
|
+
<img
|
|
19
|
+
class="signature-draw__fallback"
|
|
20
|
+
:src="createSpinner(width, height)"
|
|
21
|
+
alt="signature-draw">
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
14
24
|
</template>
|
|
15
25
|
|
|
16
26
|
<script>
|
|
17
|
-
import { useMediaQuery } from "@vueuse/core";
|
|
18
27
|
import {
|
|
19
28
|
computed,
|
|
20
|
-
defineComponent
|
|
29
|
+
defineComponent,
|
|
30
|
+
onMounted,
|
|
31
|
+
ref
|
|
21
32
|
} from "vue-demi";
|
|
22
33
|
import SignatureDrawMobile from "./SignatureDrawMobile.vue";
|
|
23
34
|
import SignatureDrawDesktop from "./SignatureDrawDesktop.vue";
|
|
35
|
+
import { useMediaQuery } from "@vueuse/core";
|
|
36
|
+
import { createSpinner } from "../avatar/utils/create-image";
|
|
24
37
|
export default defineComponent({
|
|
25
38
|
props: {
|
|
26
39
|
modelValue: {
|
|
@@ -66,11 +79,27 @@ export default defineComponent({
|
|
|
66
79
|
},
|
|
67
80
|
emits: ["update:modelValue"],
|
|
68
81
|
setup() {
|
|
82
|
+
const ready = ref(false);
|
|
69
83
|
const isDesktop = useMediaQuery("(min-width: 768px)");
|
|
70
84
|
const view = computed(() => {
|
|
71
85
|
return isDesktop.value ? SignatureDrawDesktop : SignatureDrawMobile;
|
|
72
86
|
});
|
|
73
|
-
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
ready.value = true;
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
view,
|
|
92
|
+
ready,
|
|
93
|
+
createSpinner
|
|
94
|
+
};
|
|
74
95
|
}
|
|
75
96
|
});
|
|
76
97
|
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="postcss">
|
|
100
|
+
.signature-draw {
|
|
101
|
+
&__fallback {
|
|
102
|
+
@apply border rounded border-dashed;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { ModelModifier } from '../dropzone';
|
|
3
|
+
import { createSpinner } from '../avatar/utils/create-image';
|
|
3
4
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
4
5
|
modelValue: {
|
|
5
6
|
type: (StringConstructor | {
|
|
@@ -42,6 +43,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
42
43
|
};
|
|
43
44
|
}, {
|
|
44
45
|
view: import("vue-demi").ComputedRef<any>;
|
|
46
|
+
ready: import("vue-demi").Ref<boolean>;
|
|
47
|
+
createSpinner: typeof createSpinner;
|
|
45
48
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
46
49
|
modelValue: {
|
|
47
50
|
type: (StringConstructor | {
|