@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jari-ace/element-plus-component",
3
3
  "private": false,
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "main": "lib/index.umd.cjs",
6
6
  "module": "lib/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,12 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import type {ValidationInstance} from '../../hooks/useBackendValidations'
3
- import {inject, ref, watch, computed} from "vue";
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<InstanceType<typeof ElSwitch>>()
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: () => (input.value as any)?.focus?.(),
46
- blur: () => (input.value as any)?.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="{ ...elementProps, ...$attrs }">
45
+ v-bind="$attrs">
57
46
  <template v-for="(_, name) in $slots" v-slot:[name]>
58
47
  <slot :name="name"></slot>
59
48
  </template>