From 0c10f4a0d762a7ccd361b994da9e5387dc0d43b3 Mon Sep 17 00:00:00 2001 From: allipierre Date: Sat, 18 Nov 2017 10:17:54 +0100 Subject: [PATCH 1/7] update namespace server with ajax jquery settings --- package-lock.json | 13 +++ package.json | 2 +- types/orclapex-js/index.d.ts | 32 +++++--- types/orclapex-js/orclapex-js-tests.js | 70 ++++++++++++++++ types/orclapex-js/orclapex-js-tests.ts | 107 +++++++++++++++++++++++++ 5 files changed, 211 insertions(+), 13 deletions(-) create mode 100644 package-lock.json create mode 100644 types/orclapex-js/orclapex-js-tests.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a6a736f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "orclapex-js", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/jquery": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.2.16.tgz", + "integrity": "sha512-q2WC02YxQoX2nY1HRKlYGHpGP1saPmD7GN0pwCDlTz35a4eOtJG+aHRlXyjCuXokUukSrR2aXyBhSW3j+jPc0A==" + } + } +} diff --git a/package.json b/package.json index 8f3a0b8..441f820 100644 --- a/package.json +++ b/package.json @@ -10,4 +10,4 @@ "@types/jquery": "^3.2.16" }, "devDependencies": {} -} \ No newline at end of file +} diff --git a/types/orclapex-js/index.d.ts b/types/orclapex-js/index.d.ts index 76577b7..80e3fd4 100644 --- a/types/orclapex-js/index.d.ts +++ b/types/orclapex-js/index.d.ts @@ -390,16 +390,16 @@ declare namespace apex { interface PluginData { pageItems: string | JQuery | HTMLElement | Array, - x01?: string, - x02?: string, - x03?: string, - x04?: string, - x05?: string, - x06?: string, - x07?: string, - x08?: string, - x09?: string, - x10?: string, + x01?: string | number, + x02?: string | number, + x03?: string | number, + x04?: string | number, + x05?: string | number, + x06?: string | number, + x07?: string | number, + x08?: string | number, + x09?: string | number, + x10?: string | number, f01?: string | Array f02?: string | Array f03?: string | Array @@ -435,7 +435,15 @@ declare namespace apex { loadingIndicator?: string | JQuery | HTMLElement | Function, loadingIndicatorPosition?: string, queue?: Queue, - target?: string | HTMLElement + success?: Function, + error?: Function, + beforeSend?: Function, + complete?: Function, + async?:boolean, + target?: string | HTMLElement, + cache?:boolean, + contents?:Object, + context?:Object } function loadScript(pConfig: ScriptConfig, pCallback: Function): Function; @@ -1173,4 +1181,4 @@ declare function $d_Find(pThis: HTMLElement | string, pString: string, pTags: st * @returns { boolean } */ declare function $f_First_field(pNd: HTMLElement | string): boolean; -// END - Non-namespaced APIs \ No newline at end of file +// END - Non-namespaced APIs diff --git a/types/orclapex-js/orclapex-js-tests.js b/types/orclapex-js/orclapex-js-tests.js new file mode 100644 index 0000000..643cfed --- /dev/null +++ b/types/orclapex-js/orclapex-js-tests.js @@ -0,0 +1,70 @@ +/// +var Car = /** @class */ (function () { + function Car(firstname, lastname) { + this.firstname = firstname; + this.lastname = lastname; + this.firstName = firstname; + this.lastName = lastname; + } + Car.prototype.getSumme = function (a, b) { + return a + b; + }; + Car.prototype.getSumme_x = function (a, b, c) { + return a + b + c; + }; + Car.prototype.getFirstName = function () { + return this.firstName; + }; + Car.prototype.getLastName = function () { + return this.lastName; + }; + Car.prototype.setLastName = function (lastname) { + if (this.lastName == lastName) { + console.log("Latname is already exist"); + } + else { + this.lastName = lastname; + } + }; + Car.prototype.setFirstName = function (firstName) { + this.firstName = firstName; + }; + Car.prototype.callServer = function () { + apex.page.confirm("Are you Sure?", "SUCCESS"); + apex.event.trigger('pSelector', 'pEvent', $x('pNd')); + }; + Car.prototype.callServerx = function (processname) { + var $body = $(".t-Body"); + apex.server.process(processname, { + pageItems: "#P2300_LOV", + x01: 1 + }, { + beforeSend: function () { + $body.addClass("loading"); + $('Processing').appendTo("body"); + }, + success: function (pData) { + /* If the AJAX is successful set the value or the returned items */ + if (pData.success === true) { + /* Loop through the array and set the value of each item */ + for (var i = 0; i < pData.items.length; i++) { + apex.item(pData.items[i].id).setValue(pData.items[i].value); + } + } + /* Remove the processing image */ + }, + error: function (request, status, error) { + alert(request.responseText); + /* Remove the processing image */ + } + }); + }; + return Car; +}()); +var firstName = 'Pierre'; +var lastName = 'Yotti'; +var type = new Car(firstName, lastName); +console.log("The Summe is " + type.getSumme(2, 3)); +console.log("The LastName is " + type.getLastName()); +type.setLastName('Yotti'); +console.log("The LastName is " + type.getLastName()); diff --git a/types/orclapex-js/orclapex-js-tests.ts b/types/orclapex-js/orclapex-js-tests.ts index e69de29..9d32801 100644 --- a/types/orclapex-js/orclapex-js-tests.ts +++ b/types/orclapex-js/orclapex-js-tests.ts @@ -0,0 +1,107 @@ +/// +namespace server { + export interface Iperson { + firstname: string, + lastname: string, + getSumme: (a: number, b: number) => number + + } + + export interface care { + firstname: string, + lastname: string, + getSumme: (a: number, b: number) => number + + } + + export interface callbackevent { + success: string, + lastname: string, + getSumme: (a: number, b: number) => number + + } +} + +class Car implements server.Iperson { + private firstName: string; + private lastName: string; + constructor(public firstname: string, public lastname: string) { + this.firstName = firstname; + this.lastName = lastname; + } + public getSumme(a: number, b: number): number { + return a + b; + } + + public getSumme_x(a: number, b: number, c: number): number { + return a + b + c; + } + public getFirstName(): string { + return this.firstName; + } + public getLastName(): string { + return this.lastName; + } + public setLastName(lastname: string) { + if (this.lastName == lastName) { + console.log("Latname is already exist"); + } else { + this.lastName = lastname; + } + + } + + public setFirstName(firstName: string) { + this.firstName = firstName; + } + + public callServer() { + apex.page.confirm("Are you Sure?", "SUCCESS"); + apex.event.trigger('pSelector', 'pEvent', $x('pNd')) + + } + + public callServerx(processname: string) { + var $body = $(".t-Body"); + apex.server.process(processname, { + pageItems: "#P2300_LOV", + x01: 1 + }, { + contents: document.body, + async:true, + beforeSend: function() { + $body.addClass("loading"); + $('Processing').appendTo("body"); + + + }, + success: function(pData:any) { + /* If the AJAX is successful set the value or the returned items */ + if (pData.success === true) { + /* Loop through the array and set the value of each item */ + for (var i = 0; i < pData.items.length; i++) { + apex.item(pData.items[i].id).setValue(pData.items[i].value); + } + } + + /* Remove the processing image */ + + }, + error: function(request:any, status:any, error:any) { + alert(request.responseText); + + /* Remove the processing image */ + + } + }); + } +} + + +var firstName: string = 'Pierre'; +var lastName: string = 'Yotti'; +var type = new Car(firstName, lastName); +console.log("The Summe is " + type.getSumme(2, 3)); +console.log("The LastName is " + type.getLastName()); +type.setLastName('Yotti'); +console.log("The LastName is " + type.getLastName()); From 150dfbce5d90a39d1926ae57c2881929f2ed7ff7 Mon Sep 17 00:00:00 2001 From: allipierre Date: Sat, 18 Nov 2017 10:40:10 +0100 Subject: [PATCH 2/7] update namespace server with ajax jquery settings --- types/orclapex-js/index.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/types/orclapex-js/index.d.ts b/types/orclapex-js/index.d.ts index 80e3fd4..76f57ee 100644 --- a/types/orclapex-js/index.d.ts +++ b/types/orclapex-js/index.d.ts @@ -439,11 +439,15 @@ declare namespace apex { error?: Function, beforeSend?: Function, complete?: Function, - async?:boolean, + async?: boolean, target?: string | HTMLElement, - cache?:boolean, - contents?:Object, - context?:Object + cache?: boolean, + contents?: Object, + context?: Object, + contentType?: boolean | string, + converters?: Object, + crossDomain?: boolean, + data?: object | string | Array } function loadScript(pConfig: ScriptConfig, pCallback: Function): Function; From dd4b48c4e5f3c9be2ce39a02f0def3ac7bdfa28e Mon Sep 17 00:00:00 2001 From: allipierre Date: Sat, 18 Nov 2017 10:43:32 +0100 Subject: [PATCH 3/7] update namespace server with ajax jquery settings --- types/orclapex-js/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/orclapex-js/index.d.ts b/types/orclapex-js/index.d.ts index 76f57ee..2bdc626 100644 --- a/types/orclapex-js/index.d.ts +++ b/types/orclapex-js/index.d.ts @@ -446,8 +446,7 @@ declare namespace apex { context?: Object, contentType?: boolean | string, converters?: Object, - crossDomain?: boolean, - data?: object | string | Array + crossDomain?: boolean } function loadScript(pConfig: ScriptConfig, pCallback: Function): Function; From 6d26a705176825f82a070be70d5bb7a0d712e536 Mon Sep 17 00:00:00 2001 From: allipierre Date: Sat, 18 Nov 2017 10:48:06 +0100 Subject: [PATCH 4/7] update namespace server with ajax jquery settings --- types/orclapex-js/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/orclapex-js/index.d.ts b/types/orclapex-js/index.d.ts index 2bdc626..f89b9b5 100644 --- a/types/orclapex-js/index.d.ts +++ b/types/orclapex-js/index.d.ts @@ -446,7 +446,8 @@ declare namespace apex { context?: Object, contentType?: boolean | string, converters?: Object, - crossDomain?: boolean + crossDomain?: boolean, + dataFilter?: Function } function loadScript(pConfig: ScriptConfig, pCallback: Function): Function; From 9968dd37ddea110465bbfa829c57de05af41d115 Mon Sep 17 00:00:00 2001 From: allipierre Date: Sun, 19 Nov 2017 11:24:03 +0100 Subject: [PATCH 5/7] make apex.confirm parameter as optional --- package-lock.json | 18 +++++++++++++++++ package.json | 4 +++- types/orclapex-js/index.d.ts | 4 ++-- types/orclapex-js/jquery_confirm.d.ts | 19 ++++++++++++++++++ types/orclapex-js/orclapex-js-tests.js | 26 +++++++++++++++++++++++++ types/orclapex-js/orclapex-js-tests.ts | 27 ++++++++++++++++++++++++++ types/orclapex-js/tsconfig.json | 5 +++-- 7 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 types/orclapex-js/jquery_confirm.d.ts diff --git a/package-lock.json b/package-lock.json index a6a736f..5b6c270 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,10 +4,28 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/base-64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@types/base-64/-/base-64-0.1.2.tgz", + "integrity": "sha1-Y6wxgwLNq7XwToripW5U1IMhB+I=" + }, "@types/jquery": { "version": "3.2.16", "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.2.16.tgz", "integrity": "sha512-q2WC02YxQoX2nY1HRKlYGHpGP1saPmD7GN0pwCDlTz35a4eOtJG+aHRlXyjCuXokUukSrR2aXyBhSW3j+jPc0A==" + }, + "jquery": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", + "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + }, + "jquery-confirm": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/jquery-confirm/-/jquery-confirm-3.3.2.tgz", + "integrity": "sha1-yAp6FRfHOPXlc1mTuxaOk40I9YI=", + "requires": { + "jquery": "3.2.1" + } } } } diff --git a/package.json b/package.json index 441f820..d162844 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "author": "Adrian Png , + pageItems?: string | JQuery | HTMLElement | Array, x01?: string | number, x02?: string | number, x03?: string | number, diff --git a/types/orclapex-js/jquery_confirm.d.ts b/types/orclapex-js/jquery_confirm.d.ts new file mode 100644 index 0000000..18a4a6a --- /dev/null +++ b/types/orclapex-js/jquery_confirm.d.ts @@ -0,0 +1,19 @@ +// Type definitions for Jquery Confirm Dialog +/// +declare namespace $s { + + interface confirmOptions { + buttons? : object, + title? : string, + content? : string, + } + + /** + * confirm Dialog + * @param {confirmOptions} pOtions + */ + function confirm( pOtions: confirmOptions): boolean | void; + + + +} diff --git a/types/orclapex-js/orclapex-js-tests.js b/types/orclapex-js/orclapex-js-tests.js index 643cfed..057d02d 100644 --- a/types/orclapex-js/orclapex-js-tests.js +++ b/types/orclapex-js/orclapex-js-tests.js @@ -1,4 +1,5 @@ /// +/// var Car = /** @class */ (function () { function Car(firstname, lastname) { this.firstname = firstname; @@ -39,6 +40,8 @@ var Car = /** @class */ (function () { pageItems: "#P2300_LOV", x01: 1 }, { + contents: document.body, + async: true, beforeSend: function () { $body.addClass("loading"); $('Processing').appendTo("body"); @@ -59,6 +62,29 @@ var Car = /** @class */ (function () { } }); }; + Car.prototype.confirm = function () { + var $ = $s; + $.confirm({ + title: 'Confirm!', + content: 'Simple confirm!', + buttons: { + confirm: function () { + alert('Confirmed!'); + }, + cancel: function () { + alert('Canceled!'); + }, + somethingElse: { + text: 'Something else', + btnClass: 'btn-blue', + keys: ['enter', 'shift'], + action: function () { + alert('Something else?'); + } + } + } + }); + }; return Car; }()); var firstName = 'Pierre'; diff --git a/types/orclapex-js/orclapex-js-tests.ts b/types/orclapex-js/orclapex-js-tests.ts index 9d32801..fff1d6f 100644 --- a/types/orclapex-js/orclapex-js-tests.ts +++ b/types/orclapex-js/orclapex-js-tests.ts @@ -1,4 +1,5 @@ /// +/// namespace server { export interface Iperson { firstname: string, @@ -95,6 +96,32 @@ class Car implements server.Iperson { } }); } + + + public confirm() { + var $ = $s; + $.confirm({ + title: 'Confirm!', + content: 'Simple confirm!', + buttons: { + confirm: function () { + alert('Confirmed!'); + }, + cancel: function () { + alert('Canceled!'); + }, + somethingElse: { + text: 'Something else', + btnClass: 'btn-blue', + keys: ['enter', 'shift'], + action: function(){ + alert('Something else?'); + } + } + } + }); + } + } diff --git a/types/orclapex-js/tsconfig.json b/types/orclapex-js/tsconfig.json index bcf0c8e..67031da 100644 --- a/types/orclapex-js/tsconfig.json +++ b/types/orclapex-js/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", - "orclapex-js-tests.ts" + "orclapex-js-tests.ts", + "indexconfirm.d.ts" ] -} \ No newline at end of file +} From 69381bd883355376790aa1de26912ec21cefc9c7 Mon Sep 17 00:00:00 2001 From: allipierre Date: Sun, 19 Nov 2017 11:31:52 +0100 Subject: [PATCH 6/7] make apex.confirm parameter as optional --- types/orclapex-js/orclapex-js-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/orclapex-js/orclapex-js-tests.ts b/types/orclapex-js/orclapex-js-tests.ts index fff1d6f..db3fdeb 100644 --- a/types/orclapex-js/orclapex-js-tests.ts +++ b/types/orclapex-js/orclapex-js-tests.ts @@ -58,6 +58,7 @@ class Car implements server.Iperson { public callServer() { apex.page.confirm("Are you Sure?", "SUCCESS"); + apex.confirm(); apex.event.trigger('pSelector', 'pEvent', $x('pNd')) } From 017561ca7ae291fafd8a5a294f4a2251ac52824b Mon Sep 17 00:00:00 2001 From: allipierre Date: Wed, 22 Nov 2017 12:06:25 +0100 Subject: [PATCH 7/7] add optional Parameter to interface server.PluginData and update namespace.message --- types/orclapex-js/index.d.ts | 10 +-- types/orclapex-js/jquery_confirm.d.ts | 19 ------ types/orclapex-js/orclapex-js-tests.js | 89 +++++++++++++------------- types/orclapex-js/orclapex-js-tests.ts | 54 ++++++++-------- types/orclapex-js/tsconfig.json | 3 +- 5 files changed, 81 insertions(+), 94 deletions(-) delete mode 100644 types/orclapex-js/jquery_confirm.d.ts diff --git a/types/orclapex-js/index.d.ts b/types/orclapex-js/index.d.ts index 518d8eb..1affeeb 100644 --- a/types/orclapex-js/index.d.ts +++ b/types/orclapex-js/index.d.ts @@ -283,13 +283,14 @@ declare namespace apex { } function addVisibilityCheck(pFunction: Function): void; - function alert(pMessage: string, pCallback: Function): void; + function alert(pMessage: string, pCallback?: Function): void; function clearErrors(): void; - function confirm(pMessage: string, pCallback: Function): void; + function confirm(pMessage: string, pCallback?: Function): void; function hidePageSuccess(): void; - function setThemeHooks(): void; // @todo + function setThemeHooks(themeHookOptions?: ThemeHookOptions): void; // @todo function showErrors(pErrors: Error | Array): void; // @todo function showPageSuccess(pMessage: string): void; + } namespace navigation { @@ -419,7 +420,8 @@ declare namespace apex { f17?: string | Array f18?: string | Array f19?: string | Array - f20?: string | Array + f20?: string | Array, + p_request?:string } interface Queue { diff --git a/types/orclapex-js/jquery_confirm.d.ts b/types/orclapex-js/jquery_confirm.d.ts deleted file mode 100644 index 18a4a6a..0000000 --- a/types/orclapex-js/jquery_confirm.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for Jquery Confirm Dialog -/// -declare namespace $s { - - interface confirmOptions { - buttons? : object, - title? : string, - content? : string, - } - - /** - * confirm Dialog - * @param {confirmOptions} pOtions - */ - function confirm( pOtions: confirmOptions): boolean | void; - - - -} diff --git a/types/orclapex-js/orclapex-js-tests.js b/types/orclapex-js/orclapex-js-tests.js index 057d02d..c221c52 100644 --- a/types/orclapex-js/orclapex-js-tests.js +++ b/types/orclapex-js/orclapex-js-tests.js @@ -1,40 +1,40 @@ /// -/// -var Car = /** @class */ (function () { - function Car(firstname, lastname) { +class Car { + constructor(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; this.firstName = firstname; this.lastName = lastname; } - Car.prototype.getSumme = function (a, b) { + getSumme(a, b) { return a + b; - }; - Car.prototype.getSumme_x = function (a, b, c) { + } + getSumme_x(a, b, c) { return a + b + c; - }; - Car.prototype.getFirstName = function () { + } + getFirstName() { return this.firstName; - }; - Car.prototype.getLastName = function () { + } + getLastName() { return this.lastName; - }; - Car.prototype.setLastName = function (lastname) { + } + setLastName(lastname) { if (this.lastName == lastName) { console.log("Latname is already exist"); } else { this.lastName = lastname; } - }; - Car.prototype.setFirstName = function (firstName) { + } + setFirstName(firstName) { this.firstName = firstName; - }; - Car.prototype.callServer = function () { + } + callServer() { apex.page.confirm("Are you Sure?", "SUCCESS"); + apex.confirm(); apex.event.trigger('pSelector', 'pEvent', $x('pNd')); - }; - Car.prototype.callServerx = function (processname) { + } + callServerx(processname) { var $body = $(".t-Body"); apex.server.process(processname, { pageItems: "#P2300_LOV", @@ -42,11 +42,11 @@ var Car = /** @class */ (function () { }, { contents: document.body, async: true, - beforeSend: function () { + beforeSend: () => { $body.addClass("loading"); $('Processing').appendTo("body"); }, - success: function (pData) { + success: (pData) => { /* If the AJAX is successful set the value or the returned items */ if (pData.success === true) { /* Loop through the array and set the value of each item */ @@ -56,37 +56,38 @@ var Car = /** @class */ (function () { } /* Remove the processing image */ }, - error: function (request, status, error) { + error: (request, status, error) => { alert(request.responseText); /* Remove the processing image */ } }); - }; - Car.prototype.confirm = function () { - var $ = $s; - $.confirm({ - title: 'Confirm!', - content: 'Simple confirm!', - buttons: { - confirm: function () { - alert('Confirmed!'); - }, - cancel: function () { - alert('Canceled!'); - }, - somethingElse: { - text: 'Something else', - btnClass: 'btn-blue', - keys: ['enter', 'shift'], - action: function () { - alert('Something else?'); - } + } + apexMessageAlert() { + apex.message.alert("Load complete"); + } + apexMessageConfirm() { + apex.message.confirm("Are you sure?", (okPressed) => { + if (okPressed) { + console.log('delete'); + } + }); + apex.message.confirm("Are you sure?"); + } + apexMessageSetThemeHooks() { + apex.message.setThemeHooks({ + beforeShow: (pMsgType, pElement$) => { + if (pMsgType === apex.message.TYPE.SUCCESS) { + pElement$.addClass("animate-msg"); + } + }, + beforeHide: (pMsgType, pElement$) => { + if (pMsgType === apex.message.TYPE.SUCCESS) { + pElement$.removeClass("animate-msg"); } } }); - }; - return Car; -}()); + } +} var firstName = 'Pierre'; var lastName = 'Yotti'; var type = new Car(firstName, lastName); diff --git a/types/orclapex-js/orclapex-js-tests.ts b/types/orclapex-js/orclapex-js-tests.ts index db3fdeb..7106b83 100644 --- a/types/orclapex-js/orclapex-js-tests.ts +++ b/types/orclapex-js/orclapex-js-tests.ts @@ -1,5 +1,4 @@ /// -/// namespace server { export interface Iperson { firstname: string, @@ -71,13 +70,13 @@ class Car implements server.Iperson { }, { contents: document.body, async:true, - beforeSend: function() { + beforeSend: ()=> { $body.addClass("loading"); $('Processing').appendTo("body"); }, - success: function(pData:any) { + success: (pData:any)=> { /* If the AJAX is successful set the value or the returned items */ if (pData.success === true) { /* Loop through the array and set the value of each item */ @@ -89,7 +88,7 @@ class Car implements server.Iperson { /* Remove the processing image */ }, - error: function(request:any, status:any, error:any) { + error: (request:any, status:any, error:any)=> { alert(request.responseText); /* Remove the processing image */ @@ -98,30 +97,35 @@ class Car implements server.Iperson { }); } + public apexMessageAlert(){ + apex.message.alert("Load complete"); + } - public confirm() { - var $ = $s; - $.confirm({ - title: 'Confirm!', - content: 'Simple confirm!', - buttons: { - confirm: function () { - alert('Confirmed!'); - }, - cancel: function () { - alert('Canceled!'); - }, - somethingElse: { - text: 'Something else', - btnClass: 'btn-blue', - keys: ['enter', 'shift'], - action: function(){ - alert('Something else?'); - } - } + public apexMessageConfirm(){ + apex.message.confirm( "Are you sure?", ( okPressed: string )=> { + if( okPressed ) { + console.log('delete'); } }); - } + apex.message.confirm( "Are you sure?"); + } + + public apexMessageSetThemeHooks(){ + apex.message.setThemeHooks({ + beforeShow: ( pMsgType: string, pElement$: HTMLSelectElement )=>{ + if ( pMsgType === apex.message.TYPE.SUCCESS ) { + pElement$.addClass( "animate-msg" ); + } + }, + beforeHide: ( pMsgType:any, pElement$:any )=>{ + if ( pMsgType === apex.message.TYPE.SUCCESS ) { + pElement$.removeClass( "animate-msg" ); + } + } +}); + + } + } diff --git a/types/orclapex-js/tsconfig.json b/types/orclapex-js/tsconfig.json index 67031da..7416690 100644 --- a/types/orclapex-js/tsconfig.json +++ b/types/orclapex-js/tsconfig.json @@ -18,7 +18,6 @@ }, "files": [ "index.d.ts", - "orclapex-js-tests.ts", - "indexconfirm.d.ts" + "orclapex-js-tests.ts" ] }