aurelia-syncfusion-ej2-bridge 0.1.0-beta.9 → 1.0.1

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.
Files changed (79) hide show
  1. package/README.md +1 -0
  2. package/dist/commonjs/common/controlBase.d.ts +3 -1
  3. package/dist/commonjs/common/controlBase.js +18 -9
  4. package/dist/commonjs/common/syncfusionWrapper.d.ts +3 -0
  5. package/dist/commonjs/common/syncfusionWrapper.js +11 -6
  6. package/dist/commonjs/configBuider.d.ts +2 -0
  7. package/dist/commonjs/configBuider.js +12 -2
  8. package/dist/commonjs/controlBindings.d.ts +10 -0
  9. package/dist/commonjs/controlBindings.js +70 -38
  10. package/dist/commonjs/index.js +2 -2
  11. package/dist/commonjs/utilities/decorator.js +2 -3
  12. package/dist/commonjs/widgets/accordion/ej2-accordion.js +6 -6
  13. package/dist/commonjs/widgets/autoComplete/ej2-autoComplete.js +5 -5
  14. package/dist/commonjs/widgets/button/ej2-button.d.ts +1 -1
  15. package/dist/commonjs/widgets/button/ej2-button.js +13 -11
  16. package/dist/commonjs/widgets/checkbox/ej2-checkbox-list.js +4 -5
  17. package/dist/commonjs/widgets/checkbox/ej2-checkbox.js +6 -7
  18. package/dist/commonjs/widgets/comboBox/ej2-comboBox.js +5 -5
  19. package/dist/commonjs/widgets/dashboardLayout/ej2-dashboardLayout.js +5 -5
  20. package/dist/commonjs/widgets/datePicker/ej2-DatePicker.js +5 -5
  21. package/dist/commonjs/widgets/dateRangePicker/ej2-dateRangePicker.js +5 -5
  22. package/dist/commonjs/widgets/dateTimePicker/ej2-dateTimePicker.js +5 -5
  23. package/dist/commonjs/widgets/dropDownList/ej2-dropDownList.js +5 -5
  24. package/dist/commonjs/widgets/dropDownTree/ej2-dropDownTree.js +5 -5
  25. package/dist/commonjs/widgets/fileManager/ej2-fileManager.js +6 -6
  26. package/dist/commonjs/widgets/grid/ej2-grid.js +27 -27
  27. package/dist/commonjs/widgets/listView/ej2-listView.js +6 -6
  28. package/dist/commonjs/widgets/maskedTextBox/ej2-maskedTextBox.js +6 -6
  29. package/dist/commonjs/widgets/multiSelect/ej2-multiSelect.d.ts +10 -0
  30. package/dist/commonjs/widgets/multiSelect/ej2-multiSelect.js +44 -0
  31. package/dist/commonjs/widgets/numericTextBox/ej2-numericTextBox.js +5 -5
  32. package/dist/commonjs/widgets/pager/ej2-pager.js +5 -5
  33. package/dist/commonjs/widgets/progressButton/ej2-progress-button.d.ts +1 -1
  34. package/dist/commonjs/widgets/progressButton/ej2-progress-button.js +13 -11
  35. package/dist/commonjs/widgets/radio/ej2-radio.js +8 -8
  36. package/dist/commonjs/widgets/schedule/ej2-schedule.d.ts +8 -0
  37. package/dist/commonjs/widgets/schedule/ej2-schedule.js +32 -0
  38. package/dist/commonjs/widgets/sidebar/ej2-sidebar.js +5 -5
  39. package/dist/commonjs/widgets/slider/ej2-slider.d.ts +2 -0
  40. package/dist/commonjs/widgets/slider/ej2-slider.js +19 -5
  41. package/dist/commonjs/widgets/splitter/ej2-splitter.js +5 -7
  42. package/dist/commonjs/widgets/switch/ej2-switch.d.ts +2 -1
  43. package/dist/commonjs/widgets/switch/ej2-switch.js +13 -9
  44. package/dist/commonjs/widgets/textBox/ej2-textBox.js +6 -6
  45. package/dist/commonjs/widgets/timePicker/ej2-timePicker.js +5 -5
  46. package/dist/commonjs/widgets/treeView/ej2-treeView.js +5 -5
  47. package/dist/commonjs/widgets/uploader/ej2-uploader.d.ts +7 -1
  48. package/dist/commonjs/widgets/uploader/ej2-uploader.js +70 -34
  49. package/dist/native-modules/common/controlBase.d.ts +3 -1
  50. package/dist/native-modules/common/controlBase.js +16 -7
  51. package/dist/native-modules/common/syncfusionWrapper.d.ts +3 -0
  52. package/dist/native-modules/common/syncfusionWrapper.js +11 -6
  53. package/dist/native-modules/configBuider.d.ts +2 -0
  54. package/dist/native-modules/configBuider.js +12 -2
  55. package/dist/native-modules/controlBindings.d.ts +10 -0
  56. package/dist/native-modules/controlBindings.js +70 -38
  57. package/dist/native-modules/interfaces/IEJ2WidgetBridge.js +1 -0
  58. package/dist/native-modules/interfaces/IEj2Uploader.js +1 -0
  59. package/dist/native-modules/widgets/button/ej2-button.d.ts +1 -1
  60. package/dist/native-modules/widgets/button/ej2-button.js +9 -7
  61. package/dist/native-modules/widgets/checkbox/ej2-checkbox-list.js +0 -1
  62. package/dist/native-modules/widgets/checkbox/ej2-checkbox.js +2 -3
  63. package/dist/native-modules/widgets/grid/ej2-grid.js +22 -22
  64. package/dist/native-modules/widgets/listView/ej2-listView.js +1 -1
  65. package/dist/native-modules/widgets/multiSelect/ej2-multiSelect.d.ts +10 -0
  66. package/dist/native-modules/widgets/multiSelect/ej2-multiSelect.js +41 -0
  67. package/dist/native-modules/widgets/progressButton/ej2-progress-button.d.ts +1 -1
  68. package/dist/native-modules/widgets/progressButton/ej2-progress-button.js +8 -6
  69. package/dist/native-modules/widgets/radio/ej2-radio.js +3 -3
  70. package/dist/native-modules/widgets/schedule/ej2-schedule.d.ts +8 -0
  71. package/dist/native-modules/widgets/schedule/ej2-schedule.js +29 -0
  72. package/dist/native-modules/widgets/slider/ej2-slider.d.ts +2 -0
  73. package/dist/native-modules/widgets/slider/ej2-slider.js +11 -0
  74. package/dist/native-modules/widgets/splitter/ej2-splitter.js +0 -2
  75. package/dist/native-modules/widgets/switch/ej2-switch.d.ts +2 -1
  76. package/dist/native-modules/widgets/switch/ej2-switch.js +8 -4
  77. package/dist/native-modules/widgets/uploader/ej2-uploader.d.ts +7 -1
  78. package/dist/native-modules/widgets/uploader/ej2-uploader.js +65 -29
  79. package/package.json +9 -7
