@hufe921/canvas-editor 0.9.79 → 0.9.80
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/CHANGELOG.md +25 -0
- package/dist/canvas-editor.es.js +2218 -1860
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +37 -37
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +1 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +1 -0
- package/dist/src/editor/core/draw/control/date/DateControl.d.ts +24 -0
- package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +8 -7
- package/dist/src/editor/dataset/enum/Control.d.ts +2 -1
- package/dist/src/editor/interface/Control.d.ts +4 -5
- package/package.json +1 -1
|
@@ -89,6 +89,7 @@ export declare class Command {
|
|
|
89
89
|
executeSetControlProperties: CommandAdapt['setControlProperties'];
|
|
90
90
|
executeSetControlHighlight: CommandAdapt['setControlHighlight'];
|
|
91
91
|
executeUpdateOptions: CommandAdapt['updateOptions'];
|
|
92
|
+
executeInsertTitle: CommandAdapt['insertTitle'];
|
|
92
93
|
getCatalog: CommandAdapt['getCatalog'];
|
|
93
94
|
getImage: CommandAdapt['getImage'];
|
|
94
95
|
getOptions: CommandAdapt['getOptions'];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IControlContext, IControlInstance, IControlRuleOption } from '../../../../interface/Control';
|
|
2
|
+
import { IElement } from '../../../../interface/Element';
|
|
3
|
+
import { Control } from '../Control';
|
|
4
|
+
export declare class DateControl implements IControlInstance {
|
|
5
|
+
private draw;
|
|
6
|
+
private element;
|
|
7
|
+
private control;
|
|
8
|
+
private isPopup;
|
|
9
|
+
private datePicker;
|
|
10
|
+
constructor(element: IElement, control: Control);
|
|
11
|
+
setElement(element: IElement): void;
|
|
12
|
+
getElement(): IElement;
|
|
13
|
+
getIsPopup(): boolean;
|
|
14
|
+
getValueRange(context?: IControlContext): [number, number] | null;
|
|
15
|
+
getValue(context?: IControlContext): IElement[];
|
|
16
|
+
setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
|
|
17
|
+
clearSelect(context?: IControlContext, options?: IControlRuleOption): number;
|
|
18
|
+
setSelect(date: string, context?: IControlContext, options?: IControlRuleOption): void;
|
|
19
|
+
keydown(evt: KeyboardEvent): number | null;
|
|
20
|
+
cut(): number;
|
|
21
|
+
awake(): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
private _setDate;
|
|
24
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IElementPosition } from '../../../../interface/Element';
|
|
2
|
+
import { Draw } from '../../Draw';
|
|
2
3
|
export interface IDatePickerLang {
|
|
3
4
|
now: string;
|
|
4
5
|
confirm: string;
|
|
@@ -20,17 +21,15 @@ export interface IDatePickerLang {
|
|
|
20
21
|
second: string;
|
|
21
22
|
}
|
|
22
23
|
export interface IDatePickerOption {
|
|
23
|
-
mountDom?: HTMLElement;
|
|
24
24
|
onSubmit?: (date: string) => any;
|
|
25
|
-
getLang?: () => IDatePickerLang;
|
|
26
25
|
}
|
|
27
26
|
interface IRenderOption {
|
|
28
27
|
value: string;
|
|
29
|
-
element: IElement;
|
|
30
28
|
position: IElementPosition;
|
|
31
|
-
|
|
29
|
+
dateFormat?: string;
|
|
32
30
|
}
|
|
33
31
|
export declare class DatePicker {
|
|
32
|
+
private draw;
|
|
34
33
|
private options;
|
|
35
34
|
private now;
|
|
36
35
|
private dom;
|
|
@@ -38,13 +37,14 @@ export declare class DatePicker {
|
|
|
38
37
|
private isDatePicker;
|
|
39
38
|
private pickDate;
|
|
40
39
|
private lang;
|
|
41
|
-
constructor(options?: IDatePickerOption);
|
|
40
|
+
constructor(draw: Draw, options?: IDatePickerOption);
|
|
42
41
|
private _createDom;
|
|
43
42
|
private _bindEvent;
|
|
44
43
|
private _setPosition;
|
|
45
44
|
isInvalidDate(value: Date): boolean;
|
|
46
45
|
private _setValue;
|
|
47
|
-
private
|
|
46
|
+
private _getLang;
|
|
47
|
+
private _setLangChange;
|
|
48
48
|
private _update;
|
|
49
49
|
private _toggleDateTimePicker;
|
|
50
50
|
private _setDatePick;
|
|
@@ -60,5 +60,6 @@ export declare class DatePicker {
|
|
|
60
60
|
formatDate(date: Date, format?: string): string;
|
|
61
61
|
render(option: IRenderOption): void;
|
|
62
62
|
dispose(): void;
|
|
63
|
+
destroy(): void;
|
|
63
64
|
}
|
|
64
65
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ControlType, ControlIndentation } from '../dataset/enum/Control';
|
|
2
2
|
import { EditorZone } from '../dataset/enum/Editor';
|
|
3
3
|
import { MoveDirection } from '../dataset/enum/Observer';
|
|
4
|
-
import { ICheckbox } from './Checkbox';
|
|
5
4
|
import { IDrawOption } from './Draw';
|
|
6
5
|
import { IElement } from './Element';
|
|
7
6
|
import { IPositionContext } from './Position';
|
|
8
|
-
import { IRadio } from './Radio';
|
|
9
7
|
import { IRange } from './Range';
|
|
10
8
|
export interface IValueSet {
|
|
11
9
|
value: string;
|
|
@@ -20,12 +18,13 @@ export interface IControlCheckbox {
|
|
|
20
18
|
min?: number;
|
|
21
19
|
max?: number;
|
|
22
20
|
valueSets: IValueSet[];
|
|
23
|
-
checkbox?: ICheckbox;
|
|
24
21
|
}
|
|
25
22
|
export interface IControlRadio {
|
|
26
23
|
code: string | null;
|
|
27
24
|
valueSets: IValueSet[];
|
|
28
|
-
|
|
25
|
+
}
|
|
26
|
+
export interface IControlDate {
|
|
27
|
+
dateFormat?: string;
|
|
29
28
|
}
|
|
30
29
|
export interface IControlHighlightRule {
|
|
31
30
|
keyword: string;
|
|
@@ -61,7 +60,7 @@ export interface IControlStyle {
|
|
|
61
60
|
italic?: boolean;
|
|
62
61
|
strikeout?: boolean;
|
|
63
62
|
}
|
|
64
|
-
export type IControl = IControlBasic & IControlRule & Partial<IControlSelect> & Partial<IControlCheckbox> & Partial<IControlRadio> & Partial<
|
|
63
|
+
export type IControl = IControlBasic & IControlRule & Partial<IControlStyle> & Partial<IControlSelect> & Partial<IControlCheckbox> & Partial<IControlRadio> & Partial<IControlDate>;
|
|
65
64
|
export interface IControlOption {
|
|
66
65
|
placeholderColor?: string;
|
|
67
66
|
bracketColor?: string;
|