rayyy-vue-table-components 1.2.19 → 1.2.21
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/index.es.js +5225 -5256
- package/dist/index.umd.js +11 -15
- package/dist/rayyy-vue-table-components.css +1 -1
- package/dist/src/components/index.d.ts +4 -1
- package/dist/src/components/layout/FunctionHeader.vue.d.ts +12 -2
- package/dist/src/types/components.d.ts +506 -29
- package/package.json +1 -1
- package/src/components/form/BaseForm.vue +5 -1
- package/src/components/form/BaseInput.vue +5 -1
- package/src/components/form/BaseMultipleInput.vue +5 -2
- package/src/components/form/BaseSelector.vue +5 -0
- package/src/components/index.ts +30 -0
- package/src/components/items/BaseBtn.vue +5 -1
- package/src/components/items/FilterBtn.vue +5 -2
- package/src/components/items/SearchBar.vue +5 -2
- package/src/components/layout/FunctionHeader.vue +11 -8
- package/src/types/components.d.ts +506 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends Record<string, unknown>">
|
|
2
|
-
import { computed, ref } from 'vue'
|
|
2
|
+
import { computed, ref, useAttrs } from 'vue'
|
|
3
3
|
import type { FormInstance, FormRules } from 'element-plus'
|
|
4
4
|
|
|
5
5
|
type Props<T extends object = object> = {
|
|
@@ -10,6 +10,9 @@ type Props<T extends object = object> = {
|
|
|
10
10
|
}
|
|
11
11
|
const props = withDefaults(defineProps<Props>(), {})
|
|
12
12
|
|
|
13
|
+
// 獲取所有非 props 屬性
|
|
14
|
+
const attrs = useAttrs()
|
|
15
|
+
|
|
13
16
|
const computedLabelWidth = computed(() => {
|
|
14
17
|
if (props.labelWidth) return props.labelWidth
|
|
15
18
|
else return '100px'
|
|
@@ -47,6 +50,7 @@ defineExpose({
|
|
|
47
50
|
|
|
48
51
|
<template>
|
|
49
52
|
<el-form
|
|
53
|
+
v-bind="attrs"
|
|
50
54
|
ref="formRef"
|
|
51
55
|
:model="formData"
|
|
52
56
|
:label-width="computedLabelWidth"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, useAttrs } from 'vue'
|
|
3
3
|
import { Search } from '@element-plus/icons-vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -20,6 +20,9 @@ const emits = defineEmits<{
|
|
|
20
20
|
(e: 'update:clearValue'): void
|
|
21
21
|
}>()
|
|
22
22
|
|
|
23
|
+
// 獲取所有非 props 屬性
|
|
24
|
+
const attrs = useAttrs()
|
|
25
|
+
|
|
23
26
|
const v = computed({
|
|
24
27
|
get: () => props.modelValue,
|
|
25
28
|
set: (val: string | number | null | undefined) => emits('update:modelValue', val),
|
|
@@ -31,6 +34,7 @@ const handlerClear = () => {
|
|
|
31
34
|
|
|
32
35
|
<template>
|
|
33
36
|
<el-input
|
|
37
|
+
v-bind="attrs"
|
|
34
38
|
v-model="v"
|
|
35
39
|
:placeholder="props.placeholder"
|
|
36
40
|
:type="props.type"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { ref } from 'vue'
|
|
3
|
+
import { ref, useAttrs } from 'vue'
|
|
4
4
|
import type { ElInput } from 'element-plus'
|
|
5
5
|
|
|
6
6
|
const inputValue = ref<string>('')
|
|
@@ -18,6 +18,9 @@ const props = withDefaults(
|
|
|
18
18
|
}
|
|
19
19
|
)
|
|
20
20
|
|
|
21
|
+
// 獲取所有非 props 屬性
|
|
22
|
+
const attrs = useAttrs()
|
|
23
|
+
|
|
21
24
|
const emits = defineEmits<{
|
|
22
25
|
(e: 'update:modelValue', val: string[]): void
|
|
23
26
|
(e: 'inputError'): void
|
|
@@ -60,7 +63,7 @@ const deleteLastTag = () => {
|
|
|
60
63
|
</script>
|
|
61
64
|
|
|
62
65
|
<template>
|
|
63
|
-
<div class="w-full border border-t rounded" @click="focusInput" >
|
|
66
|
+
<div v-bind="attrs" class="w-full border border-t rounded" @click="focusInput" >
|
|
64
67
|
<el-tag
|
|
65
68
|
v-for="(tag, position) in props.modelValue"
|
|
66
69
|
:key="tag"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-select
|
|
3
|
+
v-bind="attrs"
|
|
3
4
|
:model-value="modelValue"
|
|
4
5
|
:class="props.class"
|
|
5
6
|
:placeholder="props.placeholder"
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script lang="ts" setup>
|
|
21
|
+
import { useAttrs } from 'vue'
|
|
20
22
|
import type { ElOptions } from '@/types/OptionDto.ts'
|
|
21
23
|
|
|
22
24
|
export type Selection = string | string[]
|
|
@@ -42,6 +44,9 @@ const props = withDefaults(
|
|
|
42
44
|
},
|
|
43
45
|
)
|
|
44
46
|
|
|
47
|
+
// 獲取所有非 props 屬性
|
|
48
|
+
const attrs = useAttrs()
|
|
49
|
+
|
|
45
50
|
const emits = defineEmits<{
|
|
46
51
|
(e: 'update:modelValue', data?: Selection): void
|
|
47
52
|
}>()
|
package/src/components/index.ts
CHANGED
|
@@ -25,6 +25,33 @@ export type {
|
|
|
25
25
|
BaseDialogProps,
|
|
26
26
|
BaseDialogEmits,
|
|
27
27
|
BaseDialogInstance,
|
|
28
|
+
BaseInputProps,
|
|
29
|
+
BaseInputEmits,
|
|
30
|
+
BaseInputInstance,
|
|
31
|
+
FilterBtnProps,
|
|
32
|
+
FilterBtnEmits,
|
|
33
|
+
FilterBtnInstance,
|
|
34
|
+
BaseFormProps,
|
|
35
|
+
BaseFormEmits,
|
|
36
|
+
BaseFormInstance,
|
|
37
|
+
SortTableProps,
|
|
38
|
+
SortTableEmits,
|
|
39
|
+
SortTableInstance,
|
|
40
|
+
SearchBarProps,
|
|
41
|
+
SearchBarEmits,
|
|
42
|
+
SearchBarInstance,
|
|
43
|
+
TransferDialogProps,
|
|
44
|
+
TransferDialogEmits,
|
|
45
|
+
TransferDialogInstance,
|
|
46
|
+
TransferItemProps,
|
|
47
|
+
TransferItemEmits,
|
|
48
|
+
TransferItemInstance,
|
|
49
|
+
MainPanelProps,
|
|
50
|
+
MainPanelEmits,
|
|
51
|
+
MainPanelInstance,
|
|
52
|
+
FunctionHeaderProps,
|
|
53
|
+
FunctionHeaderEmits,
|
|
54
|
+
FunctionHeaderInstance,
|
|
28
55
|
PluginOptions,
|
|
29
56
|
VueTableComponentsPlugin,
|
|
30
57
|
} from '../types/components'
|
|
@@ -35,9 +62,12 @@ export type { default as BaseBtnType } from './items/BaseBtn.vue'
|
|
|
35
62
|
export type { default as BaseInputType } from './form/BaseInput.vue'
|
|
36
63
|
export type { default as FilterBtnType } from './items/FilterBtn.vue'
|
|
37
64
|
export type { default as BaseDialogType } from './items/BaseDialog.vue'
|
|
65
|
+
export type { default as BaseFormType } from './form/BaseForm.vue'
|
|
38
66
|
export type { default as SortTableType } from './tables/SortTable.vue'
|
|
39
67
|
export type { default as SearchBarType } from './items/SearchBar.vue'
|
|
40
68
|
export type { default as TransferDialogType } from './transfer/TransferDialog.vue'
|
|
41
69
|
export type { default as TransferItemType } from './transfer/transferItem.vue'
|
|
42
70
|
export type { default as SearchableListPanelType } from './layout/SearchableListPanel.vue'
|
|
43
71
|
export type { default as BaseMultipleInputType } from './form/BaseMultipleInput.vue'
|
|
72
|
+
export type { default as FunctionHeaderType } from './layout/FunctionHeader.vue'
|
|
73
|
+
export type { default as MainPanelType } from './layout/MainPanel.vue'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, useAttrs } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
text?: string
|
|
@@ -19,6 +19,9 @@ const emits = defineEmits<{
|
|
|
19
19
|
(e: 'click', evt: MouseEvent): void
|
|
20
20
|
}>()
|
|
21
21
|
|
|
22
|
+
// 獲取所有非 props 屬性
|
|
23
|
+
const attrs = useAttrs()
|
|
24
|
+
|
|
22
25
|
const click = (evt: MouseEvent) => {
|
|
23
26
|
emits('click', evt)
|
|
24
27
|
}
|
|
@@ -33,6 +36,7 @@ const buttonClass = computed(() => {
|
|
|
33
36
|
|
|
34
37
|
<template>
|
|
35
38
|
<el-button
|
|
39
|
+
v-bind="attrs"
|
|
36
40
|
:type="props.type"
|
|
37
41
|
:size="props.size"
|
|
38
42
|
:plain="props.plain"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref } from 'vue'
|
|
2
|
+
import { computed, ref, useAttrs } from 'vue'
|
|
3
3
|
import { useWindowSize } from '@vueuse/core'
|
|
4
4
|
import { BaseBtn } from '@/components'
|
|
5
5
|
import { Search, Filter } from '@element-plus/icons-vue'
|
|
@@ -10,6 +10,9 @@ defineProps<{
|
|
|
10
10
|
badgeValue?: number
|
|
11
11
|
}>()
|
|
12
12
|
|
|
13
|
+
// 獲取所有非 props 屬性
|
|
14
|
+
const attrs = useAttrs()
|
|
15
|
+
|
|
13
16
|
const showDrawer = ref(false)
|
|
14
17
|
|
|
15
18
|
function onClickBtn() {
|
|
@@ -40,7 +43,7 @@ const submitFilter = () => {
|
|
|
40
43
|
</script>
|
|
41
44
|
|
|
42
45
|
<template>
|
|
43
|
-
<base-btn type="primary" class="filter-btn" @click="onClickBtn">
|
|
46
|
+
<base-btn v-bind="attrs" type="primary" class="filter-btn" @click="onClickBtn">
|
|
44
47
|
<el-badge
|
|
45
48
|
:value="badgeValue"
|
|
46
49
|
class="!flex justify-center items-center"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ref } from 'vue'
|
|
2
|
+
import { ref, useAttrs } from 'vue'
|
|
3
3
|
import BaseInput from '../form/BaseInput.vue'
|
|
4
4
|
import FilterBtn from './FilterBtn.vue'
|
|
5
5
|
|
|
@@ -16,6 +16,9 @@ const emits = defineEmits<{
|
|
|
16
16
|
(e: 'update:resetFilter'): void
|
|
17
17
|
}>()
|
|
18
18
|
|
|
19
|
+
// 獲取所有非 props 屬性
|
|
20
|
+
const attrs = useAttrs()
|
|
21
|
+
|
|
19
22
|
const keyword = ref('')
|
|
20
23
|
|
|
21
24
|
const doSearch = () => {
|
|
@@ -30,7 +33,7 @@ const resetFilter = () => {
|
|
|
30
33
|
</script>
|
|
31
34
|
|
|
32
35
|
<template>
|
|
33
|
-
<div class="search-bar">
|
|
36
|
+
<div v-bind="attrs" class="search-bar">
|
|
34
37
|
<div class="search-bar-left">
|
|
35
38
|
<slot name="button" />
|
|
36
39
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useRouter, useRoute } from 'vue-router'
|
|
3
2
|
import { ArrowLeftBold } from '@element-plus/icons-vue'
|
|
4
|
-
import { extractSubRoutes } from '@/utils/routeFormatters.ts'
|
|
5
3
|
|
|
6
4
|
const props = defineProps({
|
|
7
5
|
title: { type: String, required: false, default: '' },
|
|
@@ -13,21 +11,26 @@ const props = defineProps({
|
|
|
13
11
|
depth: { type: Number, required: false, default: 1 },
|
|
14
12
|
})
|
|
15
13
|
|
|
16
|
-
const
|
|
17
|
-
|
|
14
|
+
const emit = defineEmits<{
|
|
15
|
+
back: [payload: { path?: string; [key: string]: unknown }]
|
|
16
|
+
}>()
|
|
18
17
|
|
|
19
18
|
const handleClick = () => {
|
|
20
|
-
const
|
|
19
|
+
const backPayload: { path?: string; [key: string]: unknown } = {}
|
|
20
|
+
|
|
21
21
|
switch (typeof props.showBack) {
|
|
22
22
|
case 'string':
|
|
23
|
-
|
|
23
|
+
backPayload.path = props.showBack
|
|
24
24
|
break
|
|
25
25
|
case 'object':
|
|
26
|
-
|
|
26
|
+
Object.assign(backPayload, props.showBack)
|
|
27
27
|
break
|
|
28
28
|
default:
|
|
29
|
-
|
|
29
|
+
// 當 showBack 為 true 時,發出預設的返回事件
|
|
30
|
+
backPayload.path = ''
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
emit('back', backPayload)
|
|
31
34
|
}
|
|
32
35
|
</script>
|
|
33
36
|
|