@@ -1,6 +1,8 @@
1
1
  import { SyncfusionWrapper } from "../../common/syncfusionWrapper";
2
2
  import { Slider, SliderModel, SliderChangeEventArgs } from "@syncfusion/ej2-inputs";
3
3
  export declare class Ej2Slider extends SyncfusionWrapper<Slider, SliderModel> {
4
+ private containerResizeObserver;
5
+ private resize;
4
6
  protected syncfusionWidgetType: typeof Slider;
5
7
  protected onWrapperCreated(): void;
6
8
  protected onWidgetCreated(): void;
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  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;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.Ej2Slider = void 0;
10
13
  const constants_1 = require("./../../common/constants");
@@ -12,12 +15,23 @@ const syncfusionWrapper_1 = require("../../common/syncfusionWrapper");
12
15
  const ej2_inputs_1 = require("@syncfusion/ej2-inputs");
13
16
  const decorator_1 = require("../../utilities/decorator");
14
17
  const aurelia_framework_1 = require("aurelia-framework");
18
+ const lodash_1 = __importDefault(require("lodash"));
15
19
  let Ej2Slider = class Ej2Slider extends syncfusionWrapper_1.SyncfusionWrapper {
16
20
  constructor() {
17
21
  super(...arguments);
22
+ this.containerResizeObserver = null;
23
+ this.resize = lodash_1.default.debounce(() => {
24
+ this.taskQueue.queueTask(() => {
25
+ this.widget.refresh();
26
+ });
27
+ }, 100);
18
28
  this.syncfusionWidgetType = ej2_inputs_1.Slider;
19
29
  }
20
30
  onWrapperCreated() {
31
+ this.containerResizeObserver = new ResizeObserver((entries) => {
32
+ this.resize();
33
+ });
34
+ this.containerResizeObserver.observe(this.widgetElement);
21
35
  }
22
36
  onWidgetCreated() {
23
37
  let _this = this;
@@ -29,9 +43,9 @@ let Ej2Slider = class Ej2Slider extends syncfusionWrapper_1.SyncfusionWrapper {
29
43
  this[`${constants_1.constants.bindablePrefix}value`] = event.value;
30
44
  }
31
45
  };
32
- Ej2Slider = __decorate([
33
- decorator_1.generateBindables("slider"),
34
- aurelia_framework_1.inlineView(`<template><div element.ref="widgetElement"></div></template>`),
35
- aurelia_framework_1.customElement('ej2-slider')
36
- ], Ej2Slider);
37
46
  exports.Ej2Slider = Ej2Slider;
47
+ exports.Ej2Slider = Ej2Slider = __decorate([
48
+ (0, decorator_1.generateBindables)("slider"),
49
+ (0, aurelia_framework_1.inlineView)(`<template><div element.ref="widgetElement"></div></template>`),
50
+ (0, aurelia_framework_1.customElement)('ej2-slider')
51
+ ], Ej2Slider);
@@ -17,15 +17,13 @@ let Ej2Splitter = class Ej2Splitter extends syncfusionWrapper_1.SyncfusionWrappe
17
17
  this.syncfusionWidgetType = ej2_layouts_1.Splitter;
18
18
  }
19
19
  onWrapperCreated() {
20
- this.debug("splitter wrapper created");
21
20
  }
22
21
  onWidgetCreated() {
23
- this.debug("splitter widget created", this.widget);
24
22
  }
25
23
  };
