@vrojs/element-plus 0.0.16 → 0.0.17
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.js +24 -26
- package/dist/style/index.css +1 -1
- package/dist/vro-el-table/index.d.ts +0 -1
- package/dist/vro-el-table/index.js +7 -9
- package/dist/vro-el-table/useVroElTable.d.ts +24 -27
- package/dist/vro-el-table/useVroElTable.js +24 -29
- package/dist/vro-el-table-actions-column/index.d.ts +15 -0
- package/dist/vro-el-table-actions-column/types.d.ts +17 -13
- package/dist/vro-el-table-actions-column/types.js +9 -2
- package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.d.ts +9 -0
- package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.js +51 -54
- package/dist/vro-el-table-column/index.d.ts +6 -6
- package/dist/vro-el-table-column/style/index.css +1 -1
- package/dist/vro-el-table-column/types.d.ts +21 -10
- package/dist/vro-el-table-column/types.js +8 -8
- package/dist/vro-el-table-column/vro-el-table-column.vue.d.ts +4 -4
- package/dist/vro-el-table-column/vro-el-table-column.vue.js +48 -46
- package/dist/vro-el-table-column-group/types.d.ts +5 -6
- package/package.json +2 -2
- package/dist/vro-el-table/createUseVroElTable.d.ts +0 -10
- package/dist/vro-el-table/createUseVroElTable.js +0 -7
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { VroElImage as P } from "./vro-el-image/index.js";
|
|
|
12
12
|
import { VroElImageUpload as d } from "./vro-el-image-upload/index.js";
|
|
13
13
|
import { VroElRadioGroup as b } from "./vro-el-radio-group/index.js";
|
|
14
14
|
import { VroElSchemaFilter as D } from "./vro-el-schema-filter/index.js";
|
|
15
|
-
import { VroElSchemaForm as
|
|
15
|
+
import { VroElSchemaForm as w } from "./vro-el-schema-form/index.js";
|
|
16
16
|
import { VroElSchemaFormDialog as O } from "./vro-el-schema-form-dialog/index.js";
|
|
17
17
|
import { VroElSchemaFormDrawer as y } from "./vro-el-schema-form-drawer/index.js";
|
|
18
18
|
import { VroElSelect as j } from "./vro-el-select/index.js";
|
|
@@ -35,7 +35,7 @@ import { getVroElImageOptions as Fo, setVroElImageOptions as ho } from "./vro-el
|
|
|
35
35
|
import { vroElImageUploadProps as Po } from "./vro-el-image-upload/types.js";
|
|
36
36
|
import { getVroElImageUploadOptions as To, setVroElImageUploadOptions as bo } from "./vro-el-image-upload/utils.js";
|
|
37
37
|
import { vroElRadioGroupProps as Do } from "./vro-el-radio-group/types.js";
|
|
38
|
-
import { vroElSchemaFilterProps as
|
|
38
|
+
import { vroElSchemaFilterProps as wo } from "./vro-el-schema-filter/types.js";
|
|
39
39
|
import { defineVroElSchemaFormCreateField as Oo } from "./vro-el-schema-form/defineVroElSchemaFormCreateField.js";
|
|
40
40
|
import { defineVroElSchemaFormFieldTrigger as yo } from "./vro-el-schema-form/defineVroElSchemaFormFieldTrigger.js";
|
|
41
41
|
import { vroElSchemaFormProps as jo } from "./vro-el-schema-form/types.js";
|
|
@@ -51,17 +51,16 @@ import { vroElSchemaFormDrawerProps as er } from "./vro-el-schema-form-drawer/ty
|
|
|
51
51
|
import { useVroElSchemaFormDrawer as mr } from "./vro-el-schema-form-drawer/useVroElSchemaFormDrawer.js";
|
|
52
52
|
import { vroElSelectProps as tr } from "./vro-el-select/types.js";
|
|
53
53
|
import { vroElSkeletonProps as fr } from "./vro-el-skeleton/types.js";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import { vroElWithConfigProps as Ur } from "./vro-el-with-config/types.js";
|
|
54
|
+
import { vroElTableProps as Er } from "./vro-el-table/types.js";
|
|
55
|
+
import { useVroElTable as ir } from "./vro-el-table/useVroElTable.js";
|
|
56
|
+
import { vroElTableActionsColumnProps as Vr } from "./vro-el-table-actions-column/types.js";
|
|
57
|
+
import { vroElTableColumnProps as gr } from "./vro-el-table-column/types.js";
|
|
58
|
+
import { vroElTableColumnGroupProps as vr } from "./vro-el-table-column-group/types.js";
|
|
59
|
+
import { useVroElTableColumnGroup as hr } from "./vro-el-table-column-group/useVroElTableColumnGroup.js";
|
|
60
|
+
import { vroElTableColumnGroupColumnManager as Pr } from "./vro-el-table-column-group/vroElTableColumnGroupColumnManager.js";
|
|
61
|
+
import { vroElTagsProps as dr } from "./vro-el-tags/types.js";
|
|
62
|
+
import { vroElTreeProps as br } from "./vro-el-tree/types.js";
|
|
63
|
+
import { vroElWithConfigProps as Dr } from "./vro-el-with-config/types.js";
|
|
65
64
|
export {
|
|
66
65
|
V as VroElCheckboxGroup,
|
|
67
66
|
g as VroElConfigProvider,
|
|
@@ -71,7 +70,7 @@ export {
|
|
|
71
70
|
d as VroElImageUpload,
|
|
72
71
|
b as VroElRadioGroup,
|
|
73
72
|
D as VroElSchemaFilter,
|
|
74
|
-
|
|
73
|
+
w as VroElSchemaForm,
|
|
75
74
|
O as VroElSchemaFormDialog,
|
|
76
75
|
y as VroElSchemaFormDrawer,
|
|
77
76
|
j as VroElSelect,
|
|
@@ -83,7 +82,6 @@ export {
|
|
|
83
82
|
Q as VroElTags,
|
|
84
83
|
Y as VroElTree,
|
|
85
84
|
_ as VroElWithConfig,
|
|
86
|
-
Er as createUseVroElTable,
|
|
87
85
|
f as datePickerValueFormat,
|
|
88
86
|
Oo as defineVroElSchemaFormCreateField,
|
|
89
87
|
yo as defineVroElSchemaFormFieldTrigger,
|
|
@@ -108,8 +106,8 @@ export {
|
|
|
108
106
|
qo as useVroElSchemaFormDialogInstance,
|
|
109
107
|
mr as useVroElSchemaFormDrawer,
|
|
110
108
|
$o as useVroElSchemaFormDrawerInstance,
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
ir as useVroElTable,
|
|
110
|
+
hr as useVroElTableColumnGroup,
|
|
113
111
|
oo as vroElCheckboxGroupProps,
|
|
114
112
|
to as vroElConfigContextKey,
|
|
115
113
|
fo as vroElConfigProviderProps,
|
|
@@ -118,7 +116,7 @@ export {
|
|
|
118
116
|
uo as vroElImageProps,
|
|
119
117
|
Po as vroElImageUploadProps,
|
|
120
118
|
Do as vroElRadioGroupProps,
|
|
121
|
-
|
|
119
|
+
wo as vroElSchemaFilterProps,
|
|
122
120
|
Bo as vroElSchemaFormDialogInjectionKey,
|
|
123
121
|
Jo as vroElSchemaFormDialogProps,
|
|
124
122
|
or as vroElSchemaFormDrawerInjectionKey,
|
|
@@ -127,13 +125,13 @@ export {
|
|
|
127
125
|
jo as vroElSchemaFormProps,
|
|
128
126
|
tr as vroElSelectProps,
|
|
129
127
|
fr as vroElSkeletonProps,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
Vr as vroElTableActionsColumnProps,
|
|
129
|
+
Pr as vroElTableColumnGroupColumnManager,
|
|
130
|
+
vr as vroElTableColumnGroupProps,
|
|
131
|
+
gr as vroElTableColumnProps,
|
|
132
|
+
Er as vroElTableProps,
|
|
133
|
+
dr as vroElTagsProps,
|
|
134
|
+
br as vroElTreeProps,
|
|
135
|
+
Dr as vroElWithConfigProps,
|
|
138
136
|
m as zhCN
|
|
139
137
|
};
|
package/dist/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";:root,:host{--vro-el-file-upload-gap: 8px;--vro-el-file-upload-item-font-size: 14px;--vro-el-file-upload-item-line-height: 1.5;--vro-el-file-upload-link-color: var(--el-color-primary);--vro-el-file-upload-clear-gap: 10px;--vro-el-file-upload-clear-color: var(--el-color-danger);--vro-el-file-upload-clear-background: var(--el-fill-color-light)}.vro-el-file-upload-btn{position:relative}.vro-el-file-upload-btn input{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}.vro-el-file-upload-content{padding:0;margin:var(--vro-el-file-upload-gap) 0 0;list-style:none}.vro-el-file-upload-item{position:relative;box-sizing:border-box;display:flex;align-items:center;margin-top:var(--vro-el-file-upload-gap);font-size:var(--vro-el-file-upload-item-font-size);line-height:var(--vro-el-file-upload-item-line-height)}.vro-el-file-upload-item a{min-width:0;margin-right:var(--vro-el-file-upload-clear-gap);color:var(--vro-el-file-upload-link-color);text-decoration:underline;word-break:break-all}.vro-el-file-upload-clear{flex:none;color:var(--vro-el-file-upload-clear-color);background-color:var(--vro-el-file-upload-clear-background);cursor:pointer}:root,:host{--vro-el-image-placeholder-background: var(--el-fill-color-light);--vro-el-image-loading-color: var(--el-text-color-placeholder);--vro-el-image-loading-size: 16px;--vro-el-image-error-background: var(--el-fill-color-light);--vro-el-image-error-color: var(--el-text-color-placeholder);--vro-el-image-error-icon-size: 24px}.vro-el-image-placeholder,.vro-el-image-error{display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden}.vro-el-image-placeholder{--vro-loading-color: var(--vro-el-image-loading-color);--vro-loading-size: var(--vro-el-image-loading-size);background-color:var(--vro-el-image-placeholder-background)}.vro-el-image-error{color:var(--vro-el-image-error-color);background-color:var(--vro-el-image-error-background)}.vro-el-image-error-icon{font-size:var(--vro-el-image-error-icon-size)}:root,:host{--vro-el-image-upload-gap: 10px;--vro-el-image-upload-item-size: 100px;--vro-el-image-upload-item-radius: 4px;--vro-el-image-upload-item-border-color: var(--el-border-color);--vro-el-image-upload-item-icon-size: 24px;--vro-el-image-upload-checkerboard-size: 8px;--vro-el-image-upload-clear-size: 20px;--vro-el-image-upload-clear-color: #fff;--vro-el-image-upload-clear-background: var(--el-color-danger)}.vro-el-image-upload-content{display:flex;flex-wrap:wrap;margin-top:calc(var(--vro-el-image-upload-gap) * -1)}.vro-el-image-upload-item{cursor:pointer;position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:var(--vro-el-image-upload-item-size);height:var(--vro-el-image-upload-item-size);margin-top:var(--vro-el-image-upload-gap);margin-right:var(--vro-el-image-upload-gap);font-size:var(--vro-el-image-upload-item-icon-size);border:1px dashed var(--vro-el-image-upload-item-border-color);border-radius:var(--vro-el-image-upload-item-radius)}.vro-el-image-upload-item .vro-el-image-upload-image,.vro-el-image-upload-item img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:center;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFyMjI////1tbWF77ztQAAABZJREFUeJxjYGAIDWUggggNbWAgggAA918Ooanz2WEAAAAASUVORK5CYII=) center!important;background-size:var(--vro-el-image-upload-checkerboard-size)!important;border-radius:var(--vro-el-image-upload-item-radius);transform:translateZ(0)}.vro-el-image-upload-item input{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--vro-el-image-upload-item-radius);opacity:0}.vro-el-image-upload-clear{position:absolute;top:-6px;right:-6px;color:var(--vro-el-image-upload-clear-color);font-size:var(--vro-el-image-upload-clear-size);background:var(--vro-el-image-upload-clear-background);border-radius:50%;cursor:pointer}:root,:host{--vro-el-schema-filter-padding: 0 16px 16px;--vro-el-schema-filter-background: var(--el-bg-color);--vro-el-schema-filter-col-margin-top: 16px}.vro-el-schema-filter{display:block;box-sizing:border-box;overflow:hidden;padding:var(--vro-el-schema-filter-padding);background-color:var(--vro-el-schema-filter-background)}.vro-el-schema-filter .el-form-item__label{display:flex;align-items:center;text-align:right;line-height:1.1;margin-bottom:0}.vro-el-schema-filter .el-form-item{margin-bottom:0}.vro-el-schema-filter .el-col{margin-top:var(--vro-el-schema-filter-col-margin-top)}.vro-el-schema-form{display:block;width:100%}.vro-el-schema-form .el-date-editor{--el-date-editor-width: 100%}.vro-el-schema-form .el-cascader,.vro-el-schema-form .el-input-number.is-controls-right{width:100%}:root,:host{--vro-el-schema-form-dialog-width: 520px}.vro-el-schema-form-dialog{--el-dialog-width: var(--vro-el-schema-form-dialog-width);width:var(--el-dialog-width)}:root,:host{--vro-el-schema-form-drawer-padding: 20px;--vro-el-schema-form-drawer-border-color: var(--el-border-color);--vro-el-schema-form-drawer-size: 520px}.vro-el-schema-form-drawer .el-drawer__header{margin-bottom:0;border-bottom:1px solid var(--vro-el-schema-form-drawer-border-color);padding:var(--vro-el-schema-form-drawer-padding)}.vro-el-schema-form-drawer .el-drawer__body{min-width:0;overflow-y:auto}.vro-el-schema-form-drawer .el-drawer__footer{padding:var(--vro-el-schema-form-drawer-padding);border-top:1px solid var(--vro-el-schema-form-drawer-border-color)}.vro-el-schema-form-drawer-footer{display:flex;justify-content:flex-end}:root,:host{--vro-el-skeleton-min-height: 240px;--vro-el-skeleton-color: var(--el-text-color-secondary);--vro-el-skeleton-description-margin-top: 16px;--vro-el-skeleton-description-color: var(--el-text-color-secondary);--vro-el-skeleton-description-font-size: var(--el-font-size-base);--vro-el-skeleton-description-line-height: 1.5}.vro-el-skeleton{width:100%;min-height:var(--vro-el-skeleton-min-height)}.vro-el-skeleton-state{display:flex;align-items:center;justify-content:center;width:100%;min-height:inherit}.vro-el-skeleton-loading{flex-direction:column;color:var(--vro-el-skeleton-color)}.vro-el-skeleton-description{margin:var(--vro-el-skeleton-description-margin-top) 0 0;color:var(--vro-el-skeleton-description-color);font-size:var(--vro-el-skeleton-description-font-size);line-height:var(--vro-el-skeleton-description-line-height);text-align:center}:root,:host{--vro-el-table-gap: 16px;--vro-el-table-padding: 16px;--vro-el-table-inner-gap: var(--vro-el-table-gap)}.vro-el-table{display:flex;flex-direction:column;width:100%;box-sizing:border-box;gap:var(--vro-el-table-gap)}.vro-el-table .el-table-column--selection{line-height:normal}.vro-el-table .el-table__expand-icon{display:flex;align-items:center;justify-content:center}.vro-el-table-inner{flex:1;position:relative;background-color:var(--el-bg-color);padding:var(--vro-el-table-padding);display:flex;flex-direction:column;gap:var(--vro-el-table-inner-gap)}.vro-el-table-header{display:flex;align-items:center;flex-wrap:wrap}.vro-el-table-header h2{font-size:16px}.vro-el-table-actions{flex-shrink:0;margin-left:auto}.vro-el-table-content{flex:1}.vro-el-table-content .el-table{width:100%;--el-table-bg-color: transparent}.vro-el-table-content .el-table__header{--el-table-header-bg-color: var(--el-bg-color-page);--el-table-header-text-color: var(--el-text-color-primary)}.vro-el-table-content .el-table__body-wrapper .cell{line-height:1.4}.vro-el-table-content .el-table__body-wrapper strong{font-weight:700;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt{font-weight:700;margin-bottom:8px;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt:last-child{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper dl dd{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper dl dd:last-of-type{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper ul li{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper ul li:last-of-type{margin-bottom:0}.vro-el-table-pagination{justify-content:flex-end}:root,:host{--vro-el-table-actions-column-row-gap: 4px;--vro-el-table-actions-column-column-gap: 12px}.vro-el-table-actions-column-cell .cell{display:flex;flex-wrap:wrap;row-gap:var(--vro-el-table-actions-column-row-gap);column-gap:var(--vro-el-table-actions-column-column-gap)}.vro-el-table-actions-column-cell .cell>.el-button+.el-button{margin-left:0}.vro-el-table-actions-column-dropdown-action.is-primary{color:var(--el-color-primary)}.vro-el-table-actions-column-dropdown-action.is-success{color:var(--el-color-success)}.vro-el-table-actions-column-dropdown-action.is-warning{color:var(--el-color-warning)}.vro-el-table-actions-column-dropdown-action.is-danger{color:var(--el-color-danger)}.vro-el-table-actions-column-dropdown-action.is-info{color:var(--el-color-info)}:root,:host{--vro-el-table-column-gap: 4px;--vro-el-table-column-icon-size: 14px;--vro-el-table-column-line-clamp: 1}.vro-el-table-column-content{display:inline-flex;width:100%;max-width:100%;min-width:0;align-items:center;gap:var(--vro-el-table-column-gap);vertical-align:middle}.vro-el-table-column-content.is-center{justify-content:center}.vro-el-table-column-content.is-right{justify-content:flex-end}.vro-el-table-column-content .vro-el-icon{flex:none;font-size:var(--vro-el-table-column-icon-size)}.vro-el-table-column-prefix,.vro-el-table-column-suffix{display:inline-flex;flex:none;min-width:0;align-items:center}.vro-el-table-column-text{flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vro-el-table-column-text.is-line-clamp{display:-webkit-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:var(--vro-el-table-column-line-clamp)}:root,:host{--vro-el-tags-gap: 8px;--vro-el-tags-input-width: 120px}.vro-el-tags{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vro-el-tags-gap)}.vro-el-tags-tag,.vro-el-tags-button{flex:none}.vro-el-tags-input{width:var(--vro-el-tags-input-width)}.vro-el-tree{width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}
|
|
1
|
+
@charset "UTF-8";:root,:host{--vro-el-file-upload-gap: 8px;--vro-el-file-upload-item-font-size: 14px;--vro-el-file-upload-item-line-height: 1.5;--vro-el-file-upload-link-color: var(--el-color-primary);--vro-el-file-upload-clear-gap: 10px;--vro-el-file-upload-clear-color: var(--el-color-danger);--vro-el-file-upload-clear-background: var(--el-fill-color-light)}.vro-el-file-upload-btn{position:relative}.vro-el-file-upload-btn input{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}.vro-el-file-upload-content{padding:0;margin:var(--vro-el-file-upload-gap) 0 0;list-style:none}.vro-el-file-upload-item{position:relative;box-sizing:border-box;display:flex;align-items:center;margin-top:var(--vro-el-file-upload-gap);font-size:var(--vro-el-file-upload-item-font-size);line-height:var(--vro-el-file-upload-item-line-height)}.vro-el-file-upload-item a{min-width:0;margin-right:var(--vro-el-file-upload-clear-gap);color:var(--vro-el-file-upload-link-color);text-decoration:underline;word-break:break-all}.vro-el-file-upload-clear{flex:none;color:var(--vro-el-file-upload-clear-color);background-color:var(--vro-el-file-upload-clear-background);cursor:pointer}:root,:host{--vro-el-image-placeholder-background: var(--el-fill-color-light);--vro-el-image-loading-color: var(--el-text-color-placeholder);--vro-el-image-loading-size: 16px;--vro-el-image-error-background: var(--el-fill-color-light);--vro-el-image-error-color: var(--el-text-color-placeholder);--vro-el-image-error-icon-size: 24px}.vro-el-image-placeholder,.vro-el-image-error{display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden}.vro-el-image-placeholder{--vro-loading-color: var(--vro-el-image-loading-color);--vro-loading-size: var(--vro-el-image-loading-size);background-color:var(--vro-el-image-placeholder-background)}.vro-el-image-error{color:var(--vro-el-image-error-color);background-color:var(--vro-el-image-error-background)}.vro-el-image-error-icon{font-size:var(--vro-el-image-error-icon-size)}:root,:host{--vro-el-image-upload-gap: 10px;--vro-el-image-upload-item-size: 100px;--vro-el-image-upload-item-radius: 4px;--vro-el-image-upload-item-border-color: var(--el-border-color);--vro-el-image-upload-item-icon-size: 24px;--vro-el-image-upload-checkerboard-size: 8px;--vro-el-image-upload-clear-size: 20px;--vro-el-image-upload-clear-color: #fff;--vro-el-image-upload-clear-background: var(--el-color-danger)}.vro-el-image-upload-content{display:flex;flex-wrap:wrap;margin-top:calc(var(--vro-el-image-upload-gap) * -1)}.vro-el-image-upload-item{cursor:pointer;position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:var(--vro-el-image-upload-item-size);height:var(--vro-el-image-upload-item-size);margin-top:var(--vro-el-image-upload-gap);margin-right:var(--vro-el-image-upload-gap);font-size:var(--vro-el-image-upload-item-icon-size);border:1px dashed var(--vro-el-image-upload-item-border-color);border-radius:var(--vro-el-image-upload-item-radius)}.vro-el-image-upload-item .vro-el-image-upload-image,.vro-el-image-upload-item img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:center;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFyMjI////1tbWF77ztQAAABZJREFUeJxjYGAIDWUggggNbWAgggAA918Ooanz2WEAAAAASUVORK5CYII=) center!important;background-size:var(--vro-el-image-upload-checkerboard-size)!important;border-radius:var(--vro-el-image-upload-item-radius);transform:translateZ(0)}.vro-el-image-upload-item input{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--vro-el-image-upload-item-radius);opacity:0}.vro-el-image-upload-clear{position:absolute;top:-6px;right:-6px;color:var(--vro-el-image-upload-clear-color);font-size:var(--vro-el-image-upload-clear-size);background:var(--vro-el-image-upload-clear-background);border-radius:50%;cursor:pointer}:root,:host{--vro-el-schema-filter-padding: 0 16px 16px;--vro-el-schema-filter-background: var(--el-bg-color);--vro-el-schema-filter-col-margin-top: 16px}.vro-el-schema-filter{display:block;box-sizing:border-box;overflow:hidden;padding:var(--vro-el-schema-filter-padding);background-color:var(--vro-el-schema-filter-background)}.vro-el-schema-filter .el-form-item__label{display:flex;align-items:center;text-align:right;line-height:1.1;margin-bottom:0}.vro-el-schema-filter .el-form-item{margin-bottom:0}.vro-el-schema-filter .el-col{margin-top:var(--vro-el-schema-filter-col-margin-top)}.vro-el-schema-form{display:block;width:100%}.vro-el-schema-form .el-date-editor{--el-date-editor-width: 100%}.vro-el-schema-form .el-cascader,.vro-el-schema-form .el-input-number.is-controls-right{width:100%}:root,:host{--vro-el-schema-form-dialog-width: 520px}.vro-el-schema-form-dialog{--el-dialog-width: var(--vro-el-schema-form-dialog-width);width:var(--el-dialog-width)}:root,:host{--vro-el-schema-form-drawer-padding: 20px;--vro-el-schema-form-drawer-border-color: var(--el-border-color);--vro-el-schema-form-drawer-size: 520px}.vro-el-schema-form-drawer .el-drawer__header{margin-bottom:0;border-bottom:1px solid var(--vro-el-schema-form-drawer-border-color);padding:var(--vro-el-schema-form-drawer-padding)}.vro-el-schema-form-drawer .el-drawer__body{min-width:0;overflow-y:auto}.vro-el-schema-form-drawer .el-drawer__footer{padding:var(--vro-el-schema-form-drawer-padding);border-top:1px solid var(--vro-el-schema-form-drawer-border-color)}.vro-el-schema-form-drawer-footer{display:flex;justify-content:flex-end}:root,:host{--vro-el-skeleton-min-height: 240px;--vro-el-skeleton-color: var(--el-text-color-secondary);--vro-el-skeleton-description-margin-top: 16px;--vro-el-skeleton-description-color: var(--el-text-color-secondary);--vro-el-skeleton-description-font-size: var(--el-font-size-base);--vro-el-skeleton-description-line-height: 1.5}.vro-el-skeleton{width:100%;min-height:var(--vro-el-skeleton-min-height)}.vro-el-skeleton-state{display:flex;align-items:center;justify-content:center;width:100%;min-height:inherit}.vro-el-skeleton-loading{flex-direction:column;color:var(--vro-el-skeleton-color)}.vro-el-skeleton-description{margin:var(--vro-el-skeleton-description-margin-top) 0 0;color:var(--vro-el-skeleton-description-color);font-size:var(--vro-el-skeleton-description-font-size);line-height:var(--vro-el-skeleton-description-line-height);text-align:center}:root,:host{--vro-el-table-gap: 16px;--vro-el-table-padding: 16px;--vro-el-table-inner-gap: var(--vro-el-table-gap)}.vro-el-table{display:flex;flex-direction:column;width:100%;box-sizing:border-box;gap:var(--vro-el-table-gap)}.vro-el-table .el-table-column--selection{line-height:normal}.vro-el-table .el-table__expand-icon{display:flex;align-items:center;justify-content:center}.vro-el-table-inner{flex:1;position:relative;background-color:var(--el-bg-color);padding:var(--vro-el-table-padding);display:flex;flex-direction:column;gap:var(--vro-el-table-inner-gap)}.vro-el-table-header{display:flex;align-items:center;flex-wrap:wrap}.vro-el-table-header h2{font-size:16px}.vro-el-table-actions{flex-shrink:0;margin-left:auto}.vro-el-table-content{flex:1}.vro-el-table-content .el-table{width:100%;--el-table-bg-color: transparent}.vro-el-table-content .el-table__header{--el-table-header-bg-color: var(--el-bg-color-page);--el-table-header-text-color: var(--el-text-color-primary)}.vro-el-table-content .el-table__body-wrapper .cell{line-height:1.4}.vro-el-table-content .el-table__body-wrapper strong{font-weight:700;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt{font-weight:700;margin-bottom:8px;font-size:14px}.vro-el-table-content .el-table__body-wrapper dl dt:last-child{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper dl dd{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper dl dd:last-of-type{margin-bottom:0}.vro-el-table-content .el-table__body-wrapper ul li{margin-bottom:4px}.vro-el-table-content .el-table__body-wrapper ul li:last-of-type{margin-bottom:0}.vro-el-table-pagination{justify-content:flex-end}:root,:host{--vro-el-table-actions-column-row-gap: 4px;--vro-el-table-actions-column-column-gap: 12px}.vro-el-table-actions-column-cell .cell{display:flex;flex-wrap:wrap;row-gap:var(--vro-el-table-actions-column-row-gap);column-gap:var(--vro-el-table-actions-column-column-gap)}.vro-el-table-actions-column-cell .cell>.el-button+.el-button{margin-left:0}.vro-el-table-actions-column-dropdown-action.is-primary{color:var(--el-color-primary)}.vro-el-table-actions-column-dropdown-action.is-success{color:var(--el-color-success)}.vro-el-table-actions-column-dropdown-action.is-warning{color:var(--el-color-warning)}.vro-el-table-actions-column-dropdown-action.is-danger{color:var(--el-color-danger)}.vro-el-table-actions-column-dropdown-action.is-info{color:var(--el-color-info)}:root,:host{--vro-el-table-column-gap: 4px;--vro-el-table-column-icon-size: 14px;--vro-el-table-column-line-clamp: 1}.vro-el-table-column-content{display:inline-flex;width:100%;max-width:100%;min-width:0;align-items:center;gap:var(--vro-el-table-column-gap);vertical-align:middle}.vro-el-table-column-content.is-left{justify-content:flex-start}.vro-el-table-column-content.is-center{justify-content:center}.vro-el-table-column-content.is-right{justify-content:flex-end}.vro-el-table-column-content .vro-el-icon{flex:none;font-size:var(--vro-el-table-column-icon-size)}.vro-el-table-column-prefix,.vro-el-table-column-suffix{display:inline-flex;flex:none;min-width:0;align-items:center}.vro-el-table-column-text{flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vro-el-table-column-text.is-line-clamp{display:-webkit-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:var(--vro-el-table-column-line-clamp)}:root,:host{--vro-el-tags-gap: 8px;--vro-el-tags-input-width: 120px}.vro-el-tags{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vro-el-tags-gap)}.vro-el-tags-tag,.vro-el-tags-button{flex:none}.vro-el-tags-input{width:var(--vro-el-tags-input-width)}.vro-el-tree{width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { withInstall as o } from "@vrojs/base";
|
|
2
2
|
import r from "./vro-el-table.vue.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const t = o(r);
|
|
3
|
+
import { vroElTableProps as f } from "./types.js";
|
|
4
|
+
import { useVroElTable as s } from "./useVroElTable.js";
|
|
5
|
+
const e = o(r);
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
s as vroElTableProps
|
|
7
|
+
e as VroElTable,
|
|
8
|
+
e as default,
|
|
9
|
+
s as useVroElTable,
|
|
10
|
+
f as vroElTableProps
|
|
13
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseAsyncTaskOptions } from '@vrojs/use';
|
|
2
|
-
import { Ref } from 'vue';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
3
|
import { VroElSchemaFormSchema, VroElSchemaFormSchemaFieldBase } from '../vro-el-schema-form';
|
|
4
4
|
import { VroElTableColumnGroupColumns } from '../vro-el-table-column-group';
|
|
5
5
|
import { VroElTableRequest } from './types';
|
|
@@ -12,33 +12,30 @@ export type UseVroElTableAsyncTaskParams = {
|
|
|
12
12
|
pageSize?: number;
|
|
13
13
|
query?: Record<string, any>;
|
|
14
14
|
} | number;
|
|
15
|
-
export type UseVroElTableRawColumns<T extends Record<string, any> = any> = (() => VroElTableColumnGroupColumns<T>) | VroElTableColumnGroupColumns<T>;
|
|
16
15
|
export type UseVroElTableSchema<T extends VroElSchemaFormSchema> = {
|
|
17
16
|
[P in keyof T]: VroElSchemaFormSchemaFieldBase;
|
|
18
17
|
};
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
query: Ref<Record<string, any> | undefined
|
|
34
|
-
schema:
|
|
35
|
-
columns:
|
|
18
|
+
export interface UseVroElTablePagination {
|
|
19
|
+
currentPage: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
total: number;
|
|
22
|
+
}
|
|
23
|
+
export interface UseVroElTableTableProps<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = never> {
|
|
24
|
+
schema: UseVroElTableSchema<R> | undefined;
|
|
25
|
+
loading: boolean;
|
|
26
|
+
columns: VroElTableColumnGroupColumns<Row>;
|
|
27
|
+
data: Row[];
|
|
28
|
+
pagination: UseVroElTablePagination;
|
|
29
|
+
}
|
|
30
|
+
export interface UseVroElTableReturn<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = never> {
|
|
31
|
+
tableProps: ComputedRef<UseVroElTableTableProps<Row, R>>;
|
|
32
|
+
query: Ref<Record<string, any> | undefined>;
|
|
33
|
+
schema: UseVroElTableSchema<R> | undefined;
|
|
34
|
+
columns: VroElTableColumnGroupColumns<Row>;
|
|
36
35
|
trigger: (params?: UseVroElTableAsyncTaskParams) => Promise<Row[]>;
|
|
37
|
-
data: Ref<Row[]
|
|
38
|
-
loading: Ref<boolean
|
|
39
|
-
pagination:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
};
|
|
36
|
+
data: Ref<Row[]>;
|
|
37
|
+
loading: Ref<boolean>;
|
|
38
|
+
pagination: UseVroElTablePagination;
|
|
39
|
+
}
|
|
40
|
+
export declare function useVroElTable<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: R, rawColumns: VroElTableColumnGroupColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, R>;
|
|
41
|
+
export declare function useVroElTable<Row extends Record<string, any> = any>(rawColumns: VroElTableColumnGroupColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, never>;
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { useAsyncTask as
|
|
4
|
-
import { reactive as n, ref as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { query: d, ...P } = y, a = n(
|
|
8
|
-
p(i) ? i() : i
|
|
9
|
-
), u = n(p(o) ? o() : o), r = d ?? T(), t = n({
|
|
1
|
+
import z from "../node_modules/.pnpm/@ajuanjs_banana@0.0.3/node_modules/@ajuanjs/banana/dist/index.js";
|
|
2
|
+
import { isNumber as A, filterEmptyValue as E } from "@daysnap/utils";
|
|
3
|
+
import { useAsyncTask as T } from "@vrojs/use";
|
|
4
|
+
import { reactive as n, ref as V, computed as k } from "vue";
|
|
5
|
+
function _(i, u, c, p) {
|
|
6
|
+
const o = Array.isArray(i), s = o ? void 0 : i, v = o ? i : u, m = o ? u : c, w = (o ? c : p) ?? {}, a = s ? n(s) : void 0, l = n(v), { query: P, ...b } = w, r = P ?? V(), t = n({
|
|
10
7
|
currentPage: 1,
|
|
11
8
|
pageSize: 10,
|
|
12
9
|
total: 0
|
|
13
|
-
}), { trigger:
|
|
10
|
+
}), { trigger: S, data: g, loading: f } = T(
|
|
14
11
|
async (e) => {
|
|
15
|
-
|
|
16
|
-
const { currentPage:
|
|
17
|
-
e?.query && (r.value = e
|
|
18
|
-
const [
|
|
19
|
-
return t.total =
|
|
12
|
+
A(e) && (e = { currentPage: e });
|
|
13
|
+
const { currentPage: y, pageSize: d } = Object.assign({}, t, e);
|
|
14
|
+
e?.query && (r.value = e.query), r.value || (r.value = a ? E(await z.extract(a), !0) : {}), t.currentPage = y, t.pageSize = d;
|
|
15
|
+
const [q, x] = await m([y, d], r.value);
|
|
16
|
+
return t.total = x, q || [];
|
|
20
17
|
},
|
|
21
18
|
{
|
|
22
19
|
immediate: !0,
|
|
23
20
|
throwError: !0,
|
|
24
21
|
initialValue: [],
|
|
25
|
-
...
|
|
22
|
+
...b
|
|
26
23
|
}
|
|
27
24
|
);
|
|
28
25
|
return {
|
|
29
|
-
tableProps:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
data: c.value,
|
|
36
|
-
paginationProps: t
|
|
26
|
+
tableProps: k(() => ({
|
|
27
|
+
schema: a,
|
|
28
|
+
loading: f.value,
|
|
29
|
+
columns: l,
|
|
30
|
+
data: g.value,
|
|
31
|
+
pagination: t
|
|
37
32
|
})),
|
|
38
33
|
query: r,
|
|
39
34
|
schema: a,
|
|
40
|
-
columns:
|
|
41
|
-
trigger:
|
|
42
|
-
data:
|
|
43
|
-
loading:
|
|
35
|
+
columns: l,
|
|
36
|
+
trigger: S,
|
|
37
|
+
data: g,
|
|
38
|
+
loading: f,
|
|
44
39
|
pagination: t
|
|
45
40
|
};
|
|
46
41
|
}
|
|
47
42
|
export {
|
|
48
|
-
|
|
43
|
+
_ as useVroElTable
|
|
49
44
|
};
|
|
@@ -10,6 +10,10 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
10
10
|
type: import('vue').PropType<"hover" | "click" | "contextmenu">;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
|
+
moreButtonProps: {
|
|
14
|
+
type: import('vue').PropType<import('./types').VroElTableActionsColumnButtonProps>;
|
|
15
|
+
default: () => {};
|
|
16
|
+
};
|
|
13
17
|
moreText: StringConstructor;
|
|
14
18
|
moreActions: {
|
|
15
19
|
type: import('vue').PropType<import('./types').VroElTableActionsColumnActions>;
|
|
@@ -81,6 +85,7 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
81
85
|
filterMultiple: boolean;
|
|
82
86
|
actions: import('./types').VroElTableActionsColumnActions<any>;
|
|
83
87
|
moreTrigger: "click" | "contextmenu" | "hover";
|
|
88
|
+
moreButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
84
89
|
moreActions: import('./types').VroElTableActionsColumnActions<any>;
|
|
85
90
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
86
91
|
P: {};
|
|
@@ -99,6 +104,10 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
99
104
|
type: import('vue').PropType<"hover" | "click" | "contextmenu">;
|
|
100
105
|
default: string;
|
|
101
106
|
};
|
|
107
|
+
moreButtonProps: {
|
|
108
|
+
type: import('vue').PropType<import('./types').VroElTableActionsColumnButtonProps>;
|
|
109
|
+
default: () => {};
|
|
110
|
+
};
|
|
102
111
|
moreText: StringConstructor;
|
|
103
112
|
moreActions: {
|
|
104
113
|
type: import('vue').PropType<import('./types').VroElTableActionsColumnActions>;
|
|
@@ -170,6 +179,7 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
170
179
|
filterMultiple: boolean;
|
|
171
180
|
actions: import('./types').VroElTableActionsColumnActions<any>;
|
|
172
181
|
moreTrigger: "click" | "contextmenu" | "hover";
|
|
182
|
+
moreButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
173
183
|
moreActions: import('./types').VroElTableActionsColumnActions<any>;
|
|
174
184
|
}>;
|
|
175
185
|
__isFragment?: never;
|
|
@@ -185,6 +195,10 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
185
195
|
type: import('vue').PropType<"hover" | "click" | "contextmenu">;
|
|
186
196
|
default: string;
|
|
187
197
|
};
|
|
198
|
+
moreButtonProps: {
|
|
199
|
+
type: import('vue').PropType<import('./types').VroElTableActionsColumnButtonProps>;
|
|
200
|
+
default: () => {};
|
|
201
|
+
};
|
|
188
202
|
moreText: StringConstructor;
|
|
189
203
|
moreActions: {
|
|
190
204
|
type: import('vue').PropType<import('./types').VroElTableActionsColumnActions>;
|
|
@@ -256,6 +270,7 @@ export declare const VroElTableActionsColumn: import('@vrojs/base').WithInstall<
|
|
|
256
270
|
filterMultiple: boolean;
|
|
257
271
|
actions: import('./types').VroElTableActionsColumnActions<any>;
|
|
258
272
|
moreTrigger: "click" | "contextmenu" | "hover";
|
|
273
|
+
moreButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
259
274
|
moreActions: import('./types').VroElTableActionsColumnActions<any>;
|
|
260
275
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
261
276
|
$slots: Readonly<import('./types').VroElTableActionsColumnSlots<any>> & import('./types').VroElTableActionsColumnSlots<any>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonProps } from 'element-plus';
|
|
2
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
3
|
import { VroElTableColumnScope } from '../vro-el-table-column/types';
|
|
4
|
+
/**
|
|
5
|
+
* 操作按钮属性,透传给 ElButton,其中 loading、onClick 由组件内部管理。
|
|
6
|
+
*/
|
|
7
|
+
export type VroElTableActionsColumnButtonProps = Partial<ButtonProps>;
|
|
3
8
|
export interface VroElTableActionsColumnAction<T = any> {
|
|
4
9
|
/**
|
|
5
10
|
* 操作唯一标识,用于优化列表渲染。
|
|
@@ -9,18 +14,6 @@ export interface VroElTableActionsColumnAction<T = any> {
|
|
|
9
14
|
* 操作文本。
|
|
10
15
|
*/
|
|
11
16
|
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* 操作图标。
|
|
14
|
-
*/
|
|
15
|
-
icon?: string | Component;
|
|
16
|
-
/**
|
|
17
|
-
* 按钮类型。
|
|
18
|
-
*/
|
|
19
|
-
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
20
|
-
/**
|
|
21
|
-
* 是否禁用。
|
|
22
|
-
*/
|
|
23
|
-
disabled?: boolean;
|
|
24
17
|
/**
|
|
25
18
|
* 是否隐藏,返回 true 时隐藏当前操作。
|
|
26
19
|
*/
|
|
@@ -29,6 +22,10 @@ export interface VroElTableActionsColumnAction<T = any> {
|
|
|
29
22
|
* 点击操作时触发。
|
|
30
23
|
*/
|
|
31
24
|
onAction?: (row: T, index: number) => any;
|
|
25
|
+
/**
|
|
26
|
+
* 按钮属性,直接展示的操作项透传给 ElButton;收纳到更多下拉菜单中的操作项,取其中的 icon、disabled、type。
|
|
27
|
+
*/
|
|
28
|
+
buttonProps?: VroElTableActionsColumnButtonProps;
|
|
32
29
|
}
|
|
33
30
|
export type VroElTableActionsColumnActions<T = any> = VroElTableActionsColumnAction<T>[] | ((row: T, index: number) => VroElTableActionsColumnAction<T>[]);
|
|
34
31
|
export declare const vroElTableActionsColumnProps: {
|
|
@@ -50,6 +47,13 @@ export declare const vroElTableActionsColumnProps: {
|
|
|
50
47
|
type: PropType<"hover" | "click" | "contextmenu">;
|
|
51
48
|
default: string;
|
|
52
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* 更多操作按钮属性,默认 { type: 'primary', link: true }。
|
|
52
|
+
*/
|
|
53
|
+
moreButtonProps: {
|
|
54
|
+
type: PropType<VroElTableActionsColumnButtonProps>;
|
|
55
|
+
default: () => {};
|
|
56
|
+
};
|
|
53
57
|
/**
|
|
54
58
|
* 更多操作按钮文本。
|
|
55
59
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { elTableColumnProps as
|
|
1
|
+
import { elTableColumnProps as t } from "../utils/elTableColumnProps.js";
|
|
2
2
|
import "@vrojs/base";
|
|
3
3
|
const e = {
|
|
4
|
-
...
|
|
4
|
+
...t,
|
|
5
5
|
/**
|
|
6
6
|
* 列标题。
|
|
7
7
|
*/
|
|
@@ -20,6 +20,13 @@ const e = {
|
|
|
20
20
|
type: String,
|
|
21
21
|
default: "hover"
|
|
22
22
|
},
|
|
23
|
+
/**
|
|
24
|
+
* 更多操作按钮属性,默认 { type: 'primary', link: true }。
|
|
25
|
+
*/
|
|
26
|
+
moreButtonProps: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: () => ({})
|
|
29
|
+
},
|
|
23
30
|
/**
|
|
24
31
|
* 更多操作按钮文本。
|
|
25
32
|
*/
|
|
@@ -16,6 +16,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
16
16
|
type: import('vue').PropType<"hover" | "click" | "contextmenu">;
|
|
17
17
|
default: string;
|
|
18
18
|
};
|
|
19
|
+
moreButtonProps: {
|
|
20
|
+
type: import('vue').PropType<import('./types').VroElTableActionsColumnButtonProps>;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
19
23
|
moreText: StringConstructor;
|
|
20
24
|
moreActions: {
|
|
21
25
|
type: import('vue').PropType<VroElTableActionsColumnActions>;
|
|
@@ -85,6 +89,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
85
89
|
type: import('vue').PropType<"hover" | "click" | "contextmenu">;
|
|
86
90
|
default: string;
|
|
87
91
|
};
|
|
92
|
+
moreButtonProps: {
|
|
93
|
+
type: import('vue').PropType<import('./types').VroElTableActionsColumnButtonProps>;
|
|
94
|
+
default: () => {};
|
|
95
|
+
};
|
|
88
96
|
moreText: StringConstructor;
|
|
89
97
|
moreActions: {
|
|
90
98
|
type: import('vue').PropType<VroElTableActionsColumnActions>;
|
|
@@ -156,6 +164,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
156
164
|
filterMultiple: boolean;
|
|
157
165
|
actions: VroElTableActionsColumnActions<any>;
|
|
158
166
|
moreTrigger: "click" | "contextmenu" | "hover";
|
|
167
|
+
moreButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
159
168
|
moreActions: VroElTableActionsColumnActions<any>;
|
|
160
169
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
161
170
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,74 +1,71 @@
|
|
|
1
|
-
import { defineComponent as V, computed as A, reactive as D, createBlock as c, openBlock as a, unref as i, mergeProps as
|
|
1
|
+
import { defineComponent as V, computed as A, reactive as D, createBlock as c, openBlock as a, unref as i, mergeProps as s, withCtx as l, renderSlot as p, normalizeProps as M, guardReactiveProps as z, createElementBlock as P, createCommentVNode as F, Fragment as v, renderList as w, withModifiers as T, createTextVNode as f, toDisplayString as b, createVNode as h, normalizeClass as K } from "vue";
|
|
2
2
|
import { pick as S, typedKeys as j, isFunction as R, isPromiseLike as q } from "@daysnap/utils";
|
|
3
|
-
import { ElTableColumn as G, ElButton as
|
|
3
|
+
import { ElTableColumn as G, ElButton as E, ElDropdown as H, ElDropdownMenu as J, ElDropdownItem as O } from "element-plus";
|
|
4
4
|
import { useLocale as Q } from "../locale/useLocale.js";
|
|
5
5
|
import { elTableColumnProps as U } from "../utils/elTableColumnProps.js";
|
|
6
6
|
import "@vrojs/base";
|
|
7
7
|
import { vroElTableActionsColumnProps as W } from "./types.js";
|
|
8
|
-
const
|
|
8
|
+
const to = /* @__PURE__ */ V({
|
|
9
9
|
name: "VroElTableActionsColumn",
|
|
10
10
|
__name: "vro-el-table-actions-column",
|
|
11
11
|
props: W,
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
const
|
|
12
|
+
setup(L) {
|
|
13
|
+
const d = L, { t: g } = Q(), _ = A(() => {
|
|
14
|
+
const o = S(d, j(U));
|
|
15
15
|
return {
|
|
16
|
-
...
|
|
17
|
-
label:
|
|
18
|
-
className: ["vro-el-table-actions-column-cell",
|
|
16
|
+
...o,
|
|
17
|
+
label: d.label ?? g("tableActionsColumn.label"),
|
|
18
|
+
className: ["vro-el-table-actions-column-cell", o.className].filter(Boolean).join(" ")
|
|
19
19
|
};
|
|
20
|
-
}), B = A(() =>
|
|
21
|
-
|
|
22
|
-
}, C = async (
|
|
23
|
-
const
|
|
24
|
-
if (!(!
|
|
25
|
-
k(
|
|
20
|
+
}), B = A(() => d.moreText ?? g("tableActionsColumn.moreText")), $ = D(/* @__PURE__ */ new Map()), m = (o, n, e) => (typeof o == "function" ? o(n, e) : o).filter((r) => !(R(r.hidden) ? r.hidden(n, e) : r.hidden)), u = (o, n) => o.key ?? `${n}-${o.label}`, y = (o, n, e) => !!$.get(`${n}-${u(o, e)}`), k = (o, n, e, t) => {
|
|
21
|
+
$.set(`${n}-${u(o, e)}`, t);
|
|
22
|
+
}, C = async (o, n, e, t) => {
|
|
23
|
+
const r = o.onAction?.(n, e);
|
|
24
|
+
if (!(!o.buttonProps?.icon || !q(r))) {
|
|
25
|
+
k(o, e, t, !0);
|
|
26
26
|
try {
|
|
27
|
-
await
|
|
27
|
+
await r;
|
|
28
28
|
} finally {
|
|
29
|
-
k(
|
|
29
|
+
k(o, e, t, !1);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
return (
|
|
34
|
-
default:
|
|
35
|
-
|
|
36
|
-
(a(!0), v
|
|
37
|
-
key:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
default: r(() => [
|
|
46
|
-
f(e.$slots, "action", m({ ref_for: !0 }, { ...o, action: n }), () => [
|
|
47
|
-
p(b(n.label), 1)
|
|
33
|
+
return (o, n) => (a(), c(i(G), s(_.value, { class: "vro-el-table-actions-column" }), {
|
|
34
|
+
default: l((e) => [
|
|
35
|
+
p(o.$slots, "default", M(z(e)), () => [
|
|
36
|
+
(a(!0), P(v, null, w(m(o.actions, e.row, e.$index), (t, r) => (a(), c(i(E), s({
|
|
37
|
+
key: u(t, r)
|
|
38
|
+
}, { ref_for: !0 }, { link: !0, type: "primary", ...t.buttonProps }, {
|
|
39
|
+
loading: y(t, e.$index, r),
|
|
40
|
+
onClick: T((N) => C(t, e.row, e.$index, r), ["stop"])
|
|
41
|
+
}), {
|
|
42
|
+
default: l(() => [
|
|
43
|
+
p(o.$slots, "action", s({ ref_for: !0 }, { ...e, action: t }), () => [
|
|
44
|
+
f(b(t.label), 1)
|
|
48
45
|
])
|
|
49
46
|
]),
|
|
50
47
|
_: 2
|
|
51
|
-
},
|
|
52
|
-
|
|
48
|
+
}, 1040, ["loading", "onClick"]))), 128)),
|
|
49
|
+
m(o.moreActions, e.row, e.$index).length ? (a(), c(i(H), {
|
|
53
50
|
key: 0,
|
|
54
|
-
trigger:
|
|
51
|
+
trigger: o.moreTrigger
|
|
55
52
|
}, {
|
|
56
|
-
dropdown:
|
|
57
|
-
|
|
58
|
-
default:
|
|
59
|
-
(a(!0), v
|
|
60
|
-
key:
|
|
53
|
+
dropdown: l(() => [
|
|
54
|
+
h(i(J), null, {
|
|
55
|
+
default: l(() => [
|
|
56
|
+
(a(!0), P(v, null, w(m(o.moreActions, e.row, e.$index), (t, r) => (a(), c(i(O), {
|
|
57
|
+
key: u(t, r),
|
|
61
58
|
class: K([
|
|
62
59
|
"vro-el-table-actions-column-dropdown-action",
|
|
63
|
-
|
|
60
|
+
t.buttonProps?.type && `is-${t.buttonProps.type}`
|
|
64
61
|
]),
|
|
65
|
-
icon:
|
|
66
|
-
disabled:
|
|
67
|
-
onClick:
|
|
62
|
+
icon: t.buttonProps?.icon,
|
|
63
|
+
disabled: t.buttonProps?.disabled || y(t, e.$index, r),
|
|
64
|
+
onClick: T((N) => C(t, e.row, e.$index, r), ["stop"])
|
|
68
65
|
}, {
|
|
69
|
-
default:
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
default: l(() => [
|
|
67
|
+
p(o.$slots, "more-action", s({ ref_for: !0 }, { ...e, action: t }), () => [
|
|
68
|
+
f(b(t.label), 1)
|
|
72
69
|
])
|
|
73
70
|
]),
|
|
74
71
|
_: 2
|
|
@@ -77,16 +74,16 @@ const ne = /* @__PURE__ */ V({
|
|
|
77
74
|
_: 2
|
|
78
75
|
}, 1024)
|
|
79
76
|
]),
|
|
80
|
-
default:
|
|
81
|
-
|
|
77
|
+
default: l(() => [
|
|
78
|
+
h(i(E), s({
|
|
82
79
|
type: "primary",
|
|
83
80
|
link: ""
|
|
84
|
-
}, {
|
|
85
|
-
default:
|
|
86
|
-
|
|
81
|
+
}, o.moreButtonProps), {
|
|
82
|
+
default: l(() => [
|
|
83
|
+
f(b(B.value), 1)
|
|
87
84
|
]),
|
|
88
85
|
_: 1
|
|
89
|
-
})
|
|
86
|
+
}, 16)
|
|
90
87
|
]),
|
|
91
88
|
_: 2
|
|
92
89
|
}, 1032, ["trigger"])) : F("", !0)
|
|
@@ -97,5 +94,5 @@ const ne = /* @__PURE__ */ V({
|
|
|
97
94
|
}
|
|
98
95
|
});
|
|
99
96
|
export {
|
|
100
|
-
|
|
97
|
+
to as default
|
|
101
98
|
};
|
|
@@ -7,8 +7,8 @@ export declare const VroElTableColumn: import('@vrojs/base').WithInstall<{
|
|
|
7
7
|
};
|
|
8
8
|
unit: StringConstructor;
|
|
9
9
|
lineClamp: NumberConstructor;
|
|
10
|
-
map: import('vue').PropType<
|
|
11
|
-
|
|
10
|
+
map: import('vue').PropType<import('./types').VroElTableColumnMap>;
|
|
11
|
+
render: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
12
12
|
renderContent: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
13
13
|
prefixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
14
14
|
suffixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
@@ -92,8 +92,8 @@ export declare const VroElTableColumn: import('@vrojs/base').WithInstall<{
|
|
|
92
92
|
};
|
|
93
93
|
unit: StringConstructor;
|
|
94
94
|
lineClamp: NumberConstructor;
|
|
95
|
-
map: import('vue').PropType<
|
|
96
|
-
|
|
95
|
+
map: import('vue').PropType<import('./types').VroElTableColumnMap>;
|
|
96
|
+
render: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
97
97
|
renderContent: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
98
98
|
prefixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
99
99
|
suffixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
@@ -174,8 +174,8 @@ export declare const VroElTableColumn: import('@vrojs/base').WithInstall<{
|
|
|
174
174
|
};
|
|
175
175
|
unit: StringConstructor;
|
|
176
176
|
lineClamp: NumberConstructor;
|
|
177
|
-
map: import('vue').PropType<
|
|
178
|
-
|
|
177
|
+
map: import('vue').PropType<import('./types').VroElTableColumnMap>;
|
|
178
|
+
render: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
179
179
|
renderContent: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
180
180
|
prefixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
181
181
|
suffixIcon: import('vue').PropType<import('./types').VroElTableColumnIcon>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root,:host{--vro-el-table-column-gap: 4px;--vro-el-table-column-icon-size: 14px;--vro-el-table-column-line-clamp: 1}.vro-el-table-column-content{display:inline-flex;width:100%;max-width:100%;min-width:0;align-items:center;gap:var(--vro-el-table-column-gap);vertical-align:middle}.vro-el-table-column-content.is-center{justify-content:center}.vro-el-table-column-content.is-right{justify-content:flex-end}.vro-el-table-column-content .vro-el-icon{flex:none;font-size:var(--vro-el-table-column-icon-size)}.vro-el-table-column-prefix,.vro-el-table-column-suffix{display:inline-flex;flex:none;min-width:0;align-items:center}.vro-el-table-column-text{flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vro-el-table-column-text.is-line-clamp{display:-webkit-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:var(--vro-el-table-column-line-clamp)}
|
|
1
|
+
:root,:host{--vro-el-table-column-gap: 4px;--vro-el-table-column-icon-size: 14px;--vro-el-table-column-line-clamp: 1}.vro-el-table-column-content{display:inline-flex;width:100%;max-width:100%;min-width:0;align-items:center;gap:var(--vro-el-table-column-gap);vertical-align:middle}.vro-el-table-column-content.is-left{justify-content:flex-start}.vro-el-table-column-content.is-center{justify-content:center}.vro-el-table-column-content.is-right{justify-content:flex-end}.vro-el-table-column-content .vro-el-icon{flex:none;font-size:var(--vro-el-table-column-icon-size)}.vro-el-table-column-prefix,.vro-el-table-column-suffix{display:inline-flex;flex:none;min-width:0;align-items:center}.vro-el-table-column-text{flex:0 1 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vro-el-table-column-text.is-line-clamp{display:-webkit-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:var(--vro-el-table-column-line-clamp)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TableColumnCtx } from 'element-plus';
|
|
2
2
|
import { ExtractPropTypes, PropType, VNodeChild } from 'vue';
|
|
3
3
|
import { VroElIconProps } from '../vro-el-icon';
|
|
4
|
-
export type VroElTableColumnFormatter = TableColumnCtx<any
|
|
4
|
+
export type VroElTableColumnFormatter<T extends Record<string, any> = any> = (row: T, column: TableColumnCtx<T>, cellValue: any, index: number) => any;
|
|
5
5
|
export type VroElTableColumnIcon = string | Partial<VroElIconProps>;
|
|
6
|
+
export type VroElTableColumnMap<T extends Record<string, any> = any> = Record<PropertyKey, any> | ((row: T, index: number) => Record<PropertyKey, any>);
|
|
6
7
|
export interface VroElTableColumnScope<T extends Record<string, any> = any> {
|
|
7
8
|
row: T;
|
|
8
9
|
column: TableColumnCtx<T>;
|
|
@@ -19,7 +20,17 @@ export interface VroElTableColumnExpandScope {
|
|
|
19
20
|
export interface VroElTableColumnFilterIconScope {
|
|
20
21
|
filterOpened: boolean;
|
|
21
22
|
}
|
|
22
|
-
export
|
|
23
|
+
export interface VroElTableColumnRenderScope<T extends Record<string, any> = any> extends VroElTableColumnScope<T> {
|
|
24
|
+
/**
|
|
25
|
+
* 单元格原始值,即 prop 对应的值。
|
|
26
|
+
*/
|
|
27
|
+
rawValue?: any;
|
|
28
|
+
/**
|
|
29
|
+
* 单元格格式化后的值,已应用 formatter、map、unit。
|
|
30
|
+
*/
|
|
31
|
+
value?: any;
|
|
32
|
+
}
|
|
33
|
+
export type VroElTableColumnRender<T extends Record<string, any> = any> = (scope: VroElTableColumnRenderScope<T>) => VNodeChild;
|
|
23
34
|
export declare const vroElTableColumnProps: {
|
|
24
35
|
/**
|
|
25
36
|
* 空值占位内容。
|
|
@@ -29,7 +40,7 @@ export declare const vroElTableColumnProps: {
|
|
|
29
40
|
default: string;
|
|
30
41
|
};
|
|
31
42
|
/**
|
|
32
|
-
*
|
|
43
|
+
* 非空值后缀单位,仅对字符串、数字生效。
|
|
33
44
|
*/
|
|
34
45
|
unit: StringConstructor;
|
|
35
46
|
/**
|
|
@@ -37,15 +48,15 @@ export declare const vroElTableColumnProps: {
|
|
|
37
48
|
*/
|
|
38
49
|
lineClamp: NumberConstructor;
|
|
39
50
|
/**
|
|
40
|
-
*
|
|
51
|
+
* 枚举值映射表,支持传入函数按行生成。
|
|
41
52
|
*/
|
|
42
|
-
map: PropType<
|
|
53
|
+
map: PropType<VroElTableColumnMap>;
|
|
43
54
|
/**
|
|
44
|
-
* 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map
|
|
55
|
+
* 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map,低于默认插槽。
|
|
45
56
|
*/
|
|
46
|
-
|
|
57
|
+
render: PropType<VroElTableColumnRender>;
|
|
47
58
|
/**
|
|
48
|
-
*
|
|
59
|
+
* 自定义中间主体内容渲染函数,前后缀图标、对齐、单位仍然生效,空值占位由自定义内容自行处理。
|
|
49
60
|
*/
|
|
50
61
|
renderContent: PropType<VroElTableColumnRender>;
|
|
51
62
|
/**
|
|
@@ -133,9 +144,9 @@ export interface VroElTableColumnSlots<T extends Record<string, any> = any> {
|
|
|
133
144
|
/**
|
|
134
145
|
* 自定义默认内容前缀。
|
|
135
146
|
*/
|
|
136
|
-
prefix?: (props:
|
|
147
|
+
prefix?: (props: VroElTableColumnRenderScope<T>) => any;
|
|
137
148
|
/**
|
|
138
149
|
* 自定义默认内容后缀。
|
|
139
150
|
*/
|
|
140
|
-
suffix?: (props:
|
|
151
|
+
suffix?: (props: VroElTableColumnRenderScope<T>) => any;
|
|
141
152
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { elTableColumnProps as
|
|
1
|
+
import { elTableColumnProps as n } from "../utils/elTableColumnProps.js";
|
|
2
2
|
import "@vrojs/base";
|
|
3
3
|
const r = {
|
|
4
|
-
...
|
|
4
|
+
...n,
|
|
5
5
|
/**
|
|
6
6
|
* 空值占位内容。
|
|
7
7
|
*/
|
|
@@ -10,7 +10,7 @@ const r = {
|
|
|
10
10
|
default: "-"
|
|
11
11
|
},
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 非空值后缀单位,仅对字符串、数字生效。
|
|
14
14
|
*/
|
|
15
15
|
unit: String,
|
|
16
16
|
/**
|
|
@@ -18,15 +18,15 @@ const r = {
|
|
|
18
18
|
*/
|
|
19
19
|
lineClamp: Number,
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* 枚举值映射表,支持传入函数按行生成。
|
|
22
22
|
*/
|
|
23
|
-
map: Object,
|
|
23
|
+
map: [Object, Function],
|
|
24
24
|
/**
|
|
25
|
-
* 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map
|
|
25
|
+
* 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map,低于默认插槽。
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
render: Function,
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* 自定义中间主体内容渲染函数,前后缀图标、对齐、单位仍然生效,空值占位由自定义内容自行处理。
|
|
30
30
|
*/
|
|
31
31
|
renderContent: Function,
|
|
32
32
|
/**
|
|
@@ -13,8 +13,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
13
13
|
};
|
|
14
14
|
unit: StringConstructor;
|
|
15
15
|
lineClamp: NumberConstructor;
|
|
16
|
-
map: import('vue').PropType<
|
|
17
|
-
|
|
16
|
+
map: import('vue').PropType<import('./types').VroElTableColumnMap>;
|
|
17
|
+
render: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
18
18
|
renderContent: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
19
19
|
prefixIcon: import('vue').PropType<VroElTableColumnIcon>;
|
|
20
20
|
suffixIcon: import('vue').PropType<VroElTableColumnIcon>;
|
|
@@ -80,8 +80,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
80
80
|
};
|
|
81
81
|
unit: StringConstructor;
|
|
82
82
|
lineClamp: NumberConstructor;
|
|
83
|
-
map: import('vue').PropType<
|
|
84
|
-
|
|
83
|
+
map: import('vue').PropType<import('./types').VroElTableColumnMap>;
|
|
84
|
+
render: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
85
85
|
renderContent: import('vue').PropType<import('./types').VroElTableColumnRender>;
|
|
86
86
|
prefixIcon: import('vue').PropType<VroElTableColumnIcon>;
|
|
87
87
|
suffixIcon: import('vue').PropType<VroElTableColumnIcon>;
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { pick as
|
|
3
|
-
import { ElTableColumn as
|
|
4
|
-
import {
|
|
5
|
-
import { elTableColumnProps as M } from "../utils/elTableColumnProps.js";
|
|
1
|
+
import { defineComponent as B, useSlots as N, computed as s, createBlock as K, openBlock as O, unref as R, normalizeProps as p, guardReactiveProps as i, createSlots as j, withCtx as c, renderList as z, renderSlot as C, createVNode as D, h as a } from "vue";
|
|
2
|
+
import { typedKeys as y, pick as F, getByPath as L, isFunction as M } from "@daysnap/utils";
|
|
3
|
+
import { ElTableColumn as U } from "element-plus";
|
|
4
|
+
import { elTableColumnProps as W } from "../utils/elTableColumnProps.js";
|
|
6
5
|
import "@vrojs/base";
|
|
7
|
-
import { VroElIcon as
|
|
8
|
-
import { vroElTableColumnProps as
|
|
9
|
-
const
|
|
6
|
+
import { VroElIcon as q } from "../vro-el-icon/index.js";
|
|
7
|
+
import { vroElTableColumnProps as G } from "./types.js";
|
|
8
|
+
const re = /* @__PURE__ */ B({
|
|
10
9
|
name: "VroElTableColumn",
|
|
11
10
|
__name: "vro-el-table-column",
|
|
12
|
-
props:
|
|
13
|
-
setup(
|
|
14
|
-
const r =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
props: G,
|
|
12
|
+
setup(x) {
|
|
13
|
+
const r = x, l = N(), b = ["selection", "index", "expand"], h = ["default", "prefix", "suffix"], g = y(W).filter((e) => e !== "formatter"), S = s(() => F(r, g)), $ = s(() => r.type === "expand"), v = s(() => y(l).filter((e) => !h.includes(e) && !String(e).startsWith("_"))), P = s(() => !b.includes(r.type) || !!l.default || !!r.render), V = ({ scope: e }) => e.$index < 0 ? null : l.default ? l.default(e) : w(e), w = (e) => {
|
|
14
|
+
const t = {
|
|
15
|
+
...e,
|
|
16
|
+
..._(e)
|
|
17
|
+
};
|
|
18
|
+
return r.render ? r.render(t) : a("div", { class: ["vro-el-table-column-content", `is-${r.align || "left"}`] }, [
|
|
19
|
+
f("prefix", l.prefix?.(t) ?? m(r.prefixIcon)),
|
|
20
|
+
E(t),
|
|
21
|
+
f("suffix", l.suffix?.(t) ?? m(r.suffixIcon))
|
|
22
|
+
]);
|
|
23
|
+
}, f = (e, t) => t == null ? null : a("span", { class: `vro-el-table-column-${e}` }, t), m = (e) => e ? a(q, typeof e == "string" ? { name: e } : e) : null, E = (e) => r.renderContent ? r.renderContent(e) : a(
|
|
19
24
|
"span",
|
|
20
25
|
{
|
|
21
26
|
class: ["vro-el-table-column-text", { "is-line-clamp": !!r.lineClamp }],
|
|
22
27
|
style: r.lineClamp ? { "--vro-el-table-column-line-clamp": r.lineClamp } : void 0
|
|
23
28
|
},
|
|
24
|
-
|
|
25
|
-
),
|
|
26
|
-
const n =
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, k = (e) =>
|
|
32
|
-
|
|
29
|
+
d(e.value) ? r.placeholder : e.value
|
|
30
|
+
), _ = (e) => {
|
|
31
|
+
const { row: t, column: n, $index: o } = e, A = r.prop || r.property, u = L(t, A), I = r.formatter ? r.formatter(t, n, u, o) : T(u, t, o);
|
|
32
|
+
return {
|
|
33
|
+
rawValue: u,
|
|
34
|
+
value: k(I)
|
|
35
|
+
};
|
|
36
|
+
}, k = (e) => {
|
|
37
|
+
const t = typeof e == "string" || typeof e == "number";
|
|
38
|
+
return r.unit && t && !d(e) ? `${e}${r.unit}` : e;
|
|
39
|
+
}, T = (e, t, n) => {
|
|
40
|
+
const o = M(r.map) ? r.map(t, n) : r.map;
|
|
41
|
+
return !o || e == null ? e : Object.prototype.hasOwnProperty.call(o, e) ? o[e] : e;
|
|
42
|
+
}, d = (e) => e == null || e === "" || Array.isArray(e) && !e.length;
|
|
43
|
+
return (e, t) => (O(), K(R(U), p(i(S.value)), j({ _: 2 }, [
|
|
33
44
|
$.value ? {
|
|
34
45
|
name: "default",
|
|
35
|
-
fn:
|
|
36
|
-
|
|
46
|
+
fn: c((n) => [
|
|
47
|
+
C(e.$slots, "default", p(i(n)))
|
|
37
48
|
]),
|
|
38
49
|
key: "0"
|
|
39
|
-
} :
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
u(e.$slots, "header", i(p(t)))
|
|
50
|
+
} : P.value ? {
|
|
51
|
+
name: "default",
|
|
52
|
+
fn: c((n) => [
|
|
53
|
+
D(V, { scope: n }, null, 8, ["scope"])
|
|
44
54
|
]),
|
|
45
55
|
key: "1"
|
|
46
56
|
} : void 0,
|
|
47
|
-
|
|
48
|
-
name:
|
|
49
|
-
fn:
|
|
50
|
-
|
|
51
|
-
])
|
|
52
|
-
|
|
53
|
-
} : void 0,
|
|
54
|
-
e.$slots["filter-icon"] ? {
|
|
55
|
-
name: "filter-icon",
|
|
56
|
-
fn: o((t) => [
|
|
57
|
-
u(e.$slots, "filter-icon", i(p(t)))
|
|
58
|
-
]),
|
|
59
|
-
key: "3"
|
|
60
|
-
} : void 0
|
|
57
|
+
z(v.value, (n) => ({
|
|
58
|
+
name: n,
|
|
59
|
+
fn: c((o) => [
|
|
60
|
+
C(e.$slots, n, p(i(o)))
|
|
61
|
+
])
|
|
62
|
+
}))
|
|
61
63
|
]), 1040));
|
|
62
64
|
}
|
|
63
65
|
});
|
|
64
66
|
export {
|
|
65
|
-
|
|
67
|
+
re as default
|
|
66
68
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { TableColumnCtx } from 'element-plus';
|
|
2
1
|
import { Component, ExtractPropTypes, PropType, Raw } from 'vue';
|
|
3
2
|
import { VroElTableActionsColumnActions, VroElTableActionsColumnProps } from '../vro-el-table-actions-column';
|
|
4
|
-
import { VroElTableColumnProps, VroElTableColumnRender } from '../vro-el-table-column';
|
|
5
|
-
export type VroElTableColumnGroupFormatter<T extends Record<string, any> = any> =
|
|
6
|
-
export type VroElTableColumnGroupTableColumnProps<T extends Record<string, any> = any> = Partial<Omit<VroElTableColumnProps, 'formatter' | '
|
|
3
|
+
import { VroElTableColumnFormatter, VroElTableColumnProps, VroElTableColumnRender } from '../vro-el-table-column';
|
|
4
|
+
export type VroElTableColumnGroupFormatter<T extends Record<string, any> = any> = VroElTableColumnFormatter<T>;
|
|
5
|
+
export type VroElTableColumnGroupTableColumnProps<T extends Record<string, any> = any> = Partial<Omit<VroElTableColumnProps, 'formatter' | 'render' | 'renderContent'>> & {
|
|
7
6
|
/**
|
|
8
7
|
* 单元格格式化函数。
|
|
9
8
|
*/
|
|
10
|
-
formatter?:
|
|
9
|
+
formatter?: VroElTableColumnFormatter<T>;
|
|
11
10
|
/**
|
|
12
11
|
* 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map。
|
|
13
12
|
*/
|
|
14
|
-
|
|
13
|
+
render?: VroElTableColumnRender<T>;
|
|
15
14
|
/**
|
|
16
15
|
* 自定义中间主体内容渲染函数。
|
|
17
16
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vrojs/element-plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "vrojs ui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@ajuanjs/banana": "^0.0.3",
|
|
47
|
-
"@daysnap/utils": "^0.1.
|
|
47
|
+
"@daysnap/utils": "^0.1.37",
|
|
48
48
|
"@element-plus/icons-vue": "^2.3.2",
|
|
49
49
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
50
50
|
"element-plus": "^2.11.9",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { VroElSchemaFormSchema } from '../vro-el-schema-form';
|
|
2
|
-
import { VroElTableRequest } from './types';
|
|
3
|
-
import { UseVroElTableOptions, UseVroElTableRawColumns, useVroElTable } from './useVroElTable';
|
|
4
|
-
export interface CreateUseVroElTable<Row extends Record<string, any> = any> {
|
|
5
|
-
<R extends VroElSchemaFormSchema>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): ReturnType<typeof useVroElTable<Row, R>>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* 类型辅助器,现在 typescript 升级了之后,应该用不到了
|
|
9
|
-
*/
|
|
10
|
-
export declare function createUseVroElTable<Row extends Record<string, any> = any>(): CreateUseVroElTable<Row>;
|