Skip to content

Commit ffeea1f

Browse files
author
pipeline
committed
v17.2.34 is released
1 parent cfb8bb4 commit ffeea1f

File tree

758 files changed

+27200
-10273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

758 files changed

+27200
-10273
lines changed

controls/barcodegenerator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-barcode-generator",
3-
"version": "16.4.40",
3+
"version": "17.2.28",
44
"description": "Barcode generator component is a pure JavaScript library which will convert a string to Barcode and show it to the user. This supports major 1D and 2D barcodes including coda bar, code 128, QR Code.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/base/dist/ej2-base.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/ej2-base.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/es6/ej2-base.es2015.js

Lines changed: 43 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/es6/ej2-base.es2015.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/es6/ej2-base.es5.js

Lines changed: 43 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/es6/ej2-base.es5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/global/ej2-base.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/dist/global/ej2-base.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controls/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-base",
3-
"version": "17.1.49",
3+
"version": "17.2.34",
44
"description": "A common package of Essential JS 2 base libraries, methods and class definitions",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/base/spec/internationalization.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Spec for internationalization.
33
*/
4-
import { Internationalization, setCulture, setCurrencyCode, getNumericObject, getDefaultDateObject, loadCldr } from '../src/internationalization';
4+
import { Internationalization, setCulture, setCurrencyCode, getNumericObject, getDefaultDateObject, getNumberDependable, loadCldr } from '../src/internationalization';
55
import { monthDayMatch } from './intl/date-parser.spec';
66
import { getTimeZoneString } from './intl/date-formatter.spec';
77
import { IntlBase as base } from '../src/intl/intl-base';
@@ -123,6 +123,7 @@ describe('Internationalization', () => {
123123
});
124124
describe('getNumericObject', () => {
125125
it('checkNumericObject for invalid culture returns default culture', () => {
126+
getNumberDependable('fe', 'USD');
126127
expect(getNumericObject('fe')).toEqual({
127128
decimal: '.', exponential: 'E', group: ',', infinity: '∞', list: ';', maximumFraction: 3, minimumFraction: 0
128129
, minusSign: '-', nan: 'NaN', perMille: '‰', percentSign: '%', plusSign: '+', superscriptingExponent: '×',
@@ -561,4 +562,4 @@ describe('Internationalization', () => {
561562
});
562563
});
563564
/* tslint:enable:quotemark */
564-
});
565+
});

