@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,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-c6e4ec44.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
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);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.HelperModalWrapper {
|
|
6
|
+
position: fixed;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
background: rgba(0, 0, 0, 0.7);
|
|
12
|
+
opacity: 0;
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
transform: scale(1.1);
|
|
15
|
+
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.HelperModalVisible {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
visibility: visible;
|
|
22
|
+
transform: scale(1);
|
|
23
|
+
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.HelperModalContent {
|
|
27
|
+
position: relative;
|
|
28
|
+
border: solid 1px #848e97;
|
|
29
|
+
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.007);
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
padding: 10px 10px 5px 10px;
|
|
32
|
+
background-color: #fff;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 50%;
|
|
35
|
+
left: 50%;
|
|
36
|
+
transform: translate(-50%, -50%);
|
|
37
|
+
border-radius: 4px;
|
|
38
|
+
width: 600px;
|
|
39
|
+
max-height: 600px;
|
|
40
|
+
overflow-y: scroll;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.HelperModalMobileContent {
|
|
44
|
+
background: #FFF;
|
|
45
|
+
top: 50%;
|
|
46
|
+
left: 50%;
|
|
47
|
+
transform: translate(-50%, -50%);
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
width: 80%;
|
|
50
|
+
max-height: 350px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.HelperModalClose {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 15px;
|
|
57
|
+
right: 15px;
|
|
58
|
+
font-size: 20px;
|
|
59
|
+
color: #000;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.HelperModalMobileClose {
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 15px;
|
|
65
|
+
right: 15px;
|
|
66
|
+
font-size: 20px;
|
|
67
|
+
color: #000;
|
|
68
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
2
|
+
import { isMobile } from "../../utils/utils";
|
|
3
|
+
export class HelperModal {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Toggles if the helper is visible or not
|
|
7
|
+
*/
|
|
8
|
+
this.visible = true;
|
|
9
|
+
/**
|
|
10
|
+
* Client custom styling via string
|
|
11
|
+
*/
|
|
12
|
+
this.clientStyling = '';
|
|
13
|
+
/**
|
|
14
|
+
* Client custom styling via url content
|
|
15
|
+
*/
|
|
16
|
+
this.clientStylingUrlContent = '';
|
|
17
|
+
this.limitStylingAppends = false;
|
|
18
|
+
this.userAgent = window.navigator.userAgent;
|
|
19
|
+
this.setClientStyling = () => {
|
|
20
|
+
let sheet = document.createElement('style');
|
|
21
|
+
sheet.innerHTML = this.clientStyling;
|
|
22
|
+
this.stylingContainer.prepend(sheet);
|
|
23
|
+
};
|
|
24
|
+
this.setClientStylingURL = () => {
|
|
25
|
+
let cssFile = document.createElement('style');
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
28
|
+
this.stylingContainer.prepend(cssFile);
|
|
29
|
+
}, 1);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
handleHelperModalClose() {
|
|
33
|
+
this.visible = false;
|
|
34
|
+
this.cancel.emit();
|
|
35
|
+
}
|
|
36
|
+
;
|
|
37
|
+
componentDidRender() {
|
|
38
|
+
// start custom styling area
|
|
39
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
40
|
+
if (this.clientStyling)
|
|
41
|
+
this.setClientStyling();
|
|
42
|
+
if (this.clientStylingUrlContent)
|
|
43
|
+
this.setClientStylingURL();
|
|
44
|
+
this.limitStylingAppends = true;
|
|
45
|
+
}
|
|
46
|
+
// end custom styling area
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return ((this.visible &&
|
|
50
|
+
h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el },
|
|
51
|
+
h("div", { class: "HelperModalWrapper HelperModalVisible" },
|
|
52
|
+
h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') },
|
|
53
|
+
h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"),
|
|
54
|
+
h("slot", null))))));
|
|
55
|
+
}
|
|
56
|
+
static get is() { return "helper-modal"; }
|
|
57
|
+
static get encapsulation() { return "shadow"; }
|
|
58
|
+
static get originalStyleUrls() { return {
|
|
59
|
+
"$": ["helper-modal.scss"]
|
|
60
|
+
}; }
|
|
61
|
+
static get styleUrls() { return {
|
|
62
|
+
"$": ["helper-modal.css"]
|
|
63
|
+
}; }
|
|
64
|
+
static get properties() { return {
|
|
65
|
+
"titleModal": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "string",
|
|
70
|
+
"resolved": "string",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": "Modal title"
|
|
78
|
+
},
|
|
79
|
+
"attribute": "title-modal",
|
|
80
|
+
"reflect": true
|
|
81
|
+
},
|
|
82
|
+
"visible": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"mutable": true,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "boolean",
|
|
87
|
+
"resolved": "boolean",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": false,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Toggles if the helper is visible or not"
|
|
95
|
+
},
|
|
96
|
+
"attribute": "visible",
|
|
97
|
+
"reflect": true,
|
|
98
|
+
"defaultValue": "true"
|
|
99
|
+
},
|
|
100
|
+
"clientStyling": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Client custom styling via string"
|
|
113
|
+
},
|
|
114
|
+
"attribute": "client-styling",
|
|
115
|
+
"reflect": true,
|
|
116
|
+
"defaultValue": "''"
|
|
117
|
+
},
|
|
118
|
+
"clientStylingUrlContent": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "Client custom styling via url content"
|
|
131
|
+
},
|
|
132
|
+
"attribute": "client-styling-url-content",
|
|
133
|
+
"reflect": true,
|
|
134
|
+
"defaultValue": "''"
|
|
135
|
+
}
|
|
136
|
+
}; }
|
|
137
|
+
static get states() { return {
|
|
138
|
+
"limitStylingAppends": {}
|
|
139
|
+
}; }
|
|
140
|
+
static get events() { return [{
|
|
141
|
+
"method": "cancel",
|
|
142
|
+
"name": "modalCloseEvent",
|
|
143
|
+
"bubbles": true,
|
|
144
|
+
"cancelable": true,
|
|
145
|
+
"composed": true,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": "The event triggered when the modal is closed"
|
|
149
|
+
},
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "any",
|
|
152
|
+
"resolved": "any",
|
|
153
|
+
"references": {}
|
|
154
|
+
}
|
|
155
|
+
}]; }
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name isMobile
|
|
3
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
4
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
5
|
+
* @returns {Boolean} true or false
|
|
6
|
+
*/
|
|
7
|
+
export const isMobile = (userAgent) => {
|
|
8
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
9
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
10
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @name getDevice
|
|
15
|
+
* @description A method that returns the type of the device
|
|
16
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
17
|
+
* @returns {String} Android/iPhone/iPad/PC
|
|
18
|
+
*/
|
|
19
|
+
export const getDevice = (userAgent) => {
|
|
20
|
+
if (userAgent.toLowerCase().match(/android/i)) {
|
|
21
|
+
return 'Android';
|
|
22
|
+
}
|
|
23
|
+
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
24
|
+
return 'iPhone';
|
|
25
|
+
}
|
|
26
|
+
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
27
|
+
return 'iPad';
|
|
28
|
+
}
|
|
29
|
+
return 'PC';
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface HelperModal extends Components.HelperModal, HTMLElement {}
|
|
4
|
+
export const HelperModal: {
|
|
5
|
+
prototype: HelperModal;
|
|
6
|
+
new (): HelperModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name isMobile
|
|
5
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
6
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
7
|
+
* @returns {Boolean} true or false
|
|
8
|
+
*/
|
|
9
|
+
const isMobile = (userAgent) => {
|
|
10
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
12
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
13
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
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}";
|
|
17
|
+
|
|
18
|
+
const HelperModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.__registerHost();
|
|
22
|
+
this.__attachShadow();
|
|
23
|
+
this.cancel = createEvent(this, "modalCloseEvent", 7);
|
|
24
|
+
/**
|
|
25
|
+
* Toggles if the helper is visible or not
|
|
26
|
+
*/
|
|
27
|
+
this.visible = true;
|
|
28
|
+
/**
|
|
29
|
+
* Client custom styling via string
|
|
30
|
+
*/
|
|
31
|
+
this.clientStyling = '';
|
|
32
|
+
/**
|
|
33
|
+
* Client custom styling via url content
|
|
34
|
+
*/
|
|
35
|
+
this.clientStylingUrlContent = '';
|
|
36
|
+
this.limitStylingAppends = false;
|
|
37
|
+
this.userAgent = window.navigator.userAgent;
|
|
38
|
+
this.setClientStyling = () => {
|
|
39
|
+
let sheet = document.createElement('style');
|
|
40
|
+
sheet.innerHTML = this.clientStyling;
|
|
41
|
+
this.stylingContainer.prepend(sheet);
|
|
42
|
+
};
|
|
43
|
+
this.setClientStylingURL = () => {
|
|
44
|
+
let cssFile = document.createElement('style');
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
47
|
+
this.stylingContainer.prepend(cssFile);
|
|
48
|
+
}, 1);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
handleHelperModalClose() {
|
|
52
|
+
this.visible = false;
|
|
53
|
+
this.cancel.emit();
|
|
54
|
+
}
|
|
55
|
+
;
|
|
56
|
+
componentDidRender() {
|
|
57
|
+
// start custom styling area
|
|
58
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
59
|
+
if (this.clientStyling)
|
|
60
|
+
this.setClientStyling();
|
|
61
|
+
if (this.clientStylingUrlContent)
|
|
62
|
+
this.setClientStylingURL();
|
|
63
|
+
this.limitStylingAppends = true;
|
|
64
|
+
}
|
|
65
|
+
// end custom styling area
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return ((this.visible &&
|
|
69
|
+
h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
|
|
70
|
+
}
|
|
71
|
+
static get style() { return helperModalCss; }
|
|
72
|
+
}, [1, "helper-modal", {
|
|
73
|
+
"titleModal": [513, "title-modal"],
|
|
74
|
+
"visible": [1540],
|
|
75
|
+
"clientStyling": [513, "client-styling"],
|
|
76
|
+
"clientStylingUrlContent": [513, "client-styling-url-content"],
|
|
77
|
+
"limitStylingAppends": [32]
|
|
78
|
+
}]);
|
|
79
|
+
function defineCustomElement$1() {
|
|
80
|
+
if (typeof customElements === "undefined") {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const components = ["helper-modal"];
|
|
84
|
+
components.forEach(tagName => { switch (tagName) {
|
|
85
|
+
case "helper-modal":
|
|
86
|
+
if (!customElements.get(tagName)) {
|
|
87
|
+
customElements.define(tagName, HelperModal$1);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
} });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const HelperModal = HelperModal$1;
|
|
94
|
+
const defineCustomElement = defineCustomElement$1;
|
|
95
|
+
|
|
96
|
+
export { HelperModal, defineCustomElement };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* HelperModal custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-4d594e7d.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name isMobile
|
|
5
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
6
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
7
|
+
* @returns {Boolean} true or false
|
|
8
|
+
*/
|
|
9
|
+
const isMobile = (userAgent) => {
|
|
10
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
12
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
13
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
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}";
|
|
17
|
+
|
|
18
|
+
const HelperModal = class {
|
|
19
|
+
constructor(hostRef) {
|
|
20
|
+
registerInstance(this, hostRef);
|
|
21
|
+
this.cancel = createEvent(this, "modalCloseEvent", 7);
|
|
22
|
+
/**
|
|
23
|
+
* Toggles if the helper is visible or not
|
|
24
|
+
*/
|
|
25
|
+
this.visible = true;
|
|
26
|
+
/**
|
|
27
|
+
* Client custom styling via string
|
|
28
|
+
*/
|
|
29
|
+
this.clientStyling = '';
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via url content
|
|
32
|
+
*/
|
|
33
|
+
this.clientStylingUrlContent = '';
|
|
34
|
+
this.limitStylingAppends = false;
|
|
35
|
+
this.userAgent = window.navigator.userAgent;
|
|
36
|
+
this.setClientStyling = () => {
|
|
37
|
+
let sheet = document.createElement('style');
|
|
38
|
+
sheet.innerHTML = this.clientStyling;
|
|
39
|
+
this.stylingContainer.prepend(sheet);
|
|
40
|
+
};
|
|
41
|
+
this.setClientStylingURL = () => {
|
|
42
|
+
let cssFile = document.createElement('style');
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
45
|
+
this.stylingContainer.prepend(cssFile);
|
|
46
|
+
}, 1);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
handleHelperModalClose() {
|
|
50
|
+
this.visible = false;
|
|
51
|
+
this.cancel.emit();
|
|
52
|
+
}
|
|
53
|
+
;
|
|
54
|
+
componentDidRender() {
|
|
55
|
+
// start custom styling area
|
|
56
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
57
|
+
if (this.clientStyling)
|
|
58
|
+
this.setClientStyling();
|
|
59
|
+
if (this.clientStylingUrlContent)
|
|
60
|
+
this.setClientStylingURL();
|
|
61
|
+
this.limitStylingAppends = true;
|
|
62
|
+
}
|
|
63
|
+
// end custom styling area
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return ((this.visible &&
|
|
67
|
+
h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
HelperModal.style = helperModalCss;
|
|
71
|
+
|
|
72
|
+
export { HelperModal as helper_modal };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-4d594e7d.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
+
*/
|
|
6
|
+
const patchBrowser = () => {
|
|
7
|
+
const importMeta = import.meta.url;
|
|
8
|
+
const opts = {};
|
|
9
|
+
if (importMeta !== '') {
|
|
10
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
11
|
+
}
|
|
12
|
+
return promiseResolve(opts);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
patchBrowser().then(options => {
|
|
16
|
+
return bootstrapLazy([["helper-modal",[[1,"helper-modal",{"titleModal":[513,"title-modal"],"visible":[1540],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
17
|
+
});
|