@jari-ace/element-plus-component 0.6.0 → 0.6.1
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/switch/JaSwitch.vue.d.ts +229 -170
- package/dist/components/switch/JaSwitch.vue.d.ts.map +1 -1
- package/dist/components/switch/JaSwitch.vue.js +4 -13
- package/dist/components/switch/JaSwitch.vue.js.map +1 -1
- package/lib/index.js +143 -170
- package/lib/index.umd.cjs +24 -24
- package/package.json +1 -1
- package/packages/components/switch/JaSwitch.vue +5 -16
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type {ValidationInstance} from '../../hooks/useBackendValidations'
|
|
3
|
-
import {inject, ref, watch
|
|
3
|
+
import {inject, ref, watch} from "vue";
|
|
4
4
|
import {ElSwitch} from "element-plus";
|
|
5
|
-
import type { SwitchProps } from 'element-plus'
|
|
6
5
|
import {getValue, setValue} from "../../utils/objectUtils";
|
|
7
6
|
import type {EpPropMergeType} from "element-plus/es/utils";
|
|
8
7
|
|
|
9
|
-
const input = ref<
|
|
8
|
+
const input = ref<typeof ElSwitch>()
|
|
10
9
|
const model = inject('aceFormModel') as Record<string, any>
|
|
11
10
|
const prop = inject('aceFormItemProp') as string
|
|
12
11
|
const validator = inject('aceFormValidator') as ValidationInstance
|
|
@@ -14,11 +13,6 @@ const emit = defineEmits<{
|
|
|
14
13
|
change: [value: boolean | string | number]
|
|
15
14
|
}>()
|
|
16
15
|
|
|
17
|
-
export interface JaSwitchProps extends Partial<SwitchProps> {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const props = defineProps<JaSwitchProps>()
|
|
21
|
-
|
|
22
16
|
function onChange(value: boolean | string | number) {
|
|
23
17
|
validator.removeFieldError(prop)
|
|
24
18
|
setValue(model.formData, prop, mv.value);
|
|
@@ -36,14 +30,9 @@ watch(() => model.formData, () => {
|
|
|
36
30
|
deep: true
|
|
37
31
|
})
|
|
38
32
|
|
|
39
|
-
const elementProps = computed(() => {
|
|
40
|
-
const { modelValue, ...rest } = props
|
|
41
|
-
return rest
|
|
42
|
-
})
|
|
43
|
-
|
|
44
33
|
defineExpose({
|
|
45
|
-
focus: () =>
|
|
46
|
-
blur: () =>
|
|
34
|
+
focus: () => input.value?.focus(),
|
|
35
|
+
blur: () => input.value?.blur(),
|
|
47
36
|
elSwitch: input
|
|
48
37
|
})
|
|
49
38
|
</script>
|
|
@@ -53,7 +42,7 @@ defineExpose({
|
|
|
53
42
|
ref="input"
|
|
54
43
|
v-model="mv"
|
|
55
44
|
@change="onChange"
|
|
56
|
-
v-bind="
|
|
45
|
+
v-bind="$attrs">
|
|
57
46
|
<template v-for="(_, name) in $slots" v-slot:[name]>
|
|
58
47
|
<slot :name="name"></slot>
|
|
59
48
|
</template>
|