el-plus-crud 0.0.12 → 0.0.13

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +115 -3
  3. package/dist/el-plus-crud.mjs +6968 -6968
  4. package/dist/el-plus-crud.umd.js +27 -27
  5. package/dist/style.css +1 -1
  6. package/lib/components/el-plus-form/ElPlusFormDialog.vue +107 -107
  7. package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
  8. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
  9. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +51 -51
  10. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +42 -42
  11. package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +42 -42
  12. package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
  13. package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +44 -44
  14. package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +38 -38
  15. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
  16. package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +51 -51
  17. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
  18. package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
  19. package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
  20. package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +67 -67
  21. package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
  22. package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
  23. package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
  24. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +53 -53
  25. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +36 -36
  26. package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +2 -0
  27. package/lib/components/el-plus-form/components/index.ts +17 -17
  28. package/lib/components/el-plus-form/data/file.ts +74 -74
  29. package/lib/components/el-plus-form/mixins/index.ts +113 -113
  30. package/lib/components/el-plus-form/util/validate.ts +310 -310
  31. package/lib/components-list.ts +66 -66
  32. package/package.json +1 -1
@@ -1,113 +1,113 @@
1
- <template>
2
- <div class="ele-form-image">
3
- <template v-if="imagLIst && imagLIst.length > 0">
4
- <el-image v-for="(image, i) in imagLIst" :class="desc.class" :key="image" :preview-src-list="attrs.isShowPreview === false ? null : imagLIst" :initial-index="i" :src="format.imgUrl(image)" v-bind="attrs" :style="styles" v-on="onEvents" :fit="attrs.fit || 'cover'" />
5
- </template>
6
- <div v-else>
7
- <span class="no-img-tip">—</span>
8
- </div>
9
- </div>
10
- </template>
11
- <script lang="ts">
12
- export default {
13
- name: 'ElPlusFormImage',
14
- inheritAttrs: false,
15
- typeName: 'image',
16
- customOptions: {}
17
- }
18
- </script>
19
- <script lang="ts" setup>
20
- import { ref, computed, useAttrs, onBeforeMount, inject } from 'vue'
21
- import { getAttrs, getEvents } from '../mixins'
22
-
23
- // 格式化
24
- const format = inject('format') as any
25
-
26
- const props = defineProps<{
27
- modelValue?: Array<any> | string | null
28
- field: string
29
- loading?: boolean
30
- desc: { [key: string]: any }
31
- formData: { [key: string]: any }
32
- }>()
33
-
34
- const attrs = ref({} as any)
35
- const onEvents = ref(getEvents(props))
36
-
37
- onBeforeMount(async () => {
38
- attrs.value = await getAttrs(props, { isShowPreview: true, previewTeleported: true, ...useAttrs() })
39
- })
40
-
41
- const imagLIst = computed(() => {
42
- if (!props.modelValue) {
43
- return []
44
- }
45
- if (Array.isArray(props.modelValue)) {
46
- if (typeof props.modelValue[0] === 'string') {
47
- return props.modelValue
48
- } else {
49
- return props.modelValue.map((item) => item.shareUrl || item.furl)
50
- }
51
- } else if (typeof props.modelValue === 'string') {
52
- return props.modelValue.split(',').map((url) => format.imgUrl(url))
53
- } else {
54
- // console.log('unknown image Type.....')
55
- }
56
- return []
57
- })
58
-
59
- /**
60
- * 格式化样式
61
- * large,default,small
62
- */
63
- const styles = computed(() => {
64
- let width = ''
65
- let height = ''
66
- let size = props.desc.size || 'default'
67
- switch (size) {
68
- case 'large':
69
- width = '44px'
70
- height = '44px'
71
- break
72
- case 'default':
73
- width = '36px'
74
- height = '36px'
75
- break
76
- case 'small':
77
- width = '28px'
78
- height = '28px'
79
- break
80
- default:
81
- width = parseInt(size) + 'px'
82
- height = parseInt(size) + 'px'
83
- break
84
- }
85
- return Object.assign({}, props.desc.style, { width, height, 'max-width': width })
86
- })
87
- </script>
88
- <style lang="scss">
89
- .ele-form-image {
90
- display: flex;
91
- // justify-content: center;
92
- flex-wrap: wrap;
93
-
94
- .no-img-tip {
95
- color: #999999;
96
- }
97
-
98
- .el-image {
99
- margin-left: 10px;
100
- margin-bottom: 10px;
101
- }
102
- }
103
-
104
- .ele-form-image .el-image {
105
- border-radius: 5px;
106
- margin-bottom: 10px;
107
-
108
- .el-image__error {
109
- font-size: 12px;
110
- line-height: 13px;
111
- }
112
- }
113
- </style>
1
+ <template>
2
+ <div class="ele-form-image">
3
+ <template v-if="imagLIst && imagLIst.length > 0">
4
+ <el-image v-for="(image, i) in imagLIst" :class="desc.class" :key="image" :preview-src-list="attrs.isShowPreview === false ? null : imagLIst" :initial-index="i" :src="format.imgUrl(image)" v-bind="attrs" :style="styles" v-on="onEvents" :fit="attrs.fit || 'cover'" />
5
+ </template>
6
+ <div v-else>
7
+ <span class="no-img-tip">—</span>
8
+ </div>
9
+ </div>
10
+ </template>
11
+ <script lang="ts">
12
+ export default {
13
+ name: 'ElPlusFormImage',
14
+ inheritAttrs: false,
15
+ typeName: 'image',
16
+ customOptions: {}
17
+ }
18
+ </script>
19
+ <script lang="ts" setup>
20
+ import { ref, computed, useAttrs, onBeforeMount, inject } from 'vue'
21
+ import { getAttrs, getEvents } from '../mixins'
22
+
23
+ // 格式化
24
+ const format = inject('format') as any
25
+
26
+ const props = defineProps<{
27
+ modelValue?: Array<any> | string | null
28
+ field: string
29
+ loading?: boolean
30
+ desc: { [key: string]: any }
31
+ formData: { [key: string]: any }
32
+ }>()
33
+
34
+ const attrs = ref({} as any)
35
+ const onEvents = ref(getEvents(props))
36
+
37
+ onBeforeMount(async () => {
38
+ attrs.value = await getAttrs(props, { isShowPreview: true, previewTeleported: true, ...useAttrs() })
39
+ })
40
+
41
+ const imagLIst = computed(() => {
42
+ if (!props.modelValue) {
43
+ return []
44
+ }
45
+ if (Array.isArray(props.modelValue)) {
46
+ if (typeof props.modelValue[0] === 'string') {
47
+ return props.modelValue
48
+ } else {
49
+ return props.modelValue.map((item) => item.shareUrl || item.furl)
50
+ }
51
+ } else if (typeof props.modelValue === 'string') {
52
+ return props.modelValue.split(',').map((url) => format.imgUrl(url))
53
+ } else {
54
+ // console.log('unknown image Type.....')
55
+ }
56
+ return []
57
+ })
58
+
59
+ /**
60
+ * 格式化样式
61
+ * large,default,small
62
+ */
63
+ const styles = computed(() => {
64
+ let width = ''
65
+ let height = ''
66
+ let size = props.desc.size || 'default'
67
+ switch (size) {
68
+ case 'large':
69
+ width = '44px'
70
+ height = '44px'
71
+ break
72
+ case 'default':
73
+ width = '36px'
74
+ height = '36px'
75
+ break
76
+ case 'small':
77
+ width = '28px'
78
+ height = '28px'
79
+ break
80
+ default:
81
+ width = parseInt(size) + 'px'
82
+ height = parseInt(size) + 'px'
83
+ break
84
+ }
85
+ return Object.assign({}, props.desc.style, { width, height, 'max-width': width })
86
+ })
87
+ </script>
88
+ <style lang="scss">
89
+ .ele-form-image {
90
+ display: flex;
91
+ // justify-content: center;
92
+ flex-wrap: wrap;
93
+
94
+ .no-img-tip {
95
+ color: #999999;
96
+ }
97
+
98
+ .el-image {
99
+ margin-left: 10px;
100
+ margin-bottom: 10px;
101
+ }
102
+ }
103
+
104
+ .ele-form-image .el-image {
105
+ border-radius: 5px;
106
+ margin-bottom: 10px;
107
+
108
+ .el-image__error {
109
+ font-size: 12px;
110
+ line-height: 13px;
111
+ }
112
+ }
113
+ </style>
@@ -1,51 +1,51 @@
1
- <template>
2
- <el-input :class="desc.class" :style="desc.style" :clearable="attrs.clearable ?? true" type="number" v-bind="attrs" v-on="onEvents" v-model="currentValue">
3
- <template v-for="(item, key, index) of slots" #[key] :key="index">
4
- <slot :name="key" />
5
- </template>
6
- <template v-if="desc.rtext" #append>{{ desc.rtext.text }}</template>
7
- </el-input>
8
- </template>
9
- <script lang="ts">
10
- export default {
11
- name: 'ElPlusFormNbinput',
12
- inheritAttrs: false,
13
- typeName: 'nbinput',
14
- customOptions: {}
15
- }
16
- </script>
17
- <script lang="ts" setup>
18
- import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
19
- import { getAttrs, getEvents } from '../mixins'
20
-
21
- const props = defineProps<{
22
- modelValue?: string | number | '' | null
23
- field: string
24
- loading?: boolean
25
- desc: { [key: string]: any }
26
- formData: { [key: string]: any }
27
- rowIndex?: number
28
- }>()
29
- const emits = defineEmits(['update:modelValue'])
30
- const currentValue = ref(props.modelValue)
31
- emits('update:modelValue', currentValue)
32
-
33
- const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
34
- const attrs = ref({} as any)
35
- const onEvents = ref(getEvents(props))
36
-
37
- onBeforeMount(async () => {
38
- attrs.value = await getAttrs(props, { ...useAttrs() })
39
- })
40
- </script>
41
- <style lang="scss">
42
- /*input输入框屏蔽浏览器出现上下箭头*/
43
- input::-webkit-outer-spin-button,
44
- input::-webkit-inner-spin-button {
45
- -webkit-appearance: none;
46
- }
47
-
48
- input[type='number'] {
49
- -moz-appearance: textfield;
50
- }
51
- </style>
1
+ <template>
2
+ <el-input :class="desc.class" :style="desc.style" :clearable="attrs.clearable ?? true" type="number" v-bind="attrs" v-on="onEvents" v-model="currentValue">
3
+ <template v-for="(item, key, index) of slots" #[key] :key="index">
4
+ <slot :name="key" />
5
+ </template>
6
+ <template v-if="desc.rtext" #append>{{ desc.rtext.text }}</template>
7
+ </el-input>
8
+ </template>
9
+ <script lang="ts">
10
+ export default {
11
+ name: 'ElPlusFormNbinput',
12
+ inheritAttrs: false,
13
+ typeName: 'nbinput',
14
+ customOptions: {}
15
+ }
16
+ </script>
17
+ <script lang="ts" setup>
18
+ import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
19
+ import { getAttrs, getEvents } from '../mixins'
20
+
21
+ const props = defineProps<{
22
+ modelValue?: string | number | '' | null
23
+ field: string
24
+ loading?: boolean
25
+ desc: { [key: string]: any }
26
+ formData: { [key: string]: any }
27
+ rowIndex?: number
28
+ }>()
29
+ const emits = defineEmits(['update:modelValue'])
30
+ const currentValue = ref(props.modelValue)
31
+ emits('update:modelValue', currentValue)
32
+
33
+ const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
34
+ const attrs = ref({} as any)
35
+ const onEvents = ref(getEvents(props))
36
+
37
+ onBeforeMount(async () => {
38
+ attrs.value = await getAttrs(props, { ...useAttrs() })
39
+ })
40
+ </script>
41
+ <style lang="scss">
42
+ /*input输入框屏蔽浏览器出现上下箭头*/
43
+ input::-webkit-outer-spin-button,
44
+ input::-webkit-inner-spin-button {
45
+ -webkit-appearance: none;
46
+ }
47
+
48
+ input[type='number'] {
49
+ -moz-appearance: textfield;
50
+ }
51
+ </style>
@@ -1,42 +1,42 @@
1
- <template>
2
- <el-radio-group class="ElPlusFormRadio-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
3
- <el-radio v-for="option of attrs.options" :key="option.value" :label="option.value">
4
- {{ option.l || option.label }}
5
- </el-radio>
6
- </el-radio-group>
7
- </template>
8
- <script lang="ts">
9
- export default {
10
- name: 'ElPlusFormRadio',
11
- inheritAttrs: false,
12
- typeName: 'radio',
13
- customOptions: {}
14
- }
15
- </script>
16
- <script lang="ts" setup>
17
- import { ref, useAttrs, onBeforeMount } from 'vue'
18
- import { getAttrs, getEvents } from '../mixins'
19
-
20
- const props = defineProps<{
21
- modelValue?: string | number | '' | null
22
- field: string
23
- desc: { [key: string]: any }
24
- formData: { [key: string]: any }
25
- }>()
26
-
27
- const emits = defineEmits(['update:modelValue'])
28
- const currentValue = ref(props.modelValue)
29
- emits('update:modelValue', currentValue)
30
-
31
- const attrs = ref({} as any)
32
- const onEvents = ref(getEvents(props))
33
-
34
- onBeforeMount(async () => {
35
- attrs.value = await getAttrs(props, { ...useAttrs() })
36
- })
37
- </script>
38
- <style lang="scss" scoped>
39
- .ElPlusFormRadio-panel {
40
- display: flex;
41
- }
42
- </style>
1
+ <template>
2
+ <el-radio-group class="ElPlusFormRadio-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
3
+ <el-radio v-for="option of attrs.options" :key="option.value" :label="option.value">
4
+ {{ option.l || option.label }}
5
+ </el-radio>
6
+ </el-radio-group>
7
+ </template>
8
+ <script lang="ts">
9
+ export default {
10
+ name: 'ElPlusFormRadio',
11
+ inheritAttrs: false,
12
+ typeName: 'radio',
13
+ customOptions: {}
14
+ }
15
+ </script>
16
+ <script lang="ts" setup>
17
+ import { ref, useAttrs, onBeforeMount } from 'vue'
18
+ import { getAttrs, getEvents } from '../mixins'
19
+
20
+ const props = defineProps<{
21
+ modelValue?: string | number | '' | null
22
+ field: string
23
+ desc: { [key: string]: any }
24
+ formData: { [key: string]: any }
25
+ }>()
26
+
27
+ const emits = defineEmits(['update:modelValue'])
28
+ const currentValue = ref(props.modelValue)
29
+ emits('update:modelValue', currentValue)
30
+
31
+ const attrs = ref({} as any)
32
+ const onEvents = ref(getEvents(props))
33
+
34
+ onBeforeMount(async () => {
35
+ attrs.value = await getAttrs(props, { ...useAttrs() })
36
+ })
37
+ </script>
38
+ <style lang="scss" scoped>
39
+ .ElPlusFormRadio-panel {
40
+ display: flex;
41
+ }
42
+ </style>
@@ -1,38 +1,38 @@
1
- <template>
2
- <el-rate class="ElPlusFormRate-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
3
- </template>
4
- <script lang="ts">
5
- export default {
6
- name: 'ElPlusFormRate',
7
- inheritAttrs: false,
8
- typeName: 'rate',
9
- customOptions: {}
10
- }
11
- </script>
12
- <script lang="ts" setup>
13
- import { ref, useAttrs, onBeforeMount } from 'vue'
14
- import { getAttrs, getEvents } from '../mixins'
15
-
16
- const props = defineProps<{
17
- modelValue?: string | number | '' | null
18
- field: string
19
- desc: { [key: string]: any }
20
- formData: { [key: string]: any }
21
- }>()
22
-
23
- const emits = defineEmits(['update:modelValue'])
24
- const currentValue = ref(props.modelValue)
25
- emits('update:modelValue', currentValue)
26
-
27
- const attrs = ref({} as any)
28
- const onEvents = ref(getEvents(props))
29
-
30
- onBeforeMount(async () => {
31
- attrs.value = await getAttrs(props, { ...useAttrs() })
32
- })
33
- </script>
34
- <style lang="scss" scoped>
35
- .ElPlusFormRate-panel {
36
- display: flex;
37
- }
38
- </style>
1
+ <template>
2
+ <el-rate class="ElPlusFormRate-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
3
+ </template>
4
+ <script lang="ts">
5
+ export default {
6
+ name: 'ElPlusFormRate',
7
+ inheritAttrs: false,
8
+ typeName: 'rate',
9
+ customOptions: {}
10
+ }
11
+ </script>
12
+ <script lang="ts" setup>
13
+ import { ref, useAttrs, onBeforeMount } from 'vue'
14
+ import { getAttrs, getEvents } from '../mixins'
15
+
16
+ const props = defineProps<{
17
+ modelValue?: string | number | '' | null
18
+ field: string
19
+ desc: { [key: string]: any }
20
+ formData: { [key: string]: any }
21
+ }>()
22
+
23
+ const emits = defineEmits(['update:modelValue'])
24
+ const currentValue = ref(props.modelValue)
25
+ emits('update:modelValue', currentValue)
26
+
27
+ const attrs = ref({} as any)
28
+ const onEvents = ref(getEvents(props))
29
+
30
+ onBeforeMount(async () => {
31
+ attrs.value = await getAttrs(props, { ...useAttrs() })
32
+ })
33
+ </script>
34
+ <style lang="scss" scoped>
35
+ .ElPlusFormRate-panel {
36
+ display: flex;
37
+ }
38
+ </style>
@@ -1,38 +1,38 @@
1
- <template>
2
- <el-slider class="ElPlusFormSlider-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
3
- </template>
4
- <script lang="ts">
5
- export default {
6
- name: 'ElPlusFormSlider',
7
- inheritAttrs: false,
8
- typeName: 'slider',
9
- customOptions: {}
10
- }
11
- </script>
12
- <script lang="ts" setup>
13
- import { ref, useAttrs, onBeforeMount } from 'vue'
14
- import { getAttrs, getEvents } from '../mixins'
15
-
16
- const props = defineProps<{
17
- modelValue?: string | number | '' | null
18
- field: string
19
- desc: { [key: string]: any }
20
- formData: { [key: string]: any }
21
- }>()
22
-
23
- const emits = defineEmits(['update:modelValue'])
24
- const currentValue = ref(props.modelValue)
25
- emits('update:modelValue', currentValue)
26
-
27
- const attrs = ref({} as any)
28
- const onEvents = ref(getEvents(props))
29
-
30
- onBeforeMount(async () => {
31
- attrs.value = await getAttrs(props, { ...useAttrs() })
32
- })
33
- </script>
34
- <style lang="scss" scoped>
35
- .ElPlusFormSlider-panel {
36
- display: flex;
37
- }
38
- </style>
1
+ <template>
2
+ <el-slider class="ElPlusFormSlider-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue" />
3
+ </template>
4
+ <script lang="ts">
5
+ export default {
6
+ name: 'ElPlusFormSlider',
7
+ inheritAttrs: false,
8
+ typeName: 'slider',
9
+ customOptions: {}
10
+ }
11
+ </script>
12
+ <script lang="ts" setup>
13
+ import { ref, useAttrs, onBeforeMount } from 'vue'
14
+ import { getAttrs, getEvents } from '../mixins'
15
+
16
+ const props = defineProps<{
17
+ modelValue?: string | number | '' | null
18
+ field: string
19
+ desc: { [key: string]: any }
20
+ formData: { [key: string]: any }
21
+ }>()
22
+
23
+ const emits = defineEmits(['update:modelValue'])
24
+ const currentValue = ref(props.modelValue)
25
+ emits('update:modelValue', currentValue)
26
+
27
+ const attrs = ref({} as any)
28
+ const onEvents = ref(getEvents(props))
29
+
30
+ onBeforeMount(async () => {
31
+ attrs.value = await getAttrs(props, { ...useAttrs() })
32
+ })
33
+ </script>
34
+ <style lang="scss" scoped>
35
+ .ElPlusFormSlider-panel {
36
+ display: flex;
37
+ }
38
+ </style>