@bruit/component
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -1,1 +0,1 @@ | ||
import{p as o,g as r,b as i}from"./p-040e9bdb.js";o().then(o=>(r(),i([["p-54wrhpj3",[[1,"bruit-core",{config:[1,"brt-config"],_bruitCoreConfig:[32],modalOpened:[32],modalBrtField:[32],modalError:[32],_bruitIoConfig:[32],newFeedback:[64],sendFeedback:[64]}],[1,"bruit-io",{config:[1,"brt-config"],data:[16],dataFn:[16],_config:[32]}],[0,"bruit-rating",{value:[1538],max:[1538],color:[1],offColor:[1,"off-color"],onBorderColor:[32]}],[0,"bruit-select",{id:[1],options:[16],value:[1],required:[4]}]]]],o))); | ||
import{p as o,g as r,b as i}from"./p-040e9bdb.js";o().then(o=>(r(),i([["p-jalwrjql",[[1,"bruit-core",{config:[1,"brt-config"],_bruitCoreConfig:[32],modalOpened:[32],modalBrtField:[32],modalError:[32],_bruitIoConfig:[32],newFeedback:[64],sendFeedback:[64]}],[1,"bruit-io",{config:[1,"brt-config"],data:[16],dataFn:[16],_config:[32]}],[0,"bruit-rating",{value:[1538],max:[1538],color:[1],offColor:[1,"off-color"],onBorderColor:[32]}],[0,"bruit-select",{id:[1],options:[16],value:[1],required:[4]}]]]],o))); |
@@ -1,1 +0,1 @@ | ||
export{a as BrtFieldType,b as __moduleExports}from"./p-3b5241ac.js";function o(o){console.log("wazza2",o)}export{o as sendFeedback2}; | ||
export{a as BrtFieldType,b as __moduleExports}from"./p-fa96e0e6.js"; |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-71cb4dd5.system.js"],(function(){"use strict";var e,o,r;return{setters:[function(t){e=t.p;o=t.g;r=t.b}],execute:function(){e().then((function(e){o();return r([["p-ecjet8zz.system",[[1,"bruit-core",{config:[1,"brt-config"],_bruitCoreConfig:[32],modalOpened:[32],modalBrtField:[32],modalError:[32],_bruitIoConfig:[32],newFeedback:[64],sendFeedback:[64]}],[1,"bruit-io",{config:[1,"brt-config"],data:[16],dataFn:[16],_config:[32]}],[0,"bruit-rating",{value:[1538],max:[1538],color:[1],offColor:[1,"off-color"],onBorderColor:[32]}],[0,"bruit-select",{id:[1],options:[16],value:[1],required:[4]}]]]],e)}))}}})); | ||
System.register(["./p-71cb4dd5.system.js"],(function(){"use strict";var o,e,r;return{setters:[function(t){o=t.p;e=t.g;r=t.b}],execute:function(){o().then((function(o){e();return r([["p-i0u0z90j.system",[[1,"bruit-core",{config:[1,"brt-config"],_bruitCoreConfig:[32],modalOpened:[32],modalBrtField:[32],modalError:[32],_bruitIoConfig:[32],newFeedback:[64],sendFeedback:[64]}],[1,"bruit-io",{config:[1,"brt-config"],data:[16],dataFn:[16],_config:[32]}],[0,"bruit-rating",{value:[1538],max:[1538],color:[1],offColor:[1,"off-color"],onBorderColor:[32]}],[0,"bruit-select",{id:[1],options:[16],value:[1],required:[4]}]]]],o)}))}}})); |
@@ -5,10 +5,7 @@ 'use strict'; | ||
const brtFieldType = require('./brt-field-type-ec0b7dd7.js'); | ||
const brtFieldType = require('./brt-field-type-227b8bd3.js'); | ||
function sendFeedback2(test) { | ||
console.log('wazza2', test); | ||
} | ||
exports.BrtFieldType = brtFieldType.brtFieldType_1; | ||
exports.__moduleExports = brtFieldType.brtFieldType; | ||
exports.sendFeedback2 = sendFeedback2; |
@@ -8,2 +8,3 @@ import { BrtFieldType } from '@bruit/types/dist/enums/brt-field-type'; | ||
import { BruitCoreConfig } from '../../models/bruit-core-config.class'; | ||
const openAnimationDuration = 200; | ||
export class BruitCore { | ||
@@ -19,2 +20,3 @@ constructor() { | ||
this.modalBrtField = []; | ||
this._openOrCloseLock = Promise.resolve(); | ||
} | ||
@@ -75,4 +77,4 @@ /** | ||
} | ||
waitRendering() { | ||
return new Promise(resolve => setTimeout(resolve)); | ||
waitRendering(time = 0) { | ||
return new Promise(resolve => setTimeout(resolve, time)); | ||
} | ||
@@ -85,9 +87,6 @@ /** | ||
//if there's already a current feedback, we have a probleme!!! => destroy it | ||
let preparePromise; | ||
let preparePromise = this.waitRendering(openAnimationDuration + 2); | ||
if (this._currentFeedback) { | ||
preparePromise = this.destroyFeedback(); | ||
preparePromise = preparePromise.then(() => this.destroyFeedback()); | ||
} | ||
else { | ||
preparePromise = Promise.resolve(); | ||
} | ||
return preparePromise | ||
@@ -106,4 +105,6 @@ .then(() => { | ||
// close the modal and send feedback | ||
this.closeModal(); | ||
return this.hideVirtualKeyboard().then(() => this.waitRendering().then(() => feedback.send(dataFromModal, data, dataFn))); | ||
return Promise.all([ | ||
this.closeModal(), | ||
this.hideVirtualKeyboard() | ||
]).then(() => this.waitRendering().then(() => feedback.send(dataFromModal, data, dataFn))); | ||
} | ||
@@ -131,4 +132,4 @@ else { | ||
if (err === 'close') { | ||
this.destroyFeedback(); | ||
//console.log('feedback canceled'); | ||
//this.destroyFeedback(); | ||
// console.log('feedback canceled'); | ||
} | ||
@@ -220,9 +221,16 @@ else { | ||
openModal() { | ||
this.modalOpened = true; | ||
this.modalBrtField = JSON.parse(JSON.stringify(this._bruitIoConfig.form)); | ||
return new Promise(resolve => { | ||
setTimeout(() => { | ||
this.setSubmitButtonState(SubmitButtonState.SUBMIT); | ||
resolve(); | ||
}, 300); // we have to wait for opening animation to be done | ||
return this._openOrCloseLock.then(() => { | ||
let unlock; | ||
this._openOrCloseLock = new Promise((resolve) => { unlock = resolve; }); | ||
this.modalOpened = true; | ||
// console.log('openModal called'); | ||
// console.log(' set this.modalBrtField'); | ||
this.modalBrtField = JSON.parse(JSON.stringify(this._bruitIoConfig.form)); | ||
return new Promise(resolve => { | ||
setTimeout(() => { | ||
this.setSubmitButtonState(SubmitButtonState.SUBMIT); | ||
unlock(); | ||
resolve(); | ||
}, openAnimationDuration + 1); // we have to wait for opening animation to be done | ||
}); | ||
}); | ||
@@ -234,9 +242,16 @@ } | ||
closeModal() { | ||
this.modalOpened = false; | ||
return new Promise(resolve => { | ||
setTimeout(() => { | ||
this.modalBrtField = []; | ||
this.modalError = undefined; | ||
resolve(); | ||
}, 250); | ||
return this._openOrCloseLock.then(() => { | ||
let unlock; | ||
this._openOrCloseLock = new Promise((resolve) => { unlock = resolve; }); | ||
this.modalOpened = false; | ||
// console.log('close called'); | ||
return new Promise(resolve => { | ||
setTimeout(() => { | ||
// console.log(' unset this.modalBrtField'); | ||
this.modalBrtField = []; | ||
this.modalError = undefined; | ||
unlock(); | ||
resolve(); | ||
}, openAnimationDuration + 1); | ||
}); | ||
}); | ||
@@ -269,13 +284,15 @@ } | ||
//------------------ close modal ---------------------- | ||
const _closeModalFn = () => { | ||
this.closeModal().then(() => { | ||
// remove event listeners (for memory leaks and disable form) | ||
button_close.removeEventListener('click', _closeModalFn, false); | ||
modal_wrapper.removeEventListener('click', _closeModalFn, false); | ||
const _closeModalFn = ( /*name*/) => ((e) => { | ||
// remove event listeners (for memory leaks and disable form) | ||
button_close.removeEventListener('click', _closeModalFn, false); | ||
modal_wrapper.removeEventListener('click', _closeModalFn, false); | ||
// console.log('CLOSE MODAL FROM ', name); | ||
e.preventDefault(); | ||
this.destroyFeedback().then(() => { | ||
form.removeEventListener('submit', _onSubmit, false); | ||
reject('close'); | ||
}); | ||
}; | ||
button_close.addEventListener('click', _closeModalFn, { once: true }); | ||
modal_wrapper.addEventListener('click', _closeModalFn, { once: true }); | ||
}); | ||
button_close.addEventListener('click', _closeModalFn(), { once: true }); | ||
modal_wrapper.addEventListener('click', _closeModalFn(), { once: true }); | ||
}); | ||
@@ -391,2 +408,3 @@ } | ||
modalFields() { | ||
// console.log(' brtField used = ', this.modalBrtField); | ||
return this.modalBrtField.map(field => { | ||
@@ -393,0 +411,0 @@ switch (field.type) { |
export * from '@bruit/types/dist/enums/brt-field-type'; | ||
export function sendFeedback2(test) { | ||
console.log('wazza2', test); | ||
} |
@@ -22,4 +22,1 @@ export default function () { | ||
} | ||
export function sendFeedback(test) { | ||
console.log('wazza', test); | ||
} |
@@ -43,2 +43,3 @@ import { BrtCoreConfig, BrtData, BrtError, BrtField } from '@bruit/types'; | ||
bruitCoreElement: HTMLBruitCoreElement; | ||
private _openOrCloseLock; | ||
/** | ||
@@ -49,3 +50,3 @@ * fired on component loading before render() | ||
hideVirtualKeyboard(): Promise<void>; | ||
waitRendering(): Promise<unknown>; | ||
waitRendering(time?: number): Promise<unknown>; | ||
/** | ||
@@ -52,0 +53,0 @@ * called on click on component |
@@ -1,5 +0,6 @@ | ||
export * from './components'; | ||
export * from '@bruit/types/dist/enums/brt-field-type'; | ||
export * from '@bruit/types/dist/interfaces/brt-colors'; | ||
export * from '@bruit/types/dist/interfaces/brt-config'; | ||
export * from '@bruit/types/dist/interfaces/brt-core-config'; | ||
export * from '@bruit/types/dist/interfaces/brt-data'; | ||
export * from '@bruit/types/dist/interfaces/brt-error'; | ||
@@ -9,4 +10,2 @@ export * from '@bruit/types/dist/interfaces/brt-field'; | ||
export * from '@bruit/types/dist/interfaces/brt-log-cache-length'; | ||
export * from '@bruit/types/dist/interfaces/brt-data'; | ||
export * from '@bruit/types/dist/enums/brt-field-type'; | ||
export declare function sendFeedback2(test: any): void; | ||
export * from './components'; |
export default function (): void; | ||
export declare function sendFeedback(test: any): void; |
{ | ||
"name": "@bruit/component", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "send your feedbacks with bruit.io", | ||
@@ -61,3 +61,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@bruit/types": "0.2.28-2", | ||
"@bruit/types": "1.3.1", | ||
"bowser": "^2.7.0", | ||
@@ -64,0 +64,0 @@ "html2canvas": "^1.0.0-rc.5", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
3054710
46106
+ Added@bruit/types@1.3.1(transitive)
- Removed@bruit/types@0.2.28-2(transitive)
Updated@bruit/types@1.3.1