@privyid/persona 0.20.0 → 0.21.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/accordion/Accordion.vue +118 -0
- package/dist/components/accordion/AccordionItem.vue +184 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.mjs +10 -0
- package/dist/components/badge/Badge.vue.d.ts +1 -1
- package/dist/components/button/Button.vue +102 -65
- package/dist/components/calendar/Calendar.vue.d.ts +2 -2
- package/dist/components/calendar/adapter/adapter.mjs +1 -1
- 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/contextual-bar/ContextualBar.vue.d.ts +3 -3
- package/dist/components/datepicker/Datepicker.vue.d.ts +2 -2
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dot/Dot.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue.d.ts +3 -3
- package/dist/components/dropdown-subitem/DropdownSubitem.vue.d.ts +1 -1
- package/dist/components/dropzone/Dropzone.vue.d.ts +2 -2
- package/dist/components/filterbar/pinned/PinnedDate.vue.d.ts +2 -2
- package/dist/components/form-group/FormGroup.vue +92 -65
- package/dist/components/global/store.d.ts +27 -0
- package/dist/components/global/store.mjs +31 -0
- package/dist/components/global/utils/queue.mjs +2 -0
- package/dist/components/input/utils/accept.d.ts +19 -19
- package/dist/components/input-file/InputFile.vue.d.ts +2 -2
- package/dist/components/input-password/InputPassword.vue.d.ts +1 -3
- package/dist/components/input-range/InputRange.vue.d.ts +1 -1
- package/dist/components/label/Label.vue.d.ts +2 -2
- package/dist/components/modal/Modal.vue +1 -1
- package/dist/components/modal/Modal.vue.d.ts +3 -3
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/index.mjs +0 -0
- package/dist/components/nav/NavItemDropdown.vue.d.ts +1 -1
- package/dist/components/pdf-text/PdfText.vue +6 -2
- package/dist/components/pdf-text/PdfText.vue.d.ts +3 -2
- package/dist/components/pdf-text/utils/text-to-image.d.ts +1 -1
- package/dist/components/pdf-text/utils/text-to-image.mjs +19 -17
- package/dist/components/pdf-viewer/PdfError.vue +12 -7
- package/dist/components/pdf-viewer/PdfError.vue.d.ts +3 -11
- package/dist/components/pdf-viewer/PdfNavigation.vue +5 -13
- package/dist/components/pdf-viewer/PdfNavigation.vue.d.ts +4 -4
- package/dist/components/pdf-viewer/PdfViewer.vue +42 -5
- package/dist/components/pdf-viewer/PdfViewer.vue.d.ts +4 -1
- package/dist/components/pdf-viewer/index.d.ts +8 -0
- package/dist/components/pdf-viewer/index.mjs +6 -1
- package/dist/components/pdf-viewer/utils/pdfjs.d.ts +8 -0
- package/dist/components/pdf-viewer/utils/pdfjs.mjs +40 -0
- package/dist/components/pdf-viewer/utils/use-viewer.d.ts +0 -2
- package/dist/components/pdf-viewer/utils/use-viewer.mjs +12 -18
- package/dist/components/progressbar/Progressbar.vue.d.ts +1 -1
- package/dist/components/select/Select.vue.d.ts +1 -1
- package/dist/components/sheet/Sheet.vue +231 -0
- package/dist/components/signature-draw/utils/canvas.d.ts +1 -1
- package/dist/components/signature-draw/utils/canvas.mjs +5 -3
- package/dist/components/signature-draw/utils/smooth-line.d.ts +1 -1
- package/dist/components/signature-draw/utils/smooth-line.mjs +6 -1
- package/dist/components/signature-draw/utils/straight-line.mjs +2 -0
- package/dist/components/signature-text/SignatureText.vue +10 -7
- package/dist/components/signature-text/SignatureText.vue.d.ts +2 -1
- package/dist/components/signature-text/utils/generate-text.d.ts +1 -1
- package/dist/components/signature-text/utils/generate-text.mjs +3 -8
- package/dist/components/steps/utils/hook.mjs +1 -0
- package/dist/components/table-flex/TableFlex.vue +36 -23
- package/dist/components/table-static/TableStatic.vue +47 -30
- package/dist/components/tabs/Tab.vue.d.ts +1 -1
- package/dist/components/tour/Tour.vue.d.ts +2 -4
- package/dist/components/tour/TourDialog.vue.d.ts +1 -1
- package/dist/components/tour/core/base.mjs +11 -0
- package/dist/components/tour/core/step/conditional.mjs +1 -0
- package/dist/components/tour/core/step/visit.mjs +1 -4
- package/dist/components/tour/core/step.mjs +1 -4
- package/dist/components/tour/core/tour.mjs +4 -0
- package/dist/components/utils/base64.mjs +3 -3
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.mjs +14 -3
- package/dist/module.d.mts +17 -0
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.mjs +10 -3
- package/dist/types.d.mts +15 -0
- package/package.json +13 -13
- package/dist/components/button/Button.vue.d.ts +0 -74
- package/dist/components/form-group/FormGroup.vue.d.ts +0 -61
- package/dist/components/global/context.d.ts +0 -24
- package/dist/components/global/context.mjs +0 -18
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classNames"
|
|
4
|
+
data-testid="accordion">
|
|
5
|
+
<slot>
|
|
6
|
+
<Item
|
|
7
|
+
v-for="(item, i) in items"
|
|
8
|
+
:key="i"
|
|
9
|
+
:title="item.title"
|
|
10
|
+
:disabled="item.disabled">
|
|
11
|
+
<div class="p-4">
|
|
12
|
+
{{ item.content }}
|
|
13
|
+
</div>
|
|
14
|
+
</Item>
|
|
15
|
+
</slot>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { useVModel } from '@vueuse/core'
|
|
21
|
+
import { type AccordionItem, ACCORDION_CONTEXT } from '.'
|
|
22
|
+
import {
|
|
23
|
+
PropType, computed, provide, readonly,
|
|
24
|
+
} from 'vue-demi'
|
|
25
|
+
import Item from './AccordionItem.vue'
|
|
26
|
+
|
|
27
|
+
defineOptions({ name: 'Accordion' })
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
multiple: {
|
|
31
|
+
type : Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
flush: {
|
|
35
|
+
type : Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
pill: {
|
|
39
|
+
type : Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
modelValue: {
|
|
43
|
+
type : String,
|
|
44
|
+
default: undefined,
|
|
45
|
+
},
|
|
46
|
+
noCaret: {
|
|
47
|
+
type : Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
items: {
|
|
51
|
+
type : Array as PropType<AccordionItem[]>,
|
|
52
|
+
default: () => ([] as AccordionItem[]),
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits<{
|
|
57
|
+
'update:modelValue': [value: string],
|
|
58
|
+
}>()
|
|
59
|
+
|
|
60
|
+
const modelValue = useVModel(props, 'modelValue', emit, { passive: true })
|
|
61
|
+
|
|
62
|
+
const classNames = computed(() => {
|
|
63
|
+
const result: string[] = ['accordion']
|
|
64
|
+
|
|
65
|
+
if (props.flush)
|
|
66
|
+
result.push('accordion--flush')
|
|
67
|
+
|
|
68
|
+
if (props.pill)
|
|
69
|
+
result.push('accordion--pills')
|
|
70
|
+
|
|
71
|
+
return result
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
function setOpenItem (id: string): void {
|
|
75
|
+
modelValue.value = id
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
provide(ACCORDION_CONTEXT, {
|
|
79
|
+
openItem: readonly(modelValue),
|
|
80
|
+
multiple: props.multiple,
|
|
81
|
+
noCaret : props.noCaret,
|
|
82
|
+
setOpenItem,
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="postcss">
|
|
87
|
+
.accordion {
|
|
88
|
+
@apply flex flex-col w-full;
|
|
89
|
+
@apply border border-default rounded;
|
|
90
|
+
@apply dark:border-dark-default;
|
|
91
|
+
|
|
92
|
+
& > &__item {
|
|
93
|
+
@apply first:rounded-t last:rounded-b;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--pills {
|
|
97
|
+
@apply gap-2 border-0 rounded-none;
|
|
98
|
+
|
|
99
|
+
> .accordion__item {
|
|
100
|
+
@apply border rounded border-default;
|
|
101
|
+
@apply dark:border-dark-default;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:not(&--pills) {
|
|
106
|
+
@apply divide-y divide-default;
|
|
107
|
+
@apply dark:divide-dark-default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--flush {
|
|
111
|
+
@apply border-0 rounded-none;
|
|
112
|
+
|
|
113
|
+
> .accordion__item {
|
|
114
|
+
@apply first:rounded-none last:rounded-none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classNames"
|
|
4
|
+
data-testid="accordion-item"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:data-accordion-item-id="uid">
|
|
7
|
+
<slot
|
|
8
|
+
name="activator"
|
|
9
|
+
:toggle="toggle"
|
|
10
|
+
:expanded="model">
|
|
11
|
+
<div
|
|
12
|
+
class="accordion__item__activator"
|
|
13
|
+
data-testid="accordion-item-activator"
|
|
14
|
+
@click="toggle">
|
|
15
|
+
<Subheading>
|
|
16
|
+
{{ title }}
|
|
17
|
+
</Subheading>
|
|
18
|
+
<slot
|
|
19
|
+
v-if="!hideCaret"
|
|
20
|
+
name="caret"
|
|
21
|
+
:expanded="model">
|
|
22
|
+
<ChevronUp
|
|
23
|
+
v-if="model"
|
|
24
|
+
class="accordion__item__caret"
|
|
25
|
+
data-testid="accordion-item-caret" />
|
|
26
|
+
<ChevronDown
|
|
27
|
+
v-else
|
|
28
|
+
class="accordion__item__caret"
|
|
29
|
+
data-testid="accordion-item-caret" />
|
|
30
|
+
</slot>
|
|
31
|
+
</div>
|
|
32
|
+
</slot>
|
|
33
|
+
|
|
34
|
+
<Collapse
|
|
35
|
+
:when="model"
|
|
36
|
+
class="accordion__item__content"
|
|
37
|
+
data-testid="accordion-item-content">
|
|
38
|
+
<slot :expanded="model" />
|
|
39
|
+
</Collapse>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts" setup>
|
|
44
|
+
import { useVModel } from '@vueuse/core'
|
|
45
|
+
import { ACCORDION_CONTEXT, generateId } from '.'
|
|
46
|
+
import {
|
|
47
|
+
computed, inject, watch,
|
|
48
|
+
} from 'vue-demi'
|
|
49
|
+
|
|
50
|
+
import Subheading from '../subheading/Subheading.vue'
|
|
51
|
+
import { Collapse } from 'vue-collapsed'
|
|
52
|
+
import ChevronUp from '@privyid/persona-icon/vue/chevron-up/16.vue'
|
|
53
|
+
import ChevronDown from '@privyid/persona-icon/vue/chevron-down/16.vue'
|
|
54
|
+
|
|
55
|
+
const uid = generateId(undefined, 'accordion-item')
|
|
56
|
+
|
|
57
|
+
const parentData = inject(ACCORDION_CONTEXT)
|
|
58
|
+
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
modelValue: {
|
|
61
|
+
type : Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
type : String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
type : Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
noCaret: {
|
|
73
|
+
type : Boolean,
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
const emit = defineEmits([
|
|
78
|
+
'update:modelValue',
|
|
79
|
+
'expand',
|
|
80
|
+
'collapse',
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
const model = useVModel(props, 'modelValue', emit, { passive: true })
|
|
84
|
+
|
|
85
|
+
const hideCaret = computed(() => {
|
|
86
|
+
return props.noCaret || (parentData?.noCaret)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const classNames = computed(() => {
|
|
90
|
+
const result: string[] = ['accordion__item']
|
|
91
|
+
|
|
92
|
+
if (props.disabled)
|
|
93
|
+
result.push('accordion__item--disabled')
|
|
94
|
+
|
|
95
|
+
if (model.value)
|
|
96
|
+
result.push('expanded')
|
|
97
|
+
else
|
|
98
|
+
result.push('collapsed')
|
|
99
|
+
|
|
100
|
+
return result
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
function toggle () {
|
|
104
|
+
if (props.disabled)
|
|
105
|
+
return
|
|
106
|
+
|
|
107
|
+
model.value = !model.value
|
|
108
|
+
|
|
109
|
+
if (!model.value && !parentData?.multiple)
|
|
110
|
+
parentData?.setOpenItem('')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
watch(
|
|
114
|
+
() => parentData?.openItem.value,
|
|
115
|
+
() => {
|
|
116
|
+
model.value = parentData?.openItem.value === uid.value && !parentData?.multiple
|
|
117
|
+
},
|
|
118
|
+
)
|
|
119
|
+
watch(
|
|
120
|
+
() => model.value,
|
|
121
|
+
(value) => {
|
|
122
|
+
if (value && !parentData?.multiple) parentData?.setOpenItem(uid.value)
|
|
123
|
+
|
|
124
|
+
if (value)
|
|
125
|
+
emit('expand')
|
|
126
|
+
else
|
|
127
|
+
emit('collapse')
|
|
128
|
+
},
|
|
129
|
+
)
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style lang="postcss">
|
|
133
|
+
.accordion__item {
|
|
134
|
+
--p-accordion-bg: theme(backgroundColor.default.DEFAULT);
|
|
135
|
+
--p-accordion-bg-dark: theme(backgroundColor.dark.default.DEFAULT);
|
|
136
|
+
--p-accordion-collapsed-border: theme(borderColor.default.DEFAULT);
|
|
137
|
+
--p-accordion-collapsed-border-dark: theme(borderColor.dark.default.DEFAULT);
|
|
138
|
+
--p-accordion-expanded-border: theme(borderColor.default.DEFAULT);
|
|
139
|
+
--p-accordion-expanded-border-dark: theme(borderColor.dark.default.DEFAULT);
|
|
140
|
+
|
|
141
|
+
@apply w-full bg-[color:var(--p-accordion-bg)];
|
|
142
|
+
@apply dark:bg-[color:var(--p-accordion-bg-dark)];
|
|
143
|
+
|
|
144
|
+
&:not(.accordion &) {
|
|
145
|
+
@apply rounded border;
|
|
146
|
+
|
|
147
|
+
&.collapsed {
|
|
148
|
+
@apply border-[color:var(--p-accordion-collapsed-border)];
|
|
149
|
+
@apply dark:border-[color:var(--p-accordion-collapsed-border-dark)];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.expanded {
|
|
153
|
+
@apply border-[color:var(--p-accordion-expanded-border)];
|
|
154
|
+
@apply dark:border-[color:var(--p-accordion-expanded-border-dark)];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.accordion__item__activator {
|
|
158
|
+
@apply bg-default-alpha;
|
|
159
|
+
@apply dark:bg-dark-default-alpha;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__activator {
|
|
164
|
+
@apply flex justify-between items-center p-4 cursor-pointer;
|
|
165
|
+
|
|
166
|
+
.expanded & {
|
|
167
|
+
@apply bg-default-alpha;
|
|
168
|
+
@apply dark:bg-dark-default-alpha;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:is(&--disabled) {
|
|
173
|
+
@apply pointer-events-none;
|
|
174
|
+
|
|
175
|
+
> .accordion__item__activator {
|
|
176
|
+
@apply opacity-50;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__content {
|
|
181
|
+
@apply transition-[height] duration-300 ease-out;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComputedRef, type MaybeRefOrGetter, type InjectionKey, type Ref } from 'vue';
|
|
2
|
+
export interface AccordionItem {
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const ACCORDION_CONTEXT: InjectionKey<{
|
|
8
|
+
openItem: Readonly<Ref<string | undefined>>;
|
|
9
|
+
multiple: boolean;
|
|
10
|
+
noCaret: boolean;
|
|
11
|
+
setOpenItem: (id: string) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function defineAccordion(items: AccordionItem[]): AccordionItem[];
|
|
14
|
+
export declare const generateId: (id?: MaybeRefOrGetter<string | undefined>, suffix?: string) => ComputedRef<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toValue
|
|
4
|
+
} from "vue";
|
|
5
|
+
export const ACCORDION_CONTEXT = Symbol("accordion");
|
|
6
|
+
export function defineAccordion(items) {
|
|
7
|
+
return items;
|
|
8
|
+
}
|
|
9
|
+
const getId = (suffix = "") => `${suffix}__${Math.random().toString().slice(2, 8)}`;
|
|
10
|
+
export const generateId = (id, suffix) => computed(() => toValue(id) ?? getId(suffix));
|
|
@@ -4,77 +4,108 @@
|
|
|
4
4
|
:href="href"
|
|
5
5
|
:type="type"
|
|
6
6
|
data-testid="btn"
|
|
7
|
-
:class="classNames"
|
|
8
|
-
|
|
7
|
+
:class="classNames"
|
|
8
|
+
:disabled="loading || disabled">
|
|
9
|
+
<spinner v-if="loading" />
|
|
10
|
+
<slot v-else />
|
|
9
11
|
</component>
|
|
10
12
|
</template>
|
|
11
13
|
|
|
12
|
-
<script>
|
|
14
|
+
<script lang="ts" setup>
|
|
13
15
|
import {
|
|
14
16
|
computed,
|
|
15
|
-
|
|
16
|
-
inject
|
|
17
|
-
} from
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
icon: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
pill: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
href: {
|
|
43
|
-
type: [String, Object],
|
|
44
|
-
default: void 0
|
|
45
|
-
},
|
|
46
|
-
type: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: "button"
|
|
49
|
-
}
|
|
17
|
+
PropType,
|
|
18
|
+
inject,
|
|
19
|
+
} from 'vue-demi'
|
|
20
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
21
|
+
import {
|
|
22
|
+
ColorVariant,
|
|
23
|
+
SizeVariant,
|
|
24
|
+
StyleVariant,
|
|
25
|
+
TypeVariant,
|
|
26
|
+
} from '.'
|
|
27
|
+
import { BUTTONGROUP_SETTING } from '../button-group'
|
|
28
|
+
import { INPUTGROUP_SETTING } from '../input-group'
|
|
29
|
+
import Spinner from '../spinner/SpinnerRinggo.vue'
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
variant: {
|
|
33
|
+
type : String as PropType<StyleVariant>,
|
|
34
|
+
default: 'solid',
|
|
50
35
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
color: {
|
|
37
|
+
type : String as PropType<ColorVariant>,
|
|
38
|
+
default: 'default',
|
|
39
|
+
},
|
|
40
|
+
size: {
|
|
41
|
+
type : String as PropType<SizeVariant>,
|
|
42
|
+
default: 'md',
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type : Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
pill: {
|
|
49
|
+
type : Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
href: {
|
|
53
|
+
type : [String, Object] as PropType<string | RouteLocationRaw>,
|
|
54
|
+
default: undefined,
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
type : String as PropType<TypeVariant>,
|
|
58
|
+
default: 'button',
|
|
59
|
+
},
|
|
60
|
+
disabled: {
|
|
61
|
+
type : Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
loading: {
|
|
65
|
+
type : Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const inputSetting = inject(INPUTGROUP_SETTING, undefined, false)
|
|
71
|
+
const buttonSetting = inject(BUTTONGROUP_SETTING, undefined, false)
|
|
72
|
+
|
|
73
|
+
const classNames = computed(() => {
|
|
74
|
+
const result: string[] = ['btn']
|
|
75
|
+
|
|
76
|
+
if (props.color)
|
|
77
|
+
result.push(`btn--${props.color}`)
|
|
78
|
+
|
|
79
|
+
if (props.variant)
|
|
80
|
+
result.push(`btn--variant-${props.variant}`)
|
|
81
|
+
|
|
82
|
+
if (props.loading)
|
|
83
|
+
result.push('btn--loading')
|
|
84
|
+
|
|
85
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
86
|
+
if (inputSetting?.size.value)
|
|
87
|
+
result.push(`btn--${inputSetting?.size.value}`)
|
|
88
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
89
|
+
else if (buttonSetting?.size.value)
|
|
90
|
+
result.push(`btn--${buttonSetting?.size.value}`)
|
|
91
|
+
// eslint-disable-next-line unicorn/explicit-length-check
|
|
92
|
+
else if (props.size)
|
|
93
|
+
result.push(`btn--${props.size}`)
|
|
94
|
+
|
|
95
|
+
if (props.icon)
|
|
96
|
+
result.push('btn--icon')
|
|
97
|
+
|
|
98
|
+
if (props.pill)
|
|
99
|
+
result.push('btn--pill')
|
|
100
|
+
|
|
101
|
+
return result
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
const tagName = computed(() => {
|
|
105
|
+
return props.href
|
|
106
|
+
? 'nuxt-link'
|
|
107
|
+
: 'button'
|
|
108
|
+
})
|
|
78
109
|
</script>
|
|
79
110
|
|
|
80
111
|
<style lang="postcss">
|
|
@@ -320,5 +351,11 @@ export default defineComponent({
|
|
|
320
351
|
&&--pill {
|
|
321
352
|
@apply rounded-full;
|
|
322
353
|
}
|
|
354
|
+
|
|
355
|
+
&--loading {
|
|
356
|
+
.spinner {
|
|
357
|
+
@apply h-6;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
323
360
|
}
|
|
324
361
|
</style>
|
|
@@ -179,14 +179,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
179
179
|
"onUpdate:start"?: ((...args: any[]) => any) | undefined;
|
|
180
180
|
"onUpdate:end"?: ((...args: any[]) => any) | undefined;
|
|
181
181
|
}, {
|
|
182
|
+
modelValue: Date | [Date, Date];
|
|
182
183
|
start: Date;
|
|
184
|
+
mode: "date" | "month" | "year";
|
|
183
185
|
end: Date;
|
|
184
186
|
min: Date;
|
|
185
187
|
max: Date;
|
|
186
|
-
modelValue: Date | [Date, Date];
|
|
187
188
|
disabled: boolean;
|
|
188
189
|
readonly: boolean;
|
|
189
|
-
mode: "date" | "month" | "year";
|
|
190
190
|
range: boolean;
|
|
191
191
|
minRange: string;
|
|
192
192
|
maxRange: string;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "date-fns";
|
|
4
4
|
import id from "date-fns/locale/id/index";
|
|
5
5
|
import en from "date-fns/locale/en-US/index";
|
|
6
|
-
import { getLang } from "../../global/
|
|
6
|
+
import { getLang } from "../../global/store.mjs";
|
|
7
7
|
import { chunk } from "lodash-es";
|
|
8
8
|
const localePacks = { en, id };
|
|
9
9
|
export const CalendarFormat = [
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
49
49
|
toast: (text: string) => void;
|
|
50
50
|
deviceId: ComputedRef<string | undefined>;
|
|
51
51
|
constraints: ComputedRef<MediaStreamConstraints>;
|
|
52
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "
|
|
52
|
+
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("change" | "update:modelValue" | "result" | "start")[], "change" | "update:modelValue" | "result" | "start", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
53
53
|
modelValue: {
|
|
54
54
|
type: PropType<string | string[] | File | File[]>;
|
|
55
55
|
default: string;
|
|
@@ -81,13 +81,13 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
81
81
|
}>> & {
|
|
82
82
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
83
83
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
84
|
-
onStart?: ((...args: any[]) => any) | undefined;
|
|
85
84
|
onResult?: ((...args: any[]) => any) | undefined;
|
|
85
|
+
onStart?: ((...args: any[]) => any) | undefined;
|
|
86
86
|
}, {
|
|
87
|
-
|
|
87
|
+
facingMode: ConstrainDOMString;
|
|
88
88
|
mask: MaskVariant;
|
|
89
89
|
mirror: boolean | "preview" | "all";
|
|
90
|
-
|
|
90
|
+
modelValue: string | string[] | File | File[];
|
|
91
91
|
modelModifiers: ModelModifier;
|
|
92
92
|
adapter: Adapter;
|
|
93
93
|
silent: boolean;
|
|
@@ -67,8 +67,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
67
67
|
onDismissed?: ((...args: any[]) => any) | undefined;
|
|
68
68
|
}, {
|
|
69
69
|
dismissable: boolean;
|
|
70
|
-
disabled: boolean;
|
|
71
70
|
title: string;
|
|
71
|
+
disabled: boolean;
|
|
72
72
|
element: ElementVariant;
|
|
73
73
|
sectioned: boolean;
|
|
74
74
|
callout: boolean;
|
|
@@ -36,7 +36,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
36
36
|
close: (event: Event) => void;
|
|
37
37
|
onEnter: (target: HTMLDivElement) => void;
|
|
38
38
|
onLeave: (target: HTMLDivElement) => void;
|
|
39
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("
|
|
39
|
+
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("close" | "show" | "update:modelValue" | "hide")[], "close" | "show" | "update:modelValue" | "hide", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
40
40
|
variant: {
|
|
41
41
|
type: PropType<StyleVariant>;
|
|
42
42
|
default: string;
|
|
@@ -67,14 +67,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
67
67
|
};
|
|
68
68
|
}>> & {
|
|
69
69
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
70
|
-
onShow?: ((...args: any[]) => any) | undefined;
|
|
71
70
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
72
72
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
73
73
|
}, {
|
|
74
74
|
variant: StyleVariant;
|
|
75
75
|
dismissable: boolean;
|
|
76
|
-
modelValue: boolean;
|
|
77
76
|
title: string;
|
|
77
|
+
modelValue: boolean;
|
|
78
78
|
message: string;
|
|
79
79
|
align: AlignVariant;
|
|
80
80
|
backgroundUrl: string;
|
|
@@ -137,14 +137,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
137
137
|
}, {
|
|
138
138
|
error: boolean;
|
|
139
139
|
size: SizeVariant;
|
|
140
|
+
modelValue: Date | [Date, Date];
|
|
140
141
|
start: Date;
|
|
142
|
+
mode: "date" | "month" | "year";
|
|
141
143
|
end: Date;
|
|
142
144
|
min: Date;
|
|
143
145
|
max: Date;
|
|
144
|
-
modelValue: Date | [Date, Date];
|
|
145
146
|
disabled: boolean;
|
|
146
147
|
readonly: boolean;
|
|
147
|
-
mode: "date" | "month" | "year";
|
|
148
148
|
range: boolean;
|
|
149
149
|
minRange: string;
|
|
150
150
|
maxRange: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FooterAlignVariant, FooterButtonColorVariant, FooterButtonStyleVariant } from './DialogFooter.vue';
|
|
2
|
-
import type { SizeVariant } from '../modal
|
|
2
|
+
import type { SizeVariant } from '../modal';
|
|
3
3
|
interface DialogButton {
|
|
4
4
|
text?: string;
|
|
5
5
|
visible?: boolean;
|
|
@@ -129,13 +129,13 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
129
129
|
onShow?: ((...args: any[]) => any) | undefined;
|
|
130
130
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
131
131
|
}, {
|
|
132
|
+
color: ColorVariant;
|
|
132
133
|
variant: StyleVariant;
|
|
133
|
-
icon: boolean;
|
|
134
134
|
size: SizeVariant;
|
|
135
|
+
icon: boolean;
|
|
136
|
+
pill: boolean;
|
|
135
137
|
divider: boolean;
|
|
136
138
|
text: string;
|
|
137
|
-
pill: boolean;
|
|
138
|
-
color: ColorVariant;
|
|
139
139
|
modelValue: boolean;
|
|
140
140
|
disabled: boolean;
|
|
141
141
|
placement: Placement;
|