@vrojs/element-plus 0.0.15 → 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 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 U } from "./vro-el-schema-form/index.js";
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 Uo } from "./vro-el-schema-filter/types.js";
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 { createUseVroElTable as Er } from "./vro-el-table/createUseVroElTable.js";
55
- import { vroElTableProps as ir } from "./vro-el-table/types.js";
56
- import { useVroElTable as Vr } from "./vro-el-table/useVroElTable.js";
57
- import { vroElTableActionsColumnProps as gr } from "./vro-el-table-actions-column/types.js";
58
- import { vroElTableColumnProps as vr } from "./vro-el-table-column/types.js";
59
- import { vroElTableColumnGroupProps as hr } from "./vro-el-table-column-group/types.js";
60
- import { useVroElTableColumnGroup as Pr } from "./vro-el-table-column-group/useVroElTableColumnGroup.js";
61
- import { vroElTableColumnGroupColumnManager as dr } from "./vro-el-table-column-group/vroElTableColumnGroupColumnManager.js";
62
- import { vroElTagsProps as br } from "./vro-el-tags/types.js";
63
- import { vroElTreeProps as Dr } from "./vro-el-tree/types.js";
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
- U as VroElSchemaForm,
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
- Vr as useVroElTable,
112
- Pr as useVroElTableColumnGroup,
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
- Uo as vroElSchemaFilterProps,
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
- gr as vroElTableActionsColumnProps,
131
- dr as vroElTableColumnGroupColumnManager,
132
- hr as vroElTableColumnGroupProps,
133
- vr as vroElTableColumnProps,
134
- ir as vroElTableProps,
135
- br as vroElTagsProps,
136
- Dr as vroElTreeProps,
137
- Ur as vroElWithConfigProps,
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
  };
@@ -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,4 +1,3 @@
1
- export * from './createUseVroElTable';
2
1
  export * from './types';
3
2
  export * from './useVroElTable';