controls/base/spec/template-engine.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('Template Engine', () => {
7575
let templateStr: string = '<div class=" class1">blazor</div>';
7676
let result: any = [];
7777
let blazor: string = 'Blazor';
78-
let ejsIntrop: string = 'ejsIntrop';
78+
let ejsIntrop: string = 'ejsInterop';
7979
window[blazor] = 'Template';
8080
window[ejsIntrop] = { updateTemplate: function () { } };
8181
result = (template.updateBlazorTemplate('template', 'Template'));
@@ -88,7 +88,7 @@ describe('Template Engine', () => {
8888
let templateStr: string = '<div class=" class1">blazor</div>';
8989
let result: any = [];
9090
let blazor: string = 'Blazor';
91-
let ejsIntrop: string = 'ejsIntrop';
91+
let ejsIntrop: string = 'ejsInterop';
9292
window[blazor] = 'Template';
9393
window[ejsIntrop] = { updateTemplate: function () { } };
9494
result = (template.updateBlazorTemplate('rowtemplate', 'RowTemplate'));

controls/base/spec/util.spec.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,55 @@ describe('Util', () => {
247247
expect((<any>result).columns[0].b).toBe(3);
248248
});
249249

250+
it('isBlazor false', () => {
251+
expect(Util.isBlazor()).toBe(false);
252+
});
253+
254+
it('isBlazor true', () => {
255+
window['Blazor'] = {};
256+
expect(Util.isBlazor()).toBe(true);
257+
});
258+
259+
it('GetElement with element', () => {
260+
window['Blazor'] = {};
261+
var element = document.createElement('span');
262+
expect(Util.getElement(element)).toBe(element);
263+
});
264+
it('GetElement with xpath', () => {
265+
window['Blazor'] = {};
266+
var element = document.createElement('span');
267+
element.id = "xpathelement";
268+
document.body.appendChild(element);
269+
var eleObj = {
270+
'xPath': createXPathFromElement(element)
271+
}
272+
expect(Util.getElement(eleObj)).toBe(element);
273+
document.body.innerHTML = "";
274+
});
275+
function createXPathFromElement (elm: any): any {
276+
var allNodes = document.getElementsByTagName('*');
277+
for (var segs = []; elm && elm.nodeType === 1; elm = elm.parentNode) {
278+
if (elm.hasAttribute('id')) {
279+
var uniqueIdCount = 0;
280+
for (var n = 0; n < allNodes.length; n++) {
281+
if (allNodes[n].hasAttribute('id') && allNodes[n].id === elm.id) uniqueIdCount++;
282+
if (uniqueIdCount > 1) break;
283+
};
284+
if (uniqueIdCount === 1) {
285+
segs.unshift('id("' + elm.getAttribute('id') + '")');
286+
return segs.join('/');
287+
} else {
288+
segs.unshift(elm.localName.toLowerCase() + '[@id="' + elm.getAttribute('id') + '"]');
289+
}
290+
} else if (elm.hasAttribute('class')) {
291+
segs.unshift(elm.localName.toLowerCase() + '[@class="' + elm.getAttribute('class') + '"]');
292+
} else {
293+
for (var i = 1, sib = elm.previousSibling; sib; sib = sib.previousSibling) {
294+
if (sib.localName === elm.localName) i++;
295+
}
296+
segs.unshift(elm.localName.toLowerCase() + '[' + i + ']');
297+
}
298+
}
299+
return segs.length ? '/' + segs.join('/') : null;
300+
}
250301
});

controls/base/src/component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export abstract class Component<ElementType extends HTMLElement> extends Base<El
3737
*/
3838
@Property()
3939
public locale: string;
40+
/**
41+
* string template option for Blazor template rendering
42+
* @private
43+
*/
44+
public isStringTemplate: boolean = false;
4045
protected needsID: boolean = false;
4146
protected moduleLoader: ModuleLoader;
4247
protected localObserver: Observer;

controls/base/src/internationalization.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,24 @@ export function getNumericObject(locale: string, type?: string): Object {
294294
let pattern: string = IntlBase.getSymbolPattern(type || 'decimal', numSystem, numObject, false);
295295
return extend(symbPattern, IntlBase.getFormatData(pattern, true, '', true), { 'dateSeparator': IntlBase.getDateSeparator(dateObject) });
296296
}
297+
298+
/**
299+
* To get the numeric CLDR number base object for given culture
300+
* @param {string} locale - Specifies the locale for which numericObject to be returned.
301+
* @param {string} currency - Specifies the currency for which numericObject to be returned.
302+
* @ignore
303+
* @private
304+
*/
305+
export function getNumberDependable(locale: string, currency: string): string {
306+
let numObject: Object = (<any>IntlBase.getDependables(cldrData, locale, '', true));
307+
return IntlBase.getCurrencySymbol((<any>numObject).numericObject, currency);
308+
}
309+
297310
/**
298311
* To get the default date CLDR object.
299312
* @ignore
300313
* @private
301314
*/
302315
export function getDefaultDateObject(mode?: string): Object {
303316
return (<any>IntlBase.getDependables(cldrData, '', mode, false))[mapper[1]];
304-
}
317+
}

controls/base/src/template-engine.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export interface ITemplateEngine {
3131
export function compile(templateString: string, helper?: Object): (data: Object | JSON, component?: any, propName?: any) => NodeList {
3232
let compiler: Function = engineObj.compile(templateString, helper);
3333
//tslint:disable-next-line
34-
return (data: Object, component?: any, propName?: any, templateId?: any): NodeList => {
34+
return (data: Object, component?: any, propName?: any, templateId?: any, isStringTemplate?: boolean ): NodeList => {
3535
let result: object = compiler(data, component, propName);
3636
let blazor: string = 'Blazor'; let blazorTemplateId: string = 'BlazorTemplateId';
37-
if (window && window[blazor]) {
37+
if (window && window[blazor] && !isStringTemplate) {
3838
let randomId: string = getRandomId();
3939
if (!blazorTemplates[templateId]) {
4040
blazorTemplates[templateId] = [];
@@ -60,11 +60,11 @@ export function compile(templateString: string, helper?: Object): (data: Object
6060
};
6161
}
6262

63-
export function updateBlazorTemplate(templateId?: string, templateName?: string): void {
63+
export function updateBlazorTemplate(templateId?: string, templateName?: string, comp?: object): void {
6464
let blazor: string = 'Blazor';
6565
if (window && window[blazor]) {
66-
let ejsIntrop: string = 'ejsIntrop';
67-
window[ejsIntrop].updateTemplate(templateName, blazorTemplates[templateId], templateId);
66+
let ejsIntrop: string = 'ejsInterop';
67+
window[ejsIntrop].updateTemplate(templateName, blazorTemplates[templateId], templateId, comp);
6868
blazorTemplates[templateId] = [];
6969
}
7070
}

0 commit comments

Comments
 (0)