br-dionysus 1.5.7 → 1.6.1

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/README.md CHANGED
@@ -926,11 +926,25 @@ const options: Option[] = [{
926
926
  ```html
927
927
 
928
928
  <template>
929
- <div>
930
- <MTable :data="tableData" @pasteData="pasteData" sole="date">
931
- <el-table-column label="Date" prop="date"/>
932
- <el-table-column prop="address" label="Address"></el-table-column>
933
- <el-table-column prop="name" label="name">
929
+ <div class="g-box">
930
+ <MTable
931
+ :data="tableData"
932
+ @pasteData="pasteData"
933
+ sole="date"
934
+ v-model:tableConfig="tableConfig"
935
+ >
936
+ <el-table-column
937
+ label="Date"
938
+ prop="date"
939
+ />
940
+ <el-table-column
941
+ prop="address"
942
+ label="Address"
943
+ ></el-table-column>
944
+ <el-table-column
945
+ prop="name"
946
+ label="name"
947
+ >
934
948
  <template #default="scope">
935
949
  <el-input v-model="scope.row.name"></el-input>
936
950
  </template>
@@ -949,6 +963,8 @@ interface User {
949
963
  tag: string;
950
964
  }
951
965
 
966
+ const tableConfig = ref<any>({})
967
+
952
968
  const tableData = ref(<User[]>[
953
969
  {
954
970
  date: '2016-05-03',
@@ -981,7 +997,11 @@ const pasteData = (obj: any, data: any) => {
981
997
  }
982
998
  </script>
983
999
 
984
- <style lang="scss"></style>
1000
+ <style lang="scss" scoped>
1001
+ .g-box {
1002
+ max-width: 1200px;
1003
+ }
1004
+ </style>
985
1005
 
986
1006
 
987
1007
  ```
@@ -2036,8 +2056,8 @@ const list = ref<{ name: string, className: string }[]>([
2036
2056
 
2037
2057
  表格组合 hook
2038
2058
  =================
2039
- ### 1) 基础用法
2040
2059
 
2060
+ ### 1) 基础用法
2041
2061
 
2042
2062
 
2043
2063
 
@@ -2061,16 +2081,20 @@ const list = ref<{ name: string, className: string }[]>([
2061
2081
 
2062
2082
  ### 4) TableTitle
2063
2083
 
2064
- | 名称 | 描述 | 类型 |
2065
- |---------------|----------------------------------------------------------------------|---------------------------------------------|
2066
- | label | 显示的标题 | string |
2067
- | prop | 字段对应列的字段名字也可以使用 property属性 | string |
2068
- | minWidth? | 对应列的最小宽度与 width 的区别是 width 是固定的,min-width 会按比例分配剩余宽度 | number ,string, |
2069
- | className? | 列的className | string |
2070
- | sortable | 列是否能够排序 则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 */ | Boolean |
2071
- | filters? | 据过滤的选项, 数组格式,数组中的元素需要有 text value 属性。 数组中的每个元素都需要有 text value 属性 | {text:string,number,value:string,number} [] |
2072
- | filterMethod? | 数据过滤使用的方法, 如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示 | Function |
2073
- | headerAlign? | 表头对齐方式, 若不设置该项,则使用表格的对齐方式 | 'left' , 'center' , 'right' |
2084
+ | 名称 | 描述 | 类型 | 是否必填 |
2085
+ |--------------|---------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|------|
2086
+ | label | 显示的标题 | string | 是 |
2087
+ | prop | 字段对应列的字段名字也可以使用 property属性 | string | 是 |
2088
+ | minWidth | 对应列的最小宽度与 width 的区别是 width 是固定的,min-width 会按比例分配剩余宽度 | number \| string | 否 |
2089
+ | className | 列的className | boolean \| string | 否 |
2090
+ | sortable | 列是否能够排序 则代表用户希望远程排序,需要监听 Table 的 sort-change 事件 | Boolean | 否 |
2091
+ | sortBy | 指定数据按照哪个属性进行排序,仅当 sortable 设置为 true 且没有设置 sort-method 的时候有效。 如果 sort-by 为数组,则先按照第 1 个属性排序,如果第 1 个相等,再按照第 2 个排序,以此类推 | (row: any, index: number) => string \| string \| string[] | 否 |
2092
+ | sortOrders | 数据在排序时所使用排序策略的轮转顺序,仅当 sortable true 时有效。 需传入一个数组,随着用户点击表头,该列依次按照数组中元素的顺序进行排序 | ('ascending' \| 'descending' \| null)[] | 否 |
2093
+ | filters | 据过滤的选项, 数组格式,数组中的元素需要有 text value 属性。 数组中的每个元素都需要有 text 和 value 属性 | {text:string,number,value:string,number} [] | 否 |
2094
+ | filterMethod | 数据过滤使用的方法, 如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示 | Function | 否 |
2095
+ | headerAlign | 表头对齐方式, 若不设置该项,则使用表格的对齐方式 | 'left' \| 'center' \| 'right' | 否 |
2096
+ | align | 对齐方式 | 'left' \| 'center' \| 'right' | 否 |
2097
+ | fixed | 列是否固定在左侧或者右侧。 true 表示固定在左侧 | 'left' \| 'right' \| boolean | 否 |
2074
2098
 
2075
2099
 
2076
2100
 
@@ -2981,11 +3005,25 @@ const options: Option[] = [{
2981
3005
  ```html
2982
3006
 
2983
3007
  <template>
2984
- <div>
2985
- <MTable :data="tableData" @pasteData="pasteData" sole="date">
2986
- <el-table-column label="Date" prop="date"/>
2987
- <el-table-column prop="address" label="Address"></el-table-column>
2988
- <el-table-column prop="name" label="name">
3008
+ <div class="g-box">
3009
+ <MTable
3010
+ :data="tableData"
3011
+ @pasteData="pasteData"
3012
+ sole="date"
3013
+ v-model:tableConfig="tableConfig"
3014
+ >
3015
+ <el-table-column
3016
+ label="Date"
3017
+ prop="date"
3018
+ />
3019
+ <el-table-column
3020
+ prop="address"
3021
+ label="Address"
3022
+ ></el-table-column>
3023
+ <el-table-column
3024
+ prop="name"
3025
+ label="name"
3026
+ >
2989
3027
  <template #default="scope">
2990
3028
  <el-input v-model="scope.row.name"></el-input>
2991
3029
  </template>
@@ -3004,6 +3042,8 @@ interface User {
3004
3042
  tag: string;
3005
3043
  }
3006
3044
 
3045
+ const tableConfig = ref<any>({})
3046
+
3007
3047
  const tableData = ref(<User[]>[
3008
3048
  {
3009
3049
  date: '2016-05-03',
@@ -3036,7 +3076,11 @@ const pasteData = (obj: any, data: any) => {
3036
3076
  }
3037
3077
  </script>
3038
3078
 
3039
- <style lang="scss"></style>
3079
+ <style lang="scss" scoped>
3080
+ .g-box {
3081
+ max-width: 1200px;
3082
+ }
3083
+ </style>
3040
3084
 
3041
3085
 
3042
3086
  ```
package/attributes.json CHANGED
@@ -1 +1 @@
1
- {"m-dialog/modelValue":{"type":"boolean","description":""},"m-dialog/width":{"type":"string | number","description":"对话框的宽度,默认值为 50%"},"m-dialog/resize":{"type":"boolean","description":"是否开启拖拽改变大小"},"m-dialog/draggable":{"type":"boolean","description":"是否可拖动"},"m-dialog/resized":{"type":"[contentsSize: { width: number, height: number }]","description":"窗口大小改变完成事件"},"m-inline/minWidth":{"type":"number","description":"列最小宽度"},"m-inline/maxWidth":{"type":"number","description":"列最大宽度"},"m-inline/size":{"type":"Size","description":"组件尺寸"},"m-inline/switch":{"type":"[status: boolean]","description":"切换折叠展开事件"},"m-input-number/modelValue":{"type":"string | number","description":""},"m-input-number/placeholder":{"type":"string","description":""},"m-input-number/disabled":{"type":"boolean","description":"是否禁用数值输入框"},"m-input-number/size":{"type":"string","description":"数值输入框尺寸"},"m-input-number/min":{"type":"number","description":"设置数值输入框允许的最小值"},"m-input-number/max":{"type":"number","description":"设置数值输入框允许的最大值"},"m-input-number/step":{"type":"number","description":"数值输入框步长"},"m-input-number/stepStrictly":{"type":"boolean","description":"是否只能输入 step 的倍数"},"m-input-number/thousandthPlace":{"type":"boolean","description":"输入框是否显示千分位"},"m-input-number/noBorder":{"type":"boolean","description":"是否不要边框"},"m-input-number/noSpacing":{"type":"boolean","description":"不要边距"},"m-input-number/update:modelValue":{"type":"any","description":""},"m-input-number/change":{"type":"any","description":""},"m-input-number/focus":{"type":"any","description":""},"m-input-number/blur":{"type":"any","description":""},"m-select/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select/multiple":{"type":"boolean","description":"多选"},"m-select-table/modelValue":{"type":"string | number | Array<number | string>","description":""},"m-select-table/name":{"type":"string | number | Array<number | string>","description":"显示值"},"m-select-table/placeholder":{"type":"string","description":""},"m-select-table/disabled":{"type":"boolean","description":""},"m-select-table/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table/total":{"type":"number | null","description":"总数据量,当有值时,出现分页器"},"m-select-table/filterMethod":{"type":"Function | null","description":"自定义搜索"},"m-select-table/filterable":{"type":"boolean","description":"是否使用搜索"},"m-select-table/remote":{"type":"boolean","description":"是否使用 远程搜索"},"m-select-table/remoteMethod":{"type":"Function","description":"自定义远程搜索"},"m-select-table/options":{"type":"Option[]","description":""},"m-select-table/tableTitle":{"type":"TableTitle[]","description":""},"m-select-table/multiple":{"type":"boolean","description":"是否多选"},"m-select-table/keywords":{"type":"Option","description":"定义默认的 label 和value"},"m-select-table/reserveSelection":{"type":"boolean","description":"是否开启翻页多选"},"m-select-table/tableHeight":{"type":"string | number","description":""},"m-select-table/isAffirmBtn":{"type":"boolean","description":"是否有确认按钮"},"m-select-table/scrollbarAlwaysOn":{"type":"boolean","description":"是否常态显示滚动条"},"m-select-table/allowCreate":{"type":"boolean","description":"是否能够创建条目"},"m-select-table/border":{"type":"boolean","description":"表格边框"},"m-select-table/popupWidth":{"type":"number | string","description":"弹窗的宽度"},"m-select-table/selected":{"type":"[values: string | number | Array<string | number>, rows: Option[] | Option]","description":"单选或多选之后的回调"},"m-select-table/selectMultiple":{"type":"[values: Array<string | number>, rows: Option[]]","description":"多选确认按钮时的回调 配合isAffirmBtn使用"},"m-select-table/toPage":{"type":"[page: Page, query?: string]","description":"当没有使用filterMethod时候才会有回调否则没有"},"m-select-table/update:modelValue":{"type":"[value: string | number | Array<string | number>]","description":""},"m-select-table/clear":{"type":"[]","description":"用户点击清空按钮时触发"},"m-select-table/removeTag":{"type":"[tag: any]","description":"多选模式下移除tag时触发"},"m-select-table-v1/modelValue":{"type":"string | number","description":""},"m-select-table-v1/placeholder":{"type":"string","description":""},"m-select-table-v1/disabled":{"type":"boolean","description":""},"m-select-table-v1/options":{"type":"Option[]","description":""},"m-select-table-v1/tableTitle":{"type":"any[]","description":""},"m-select-table-v1/remoteMethod":{"type":"Function","description":""},"m-select-table-v1/allowCreate":{"type":"boolean","description":""},"m-select-table-v1/focusShow":{"type":"boolean","description":""},"m-select-table-v1/isSelect":{"type":"boolean","description":""},"m-select-table-v1/clearable":{"type":"boolean","description":""},"m-select-table-v1/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table-v1/labelKey":{"type":"string","description":""},"m-select-table-v1/scrollbarAlwaysOn":{"type":"boolean","description":""},"m-select-table-v1/total":{"type":"number | null","description":""},"m-select-table-v1/update:modelValue":{"type":"any","description":""},"m-select-table-v1/selectMultiple":{"type":"any","description":""},"m-select-table-v1/change":{"type":"any","description":""},"m-select-table-v1/selected":{"type":"any","description":""},"m-select-table-v1/clear":{"type":"any","description":""},"m-select-v2/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select-v2/multiple":{"type":"boolean","description":"多选"},"m-select-v2/showAll":{"type":"boolean","description":"是否显示全选"},"m-select-v2/options":{"type":"Option[]","description":"选项"},"m-select-v2/update:modelValue":{"type":"[data: any]","description":""},"m-table/sole":{"type":"string","description":""},"m-table/data":{"type":"Array<{\n [key: string]: string | number\n }>","description":""},"m-table/filtersValue":{"type":"FilterValue","description":""},"m-table/pasteData":{"type":"[data: {\n /** 粘贴行的行数据 */\n editRow: { [key: string]: any },\n /** 粘贴列的列名 */\n editColumn: string,\n /** 粘贴的数据 */\n arr: Array<string | number>,\n /** 起始行 */\n rowIndex: number,\n },\n /** 粘贴完成后的表格数据 */\n tableData: Array<{ [key: string]: any\n }>]","description":""},"m-table-column/filtersValue":{"type":"FilterValue","description":"过滤值"},"m-table-column/filters":{"type":"Array<{ text: string | number, value: string | number }>","description":"过滤选项"},"m-table-column/filterMethod":{"type":"Function | null","description":"过滤方法"},"m-table-column/children":{"type":"Array<PropChildren>","description":""},"m-table-column/update:filtersValue":{"type":"any","description":""},"m-table-column-set/modelValue":{"type":"TableConfig","description":"配置"},"m-table-column-set/foldMode":{"type":"boolean","description":"是否为折叠模式"},"m-table-column-set/link":{"type":"boolean","description":"是否为链接按钮"},"m-table-column-set/update:modelValue":{"type":"any","description":""},"skin-config/change":{"type":"any","description":""},"tab-page/modelValue":{"type":"MenuItem[]","description":""},"tab-page/activeKey":{"type":"string","description":""},"tab-page/showRightClickMenu":{"type":"boolean","description":""},"tab-page/primaryColor":{"type":"string","description":""},"tab-page/primaryBackgroundColor":{"type":"string | null","description":""},"tab-page/close":{"type":"any","description":""},"tab-page/click":{"type":"any","description":""}}
1
+ {"m-dialog/modelValue":{"type":"boolean","description":""},"m-dialog/width":{"type":"string | number","description":"对话框的宽度,默认值为 50%"},"m-dialog/resize":{"type":"boolean","description":"是否开启拖拽改变大小"},"m-dialog/draggable":{"type":"boolean","description":"是否可拖动"},"m-dialog/resized":{"type":"[contentsSize: { width: number, height: number }]","description":"窗口大小改变完成事件"},"m-inline/minWidth":{"type":"number","description":"列最小宽度"},"m-inline/maxWidth":{"type":"number","description":"列最大宽度"},"m-inline/size":{"type":"Size","description":"组件尺寸"},"m-inline/switch":{"type":"[status: boolean]","description":"切换折叠展开事件"},"m-input-number/modelValue":{"type":"string | number","description":""},"m-input-number/placeholder":{"type":"string","description":""},"m-input-number/disabled":{"type":"boolean","description":"是否禁用数值输入框"},"m-input-number/size":{"type":"string","description":"数值输入框尺寸"},"m-input-number/min":{"type":"number","description":"设置数值输入框允许的最小值"},"m-input-number/max":{"type":"number","description":"设置数值输入框允许的最大值"},"m-input-number/step":{"type":"number","description":"数值输入框步长"},"m-input-number/stepStrictly":{"type":"boolean","description":"是否只能输入 step 的倍数"},"m-input-number/thousandthPlace":{"type":"boolean","description":"输入框是否显示千分位"},"m-input-number/noBorder":{"type":"boolean","description":"是否不要边框"},"m-input-number/noSpacing":{"type":"boolean","description":"不要边距"},"m-input-number/update:modelValue":{"type":"any","description":""},"m-input-number/change":{"type":"any","description":""},"m-input-number/focus":{"type":"any","description":""},"m-input-number/blur":{"type":"any","description":""},"m-select/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select/multiple":{"type":"boolean","description":"多选"},"m-select-table/modelValue":{"type":"string | number | Array<number | string>","description":""},"m-select-table/name":{"type":"string | number | Array<number | string>","description":"显示值"},"m-select-table/placeholder":{"type":"string","description":""},"m-select-table/disabled":{"type":"boolean","description":""},"m-select-table/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table/total":{"type":"number | null","description":"总数据量,当有值时,出现分页器"},"m-select-table/filterMethod":{"type":"Function | null","description":"自定义搜索"},"m-select-table/filterable":{"type":"boolean","description":"是否使用搜索"},"m-select-table/remote":{"type":"boolean","description":"是否使用 远程搜索"},"m-select-table/remoteMethod":{"type":"Function","description":"自定义远程搜索"},"m-select-table/options":{"type":"Option[]","description":""},"m-select-table/tableTitle":{"type":"TableTitle[]","description":""},"m-select-table/multiple":{"type":"boolean","description":"是否多选"},"m-select-table/keywords":{"type":"Option","description":"定义默认的 label 和value"},"m-select-table/reserveSelection":{"type":"boolean","description":"是否开启翻页多选"},"m-select-table/tableHeight":{"type":"string | number","description":""},"m-select-table/isAffirmBtn":{"type":"boolean","description":"是否有确认按钮"},"m-select-table/scrollbarAlwaysOn":{"type":"boolean","description":"是否常态显示滚动条"},"m-select-table/allowCreate":{"type":"boolean","description":"是否能够创建条目"},"m-select-table/border":{"type":"boolean","description":"表格边框"},"m-select-table/popupWidth":{"type":"number | string","description":"弹窗的宽度"},"m-select-table/selected":{"type":"[values: string | number | Array<string | number>, rows: Option[] | Option]","description":"单选或多选之后的回调"},"m-select-table/selectMultiple":{"type":"[values: Array<string | number>, rows: Option[]]","description":"多选确认按钮时的回调 配合isAffirmBtn使用"},"m-select-table/toPage":{"type":"[page: Page, query?: string]","description":"当没有使用filterMethod时候才会有回调否则没有"},"m-select-table/update:modelValue":{"type":"[value: string | number | Array<string | number>]","description":""},"m-select-table/clear":{"type":"[]","description":"用户点击清空按钮时触发"},"m-select-table/removeTag":{"type":"[tag: any]","description":"多选模式下移除tag时触发"},"m-select-table-v1/modelValue":{"type":"string | number","description":""},"m-select-table-v1/placeholder":{"type":"string","description":""},"m-select-table-v1/disabled":{"type":"boolean","description":""},"m-select-table-v1/options":{"type":"Option[]","description":""},"m-select-table-v1/tableTitle":{"type":"any[]","description":""},"m-select-table-v1/remoteMethod":{"type":"Function","description":""},"m-select-table-v1/allowCreate":{"type":"boolean","description":""},"m-select-table-v1/focusShow":{"type":"boolean","description":""},"m-select-table-v1/isSelect":{"type":"boolean","description":""},"m-select-table-v1/clearable":{"type":"boolean","description":""},"m-select-table-v1/size":{"type":"'small' | 'large' | ''","description":""},"m-select-table-v1/labelKey":{"type":"string","description":""},"m-select-table-v1/scrollbarAlwaysOn":{"type":"boolean","description":""},"m-select-table-v1/total":{"type":"number | null","description":""},"m-select-table-v1/update:modelValue":{"type":"any","description":""},"m-select-table-v1/selectMultiple":{"type":"any","description":""},"m-select-table-v1/change":{"type":"any","description":""},"m-select-table-v1/selected":{"type":"any","description":""},"m-select-table-v1/clear":{"type":"any","description":""},"m-select-v2/checkboxMode":{"type":"boolean","description":"是否为checkbox模式"},"m-select-v2/multiple":{"type":"boolean","description":"多选"},"m-select-v2/showAll":{"type":"boolean","description":"是否显示全选"},"m-select-v2/options":{"type":"Option[]","description":"选项"},"m-select-v2/update:modelValue":{"type":"[data: any]","description":""},"m-table/sole":{"type":"string","description":""},"m-table/data":{"type":"Array<{\n [key: string]: string | number\n }>","description":""},"m-table/filtersValue":{"type":"FilterValue","description":""},"m-table/tableConfig":{"type":"TableConfig | null","description":"表格配置"},"m-table/pasteData":{"type":"[data: {\n /** 粘贴行的行数据 */\n editRow: { [key: string]: any },\n /** 粘贴列的列名 */\n editColumn: string,\n /** 粘贴的数据 */\n arr: Array<string | number>,\n /** 起始行 */\n rowIndex: number,\n },\n /** 粘贴完成后的表格数据 */\n tableData: Array<{ [key: string]: any\n }>]","description":""},"m-table/update:tableConfig":{"type":"[tableConfig: TableConfig]","description":""},"m-table-column/filtersValue":{"type":"FilterValue","description":"过滤值"},"m-table-column/filters":{"type":"Array<{ text: string | number, value: string | number }>","description":"过滤选项"},"m-table-column/filterMethod":{"type":"Function | null","description":"过滤方法"},"m-table-column/children":{"type":"Array<PropChildren>","description":""},"m-table-column/update:filtersValue":{"type":"any","description":""},"m-table-column-set/modelValue":{"type":"TableConfig","description":"配置"},"m-table-column-set/foldMode":{"type":"boolean","description":"是否为折叠模式"},"m-table-column-set/link":{"type":"boolean","description":"是否为链接按钮"},"m-table-column-set/update:modelValue":{"type":"any","description":""},"m-table-column-set/change":{"type":"any","description":""},"skin-config/change":{"type":"any","description":""},"tab-page/modelValue":{"type":"MenuItem[]","description":""},"tab-page/activeKey":{"type":"string","description":""},"tab-page/showRightClickMenu":{"type":"boolean","description":""},"tab-page/primaryColor":{"type":"string","description":""},"tab-page/primaryBackgroundColor":{"type":"string | null","description":""},"tab-page/close":{"type":"any","description":""},"tab-page/click":{"type":"any","description":""}}