26
- Ej2Splitter = __decorate([
27
- decorator_1.generateBindables("splitter"),
28
- aurelia_framework_1.inlineView(`<template><div element.ref="widgetElement"><slot></slot></div></template>`),
29
- aurelia_framework_1.customElement('ej2-splitter')
30
- ], Ej2Splitter);
31
24
  exports.Ej2Splitter = Ej2Splitter;
25
+ exports.Ej2Splitter = Ej2Splitter = __decorate([
26
+ (0, decorator_1.generateBindables)("splitter"),
27
+ (0, aurelia_framework_1.inlineView)(`<template><div element.ref="widgetElement"><slot></slot></div></template>`),
28
+ (0, aurelia_framework_1.customElement)('ej2-splitter')
29
+ ], Ej2Splitter);
@@ -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
  }
@@ -17,6 +17,7 @@ let Ej2Switch = class Ej2Switch extends syncfusionWrapper_1.SyncfusionWrapper {
17
17
  super(...arguments);
18
18
  this.syncfusionWidgetType = ej2_buttons_1.Switch;
19
19
  this.id = null;
20
+ this.onChange = null;
20
21
  }
21
22
  onWrapperCreated() {
22
23
  this.id = this.element.getAttribute("id");
@@ -27,10 +28,10 @@ let Ej2Switch = class Ej2Switch extends syncfusionWrapper_1.SyncfusionWrapper {
27
28
  }
28
29
  onWidgetCreated() {
29
30
  let _this = this;
30
- this.widget.addEventListener("change", (args) => { _this.onChange(args); });
31
- }
32
- onChange(args) {
33
- this[`${constants_1.constants.bindablePrefix}checked`] = args.checked;
31
+ this.onChange = (args) => {
32
+ _this[`${constants_1.constants.bindablePrefix}checked`] = args.checked;
33
+ };
34
+ this.widget.addEventListener("change", this.onChange);
34
35
  }
35
36
  recreate() {
36
37
  if (this.id) {
@@ -39,10 +40,13 @@ let Ej2Switch = class Ej2Switch extends syncfusionWrapper_1.SyncfusionWrapper {
39
40
  this.element.setAttribute("id", this.id);
40
41
  super.recreate();
41
42
  }
43
+ detached() {
44
+ this.widget.removeEventListener("change", this.onChange);
45
+ }
42
46
  };
43
- Ej2Switch = __decorate([
44
- decorator_1.generateBindables("switch"),
45
- aurelia_framework_1.inlineView(`<template><slot></slot><input element.ref="widgetElement" type="checkbox" /></template>`),
46
- aurelia_framework_1.customElement('ej2-switch')
47
- ], Ej2Switch);
48
47
  exports.Ej2Switch = Ej2Switch;
48
+ exports.Ej2Switch = Ej2Switch = __decorate([
49
+ (0, decorator_1.generateBindables)("switch"),
50
+ (0, aurelia_framework_1.inlineView)(`<template><slot></slot><input element.ref="widgetElement" type="checkbox" /></template>`),
51
+ (0, aurelia_framework_1.customElement)('ej2-switch')
52
+ ], Ej2Switch);
@@ -13,7 +13,7 @@ const ej2_inputs_1 = require("@syncfusion/ej2-inputs");
13
13
  const decorator_1 = require("../../utilities/decorator");
14
14
  const ej2_base_1 = require("@syncfusion/ej2-base");
15
15
  const aurelia_framework_1 = require("aurelia-framework");
16
- ej2_base_1.enableRipple(true);
16
+ (0, ej2_base_1.enableRipple)(true);
17
17
  let Ej2TextBox = class Ej2TextBox extends syncfusionWrapper_1.SyncfusionWrapper {
18
18
  constructor() {
19
19
  super(...arguments);
@@ -29,9 +29,9 @@ let Ej2TextBox = class Ej2TextBox extends syncfusionWrapper_1.SyncfusionWrapper
29
29
  this[`${constants_1.constants.bindablePrefix}value`] = args.value;
30
30
  }
31
31
  };
32
- Ej2TextBox = __decorate([
33
- decorator_1.generateBindables("textBox"),
34
- aurelia_framework_1.inlineView(`<template><input element.ref="widgetElement" /></template>`),
35
- aurelia_framework_1.customElement('ej2-text-box')
36
- ], Ej2TextBox);
37
32
  exports.Ej2TextBox = Ej2TextBox;
33
+ exports.Ej2TextBox = Ej2TextBox = __decorate([
34
+ (0, decorator_1.generateBindables)("textBox"),
35
+ (0, aurelia_framework_1.inlineView)(`<template><input element.ref="widgetElement" /></template>`),
36
+ (0, aurelia_framework_1.customElement)('ej2-text-box')
37
+ ], Ej2TextBox);
@@ -27,9 +27,9 @@ let Ej2TimePicker = class Ej2TimePicker extends syncfusionWrapper_1.SyncfusionWr
27
27
  this[`${constants_1.constants.bindablePrefix}value`] = args.value;
28
28
  }
29
29
  };
