@syncfusion/ej2-base 19.2.55 → 19.3.47
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/.eslintrc.json +1 -1
- package/CHANGELOG.md +1 -89
- package/README.md +1 -1
- package/dist/ej2-base.umd.min.js +2 -2
- package/dist/ej2-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-base.es2015.js +2650 -2401
- package/dist/es6/ej2-base.es2015.js.map +1 -1
- package/dist/es6/ej2-base.es5.js +3186 -2948
- package/dist/es6/ej2-base.es5.js.map +1 -1
- package/dist/global/ej2-base.min.js +2 -2
- package/dist/global/ej2-base.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/e2e/crypto.js +1 -1
- package/e2e/index.d.ts +0 -3
- package/e2e/m.protractor.config.js +1 -1
- package/e2e/protractor.config.js +1 -1
- package/helpers/e2e/base.js +3 -3
- package/package.json +7 -64
- package/src/ajax.d.ts +24 -10
- package/src/ajax.js +14 -6
- package/src/animation-model.d.ts +12 -4
- package/src/animation.d.ts +37 -12
- package/src/animation.js +48 -22
- package/src/base.d.ts +31 -11
- package/src/base.js +34 -16
- package/src/browser.d.ts +63 -25
- package/src/browser.js +60 -15
- package/src/child-property.d.ts +21 -10
- package/src/child-property.js +23 -13
- package/src/component-model.d.ts +4 -1
- package/src/component.d.ts +42 -5
- package/src/component.js +52 -35
- package/src/dom.d.ts +76 -25
- package/src/dom.js +128 -124
- package/src/draggable-model.d.ts +5 -0
- package/src/draggable.d.ts +4 -1
- package/src/draggable.js +8 -2
- package/src/droppable-model.d.ts +7 -4
- package/src/droppable.d.ts +7 -3
- package/src/droppable.js +1 -0
- package/src/event-handler.d.ts +10 -6
- package/src/event-handler.js +11 -7
- package/src/hijri-parser.d.ts +12 -0
- package/src/hijri-parser.js +111 -90
- package/src/internationalization.d.ts +54 -21
- package/src/internationalization.js +55 -18
- package/src/intl/date-formatter.d.ts +19 -8
- package/src/intl/date-formatter.js +36 -13
- package/src/intl/date-parser.d.ts +30 -23
- package/src/intl/date-parser.js +61 -42
- package/src/intl/intl-base.d.ts +123 -46
- package/src/intl/intl-base.js +451 -377
- package/src/intl/number-formatter.d.ts +45 -34
- package/src/intl/number-formatter.js +47 -35
- package/src/intl/number-parser.d.ts +11 -8
- package/src/intl/number-parser.js +14 -11
- package/src/intl/parser-base.d.ts +38 -13
- package/src/intl/parser-base.js +45 -16
- package/src/keyboard-model.d.ts +5 -2
- package/src/keyboard.d.ts +26 -8
- package/src/keyboard.js +24 -9
- package/src/l10n.d.ts +16 -7
- package/src/l10n.js +16 -7
- package/src/module-loader.d.ts +13 -8
- package/src/module-loader.js +13 -9
- package/src/notify-property-change.d.ts +19 -7
- package/src/notify-property-change.js +140 -24
- package/src/observer.d.ts +17 -5
- package/src/observer.js +19 -7
- package/src/sanitize-helper.d.ts +1 -0
- package/src/sanitize-helper.js +1 -1
- package/src/template-engine.d.ts +30 -4
- package/src/template-engine.js +37 -12
- package/src/template.d.ts +8 -3
- package/src/template.js +67 -19
- package/src/touch-model.d.ts +11 -4
- package/src/touch.d.ts +51 -9
- package/src/touch.js +45 -13
- package/src/util.d.ts +67 -37
- package/src/util.js +99 -49
- package/styles/_bootstrap-definition.scss +0 -1
- package/styles/_bootstrap5-dark-definition.scss +10 -0
- package/styles/_bootstrap5-definition.scss +9 -0
- package/styles/_fabric-dark-definition.scss +0 -1
- package/styles/_highcontrast-light-definition.scss +1 -0
- package/styles/_material-definition.scss +1 -0
- package/styles/bootstrap-dark.css +2613 -32
- package/styles/bootstrap.css +2613 -32
- package/styles/bootstrap4.css +2149 -32
- package/styles/bootstrap5-dark.css +2157 -0
- package/styles/bootstrap5-dark.scss +3 -0
- package/styles/bootstrap5.css +2157 -0
- package/styles/bootstrap5.scss +3 -0
- package/styles/common/_core.scss +28 -63
- package/styles/definition/_bootstrap-dark.scss +3 -3
- package/styles/definition/_bootstrap.scss +1 -1
- package/styles/definition/_bootstrap5-dark.scss +357 -0
- package/styles/definition/_bootstrap5.scss +356 -0
- package/styles/definition/_material-dark.scss +1 -1
- package/styles/definition/_tailwind-dark.scss +18 -1
- package/styles/definition/_tailwind.scss +17 -0
- package/styles/fabric-dark.css +2589 -32
- package/styles/fabric.css +2589 -32
- package/styles/highcontrast-light.css +2573 -32
- package/styles/highcontrast.css +2573 -32
- package/styles/material-dark.css +2549 -32
- package/styles/material.css +2549 -32
- package/styles/tailwind-dark.css +2221 -32
- package/styles/tailwind.css +2221 -32
- package/src/virtual-dom.d.ts +0 -32
- package/src/virtual-dom.js +0 -449
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { createInstance, isUndefined, merge, extend, getValue } from './util';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the Class Object
|
|
4
|
+
*
|
|
4
5
|
* @param {ClassObject} instance - instance of ClassObject
|
|
5
6
|
* @param {string} curKey - key of the current instance
|
|
6
7
|
* @param {Object} defaultValue - default Value
|
|
7
|
-
* @param {Object[]} type
|
|
8
|
+
* @param {Object[]} type ?
|
|
9
|
+
* @returns {ClassObject} ?
|
|
8
10
|
*/
|
|
11
|
+
// eslint-disable-next-line
|
|
9
12
|
function getObject(instance, curKey, defaultValue, type) {
|
|
13
|
+
// eslint-disable-next-line
|
|
10
14
|
if (!instance.properties.hasOwnProperty(curKey) || !(instance.properties[curKey] instanceof type)) {
|
|
11
15
|
instance.properties[curKey] = createInstance(type, [instance, curKey, defaultValue]);
|
|
12
16
|
}
|
|
@@ -14,13 +18,16 @@ function getObject(instance, curKey, defaultValue, type) {
|
|
|
14
18
|
}
|
|
15
19
|
/**
|
|
16
20
|
* Returns object array
|
|
17
|
-
*
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {
|
|
20
|
-
* @param
|
|
21
|
-
* @param {
|
|
22
|
-
* @
|
|
21
|
+
*
|
|
22
|
+
* @param {ClassObject} instance ?
|
|
23
|
+
* @param {string} curKey ?
|
|
24
|
+
* @param {Object[]} defaultValue ?
|
|
25
|
+
* @param {Object} type ?
|
|
26
|
+
* @param {boolean} isSetter ?
|
|
27
|
+
* @param {boolean} isFactory ?
|
|
28
|
+
* @returns {Object[]} ?
|
|
23
29
|
*/
|
|
30
|
+
// eslint-disable-next-line
|
|
24
31
|
function getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {
|
|
25
32
|
var result = [];
|
|
26
33
|
var len = defaultValue ? defaultValue.length : 0;
|
|
@@ -42,11 +49,14 @@ function getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactor
|
|
|
42
49
|
}
|
|
43
50
|
/**
|
|
44
51
|
* Returns the properties of the object
|
|
45
|
-
*
|
|
46
|
-
* @param {
|
|
52
|
+
*
|
|
53
|
+
* @param {Object} defaultValue ?
|
|
54
|
+
* @param {string} curKey ?
|
|
55
|
+
* @returns {void} ?
|
|
47
56
|
*/
|
|
48
57
|
function propertyGetter(defaultValue, curKey) {
|
|
49
58
|
return function () {
|
|
59
|
+
// eslint-disable-next-line
|
|
50
60
|
if (!this.properties.hasOwnProperty(curKey)) {
|
|
51
61
|
this.properties[curKey] = defaultValue;
|
|
52
62
|
}
|
|
@@ -55,12 +65,15 @@ function propertyGetter(defaultValue, curKey) {
|
|
|
55
65
|
}
|
|
56
66
|
/**
|
|
57
67
|
* Set the properties for the object
|
|
58
|
-
*
|
|
59
|
-
* @param {
|
|
68
|
+
*
|
|
69
|
+
* @param {Object} defaultValue ?
|
|
70
|
+
* @param {string} curKey ?
|
|
71
|
+
* @returns {void} ?
|
|
60
72
|
*/
|
|
61
73
|
function propertySetter(defaultValue, curKey) {
|
|
62
74
|
return function (newValue) {
|
|
63
75
|
if (this.properties[curKey] !== newValue) {
|
|
76
|
+
// eslint-disable-next-line
|
|
64
77
|
var oldVal = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
|
|
65
78
|
this.saveChanges(curKey, newValue, oldVal);
|
|
66
79
|
this.properties[curKey] = newValue;
|
|
@@ -69,7 +82,13 @@ function propertySetter(defaultValue, curKey) {
|
|
|
69
82
|
}
|
|
70
83
|
/**
|
|
71
84
|
* Returns complex objects
|
|
85
|
+
*
|
|
86
|
+
* @param {Object} defaultValue ?
|
|
87
|
+
* @param {string} curKey ?
|
|
88
|
+
* @param {Object[]} type ?
|
|
89
|
+
* @returns {void} ?
|
|
72
90
|
*/
|
|
91
|
+
// eslint-disable-next-line
|
|
73
92
|
function complexGetter(defaultValue, curKey, type) {
|
|
74
93
|
return function () {
|
|
75
94
|
return getObject(this, curKey, defaultValue, type);
|
|
@@ -77,15 +96,29 @@ function complexGetter(defaultValue, curKey, type) {
|
|
|
77
96
|
}
|
|
78
97
|
/**
|
|
79
98
|
* Sets complex objects
|
|
99
|
+
*
|
|
100
|
+
* @param {Object} defaultValue ?
|
|
101
|
+
* @param {string} curKey ?
|
|
102
|
+
* @param {Object[]} type ?
|
|
103
|
+
* @returns {void} ?
|
|
80
104
|
*/
|
|
81
105
|
function complexSetter(defaultValue, curKey, type) {
|
|
82
106
|
return function (newValue) {
|
|
83
107
|
getObject(this, curKey, defaultValue, type).setProperties(newValue);
|
|
84
108
|
};
|
|
85
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* @param {Object} defaultValue ?
|
|
113
|
+
* @param {string} curKey ?
|
|
114
|
+
* @param {FunctionConstructor} type ?
|
|
115
|
+
* @returns {void} ?
|
|
116
|
+
*/
|
|
117
|
+
// eslint-disable-next-line
|
|
86
118
|
function complexFactoryGetter(defaultValue, curKey, type) {
|
|
87
119
|
return function () {
|
|
88
120
|
var curType = type({});
|
|
121
|
+
// eslint-disable-next-line
|
|
89
122
|
if (this.properties.hasOwnProperty(curKey)) {
|
|
90
123
|
return this.properties[curKey];
|
|
91
124
|
}
|
|
@@ -94,21 +127,37 @@ function complexFactoryGetter(defaultValue, curKey, type) {
|
|
|
94
127
|
}
|
|
95
128
|
};
|
|
96
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param {Object} defaultValue ?
|
|
133
|
+
* @param {string} curKey ?
|
|
134
|
+
* @param {Object[]} type ?
|
|
135
|
+
* @returns {void} ?
|
|
136
|
+
*/
|
|
97
137
|
function complexFactorySetter(defaultValue, curKey, type) {
|
|
98
138
|
return function (newValue) {
|
|
99
139
|
var curType = type(newValue, this);
|
|
100
140
|
getObject(this, curKey, defaultValue, curType).setProperties(newValue);
|
|
101
141
|
};
|
|
102
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {Object[]} defaultValue ?
|
|
146
|
+
* @param {string} curKey ?
|
|
147
|
+
* @param {Object[]} type ?
|
|
148
|
+
* @returns {void} ?
|
|
149
|
+
*/
|
|
103
150
|
function complexArrayGetter(defaultValue, curKey, type) {
|
|
104
151
|
return function () {
|
|
105
152
|
var _this = this;
|
|
153
|
+
// eslint-disable-next-line
|
|
106
154
|
if (!this.properties.hasOwnProperty(curKey)) {
|
|
107
155
|
var defCollection = getObjectArray(this, curKey, defaultValue, type, false);
|
|
108
156
|
this.properties[curKey] = defCollection;
|
|
109
157
|
}
|
|
110
158
|
var ignore = ((this.controlParent !== undefined && this.controlParent.ignoreCollectionWatch)
|
|
111
159
|
|| this.ignoreCollectionWatch);
|
|
160
|
+
// eslint-disable-next-line
|
|
112
161
|
if (!this.properties[curKey].hasOwnProperty('push') && !ignore) {
|
|
113
162
|
['push', 'pop'].forEach(function (extendFunc) {
|
|
114
163
|
var descriptor = {
|
|
@@ -118,12 +167,20 @@ function complexArrayGetter(defaultValue, curKey, type) {
|
|
|
118
167
|
Object.defineProperty(_this.properties[curKey], extendFunc, descriptor);
|
|
119
168
|
});
|
|
120
169
|
}
|
|
170
|
+
// eslint-disable-next-line
|
|
121
171
|
if (!this.properties[curKey].hasOwnProperty('isComplexArray')) {
|
|
122
172
|
Object.defineProperty(this.properties[curKey], 'isComplexArray', { value: true });
|
|
123
173
|
}
|
|
124
174
|
return this.properties[curKey];
|
|
125
175
|
};
|
|
126
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @param {Object[]} defaultValue ?
|
|
180
|
+
* @param {string} curKey ?
|
|
181
|
+
* @param {Object[]} type ?
|
|
182
|
+
* @returns {void} ?
|
|
183
|
+
*/
|
|
127
184
|
function complexArraySetter(defaultValue, curKey, type) {
|
|
128
185
|
return function (newValue) {
|
|
129
186
|
this.isComplexArraySetter = true;
|
|
@@ -134,17 +191,33 @@ function complexArraySetter(defaultValue, curKey, type) {
|
|
|
134
191
|
this.properties[curKey] = newValCollection;
|
|
135
192
|
};
|
|
136
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
* @param {Object[]} defaultValue ?
|
|
197
|
+
* @param {string} curKey ?
|
|
198
|
+
* @param {Object[]} type ?
|
|
199
|
+
* @returns {void} ?
|
|
200
|
+
*/
|
|
137
201
|
function complexArrayFactorySetter(defaultValue, curKey, type) {
|
|
138
202
|
return function (newValue) {
|
|
203
|
+
// eslint-disable-next-line
|
|
139
204
|
var oldValueCollection = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
|
|
140
205
|
var newValCollection = getObjectArray(this, curKey, newValue, type, true, true);
|
|
141
206
|
this.saveChanges(curKey, newValCollection, oldValueCollection);
|
|
142
207
|
this.properties[curKey] = newValCollection;
|
|
143
208
|
};
|
|
144
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* @param {Object[]} defaultValue ?
|
|
213
|
+
* @param {string} curKey ?
|
|
214
|
+
* @param {FunctionConstructor} type ?
|
|
215
|
+
* @returns {void} ?
|
|
216
|
+
*/
|
|
145
217
|
function complexArrayFactoryGetter(defaultValue, curKey, type) {
|
|
146
218
|
return function () {
|
|
147
219
|
var curType = type({});
|
|
220
|
+
// eslint-disable-next-line
|
|
148
221
|
if (!this.properties.hasOwnProperty(curKey)) {
|
|
149
222
|
var defCollection = getObjectArray(this, curKey, defaultValue, curType, false);
|
|
150
223
|
this.properties[curKey] = defCollection;
|
|
@@ -152,6 +225,14 @@ function complexArrayFactoryGetter(defaultValue, curKey, type) {
|
|
|
152
225
|
return this.properties[curKey];
|
|
153
226
|
};
|
|
154
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
*
|
|
230
|
+
* @param {string} dFunc ?
|
|
231
|
+
* @param {string} curKey ?
|
|
232
|
+
* @param {Object} type ?
|
|
233
|
+
* @param {Object} prop ?
|
|
234
|
+
* @returns {Object} ?
|
|
235
|
+
*/
|
|
155
236
|
function complexArrayDefinedCallback(dFunc, curKey, type, prop) {
|
|
156
237
|
/* tslint:disable no-function-expression */
|
|
157
238
|
return function () {
|
|
@@ -170,14 +251,22 @@ function complexArrayDefinedCallback(dFunc, curKey, type, prop) {
|
|
|
170
251
|
break;
|
|
171
252
|
case 'pop':
|
|
172
253
|
Array.prototype[dFunc].apply(prop);
|
|
254
|
+
// eslint-disable-next-line
|
|
173
255
|
var model = getArrayModel(keyString + prop.length, null, !this.controlParent, dFunc);
|
|
174
256
|
this.serverDataBind(model, { ejsAction: 'pop' }, false, dFunc);
|
|
175
257
|
break;
|
|
176
258
|
}
|
|
177
259
|
return prop;
|
|
178
260
|
};
|
|
179
|
-
/* tslint:enable no-function-expression */
|
|
180
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* @param {string} keyString ?
|
|
265
|
+
* @param {Object} value ?
|
|
266
|
+
* @param {boolean} isControlParent ?
|
|
267
|
+
* @param {string} arrayFunction ?
|
|
268
|
+
* @returns {Object} ?
|
|
269
|
+
*/
|
|
181
270
|
function getArrayModel(keyString, value, isControlParent, arrayFunction) {
|
|
182
271
|
var modelObject = keyString;
|
|
183
272
|
if (isControlParent) {
|
|
@@ -190,9 +279,12 @@ function getArrayModel(keyString, value, isControlParent, arrayFunction) {
|
|
|
190
279
|
}
|
|
191
280
|
return modelObject;
|
|
192
281
|
}
|
|
282
|
+
// eslint-disable-next-line
|
|
193
283
|
/**
|
|
194
284
|
* Method used to create property. General syntax below.
|
|
195
|
-
*
|
|
285
|
+
*
|
|
286
|
+
* @param {Object} defaultValue - Specifies the default value of property.
|
|
287
|
+
* @returns {PropertyDecorator} ?
|
|
196
288
|
* ```
|
|
197
289
|
* @Property('TypeScript')
|
|
198
290
|
* propertyName: Type;
|
|
@@ -214,8 +306,10 @@ export function Property(defaultValue) {
|
|
|
214
306
|
}
|
|
215
307
|
/**
|
|
216
308
|
* Method used to create complex property. General syntax below.
|
|
217
|
-
*
|
|
309
|
+
*
|
|
310
|
+
* @param {any} defaultValue - Specifies the default value of property.
|
|
218
311
|
* @param {Function} type - Specifies the class type of complex object.
|
|
312
|
+
* @returns {PropertyDecorator} ?
|
|
219
313
|
* ```
|
|
220
314
|
* @Complex<Type>({},Type)
|
|
221
315
|
* propertyName: Type;
|
|
@@ -237,8 +331,9 @@ export function Complex(defaultValue, type) {
|
|
|
237
331
|
}
|
|
238
332
|
/**
|
|
239
333
|
* Method used to create complex Factory property. General syntax below.
|
|
240
|
-
*
|
|
334
|
+
*
|
|
241
335
|
* @param {Function} type - Specifies the class factory type of complex object.
|
|
336
|
+
* @returns {PropertyDecorator} ?
|
|
242
337
|
* ```
|
|
243
338
|
* @ComplexFactory(defaultType, factoryFunction)
|
|
244
339
|
* propertyName: Type1 | Type2;
|
|
@@ -260,8 +355,10 @@ export function ComplexFactory(type) {
|
|
|
260
355
|
}
|
|
261
356
|
/**
|
|
262
357
|
* Method used to create complex array property. General syntax below.
|
|
263
|
-
*
|
|
358
|
+
*
|
|
359
|
+
* @param {any} defaultValue - Specifies the default value of property.
|
|
264
360
|
* @param {Function} type - Specifies the class type of complex object.
|
|
361
|
+
* @returns {PropertyDecorator} ?
|
|
265
362
|
* ```
|
|
266
363
|
* @Collection([], Type);
|
|
267
364
|
* propertyName: Type;
|
|
@@ -283,8 +380,9 @@ export function Collection(defaultValue, type) {
|
|
|
283
380
|
}
|
|
284
381
|
/**
|
|
285
382
|
* Method used to create complex factory array property. General syntax below.
|
|
286
|
-
*
|
|
383
|
+
*
|
|
287
384
|
* @param {Function} type - Specifies the class type of complex object.
|
|
385
|
+
* @returns {PropertyCollectionInfo} ?
|
|
288
386
|
* ```
|
|
289
387
|
* @Collection([], Type);
|
|
290
388
|
* propertyName: Type;
|
|
@@ -306,8 +404,8 @@ export function CollectionFactory(type) {
|
|
|
306
404
|
}
|
|
307
405
|
/**
|
|
308
406
|
* Method used to create event property. General syntax below.
|
|
309
|
-
*
|
|
310
|
-
* @
|
|
407
|
+
*
|
|
408
|
+
* @returns {PropertyDecorator} ?
|
|
311
409
|
* ```
|
|
312
410
|
* @Event(()=>{return true;})
|
|
313
411
|
* ```
|
|
@@ -338,6 +436,8 @@ export function Event() {
|
|
|
338
436
|
/**
|
|
339
437
|
* NotifyPropertyChanges is triggers the call back when the property has been changed.
|
|
340
438
|
*
|
|
439
|
+
* @param {Function} classConstructor ?
|
|
440
|
+
* @returns {void} ?
|
|
341
441
|
* ```
|
|
342
442
|
* @NotifyPropertyChanges
|
|
343
443
|
* class DemoClass implements INotifyPropertyChanged {
|
|
@@ -356,11 +456,19 @@ export function Event() {
|
|
|
356
456
|
* ```
|
|
357
457
|
* @private
|
|
358
458
|
*/
|
|
459
|
+
// eslint-disable-next-line
|
|
359
460
|
export function NotifyPropertyChanges(classConstructor) {
|
|
360
461
|
/** Need to code */
|
|
361
462
|
}
|
|
362
463
|
/**
|
|
363
464
|
* Method used to create the builderObject for the target component.
|
|
465
|
+
*
|
|
466
|
+
* @param {BuildInfo} target ?
|
|
467
|
+
* @param {string} key ?
|
|
468
|
+
* @param {string} propertyType ?
|
|
469
|
+
* @param {Object} defaultValue ?
|
|
470
|
+
* @param {Function} type ?
|
|
471
|
+
* @returns {void} ?
|
|
364
472
|
* @private
|
|
365
473
|
*/
|
|
366
474
|
function addPropertyCollection(target, key, propertyType, defaultValue, type) {
|
|
@@ -376,18 +484,20 @@ function addPropertyCollection(target, key, propertyType, defaultValue, type) {
|
|
|
376
484
|
eventNames: []
|
|
377
485
|
};
|
|
378
486
|
}
|
|
379
|
-
|
|
487
|
+
// eslint-disable-next-line
|
|
380
488
|
target.propList[propertyType + 's'].push({
|
|
381
489
|
propertyName: key,
|
|
382
490
|
defaultValue: defaultValue,
|
|
383
491
|
type: type
|
|
384
492
|
});
|
|
493
|
+
// eslint-disable-next-line
|
|
385
494
|
target.propList[propertyType + 'Names'].push(key);
|
|
386
|
-
/* tslint:enable no-any */
|
|
387
495
|
}
|
|
388
496
|
/**
|
|
389
497
|
* Returns an object containing the builder properties
|
|
390
|
-
*
|
|
498
|
+
*
|
|
499
|
+
* @param {Function} component ?
|
|
500
|
+
* @returns {Object} ?
|
|
391
501
|
* @private
|
|
392
502
|
*/
|
|
393
503
|
function getBuilderProperties(component) {
|
|
@@ -438,7 +548,9 @@ function getBuilderProperties(component) {
|
|
|
438
548
|
}
|
|
439
549
|
/**
|
|
440
550
|
* Method used to create builder for the components
|
|
551
|
+
*
|
|
441
552
|
* @param {any} component -specifies the target component for which builder to be created.
|
|
553
|
+
* @returns {Object} ?
|
|
442
554
|
* @private
|
|
443
555
|
*/
|
|
444
556
|
export function CreateBuilder(component) {
|
|
@@ -447,6 +559,7 @@ export function CreateBuilder(component) {
|
|
|
447
559
|
return this;
|
|
448
560
|
};
|
|
449
561
|
var instanceFunction = function (element) {
|
|
562
|
+
// eslint-disable-next-line
|
|
450
563
|
if (!builderFunction.prototype.hasOwnProperty('create')) {
|
|
451
564
|
builderFunction.prototype = getBuilderProperties(component);
|
|
452
565
|
builderFunction.prototype.create = function () {
|
|
@@ -461,11 +574,14 @@ export function CreateBuilder(component) {
|
|
|
461
574
|
}
|
|
462
575
|
/**
|
|
463
576
|
* Returns parent options for the object
|
|
464
|
-
*
|
|
465
|
-
* @param {
|
|
577
|
+
*
|
|
578
|
+
* @param {Object} context ?
|
|
579
|
+
* @param {string} prefix ?
|
|
580
|
+
* @returns {ParentOption} ?
|
|
466
581
|
* @private
|
|
467
582
|
*/
|
|
468
583
|
function getParentContext(context, prefix) {
|
|
584
|
+
// eslint-disable-next-line
|
|
469
585
|
if (context.hasOwnProperty('parentObj') === false) {
|
|
470
586
|
return { context: context, prefix: prefix };
|
|
471
587
|
}
|
package/src/observer.d.ts
CHANGED
|
@@ -26,28 +26,31 @@ export declare class Observer {
|
|
|
26
26
|
constructor(context?: Object);
|
|
27
27
|
/**
|
|
28
28
|
* To attach handler for given property in current context.
|
|
29
|
+
*
|
|
29
30
|
* @param {string} property - specifies the name of the event.
|
|
30
31
|
* @param {Function} handler - Specifies the handler function to be called while event notified.
|
|
31
32
|
* @param {Object} context - Specifies the context binded to the handler.
|
|
32
33
|
* @param {string} id - specifies the random generated id.
|
|
33
|
-
* @
|
|
34
|
+
* @returns {void}
|
|
34
35
|
*/
|
|
35
36
|
on(property: string, handler: Function, context?: Object, id?: string): void;
|
|
36
37
|
/**
|
|
37
38
|
* To remove handlers from a event attached using on() function.
|
|
38
|
-
*
|
|
39
|
+
*
|
|
40
|
+
* @param {string} property - specifies the name of the event.
|
|
39
41
|
* @param {Function} handler - Optional argument specifies the handler function to be called while event notified.
|
|
40
42
|
* @param {string} id - specifies the random generated id.
|
|
41
|
-
* @
|
|
43
|
+
* @returns {void} ?
|
|
42
44
|
*/
|
|
43
45
|
off(property: string, handler?: Function, id?: string): void;
|
|
44
46
|
/**
|
|
45
47
|
* To notify the handlers in the specified event.
|
|
48
|
+
*
|
|
46
49
|
* @param {string} property - Specifies the event to be notify.
|
|
47
|
-
* @param {Object}
|
|
50
|
+
* @param {Object} argument - Additional parameters to pass while calling the handler.
|
|
48
51
|
* @param {Function} successHandler - this function will invoke after event successfully triggered
|
|
49
52
|
* @param {Function} errorHandler - this function will invoke after event if it was failure to call.
|
|
50
|
-
* @
|
|
53
|
+
* @returns {void} ?
|
|
51
54
|
*/
|
|
52
55
|
notify(property: string, argument?: Object, successHandler?: Function, errorHandler?: Function): void | Object;
|
|
53
56
|
private blazorCallback;
|
|
@@ -55,14 +58,23 @@ export declare class Observer {
|
|
|
55
58
|
isJson(value: string): boolean;
|
|
56
59
|
/**
|
|
57
60
|
* To destroy handlers in the event
|
|
61
|
+
*
|
|
62
|
+
* @returns {void} ?
|
|
58
63
|
*/
|
|
59
64
|
destroy(): void;
|
|
60
65
|
/**
|
|
61
66
|
* Returns if the property exists.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} prop ?
|
|
69
|
+
* @returns {boolean} ?
|
|
62
70
|
*/
|
|
63
71
|
private notExist;
|
|
64
72
|
/**
|
|
65
73
|
* Returns if the handler is present.
|
|
74
|
+
*
|
|
75
|
+
* @param {BoundOptions[]} boundedEvents ?
|
|
76
|
+
* @param {Function} handler ?
|
|
77
|
+
* @returns {boolean} ?
|
|
66
78
|
*/
|
|
67
79
|
private isHandlerPresent;
|
|
68
80
|
}
|
package/src/observer.js
CHANGED
|
@@ -8,14 +8,14 @@ var Observer = /** @class */ (function () {
|
|
|
8
8
|
}
|
|
9
9
|
this.context = context;
|
|
10
10
|
}
|
|
11
|
-
;
|
|
12
11
|
/**
|
|
13
12
|
* To attach handler for given property in current context.
|
|
13
|
+
*
|
|
14
14
|
* @param {string} property - specifies the name of the event.
|
|
15
15
|
* @param {Function} handler - Specifies the handler function to be called while event notified.
|
|
16
16
|
* @param {Object} context - Specifies the context binded to the handler.
|
|
17
17
|
* @param {string} id - specifies the random generated id.
|
|
18
|
-
* @
|
|
18
|
+
* @returns {void}
|
|
19
19
|
*/
|
|
20
20
|
Observer.prototype.on = function (property, handler, context, id) {
|
|
21
21
|
if (isNullOrUndefined(handler)) {
|
|
@@ -38,10 +38,11 @@ var Observer = /** @class */ (function () {
|
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
* To remove handlers from a event attached using on() function.
|
|
41
|
-
*
|
|
41
|
+
*
|
|
42
|
+
* @param {string} property - specifies the name of the event.
|
|
42
43
|
* @param {Function} handler - Optional argument specifies the handler function to be called while event notified.
|
|
43
44
|
* @param {string} id - specifies the random generated id.
|
|
44
|
-
* @
|
|
45
|
+
* @returns {void} ?
|
|
45
46
|
*/
|
|
46
47
|
Observer.prototype.off = function (property, handler, id) {
|
|
47
48
|
if (this.notExist(property)) {
|
|
@@ -72,11 +73,12 @@ var Observer = /** @class */ (function () {
|
|
|
72
73
|
};
|
|
73
74
|
/**
|
|
74
75
|
* To notify the handlers in the specified event.
|
|
76
|
+
*
|
|
75
77
|
* @param {string} property - Specifies the event to be notify.
|
|
76
|
-
* @param {Object}
|
|
78
|
+
* @param {Object} argument - Additional parameters to pass while calling the handler.
|
|
77
79
|
* @param {Function} successHandler - this function will invoke after event successfully triggered
|
|
78
80
|
* @param {Function} errorHandler - this function will invoke after event if it was failure to call.
|
|
79
|
-
* @
|
|
81
|
+
* @returns {void} ?
|
|
80
82
|
*/
|
|
81
83
|
Observer.prototype.notify = function (property, argument, successHandler, errorHandler) {
|
|
82
84
|
if (this.notExist(property)) {
|
|
@@ -137,7 +139,7 @@ var Observer = /** @class */ (function () {
|
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
};
|
|
140
|
-
//
|
|
142
|
+
// eslint-disable-next-line
|
|
141
143
|
Observer.prototype.dateReviver = function (key, value) {
|
|
142
144
|
var dPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
|
|
143
145
|
if (isBlazor && typeof value === 'string' && value.match(dPattern) !== null) {
|
|
@@ -156,18 +158,28 @@ var Observer = /** @class */ (function () {
|
|
|
156
158
|
};
|
|
157
159
|
/**
|
|
158
160
|
* To destroy handlers in the event
|
|
161
|
+
*
|
|
162
|
+
* @returns {void} ?
|
|
159
163
|
*/
|
|
160
164
|
Observer.prototype.destroy = function () {
|
|
161
165
|
this.boundedEvents = this.context = undefined;
|
|
162
166
|
};
|
|
163
167
|
/**
|
|
164
168
|
* Returns if the property exists.
|
|
169
|
+
*
|
|
170
|
+
* @param {string} prop ?
|
|
171
|
+
* @returns {boolean} ?
|
|
165
172
|
*/
|
|
166
173
|
Observer.prototype.notExist = function (prop) {
|
|
174
|
+
// eslint-disable-next-line
|
|
167
175
|
return this.boundedEvents.hasOwnProperty(prop) === false || this.boundedEvents[prop].length <= 0;
|
|
168
176
|
};
|
|
169
177
|
/**
|
|
170
178
|
* Returns if the handler is present.
|
|
179
|
+
*
|
|
180
|
+
* @param {BoundOptions[]} boundedEvents ?
|
|
181
|
+
* @param {Function} handler ?
|
|
182
|
+
* @returns {boolean} ?
|
|
171
183
|
*/
|
|
172
184
|
Observer.prototype.isHandlerPresent = function (boundedEvents, handler) {
|
|
173
185
|
for (var _i = 0, boundedEvents_1 = boundedEvents; _i < boundedEvents_1.length; _i++) {
|
package/src/sanitize-helper.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ interface BeforeSanitizeHtml {
|
|
|
2
2
|
/** Illustrates whether the current action needs to be prevented or not. */
|
|
3
3
|
cancel?: boolean;
|
|
4
4
|
/** It is a callback function and executed it before our inbuilt action. It should return HTML as a string.
|
|
5
|
+
*
|
|
5
6
|
* @function
|
|
6
7
|
* @param {string} value - Returns the value.
|
|
7
8
|
* @returns {string}
|
package/src/sanitize-helper.js
CHANGED
|
@@ -121,7 +121,6 @@ var SanitizeHtmlHelper = /** @class */ (function () {
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
;
|
|
125
124
|
SanitizeHtmlHelper.sanitize = function (value) {
|
|
126
125
|
var item = this.beforeSanitize();
|
|
127
126
|
var output = this.serializeValue(item, value);
|
|
@@ -177,6 +176,7 @@ var SanitizeHtmlHelper = /** @class */ (function () {
|
|
|
177
176
|
};
|
|
178
177
|
SanitizeHtmlHelper.removeXssAttrs = function () {
|
|
179
178
|
var _this = this;
|
|
179
|
+
// eslint-disable-next-line
|
|
180
180
|
this.removeAttrs.forEach(function (item, index) {
|
|
181
181
|
var elements = _this.wrapElement.querySelectorAll(item.selector);
|
|
182
182
|
if (elements.length > 0) {
|
package/src/template-engine.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const blazorTemplates: object;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @returns {string} ?
|
|
5
|
+
*/
|
|
2
6
|
export declare function getRandomId(): string;
|
|
3
7
|
/**
|
|
4
8
|
* Interface for Template Engine.
|
|
@@ -8,22 +12,44 @@ export interface ITemplateEngine {
|
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Compile the template string into template function.
|
|
11
|
-
*
|
|
12
|
-
* @param
|
|
15
|
+
*
|
|
16
|
+
* @param {string} templateString - The template string which is going to convert.
|
|
17
|
+
* @param {Object} helper - Helper functions as an object.
|
|
18
|
+
* @param {boolean} ignorePrefix ?
|
|
19
|
+
* @returns {NodeList} ?
|
|
13
20
|
* @private
|
|
14
21
|
*/
|
|
15
22
|
export declare function compile(templateString: string, helper?: Object, ignorePrefix?: boolean): (data: Object | JSON, component?: any, propName?: any) => NodeList;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {string} templateId ?
|
|
26
|
+
* @param {string} templateName ?
|
|
27
|
+
* @param {string} comp ?
|
|
28
|
+
* @param {boolean} isEmpty ?
|
|
29
|
+
* @param {Function} callBack ?
|
|
30
|
+
* @returns {void} ?
|
|
31
|
+
*/
|
|
16
32
|
export declare function updateBlazorTemplate(templateId?: string, templateName?: string, comp?: object, isEmpty?: boolean, callBack?: Function): void;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {string} templateId ?
|
|
36
|
+
* @param {string} templateName ?
|
|
37
|
+
* @param {number} index ?
|
|
38
|
+
* @returns {void} ?
|
|
39
|
+
*/
|
|
17
40
|
export declare function resetBlazorTemplate(templateId?: string, templateName?: string, index?: number): void;
|
|
18
41
|
/**
|
|
19
42
|
* Set your custom template engine for template rendering.
|
|
43
|
+
*
|
|
20
44
|
* @param {ITemplateEngine} classObj - Class object for custom template.
|
|
45
|
+
* @returns {void} ?
|
|
21
46
|
* @private
|
|
22
47
|
*/
|
|
23
48
|
export declare function setTemplateEngine(classObj: ITemplateEngine): void;
|
|
24
49
|
/**
|
|
25
50
|
* Get current template engine for template rendering
|
|
26
|
-
*
|
|
51
|
+
*
|
|
52
|
+
* @returns {string} ?
|
|
27
53
|
* @private
|
|
28
54
|
*/
|
|
29
55
|
export declare function getTemplateEngine(): (template: string, helper?: Object) => (data: Object | JSON) => string;
|