sync
This commit is contained in:
1 parent
5cb14ffd44
commit
05ce7035dd
15 files changed
+946
-460
No files matched your search
Vendored
+132
-10
@@ -9,6 +9,40 @@ export interface OptionParamBase {
|
||||
getText?: GetTextCallback;
|
||||
}
|
||||
|
||||
export interface RectLike {
|
||||
top?: number;
|
||||
left?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
export type BoxRect = Required<Omit<RectLike, 'zIndex'>>;
|
||||
|
||||
export interface SnapLine {
|
||||
axis: 'x' | 'y';
|
||||
pos: number;
|
||||
}
|
||||
|
||||
export interface MovableOptions<T = void> {
|
||||
movable: boolean;
|
||||
resizable: boolean;
|
||||
minSize?: number;
|
||||
snapThreshold?: number;
|
||||
snapToContainer?: boolean;
|
||||
snapToSiblings?: boolean;
|
||||
hoverSelector?: string;
|
||||
hoverIgnore?: string;
|
||||
dragSelector?: string;
|
||||
resizerSelector?: string;
|
||||
rootDragClass?: string;
|
||||
context?: T;
|
||||
onMoved?(this: T | undefined, rect: BoxRect): void;
|
||||
onResizeStart?(this: T | undefined): void;
|
||||
onResized?(this: T | undefined, rect: BoxRect): void;
|
||||
onSnap?(this: T | undefined, guides: SnapLine[]): void;
|
||||
}
|
||||
|
||||
export type MarkRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
||||
|
||||
export interface NotifyOption {
|
||||
@@ -31,17 +65,13 @@ export interface PopupRectParam {
|
||||
}
|
||||
|
||||
export interface Popup {
|
||||
constructor(opts?: PopupOptions): void;
|
||||
readonly container: HTMLElement | undefined;
|
||||
|
||||
get container(): HTMLElement;
|
||||
title: string | HTMLElement;
|
||||
|
||||
get title(): string;
|
||||
set title(title: string);
|
||||
loading: boolean;
|
||||
|
||||
get loading(): boolean;
|
||||
set loading(flag: boolean);
|
||||
|
||||
get rect(): PopupRectParam | null;
|
||||
get rect(): PopupRectParam | undefined;
|
||||
set rect(r: PopupRectParam);
|
||||
|
||||
close(result?: any, animation?: boolean): void;
|
||||
@@ -52,10 +82,10 @@ export interface Popup {
|
||||
export interface PopupButton {
|
||||
className?: string;
|
||||
tabIndex?: number;
|
||||
key: string;
|
||||
key?: string;
|
||||
text: string;
|
||||
isPrimary?: boolean;
|
||||
trigger: (this: Popup) => boolean | Promise<boolean>;
|
||||
trigger?: (popup: Popup, button?: PopupButton) => boolean | Promise<boolean> | string | number;
|
||||
}
|
||||
|
||||
export interface PopupOptions {
|
||||
@@ -123,6 +153,13 @@ export interface PopupOptions {
|
||||
resolve?: (this: Popup, result: { result: any, popup: Popup }) => void;
|
||||
}
|
||||
|
||||
export interface InputOptions {
|
||||
tabIndex?: number;
|
||||
default?: string;
|
||||
placeholder?: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 复选框选项
|
||||
*/
|
||||
@@ -162,3 +199,88 @@ export interface CheckboxOptions {
|
||||
*/
|
||||
onchange?: (this: HTMLInputElement, ev: Event) => any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据项基础类型
|
||||
*/
|
||||
export interface DropdownItemBase {
|
||||
__checked?: 0 | 1 | 2 | undefined;
|
||||
__p?: string;
|
||||
__level?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据项类型
|
||||
*/
|
||||
export type DropdownItem = DropdownItemBase & Record<string, any>;
|
||||
|
||||
|
||||
export interface Dropdown {
|
||||
sourceFilter?: (this: Dropdown) => DropdownItem[];
|
||||
onSelectedList?: (this: Dropdown, list: DropdownItem[]) => void;
|
||||
onSelected?: (this: Dropdown, it?: DropdownItem) => void;
|
||||
onExpanded?: (this: Dropdown) => void;
|
||||
onCollapsed?: (this: Dropdown) => void;
|
||||
|
||||
create(): HTMLDivElement;
|
||||
|
||||
readonly multiSelect?: boolean;
|
||||
readonly ignoreAll?: boolean;
|
||||
disabled: boolean;
|
||||
source: DropdownItem[];
|
||||
readonly selected?: DropdownItem;
|
||||
readonly selectedList: DropdownItem[];
|
||||
|
||||
select(selected?: string, silence?: boolean, ignoreCase?: boolean): boolean | undefined;
|
||||
selectlist(selectedlist: string[], silence: boolean): boolean | undefined;
|
||||
}
|
||||
|
||||
/** 下拉列表参数对象 */
|
||||
export interface DropdownOptions {
|
||||
/** 文本关键字 */
|
||||
textKey?: string;
|
||||
/** 值关键字 */
|
||||
valueKey?: string;
|
||||
/** 源码显示的关键字 */
|
||||
htmlKey?: string;
|
||||
/** 子集合的关键字 */
|
||||
childKey?: string;
|
||||
/** 最大输入长度 */
|
||||
maxLength?: number;
|
||||
/**
|
||||
* 模板创建函数
|
||||
* @param this 当前Dropdown
|
||||
* @param it 下拉项目
|
||||
* @returns 返回渲染的字符串
|
||||
*/
|
||||
htmlTemplate?: (this: Dropdown, it: DropdownItem) => string;
|
||||
/** 是否允许多选 */
|
||||
multiSelect?: boolean;
|
||||
/** 选中值 */
|
||||
selected?: string;
|
||||
/** 选中的数组 */
|
||||
selectedList?: string[];
|
||||
/** 是否禁用 */
|
||||
disabled?: boolean;
|
||||
/** 是否支持输入 */
|
||||
input?: boolean;
|
||||
/** 是否支持搜索 */
|
||||
search?: boolean;
|
||||
/** 搜索的关键字数组 */
|
||||
searchKeys?: string[];
|
||||
/** 搜索提示文本,默认值取语言资源 `searchHolder` "Search..." */
|
||||
searchPlaceholder?: string;
|
||||
/** 焦点索引 */
|
||||
tabIndex?: number;
|
||||
/** 输入框的提示文本 */
|
||||
placeholder?: string;
|
||||
/** 是否固定为向下展开 */
|
||||
slideFixed?: boolean;
|
||||
/** 父元素,默认添加到头元素之后 */
|
||||
wrapper?: HTMLElement;
|
||||
/** 是否忽略 All 选项 */
|
||||
ignoreAll?: boolean;
|
||||
/** 获取文本的代理函数 */
|
||||
getText?: GetTextCallback;
|
||||
}
|
||||
Reference in new issue
Block a user