30
- Ej2TimePicker = __decorate([
31
- decorator_1.generateBindables("timePicker"),
32
- aurelia_framework_1.inlineView(`<template><input element.ref="widgetElement" /></template>`),
33
- aurelia_framework_1.customElement('ej2-time-picker')
34
- ], Ej2TimePicker);
35
30
  exports.Ej2TimePicker = Ej2TimePicker;
31
+ exports.Ej2TimePicker = Ej2TimePicker = __decorate([
32
+ (0, decorator_1.generateBindables)("timePicker"),
33
+ (0, aurelia_framework_1.inlineView)(`<template><input element.ref="widgetElement" /></template>`),
34
+ (0, aurelia_framework_1.customElement)('ej2-time-picker')
35
+ ], Ej2TimePicker);
@@ -21,9 +21,9 @@ let Ej2TreeView = class Ej2TreeView extends syncfusionWrapper_1.SyncfusionWrappe
21
21
  onWidgetCreated() {
22
22
  }
23
23
  };
24
- Ej2TreeView = __decorate([
25
- decorator_1.generateBindables("treeView"),
26
- aurelia_framework_1.inlineView(`<template><div element.ref="widgetElement"></div></template>`),
27
- aurelia_framework_1.customElement('ej2-tree-view')
28
- ], Ej2TreeView);
29
24
  exports.Ej2TreeView = Ej2TreeView;
25
+ exports.Ej2TreeView = Ej2TreeView = __decorate([
26
+ (0, decorator_1.generateBindables)("treeView"),
27
+ (0, aurelia_framework_1.inlineView)(`<template><div element.ref="widgetElement"></div></template>`),
28
+ (0, aurelia_framework_1.customElement)('ej2-tree-view')
29
+ ], Ej2TreeView);
@@ -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
- filesChanged(): void;
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[];
@@ -15,12 +15,13 @@ const ej2_inputs_1 = require("@syncfusion/ej2-inputs");
15
15
  const syncfusionWrapper_1 = require("../../common/syncfusionWrapper");
16
16
  const decorator_1 = require("../../utilities/decorator");
17
17
  const aurelia_framework_1 = require("aurelia-framework");
18
- const uid = require("uuid/v4");
18
+ const uuid_1 = require("uuid");
19
19
  const aurelia_framework_2 = require("aurelia-framework");