4
3
  export declare const VroElTable: import('@vrojs/base').WithInstall<{
@@ -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 { createUseVroElTable as f } from "./createUseVroElTable.js";
4
- import { vroElTableProps as s } from "./types.js";
5
- import { useVroElTable as i } from "./useVroElTable.js";
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
- t as VroElTable,
9
- f as createUseVroElTable,
10
- t as default,
11
- i as useVroElTable,
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,6 @@
1
1
  import '../../vro-el-schema-filter/style/deps.js';
2
2
  import '../../vro-el-table-column-group/style/deps.js';
3
3
  import 'element-plus/es/components/button/style/css';
4
+ import 'element-plus/es/components/loading/style/css';
4
5
  import 'element-plus/es/components/pagination/style/css';
5
6
  import 'element-plus/es/components/table/style/css';
@@ -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 declare function useVroElTable<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: (() => R) | R, rawColumns: UseVroElTableRawColumns<Row>, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): {
20
- tableProps: import('vue').ComputedRef<{
21
- filterProps: {
22
- schema: import('vue').Reactive<UseVroElTableSchema<R>>;
23
- };
24
- loading: boolean;
25
- columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
26
- data: Row[];
27
- paginationProps: {
28
- currentPage: number;
29
- pageSize: number;
30
- total: number;
31
- };
32
- }>;
33
- query: Ref<Record<string, any> | undefined, Record<string, any> | undefined>;
34
- schema: import('vue').Reactive<UseVroElTableSchema<R>>;
35
- columns: import('vue').Reactive<VroElTableColumnGroupColumns<Row>>;
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[], Row[]>;
38
- loading: Ref<boolean, boolean>;
39
- pagination: {
40
- currentPage: number;
41
- pageSize: number;
42
- total: number;
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 q from "../node_modules/.pnpm/@ajuanjs_banana@0.0.3/node_modules/@ajuanjs/banana/dist/index.js";
2
- import { isFunction as p, isNumber as x, filterEmptyValue as z } from "@daysnap/utils";
3
- import { useAsyncTask as E } from "@vrojs/use";
4
- import { reactive as n, ref as T, computed as V } from "vue";
5
- import "../vro-el-table-column-group/index.js";
6
- function Q(i, o, f, y = {}) {
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: m, data: c, loading: l } = E(
10
+ }), { trigger: S, data: g, loading: f } = T(
14
11
  async (e) => {
15
- x(e) && (e = { currentPage: e });
16
- const { currentPage: s, pageSize: g } = Object.assign({}, t, e);
17
- e?.query && (r.value = e?.query), r.value || (r.value = z(await q.extract(a), !0)), t.currentPage = s, t.pageSize = g;
18
- const [v, b] = await f([s, g], r.value);
19
- return t.total = b, v || [];
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
- ...P
22
+ ...b
26
23
  }
27
24
  );
28
25
  return {
29
- tableProps: V(() => ({
30
- filterProps: {
31
- schema: a
32
- },
33
- loading: l.value,
34
- columns: u,
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: u,
41
- trigger: m,
42
- data: c,
43
- loading: l,
35
+ columns: l,
36
+ trigger: S,
37
+ data: g,
38
+ loading: f,
44
39
  pagination: t
45
40
  };
46
41
  }
47
42
  export {
48
- Q as useVroElTable
43
+ _ as useVroElTable
49
44
  };
@@ -1,92 +1,89 @@
1
- import { defineComponent as $, useTemplateRef as y, computed as k, resolveDirective as P, createElementBlock as i, openBlock as l, createBlock as a, createCommentVNode as s, createElementVNode as d, unref as r, mergeProps as u, withDirectives as T, renderSlot as n, withCtx as p, createTextVNode as V, toDisplayString as q, createVNode as w } from "vue";
2
- import { isEmptyObject as C } from "@daysnap/utils";
3
- import { RefreshRight as S } from "@element-plus/icons-vue";
4
- import { ElButton as z, ElTable as B, ElPagination as R } from "element-plus";
1
+ import { defineComponent as $, useTemplateRef as y, computed as k, createElementBlock as i, openBlock as r, createBlock as s, createCommentVNode as a, createElementVNode as d, unref as l, mergeProps as u, withDirectives as P, renderSlot as n, withCtx as p, createTextVNode as T, toDisplayString as V, createVNode as q } from "vue";
2
+ import { isEmptyObject as w } from "@daysnap/utils";
3
+ import { RefreshRight as C } from "@element-plus/icons-vue";
4
+ import { ElLoading as S, ElButton as z, ElTable as B, ElPagination as R } from "element-plus";
5
5
  import { useLocale as N } from "../locale/useLocale.js";
6
- import { VroElSchemaFilter as D } from "../vro-el-schema-filter/index.js";
6
+ import { VroElSchemaFilter as L } from "../vro-el-schema-filter/index.js";
7
7
  import { VroElTableColumnGroup as j } from "../vro-el-table-column-group/index.js";
8
- import { vroElTableProps as U } from "./types.js";
9
- const F = { class: "vro-el-table" }, G = { class: "vro-el-table-inner" }, H = {
8
+ import { vroElTableProps as D } from "./types.js";
9
+ const U = { class: "vro-el-table" }, F = { class: "vro-el-table-inner" }, G = {
10
10
  key: 0,
11
11
  class: "vro-el-table-header"
12
- }, L = { class: "vro-el-table-actions" }, O = { class: "vro-el-table-content" }, Y = /* @__PURE__ */ $({
12
+ }, H = { class: "vro-el-table-actions" }, O = { class: "vro-el-table-content" }, Y = /* @__PURE__ */ $({
13
13
  name: "VroElTable",
14
14
  __name: "vro-el-table",
15
- props: U,
15
+ props: D,
16
16
  emits: ["request", "selection-change"],
17
17
  setup(f, { expose: g }) {
18
- const b = f, { t: v } = N(), c = B, m = y("refElTable"), h = k(() => {
18
+ const b = f, { t: v } = N(), c = B, h = S.directive, m = y("refElTable"), E = k(() => {
19
19
  const { filterable: e, filterProps: o } = b;
20
- return !!(e && o?.schema && !C(o.schema));
20
+ return !!(e && o?.schema && !w(o.schema));
21
21
  });
22
22
  return g({
23
23
  get elTable() {
24
24
  return m.value;
25
25
  }
26
- }), (e, o) => {
27
- const E = P("loading");
28
- return l(), i("div", F, [
29
- h.value ? (l(), a(r(D), u({ key: 0 }, e.filterProps, {
30
- loading: e.loading,
31
- class: "vro-el-table-filter",
32
- onQuery: o[0] || (o[0] = (t) => e.$emit("request", { query: t, currentPage: 1 }))
33
- }), null, 16, ["loading"])) : s("", !0),
34
- d("div", G, [
35
- e.showHeader && (e.$slots.title || e.$slots.actions || e.showRefresh) ? (l(), i("div", H, [
36
- n(e.$slots, "title"),
37
- d("div", L, [
38
- e.showRefresh ? (l(), a(r(z), {
39
- key: 0,
40
- plain: "",
41
- icon: r(S),
42
- loading: e.loading,
43
- onClick: o[1] || (o[1] = (t) => e.$emit("request"))
44
- }, {
45
- default: p(() => [
46
- V(q(r(v)("table.refresh")), 1)
47
- ]),
48
- _: 1
49
- }, 8, ["icon", "loading"])) : s("", !0),
50
- n(e.$slots, "actions")
51
- ])
52
- ])) : s("", !0),
53
- T((l(), i("div", O, [
54
- w(r(c), u({
55
- ref_key: "refElTable",
56
- ref: m,
57
- width: "100%",
58
- "table-layout": "fixed"
59
- }, e.tableProps, {
60
- data: e.data,
61
- onSelectionChange: o[2] || (o[2] = (t) => e.$emit("selection-change", t))
62
- }), {
26
+ }), (e, o) => (r(), i("div", U, [
27
+ E.value ? (r(), s(l(L), u({ key: 0 }, e.filterProps, {
28
+ loading: e.loading,
29
+ class: "vro-el-table-filter",
30
+ onQuery: o[0] || (o[0] = (t) => e.$emit("request", { query: t, currentPage: 1 }))
31
+ }), null, 16, ["loading"])) : a("", !0),
32
+ d("div", F, [
33
+ e.showHeader && (e.$slots.title || e.$slots.actions || e.showRefresh) ? (r(), i("div", G, [
34
+ n(e.$slots, "title"),
35
+ d("div", H, [
36
+ e.showRefresh ? (r(), s(l(z), {
37
+ key: 0,
38
+ plain: "",
39
+ icon: l(C),
40
+ loading: e.loading,
41
+ onClick: o[1] || (o[1] = (t) => e.$emit("request"))
42
+ }, {
63
43
  default: p(() => [
64
- n(e.$slots, "content-prefix"),
65
- e.columns.length ? (l(), a(r(j), {
66
- key: 0,
67
- columns: e.columns
68
- }, null, 8, ["columns"])) : s("", !0),
69
- n(e.$slots, "default")
44
+ T(V(l(v)("table.refresh")), 1)
70
45
  ]),
71
- _: 3
72
- }, 16, ["data"])
73
- ])), [
74
- [E, e.loading]
75
- ]),
76
- e.pageable ? (l(), a(r(R), u({
77
- key: 1,
78
- class: "vro-el-table-pagination",
79
- layout: "total, prev, pager, next, sizes, jumper",
80
- background: "",
81
- size: "small",
82
- "page-sizes": [10, 20, 50, 100]
83
- }, e.paginationProps, {
84
- "onUpdate:currentPage": o[3] || (o[3] = (t) => e.$emit("request", { currentPage: t })),
85
- "onUpdate:pageSize": o[4] || (o[4] = (t) => e.$emit("request", { pageSize: t, currentPage: 1 }))
86
- }), null, 16)) : s("", !0)
87
- ])
88
- ]);
89
- };
46
+ _: 1
47
+ }, 8, ["icon", "loading"])) : a("", !0),
48
+ n(e.$slots, "actions")
49
+ ])
50
+ ])) : a("", !0),
51
+ P((r(), i("div", O, [
52
+ q(l(c), u({
53
+ ref_key: "refElTable",
54
+ ref: m,
55
+ width: "100%",
56
+ "table-layout": "fixed"
57
+ }, e.tableProps, {
58
+ data: e.data,
59
+ onSelectionChange: o[2] || (o[2] = (t) => e.$emit("selection-change", t))
60
+ }), {
61
+ default: p(() => [
62
+ n(e.$slots, "content-prefix"),
63
+ e.columns.length ? (r(), s(l(j), {
64
+ key: 0,
65
+ columns: e.columns
66
+ }, null, 8, ["columns"])) : a("", !0),
67
+ n(e.$slots, "default")
68
+ ]),
69
+ _: 3
70
+ }, 16, ["data"])
71
+ ])), [
72
+ [l(h), e.loading]
73
+ ]),
74
+ e.pageable ? (r(), s(l(R), u({
75
+ key: 1,
76
+ class: "vro-el-table-pagination",
77
+ layout: "total, prev, pager, next, sizes, jumper",
78
+ background: "",
79
+ size: "small",
80
+ "page-sizes": [10, 20, 50, 100]
81
+ }, e.paginationProps, {
82
+ "onUpdate:currentPage": o[3] || (o[3] = (t) => e.$emit("request", { currentPage: t })),
83
+ "onUpdate:pageSize": o[4] || (o[4] = (t) => e.$emit("request", { pageSize: t, currentPage: 1 }))
84
+ }), null, 16)) : a("", !0)
85
+ ])
86
+ ]));
90
87
  }
91
88
  });
92
89
  export {
@@ -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 { Component, ExtractPropTypes, PropType } from 'vue';
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 r } from "../utils/elTableColumnProps.js";
1
+ import { elTableColumnProps as t } from "../utils/elTableColumnProps.js";
2
2
  import "@vrojs/base";
3
3
  const e = {
4
- ...r,
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 m, withCtx as r, renderSlot as f, normalizeProps as M, guardReactiveProps as z, createElementBlock as v, createCommentVNode as F, Fragment as w, renderList as T, withModifiers as h, createTextVNode as p, toDisplayString as b, createVNode as E, normalizeClass as K } from "vue";
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 L, ElDropdown as H, ElDropdownMenu as J, ElDropdownItem as O } from "element-plus";
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 ne = /* @__PURE__ */ V({
8
+ const to = /* @__PURE__ */ V({
9
9
  name: "VroElTableActionsColumn",
10
10
  __name: "vro-el-table-actions-column",
11
11
  props: W,
12
- setup(P) {
13
- const u = P, { t: g } = Q(), _ = A(() => {
14
- const e = S(u, j(U));
12
+ setup(L) {
13
+ const d = L, { t: g } = Q(), _ = A(() => {
14
+ const o = S(d, j(U));
15
15
  return {
16
- ...e,
17
- label: u.label ?? g("tableActionsColumn.label"),
18
- className: ["vro-el-table-actions-column-cell", e.className].filter(Boolean).join(" ")
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(() => u.moreText ?? g("tableActionsColumn.moreText")), y = D(/* @__PURE__ */ new Map()), d = (e, l, o) => (typeof e == "function" ? e(l, o) : e).filter((t) => !(R(t.hidden) ? t.hidden(l, o) : t.hidden)), s = (e, l) => e.key ?? `${l}-${e.label}`, $ = (e, l, o) => !!y.get(`${l}-${s(e, o)}`), k = (e, l, o, n) => {
21
- y.set(`${l}-${s(e, o)}`, n);
22
- }, C = async (e, l, o, n) => {
23
- const t = e.onAction?.(l, o);
24
- if (!(!e.icon || !q(t))) {
25
- k(e, o, n, !0);
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 t;
27
+ await r;
28
28
  } finally {
29
- k(e, o, n, !1);
29
+ k(o, e, t, !1);
30
30
  }
31
31
  }
32
32
  };
33
- return (e, l) => (a(), c(i(G), m(_.value, { class: "vro-el-table-actions-column" }), {
34
- default: r((o) => [
35
- f(e.$slots, "default", M(z(o)), () => [
36
- (a(!0), v(w, null, T(d(e.actions, o.row, o.$index), (n, t) => (a(), c(i(L), {
37
- key: s(n, t),
38
- link: "",
39
- type: n.type || "primary",
40
- icon: n.icon,
41
- loading: $(n, o.$index, t),
42
- disabled: n.disabled,
43
- onClick: h((N) => C(n, o.row, o.$index, t), ["stop"])
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
- }, 1032, ["type", "icon", "loading", "disabled", "onClick"]))), 128)),
52
- d(e.moreActions, o.row, o.$index).length ? (a(), c(i(H), {
48
+ }, 1040, ["loading", "onClick"]))), 128)),
49
+ m(o.moreActions, e.row, e.$index).length ? (a(), c(i(H), {
53
50
  key: 0,
54
- trigger: e.moreTrigger
51
+ trigger: o.moreTrigger
55
52
  }, {
56
- dropdown: r(() => [
57
- E(i(J), null, {
58
- default: r(() => [
59
- (a(!0), v(w, null, T(d(e.moreActions, o.row, o.$index), (n, t) => (a(), c(i(O), {
60
- key: s(n, t),
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
- n.type && `is-${n.type}`
60
+ t.buttonProps?.type && `is-${t.buttonProps.type}`
64
61
  ]),
65
- icon: n.icon,
66
- disabled: n.disabled || $(n, o.$index, t),
67
- onClick: h((N) => C(n, o.row, o.$index, t), ["stop"])
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: r(() => [
70
- f(e.$slots, "more-action", m({ ref_for: !0 }, { ...o, action: n }), () => [
71
- p(b(n.label), 1)
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: r(() => [
81
- E(i(L), {
77
+ default: l(() => [
78
+ h(i(E), s({
82
79
  type: "primary",
83
80
  link: ""
84
- }, {
85
- default: r(() => [
86
- p(b(B.value), 1)
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
- ne as default
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<Record<PropertyKey, any>>;
11
- renderDefault: import('vue').PropType<import('./types').VroElTableColumnRender>;
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<Record<PropertyKey, any>>;
96
- renderDefault: import('vue').PropType<import('./types').VroElTableColumnRender>;
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<Record<PropertyKey, any>>;
178
- renderDefault: import('vue').PropType<import('./types').VroElTableColumnRender>;
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>['formatter'];
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 type VroElTableColumnRender<T extends Record<string, any> = any> = (scope: VroElTableColumnScope<T>) => VNodeChild;
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<Record<PropertyKey, any>>;
53
+ map: PropType<VroElTableColumnMap>;
43
54
  /**
44
- * 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map。
55
+ * 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map,低于默认插槽。
45
56
  */
46
- renderDefault: PropType<VroElTableColumnRender>;
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: VroElTableColumnScope<T>) => any;
147
+ prefix?: (props: VroElTableColumnRenderScope<T>) => any;
137
148
  /**
138
149
  * 自定义默认内容后缀。
139
150
  */
140
- suffix?: (props: VroElTableColumnScope<T>) => any;
151
+ suffix?: (props: VroElTableColumnRenderScope<T>) => any;
141
152
  }
@@ -1,7 +1,7 @@
1
- import { elTableColumnProps as e } from "../utils/elTableColumnProps.js";
1
+ import { elTableColumnProps as n } from "../utils/elTableColumnProps.js";
2
2
  import "@vrojs/base";
3
3
  const r = {
4
- ...e,
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
- renderDefault: Function,
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<Record<PropertyKey, any>>;
17
- renderDefault: import('vue').PropType<import('./types').VroElTableColumnRender>;
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<Record<PropertyKey, any>>;
84
- renderDefault: import('vue').PropType<import('./types').VroElTableColumnRender>;
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 T, useSlots as w, computed as y, createBlock as D, openBlock as I, unref as S, mergeProps as A, createSlots as B, withCtx as o, createVNode as O, renderSlot as u, normalizeProps as i, guardReactiveProps as p, h as a } from "vue";
2
- import { pick as R, typedKeys as j } from "@daysnap/utils";
3
- import { ElTableColumn as z } from "element-plus";
4
- import { getProp as K } from "element-plus/es/utils/objects";
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 N } from "../vro-el-icon/index.js";
8
- import { vroElTableColumnProps as _ } from "./types.js";
9
- const W = /* @__PURE__ */ T({
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(b) {
14
- const r = b, l = w(), v = ["selection", "index", "expand"], x = y(() => R(r, j(M))), $ = y(() => !v.includes(r.type) || !!l.default || !!r.renderDefault), h = ({ scope: e }) => e.$index < 0 ? null : l.default ? l.default(e) : r.renderDefault ? r.renderDefault(e) : a("div", { class: ["vro-el-table-column-content", `is-${r.align || "left"}`] }, [
15
- m("prefix", l.prefix?.(e) ?? f(r.prefixIcon)),
16
- V(e),
17
- m("suffix", l.suffix?.(e) ?? f(r.suffixIcon))
18
- ]), m = (e, n) => n == null ? null : a("span", { class: `vro-el-table-column-${e}` }, n), f = (e) => e ? a(N, typeof e == "string" ? { name: e } : e) : null, V = (e) => r.renderContent ? r.renderContent(e) : a(
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
- P(e)
25
- ), P = (e) => {
26
- const n = g(e);
27
- return c(n) ? r.placeholder : n;
28
- }, g = (e) => {
29
- const { row: n, column: t, $index: E } = e, d = r.prop || r.property, C = d ? K(n, d).value : void 0, s = r.formatter ? r.formatter(n, t, C, E) : k(C);
30
- return c(s) || !r.unit ? s : `${s}${r.unit}`;
31
- }, k = (e) => !r.map || e == null ? e : Object.prototype.hasOwnProperty.call(r.map, e) ? r.map[e] : e, c = (e) => e == null || e === "" || Array.isArray(e) && !e.length;
32
- return (e, n) => (I(), D(S(z), A(x.value, { class: "vro-el-table-column" }), B({ _: 2 }, [
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: o((t) => [
36
- O(h, { scope: t }, null, 8, ["scope"])
46
+ fn: c((n) => [
47
+ C(e.$slots, "default", p(i(n)))
37
48
  ]),
38
49
  key: "0"
39
- } : void 0,
40
- e.$slots.header ? {
41
- name: "header",
42
- fn: o((t) => [
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
- e.$slots.expand ? {
48
- name: "expand",
49
- fn: o((t) => [
50
- u(e.$slots, "expand", i(p(t)))
51
- ]),
52
- key: "2"
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
- W as default
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> = (row: T, column: TableColumnCtx<T>, cellValue: any, index: number) => any;
6
- export type VroElTableColumnGroupTableColumnProps<T extends Record<string, any> = any> = Partial<Omit<VroElTableColumnProps, 'formatter' | 'renderDefault' | 'renderContent'>> & {
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?: VroElTableColumnGroupFormatter<T>;
9
+ formatter?: VroElTableColumnFormatter<T>;
11
10
  /**
12
11
  * 自定义整格内容渲染函数,优先级高于 renderContent、formatter、map。
13
12
  */
14
- renderDefault?: VroElTableColumnRender<T>;
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.15",
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.36",
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>;
@@ -1,7 +0,0 @@
1
- import { useVroElTable as e } from "./useVroElTable.js";
2
- function o() {
3
- return e;
4
- }
5
- export {
6
- o as createUseVroElTable
7
- };