@mescius/wijmo.undo 5.20232.939
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/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +339 -0
- package/index.js +14 -0
- package/package.json +48 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* {@module wijmo.undo}
|
|
15
|
+
* Defines the {@link UndoStack} and associated classes.
|
|
16
|
+
*
|
|
17
|
+
* {@link UndoStack} objects track changes made to regular HTML
|
|
18
|
+
* input elements as well as most Wijmo controls.
|
|
19
|
+
*
|
|
20
|
+
* It also handles the undo/redo keys automatically and provides
|
|
21
|
+
* commands for performing undo and redo actions programmatically.
|
|
22
|
+
*
|
|
23
|
+
* The example below creates a form with an undo/redo toolbar.
|
|
24
|
+
* You can edit the data using any controls, and undo/redo your
|
|
25
|
+
* edits at any time.
|
|
26
|
+
*
|
|
27
|
+
* {@sample Undo/UndoStack/purejs Example}
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export declare var ___keepComment: any;
|
|
33
|
+
import { CancelEventArgs, Control, Event, EventArgs } from '@grapecity/wijmo';
|
|
34
|
+
import * as mInput from '@grapecity/wijmo.input';
|
|
35
|
+
import * as wjcGrid from '@grapecity/wijmo.grid';
|
|
36
|
+
import * as wjcGauge from '@grapecity/wijmo.gauge';
|
|
37
|
+
import * as wjcNav from '@grapecity/wijmo.nav';
|
|
38
|
+
import * as selfModule from '@grapecity/wijmo.undo';
|
|
39
|
+
/**
|
|
40
|
+
* Base class for undoable actions.
|
|
41
|
+
*/
|
|
42
|
+
export declare class UndoableAction {
|
|
43
|
+
protected _target: any;
|
|
44
|
+
protected _oldState: any;
|
|
45
|
+
protected _newState: any;
|
|
46
|
+
protected _actions: UndoableAction[];
|
|
47
|
+
/**
|
|
48
|
+
* Initializes a new instance of an {@link UndoableAction}.
|
|
49
|
+
*
|
|
50
|
+
* @param target Object that the action applies to.
|
|
51
|
+
*/
|
|
52
|
+
constructor(target: any);
|
|
53
|
+
/**
|
|
54
|
+
* Undoes the action.
|
|
55
|
+
*/
|
|
56
|
+
undo(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Redoes the action.
|
|
59
|
+
*/
|
|
60
|
+
redo(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Closes the action by saving the new state.
|
|
63
|
+
* Returns true if the new state is different from the old state.
|
|
64
|
+
*/
|
|
65
|
+
close(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Applies a given state to the target object.
|
|
68
|
+
* @param state State to apply to the target object.
|
|
69
|
+
*/
|
|
70
|
+
applyState(state: any): void;
|
|
71
|
+
/**
|
|
72
|
+
* Gets a value that determines whether a given action should
|
|
73
|
+
* be added as a child action or as a new independent action.
|
|
74
|
+
*
|
|
75
|
+
* @param action {@link UndoableAction} to add to this action's
|
|
76
|
+
* child action list.
|
|
77
|
+
*/
|
|
78
|
+
shouldAddAsChildAction(action: UndoableAction): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Adds a child action to this action's child list.
|
|
81
|
+
*
|
|
82
|
+
* @param action {@link UndoableAction} to add to this action's
|
|
83
|
+
* child action list.
|
|
84
|
+
*/
|
|
85
|
+
addChildAction(action: UndoableAction): void;
|
|
86
|
+
/**
|
|
87
|
+
* Gets a reference to the action's target object.
|
|
88
|
+
*/
|
|
89
|
+
readonly target: any;
|
|
90
|
+
protected _focusScroll(): void;
|
|
91
|
+
}
|
|
92
|
+
export declare class _UndoStackHTML {
|
|
93
|
+
static addTarget(stack: UndoStack, target: HTMLElement): boolean;
|
|
94
|
+
private static _addInputElement;
|
|
95
|
+
private static _addTextAreaElement;
|
|
96
|
+
private static _addSelectElement;
|
|
97
|
+
private static _getLabel;
|
|
98
|
+
}
|
|
99
|
+
export declare class InputChangeAction extends UndoableAction {
|
|
100
|
+
_focus: boolean;
|
|
101
|
+
constructor(e: any);
|
|
102
|
+
close(): boolean;
|
|
103
|
+
applyState(state: any): void;
|
|
104
|
+
}
|
|
105
|
+
export declare class CheckboxClickAction extends UndoableAction {
|
|
106
|
+
constructor(e: MouseEvent);
|
|
107
|
+
applyState(state: any): void;
|
|
108
|
+
}
|
|
109
|
+
export declare class RadioClickAction extends UndoableAction {
|
|
110
|
+
constructor(e: any);
|
|
111
|
+
close(): boolean;
|
|
112
|
+
applyState(state: any): void;
|
|
113
|
+
_getState(): Element;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Class that provides undo/redo functionality for
|
|
117
|
+
* input elements and Wijmo controls.
|
|
118
|
+
*/
|
|
119
|
+
export declare class UndoStack {
|
|
120
|
+
static _evtInput: any;
|
|
121
|
+
_autoKbd: boolean;
|
|
122
|
+
_disabled: boolean;
|
|
123
|
+
_undoing: boolean;
|
|
124
|
+
_stack: UndoableAction[];
|
|
125
|
+
_maxActions: number;
|
|
126
|
+
_pendingAction: UndoableAction;
|
|
127
|
+
_ptr: number;
|
|
128
|
+
/**
|
|
129
|
+
* Initializes a new instance of the {@link UndoStack} class.
|
|
130
|
+
*
|
|
131
|
+
* @param target The DOM element or CSS selector for the DOM elements to be added to
|
|
132
|
+
* {@link UndoStack} context. If not provided, the whole document body is added to
|
|
133
|
+
* the context.
|
|
134
|
+
* @param options The JavaScript object containing initialization data for the
|
|
135
|
+
* {@link UndoStack}.
|
|
136
|
+
*/
|
|
137
|
+
constructor(target?: any, options?: any);
|
|
138
|
+
/**
|
|
139
|
+
* Adds an undo/redo target to the {@link UndoStack} context.
|
|
140
|
+
*
|
|
141
|
+
* @param target Query selector or element to add to the {@link UndoStack} context.
|
|
142
|
+
*/
|
|
143
|
+
addTarget(target: any): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Gets or sets a value that determines whether the {@link UndoStack}
|
|
146
|
+
* should monitor the keyboard and handle the undo/redo keys (ctrl+Z/ctrl+Y)
|
|
147
|
+
* automatically.
|
|
148
|
+
*/
|
|
149
|
+
autoKeyboard: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Gets or sets a vlue that determines whether the {@link UndoStack} is currently disabled.
|
|
152
|
+
*/
|
|
153
|
+
isDisabled: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Gets or sets the maximum number of actions to store in the {@link UndoStack}.
|
|
156
|
+
*
|
|
157
|
+
* The default value for this property is **1,000** actions.
|
|
158
|
+
*/
|
|
159
|
+
maxActions: number;
|
|
160
|
+
/**
|
|
161
|
+
* Gets the number of actions currently stored in the {@link UndoStack}.
|
|
162
|
+
*/
|
|
163
|
+
readonly actionCount: number;
|
|
164
|
+
/**
|
|
165
|
+
* Gets a value that determines whether the {@link UndoStack} is ready to undo an action.
|
|
166
|
+
*/
|
|
167
|
+
readonly canUndo: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Gets a value that determines whether the {@link UndoStack} is ready to redo an action.
|
|
170
|
+
*/
|
|
171
|
+
readonly canRedo: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Undoes the last action recorded.
|
|
174
|
+
*/
|
|
175
|
+
undo(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Redoes the last action undone.
|
|
178
|
+
*/
|
|
179
|
+
redo(): void;
|
|
180
|
+
/**
|
|
181
|
+
* Clears the {@link UndoStack}.
|
|
182
|
+
*/
|
|
183
|
+
clear(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Pushes a new undoable action onto the stack.
|
|
186
|
+
*
|
|
187
|
+
* @param action {@link UndoableAction} to add to the stack.
|
|
188
|
+
*/
|
|
189
|
+
pushAction(action: UndoableAction): void;
|
|
190
|
+
/**
|
|
191
|
+
* Occurs when an element is about to be added to the {@link UndoStack} context.
|
|
192
|
+
*
|
|
193
|
+
* Listeners may prevent the element from being added to the context
|
|
194
|
+
* by setting the cancel parameter to true.
|
|
195
|
+
*/
|
|
196
|
+
readonly addingTarget: Event<UndoStack, AddTargetEventArgs>;
|
|
197
|
+
/**
|
|
198
|
+
* Raises the {@link addingTarget} event.
|
|
199
|
+
*
|
|
200
|
+
* @param e {@link AddTargetEventArgs} that contains the event data.
|
|
201
|
+
* @return True if the event was not canceled.
|
|
202
|
+
*/
|
|
203
|
+
onAddingTarget(e: AddTargetEventArgs): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Occurs after an element has been added to the {@link UndoStack} context.
|
|
206
|
+
*/
|
|
207
|
+
readonly addedTarget: Event<UndoStack, AddTargetEventArgs>;
|
|
208
|
+
/**
|
|
209
|
+
* Raises the {link @addedTarget} event.
|
|
210
|
+
*
|
|
211
|
+
* @param e {@link AddTargetEventArgs} that contains the event data.
|
|
212
|
+
*/
|
|
213
|
+
onAddedTarget(e: AddTargetEventArgs): void;
|
|
214
|
+
/**
|
|
215
|
+
* Occurs when an {@link UndoableAction} is about to be added to the stack.
|
|
216
|
+
*/
|
|
217
|
+
readonly addingAction: Event<UndoStack, UndoActionEventArgs>;
|
|
218
|
+
/**
|
|
219
|
+
* Raises the {@link addingAction} event.
|
|
220
|
+
*
|
|
221
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
222
|
+
* @return True if the event was not canceled.
|
|
223
|
+
*/
|
|
224
|
+
onAddingAction(e: UndoActionEventArgs): boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Occurs after an {@link UndoableAction} had been added to the stack.
|
|
227
|
+
*/
|
|
228
|
+
readonly addedAction: Event<UndoStack, UndoActionEventArgs>;
|
|
229
|
+
/**
|
|
230
|
+
* Raises the {@link addedAction} event.
|
|
231
|
+
*
|
|
232
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
233
|
+
*/
|
|
234
|
+
onAddedAction(e: UndoActionEventArgs): void;
|
|
235
|
+
/**
|
|
236
|
+
* Occurs when an {@link UndoableAction} is about to be undone.
|
|
237
|
+
*/
|
|
238
|
+
readonly undoingAction: Event<UndoStack, UndoActionEventArgs>;
|
|
239
|
+
/**
|
|
240
|
+
* Raises the {@link undoingAction} event.
|
|
241
|
+
*
|
|
242
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
243
|
+
* @return True if the event was not canceled.
|
|
244
|
+
*/
|
|
245
|
+
onUndoingAction(e: UndoActionEventArgs): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Occurs after an {@link UndoableAction} has been undone.
|
|
248
|
+
*
|
|
249
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
250
|
+
*/
|
|
251
|
+
readonly undoneAction: Event<UndoStack, UndoActionEventArgs>;
|
|
252
|
+
/**
|
|
253
|
+
* Raises the {@link undoneAction} event.
|
|
254
|
+
*
|
|
255
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
256
|
+
*/
|
|
257
|
+
onUndoneAction(e: UndoActionEventArgs): void;
|
|
258
|
+
/**
|
|
259
|
+
* Occurs when an {@link UndoableAction} is about to be redone.
|
|
260
|
+
*/
|
|
261
|
+
readonly redoingAction: Event<UndoStack, UndoActionEventArgs>;
|
|
262
|
+
/**
|
|
263
|
+
* Raises the {@link redoingAction} event.
|
|
264
|
+
*
|
|
265
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
266
|
+
* @return True if the event was not canceled.
|
|
267
|
+
*/
|
|
268
|
+
onRedoingAction(e: UndoActionEventArgs): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Occurs after an {@link UndoableAction} has been redone.
|
|
271
|
+
*
|
|
272
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
273
|
+
*/
|
|
274
|
+
readonly redoneAction: Event<UndoStack, UndoActionEventArgs>;
|
|
275
|
+
/**
|
|
276
|
+
* Raises the {@link redoneAction} event.
|
|
277
|
+
*
|
|
278
|
+
* @param e {@link UndoActionEventArgs} that contains the event data.
|
|
279
|
+
*/
|
|
280
|
+
onRedoneAction(e: UndoActionEventArgs): void;
|
|
281
|
+
/**
|
|
282
|
+
* Occurs when the state of the {@link UndoStack} changes.
|
|
283
|
+
*
|
|
284
|
+
* Use this event to update UI elements that reflect the state of the
|
|
285
|
+
* {@link UndoStack}. For example, to enable or disable undo/redo buttons.
|
|
286
|
+
*/
|
|
287
|
+
readonly stateChanged: Event<UndoStack, EventArgs>;
|
|
288
|
+
/**
|
|
289
|
+
* Raises the {@link stateChanged} event.
|
|
290
|
+
*/
|
|
291
|
+
onStateChanged(): void;
|
|
292
|
+
pushPendingAction(): void;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Provides arguments for the {@link UndoStack.addingTarget} and {@link UndoStack.addedTarget}
|
|
296
|
+
* events.
|
|
297
|
+
*/
|
|
298
|
+
export declare class AddTargetEventArgs extends CancelEventArgs {
|
|
299
|
+
_target: HTMLElement;
|
|
300
|
+
/**
|
|
301
|
+
* Initializes a new instance of the {@link AddTargetEventArgs} class.
|
|
302
|
+
*
|
|
303
|
+
* @param target HTMLElement being added to the {@link UndoStack} context.
|
|
304
|
+
*/
|
|
305
|
+
constructor(target: HTMLElement);
|
|
306
|
+
/**
|
|
307
|
+
* Gets a reference to the HTMLElement being added to the {@link UndoStack} context.
|
|
308
|
+
*/
|
|
309
|
+
readonly target: HTMLElement;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Provides arguments for the {@link UndoStack.undoingAction}, {@link UndoStack.undoneAction},
|
|
313
|
+
* {@link UndoStack.redoingAction}, and {@link UndoStack.redoneAction} events.
|
|
314
|
+
*/
|
|
315
|
+
export declare class UndoActionEventArgs extends CancelEventArgs {
|
|
316
|
+
_action: UndoableAction;
|
|
317
|
+
/**
|
|
318
|
+
* Initializes a new instance of the {@link AddTargetEventArgs} class.
|
|
319
|
+
*
|
|
320
|
+
* @param action {@link UndoableAction} being added to the {@link UndoStack}.
|
|
321
|
+
*/
|
|
322
|
+
constructor(action: UndoableAction);
|
|
323
|
+
/**
|
|
324
|
+
* Gets a reference to the {@link UndoableAction} that this event refers to.
|
|
325
|
+
*/
|
|
326
|
+
readonly action: UndoableAction;
|
|
327
|
+
}
|
|
328
|
+
export declare function softInput(): typeof mInput;
|
|
329
|
+
export declare function softGrid(): typeof wjcGrid;
|
|
330
|
+
export declare function softGauge(): typeof wjcGauge;
|
|
331
|
+
export declare function softNav(): typeof wjcNav;
|
|
332
|
+
export declare class _UndoStackWijmo {
|
|
333
|
+
static addTarget(stack: UndoStack, ctl: Control): boolean;
|
|
334
|
+
private static _isInputControl;
|
|
335
|
+
private static _addInputControl;
|
|
336
|
+
private static _addGauge;
|
|
337
|
+
private static _addTreeView;
|
|
338
|
+
private static _addFlexGrid;
|
|
339
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),wijmo_grid_1=require("@mescius/wijmo.grid"),selfModule=__importStar(require("@mescius/wijmo.undo")),UndoableAction=function(){function UndoableAction(t){this._target=t}UndoableAction.prototype.undo=function(){if(this._actions)for(var t=this._actions.length-1;t>=0;t--)this._actions[t].undo();this.applyState(this._oldState)};UndoableAction.prototype.redo=function(){this.applyState(this._newState);this._actions&&this._actions.forEach((function(t){t.redo()}))};UndoableAction.prototype.close=function(){return!0};UndoableAction.prototype.applyState=function(t){};UndoableAction.prototype.shouldAddAsChildAction=function(t){return!1};UndoableAction.prototype.addChildAction=function(t){this._actions||(this._actions=[]);this._actions.push(t)};Object.defineProperty(UndoableAction.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0});UndoableAction.prototype._focusScroll=function(){var t=this._target;if(t instanceof wijmo_1.Control){t.hostElement&&t.hostElement.scrollIntoView();t.focus()}else if(t instanceof HTMLElement){t.focus();wijmo_1.isFunction(t.select)&&t.select()}};return UndoableAction}();exports.UndoableAction=UndoableAction;var _UndoStackHTML=function(){function _UndoStackHTML(){}_UndoStackHTML.addTarget=function(t,e){var n=_UndoStackHTML;if(e instanceof HTMLInputElement)return n._addInputElement(t,e);if(e instanceof HTMLTextAreaElement)return n._addTextAreaElement(t,e);if(e instanceof HTMLSelectElement)return n._addSelectElement(t,e);for(var o=!1,i=0;i<e.children.length;i++){var r=e.children[i];r instanceof HTMLElement&&t.addTarget(r)&&(o=!0)}return o};_UndoStackHTML._addInputElement=function(t,e){var n=null;if("checkbox"==e.type)e.addEventListener("click",(function(e){t.pushAction(new CheckboxClickAction(e))}));else{if("radio"==e.type){e.addEventListener("mousedown",(function(t){n=new RadioClickAction(t)}),!0);var o=_UndoStackHTML._getLabel(e);o&&o.addEventListener("mousedown",(function(t){n=new RadioClickAction({target:e})}),!0);e.addEventListener("focus",(function(t){n instanceof RadioClickAction&&n.target==t.target||(n=new RadioClickAction(t))}));e.addEventListener("click",(function(e){if(n instanceof RadioClickAction){t.pushAction(n);n=null}}));return!0}if("range"==e.type){e.addEventListener("mousedown",(function(t){var o=wijmo_1.getActiveElement();o instanceof HTMLElement&&o!=e&&o.blur();n=new InputChangeAction(t)}));e.addEventListener("mouseup",(function(o){if(n instanceof InputChangeAction&&wijmo_1.getActiveElement()!=e){n._focus=!1;t.pushAction(n);n=null}}))}e.addEventListener("focus",(function(t){null==n&&(n=new InputChangeAction(t))}));e.addEventListener("blur",(function(e){if(n instanceof InputChangeAction){t.pushAction(n);n=null}}))}return!0};_UndoStackHTML._addTextAreaElement=function(t,e){var n=null;e.addEventListener("focus",(function(t){n=new InputChangeAction(t)}));e.addEventListener("blur",(function(e){if(n instanceof InputChangeAction){t.pushAction(n);n=null}}));return!0};_UndoStackHTML._addSelectElement=function(t,e){var n=null;e.addEventListener("focus",(function(t){n=new InputChangeAction(t)}));e.addEventListener("blur",(function(e){if(n instanceof InputChangeAction){t.pushAction(n);n=null}}));return!0};_UndoStackHTML._getLabel=function(t){var e=t.parentElement;e instanceof HTMLLabelElement||(e=document.querySelector('label[for="'+t.id+'"'));return e};return _UndoStackHTML}();exports._UndoStackHTML=_UndoStackHTML;var InputChangeAction=function(t){__extends(InputChangeAction,t);function InputChangeAction(e){var n=t.call(this,e.target)||this;n._focus=!0;n._oldState=n._target.value;return n}InputChangeAction.prototype.close=function(){this._newState=this._target.value;return this._newState!=this._oldState};InputChangeAction.prototype.applyState=function(t){var e=this._target;e.value=t;e.dispatchEvent(UndoStack._evtInput);this._focus&&this._focusScroll()};return InputChangeAction}(UndoableAction);exports.InputChangeAction=InputChangeAction;var CheckboxClickAction=function(t){__extends(CheckboxClickAction,t);function CheckboxClickAction(e){var n=t.call(this,e.target)||this;wijmo_1.assert("checkbox"==n._target.type,"checkbox expected");n._newState=n._target.checked;n._oldState=!n._newState;return n}CheckboxClickAction.prototype.applyState=function(t){this._target.checked=t;this._target.focus()};return CheckboxClickAction}(UndoableAction);exports.CheckboxClickAction=CheckboxClickAction;var RadioClickAction=function(t){__extends(RadioClickAction,t);function RadioClickAction(e){var n=t.call(this,e.target)||this,o=n._target.type;wijmo_1.assert("radio"==o,"radio button expected");n._oldState=n._getState();return n}RadioClickAction.prototype.close=function(){this._newState=this._getState();return this._newState!=this._oldState};RadioClickAction.prototype.applyState=function(t){if(t){t.checked=!0;t.focus()}};RadioClickAction.prototype._getState=function(){for(var t='input[name="'+this._target.name+'"]',e=document.querySelectorAll(t),n=0;n<e.length;n++)if(e[n].checked)return e[n];return null};return RadioClickAction}(UndoableAction);exports.RadioClickAction=RadioClickAction;var UndoStack=function(){function UndoStack(t,e){var n=this;this._autoKbd=!0;this._stack=[];this._maxActions=1e3;this._ptr=0;this.addingTarget=new wijmo_1.Event;this.addedTarget=new wijmo_1.Event;this.addingAction=new wijmo_1.Event;this.addedAction=new wijmo_1.Event;this.undoingAction=new wijmo_1.Event;this.undoneAction=new wijmo_1.Event;this.redoingAction=new wijmo_1.Event;this.redoneAction=new wijmo_1.Event;this.stateChanged=new wijmo_1.Event;if(!UndoStack._evtInput){var o=document.createEvent("HTMLEvents");o.initEvent("input",!0,!1);UndoStack._evtInput=o}wijmo_1.copy(this,e);t=wijmo_1.getElement(t||document.body);this.addTarget(t);document.addEventListener("keydown",(function(e){var o=navigator.platform.toUpperCase().indexOf("MAC")>=0?e.metaKey:e.ctrlKey;if(n._autoKbd&&o&&!e.defaultPrevented&&wijmo_1.contains(t,e.target))if(e.shiftKey&&90===e.keyCode){if(n.canRedo){wijmo_1.getActiveElement().blur();setTimeout((function(){return n.redo()}),100)}e.preventDefault()}else switch(e.keyCode){case 90:if(n.canUndo){wijmo_1.getActiveElement().blur();setTimeout((function(){return n.undo()}),100)}e.preventDefault();break;case 89:if(n.canRedo){wijmo_1.getActiveElement().blur();setTimeout((function(){return n.redo()}),100)}e.preventDefault()}}),wijmo_1.getEventOptions(!0,!1))}UndoStack.prototype.addTarget=function(t){var e=!1;if(wijmo_1.isString(t)){for(var n=document.querySelectorAll(t),o=!1,i=0;i<n.length;i++)this.addTarget(n[i])&&(o=!0);return o}wijmo_1.assert(t instanceof HTMLElement,"Undo target should be an HTML element");var r=new AddTargetEventArgs(t);r.cancel=wijmo_1.hasClass(t,"wj-no-undo");if(this.onAddingTarget(r)){var c=wijmo_1.Control.getControl(t);c&&(e=_UndoStackWijmo.addTarget(this,c));e||(e=_UndoStackHTML.addTarget(this,t));e&&this.onAddedTarget(r)}return e};Object.defineProperty(UndoStack.prototype,"autoKeyboard",{get:function(){return this._autoKbd},set:function(t){this._autoKbd=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(UndoStack.prototype,"isDisabled",{get:function(){return this._disabled},set:function(t){this._disabled=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(UndoStack.prototype,"maxActions",{get:function(){return this._maxActions},set:function(t){if(t!=this._maxActions){this._maxActions=wijmo_1.asNumber(t,!1,!0);this.clear()}},enumerable:!0,configurable:!0});Object.defineProperty(UndoStack.prototype,"actionCount",{get:function(){return this._stack.length},enumerable:!0,configurable:!0});Object.defineProperty(UndoStack.prototype,"canUndo",{get:function(){return this._stack.length>0&&this._ptr>0&&!this._disabled},enumerable:!0,configurable:!0});Object.defineProperty(UndoStack.prototype,"canRedo",{get:function(){return this._stack.length>0&&this._ptr<this._stack.length&&!this._disabled},enumerable:!0,configurable:!0});UndoStack.prototype.undo=function(){if(this.canUndo){var t=this._stack[this._ptr-1],e=new UndoActionEventArgs(t);if(this.onUndoingAction(e)){this._ptr--;this._undoing=!0;t.undo();this._undoing=!1;this._pendingAction=null;this.onUndoneAction(e);this.onStateChanged()}}};UndoStack.prototype.redo=function(){if(this.canRedo){var t=this._stack[this._ptr],e=new UndoActionEventArgs(t);if(this.onRedoingAction(e)){this._ptr++;this._undoing=!0;t.redo();this._undoing=!1;this._pendingAction=null;this.onRedoneAction(e);this.onStateChanged()}}};UndoStack.prototype.clear=function(){this._ptr=0;this._stack.splice(0,this._stack.length);this.onStateChanged()};UndoStack.prototype.pushAction=function(t){this._pendingAction=t;this.pushPendingAction()};UndoStack.prototype.onAddingTarget=function(t){this.addingTarget.raise(this,t);return!t.cancel};UndoStack.prototype.onAddedTarget=function(t){this.addedTarget.raise(this,t)};UndoStack.prototype.onAddingAction=function(t){this.addingAction.raise(this,t);return!t.cancel};UndoStack.prototype.onAddedAction=function(t){this.addedAction.raise(this,t)};UndoStack.prototype.onUndoingAction=function(t){this.undoingAction.raise(this,t);return!t.cancel};UndoStack.prototype.onUndoneAction=function(t){this.undoneAction.raise(this,t)};UndoStack.prototype.onRedoingAction=function(t){this.redoingAction.raise(this,t);return!t.cancel};UndoStack.prototype.onRedoneAction=function(t){this.redoneAction.raise(this,t)};UndoStack.prototype.onStateChanged=function(){this.stateChanged.raise(this,wijmo_1.EventArgs.empty)};UndoStack.prototype.pushPendingAction=function(){if(!this._disabled&&!this._undoing&&this._pendingAction&&this._pendingAction.close()){this._stack.splice(this._ptr,this._stack.length-this._ptr);wijmo_1.assert(this._stack.length==this._ptr,"should be at the end of the stack");if(this._stack.length){var t=this._stack[this._ptr-1];if(t.shouldAddAsChildAction(this._pendingAction)){t.addChildAction(this._pendingAction);this._pendingAction=null;this.onStateChanged();return}}var e=new UndoActionEventArgs(this._pendingAction);if(!this.onAddingAction(e))return;this._stack.push(this._pendingAction);this._ptr++;this._pendingAction=null;var n=this._stack.length-this._maxActions;if(n>0){this._stack.splice(0,n);this._ptr-=n;wijmo_1.assert(this._ptr>=0,"pointer should not be negative")}this.onStateChanged()}};return UndoStack}();exports.UndoStack=UndoStack;var AddTargetEventArgs=function(t){__extends(AddTargetEventArgs,t);function AddTargetEventArgs(e){var n=t.call(this)||this;n._target=e;return n}Object.defineProperty(AddTargetEventArgs.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0});return AddTargetEventArgs}(wijmo_1.CancelEventArgs);exports.AddTargetEventArgs=AddTargetEventArgs;var UndoActionEventArgs=function(t){__extends(UndoActionEventArgs,t);function UndoActionEventArgs(e){var n=t.call(this)||this;n._action=e;return n}Object.defineProperty(UndoActionEventArgs.prototype,"action",{get:function(){return this._action},enumerable:!0,configurable:!0});return UndoActionEventArgs}(wijmo_1.CancelEventArgs);exports.UndoActionEventArgs=UndoActionEventArgs;function softInput(){return wijmo_1._getModule("wijmo.input")}exports.softInput=softInput;function softGrid(){return wijmo_1._getModule("wijmo.grid")}exports.softGrid=softGrid;function softGauge(){return wijmo_1._getModule("wijmo.gauge")}exports.softGauge=softGauge;function softNav(){return wijmo_1._getModule("wijmo.nav")}exports.softNav=softNav;var _UndoStackWijmo=function(){function _UndoStackWijmo(){}_UndoStackWijmo.addTarget=function(t,e){var n=_UndoStackWijmo;return softGrid()&&e instanceof softGrid().FlexGrid?n._addFlexGrid(t,e):softGauge()&&e instanceof softGauge().Gauge?n._addGauge(t,e):softNav()&&e instanceof softNav().TreeView?n._addTreeView(t,e):!!n._isInputControl(e)&&n._addInputControl(t,e)};_UndoStackWijmo._isInputControl=function(t){var e=softInput();return!!e&&(t instanceof e.DropDown||t instanceof e.InputMask||t instanceof e.InputNumber||t instanceof e.Calendar||t instanceof e.ColorPicker)};_UndoStackWijmo._addInputControl=function(t,e){var n=null;e.gotFocus.addHandler((function(){n=new InputControlChangeAction({target:e})}));e.lostFocus.addHandler((function(){if(n instanceof InputControlChangeAction){t.pushAction(n);n=null}}));return!0};_UndoStackWijmo._addGauge=function(t,e){if(!e.isReadOnly){var n=null;e.hostElement.addEventListener("focus",(function(){n||(n=new GaugeChangeAction(e))}));e.lostFocus.addHandler((function(){if(n instanceof GaugeChangeAction){t.pushAction(n);n=null}}));return!0}return!1};_UndoStackWijmo._addTreeView=function(t,e){var n=null;e.nodeEditStarted.addHandler((function(t,e){n=new TreeViewEditAction(t,e)}));e.nodeEditEnded.addHandler((function(e,o){if(n instanceof TreeViewEditAction){t.pushAction(n);n=null}}));e.isCheckedChanging.addHandler((function(t,e){n=new TreeViewCheckAction(t,e)}));e.isCheckedChanged.addHandler((function(e,o){if(n instanceof TreeViewCheckAction){t.pushAction(n);n=null}}));return!0};_UndoStackWijmo._addFlexGrid=function(t,e){var n=null;e.beginningEdit.addHandler((function(t,e){n=e.getRow()instanceof wijmo_grid_1._NewRowTemplate?null:new GridEditAction(t,e)}));e.cellEditEnded.addHandler((function(e,o){if(n instanceof GridEditAction){t.pushAction(n);n=null}}));e.pastingCell.addHandler((function(t,e){n=e.getRow()?new GridEditAction(t,e):null}));e.pastedCell.addHandler((function(e,o){if(n instanceof GridEditAction){t.pushAction(n);n=null}}));e.sortingColumn.addHandler((function(t,e){n=new GridSortAction(t,e)}));e.sortedColumn.addHandler((function(e,o){if(n instanceof GridSortAction){t.pushAction(n);n=null}}));e.resizingColumn.addHandler((function(t,e){n instanceof GridResizeAction||(n=new GridResizeAction(t,e))}));e.resizedColumn.addHandler((function(){if(n instanceof GridResizeAction){t.pushAction(n);n=null}}));e.autoSizingColumn.addHandler((function(t,e){n=new GridResizeAction(t,e)}));e.autoSizedColumn.addHandler((function(){if(n instanceof GridResizeAction){t.pushAction(n);n=null}}));e.draggingColumn.addHandler((function(t,e){n=new GridDragAction(t,e)}));e.draggedColumn.addHandler((function(e,o){if(n instanceof GridDragAction){t.pushAction(n);n=null}}));e.rowAdded.addHandler((function(e,n){n.cancel||t.pushAction(new GridAddRowAction(e,n))}));e.deletingRow.addHandler((function(e,n){n.cancel||t.pushAction(new GridRemoveRowAction(e,n))}));e.columnGroupCollapsedChanging.addHandler((function(t,e){n=new ExpandCollapseColumnGroupAction(t,e)}));e.columnGroupCollapsedChanged.addHandler((function(e,o){if(n instanceof ExpandCollapseColumnGroupAction){t.pushAction(n);n=null}}));return!0};return _UndoStackWijmo}();exports._UndoStackWijmo=_UndoStackWijmo;var InputControlChangeAction=function(t){__extends(InputControlChangeAction,t);function InputControlChangeAction(e){var n=t.call(this,e)||this;n._ctl=e.target;n._oldState=n._getControlState();return n}Object.defineProperty(InputControlChangeAction.prototype,"control",{get:function(){return this._ctl},enumerable:!0,configurable:!0});InputControlChangeAction.prototype.close=function(){this._timeStamp=Date.now();this._newState=this._getControlState();return!this._sameContent(this._oldState,this._newState)};InputControlChangeAction.prototype.shouldAddAsChildAction=function(t){if(t instanceof InputControlChangeAction&&t.target==this.target&&t._timeStamp-this._timeStamp<500){this._timeStamp=Date.now();return!0}return!1};InputControlChangeAction.prototype.applyState=function(t){var e=this._ctl,n=softInput();if(n){var o=e instanceof n.Calendar||e instanceof n.InputDate;o&&e.selectionMode!=n.DateSelectionMode.Range&&(o=!1);if(e instanceof n.MultiSelect)e.checkedItems=t;else if(e instanceof n.MultiAutoComplete)e.selectedItems=t;else if(o){e.value=t[0];e.rangeEnd=t[1]}else"value"in e?e.value=t:"text"in e?e.text=t:wijmo_1.assert(!1,"can't apply control state?");e.focus()}};InputControlChangeAction.prototype._getControlState=function(){var t=this._ctl,e=softInput();if(e){var n=t instanceof e.Calendar||t instanceof e.InputDate;n&&t.selectionMode!=e.DateSelectionMode.Range&&(n=!1);if(t instanceof e.MultiSelect)return t.checkedItems.slice();if(t instanceof e.MultiAutoComplete)return t.selectedItems.slice();if(n)return[t.value,t.rangeEnd];if("value"in t)return t.value;if("text"in t)return t.text;wijmo_1.assert(!1,"can't get control state?")}};InputControlChangeAction.prototype._sameContent=function(t,e){if(wijmo_1.isArray(t)&&wijmo_1.isArray(e)){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}return wijmo_1.isDate(t)||wijmo_1.isDate(e)?wijmo_1.DateTime.sameDate(t,e):t==e};return InputControlChangeAction}(InputChangeAction),GaugeChangeAction=function(t){__extends(GaugeChangeAction,t);function GaugeChangeAction(e){var n=t.call(this,e)||this;n._oldState=e.value;return n}Object.defineProperty(GaugeChangeAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});GaugeChangeAction.prototype.close=function(){this._newState=this._target.value;return this._newState!=this._oldState};GaugeChangeAction.prototype.applyState=function(t){var e=this._target;e.value=t;e.focus()};return GaugeChangeAction}(UndoableAction),GridEditAction=function(t){__extends(GridEditAction,t);function GridEditAction(e,n){var o=t.call(this,e)||this;o._dataItems=[];for(var i=e.collectionView,r=o._rng=n.range,c=r.topRow;c<=r.bottomRow;c++)o._dataItems.push(e.rows[c].dataItem);o._page=i instanceof wijmo_1.CollectionView?i.pageIndex:-1;o._oldState=e.getCellData(n.row,n.col,!1);return o}Object.defineProperty(GridEditAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(GridEditAction.prototype,"range",{get:function(){return this._rng.clone()},enumerable:!0,configurable:!0});Object.defineProperty(GridEditAction.prototype,"row",{get:function(){return this._rng.topRow},enumerable:!0,configurable:!0});Object.defineProperty(GridEditAction.prototype,"col",{get:function(){return this._rng.leftCol},enumerable:!0,configurable:!0});Object.defineProperty(GridEditAction.prototype,"dataItem",{get:function(){return this._dataItems[0]},enumerable:!0,configurable:!0});Object.defineProperty(GridEditAction.prototype,"dataItems",{get:function(){return this._dataItems},enumerable:!0,configurable:!0});GridEditAction.prototype.close=function(){var t=this._target.collectionView;if(t&&t.currentAddItem)return!1;this._timeStamp=Date.now();this._newState=this._target.getCellData(this.row,this.col,!1);return this._newState!=this._oldState};GridEditAction.prototype.applyState=function(t){var e=this,n=this._target,o=n.editableCollectionView;if(o){o instanceof wijmo_1.CollectionView&&this._page>-1&&o.moveToPage(this._page);n.deferUpdate((function(){e._dataItems.forEach((function(i){o.editItem(i);for(var r=e._rng.leftCol;r<=e._rng.rightCol;r++){var c=n.columns[r],a=n._getBindingColumn(n.cells,e.row,c);a&&a._binding&&a._binding.setValue(i,t)}o.commitEdit()}))}))}n.select(n.selection.row,this.col);this._focusScroll()};GridEditAction.prototype.shouldAddAsChildAction=function(t){return t instanceof GridEditAction&&t.target==this.target&&t._timeStamp-this._timeStamp<100};return GridEditAction}(UndoableAction),GridSortAction=function(t){__extends(GridSortAction,t);function GridSortAction(e,n){var o=t.call(this,e)||this,i=o._target.collectionView;i&&(o._oldState=i.sortDescriptions.slice());return o}Object.defineProperty(GridSortAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});GridSortAction.prototype.close=function(){var t=this._target.collectionView;if(t){this._newState=t.sortDescriptions.slice();return!0}return!1};GridSortAction.prototype.applyState=function(t){var e=this._target.collectionView;e&&e.deferUpdate((function(){var n=e.sortDescriptions;n.clear();t.forEach((function(t){n.push(t)}))}));this._focusScroll()};return GridSortAction}(UndoableAction),GridResizeAction=function(t){__extends(GridResizeAction,t);function GridResizeAction(e,n){var o=t.call(this,e)||this;o._col=e.columns[n.col];o._oldState=o._col.renderWidth;return o}Object.defineProperty(GridResizeAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(GridResizeAction.prototype,"col",{get:function(){return this._col},enumerable:!0,configurable:!0});GridResizeAction.prototype.close=function(){this._timeStamp=Date.now();this._newState=this._col.renderWidth;return this._newState!=this._oldState};GridResizeAction.prototype.applyState=function(t){this._col.width=t;this._focusScroll()};GridResizeAction.prototype.shouldAddAsChildAction=function(t){return t instanceof GridResizeAction&&t.target==this.target&&t._timeStamp-this._timeStamp<100};return GridResizeAction}(UndoableAction),GridDragAction=function(t){__extends(GridDragAction,t);function GridDragAction(e,n){var o=t.call(this,e)||this;o._col=n.getColumn(!0);o._oldState=o._getState(o._col);return o}Object.defineProperty(GridDragAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(GridDragAction.prototype,"col",{get:function(){return this._col},enumerable:!0,configurable:!0});GridDragAction.prototype.close=function(){this._newState=this._getState(this._col);return!this._areStatesEqual(this._newState,this._oldState)};GridDragAction.prototype.applyState=function(t){var e=this,n=this._col;n.grid.deferUpdate((function(){var o=e._getState(n);o.coll.splice(o.idx,1);t.coll.splice(t.idx,0,n)}));this._focusScroll()};GridDragAction.prototype._getState=function(t){var e=t instanceof wijmo_grid_1.ColumnGroup?t.parentGroup?t.parentGroup.columns:this.target.getColumnGroups():t.grid.columns;return{coll:e,idx:e.indexOf(t)}};GridDragAction.prototype._areStatesEqual=function(t,e){return t.coll===e.coll&&t.idx===e.idx};return GridDragAction}(UndoableAction),GridAddRowAction=function(t){__extends(GridAddRowAction,t);function GridAddRowAction(e,n){var o=t.call(this,e)||this,i=o._target.collectionView;if(i&&i.currentAddItem){var r=i.currentAddItem,c=i.sourceCollection.indexOf(r),a=i.currentPosition;o._oldState={item:r,index:c,position:a};o._newState={index:c,position:a}}return o}Object.defineProperty(GridAddRowAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});GridAddRowAction.prototype.close=function(){return null!=this._oldState};GridAddRowAction.prototype.applyState=function(t){var e=this._target.collectionView;if(e){var n=e.sourceCollection;if(t.item){n.splice(t.index,1);if(e instanceof wijmo_1.CollectionView&&e.trackChanges){var o=t.item;wijmo_1.assert(e.itemsAdded.indexOf(o)>-1,"item should be in the itemsAdded list");e.itemsAdded.remove(o)}}else{o=this._oldState.item;n.splice(t.index,0,o);if(e instanceof wijmo_1.CollectionView&&e.trackChanges){wijmo_1.assert(e.itemsAdded.indexOf(o)<0,"item should not be in the itemsAdded list");e.itemsAdded.push(o)}}e.refresh();e.moveCurrentToPosition(t.position);this._focusScroll()}};return GridAddRowAction}(UndoableAction),GridRemoveRowAction=function(t){__extends(GridRemoveRowAction,t);function GridRemoveRowAction(e,n){var o=t.call(this,e)||this;o._edtIndex=-1;var i=o._target.collectionView;if(i){var r=e.rows[n.row].dataItem,c=i.sourceCollection.indexOf(r),a=i.currentPosition;i instanceof wijmo_1.CollectionView&&i.trackChanges&&(o._edtIndex=i.itemsEdited.indexOf(r));o._oldState={item:r,index:c,position:a};o._newState={index:c,position:a}}return o}Object.defineProperty(GridRemoveRowAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(GridRemoveRowAction.prototype,"dataItem",{get:function(){return this._oldState.item},enumerable:!0,configurable:!0});GridRemoveRowAction.prototype.close=function(){this._timeStamp=Date.now();return null!=this._oldState};GridRemoveRowAction.prototype.applyState=function(t){var e=this._target,n=e.collectionView;if(n){var o=n.sourceCollection;if(t.item){o.splice(t.index,0,t.item);if(n instanceof wijmo_1.CollectionView&&n.trackChanges){var i=t.item;wijmo_1.assert(n.itemsRemoved.indexOf(i)>-1,"item should be in the itemsRemoved list");n.itemsRemoved.remove(i);this._edtIndex>-1&&n.itemsEdited.indexOf(i)<0&&n.itemsEdited.push(i)}}else{o.splice(t.index,1);if(n instanceof wijmo_1.CollectionView&&n.trackChanges){i=this._oldState.item;wijmo_1.assert(n.itemsRemoved.indexOf(i)<0,"item should not be in the itemsRemoved list");n.itemsRemoved.push(i)}}n.refresh();n.moveCurrentToPosition(t.position);var r=new(softGrid().CellRange)(t.position,0,t.position,e.columns.length-1);e.select(r);this._focusScroll()}};GridRemoveRowAction.prototype.shouldAddAsChildAction=function(t){return t instanceof GridRemoveRowAction&&t.target==this.target&&t._timeStamp-this._timeStamp<100};return GridRemoveRowAction}(UndoableAction),ExpandCollapseColumnGroupAction=function(t){__extends(ExpandCollapseColumnGroupAction,t);function ExpandCollapseColumnGroupAction(e,n){var o=t.call(this,e)||this;o._group=n.data;o._oldState=o._group.isCollapsed;return o}Object.defineProperty(ExpandCollapseColumnGroupAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(ExpandCollapseColumnGroupAction.prototype,"group",{get:function(){return this._group},enumerable:!0,configurable:!0});ExpandCollapseColumnGroupAction.prototype.close=function(){this._newState=this._group.isCollapsed;return this._newState!=this._oldState};ExpandCollapseColumnGroupAction.prototype.applyState=function(t){this._group.isCollapsed=t;this._focusScroll()};return ExpandCollapseColumnGroupAction}(UndoableAction),TreeViewEditAction=function(t){__extends(TreeViewEditAction,t);function TreeViewEditAction(e,n){var o=t.call(this,e)||this;o._nd=n.node;o._oldState=o._getNodeText();return o}Object.defineProperty(TreeViewEditAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(TreeViewEditAction.prototype,"node",{get:function(){return this._nd},enumerable:!0,configurable:!0});TreeViewEditAction.prototype.close=function(){this._newState=this._getNodeText();return this._newState!=this._oldState};TreeViewEditAction.prototype.applyState=function(t){this._nd.select();this._setNodeText(t);this._target.focus()};TreeViewEditAction.prototype._getNodeText=function(){var t=this._nd.dataItem[this._getDisplayMemberPath()];return null!=t?t.toString():""};TreeViewEditAction.prototype._setNodeText=function(t){var e=this._nd,n=e.dataItem,o=this._getDisplayMemberPath(),i=e.element.querySelector(".wj-node-text");n[o]=t;e.treeView.isContentHtml?i.innerHTML=t:i.textContent=t};TreeViewEditAction.prototype._getDisplayMemberPath=function(){var t=this._nd,e=t.treeView.displayMemberPath;e instanceof Array&&(e=e[t.level]);return e};return TreeViewEditAction}(UndoableAction),TreeViewCheckAction=function(t){__extends(TreeViewCheckAction,t);function TreeViewCheckAction(e,n){var o=t.call(this,e)||this;o._nd=n.node;o._oldState=o._nd.isChecked;return o}Object.defineProperty(TreeViewCheckAction.prototype,"control",{get:function(){return this._target},enumerable:!0,configurable:!0});Object.defineProperty(TreeViewCheckAction.prototype,"node",{get:function(){return this._nd},enumerable:!0,configurable:!0});TreeViewCheckAction.prototype.close=function(){this._newState=this._nd.isChecked;return this._newState!=this._oldState};TreeViewCheckAction.prototype.applyState=function(t){this._nd.select();this._nd.isChecked=t;this._target.focus()};return TreeViewCheckAction}(UndoableAction);wijmo_1._registerModule("wijmo.undo",selfModule);
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mescius/wijmo.undo",
|
|
3
|
+
"version": "5.20232.939",
|
|
4
|
+
"description": "UI library for pure JS, Angular, React, Vue and more...",
|
|
5
|
+
"author": "MESCIUS inc",
|
|
6
|
+
"license": "Commercial",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@mescius/wijmo": "5.20232.939",
|
|
11
|
+
"@mescius/wijmo.input": "5.20232.939",
|
|
12
|
+
"@mescius/wijmo.grid": "5.20232.939",
|
|
13
|
+
"@mescius/wijmo.gauge": "5.20232.939",
|
|
14
|
+
"@mescius/wijmo.nav": "5.20232.939"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://developer.mescius.com/wijmo",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://developer.mescius.com/forums/wijmo"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"control",
|
|
22
|
+
"component",
|
|
23
|
+
"ui",
|
|
24
|
+
"control library",
|
|
25
|
+
"component library",
|
|
26
|
+
"ui library",
|
|
27
|
+
"control-library",
|
|
28
|
+
"component-library",
|
|
29
|
+
"ui-library",
|
|
30
|
+
"grid",
|
|
31
|
+
"data grid",
|
|
32
|
+
"data-grid",
|
|
33
|
+
"datagrid",
|
|
34
|
+
"angular grid",
|
|
35
|
+
"react grid",
|
|
36
|
+
"vue grid",
|
|
37
|
+
"angular-grid",
|
|
38
|
+
"react-grid",
|
|
39
|
+
"vue-grid"
|
|
40
|
+
],
|
|
41
|
+
"module": "./es5-esm.js",
|
|
42
|
+
"esm5": "./es5-esm.js",
|
|
43
|
+
"wj-esm5": "./es5-esm.js",
|
|
44
|
+
"es2015Cjs": "./es2015-commonjs.js",
|
|
45
|
+
"wj-es2015Cjs": "./es2015-commonjs.js",
|
|
46
|
+
"esm2015": "./es2015-esm.js",
|
|
47
|
+
"wj-esm2015": "./es2015-esm.js"
|
|
48
|
+
}
|