20
20
  let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrapper {
21
21
  constructor() {
22
22
  super(...arguments);
23
23
  this._filesProperty = `${constants_1.constants.bindablePrefix}files`;
24
+ this.originalFiles = null;
24
25
  this._filesCollectionSubscription = null;
25
26
  this._privateIdProperty = "__id";
26
27
  this.syncfusionWidgetType = ej2_inputs_1.Uploader;
@@ -33,13 +34,14 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
33
34
  this.dataAdapter = null;
34
35
  this.autoRemoveServerFiles = true;
35
36
  this.context = null;
37
+ this.files = null;
38
+ this.firstBind = true;
36
39
  this.serverDelete = true;
37
40
  }
38
41
  get _files() {
39
42
  return this[this._filesProperty];
40
43
  }
41
44
  onWrapperCreated() {
42
- this.debug("wrapper created");
43
45
  this.widget.uploading = (args) => { this.onFileUpload(args); };
44
46
  this.widget.success = (args) => { this.success(args); };
45
47
  this.widget.failure = (args) => { this.failure(args); };
@@ -55,20 +57,28 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
55
57
  _this.widget.removingEventCallback(eventArgs, formData, selectedFiles, file);
56
58
  });
57
59
  };
60
+ this.widget.asyncSettings.removeUrl = null;
58
61
  }
59
62
  }
60
63
  }
61
- filesChanged() {
62
- this.debug("files Changed");
63
- this.recreate();
64
+ onfilesChanged() {
65
+ if (!this.firstBind) {
66
+ this.widget.clearAll();
67
+ this.recreate();
68
+ }
69
+ }
70
+ recreating() {
64
71
  this._filesCollectionSubscription.dispose();
65
- this.taskQueue.queueTask(() => {
66
- this.widget.files = this._files;
67
- this.initializeFileCollection();
68
- this._filesCollectionSubscription = this.createFilesCollectionSubscription();
69
- });
72
+ this[this._filesProperty].splice(0, this[this._filesProperty].length, ...this.originalFiles);
73
+ }
74
+ recreated() {
75
+ this.initializeFileCollection();
76
+ this._filesCollectionSubscription = this.createFilesCollectionSubscription();
70
77
  }
71
78
  initializeFileCollection() {
79
+ if (this.files && Array.isArray(this.files)) {
80
+ this.widget.files.push(...JSON.parse(JSON.stringify(this.files)));
81
+ }
72
82
  if (this.widget.files) {
73
83
  let extraProperties = [];
74
84
  let widgetFiles = this.widget.getFilesData();
@@ -82,7 +92,7 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
82
92
  }
83
93
  }
84
94
  initializeFile(widgetFile, i, extraProperties) {
85
- let __id = uid();
95
+ let __id = (0, uuid_1.v4)();
86
96
  widgetFile[this._privateIdProperty] = __id;
87
97
  this._files[i][this._privateIdProperty] = __id;
88
98
  extraProperties.forEach((prop) => {
@@ -94,14 +104,34 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
94
104
  this._filesCollectionSubscription = this.createFilesCollectionSubscription();
95
105
  this.subscriptions.push(this._filesCollectionSubscription);
96
106
  }
107
+ onBind() {
108
+ this.firstBind = false;
109
+ this.subscriptions.push(this.bindingEngine.propertyObserver(this, "files").subscribe(() => { this.onfilesChanged(); }));
110
+ if (this[this._filesProperty] && Array.isArray(this[this._filesProperty])) {
111
+ this.originalFiles = JSON.parse(JSON.stringify(this[this._filesProperty]));
112
+ }
113
+ else if (this.files && Array.isArray(this.files)) {
114
+ this.originalFiles = JSON.parse(JSON.stringify(this.files));
115
+ }
116
+ else {
117
+ this.originalFiles = [];
118
+ }
119
+ }
97
120
  createFilesCollectionSubscription() {
98
- return this.bindingEngine.collectionObserver(this._files).subscribe((changed) => {
99
- });
121
+ if (!this._files) {
122
+ this[this._filesProperty] = [];
123
+ }
124
+ return this.bindingEngine.collectionObserver(this._files).subscribe((changed) => { });
100
125
  }
101
126
  change() {
102
127
  if (this.autoRemoveServerFiles) {
103
128
  this.getFilesThatWereRemoved().forEach((file) => {
104
- this.removeFile(file);
129
+ this.removing({
130
+ filesData: [file],
131
+ customFormData: null,
132
+ event: null,
133
+ cancel: false
134
+ });
105
135
  });
106
136
  }
107
137
  }
@@ -124,11 +154,9 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
124
154
  });
125
155
  }
126
156
  removeFile(file) {
127
- this.debug("removeFile", file);
128
157
  this.widget.remove(file);
129
158
  }
130
159
  async removing(args) {
131
- this.debug("removing", args);
132
160
  let event = new CustomEvent("on-removing", {
133
161
  bubbles: true,
134
162
  detail: args
@@ -149,7 +177,6 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
149
177
  this.onWidgetRemoveFailed(error, args);
150
178
  }
151
179
  }
152
- this.onRemoveSuccess(args);
153
180
  }
