@everymatrix/helper-modal 1.32.4 → 1.33.0
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/dist/cjs/helper-modal.cjs.entry.js +76 -0
- package/dist/cjs/helper-modal.cjs.js +19 -0
- package/dist/cjs/index-c6e4ec44.js +1181 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/helper-modal/helper-modal.css +68 -0
- package/dist/collection/components/helper-modal/helper-modal.js +156 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +30 -0
- package/dist/components/helper-modal.d.ts +11 -0
- package/dist/components/helper-modal.js +96 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/helper-modal.entry.js +72 -0
- package/dist/esm/helper-modal.js +17 -0
- package/dist/esm/index-4d594e7d.js +1155 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/helper-modal/helper-modal.esm.js +1 -0
- package/dist/helper-modal/index.esm.js +0 -0
- package/dist/helper-modal/p-1c2c3fd8.js +1 -0
- package/dist/helper-modal/p-66f1c138.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/helper-modal/.stencil/packages/helper-modal/stencil.config.d.ts +2 -0
- package/dist/types/components/helper-modal/helper-modal.d.ts +30 -0
- package/dist/types/components.d.ts +73 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +14 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-c6e4ec44.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name isMobile
|
|
9
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
10
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
11
|
+
* @returns {Boolean} true or false
|
|
12
|
+
*/
|
|
13
|
+
const isMobile = (userAgent) => {
|
|
14
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
15
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
16
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
17
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const helperModalCss = ":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";
|
|
21
|
+
|
|
22
|
+
const HelperModal = class {
|
|
23
|
+
constructor(hostRef) {
|
|
24
|
+
index.registerInstance(this, hostRef);
|
|
25
|
+
this.cancel = index.createEvent(this, "modalCloseEvent", 7);
|
|
26
|
+
/**
|
|
27
|
+
* Toggles if the helper is visible or not
|
|
28
|
+
*/
|
|
29
|
+
this.visible = true;
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via string
|
|
32
|
+
*/
|
|
33
|
+
this.clientStyling = '';
|
|
34
|
+
/**
|
|
35
|
+
* Client custom styling via url content
|
|
36
|
+
*/
|
|
37
|
+
this.clientStylingUrlContent = '';
|
|
38
|
+
this.limitStylingAppends = false;
|
|
39
|
+
this.userAgent = window.navigator.userAgent;
|
|
40
|
+
this.setClientStyling = () => {
|
|
41
|
+
let sheet = document.createElement('style');
|
|
42
|
+
sheet.innerHTML = this.clientStyling;
|
|
43
|
+
this.stylingContainer.prepend(sheet);
|
|
44
|
+
};
|
|
45
|
+
this.setClientStylingURL = () => {
|
|
46
|
+
let cssFile = document.createElement('style');
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
49
|
+
this.stylingContainer.prepend(cssFile);
|
|
50
|
+
}, 1);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
handleHelperModalClose() {
|
|
54
|
+
this.visible = false;
|
|
55
|
+
this.cancel.emit();
|
|
56
|
+
}
|
|
57
|
+
;
|
|
58
|
+
componentDidRender() {
|
|
59
|
+
// start custom styling area
|
|
60
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
61
|
+
if (this.clientStyling)
|
|
62
|
+
this.setClientStyling();
|
|
63
|
+
if (this.clientStylingUrlContent)
|
|
64
|
+
this.setClientStylingURL();
|
|
65
|
+
this.limitStylingAppends = true;
|
|
66
|
+
}
|
|
67
|
+
// end custom styling area
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return ((this.visible &&
|
|
71
|
+
index.h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el }, index.h("div", { class: "HelperModalWrapper HelperModalVisible" }, index.h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, index.h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), index.h("slot", null))))));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
HelperModal.style = helperModalCss;
|
|
75
|
+
|
|
76
|
+
exports.helper_modal = HelperModal;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-c6e4ec44.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('helper-modal.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["helper-modal.cjs",[[1,"helper-modal",{"titleModal":[513,"title-modal"],"visible":[1540],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
19
|
+
});
|