aurelia-syncfusion-ej2-bridge 0.1.0-beta.9 → 1.0.0
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 +1 -0
- package/dist/commonjs/common/controlBase.d.ts +3 -1
- package/dist/commonjs/common/controlBase.js +13 -4
- package/dist/commonjs/common/syncfusionWrapper.d.ts +3 -0
- package/dist/commonjs/common/syncfusionWrapper.js +11 -2
- package/dist/commonjs/configBuider.d.ts +2 -0
- package/dist/commonjs/configBuider.js +12 -2
- package/dist/commonjs/controlBindings.d.ts +10 -0
- package/dist/commonjs/controlBindings.js +70 -38
- package/dist/commonjs/widgets/button/ej2-button.d.ts +1 -1
- package/dist/commonjs/widgets/button/ej2-button.js +9 -7
- package/dist/commonjs/widgets/checkbox/ej2-checkbox-list.js +0 -1
- package/dist/commonjs/widgets/checkbox/ej2-checkbox.js +1 -2
- package/dist/commonjs/widgets/grid/ej2-grid.js +22 -22
- package/dist/commonjs/widgets/listView/ej2-listView.js +1 -1
- package/dist/commonjs/widgets/multiSelect/ej2-multiSelect.d.ts +10 -0
- package/dist/commonjs/widgets/multiSelect/ej2-multiSelect.js +44 -0
- package/dist/commonjs/widgets/progressButton/ej2-progress-button.d.ts +1 -1
- package/dist/commonjs/widgets/progressButton/ej2-progress-button.js +8 -6
- package/dist/commonjs/widgets/radio/ej2-radio.js +3 -3
- package/dist/commonjs/widgets/schedule/ej2-schedule.d.ts +8 -0
- package/dist/commonjs/widgets/schedule/ej2-schedule.js +32 -0
- package/dist/commonjs/widgets/splitter/ej2-splitter.js +0 -2
- package/dist/commonjs/widgets/switch/ej2-switch.d.ts +2 -1
- package/dist/commonjs/widgets/switch/ej2-switch.js +8 -4
- package/dist/commonjs/widgets/uploader/ej2-uploader.d.ts +7 -1
- package/dist/commonjs/widgets/uploader/ej2-uploader.js +65 -29
- package/dist/native-modules/common/controlBase.d.ts +3 -1
- package/dist/native-modules/common/controlBase.js +13 -4
- package/dist/native-modules/common/syncfusionWrapper.d.ts +3 -0
- package/dist/native-modules/common/syncfusionWrapper.js +11 -2
- package/dist/native-modules/configBuider.d.ts +2 -0
- package/dist/native-modules/configBuider.js +12 -2
- package/dist/native-modules/controlBindings.d.ts +10 -0
- package/dist/native-modules/controlBindings.js +70 -38
- package/dist/native-modules/widgets/button/ej2-button.d.ts +1 -1
- package/dist/native-modules/widgets/button/ej2-button.js +9 -7
- package/dist/native-modules/widgets/checkbox/ej2-checkbox-list.js +0 -1
- package/dist/native-modules/widgets/checkbox/ej2-checkbox.js +2 -3
- package/dist/native-modules/widgets/grid/ej2-grid.js +22 -22
- package/dist/native-modules/widgets/listView/ej2-listView.js +1 -1
- package/dist/native-modules/widgets/multiSelect/ej2-multiSelect.d.ts +10 -0
- package/dist/native-modules/widgets/multiSelect/ej2-multiSelect.js +41 -0
- package/dist/native-modules/widgets/progressButton/ej2-progress-button.d.ts +1 -1
- package/dist/native-modules/widgets/progressButton/ej2-progress-button.js +8 -6
- package/dist/native-modules/widgets/radio/ej2-radio.js +3 -3
- package/dist/native-modules/widgets/schedule/ej2-schedule.d.ts +8 -0
- package/dist/native-modules/widgets/schedule/ej2-schedule.js +29 -0
- package/dist/native-modules/widgets/splitter/ej2-splitter.js +0 -2
- package/dist/native-modules/widgets/switch/ej2-switch.d.ts +2 -1
- package/dist/native-modules/widgets/switch/ej2-switch.js +8 -4
- package/dist/native-modules/widgets/uploader/ej2-uploader.d.ts +7 -1
- package/dist/native-modules/widgets/uploader/ej2-uploader.js +65 -29
- package/package.json +9 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { constants } from '../../common/constants';
|
|
8
|
+
import { SyncfusionWrapper } from "../../common/syncfusionWrapper";
|
|
9
|
+
import { MultiSelect } from "@syncfusion/ej2-dropdowns";
|
|
10
|
+
import { generateBindables } from "../../utilities/decorator";
|
|
11
|
+
import { enableRipple } from '@syncfusion/ej2-base';
|
|
12
|
+
import { inlineView, customElement } from 'aurelia-framework';
|
|
13
|
+
enableRipple(true);
|
|
14
|
+
let Ej2MultiSelect = class Ej2MultiSelect extends SyncfusionWrapper {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.syncfusionWidgetType = MultiSelect;
|
|
18
|
+
}
|
|
19
|
+
onWrapperCreated() {
|
|
20
|
+
}
|
|
21
|
+
onWidgetCreated() {
|
|
22
|
+
let _this = this;
|
|
23
|
+
this.widget.addEventListener("change", (args) => { _this.onChange(args); });
|
|
24
|
+
}
|
|
25
|
+
onInput(args) {
|
|
26
|
+
this[`${constants.bindablePrefix}value`] = args.value;
|
|
27
|
+
}
|
|
28
|
+
onChange(args) {
|
|
29
|
+
this[`${constants.bindablePrefix}value`] = args.value;
|
|
30
|
+
}
|
|
31
|
+
attached() {
|
|
32
|
+
this.widgetElement = this.element.querySelector("select,input");
|
|
33
|
+
super.attached();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
Ej2MultiSelect = __decorate([
|
|
37
|
+
generateBindables("multiSelect"),
|
|
38
|
+
inlineView(`<template><div><slot><input /></slot></div></template>`),
|
|
39
|
+
customElement('ej2-multi-select')
|
|
40
|
+
], Ej2MultiSelect);
|
|
41
|
+
export { Ej2MultiSelect };
|
|
@@ -2,10 +2,10 @@ import { ProgressButton, ProgressButtonModel } from '@syncfusion/ej2-splitbutton
|
|
|
2
2
|
import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
|
|
3
3
|
export declare class Ej2ProgressButton extends SyncfusionWrapper<ProgressButton, ProgressButtonModel> {
|
|
4
4
|
clickEvent: Event;
|
|
5
|
+
_onClick: (event: Event) => void;
|
|
5
6
|
protected onWidgetCreated(): void;
|
|
6
7
|
protected onWrapperCreated(): void;
|
|
7
8
|
protected syncfusionWidgetType: typeof ProgressButton;
|
|
8
|
-
_onClick(event: Event): void;
|
|
9
9
|
refresh(): void;
|
|
10
10
|
focusIn(): void;
|
|
11
11
|
click(): void;
|
|
@@ -12,20 +12,22 @@ let Ej2ProgressButton = class Ej2ProgressButton extends SyncfusionWrapper {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.clickEvent = null;
|
|
15
|
+
this._onClick = null;
|
|
15
16
|
this.syncfusionWidgetType = ProgressButton;
|
|
16
17
|
}
|
|
17
18
|
onWidgetCreated() {
|
|
18
|
-
|
|
19
|
+
let _this = this;
|
|
20
|
+
this._onClick = (event) => {
|
|
21
|
+
_this.element.dispatchEvent(_this.clickEvent);
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
};
|
|
24
|
+
this.widget.element.addEventListener("click", this._onClick, false);
|
|
19
25
|
}
|
|
20
26
|
onWrapperCreated() {
|
|
21
27
|
this.clickEvent = new CustomEvent("on-click", {
|
|
22
28
|
bubbles: true
|
|
23
29
|
});
|
|
24
30
|
}
|
|
25
|
-
_onClick(event) {
|
|
26
|
-
this.element.dispatchEvent(this.clickEvent);
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
}
|
|
29
31
|
refresh() {
|
|
30
32
|
this.widget.refresh();
|
|
31
33
|
}
|
|
@@ -48,7 +50,7 @@ let Ej2ProgressButton = class Ej2ProgressButton extends SyncfusionWrapper {
|
|
|
48
50
|
this.widget.stop();
|
|
49
51
|
}
|
|
50
52
|
detached() {
|
|
51
|
-
this.widget.element.removeEventListener("click", this._onClick);
|
|
53
|
+
this.widget.element.removeEventListener("click", this._onClick, false);
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
Ej2ProgressButton = __decorate([
|
|
@@ -21,17 +21,17 @@ let Ej2Radio = class Ej2Radio extends SyncfusionWrapper {
|
|
|
21
21
|
onWrapperCreated() {
|
|
22
22
|
}
|
|
23
23
|
onBind() {
|
|
24
|
-
if (!this.
|
|
24
|
+
if (!this._eModel.name) {
|
|
25
25
|
throw "Radio e-name is required";
|
|
26
26
|
}
|
|
27
27
|
this.widget.change = () => {
|
|
28
28
|
this[`${constants.bindablePrefix}checked`] = this.widget.checked;
|
|
29
|
-
this.eventAggregator.publish(`ej2-radio-${this.
|
|
29
|
+
this.eventAggregator.publish(`ej2-radio-${this._eModel.name}-changed`, this[`${constants.bindablePrefix}label`]);
|
|
30
30
|
};
|
|
31
31
|
this.checkedSubscription = this.bindingEngine.propertyObserver(this, this[`${constants.bindablePrefix}checked`]).subscribe((newValue) => {
|
|
32
32
|
this.widget.checked = newValue;
|
|
33
33
|
});
|
|
34
|
-
this.selectionChangedSubscription = this.eventAggregator.subscribe(`ej2-radio-${this.
|
|
34
|
+
this.selectionChangedSubscription = this.eventAggregator.subscribe(`ej2-radio-${this._eModel.name}-changed`, (selectedLabel) => {
|
|
35
35
|
if (this[`${constants.bindablePrefix}label`] !== selectedLabel) {
|
|
36
36
|
this[`${constants.bindablePrefix}checked`] = false;
|
|
37
37
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schedule, ScheduleModel } from '@syncfusion/ej2-schedule';
|
|
2
|
+
import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
|
|
3
|
+
export declare class Ej2Schedule extends SyncfusionWrapper<Schedule, ScheduleModel> {
|
|
4
|
+
protected syncfusionWidgetType: any;
|
|
5
|
+
protected onWrapperCreated(): void;
|
|
6
|
+
protected onWidgetCreated(): void;
|
|
7
|
+
onBeforeWidgetInstantiation(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { inlineView, customElement } from 'aurelia-framework';
|
|
8
|
+
import { Schedule, TimelineViews, TimelineMonth, Resize, DragAndDrop, Day, Week, WorkWeek, Month, Agenda, TimelineYear, ExcelExport, ICalendarExport, ICalendarImport, Print } from '@syncfusion/ej2-schedule';
|
|
9
|
+
import { generateBindables } from '../../utilities/decorator';
|
|
10
|
+
import { SyncfusionWrapper } from '../../common/syncfusionWrapper';
|
|
11
|
+
let Ej2Schedule = class Ej2Schedule extends SyncfusionWrapper {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.syncfusionWidgetType = Schedule;
|
|
15
|
+
}
|
|
16
|
+
onWrapperCreated() {
|
|
17
|
+
}
|
|
18
|
+
onWidgetCreated() {
|
|
19
|
+
}
|
|
20
|
+
onBeforeWidgetInstantiation() {
|
|
21
|
+
Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, TimelineViews, TimelineMonth, TimelineYear, DragAndDrop, Resize, ExcelExport, ICalendarExport, ICalendarImport, Print);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
Ej2Schedule = __decorate([
|
|
25
|
+
generateBindables("radio"),
|
|
26
|
+
inlineView(`<template><div element.ref="widgetElement"></div></template>`),
|
|
27
|
+
customElement('ej2-schedule')
|
|
28
|
+
], Ej2Schedule);
|
|
29
|
+
export { Ej2Schedule };
|
|
@@ -14,10 +14,8 @@ let Ej2Splitter = class Ej2Splitter extends SyncfusionWrapper {
|
|
|
14
14
|
this.syncfusionWidgetType = Splitter;
|
|
15
15
|
}
|
|
16
16
|
onWrapperCreated() {
|
|
17
|
-
this.debug("splitter wrapper created");
|
|
18
17
|
}
|
|
19
18
|
onWidgetCreated() {
|
|
20
|
-
this.debug("splitter widget created", this.widget);
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
21
|
Ej2Splitter = __decorate([
|
|
@@ -3,8 +3,9 @@ import { Switch, SwitchModel } from '@syncfusion/ej2-buttons';
|
|
|
3
3
|
export declare class Ej2Switch extends SyncfusionWrapper<Switch, SwitchModel> {
|
|
4
4
|
protected syncfusionWidgetType: typeof Switch;
|
|
5
5
|
private id;
|
|
6
|
+
private onChange;
|
|
6
7
|
protected onWrapperCreated(): void;
|
|
7
8
|
protected onWidgetCreated(): void;
|
|
8
|
-
onChange(args: any): void;
|
|
9
9
|
recreate(): void;
|
|
10
|
+
detached(): void;
|
|
10
11
|
}
|
|
@@ -14,6 +14,7 @@ let Ej2Switch = class Ej2Switch extends SyncfusionWrapper {
|
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.syncfusionWidgetType = Switch;
|
|
16
16
|
this.id = null;
|
|
17
|
+
this.onChange = null;
|
|
17
18
|
}
|
|
18
19
|
onWrapperCreated() {
|
|
19
20
|
this.id = this.element.getAttribute("id");
|
|
@@ -24,10 +25,10 @@ let Ej2Switch = class Ej2Switch extends SyncfusionWrapper {
|
|
|
24
25
|
}
|
|
25
26
|
onWidgetCreated() {
|
|
26
27
|
let _this = this;
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this
|
|
28
|
+
this.onChange = (args) => {
|
|
29
|
+
_this[`${constants.bindablePrefix}checked`] = args.checked;
|
|
30
|
+
};
|
|
31
|
+
this.widget.addEventListener("change", this.onChange);
|
|
31
32
|
}
|
|
32
33
|
recreate() {
|
|
33
34
|
if (this.id) {
|
|
@@ -36,6 +37,9 @@ let Ej2Switch = class Ej2Switch extends SyncfusionWrapper {
|
|
|
36
37
|
this.element.setAttribute("id", this.id);
|
|
37
38
|
super.recreate();
|
|
38
39
|
}
|
|
40
|
+
detached() {
|
|
41
|
+
this.widget.removeEventListener("change", this.onChange);
|
|
42
|
+
}
|
|
39
43
|
};
|
|
40
44
|
Ej2Switch = __decorate([
|
|
41
45
|
generateBindables("switch"),
|
|
@@ -3,6 +3,7 @@ import { Uploader, UploaderModel, RemovingEventArgs } from "@syncfusion/ej2-inpu
|
|
|
3
3
|
import { SyncfusionWrapper } from "../../common/syncfusionWrapper";
|
|
4
4
|
export declare class Ej2Uploader extends SyncfusionWrapper<Uploader, UploaderModel> {
|
|
5
5
|
private _filesProperty;
|
|
6
|
+
private originalFiles;
|
|
6
7
|
private _filesCollectionSubscription;
|
|
7
8
|
private _privateIdProperty;
|
|
8
9
|
protected syncfusionWidgetType: typeof Uploader;
|
|
@@ -15,13 +16,18 @@ export declare class Ej2Uploader extends SyncfusionWrapper<Uploader, UploaderMod
|
|
|
15
16
|
dataAdapter: Ej2UploaderDataAdapter;
|
|
16
17
|
autoRemoveServerFiles: boolean;
|
|
17
18
|
context: any;
|
|
19
|
+
files: any[];
|
|
20
|
+
private firstBind;
|
|
18
21
|
private get _files();
|
|
19
22
|
serverDelete: boolean;
|
|
20
23
|
protected onWrapperCreated(): void;
|
|
21
|
-
|
|
24
|
+
onfilesChanged(): void;
|
|
25
|
+
recreating(): void;
|
|
26
|
+
recreated(): void;
|
|
22
27
|
initializeFileCollection(): void;
|
|
23
28
|
initializeFile(widgetFile: any, i: any, extraProperties: any): void;
|
|
24
29
|
protected onWidgetCreated(): void;
|
|
30
|
+
onBind(): void;
|
|
25
31
|
createFilesCollectionSubscription(): Disposable;
|
|
26
32
|
change(): void;
|
|
27
33
|
getFilesThatWereRemoved(): any[];
|
|
@@ -12,12 +12,13 @@ import { Uploader } from "@syncfusion/ej2-inputs";
|
|
|
12
12
|
import { SyncfusionWrapper } from "../../common/syncfusionWrapper";
|
|
13
13
|
import { generateBindables } from "../../utilities/decorator";
|
|
14
14
|
import { bindable } from 'aurelia-framework';
|
|
15
|
-
import
|
|
15
|
+
import { v4 as uuid } from "uuid";
|
|
16
16
|
import { inlineView, customElement } from 'aurelia-framework';
|
|
17
17
|
let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
this._filesProperty = `${constants.bindablePrefix}files`;
|
|
21
|
+
this.originalFiles = null;
|
|
21
22
|
this._filesCollectionSubscription = null;
|
|
22
23
|
this._privateIdProperty = "__id";
|
|
23
24
|
this.syncfusionWidgetType = Uploader;
|
|
@@ -30,13 +31,14 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
30
31
|
this.dataAdapter = null;
|
|
31
32
|
this.autoRemoveServerFiles = true;
|
|
32
33
|
this.context = null;
|
|
34
|
+
this.files = null;
|
|
35
|
+
this.firstBind = true;
|
|
33
36
|
this.serverDelete = true;
|
|
34
37
|
}
|
|
35
38
|
get _files() {
|
|
36
39
|
return this[this._filesProperty];
|
|
37
40
|
}
|
|
38
41
|
onWrapperCreated() {
|
|
39
|
-
this.debug("wrapper created");
|
|
40
42
|
this.widget.uploading = (args) => { this.onFileUpload(args); };
|
|
41
43
|
this.widget.success = (args) => { this.success(args); };
|
|
42
44
|
this.widget.failure = (args) => { this.failure(args); };
|
|
@@ -52,20 +54,28 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
52
54
|
_this.widget.removingEventCallback(eventArgs, formData, selectedFiles, file);
|
|
53
55
|
});
|
|
54
56
|
};
|
|
57
|
+
this.widget.asyncSettings.removeUrl = null;
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
+
onfilesChanged() {
|
|
62
|
+
if (!this.firstBind) {
|
|
63
|
+
this.widget.clearAll();
|
|
64
|
+
this.recreate();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
recreating() {
|
|
61
68
|
this._filesCollectionSubscription.dispose();
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
this[this._filesProperty].splice(0, this[this._filesProperty].length, ...this.originalFiles);
|
|
70
|
+
}
|
|
71
|
+
recreated() {
|
|
72
|
+
this.initializeFileCollection();
|
|
73
|
+
this._filesCollectionSubscription = this.createFilesCollectionSubscription();
|
|
67
74
|
}
|
|
68
75
|
initializeFileCollection() {
|
|
76
|
+
if (this.files && Array.isArray(this.files)) {
|
|
77
|
+
this.widget.files.push(...JSON.parse(JSON.stringify(this.files)));
|
|
78
|
+
}
|
|
69
79
|
if (this.widget.files) {
|
|
70
80
|
let extraProperties = [];
|
|
71
81
|
let widgetFiles = this.widget.getFilesData();
|
|
@@ -79,7 +89,7 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
79
89
|
}
|
|
80
90
|
}
|
|
81
91
|
initializeFile(widgetFile, i, extraProperties) {
|
|
82
|
-
let __id =
|
|
92
|
+
let __id = uuid();
|
|
83
93
|
widgetFile[this._privateIdProperty] = __id;
|
|
84
94
|
this._files[i][this._privateIdProperty] = __id;
|
|
85
95
|
extraProperties.forEach((prop) => {
|
|
@@ -91,14 +101,34 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
91
101
|
this._filesCollectionSubscription = this.createFilesCollectionSubscription();
|
|
92
102
|
this.subscriptions.push(this._filesCollectionSubscription);
|
|
93
103
|
}
|
|
104
|
+
onBind() {
|
|
105
|
+
this.firstBind = false;
|
|
106
|
+
this.subscriptions.push(this.bindingEngine.propertyObserver(this, "files").subscribe(() => { this.onfilesChanged(); }));
|
|
107
|
+
if (this[this._filesProperty] && Array.isArray(this[this._filesProperty])) {
|
|
108
|
+
this.originalFiles = JSON.parse(JSON.stringify(this[this._filesProperty]));
|
|
109
|
+
}
|
|
110
|
+
else if (this.files && Array.isArray(this.files)) {
|
|
111
|
+
this.originalFiles = JSON.parse(JSON.stringify(this.files));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.originalFiles = [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
94
117
|
createFilesCollectionSubscription() {
|
|
95
|
-
|
|
96
|
-
|
|
118
|
+
if (!this._files) {
|
|
119
|
+
this[this._filesProperty] = [];
|
|
120
|
+
}
|
|
121
|
+
return this.bindingEngine.collectionObserver(this._files).subscribe((changed) => { });
|
|
97
122
|
}
|
|
98
123
|
change() {
|
|
99
124
|
if (this.autoRemoveServerFiles) {
|
|
100
125
|
this.getFilesThatWereRemoved().forEach((file) => {
|
|
101
|
-
this.
|
|
126
|
+
this.removing({
|
|
127
|
+
filesData: [file],
|
|
128
|
+
customFormData: null,
|
|
129
|
+
event: null,
|
|
130
|
+
cancel: false
|
|
131
|
+
});
|
|
102
132
|
});
|
|
103
133
|
}
|
|
104
134
|
}
|
|
@@ -121,11 +151,9 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
121
151
|
});
|
|
122
152
|
}
|
|
123
153
|
removeFile(file) {
|
|
124
|
-
this.debug("removeFile", file);
|
|
125
154
|
this.widget.remove(file);
|
|
126
155
|
}
|
|
127
156
|
async removing(args) {
|
|
128
|
-
this.debug("removing", args);
|
|
129
157
|
let event = new CustomEvent("on-removing", {
|
|
130
158
|
bubbles: true,
|
|
131
159
|
detail: args
|
|
@@ -146,7 +174,6 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
146
174
|
this.onWidgetRemoveFailed(error, args);
|
|
147
175
|
}
|
|
148
176
|
}
|
|
149
|
-
this.onRemoveSuccess(args);
|
|
150
177
|
}
|
|
151
178
|
onWidgetRemoveComplete(response, args) {
|
|
152
179
|
this.widget.removeCompleted(response, args.filesData[0], false);
|
|
@@ -155,15 +182,16 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
155
182
|
this.widget.removeFailed(e, args.filesData[0], false);
|
|
156
183
|
}
|
|
157
184
|
onRemoveSuccess(args) {
|
|
158
|
-
this.debug("onRemoveSuccess", args);
|
|
159
185
|
let _file = args.filesData[0];
|
|
160
186
|
let index = this[this._filesProperty].findIndex((x) => x.__id === _file.__id);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
187
|
+
if (index !== -1) {
|
|
188
|
+
const removedFile = this[this._filesProperty].splice(index, 1)[0];
|
|
189
|
+
let event = new CustomEvent("on-remove-success", {
|
|
190
|
+
bubbles: true,
|
|
191
|
+
detail: { args: args, removedFile: removedFile }
|
|
192
|
+
});
|
|
193
|
+
this.element.dispatchEvent(event);
|
|
194
|
+
}
|
|
167
195
|
}
|
|
168
196
|
success(args) {
|
|
169
197
|
if (args.operation === "upload") {
|
|
@@ -171,7 +199,7 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
171
199
|
let _uploadedFile = args.file;
|
|
172
200
|
let fileName = _uploadedFile.name.substr(0, _uploadedFile.name.length - (_uploadedFile.type.length + 1));
|
|
173
201
|
let additionalProperties = {};
|
|
174
|
-
additionalProperties[this._privateIdProperty] =
|
|
202
|
+
additionalProperties[this._privateIdProperty] = uuid();
|
|
175
203
|
if (this.uploadResultModel) {
|
|
176
204
|
for (let prop in this.uploadResultModel) {
|
|
177
205
|
additionalProperties[this.uploadResultModel[prop]] = response[prop];
|
|
@@ -188,15 +216,19 @@ let Ej2Uploader = class Ej2Uploader extends SyncfusionWrapper {
|
|
|
188
216
|
this[this._filesProperty] = [];
|
|
189
217
|
}
|
|
190
218
|
this[this._filesProperty].push(file);
|
|
191
|
-
let
|
|
219
|
+
let uploadedEvent = new CustomEvent("on-uploaded", {
|
|
192
220
|
bubbles: true,
|
|
193
|
-
detail: args
|
|
221
|
+
detail: { args: args, uploadedFile: file }
|
|
194
222
|
});
|
|
195
|
-
|
|
196
|
-
this.element.dispatchEvent(event);
|
|
223
|
+
this.element.dispatchEvent(uploadedEvent);
|
|
197
224
|
}
|
|
198
225
|
else if (args.operation === "remove") {
|
|
199
226
|
}
|
|
227
|
+
let successEvent = new CustomEvent("on-success", {
|
|
228
|
+
bubbles: true,
|
|
229
|
+
detail: args
|
|
230
|
+
});
|
|
231
|
+
this.element.dispatchEvent(successEvent);
|
|
200
232
|
}
|
|
201
233
|
failure(args) {
|
|
202
234
|
let event = new CustomEvent("on-failure", {
|
|
@@ -295,6 +327,10 @@ __decorate([
|
|
|
295
327
|
bindable,
|
|
296
328
|
__metadata("design:type", Object)
|
|
297
329
|
], Ej2Uploader.prototype, "context", void 0);
|
|
330
|
+
__decorate([
|
|
331
|
+
bindable,
|
|
332
|
+
__metadata("design:type", Array)
|
|
333
|
+
], Ej2Uploader.prototype, "files", void 0);
|
|
298
334
|
__decorate([
|
|
299
335
|
bindable,
|
|
300
336
|
__metadata("design:type", Boolean)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aurelia-syncfusion-ej2-bridge",
|
|
3
3
|
"description": "An Aurelia plugin wrapper for syncfusion EJ2 controls",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aurelia",
|
|
7
7
|
"syncfusion"
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@syncfusion/ej2": "^
|
|
15
|
+
"@syncfusion/ej2": "^25.2.7"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"start": "au run",
|
|
19
19
|
"build": "au build-plugin"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@syncfusion/ej2": "^
|
|
22
|
+
"@syncfusion/ej2": "^25.2.7",
|
|
23
23
|
"@types/jest": "^24.0.9",
|
|
24
24
|
"@types/node": "^10.11.6",
|
|
25
25
|
"aurelia-animator-css": "^1.0.4",
|
|
@@ -99,5 +99,10 @@
|
|
|
99
99
|
"text",
|
|
100
100
|
"html"
|
|
101
101
|
]
|
|
102
|
+
},
|
|
103
|
+
"overrides": {
|
|
104
|
+
"foo": {
|
|
105
|
+
"source-map": "0.7.4"
|
|
106
|
+
}
|
|
102
107
|
}
|
|
103
|
-
}
|
|
108
|
+
}
|