.
This commit is contained in:
@ -339,39 +339,39 @@ class GridColumnDefinition {
|
||||
/**
|
||||
* 列关键字,默认以该关键字从行数据中提取单元格值,行数据的关键字属性值里包含 DisplayValue 则优先显示此值
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
key;
|
||||
/**
|
||||
* 列的类型,可以为 {@linkcode GridColumn} 的子类,或者内置类型 {@linkcode Grid.ColumnTypes}
|
||||
* @type {(GridColumnTypeEnum | GridColumn)}
|
||||
* @default Grid.ColumnTypes.Common
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
type;
|
||||
/**
|
||||
* 列标题文本
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
caption;
|
||||
/**
|
||||
* 列标题的元素样式
|
||||
* @type {any}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
captionStyle;
|
||||
/**
|
||||
* 大于 0 则设置为该宽度,否则根据列内容自动调整列宽
|
||||
* @type {number}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
width;
|
||||
/**
|
||||
* 列对齐方式
|
||||
* @type {("left" |"center" | "right")}
|
||||
* @default "left"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
align;
|
||||
/**
|
||||
@ -381,199 +381,199 @@ class GridColumnDefinition {
|
||||
* * `string` 则以该值为关键字从行数据中取值作为判断条件
|
||||
* * `GridItemBooleanCallback` 则调用如下回调,以返回值作为判断条件
|
||||
* @type {(boolean | string | GridItemBooleanCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
enabled;
|
||||
/**
|
||||
* 单元格取值采用该函数返回的值
|
||||
* @type {GridItemFilterCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filter;
|
||||
/**
|
||||
* 单元格以该值填充内容,忽略filter与关键字属性
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
text;
|
||||
/**
|
||||
* 列是否可见
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
visible;
|
||||
/**
|
||||
* 列是否允许调整宽度
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
resizable;
|
||||
/**
|
||||
* 列是否允许排序
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sortable;
|
||||
/**
|
||||
* 列是否允许重排顺序
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
orderable;
|
||||
/**
|
||||
* 列为复选框类型时是否在列头增加全选复选框
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
allcheck;
|
||||
/**
|
||||
* 列为收缩列,禁用自动调整大小
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
shrink;
|
||||
/**
|
||||
* 单元格元素的额外样式类型字符串(仅在重建行元素时读取)
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
class;
|
||||
/**
|
||||
* 单元格css样式对象(仅在重建行元素时读取)
|
||||
* @type {any}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
css;
|
||||
/**
|
||||
* 合计行样式(仅在重建合计行元素时读取)
|
||||
* @type {any}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
totalCss;
|
||||
/**
|
||||
* 单元格样式(填充行列数据时读取),支持直接返回样式对象或调用函数返回(若赋值则忽略 [styleFilter]{@linkcode GridColumnDefinition#styleFilter})
|
||||
* @type {(any | GridItemObjectCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
style;
|
||||
/**
|
||||
* **已过时**<br/>_根据返回值填充单元格样式(填充行列数据时读取)_
|
||||
* @type {GridItemObjectCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
* @deprecated
|
||||
*/
|
||||
styleFilter;
|
||||
/**
|
||||
* 设置单元格背景色(填充行列数据时读取),支持直接设置颜色字符串或调用函数返回(若赋值则忽略 [bgFilter]{@linkcode GridColumnDefinition#bgFilter})
|
||||
* @type {(string | GridItemStringCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
background;
|
||||
/**
|
||||
* **已过时**<br/>_根据返回值设置单元格背景色_
|
||||
* @type {GridItemStringCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
* @deprecated
|
||||
*/
|
||||
bgFilter;
|
||||
/**
|
||||
* 给单元格元素附加事件(事件函数上下文为数据行对象)
|
||||
* @type {Map<string, Function>}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
events;
|
||||
/**
|
||||
* 根据返回值设置单元格元素的附加属性,允许直接设置对象也支持调用如下函数返回对象
|
||||
* @type {(any | GridItemObjectCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
attrs;
|
||||
/**
|
||||
* 是否允许进行列头过滤
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
allowFilter;
|
||||
/**
|
||||
* 过滤值的数组
|
||||
* @type {any[]}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filterValues;
|
||||
/**
|
||||
* 是否区分 `null` 与空字符串
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filterAllowNull;
|
||||
/**
|
||||
* 自定义列过滤器的数据源,允许调用如下函数
|
||||
* @type {(ValueItem[] | GridColumnFilterSourceCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filterSource;
|
||||
/**
|
||||
* 自定义列排序函数
|
||||
* @type {GridItemSortCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sortFilter;
|
||||
/**
|
||||
* 列为下拉列表类型时以该值设置下拉框的参数
|
||||
* @type {DropdownOptions}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
dropOptions;
|
||||
/**
|
||||
* 列为下拉列表类型时以该值设置下拉列表数据源,支持返回异步对象,也支持如下函数返回
|
||||
* @type {(GridSourceItem[] | Promise<GridSourceItem[]> | GridDropdownSourceCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
source;
|
||||
/**
|
||||
* 下拉列表数据源是否缓存结果(即行数据未发生变化时仅从source属性获取一次值)
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sourceCache;
|
||||
/**
|
||||
* 列为图标类型时以该值设置图标样式
|
||||
* @type {("fa-light" | "fa-regular" | "fa-solid")}
|
||||
* @default "fa-light"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
iconType;
|
||||
/**
|
||||
* 列为日期类型时以该值作为最小可选日期值
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
dateMin;
|
||||
/**
|
||||
* 列为日期类型时以该值作为最大可选日期值
|
||||
* @type {string}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
dateMax;
|
||||
/**
|
||||
* 列为日期类型时自定义日期格式化函数
|
||||
* @type {DateFormatterCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
dateValueFormatter;
|
||||
/**
|
||||
* 额外设置单元格的 tooltip,支持直接使用字符串或者调用如下函数
|
||||
* @type {(string | GridItemStringCallback)}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
tooltip;
|
||||
/**
|
||||
@ -622,7 +622,7 @@ class GridColumnDefinition {
|
||||
* 列为下拉框类型时在下拉列表展开时触发的事件
|
||||
* @event
|
||||
* @param {Map<string, ValueItem>} item - 行数据对象
|
||||
* @param {Dropdown} drop - 拉框对象
|
||||
* @param {Dropdown} drop - 下拉框对象
|
||||
* @this GridColumnDefinition
|
||||
*/
|
||||
onDropExpanded;
|
||||
@ -736,6 +736,7 @@ const GridColumnDirection = {
|
||||
* @property {string} [langs.duplicatePrompt={column} is being sorted more than once...]
|
||||
* @property {number} [virtualCount=100] - 行数大于等于该值则启用虚模式
|
||||
* @property {number} [rowHeight=36] - 表格行高
|
||||
* @property {number} [lineHeight=24] - 文本行高(多行文本列计算高度时使用)
|
||||
* @property {string} [filterIcon=filter] - 列头过滤图标,旧版本样式(横着三个点)需修改为 `"ellipsis-h"`
|
||||
* @property {number} [extraRows=0] - 列表底部留出额外的空白行
|
||||
* @property {number} [filterRowHeight=30] - 过滤条件列表的行高
|
||||
@ -1023,108 +1024,108 @@ export class Grid {
|
||||
/**
|
||||
* 列定义的数组
|
||||
* @type {GridColumnDefinition[]}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
columns = [];
|
||||
/**
|
||||
* 合计行数据
|
||||
* @type {Map<string, ValueItem>}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
total = null;
|
||||
/**
|
||||
* 多语言资源对象
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
langs = {
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "( All )"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
all: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "OK"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
ok: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Reset"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
reset: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Cancel"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
cancel: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "( Null )"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
null: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Add Level"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
addLevel: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Delete Level"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
deleteLevel: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Copy Level"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
copyLevel: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Ascending"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
asc: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Descending"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
desc: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Column"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
column: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Order"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
order: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "Sort"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sort: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "All sort criteria must have a column specified. Check the selected sort criteria and try again."
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
requirePrompt: null,
|
||||
/**
|
||||
* @type {string}
|
||||
* @default "{column} is being sorted more than once. Delete the duplicate sort criteria and try again."
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
duplicatePrompt: null
|
||||
};
|
||||
@ -1132,110 +1133,117 @@ export class Grid {
|
||||
* 行数大于等于该值则启用虚模式
|
||||
* @type {number}
|
||||
* @default 100
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
virtualCount = 100;
|
||||
/**
|
||||
* 表格行高
|
||||
* @type {number}
|
||||
* @default 36
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
rowHeight = 36;
|
||||
/**
|
||||
* 文本行高(多行文本列计算高度时使用)
|
||||
* @type {number}
|
||||
* @default 24
|
||||
* @ignore
|
||||
*/
|
||||
lineHeight = 24;
|
||||
/**
|
||||
* 列头过滤图标,旧版本样式(横着三个点)需修改为 `ellipsis-h`
|
||||
* @type {string}
|
||||
* @default "filter"
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filterIcon = 'filter';
|
||||
/**
|
||||
* 列表底部留出额外的空白行
|
||||
* @type {number}
|
||||
* @default 0
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
extraRows = 0;
|
||||
/**
|
||||
* 过滤条件列表的行高
|
||||
* @type {number}
|
||||
* @default 30
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
filterRowHeight = 30;
|
||||
/**
|
||||
* 列表高度值,为 0 时列表始终显示全部内容(自增高),为非数字或者小于 0 则根据容器高度来确定虚模式的渲染行数
|
||||
* @type {number | null}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
height;
|
||||
/**
|
||||
* 是否允许多选
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
multiSelect = false;
|
||||
/**
|
||||
* 为 `false` 时只有点击在单元格内才会选中行
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
fullrowClick = true;
|
||||
/**
|
||||
* 单元格 tooltip 是否禁用
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
tooltipDisabled = false;
|
||||
/**
|
||||
* 列头是否显示
|
||||
* @type {boolean}
|
||||
* @default true
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
headerVisible = true;
|
||||
/**
|
||||
* 监听事件的窗口载体
|
||||
* @type {(Window | HTMLElement)}
|
||||
* @default window
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
window;
|
||||
/**
|
||||
* 排序列的索引
|
||||
* @type {number}
|
||||
* @default -1
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sortIndex = -1;
|
||||
/**
|
||||
* 排序方式,正数升序,负数倒序
|
||||
* @type {GridColumnDirection}
|
||||
* @default GridColumnDirection.Ascending
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sortDirection = GridColumnDirection.Ascending;
|
||||
/**
|
||||
* 排序列数组
|
||||
* @type {GridColumnSortDefinition[]}
|
||||
* @default null
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
sortArray = null;
|
||||
/**
|
||||
* 是否支持点击扩展
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
expandable;
|
||||
/**
|
||||
* 扩展行生成器
|
||||
* @type {GridExpandableObjectCallback}
|
||||
* @private
|
||||
* @ignore
|
||||
*/
|
||||
expandableGenerator;
|
||||
|
||||
|
Reference in New Issue
Block a user