@vc-shell/framework 1.1.5 → 1.1.7
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/CHANGELOG.md +14 -0
- package/core/plugins/modularity/loader.ts +31 -0
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/framework.js +105 -104
- package/dist/{index-Bv5as3SI.js → index-B-mWhdLd.js} +1 -1
- package/dist/{index-DpDbQQg6.js → index-B8b4HKad.js} +1 -1
- package/dist/{index-JTAZpxKF.js → index-BgxGeHeF.js} +1 -1
- package/dist/{index-Dh1XjfgY.js → index-BkhpB2QG.js} +1 -1
- package/dist/{index-BG6N4UCY.js → index-C1SZpIDW.js} +1 -1
- package/dist/{index-DwuQbDJG.js → index-C5CvjxDz.js} +1 -1
- package/dist/{index-BBHl6nap.js → index-C70yQsjv.js} +1 -1
- package/dist/{index-CKLiFGZ-.js → index-CDBWP4up.js} +1 -1
- package/dist/{index-DbpKygJh.js → index-CiGiEqGG.js} +1 -1
- package/dist/{index-DgCtSr4P.js → index-CupHW_BC.js} +1 -1
- package/dist/{index-Fhuqbkq2.js → index-CyoDOgBt.js} +1 -1
- package/dist/{index-Q3k1PYzc.js → index-Dfqkcdc_.js} +1 -1
- package/dist/{index-CtGZgIiV.js → index-DqYA_pFb.js} +1 -1
- package/dist/{index-D13Jcezf.js → index-EX-KKv5q.js} +1 -1
- package/dist/{index-C4VyqVxv.js → index-F1Iiqswe.js} +1 -1
- package/dist/{index-MKD2CP5c.js → index-L61Jab0v.js} +8653 -8565
- package/dist/{index-CTmAMa_1.js → index-hQL5vI4T.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/shared/components/common/popup/vc-popup-error.vue.d.ts +2 -2
- package/dist/shared/components/common/popup/vc-popup-error.vue.d.ts.map +1 -1
- package/dist/shared/components/common/popup/vc-popup-info.vue.d.ts +2 -2
- package/dist/shared/components/common/popup/vc-popup-info.vue.d.ts.map +1 -1
- package/dist/shared/components/common/popup/vc-popup-warning.vue.d.ts +2 -2
- package/dist/shared/components/common/popup/vc-popup-warning.vue.d.ts.map +1 -1
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts +3 -3
- package/dist/shared/components/dashboard-widget-card/dashboard-widget-card.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts +2 -2
- package/dist/ui/components/atoms/vc-label/vc-label.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts +2 -2
- package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts.map +1 -1
- package/dist/ui/components/index.d.ts +0 -1
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/index.d.ts +1 -0
- package/dist/ui/components/molecules/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts +3 -3
- package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +6 -34
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-dropdown/index.d.ts +4 -0
- package/dist/ui/components/molecules/vc-input-dropdown/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts +171 -0
- package/dist/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-rating/vc-rating.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts +5 -5
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts +3 -3
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts +4 -4
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts +3 -3
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/common/popup/vc-popup-error.vue +3 -3
- package/shared/components/common/popup/vc-popup-info.vue +3 -3
- package/shared/components/common/popup/vc-popup-warning.vue +3 -3
- package/shared/components/dashboard-widget-card/dashboard-widget-card.vue +4 -4
- package/ui/components/atoms/vc-badge/vc-badge.vue +2 -2
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +1 -1
- package/ui/components/atoms/vc-label/vc-label.vue +3 -3
- package/ui/components/atoms/vc-tooltip/vc-tooltip.vue +3 -3
- package/ui/components/index.ts +0 -2
- package/ui/components/molecules/index.ts +1 -0
- package/ui/components/molecules/vc-checkbox/vc-checkbox.vue +4 -4
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +2 -2
- package/ui/components/molecules/vc-input-currency/vc-input-currency.stories.ts +1 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +41 -118
- package/ui/components/molecules/vc-input-dropdown/index.ts +4 -0
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.stories.ts +763 -0
- package/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.vue +268 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +2 -2
- package/ui/components/molecules/vc-rating/vc-rating.vue +2 -2
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +2 -2
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarWidgetItem.vue +3 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +6 -6
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +4 -4
- package/ui/components/organisms/vc-app/vc-app.vue +2 -3
- package/ui/components/organisms/vc-blade/vc-blade.vue +5 -5
- package/ui/components/organisms/vc-login-form/vc-login-form.vue +2 -2
- package/ui/components/organisms/vc-popup/vc-popup.vue +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@fullhuman/postcss-purgecss": "^7.0.2",
|
|
72
72
|
"@types/dompurify": "^3.0.5",
|
|
73
|
-
"@vc-shell/api-client-generator": "^1.1.
|
|
74
|
-
"@vc-shell/config-generator": "^1.1.
|
|
75
|
-
"@vc-shell/ts-config": "^1.1.
|
|
73
|
+
"@vc-shell/api-client-generator": "^1.1.7",
|
|
74
|
+
"@vc-shell/config-generator": "^1.1.7",
|
|
75
|
+
"@vc-shell/ts-config": "^1.1.7",
|
|
76
76
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
77
77
|
"@vue/test-utils": "^2.4.5",
|
|
78
78
|
"cypress-signalr-mock": "^1.5.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
</VcPopup>
|
|
28
28
|
</template>
|
|
29
|
-
|
|
29
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
30
30
|
<script lang="ts" setup>
|
|
31
31
|
import VcPopup from "./../../../../ui/components/organisms/vc-popup/vc-popup.vue";
|
|
32
32
|
|
|
@@ -43,8 +43,8 @@ defineProps<Props>();
|
|
|
43
43
|
defineEmits<Emits>();
|
|
44
44
|
|
|
45
45
|
defineSlots<{
|
|
46
|
-
header:
|
|
47
|
-
default:
|
|
46
|
+
header: (props: any) => any;
|
|
47
|
+
default: (props: any) => any;
|
|
48
48
|
}>();
|
|
49
49
|
</script>
|
|
50
50
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
</VcPopup>
|
|
28
28
|
</template>
|
|
29
|
-
|
|
29
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
30
30
|
<script lang="ts" setup>
|
|
31
31
|
import VcPopup from "./../../../../ui/components/organisms/vc-popup/vc-popup.vue";
|
|
32
32
|
|
|
@@ -43,8 +43,8 @@ defineProps<Props>();
|
|
|
43
43
|
defineEmits<Emits>();
|
|
44
44
|
|
|
45
45
|
defineSlots<{
|
|
46
|
-
header:
|
|
47
|
-
default:
|
|
46
|
+
header: (props: any) => any;
|
|
47
|
+
default: (props: any) => any;
|
|
48
48
|
}>();
|
|
49
49
|
</script>
|
|
50
50
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
</VcPopup>
|
|
30
30
|
</template>
|
|
31
|
-
|
|
31
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
32
32
|
<script lang="ts" setup>
|
|
33
33
|
import VcPopup from "./../../../../ui/components/organisms/vc-popup/vc-popup.vue";
|
|
34
34
|
|
|
@@ -46,8 +46,8 @@ defineProps<Props>();
|
|
|
46
46
|
defineEmits<Emits>();
|
|
47
47
|
|
|
48
48
|
defineSlots<{
|
|
49
|
-
header:
|
|
50
|
-
default:
|
|
49
|
+
header: (props: any) => any;
|
|
50
|
+
default: (props: any) => any;
|
|
51
51
|
}>();
|
|
52
52
|
</script>
|
|
53
53
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
39
|
-
|
|
39
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
40
40
|
<script setup lang="ts">
|
|
41
41
|
export interface Props {
|
|
42
42
|
header?: string;
|
|
@@ -47,9 +47,9 @@ export interface Props {
|
|
|
47
47
|
const props = defineProps<Props>();
|
|
48
48
|
|
|
49
49
|
defineSlots<{
|
|
50
|
-
header:
|
|
51
|
-
actions:
|
|
52
|
-
content:
|
|
50
|
+
header: (props: any) => any;
|
|
51
|
+
actions: (props: any) => any;
|
|
52
|
+
content: (props: any) => any;
|
|
53
53
|
// TODO: implement
|
|
54
54
|
// "mobile-content": void;
|
|
55
55
|
}>();
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
</template>
|
|
41
|
-
|
|
41
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
42
42
|
<script lang="ts" setup>
|
|
43
43
|
import { computed } from "vue";
|
|
44
44
|
|
|
@@ -74,7 +74,7 @@ defineSlots<{
|
|
|
74
74
|
/**
|
|
75
75
|
* Slot for component content
|
|
76
76
|
* */
|
|
77
|
-
default:
|
|
77
|
+
default: (props: any) => any;
|
|
78
78
|
}>();
|
|
79
79
|
|
|
80
80
|
function onClick(): void {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
41
|
</template>
|
|
42
|
-
|
|
42
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
43
43
|
<script lang="ts" setup>
|
|
44
44
|
import { VcIcon, VcTooltip } from "./../../../components";
|
|
45
45
|
|
|
@@ -71,8 +71,8 @@ withDefaults(defineProps<Props>(), {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
defineSlots<{
|
|
74
|
-
default:
|
|
75
|
-
tooltip?:
|
|
74
|
+
default: (props: any) => any;
|
|
75
|
+
tooltip?: (props: any) => any;
|
|
76
76
|
}>();
|
|
77
77
|
</script>
|
|
78
78
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</teleport>
|
|
25
25
|
</div>
|
|
26
26
|
</template>
|
|
27
|
-
|
|
27
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { useFloating, shift, Placement, offset as floatingOffset } from "@floating-ui/vue";
|
|
30
30
|
import { getCurrentInstance, ref, computed } from "vue";
|
|
@@ -48,8 +48,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
defineSlots<{
|
|
51
|
-
default:
|
|
52
|
-
tooltip?:
|
|
51
|
+
default: (props: any) => any;
|
|
52
|
+
tooltip?: (props: any) => any;
|
|
53
53
|
}>();
|
|
54
54
|
|
|
55
55
|
const tooltipVisible = ref(false);
|
package/ui/components/index.ts
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
</slot>
|
|
83
83
|
</div>
|
|
84
84
|
</template>
|
|
85
|
-
|
|
85
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
86
86
|
<script lang="ts" setup>
|
|
87
87
|
import { MaybeRef, computed, unref, ref, watch, onMounted } from "vue";
|
|
88
88
|
import { VcHint } from "./../../atoms/vc-hint";
|
|
@@ -117,9 +117,9 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
117
117
|
const emit = defineEmits<Emits>();
|
|
118
118
|
|
|
119
119
|
defineSlots<{
|
|
120
|
-
default: (props: Record<string, never>) =>
|
|
121
|
-
error: (props: Record<string, never>) =>
|
|
122
|
-
icon: (props: Record<string, never>) =>
|
|
120
|
+
default: (props: Record<string, never>) => any;
|
|
121
|
+
error: (props: Record<string, never>) => any;
|
|
122
|
+
icon: (props: Record<string, never>) => any;
|
|
123
123
|
}>();
|
|
124
124
|
|
|
125
125
|
const checkboxRef = ref<HTMLInputElement | null>(null);
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</slot>
|
|
56
56
|
</div>
|
|
57
57
|
</template>
|
|
58
|
-
|
|
58
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
59
59
|
<script lang="ts" setup>
|
|
60
60
|
import { getCurrentInstance, ref, unref } from "vue";
|
|
61
61
|
import { useField } from "vee-validate";
|
|
@@ -90,7 +90,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
90
90
|
const emit = defineEmits<Emits>();
|
|
91
91
|
|
|
92
92
|
defineSlots<{
|
|
93
|
-
error:
|
|
93
|
+
error: (props: any) => any;
|
|
94
94
|
}>();
|
|
95
95
|
|
|
96
96
|
const { t } = useI18n({ useScope: "global" });
|
|
@@ -1,100 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<VcInputDropdown
|
|
3
3
|
class="vc-input-currency"
|
|
4
4
|
:options="options"
|
|
5
5
|
:option-label="optionLabel"
|
|
6
6
|
:option-value="optionValue"
|
|
7
|
-
:searchable="
|
|
7
|
+
:searchable="searchable"
|
|
8
8
|
:debounce="debounce"
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
:label="label"
|
|
11
11
|
:required="required"
|
|
12
|
-
:
|
|
12
|
+
:option="option"
|
|
13
|
+
:model-value="numberValue"
|
|
13
14
|
:tooltip="tooltip"
|
|
14
|
-
|
|
15
|
+
:placeholder="placeholder"
|
|
16
|
+
:hint="hint"
|
|
17
|
+
:clearable="clearable"
|
|
18
|
+
:prefix="prefix"
|
|
19
|
+
:suffix="suffix"
|
|
20
|
+
:name="name"
|
|
21
|
+
:loading="loading"
|
|
22
|
+
:autofocus="autofocus"
|
|
23
|
+
:error="error"
|
|
24
|
+
:error-message="errorMessage"
|
|
25
|
+
:maxlength="maxlength"
|
|
26
|
+
input-type="number"
|
|
27
|
+
@update:model-value="updateModel"
|
|
28
|
+
@update:option="$emit('update:option', $event)"
|
|
29
|
+
@blur="handleBlur"
|
|
15
30
|
>
|
|
16
|
-
<template #control="{
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:clearable="clearable"
|
|
21
|
-
:prefix="prefix"
|
|
22
|
-
:suffix="suffix"
|
|
23
|
-
:name="name"
|
|
24
|
-
:model-value="numberValue"
|
|
25
|
-
:loading="loading"
|
|
31
|
+
<template #control="{ placeholder: holder }">
|
|
32
|
+
<input
|
|
33
|
+
ref="inputRef"
|
|
34
|
+
type="text"
|
|
26
35
|
:disabled="disabled"
|
|
27
|
-
:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
:maxlength="maxlength"
|
|
31
|
-
class="vc-input-currency__input"
|
|
32
|
-
type="number"
|
|
33
|
-
@update:model-value="updateModel"
|
|
36
|
+
:placeholder="holder"
|
|
37
|
+
class="vc-input-currency__control"
|
|
38
|
+
tabindex="0"
|
|
34
39
|
@blur="handleBlur"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
name="button"
|
|
39
|
-
:toggle-handler="toggleHandler"
|
|
40
|
-
>
|
|
41
|
-
<template v-if="options && options.length">
|
|
42
|
-
<button
|
|
43
|
-
class="vc-input-currency__toggle-button"
|
|
44
|
-
tabindex="0"
|
|
45
|
-
@click.stop.prevent="toggleHandler"
|
|
46
|
-
@keydown.enter.stop.prevent="toggleHandler"
|
|
47
|
-
@keydown.space.stop.prevent="toggleHandler"
|
|
48
|
-
>
|
|
49
|
-
{{ unref(option) }}
|
|
50
|
-
</button>
|
|
51
|
-
</template>
|
|
52
|
-
</slot>
|
|
53
|
-
<slot
|
|
54
|
-
v-if="$slots['append-inner']"
|
|
55
|
-
name="append-inner"
|
|
56
|
-
></slot>
|
|
57
|
-
</template>
|
|
58
|
-
<template #control="{ placeholder: holder }">
|
|
59
|
-
<input
|
|
60
|
-
ref="inputRef"
|
|
61
|
-
type="text"
|
|
62
|
-
:disabled="disabled"
|
|
63
|
-
:placeholder="holder"
|
|
64
|
-
class="vc-input-currency__control"
|
|
65
|
-
tabindex="0"
|
|
66
|
-
@blur="handleBlur"
|
|
67
|
-
@keydown="handleKeyDown"
|
|
68
|
-
@paste="handlePaste"
|
|
69
|
-
/>
|
|
70
|
-
</template>
|
|
71
|
-
<template
|
|
72
|
-
v-if="$slots['prepend-inner']"
|
|
73
|
-
#prepend-inner
|
|
74
|
-
>
|
|
75
|
-
<slot name="prepend-inner"></slot>
|
|
76
|
-
</template>
|
|
77
|
-
<template
|
|
78
|
-
v-if="$slots['append']"
|
|
79
|
-
#append
|
|
80
|
-
>
|
|
81
|
-
<slot name="append"></slot>
|
|
82
|
-
</template>
|
|
83
|
-
<template
|
|
84
|
-
v-if="$slots['prepend']"
|
|
85
|
-
#prepend
|
|
86
|
-
>
|
|
87
|
-
<slot name="prepend"></slot>
|
|
88
|
-
</template>
|
|
89
|
-
</VcInput>
|
|
40
|
+
@keydown="handleKeyDown"
|
|
41
|
+
@paste="handlePaste"
|
|
42
|
+
/>
|
|
90
43
|
</template>
|
|
91
|
-
</
|
|
44
|
+
</VcInputDropdown>
|
|
92
45
|
</template>
|
|
93
46
|
|
|
94
47
|
<script lang="ts" setup>
|
|
95
48
|
import { useCurrencyInput, CurrencyDisplay } from "vue-currency-input";
|
|
96
49
|
import { unref, watch } from "vue";
|
|
97
|
-
import {
|
|
50
|
+
import { VcInputDropdown } from "./../../molecules/vc-input-dropdown";
|
|
98
51
|
import { OptionProp } from "../vc-select/vc-select.vue";
|
|
99
52
|
|
|
100
53
|
export interface Props {
|
|
@@ -197,6 +150,10 @@ export interface Props {
|
|
|
197
150
|
*/
|
|
198
151
|
currencyDisplay?: `${CurrencyDisplay}`;
|
|
199
152
|
precision?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
|
|
153
|
+
/**
|
|
154
|
+
* Enable search in dropdown
|
|
155
|
+
*/
|
|
156
|
+
searchable?: boolean;
|
|
200
157
|
}
|
|
201
158
|
|
|
202
159
|
export interface Emits {
|
|
@@ -210,37 +167,9 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
210
167
|
debounce: 0,
|
|
211
168
|
currencyDisplay: CurrencyDisplay.hidden,
|
|
212
169
|
precision: 2,
|
|
170
|
+
searchable: false,
|
|
213
171
|
});
|
|
214
172
|
|
|
215
|
-
defineSlots<{
|
|
216
|
-
/**
|
|
217
|
-
* Slot for custom dropdown open handler
|
|
218
|
-
*/
|
|
219
|
-
button: (scope: {
|
|
220
|
-
/**
|
|
221
|
-
* Dropdown open/close handler
|
|
222
|
-
*/
|
|
223
|
-
toggleHandler: () => void;
|
|
224
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
|
-
}) => any;
|
|
226
|
-
/**
|
|
227
|
-
* Slot for custom append-inner content
|
|
228
|
-
*/
|
|
229
|
-
"append-inner": void;
|
|
230
|
-
/**
|
|
231
|
-
* Slot for custom prepend-inner content
|
|
232
|
-
*/
|
|
233
|
-
"prepend-inner": void;
|
|
234
|
-
/**
|
|
235
|
-
* Slot for custom append content
|
|
236
|
-
*/
|
|
237
|
-
append: void;
|
|
238
|
-
/**
|
|
239
|
-
* Slot for custom prepend content
|
|
240
|
-
*/
|
|
241
|
-
prepend: void;
|
|
242
|
-
}>();
|
|
243
|
-
|
|
244
173
|
const emit = defineEmits<Emits>();
|
|
245
174
|
|
|
246
175
|
const { inputRef, setOptions, numberValue, setValue } = useCurrencyInput(
|
|
@@ -285,9 +214,11 @@ watch(numberValue, (value) => {
|
|
|
285
214
|
});
|
|
286
215
|
|
|
287
216
|
function updateModel(value: string | number | Date | null | undefined) {
|
|
288
|
-
inputRef.value
|
|
289
|
-
|
|
290
|
-
|
|
217
|
+
if (inputRef.value) {
|
|
218
|
+
inputRef.value.value = value as string;
|
|
219
|
+
}
|
|
220
|
+
numberValue.value = typeof value === "number" ? value : value === null ? null : parseFloat(String(value)) || null;
|
|
221
|
+
emit("update:model-value", numberValue.value);
|
|
291
222
|
}
|
|
292
223
|
|
|
293
224
|
function handleBlur(event: Event) {
|
|
@@ -330,14 +261,6 @@ function handlePaste(e: ClipboardEvent) {
|
|
|
330
261
|
}
|
|
331
262
|
|
|
332
263
|
.vc-input-currency {
|
|
333
|
-
&__input {
|
|
334
|
-
@apply tw-w-full;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
&__toggle-button {
|
|
338
|
-
@apply tw-text-[color:var(--input-curr-toggle-color)] tw-not-italic tw-font-medium tw-text-sm tw-cursor-pointer;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
264
|
&__control {
|
|
342
265
|
@apply tw-border tw-border-solid tw-px-2 tw-py-1 tw-text-sm tw-outline-none tw-bg-transparent;
|
|
343
266
|
}
|