@jari-ace/element-plus-component 0.4.0 → 0.4.2
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/autoComplete/JaAutoComplete.vue.d.ts +543 -686
- package/dist/components/autoComplete/JaAutoComplete.vue.d.ts.map +1 -1
- package/dist/components/autoComplete/JaAutoComplete.vue.js +10 -2
- package/dist/components/autoComplete/JaAutoComplete.vue.js.map +1 -1
- package/dist/components/avatar/JaAvatar.vue.d.ts +4 -3
- package/dist/components/avatar/JaAvatar.vue.d.ts.map +1 -1
- package/dist/components/avatar/JaAvatar.vue.js +10 -2
- package/dist/components/avatar/JaAvatar.vue.js.map +1 -1
- package/dist/components/button/JaButton.vue.d.ts +184 -250
- package/dist/components/button/JaButton.vue.d.ts.map +1 -1
- package/dist/components/button/JaButton.vue.js +11 -3
- package/dist/components/button/JaButton.vue.js.map +1 -1
- package/dist/components/checkbox/JaCheckbox.vue.d.ts +164 -1068
- package/dist/components/checkbox/JaCheckbox.vue.d.ts.map +1 -1
- package/dist/components/checkbox/JaCheckbox.vue.js +9 -24
- package/dist/components/checkbox/JaCheckbox.vue.js.map +1 -1
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts +158 -163
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.js +14 -5
- package/dist/components/checkboxGroup/JaCheckboxGroup.vue.js.map +1 -1
- package/dist/components/datePicker/JaDatePicker.vue.d.ts +7 -4
- package/dist/components/datePicker/JaDatePicker.vue.d.ts.map +1 -1
- package/dist/components/datePicker/JaDatePicker.vue.js +18 -7
- package/dist/components/datePicker/JaDatePicker.vue.js.map +1 -1
- package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts +324 -399
- package/dist/components/dropdownButton/JaDropdownButton.vue.d.ts.map +1 -1
- package/dist/components/dropdownButton/JaDropdownButton.vue.js +4 -2
- package/dist/components/dropdownButton/JaDropdownButton.vue.js.map +1 -1
- package/dist/components/form/JaForm.vue.d.ts +52 -3
- package/dist/components/form/JaForm.vue.d.ts.map +1 -1
- package/dist/components/form/JaForm.vue.js +4 -2
- package/dist/components/form/JaForm.vue.js.map +1 -1
- package/dist/components/formItem/JaFormItem.vue.d.ts +168 -133
- package/dist/components/formItem/JaFormItem.vue.d.ts.map +1 -1
- package/dist/components/formItem/JaFormItem.vue.js.map +1 -1
- package/dist/components/input/JaInput.vue.d.ts +274 -421
- package/dist/components/input/JaInput.vue.d.ts.map +1 -1
- package/dist/components/input/JaInput.vue.js +20 -60
- package/dist/components/input/JaInput.vue.js.map +1 -1
- package/dist/components/inputI18n/JaInputI18n.vue.d.ts +70 -70
- package/dist/components/inputNumber/JaInputNumber.vue.d.ts +203 -217
- package/dist/components/inputNumber/JaInputNumber.vue.d.ts.map +1 -1
- package/dist/components/inputNumber/JaInputNumber.vue.js +16 -37
- package/dist/components/inputNumber/JaInputNumber.vue.js.map +1 -1
- package/dist/components/radioGroup/JaRadioGroup.vue.d.ts +148 -121
- package/dist/components/radioGroup/JaRadioGroup.vue.d.ts.map +1 -1
- package/dist/components/radioGroup/JaRadioGroup.vue.js +14 -5
- package/dist/components/radioGroup/JaRadioGroup.vue.js.map +1 -1
- package/dist/components/scrollbar/Scrollbar.vue.d.ts +5 -2
- package/dist/components/scrollbar/Scrollbar.vue.d.ts.map +1 -1
- package/dist/components/scrollbar/Scrollbar.vue.js +11 -3
- package/dist/components/scrollbar/Scrollbar.vue.js.map +1 -1
- package/dist/components/select/JaSelect.vue.d.ts +70 -70
- package/dist/components/select/JaSelect.vue.js +14 -5
- package/dist/components/select/JaSelect.vue.js.map +1 -1
- package/dist/components/switch/JaSwitch.vue.d.ts +174 -205
- package/dist/components/switch/JaSwitch.vue.d.ts.map +1 -1
- package/dist/components/switch/JaSwitch.vue.js +13 -4
- package/dist/components/switch/JaSwitch.vue.js.map +1 -1
- package/dist/components/timePicker/JaTimePicker.vue.d.ts +5 -2
- package/dist/components/timePicker/JaTimePicker.vue.d.ts.map +1 -1
- package/dist/components/timePicker/JaTimePicker.vue.js +18 -7
- package/dist/components/timePicker/JaTimePicker.vue.js.map +1 -1
- package/dist/components/tip/index.d.ts +3 -12
- package/dist/components/tip/index.d.ts.map +1 -1
- package/dist/components/tip/src/AceTip.vue.d.ts +9 -3
- package/dist/components/tip/src/AceTip.vue.d.ts.map +1 -1
- package/dist/components/tip/src/AceTip.vue.js.map +1 -1
- package/dist/components/upload/JaUploader.vue.d.ts +74 -14
- package/dist/components/upload/JaUploader.vue.d.ts.map +1 -1
- package/dist/components/upload/JaUploader.vue.js +3 -5
- package/dist/components/upload/JaUploader.vue.js.map +1 -1
- package/dist/components/upload/index.d.ts +79 -25
- package/dist/components/upload/index.d.ts.map +1 -1
- package/dist/components/upload/uploader.vue.d.ts +16 -0
- package/dist/components/upload/uploader.vue.d.ts.map +1 -1
- package/dist/components/upload/uploader.vue.js +137 -95
- package/dist/components/upload/uploader.vue.js.map +1 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts +50 -36
- package/dist/components/userGroupTree/src/userGroupTree.vue.d.ts.map +1 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.js +26 -1
- package/dist/components/userGroupTree/src/userGroupTree.vue.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.js +8291 -7887
- package/lib/index.umd.cjs +36 -36
- package/package.json +2 -2
- package/packages/components/autoComplete/JaAutoComplete.vue +19 -9
- package/packages/components/autoComplete/README.md +35 -0
- package/packages/components/avatar/JaAvatar.vue +16 -7
- package/packages/components/avatar/README.md +45 -0
- package/packages/components/button/JaButton.vue +32 -7
- package/packages/components/button/README.md +57 -0
- package/packages/components/checkbox/JaCheckbox.vue +15 -25
- package/packages/components/checkbox/README.md +21 -0
- package/packages/components/checkboxGroup/JaCheckboxGroup.vue +16 -5
- package/packages/components/checkboxGroup/README.md +24 -0
- package/packages/components/datePicker/JaDatePicker.vue +23 -10
- package/packages/components/datePicker/README.md +21 -0
- package/packages/components/dropdownButton/JaDropdownButton.vue +25 -7
- package/packages/components/dropdownButton/README.md +30 -0
- package/packages/components/form/JaForm.vue +60 -20
- package/packages/components/form/README.md +30 -0
- package/packages/components/formItem/JaFormItem.vue +43 -7
- package/packages/components/formItem/README.md +28 -0
- package/packages/components/input/JaInput.vue +30 -66
- package/packages/components/input/README.md +23 -0
- package/packages/components/inputNumber/JaInputNumber.vue +25 -45
- package/packages/components/inputNumber/README.md +21 -0
- package/packages/components/radioGroup/JaRadioGroup.vue +16 -5
- package/packages/components/radioGroup/README.md +24 -0
- package/packages/components/scrollbar/README.md +23 -0
- package/packages/components/scrollbar/Scrollbar.vue +14 -3
- package/packages/components/select/JaSelect.vue +22 -10
- package/packages/components/select/README.md +24 -0
- package/packages/components/switch/JaSwitch.vue +16 -5
- package/packages/components/switch/README.md +21 -0
- package/packages/components/timePicker/JaTimePicker.vue +21 -8
- package/packages/components/timePicker/README.md +21 -0
- package/packages/components/tip/README.md +20 -0
- package/packages/components/tip/src/AceTip.vue +10 -2
- package/packages/components/upload/JaUploader.vue +9 -8
- package/packages/components/upload/README.md +24 -0
- package/packages/components/upload/uploader.vue +95 -58
- package/packages/components/userGroupTree/src/userGroupTree.vue +9 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# JaRadioGroup 单选框组组件
|
|
2
|
+
|
|
3
|
+
`JaRadioGroup` 是对 Element Plus `ElRadioGroup` 的封装,集成了 `JaForm` 表单上下文注入。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于在 `JaForm` 中创建单选框组,自动绑定数据模型。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
该组件继承了 [ElRadioGroup](https://element-plus.org/zh-CN/component/radio.html#radiogroup-attributes) 的所有属性。
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| - | - | - | 支持所有 ElRadioGroup 属性 |
|
|
16
|
+
|
|
17
|
+
## 使用示例
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<ja-radio-group>
|
|
21
|
+
<el-radio :label="3">Option A</el-radio>
|
|
22
|
+
<el-radio :label="6">Option B</el-radio>
|
|
23
|
+
</ja-radio-group>
|
|
24
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Scrollbar 滚动条组件
|
|
2
|
+
|
|
3
|
+
`Scrollbar` 是对 Element Plus `ElScrollbar` 的扩展,支持可视区域检测(Intersection Observer)。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于内容滚动,并支持检测子元素是否在可视区域内(用于懒加载等场景)。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
该组件继承了 [ElScrollbar](https://element-plus.org/zh-CN/component/scrollbar.html#scrollbar-attributes) 的所有属性。
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| - | - | - | 支持所有 ElScrollbar 属性 |
|
|
16
|
+
|
|
17
|
+
## 使用示例
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<scrollbar height="400px">
|
|
21
|
+
<div v-for="item in 100" :key="item">{{ item }}</div>
|
|
22
|
+
</scrollbar>
|
|
23
|
+
```
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {ElScrollbar} from "element-plus";
|
|
3
|
-
import
|
|
3
|
+
import type { ScrollbarProps } from "element-plus";
|
|
4
|
+
import {nextTick, onMounted, onUnmounted, provide, type Ref, ref, watch, computed} from "vue";
|
|
4
5
|
import {
|
|
5
6
|
SCROLL_BAR_WRAPPED_INJECT_KEY,
|
|
6
7
|
type ScrollbarWrapped
|
|
7
8
|
} from "./utils";
|
|
8
9
|
|
|
10
|
+
export interface JaScrollbarProps extends Partial<ScrollbarProps> {
|
|
11
|
+
// Custom props if any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = defineProps<JaScrollbarProps>()
|
|
15
|
+
|
|
9
16
|
const scroll = ref<InstanceType<typeof ElScrollbar>>();
|
|
10
17
|
const wrappedItems: Ref<ScrollbarWrapped[]> = ref([]);
|
|
11
18
|
const wrappedItemsMap: Map<Element, ScrollbarWrapped> = new Map();
|
|
@@ -35,7 +42,7 @@ const observer = new IntersectionObserver((entries) => {
|
|
|
35
42
|
async function observeWrappedItemInView() {
|
|
36
43
|
await nextTick();
|
|
37
44
|
const wrap = scroll.value?.$el;
|
|
38
|
-
if (!wrappedItems.value) return;
|
|
45
|
+
if (!wrappedItems.value || !wrap) return;
|
|
39
46
|
try {
|
|
40
47
|
for (let i = 0; i < wrappedItems.value.length; i++) {
|
|
41
48
|
if (wrappedItems.value[i]) {
|
|
@@ -74,11 +81,15 @@ onUnmounted(() => {
|
|
|
74
81
|
})
|
|
75
82
|
})
|
|
76
83
|
|
|
84
|
+
const elementProps = computed(() => {
|
|
85
|
+
return props
|
|
86
|
+
})
|
|
87
|
+
|
|
77
88
|
</script>
|
|
78
89
|
|
|
79
90
|
<template>
|
|
80
91
|
<el-scrollbar ref="scroll" class="scroll-container"
|
|
81
|
-
v-bind="
|
|
92
|
+
v-bind="{ ...elementProps, ...$attrs }">
|
|
82
93
|
<template v-for="(_, name) in $slots" v-slot:[name]>
|
|
83
94
|
<slot :name="name"></slot>
|
|
84
95
|
</template>
|
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type {ValidationInstance} from '../../hooks/useBackendValidations'
|
|
3
|
-
import {inject, ref, watch} from "vue";
|
|
3
|
+
import {inject, ref, watch, computed} from "vue";
|
|
4
4
|
import {ElSelect} from "element-plus";
|
|
5
|
+
import type { SelectProps } from 'element-plus'
|
|
5
6
|
import type {EpPropFinalized} from "element-plus/es/utils";
|
|
6
7
|
import {getValue, setValue} from "../../utils/objectUtils";
|
|
7
8
|
|
|
8
|
-
const input = ref<typeof ElSelect
|
|
9
|
+
const input = ref<InstanceType<typeof ElSelect>>()
|
|
9
10
|
const model = inject('aceFormModel') as Record<string, any>
|
|
10
11
|
const prop = inject('aceFormItemProp') as string
|
|
11
12
|
const validator = inject('aceFormValidator') as ValidationInstance
|
|
12
13
|
const emit = defineEmits<{
|
|
13
|
-
change: [value:
|
|
14
|
+
change: [value: any]
|
|
14
15
|
}>()
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
export interface JaSelectProps extends Partial<SelectProps> {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = defineProps<JaSelectProps>()
|
|
21
|
+
|
|
22
|
+
function onChange(value: any) {
|
|
17
23
|
validator.removeFieldError(prop)
|
|
18
24
|
setValue(model.formData, prop, mv.value);
|
|
19
25
|
emit('change', value)
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
type modelType = EpPropFinalized<(ArrayConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
28
|
+
// type modelType = EpPropFinalized<(ArrayConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
29
|
+
type ModelType = any; // Select value can be complex
|
|
23
30
|
|
|
24
|
-
const mv = ref(getValue(model.formData, prop) as
|
|
31
|
+
const mv = ref(getValue(model.formData, prop) as ModelType);
|
|
25
32
|
watch(() => model.formData, () => {
|
|
26
|
-
mv.value = getValue(model.formData, prop) as
|
|
33
|
+
mv.value = getValue(model.formData, prop) as ModelType
|
|
27
34
|
}, {
|
|
28
35
|
deep: true
|
|
29
36
|
})
|
|
30
37
|
|
|
38
|
+
const elementProps = computed(() => {
|
|
39
|
+
const { modelValue, ...rest } = props as any
|
|
40
|
+
return rest
|
|
41
|
+
})
|
|
42
|
+
|
|
31
43
|
defineExpose({
|
|
32
|
-
focus: () => input.value
|
|
33
|
-
blur: () => input.value
|
|
44
|
+
focus: () => input.value?.focus?.(),
|
|
45
|
+
blur: () => input.value?.blur?.(),
|
|
34
46
|
elSelect: input
|
|
35
47
|
})
|
|
36
48
|
</script>
|
|
@@ -40,7 +52,7 @@ defineExpose({
|
|
|
40
52
|
ref="input"
|
|
41
53
|
v-model="mv"
|
|
42
54
|
@change="onChange"
|
|
43
|
-
v-bind="
|
|
55
|
+
v-bind="{ ...elementProps, ...$attrs }">
|
|
44
56
|
<template v-for="(_, name) in $slots" v-slot:[name]>
|
|
45
57
|
<slot :name="name"></slot>
|
|
46
58
|
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# JaSelect 选择器组件
|
|
2
|
+
|
|
3
|
+
`JaSelect` 是对 Element Plus `ElSelect` 的封装,集成了 `JaForm` 表单上下文注入。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于在 `JaForm` 中进行选择,自动绑定数据模型。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
该组件继承了 [ElSelect](https://element-plus.org/zh-CN/component/select.html#select-attributes) 的所有属性。
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| - | - | - | 支持所有 ElSelect 属性 |
|
|
16
|
+
|
|
17
|
+
## 使用示例
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<ja-select>
|
|
21
|
+
<el-option label="Zone 1" value="shanghai" />
|
|
22
|
+
<el-option label="Zone 2" value="beijing" />
|
|
23
|
+
</ja-select>
|
|
24
|
+
```
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type {ValidationInstance} from '../../hooks/useBackendValidations'
|
|
3
|
-
import {inject, ref, watch} from "vue";
|
|
3
|
+
import {inject, ref, watch, computed} from "vue";
|
|
4
4
|
import {ElSwitch} from "element-plus";
|
|
5
|
+
import type { SwitchProps } from 'element-plus'
|
|
5
6
|
import {getValue, setValue} from "../../utils/objectUtils";
|
|
6
7
|
import type {EpPropMergeType} from "element-plus/es/utils";
|
|
7
8
|
|
|
8
|
-
const input = ref<typeof ElSwitch
|
|
9
|
+
const input = ref<InstanceType<typeof ElSwitch>>()
|
|
9
10
|
const model = inject('aceFormModel') as Record<string, any>
|
|
10
11
|
const prop = inject('aceFormItemProp') as string
|
|
11
12
|
const validator = inject('aceFormValidator') as ValidationInstance
|
|
@@ -13,6 +14,11 @@ const emit = defineEmits<{
|
|
|
13
14
|
change: [value: boolean | string | number]
|
|
14
15
|
}>()
|
|
15
16
|
|
|
17
|
+
export interface JaSwitchProps extends Partial<SwitchProps> {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = defineProps<JaSwitchProps>()
|
|
21
|
+
|
|
16
22
|
function onChange(value: boolean | string | number) {
|
|
17
23
|
validator.removeFieldError(prop)
|
|
18
24
|
setValue(model.formData, prop, mv.value);
|
|
@@ -30,9 +36,14 @@ watch(() => model.formData, () => {
|
|
|
30
36
|
deep: true
|
|
31
37
|
})
|
|
32
38
|
|
|
39
|
+
const elementProps = computed(() => {
|
|
40
|
+
const { modelValue, ...rest } = props
|
|
41
|
+
return rest
|
|
42
|
+
})
|
|
43
|
+
|
|
33
44
|
defineExpose({
|
|
34
|
-
focus: () => input.value?.focus(),
|
|
35
|
-
blur: () => input.value?.blur(),
|
|
45
|
+
focus: () => (input.value as any)?.focus?.(),
|
|
46
|
+
blur: () => (input.value as any)?.blur?.(),
|
|
36
47
|
elSwitch: input
|
|
37
48
|
})
|
|
38
49
|
</script>
|
|
@@ -42,7 +53,7 @@ defineExpose({
|
|
|
42
53
|
ref="input"
|
|
43
54
|
v-model="mv"
|
|
44
55
|
@change="onChange"
|
|
45
|
-
v-bind="
|
|
56
|
+
v-bind="{ ...elementProps, ...$attrs }">
|
|
46
57
|
<template v-for="(_, name) in $slots" v-slot:[name]>
|
|
47
58
|
<slot :name="name"></slot>
|
|
48
59
|
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# JaSwitch 开关组件
|
|
2
|
+
|
|
3
|
+
`JaSwitch` 是对 Element Plus `ElSwitch` 的封装,集成了 `JaForm` 表单上下文注入。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于在 `JaForm` 中切换状态,自动绑定数据模型。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
该组件继承了 [ElSwitch](https://element-plus.org/zh-CN/component/switch.html#switch-attributes) 的所有属性。
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| - | - | - | 支持所有 ElSwitch 属性 |
|
|
16
|
+
|
|
17
|
+
## 使用示例
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<ja-switch />
|
|
21
|
+
```
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type {ValidationInstance} from '../../hooks/useBackendValidations'
|
|
3
|
-
import {inject, onMounted, ref, watch} from "vue";
|
|
3
|
+
import {inject, onMounted, ref, watch, computed} from "vue";
|
|
4
4
|
import {ElTimePicker} from "element-plus";
|
|
5
|
+
import type { TimePickerDefaultProps } from 'element-plus'
|
|
5
6
|
import {getValue, setValue} from "../../utils/objectUtils";
|
|
6
7
|
|
|
7
|
-
const input = ref<typeof ElTimePicker
|
|
8
|
+
const input = ref<InstanceType<typeof ElTimePicker>>()
|
|
8
9
|
const model = inject('aceFormModel') as Record<string, any>
|
|
9
10
|
const prop = inject('aceFormItemProp') as string
|
|
10
11
|
const validator = inject('aceFormValidator') as ValidationInstance
|
|
@@ -12,6 +13,11 @@ const emit = defineEmits<{
|
|
|
12
13
|
change: [value: string]
|
|
13
14
|
}>()
|
|
14
15
|
|
|
16
|
+
export interface JaTimePickerProps extends Partial<TimePickerDefaultProps> {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = defineProps<JaTimePickerProps>()
|
|
20
|
+
|
|
15
21
|
const exposeMethods = ref<any>({})
|
|
16
22
|
|
|
17
23
|
function onChange(value: string) {
|
|
@@ -20,7 +26,7 @@ function onChange(value: string) {
|
|
|
20
26
|
emit('change', value);
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
type ModelType = string | number | object;
|
|
29
|
+
type ModelType = string | number | object | any;
|
|
24
30
|
|
|
25
31
|
const mv = ref(getValue(model.formData, prop) as ModelType);
|
|
26
32
|
watch(() => model.formData, () => {
|
|
@@ -29,11 +35,18 @@ watch(() => model.formData, () => {
|
|
|
29
35
|
deep: true
|
|
30
36
|
})
|
|
31
37
|
|
|
38
|
+
const elementProps = computed(() => {
|
|
39
|
+
const { modelValue, ...rest } = props
|
|
40
|
+
return rest
|
|
41
|
+
})
|
|
42
|
+
|
|
32
43
|
onMounted(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
if (input.value) {
|
|
45
|
+
const refMethods = Object.entries(input.value).filter(([_, v]) => v instanceof Function);
|
|
46
|
+
refMethods.forEach(([key, val]) => {
|
|
47
|
+
exposeMethods.value[key] = val;
|
|
48
|
+
})
|
|
49
|
+
}
|
|
37
50
|
})
|
|
38
51
|
|
|
39
52
|
defineExpose(exposeMethods.value);
|
|
@@ -44,7 +57,7 @@ defineExpose(exposeMethods.value);
|
|
|
44
57
|
ref="input"
|
|
45
58
|
v-model="model.formData[prop]"
|
|
46
59
|
@change="onChange"
|
|
47
|
-
v-bind="
|
|
60
|
+
v-bind="{ ...elementProps, ...$attrs }">
|
|
48
61
|
<template v-for="(_, name) in $slots" v-slot:[name]>
|
|
49
62
|
<slot :name="name"></slot>
|
|
50
63
|
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# JaTimePicker 时间选择器组件
|
|
2
|
+
|
|
3
|
+
`JaTimePicker` 是对 Element Plus `ElTimePicker` 的封装,集成了 `JaForm` 表单上下文注入。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于在 `JaForm` 中选择时间,自动绑定数据模型。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
该组件继承了 [ElTimePicker](https://element-plus.org/zh-CN/component/time-picker.html#timepicker-attributes) 的所有属性。
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| - | - | - | 支持所有 ElTimePicker 属性 |
|
|
16
|
+
|
|
17
|
+
## 使用示例
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<ja-time-picker placeholder="Arbitrary time" />
|
|
21
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# AceTip 提示组件
|
|
2
|
+
|
|
3
|
+
`AceTip` 是一个简单的提示信息展示组件。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于显示警告、提示或说明信息。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
12
|
+
| :--- | :--- | :--- | :--- |
|
|
13
|
+
| `type` | `'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'` | `'primary'` | 提示类型(颜色) |
|
|
14
|
+
| `text` | `string` | `''` | 提示文本 |
|
|
15
|
+
|
|
16
|
+
## 使用示例
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<ace-tip type="warning" text="请注意,此操作不可逆!" />
|
|
20
|
+
```
|
|
@@ -14,10 +14,18 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
-
|
|
17
|
+
export interface AceTipProps {
|
|
18
|
+
/**
|
|
19
|
+
* 提示类型
|
|
20
|
+
*/
|
|
18
21
|
type?: "primary" | "success" | "warning" | "danger" | "info";
|
|
22
|
+
/**
|
|
23
|
+
* 提示文本
|
|
24
|
+
*/
|
|
19
25
|
text?: string;
|
|
20
|
-
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const props = withDefaults(defineProps<AceTipProps>(), {
|
|
21
29
|
type: "primary",
|
|
22
30
|
text: "",
|
|
23
31
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type {ValidationInstance} from '../../hooks/useBackendValidations'
|
|
3
|
-
import {inject, ref, watch} from "vue";
|
|
3
|
+
import {inject, ref, watch, computed} from "vue";
|
|
4
4
|
import {getValue, setValue} from "../../utils/objectUtils";
|
|
5
5
|
import Uploader from "./uploader.vue";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
export interface JaUploaderProps {
|
|
7
8
|
/**
|
|
8
9
|
* 应用名
|
|
9
10
|
*/
|
|
@@ -17,7 +18,7 @@ const props = defineProps<{
|
|
|
17
18
|
*/
|
|
18
19
|
attachToken?: string,
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* 数据密级
|
|
21
22
|
*/
|
|
22
23
|
classificationLevel?: number,
|
|
23
24
|
/**
|
|
@@ -28,8 +29,10 @@ const props = defineProps<{
|
|
|
28
29
|
* 文件列表最大高度
|
|
29
30
|
*/
|
|
30
31
|
maxHeight?: string | number
|
|
31
|
-
}
|
|
32
|
-
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const props = defineProps<JaUploaderProps>();
|
|
35
|
+
const input = ref<InstanceType<typeof Uploader>>()
|
|
33
36
|
const model = inject('aceFormModel') as Record<string, any>
|
|
34
37
|
const prop = inject('aceFormItemProp') as string
|
|
35
38
|
const validator = inject('aceFormValidator') as ValidationInstance
|
|
@@ -53,9 +56,7 @@ watch(() => model.formData, () => {
|
|
|
53
56
|
})
|
|
54
57
|
|
|
55
58
|
defineExpose({
|
|
56
|
-
|
|
57
|
-
blur: () => input.value.blur(),
|
|
58
|
-
elSelect: input
|
|
59
|
+
uploader: input
|
|
59
60
|
})
|
|
60
61
|
</script>
|
|
61
62
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# JaUploader 上传组件
|
|
2
|
+
|
|
3
|
+
`JaUploader` 是基于 Uppy 的文件上传组件,集成了 `JaForm` 表单上下文注入。
|
|
4
|
+
|
|
5
|
+
## 组件用途
|
|
6
|
+
|
|
7
|
+
用于在 `JaForm` 中上传和管理文件附件。
|
|
8
|
+
|
|
9
|
+
## 属性 API
|
|
10
|
+
|
|
11
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
12
|
+
| :--- | :--- | :--- | :--- |
|
|
13
|
+
| `serviceName` | `string` | - | 应用服务名称 |
|
|
14
|
+
| `configKey` | `string` | - | 附件配置 Key |
|
|
15
|
+
| `attachToken` | `string` | - | 附件 Token |
|
|
16
|
+
| `classificationLevel` | `number` | - | 数据密级 |
|
|
17
|
+
| `height` | `string \| number` | - | 文件列表高度 |
|
|
18
|
+
| `maxHeight` | `string \| number` | - | 文件列表最大高度 |
|
|
19
|
+
|
|
20
|
+
## 使用示例
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<ja-uploader serviceName="my-app" configKey="default" />
|
|
24
|
+
```
|