154
181
  onWidgetRemoveComplete(response, args) {
155
182
  this.widget.removeCompleted(response, args.filesData[0], false);
@@ -158,15 +185,16 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
158
185
  this.widget.removeFailed(e, args.filesData[0], false);
159
186
  }
160
187
  onRemoveSuccess(args) {
161
- this.debug("onRemoveSuccess", args);
162
188
  let _file = args.filesData[0];
163
189
  let index = this[this._filesProperty].findIndex((x) => x.__id === _file.__id);
164
- this[this._filesProperty].splice(index, 1);
165
- let event = new CustomEvent("on-remove-success", {
166
- bubbles: true,
167
- detail: args
168
- });
169
- this.element.dispatchEvent(event);
190
+ if (index !== -1) {
191
+ const removedFile = this[this._filesProperty].splice(index, 1)[0];
192
+ let event = new CustomEvent("on-remove-success", {
193
+ bubbles: true,
194
+ detail: { args: args, removedFile: removedFile }
195
+ });
196
+ this.element.dispatchEvent(event);
197
+ }
170
198
  }
171
199
  success(args) {
172
200
  if (args.operation === "upload") {
@@ -174,7 +202,7 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
174
202
  let _uploadedFile = args.file;
175
203
  let fileName = _uploadedFile.name.substr(0, _uploadedFile.name.length - (_uploadedFile.type.length + 1));
176
204
  let additionalProperties = {};
177
- additionalProperties[this._privateIdProperty] = uid();
205
+ additionalProperties[this._privateIdProperty] = (0, uuid_1.v4)();
178
206
  if (this.uploadResultModel) {
179
207
  for (let prop in this.uploadResultModel) {
180
208
  additionalProperties[this.uploadResultModel[prop]] = response[prop];
@@ -191,15 +219,19 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
191
219
  this[this._filesProperty] = [];
192
220
  }
193
221
  this[this._filesProperty].push(file);
194
- let event = new CustomEvent("on-success", {
222
+ let uploadedEvent = new CustomEvent("on-uploaded", {
195
223
  bubbles: true,
196
- detail: args
224
+ detail: { args: args, uploadedFile: file }
197
225
  });
198
- console.log("file after upload", _uploadedFile);
199
- this.element.dispatchEvent(event);
226
+ this.element.dispatchEvent(uploadedEvent);
200
227
  }
201
228
  else if (args.operation === "remove") {
202
229
  }
230
+ let successEvent = new CustomEvent("on-success", {
231
+ bubbles: true,
232
+ detail: args
233
+ });
234
+ this.element.dispatchEvent(successEvent);
203
235
  }
204
236
  failure(args) {
205
237
  let event = new CustomEvent("on-failure", {
@@ -270,6 +302,7 @@ let Ej2Uploader = class Ej2Uploader extends syncfusionWrapper_1.SyncfusionWrappe
270
302
  return _metadata;
271
303
  }
272
304
  };
305
+ exports.Ej2Uploader = Ej2Uploader;
273
306
  __decorate([
274
307
  aurelia_framework_1.bindable,
275
308
  __metadata("design:type", Object)
@@ -298,13 +331,16 @@ __decorate([
298
331
  aurelia_framework_1.bindable,
299
332
  __metadata("design:type", Object)
300
333
  ], Ej2Uploader.prototype, "context", void 0);
334
+ __decorate([
335
+ aurelia_framework_1.bindable,
336
+ __metadata("design:type", Array)
337
+ ], Ej2Uploader.prototype, "files", void 0);
301
338
  __decorate([
302
339
  aurelia_framework_1.bindable,
303
340
  __metadata("design:type", Boolean)
304
341
  ], Ej2Uploader.prototype, "serverDelete", void 0);
305
- Ej2Uploader = __decorate([
306
- decorator_1.generateBindables("uploader"),
307
- aurelia_framework_2.inlineView(`<template><input element.ref="widgetElement" type="file" name="UploadFiles" /></template>`),
308
- aurelia_framework_2.customElement('ej2-uploader')
342
+ exports.Ej2Uploader = Ej2Uploader = __decorate([
343
+ (0, decorator_1.generateBindables)("uploader"),
344
+ (0, aurelia_framework_2.inlineView)(`<template><input element.ref="widgetElement" type="file" name="UploadFiles" /></template>`),
345
+ (0, aurelia_framework_2.customElement)('ej2-uploader')
309
346
  ], Ej2Uploader);
310
- exports.Ej2Uploader = Ej2Uploader;
@@ -8,7 +8,8 @@ export declare class ControlBase<T, U> {
8
8
  protected taskQueue: TaskQueue;
9
9
  protected eventAggregator: EventAggregator;
10
10
  protected element: Element;
11
- eModel: U;
11
+ private eModel;
12
+ protected _eModel: U;
12
13
  protected widgetElement: HTMLElement;
13
14
  widget: T;
14
15
  protected bindingContext: any;
@@ -18,6 +19,7 @@ export declare class ControlBase<T, U> {
18
19
  protected subscriptions: Disposable[];
19
20
  constructor(bindingEngine: BindingEngine, controlContainer: ControlContainer, taskQueue: TaskQueue, eventAggregator: EventAggregator, element: Element);
20
21
  onBind(): void;
22
+ onAttached(): void;
21
23
  onCreateControl(): void;
22
24
  protected debug(message: string, ...rest: any[]): void;
23
25
  protected info(message: string, ...rest: any[]): void;
@@ -14,6 +14,9 @@ import { constants } from "./constants";
14
14
  import { EventAggregator } from 'aurelia-event-aggregator';
15
15
  let logger = LogManager.getLogger("SyncfusionBridge");
16
16
  let ControlBase = class ControlBase {
17
+ get controlType() {
18
+ throw "syncfusionControlType is not set";
19
+ }
17
20
  constructor(bindingEngine, controlContainer, taskQueue, eventAggregator, element) {
18
21
  this.bindingEngine = bindingEngine;
19
22
  this.controlContainer = controlContainer;
@@ -21,19 +24,18 @@ let ControlBase = class ControlBase {
21
24
  this.eventAggregator = eventAggregator;
22
25
  this.element = element;
23
26
  this.eModel = null;
27
+ this._eModel = null;
24
28
  this.widgetElement = null;
25
29
  this.widget = null;
26
30
  this.bindingContext = null;
27
31
  this.logName = "";
28
32
  this.propertyPriority = true;
29
33
  this.subscriptions = [];
30
- this.eModel = {};
31
- }
32
- get controlType() {
33
- throw "syncfusionControlType is not set";
34
34
  }
35
35
  onBind() {
36
36
  }
37
+ onAttached() {
38
+ }
37
39
  onCreateControl() {
38
40
  throw "onCreateControl is not implemented";
39
41
  }
@@ -52,6 +54,7 @@ let ControlBase = class ControlBase {
52
54
  bind(context) {
53
55
  this.logName = this.controlType.name;
54
56
  this.bindingContext = context;
57
+ this._eModel = Object.assign({}, this.eModel);
55
58
  this.setInitialBindings();
56
59
  this.onCreateControl();
57
60
  this.onBind();
@@ -62,8 +65,8 @@ let ControlBase = class ControlBase {
62
65
  _control.bindableProperties.forEach((property) => {
63
66
  if (!property.startsWith(constants.eventPrefix)) {
64
67
  let modelProperty = property.substr(bindablePrefixLength);
65
- if (this[property] !== undefined && (this.propertyPriority || this.eModel[modelProperty] === undefined)) {
66
- this.eModel[modelProperty] = this[property];
68
+ if (this[property] !== undefined && (this.propertyPriority || this._eModel[modelProperty] === undefined)) {
69
+ this._eModel[modelProperty] = this[property];
67
70
  }
68
71
  }
69
72
  });
@@ -121,15 +124,21 @@ let ControlBase = class ControlBase {
121
124
  }
122
125
  attached() {
123
126
  this.appendWidget();
127
+ this.onAttached();
124
128
  }
125
129
  appendWidget() {
126
130
  this.widget.appendTo(this.widgetElement);
127
131
  }
128
132
  detached() {
129
- this.subscriptions.forEach((subscription) => subscription.dispose());
133
+ this.subscriptions.forEach((subscription) => { if (subscription) {
134
+ subscription.dispose();
135
+ } });
130
136
  if (this.widget.destroy) {
131
137
  this.widget.destroy();
132
138
  }
139
+ this.widget = null;
140
+ this._eModel = null;
141
+ this.widgetElement = null;
133
142
  }
134
143
  };
135
144
  __decorate([
@@ -5,6 +5,9 @@ export declare abstract class SyncfusionWrapper<T, U> extends ControlBase<T, U>
5
5
  protected abstract onWidgetCreated(): any;
6
6
  onCreateControl(): void;
7
7
  recreate(): void;
8
+ onRecreate(): void;
9
+ recreating(): void;
10
+ recreated(): void;
8
11
  refresh(): void;
9
12
  dataBind(): void;
10
13
  protected get controlType(): any;
@@ -1,22 +1,27 @@
1
1
  import { ControlBase } from "./controlBase";
2
2
  export class SyncfusionWrapper extends ControlBase {
3
- constructor() {
4
- super(...arguments);
5
- this.syncfusionWidgetType = null;
6
- }
7
3
  onCreateControl() {
8
4
  this.onBeforeWidgetInstantiation();
9
- this.widget = new this.syncfusionWidgetType(this.eModel);
5
+ this.widget = new this.syncfusionWidgetType(this._eModel);
10
6
  this.widget.created = () => { this.onWidgetCreated(); };
11
7
  this.onWrapperCreated();
12
8
  this.createControlEvents(this.getBindables());
13
9
  }
14
10
  recreate() {
15
- this.debug("recreate");
11
+ this.onRecreate();
16
12
  this.widget.destroy();
13
+ this.widget = null;
14
+ this.recreating();
17
15
  this.setInitialBindings();
18
16
  this.onCreateControl();
19
17
  this.appendWidget();
18
+ this.recreated();
19
+ }
20
+ onRecreate() {
21
+ }
22
+ recreating() {
23
+ }
24
+ recreated() {
20
25
  }
21
26
  refresh() {
22
27
  this.widget.refresh();
@@ -22,10 +22,12 @@ export declare class ConfigBuilder {
22
22
  ej2Grid(): ConfigBuilder;
23
23
  ej2ListView(): ConfigBuilder;
24
24
  ej2MaskedTextBox(): ConfigBuilder;
25
+ ej2MultiSelect(): ConfigBuilder;
25
26
  ej2NumericTextBox(): ConfigBuilder;
26
27
  ej2Pager(): ConfigBuilder;
27
28
  ej2ProgressButton(): ConfigBuilder;
28
29
  ej2Radio(): ConfigBuilder;
30
+ ej2Schedule(): ConfigBuilder;
29
31
  ej2Sidebar(): ConfigBuilder;
30
32
  ej2Slider(): ConfigBuilder;
31
33
  ej2Splitter(): ConfigBuilder;
@@ -1,7 +1,8 @@
1
+ import { Ej2MultiSelect } from './widgets/multiSelect/ej2-multiSelect';
2
+ import { Ej2Schedule } from './widgets/schedule/ej2-schedule';
1
3
  import { Ej2FileManager } from './widgets/fileManager/ej2-fileManager';
2
4
  import { Ej2Sidebar } from './widgets/sidebar/ej2-sidebar';
3
5
  import { Ej2DatePicker } from './widgets/datePicker/ej2-DatePicker';
4
- import { PLATFORM } from "aurelia-pal";
5
6
  import { Ej2TextBox } from './widgets/textBox/ej2-textBox';
6
7
  import { Ej2DateRangePicker } from './widgets/dateRangePicker/ej2-dateRangePicker';
7
8
  import { Ej2DateTimePicker } from './widgets/dateTimePicker/ej2-dateTimePicker';
@@ -50,10 +51,12 @@ export class ConfigBuilder {
50
51
  .ej2Grid()
51
52
  .ej2ListView()
52
53
  .ej2MaskedTextBox()
54
+ .ej2MultiSelect()
53
55
  .ej2NumericTextBox()
54
56
  .ej2Pager()
55
57
  .ej2ProgressButton()
56
58
  .ej2Radio()
59
+ .ej2Schedule()
57
60
  .ej2Sidebar()
58
61
  .ej2Slider()
59
62
  .ej2Splitter()
@@ -76,7 +79,6 @@ export class ConfigBuilder {
76
79
  }
77
80
  }
78
81
  materialTheme() {
79
- this.resources.push(PLATFORM.moduleName("@syncfusion/ej2/material.css"));
80
82
  return this;
81
83
  }
82
84
  withoutGlobalResources() {
@@ -147,6 +149,10 @@ export class ConfigBuilder {
147
149
  this.resources.push(Ej2MaskedTextBox);
148
150
  return this;
149
151
  }
152
+ ej2MultiSelect() {
153
+ this.resources.push(Ej2MultiSelect);
154
+ return this;
155
+ }
150
156
  ej2NumericTextBox() {
151
157
  this.resources.push(Ej2NumericTextBox);
152
158
  return this;
@@ -163,6 +169,10 @@ export class ConfigBuilder {
163
169
  this.resources.push(Ej2Radio);
164
170
  return this;
165
171
  }
172
+ ej2Schedule() {
173
+ this.resources.push(Ej2Schedule);
174
+ return this;
175
+ }
166
176
  ej2Sidebar() {
167
177
  this.resources.push(Ej2Sidebar);
168
178
  return this;