@privyid/persona 0.25.2 → 0.27.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/calendar/Calendar.vue.d.ts +3 -3
- package/dist/components/camera/Camera.vue.d.ts +4 -4
- package/dist/components/card/Card.vue.d.ts +1 -1
- package/dist/components/card/CardSection.vue.d.ts +1 -1
- package/dist/components/carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/checkbox/index.mjs +4 -6
- package/dist/components/contextual-bar/ContextualBar.vue.d.ts +1 -1
- package/dist/components/cropper/Cropper.vue.d.ts +1 -1
- package/dist/components/datepicker/Datepicker.vue.d.ts +4 -4
- package/dist/components/dropdown/Dropdown.vue +4 -2
- package/dist/components/dropdown-subitem/DropdownSubitem.vue.d.ts +1 -1
- package/dist/components/dropzone/Dropzone.vue.d.ts +4 -4
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +2 -2
- package/dist/components/filterbar/pinned/PinnedMultiselect.vue.d.ts +1 -1
- package/dist/components/filterbar/pinned/PinnedSelect.vue.d.ts +1 -1
- package/dist/components/filterbar/pinned/PinnedToggle.vue.d.ts +1 -1
- package/dist/components/input/Input.vue.d.ts +2 -2
- package/dist/components/input-color/index.d.ts +1 -0
- package/dist/components/input-color/index.mjs +0 -0
- package/dist/components/input-color/inputColor.vue +257 -0
- package/dist/components/input-file/InputFile.vue.d.ts +5 -5
- package/dist/components/input-pin/InputPin.vue.d.ts +2 -2
- package/dist/components/input-range/InputRange.vue.d.ts +2 -2
- package/dist/components/list-group/ListGroup.vue.d.ts +1 -1
- package/dist/components/meta.json +7 -4
- package/dist/components/modal/Modal.vue.d.ts +1 -1
- package/dist/components/nav/Nav.vue.d.ts +1 -1
- package/dist/components/pagination/Pagination.vue.d.ts +1 -1
- package/dist/components/pdf-object/PdfObject.vue.d.ts +1 -1
- package/dist/components/pdf-text/PdfText.vue.d.ts +3 -3
- package/dist/components/popover/Popover.vue +131 -0
- package/dist/components/popover/index.d.ts +17 -0
- package/dist/components/popover/index.mjs +52 -0
- package/dist/components/progress-indicator/ProgressIndicator.vue.d.ts +1 -1
- package/dist/components/radio/Radio.vue.d.ts +1 -1
- package/dist/components/radio/index.mjs +2 -3
- package/dist/components/select/Select.vue +61 -49
- package/dist/components/shimmer/Shimmer.vue +125 -0
- package/dist/components/signature-draw/SignatureDraw.vue.d.ts +1 -1
- package/dist/components/signature-draw/SignatureDrawDesktop.vue +3 -1
- package/dist/components/signature-draw/SignatureDrawDesktop.vue.d.ts +1 -1
- package/dist/components/signature-draw/SignatureDrawMobile.vue +9 -1
- package/dist/components/signature-draw/SignatureDrawMobile.vue.d.ts +1 -1
- package/dist/components/signature-draw/utils/image.d.ts +7 -0
- package/dist/components/signature-draw/utils/{rotate-image.mjs → image.mjs} +12 -1
- package/dist/components/signature-text/SignatureText.vue.d.ts +1 -1
- package/dist/components/steps/Steps.vue.d.ts +1 -1
- package/dist/components/textarea/Textarea.vue.d.ts +2 -2
- package/dist/components/toggle/Toggle.vue.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.vue +1 -1
- package/dist/components/tooltip/TooltipContainer.vue +3 -1
- package/dist/components/utils/date.d.ts +2 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.mjs +3 -0
- package/dist/module.json +1 -1
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +10 -10
- package/dist/components/signature-draw/utils/rotate-image.d.ts +0 -6
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"PAccordionItem": "components/accordion/AccordionItem.vue",
|
|
4
4
|
"PAvatar": "components/avatar/Avatar.vue",
|
|
5
5
|
"PBadge": "components/badge/Badge.vue",
|
|
6
|
+
"PBanner": "components/banner/Banner.vue",
|
|
6
7
|
"PBreadcrumb": "components/breadcrumbs/Breadcrumb.vue",
|
|
7
8
|
"PBreadcrumbItem": "components/breadcrumbs/BreadcrumbItem.vue",
|
|
8
9
|
"PBreadcrumbItemDropdown": "components/breadcrumbs/BreadcrumbItemDropdown.vue",
|
|
9
|
-
"PBanner": "components/banner/Banner.vue",
|
|
10
10
|
"PButton": "components/button/Button.vue",
|
|
11
11
|
"PButtonGroup": "components/button-group/ButtonGroup.vue",
|
|
12
12
|
"PCalendar": "components/calendar/Calendar.vue",
|
|
@@ -25,19 +25,20 @@
|
|
|
25
25
|
"PContextualBar": "components/contextual-bar/ContextualBar.vue",
|
|
26
26
|
"PCropper": "components/cropper/Cropper.vue",
|
|
27
27
|
"PDatepicker": "components/datepicker/Datepicker.vue",
|
|
28
|
-
"PDivider": "components/divider/Divider.vue",
|
|
29
28
|
"PDialog": "components/dialog/Dialog.vue",
|
|
30
29
|
"PDialogFooter": "components/dialog/DialogFooter.vue",
|
|
30
|
+
"PDivider": "components/divider/Divider.vue",
|
|
31
31
|
"PDot": "components/dot/Dot.vue",
|
|
32
32
|
"PDropdown": "components/dropdown/Dropdown.vue",
|
|
33
33
|
"PDropdownHeader": "components/dropdown/DropdownHeader.vue",
|
|
34
34
|
"PDropdownItem": "components/dropdown/DropdownItem.vue",
|
|
35
|
-
"PDropdownSubitem": "components/dropdown-subitem/DropdownSubitem.vue",
|
|
36
35
|
"PDropzone": "components/dropzone/Dropzone.vue",
|
|
36
|
+
"PDropdownSubitem": "components/dropdown-subitem/DropdownSubitem.vue",
|
|
37
37
|
"PFilterbar": "components/filterbar/Filterbar.vue",
|
|
38
38
|
"PFormGroup": "components/form-group/FormGroup.vue",
|
|
39
39
|
"PHeading": "components/heading/Heading.vue",
|
|
40
40
|
"PInput": "components/input/Input.vue",
|
|
41
|
+
"PinputColor": "components/input-color/inputColor.vue",
|
|
41
42
|
"PInputFile": "components/input-file/InputFile.vue",
|
|
42
43
|
"PInputGroup": "components/input-group/InputGroup.vue",
|
|
43
44
|
"PInputGroupAddon": "components/input-group/InputGroupAddon.vue",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"PPdfLoading": "components/pdf-viewer/PdfLoading.vue",
|
|
75
76
|
"PPdfNavigation": "components/pdf-viewer/PdfNavigation.vue",
|
|
76
77
|
"PPdfViewer": "components/pdf-viewer/PdfViewer.vue",
|
|
78
|
+
"PPopover": "components/popover/Popover.vue",
|
|
77
79
|
"PProgress": "components/progress/Progress.vue",
|
|
78
80
|
"PProgressItem": "components/progress/ProgressItem.vue",
|
|
79
81
|
"PProgressIndicator": "components/progress-indicator/ProgressIndicator.vue",
|
|
@@ -84,19 +86,20 @@
|
|
|
84
86
|
"PSelectInput": "components/select/SelectInput.vue",
|
|
85
87
|
"PSelectTags": "components/select/SelectTags.vue",
|
|
86
88
|
"PSheet": "components/sheet/Sheet.vue",
|
|
89
|
+
"PShimmer": "components/shimmer/Shimmer.vue",
|
|
87
90
|
"PSidebar": "components/sidebar/Sidebar.vue",
|
|
88
91
|
"PSidebarBrand": "components/sidebar/SidebarBrand.vue",
|
|
89
92
|
"PSidebarContent": "components/sidebar/SidebarContent.vue",
|
|
90
93
|
"PSidebarNav": "components/sidebar/SidebarNav.vue",
|
|
91
94
|
"PSidebarMenu": "components/sidebar-menu/SidebarMenu.vue",
|
|
92
95
|
"PSidebarMenuItem": "components/sidebar-menu/SidebarMenuItem.vue",
|
|
93
|
-
"PSignatureText": "components/signature-text/SignatureText.vue",
|
|
94
96
|
"PSignatureDraw": "components/signature-draw/SignatureDraw.vue",
|
|
95
97
|
"PSignatureDrawDesktop": "components/signature-draw/SignatureDrawDesktop.vue",
|
|
96
98
|
"PSignatureDrawMobile": "components/signature-draw/SignatureDrawMobile.vue",
|
|
97
99
|
"PSpinner": "components/spinner/Spinner.vue",
|
|
98
100
|
"PSpinnerRing": "components/spinner/SpinnerRing.vue",
|
|
99
101
|
"PSpinnerRinggo": "components/spinner/SpinnerRinggo.vue",
|
|
102
|
+
"PSignatureText": "components/signature-text/SignatureText.vue",
|
|
100
103
|
"PSpread": "components/spread/Spread.vue",
|
|
101
104
|
"PStep": "components/steps/Step.vue",
|
|
102
105
|
"PStepSlider": "components/steps/StepSlider.vue",
|
|
@@ -143,10 +143,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
143
143
|
dismissable: boolean;
|
|
144
144
|
banner: boolean;
|
|
145
145
|
text: string;
|
|
146
|
-
modelValue: boolean;
|
|
147
146
|
title: string;
|
|
148
147
|
centered: boolean;
|
|
149
148
|
noCloseOnBackdrop: boolean;
|
|
149
|
+
modelValue: boolean;
|
|
150
150
|
bodyClass: string | Record<string, any> | unknown[];
|
|
151
151
|
noCloseOnEsc: boolean;
|
|
152
152
|
modalBodyScrollable: boolean;
|
|
@@ -81,8 +81,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
81
81
|
fill: boolean;
|
|
82
82
|
variant: StyleVariant;
|
|
83
83
|
title: string;
|
|
84
|
-
vertical: boolean;
|
|
85
84
|
align: AlignVariant;
|
|
85
|
+
vertical: boolean;
|
|
86
86
|
condensed: boolean;
|
|
87
87
|
justified: boolean;
|
|
88
88
|
titleActionLabel: RouteLocationRaw;
|
|
@@ -197,8 +197,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
197
197
|
default: string;
|
|
198
198
|
};
|
|
199
199
|
}>> & {
|
|
200
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
201
200
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
201
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
202
202
|
"onUpdate:perPage"?: ((...args: any[]) => any) | undefined;
|
|
203
203
|
}, {
|
|
204
204
|
variant: NavigationVariant;
|
|
@@ -116,9 +116,9 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
116
116
|
"onUpdate:height"?: ((...args: any[]) => any) | undefined;
|
|
117
117
|
}, {
|
|
118
118
|
y: number;
|
|
119
|
+
x: number;
|
|
119
120
|
width: number;
|
|
120
121
|
height: number;
|
|
121
|
-
x: number;
|
|
122
122
|
autofocus: boolean;
|
|
123
123
|
maxHeight: number;
|
|
124
124
|
maxWidth: number;
|
|
@@ -151,14 +151,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
151
151
|
size: number;
|
|
152
152
|
color: string;
|
|
153
153
|
text: string;
|
|
154
|
-
modelValue: string | File;
|
|
155
154
|
label: string;
|
|
155
|
+
modelValue: string | File;
|
|
156
156
|
modelModifiers: ModelModifier;
|
|
157
|
-
width: number;
|
|
158
|
-
height: number;
|
|
159
157
|
font: string;
|
|
160
158
|
padding: number;
|
|
161
159
|
lineHeight: number;
|
|
160
|
+
width: number;
|
|
161
|
+
height: number;
|
|
162
162
|
labelColor: string;
|
|
163
163
|
minSize: number;
|
|
164
164
|
maxSize: number;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
data-testid="popover"
|
|
5
|
+
class="popover">
|
|
6
|
+
<slot
|
|
7
|
+
name="activator"
|
|
8
|
+
:is-show="isShow"
|
|
9
|
+
:toggle="toggle"
|
|
10
|
+
:show="show"
|
|
11
|
+
:hide="hide" />
|
|
12
|
+
|
|
13
|
+
<p-tooltip
|
|
14
|
+
ref="tooltip"
|
|
15
|
+
v-model="isShow"
|
|
16
|
+
class="popover__tooltip"
|
|
17
|
+
data-testid="popover-tooltip"
|
|
18
|
+
:color="color"
|
|
19
|
+
:placement="placement"
|
|
20
|
+
:target="root"
|
|
21
|
+
@show="$emit('show')"
|
|
22
|
+
@hide="$emit('hide')">
|
|
23
|
+
<slot
|
|
24
|
+
:is-show="isShow"
|
|
25
|
+
:toggle="toggle"
|
|
26
|
+
:show="show"
|
|
27
|
+
:hide="hide" />
|
|
28
|
+
</p-tooltip>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import type { PropType, VNode } from 'vue-demi'
|
|
34
|
+
import type { Placement } from '@floating-ui/dom'
|
|
35
|
+
import type { ColorVariant } from '../tooltip'
|
|
36
|
+
import {
|
|
37
|
+
ref,
|
|
38
|
+
provide,
|
|
39
|
+
computed,
|
|
40
|
+
} from 'vue-demi'
|
|
41
|
+
import pTooltip from '../tooltip/Tooltip.vue'
|
|
42
|
+
import { useVModel } from '../input'
|
|
43
|
+
import { onClickOutside } from '@vueuse/core'
|
|
44
|
+
import { POPOVER_CONTEXT } from '.'
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
modelValue: {
|
|
48
|
+
type : Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
color: {
|
|
52
|
+
type : String as PropType<ColorVariant>,
|
|
53
|
+
default: 'white',
|
|
54
|
+
},
|
|
55
|
+
placement: {
|
|
56
|
+
type : String as PropType<Placement>,
|
|
57
|
+
default: 'top',
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
type : Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const root = ref<HTMLDivElement>()
|
|
66
|
+
const tooltip = ref<InstanceType<typeof pTooltip>>()
|
|
67
|
+
const isShow = useVModel(props)
|
|
68
|
+
|
|
69
|
+
const tooltipEl = computed<HTMLElement>(() => tooltip.value.$el)
|
|
70
|
+
|
|
71
|
+
onClickOutside(tooltipEl, () => {
|
|
72
|
+
if (isShow.value) {
|
|
73
|
+
// Add little delay too prevent race condition with v-model changing
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
hide()
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}, { ignore: [root] })
|
|
79
|
+
|
|
80
|
+
function toggle () {
|
|
81
|
+
if (!props.disabled) {
|
|
82
|
+
if (isShow.value)
|
|
83
|
+
hide()
|
|
84
|
+
else
|
|
85
|
+
show()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function show () {
|
|
90
|
+
if (!props.disabled)
|
|
91
|
+
isShow.value = true
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function hide () {
|
|
95
|
+
if (!props.disabled)
|
|
96
|
+
isShow.value = false
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
defineEmits<{
|
|
100
|
+
'show': [],
|
|
101
|
+
'hide': [],
|
|
102
|
+
'update:modelValue': [boolean],
|
|
103
|
+
}>()
|
|
104
|
+
|
|
105
|
+
defineSlots<{
|
|
106
|
+
'activator'(props: { isShow: boolean, show: () => void, hide: () => void, toggle: () => void }): VNode[],
|
|
107
|
+
'default'(props: { isShow: boolean, show: () => void, hide: () => void, toggle: () => void }): VNode[],
|
|
108
|
+
}>()
|
|
109
|
+
|
|
110
|
+
defineExpose({
|
|
111
|
+
isShow,
|
|
112
|
+
show,
|
|
113
|
+
hide,
|
|
114
|
+
toggle,
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
provide(POPOVER_CONTEXT, {
|
|
118
|
+
isShow,
|
|
119
|
+
show,
|
|
120
|
+
hide,
|
|
121
|
+
toggle,
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="postcss">
|
|
126
|
+
.popover {
|
|
127
|
+
& > &__tooltip.tooltip {
|
|
128
|
+
@apply text-base;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InjectionKey, type Ref } from 'vue-demi';
|
|
2
|
+
interface PopoverContext {
|
|
3
|
+
hide: () => void;
|
|
4
|
+
show: () => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
isShow: Ref<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare const POPOVER_CONTEXT: InjectionKey<PopoverContext>;
|
|
9
|
+
export declare function usePopoverPromise<R = any>(): {
|
|
10
|
+
start: () => Promise<R | undefined>;
|
|
11
|
+
finish: (result?: R | Error) => void;
|
|
12
|
+
bind: () => {
|
|
13
|
+
modelValue: boolean;
|
|
14
|
+
'onUpdate:modelValue'(value: boolean): void;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref
|
|
3
|
+
} from "vue-demi";
|
|
4
|
+
export const POPOVER_CONTEXT = Symbol("POPOVER_CONTEXT");
|
|
5
|
+
export function usePopoverPromise() {
|
|
6
|
+
const promise = ref();
|
|
7
|
+
const resolve = ref();
|
|
8
|
+
const reject = ref();
|
|
9
|
+
const isShow = ref(false);
|
|
10
|
+
function bind() {
|
|
11
|
+
return {
|
|
12
|
+
modelValue: isShow.value,
|
|
13
|
+
"onUpdate:modelValue"(value) {
|
|
14
|
+
if (resolve.value && !value)
|
|
15
|
+
finish();
|
|
16
|
+
isShow.value = value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function start() {
|
|
21
|
+
if (!promise.value) {
|
|
22
|
+
promise.value = new Promise((_resolve, _reject) => {
|
|
23
|
+
resolve.value = _resolve;
|
|
24
|
+
reject.value = _reject;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
let result;
|
|
28
|
+
try {
|
|
29
|
+
isShow.value = true;
|
|
30
|
+
result = await promise.value;
|
|
31
|
+
} finally {
|
|
32
|
+
promise.value = void 0;
|
|
33
|
+
resolve.value = void 0;
|
|
34
|
+
reject.value = void 0;
|
|
35
|
+
isShow.value = false;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
function finish(result) {
|
|
40
|
+
if (resolve.value && reject.value) {
|
|
41
|
+
if (result instanceof Error)
|
|
42
|
+
reject.value(result);
|
|
43
|
+
else
|
|
44
|
+
resolve.value(result);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
start,
|
|
49
|
+
finish,
|
|
50
|
+
bind
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -32,8 +32,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
32
32
|
default: number;
|
|
33
33
|
};
|
|
34
34
|
}>> & {
|
|
35
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
36
35
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
length: string | number;
|
|
39
39
|
modelValue: number;
|
|
@@ -67,8 +67,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
67
67
|
default: string;
|
|
68
68
|
};
|
|
69
69
|
}>> & {
|
|
70
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
71
70
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
72
72
|
}, {
|
|
73
73
|
value: any;
|
|
74
74
|
name: string;
|
|
@@ -2,15 +2,14 @@ import { computed, getCurrentInstance } from "vue-demi";
|
|
|
2
2
|
import { isEqual } from "../utils/value.mjs";
|
|
3
3
|
export function useVModel(props) {
|
|
4
4
|
const { emit } = getCurrentInstance();
|
|
5
|
-
const checked = props.value;
|
|
6
5
|
const model = computed({
|
|
7
6
|
get() {
|
|
8
|
-
return isEqual(props.modelValue,
|
|
7
|
+
return isEqual(props.modelValue, props.value) || props.checked;
|
|
9
8
|
},
|
|
10
9
|
set(value) {
|
|
11
10
|
emit("change", value);
|
|
12
11
|
if (value)
|
|
13
|
-
emit("update:modelValue",
|
|
12
|
+
emit("update:modelValue", props.value);
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
15
|
return model;
|
|
@@ -13,57 +13,61 @@
|
|
|
13
13
|
:no-animation="noAnimation"
|
|
14
14
|
@show="onOpened"
|
|
15
15
|
@hide="onClosed">
|
|
16
|
-
<template #activator>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
<template #activator="dropdownAttrs">
|
|
17
|
+
<slot
|
|
18
|
+
name="activator"
|
|
19
|
+
v-bind="dropdownAttrs">
|
|
20
|
+
<SelectInput
|
|
21
|
+
data-testid="select-activator"
|
|
22
|
+
class="select__activator"
|
|
23
|
+
:size="size"
|
|
24
|
+
:placeholder="placeholder"
|
|
25
|
+
:disabled="disabled"
|
|
26
|
+
:readonly="readonly"
|
|
27
|
+
:error="error"
|
|
28
|
+
@focus="onFocus">
|
|
29
|
+
<template #default>
|
|
30
|
+
<template v-if="hasValue">
|
|
31
|
+
<slot
|
|
32
|
+
name="selected"
|
|
33
|
+
:item="localModel"
|
|
34
|
+
:multiple="multiple">
|
|
35
|
+
<template v-if="props.multiple && Array.isArray(localModel)">
|
|
36
|
+
<SelectTags
|
|
37
|
+
:items="localModel"
|
|
38
|
+
:display-limit="displayLimit"
|
|
39
|
+
:limit-text="limitText" />
|
|
40
|
+
</template>
|
|
41
|
+
<template v-else>
|
|
42
|
+
{{ (localModel as SelectItem)?.text }}
|
|
43
|
+
</template>
|
|
44
|
+
</slot>
|
|
45
|
+
</template>
|
|
46
|
+
<template v-else>
|
|
47
|
+
<div data-testid="select-placeholder">
|
|
48
|
+
<slot name="placeholder">
|
|
49
|
+
<span class="input__form__placeholder">
|
|
50
|
+
{{ placeholder }}
|
|
51
|
+
</span>
|
|
52
|
+
</slot>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
</template>
|
|
56
|
+
<template
|
|
57
|
+
v-if="!noCaret"
|
|
58
|
+
#append>
|
|
28
59
|
<slot
|
|
29
|
-
name="
|
|
30
|
-
:
|
|
31
|
-
:
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:limit-text="limitText" />
|
|
37
|
-
</template>
|
|
38
|
-
<template v-else>
|
|
39
|
-
{{ (localModel as SelectItem)?.text }}
|
|
40
|
-
</template>
|
|
60
|
+
name="caret"
|
|
61
|
+
:is-open="isOpen"
|
|
62
|
+
:toggle="toggle">
|
|
63
|
+
<IconArrow
|
|
64
|
+
class="select__caret"
|
|
65
|
+
data-testid="select-caret-icon"
|
|
66
|
+
@click="toggle" />
|
|
41
67
|
</slot>
|
|
42
68
|
</template>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<slot name="placeholder">
|
|
46
|
-
<span class="input__form__placeholder">
|
|
47
|
-
{{ placeholder }}
|
|
48
|
-
</span>
|
|
49
|
-
</slot>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
</template>
|
|
53
|
-
<template
|
|
54
|
-
v-if="!noCaret"
|
|
55
|
-
#append>
|
|
56
|
-
<slot
|
|
57
|
-
name="caret"
|
|
58
|
-
:is-open="isOpen"
|
|
59
|
-
:toggle="toggleOpen">
|
|
60
|
-
<IconArrow
|
|
61
|
-
class="select__caret"
|
|
62
|
-
data-testid="select-caret-icon"
|
|
63
|
-
@click="toggleOpen" />
|
|
64
|
-
</slot>
|
|
65
|
-
</template>
|
|
66
|
-
</SelectInput>
|
|
69
|
+
</SelectInput>
|
|
70
|
+
</slot>
|
|
67
71
|
</template>
|
|
68
72
|
|
|
69
73
|
<template #prepend>
|
|
@@ -333,7 +337,7 @@ const localModel = ref<SelectItem | SelectItem[]>(
|
|
|
333
337
|
: findSelected(items.value, props.modelValue),
|
|
334
338
|
)
|
|
335
339
|
|
|
336
|
-
const
|
|
340
|
+
const toggle = () => {
|
|
337
341
|
if (!props.disabled && !props.readonly)
|
|
338
342
|
isOpen.value = !isOpen.value
|
|
339
343
|
}
|
|
@@ -447,6 +451,14 @@ onStartTyping(() => {
|
|
|
447
451
|
inputEl.value.focus()
|
|
448
452
|
}
|
|
449
453
|
})
|
|
454
|
+
|
|
455
|
+
defineExpose({
|
|
456
|
+
keyword,
|
|
457
|
+
isOpen,
|
|
458
|
+
isLoading,
|
|
459
|
+
menuEl,
|
|
460
|
+
toggle,
|
|
461
|
+
})
|
|
450
462
|
</script>
|
|
451
463
|
|
|
452
464
|
<style lang="postcss">
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
role="img"
|
|
4
|
+
class="shimmer"
|
|
5
|
+
:class="{ 'shimmer--responsive': responsive }"
|
|
6
|
+
data-testid="shimmer"
|
|
7
|
+
:width="width"
|
|
8
|
+
:height="height"
|
|
9
|
+
aria-labelledby="Loading..."
|
|
10
|
+
:viewBox="`0 0 ${width} ${height}`"
|
|
11
|
+
preserveAspectRatio="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<title id="loading-aria">Loading...</title>
|
|
14
|
+
<rect
|
|
15
|
+
x="0"
|
|
16
|
+
y="0"
|
|
17
|
+
width="100%"
|
|
18
|
+
height="100%"
|
|
19
|
+
:clip-path="`url(#clip-path-${uid})`"
|
|
20
|
+
:style="{ fill: `url('#fill-${uid}')` }" />
|
|
21
|
+
<defs>
|
|
22
|
+
<clipPath :id="`clip-path-${uid}`">
|
|
23
|
+
<slot>
|
|
24
|
+
<rect
|
|
25
|
+
x="0"
|
|
26
|
+
y="0"
|
|
27
|
+
rx="4"
|
|
28
|
+
ry="4"
|
|
29
|
+
width="100%"
|
|
30
|
+
height="100%" />
|
|
31
|
+
</slot>
|
|
32
|
+
</clipPath>
|
|
33
|
+
<linearGradient :id="`fill-${uid}`">
|
|
34
|
+
<stop
|
|
35
|
+
offset=".6"
|
|
36
|
+
class="shimmer__fg"
|
|
37
|
+
stop-opacity="1">
|
|
38
|
+
<animate
|
|
39
|
+
attributeName="offset"
|
|
40
|
+
dur="1s"
|
|
41
|
+
keyTimes="0; 0.25; 1"
|
|
42
|
+
repeatCount="indefinite"
|
|
43
|
+
values="-2; -2; 1" />
|
|
44
|
+
</stop>
|
|
45
|
+
<stop
|
|
46
|
+
offset="1.6"
|
|
47
|
+
class="shimmer__bg"
|
|
48
|
+
stop-opacity="1">
|
|
49
|
+
<animate
|
|
50
|
+
attributeName="offset"
|
|
51
|
+
dur="1s"
|
|
52
|
+
keyTimes="0; 0.25; 1"
|
|
53
|
+
repeatCount="indefinite"
|
|
54
|
+
values="-1; -1; 2" />
|
|
55
|
+
</stop>
|
|
56
|
+
<stop
|
|
57
|
+
offset="2.6"
|
|
58
|
+
class="shimmer__fg"
|
|
59
|
+
stop-opacity="1">
|
|
60
|
+
<animate
|
|
61
|
+
attributeName="offset"
|
|
62
|
+
dur="1s"
|
|
63
|
+
keyTimes="0; 0.25; 1"
|
|
64
|
+
repeatCount="indefinite"
|
|
65
|
+
values="0; 0; 3" />
|
|
66
|
+
</stop>
|
|
67
|
+
</linearGradient>
|
|
68
|
+
</defs>
|
|
69
|
+
</svg>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script lang="ts" setup>
|
|
73
|
+
import {
|
|
74
|
+
computed,
|
|
75
|
+
getCurrentInstance,
|
|
76
|
+
defineProps,
|
|
77
|
+
} from 'vue-demi'
|
|
78
|
+
|
|
79
|
+
defineProps({
|
|
80
|
+
width: {
|
|
81
|
+
type : [Number, String],
|
|
82
|
+
default: 100,
|
|
83
|
+
},
|
|
84
|
+
height: {
|
|
85
|
+
type : [Number, String],
|
|
86
|
+
default: 16,
|
|
87
|
+
},
|
|
88
|
+
responsive: {
|
|
89
|
+
type : Boolean,
|
|
90
|
+
default: false,
|
|
91
|
+
},
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const instance = getCurrentInstance()
|
|
95
|
+
const uid = computed(() => instance?.uid)
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style lang="postcss">
|
|
99
|
+
.shimmer {
|
|
100
|
+
--p-shimmer-fg: theme('backgroundColor.subtle.DEFAULT');
|
|
101
|
+
--p-shimmer-bg: theme('backgroundColor.base.DEFAULT');
|
|
102
|
+
--p-shimmer-dark-bg: theme('backgroundColor.dark.subtle.DEFAULT');
|
|
103
|
+
--p-shimmer-dark-fg: theme('backgroundColor.dark.base');
|
|
104
|
+
|
|
105
|
+
&--responsive {
|
|
106
|
+
@apply w-full h-auto;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.shimmer__fg {
|
|
111
|
+
stop-color: var(--p-shimmer-fg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.shimmer__bg {
|
|
115
|
+
stop-color: var(--p-shimmer-bg);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:is(.dark .shimmer__fg) {
|
|
119
|
+
stop-color: var(--p-shimmer-dark-fg);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:is(.dark .shimmer__bg) {
|
|
123
|
+
stop-color: var(--p-shimmer-dark-bg);
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -89,8 +89,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
89
89
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
90
90
|
}, {
|
|
91
91
|
color: string;
|
|
92
|
-
modelValue: string | File;
|
|
93
92
|
placeholder: string;
|
|
93
|
+
modelValue: string | File;
|
|
94
94
|
modelModifiers: ModelModifier;
|
|
95
95
|
width: number;
|
|
96
96
|
height: number;
|
|
@@ -103,7 +103,9 @@ export default defineComponent({
|
|
|
103
103
|
function setColor(color) {
|
|
104
104
|
if (!isBlank.value) {
|
|
105
105
|
replaceColor(canvas.value, color);
|
|
106
|
-
|
|
106
|
+
const result = toDataURL(canvas.value);
|
|
107
|
+
const value = props.modelModifiers.base64 ? result : fromBase64(result);
|
|
108
|
+
model.value = value;
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
watch(() => props.color, setColor);
|
|
@@ -73,8 +73,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
73
73
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
74
74
|
}, {
|
|
75
75
|
color: string;
|
|
76
|
-
modelValue: string | File;
|
|
77
76
|
placeholder: string;
|
|
77
|
+
modelValue: string | File;
|
|
78
78
|
modelModifiers: ModelModifier;
|
|
79
79
|
width: number;
|
|
80
80
|
height: number;
|