webcimes-modal 1.1.3 → 1.1.4
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/demo/demo_esm.html +1 -56
- package/demo/demo_udm.html +1 -46
- package/demo/script_esm.js +47 -0
- package/demo/script_udm.js +45 -0
- package/dist/js/webcimes-modal.esm.d.ts +1 -1
- package/dist/js/webcimes-modal.udm.d.ts +1 -1
- package/package.json +2 -3
- package/test/test.html +0 -7
- package/webpack.config.ts +32 -25
package/demo/demo_esm.html
CHANGED
|
@@ -7,62 +7,7 @@
|
|
|
7
7
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
8
8
|
<title>Demo webcimes-modal ESM</title>
|
|
9
9
|
<link rel="stylesheet" href="../dist/css/webcimes-modal.css">
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
"imports": {
|
|
13
|
-
"webcimes-modal": "../dist/js/webcimes-modal.esm.js"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
<script type="module">
|
|
18
|
-
// Import webcimes-modal
|
|
19
|
-
import {WebcimesModal} from "webcimes-modal";
|
|
20
|
-
|
|
21
|
-
// Wait for dom content loaded
|
|
22
|
-
document.addEventListener("DOMContentLoaded", function()
|
|
23
|
-
{
|
|
24
|
-
const myModal = new WebcimesModal({
|
|
25
|
-
setId: null, // set specific id to the modal, default "null"
|
|
26
|
-
setClass: null, // set specific class to the modal, default "null"
|
|
27
|
-
width: 'auto', // width (specify the unit), default "auto"
|
|
28
|
-
height: 'auto', // height (specify the unit), default "auto"
|
|
29
|
-
titleHtml: "My title", // html for title, default "null"
|
|
30
|
-
bodyHtml: "My Body", // html for body, default "null"
|
|
31
|
-
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
32
|
-
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
33
|
-
closeOnCancelButton: true, // close the modal after trigger cancel button, default "true"
|
|
34
|
-
closeOnConfirmButton: true, // close the modal after trigger confirm button, default "true"
|
|
35
|
-
showCloseButton: true, // show the close button, default "true"
|
|
36
|
-
allowCloseOutside: false, // allow to close modal when click outside, default "true"
|
|
37
|
-
allowMovement: true, // possibility to move the modal, default "true"
|
|
38
|
-
moveFromHeader: true, // if allowMovement is set to "true", ability to move modal from header, default "true"
|
|
39
|
-
moveFromBody: false, // if allowMovement is set to "true", ability to move modal from body, default "false"
|
|
40
|
-
moveFromFooter: true, // if allowMovement is set to "true", ability to move modal from footer, default "true"
|
|
41
|
-
stickyHeader: true, // keep sticky (visible) the header when scrolling, default "true"
|
|
42
|
-
stickyFooter: true, // keep sticky (visible) the footer when scrolling, default "true"
|
|
43
|
-
style: null, // add extra style css to the modal, default null
|
|
44
|
-
animationOnShow: 'animDropDown', // "animDropDown" or "animFadeIn" for enter animation, default "animDropDown"
|
|
45
|
-
animationOnDestroy: 'animDropUp', // "animDropUp" or "animFadeOut" for end animation, default "animDropUp"
|
|
46
|
-
animationDuration: 500, // anim duration in ms, default "500"
|
|
47
|
-
beforeShow: () => {console.log("before show");}, // callback before show modal
|
|
48
|
-
afterShow: () => {console.log("after show");}, // callback after destroy modal
|
|
49
|
-
beforeDestroy: () => {console.log("before destroy");}, // callback before destroy modal
|
|
50
|
-
afterDestroy: () => {console.log("after destroy");}, // callback after destroy modal
|
|
51
|
-
onCancelButton: () => {console.log("on cancel button");}, // callback after trigger cancel button
|
|
52
|
-
onConfirmButton: () => {console.log("on confirm button");}, // callback after trigger confirm button
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const myModal2 = new WebcimesModal({
|
|
56
|
-
titleHtml: "My title", // html for title, default "null"
|
|
57
|
-
bodyHtml: document.querySelector(".test").outerHTML, // html for body, default "null"
|
|
58
|
-
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
59
|
-
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
60
|
-
closeOnConfirmButton: false, // close the modal after trigger confirm button, default "true"
|
|
61
|
-
afterShow: () => {console.log(myModal2.webcimesModals); console.log(myModal2.modal);}, // callback before show modal
|
|
62
|
-
onConfirmButton: () => {myModal2.destroy();}, // callback after trigger confirm button
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
</script>
|
|
10
|
+
<script type="module" src="script_esm.js"></script>
|
|
66
11
|
</head>
|
|
67
12
|
<body>
|
|
68
13
|
<div style="display:none;">
|
package/demo/demo_udm.html
CHANGED
|
@@ -8,52 +8,7 @@
|
|
|
8
8
|
<title>Demo webcimes-modal UDM</title>
|
|
9
9
|
<link rel="stylesheet" href="../dist/css/webcimes-modal.css">
|
|
10
10
|
<script src="../dist/js/webcimes-modal.udm.js" type="text/javascript"></script>
|
|
11
|
-
<script>
|
|
12
|
-
// Wait for dom content loaded
|
|
13
|
-
document.addEventListener("DOMContentLoaded", function()
|
|
14
|
-
{
|
|
15
|
-
const myModal = new WebcimesModal({
|
|
16
|
-
setId: null, // set specific id to the modal, default "null"
|
|
17
|
-
setClass: null, // set specific class to the modal, default "null"
|
|
18
|
-
width: 'auto', // width (specify the unit), default "auto"
|
|
19
|
-
height: 'auto', // height (specify the unit), default "auto"
|
|
20
|
-
titleHtml: "My title", // html for title, default "null"
|
|
21
|
-
bodyHtml: "My Body", // html for body, default "null"
|
|
22
|
-
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
23
|
-
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
24
|
-
closeOnCancelButton: true, // close the modal after trigger cancel button, default "true"
|
|
25
|
-
closeOnConfirmButton: true, // close the modal after trigger confirm button, default "true"
|
|
26
|
-
showCloseButton: true, // show the close button, default "true"
|
|
27
|
-
allowCloseOutside: false, // allow to close modal when click outside, default "true"
|
|
28
|
-
allowMovement: true, // possibility to move the modal, default "true"
|
|
29
|
-
moveFromHeader: true, // if allowMovement is set to "true", ability to move modal from header, default "true"
|
|
30
|
-
moveFromBody: false, // if allowMovement is set to "true", ability to move modal from body, default "false"
|
|
31
|
-
moveFromFooter: true, // if allowMovement is set to "true", ability to move modal from footer, default "true"
|
|
32
|
-
stickyHeader: true, // keep sticky (visible) the header when scrolling, default "true"
|
|
33
|
-
stickyFooter: true, // keep sticky (visible) the footer when scrolling, default "true"
|
|
34
|
-
style: null, // add extra style css to the modal, default null
|
|
35
|
-
animationOnShow: 'animDropDown', // "animDropDown" or "animFadeIn" for enter animation, default "animDropDown"
|
|
36
|
-
animationOnDestroy: 'animDropUp', // "animDropUp" or "animFadeOut" for end animation, default "animDropUp"
|
|
37
|
-
animationDuration: 500, // anim duration in ms, default "500"
|
|
38
|
-
beforeShow: () => {console.log("before show");}, // callback before show modal
|
|
39
|
-
afterShow: () => {console.log("after show");}, // callback after destroy modal
|
|
40
|
-
beforeDestroy: () => {console.log("before destroy");}, // callback before destroy modal
|
|
41
|
-
afterDestroy: () => {console.log("after destroy");}, // callback after destroy modal
|
|
42
|
-
onCancelButton: () => {console.log("on cancel button");}, // callback after trigger cancel button
|
|
43
|
-
onConfirmButton: () => {console.log("on confirm button");}, // callback after trigger confirm button
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const myModal2 = new WebcimesModal({
|
|
47
|
-
titleHtml: "My title", // html for title, default "null"
|
|
48
|
-
bodyHtml: document.querySelector(".test").outerHTML, // html for body, default "null"
|
|
49
|
-
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
50
|
-
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
51
|
-
closeOnConfirmButton: false, // close the modal after trigger confirm button, default "true"
|
|
52
|
-
afterShow: () => {console.log(myModal2.webcimesModals); console.log(myModal2.modal);}, // callback before show modal
|
|
53
|
-
onConfirmButton: () => {myModal2.destroy();}, // callback after trigger confirm button
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
</script>
|
|
11
|
+
<script type="text/javascript" src="script_udm.js"></script>
|
|
57
12
|
</head>
|
|
58
13
|
<body>
|
|
59
14
|
<div style="display:none;">
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Import webcimes-modal
|
|
2
|
+
import { WebcimesModal } from "../dist/js/webcimes-modal.esm.js";
|
|
3
|
+
|
|
4
|
+
// Wait for dom content loaded
|
|
5
|
+
document.addEventListener("DOMContentLoaded", function()
|
|
6
|
+
{
|
|
7
|
+
const myModal = new WebcimesModal({
|
|
8
|
+
setId: null, // set specific id to the modal, default "null"
|
|
9
|
+
setClass: null, // set specific class to the modal, default "null"
|
|
10
|
+
width: 'auto', // width (specify the unit), default "auto"
|
|
11
|
+
height: 'auto', // height (specify the unit), default "auto"
|
|
12
|
+
titleHtml: "My title", // html for title, default "null"
|
|
13
|
+
bodyHtml: "My Body", // html for body, default "null"
|
|
14
|
+
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
15
|
+
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
16
|
+
closeOnCancelButton: true, // close the modal after trigger cancel button, default "true"
|
|
17
|
+
closeOnConfirmButton: true, // close the modal after trigger confirm button, default "true"
|
|
18
|
+
showCloseButton: true, // show the close button, default "true"
|
|
19
|
+
allowCloseOutside: false, // allow to close modal when click outside, default "true"
|
|
20
|
+
allowMovement: true, // possibility to move the modal, default "true"
|
|
21
|
+
moveFromHeader: true, // if allowMovement is set to "true", ability to move modal from header, default "true"
|
|
22
|
+
moveFromBody: false, // if allowMovement is set to "true", ability to move modal from body, default "false"
|
|
23
|
+
moveFromFooter: true, // if allowMovement is set to "true", ability to move modal from footer, default "true"
|
|
24
|
+
stickyHeader: true, // keep sticky (visible) the header when scrolling, default "true"
|
|
25
|
+
stickyFooter: true, // keep sticky (visible) the footer when scrolling, default "true"
|
|
26
|
+
style: null, // add extra style css to the modal, default null
|
|
27
|
+
animationOnShow: 'animDropDown', // "animDropDown" or "animFadeIn" for enter animation, default "animDropDown"
|
|
28
|
+
animationOnDestroy: 'animDropUp', // "animDropUp" or "animFadeOut" for end animation, default "animDropUp"
|
|
29
|
+
animationDuration: 500, // anim duration in ms, default "500"
|
|
30
|
+
beforeShow: () => {console.log("before show");}, // callback before show modal
|
|
31
|
+
afterShow: () => {console.log("after show");}, // callback after destroy modal
|
|
32
|
+
beforeDestroy: () => {console.log("before destroy");}, // callback before destroy modal
|
|
33
|
+
afterDestroy: () => {console.log("after destroy");}, // callback after destroy modal
|
|
34
|
+
onCancelButton: () => {console.log("on cancel button");}, // callback after trigger cancel button
|
|
35
|
+
onConfirmButton: () => {console.log("on confirm button");}, // callback after trigger confirm button
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const myModal2 = new WebcimesModal({
|
|
39
|
+
titleHtml: "My title", // html for title, default "null"
|
|
40
|
+
bodyHtml: document.querySelector(".test").outerHTML, // html for body, default "null"
|
|
41
|
+
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
42
|
+
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
43
|
+
closeOnConfirmButton: false, // close the modal after trigger confirm button, default "true"
|
|
44
|
+
afterShow: () => {console.log(myModal2.webcimesModals); console.log(myModal2.modal);}, // callback before show modal
|
|
45
|
+
onConfirmButton: () => {myModal2.destroy();}, // callback after trigger confirm button
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
// Wait for dom content loaded
|
|
3
|
+
document.addEventListener("DOMContentLoaded", function()
|
|
4
|
+
{
|
|
5
|
+
const myModal = new WebcimesModal({
|
|
6
|
+
setId: null, // set specific id to the modal, default "null"
|
|
7
|
+
setClass: null, // set specific class to the modal, default "null"
|
|
8
|
+
width: 'auto', // width (specify the unit), default "auto"
|
|
9
|
+
height: 'auto', // height (specify the unit), default "auto"
|
|
10
|
+
titleHtml: "My title", // html for title, default "null"
|
|
11
|
+
bodyHtml: "My Body", // html for body, default "null"
|
|
12
|
+
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
13
|
+
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
14
|
+
closeOnCancelButton: true, // close the modal after trigger cancel button, default "true"
|
|
15
|
+
closeOnConfirmButton: true, // close the modal after trigger confirm button, default "true"
|
|
16
|
+
showCloseButton: true, // show the close button, default "true"
|
|
17
|
+
allowCloseOutside: false, // allow to close modal when click outside, default "true"
|
|
18
|
+
allowMovement: true, // possibility to move the modal, default "true"
|
|
19
|
+
moveFromHeader: true, // if allowMovement is set to "true", ability to move modal from header, default "true"
|
|
20
|
+
moveFromBody: false, // if allowMovement is set to "true", ability to move modal from body, default "false"
|
|
21
|
+
moveFromFooter: true, // if allowMovement is set to "true", ability to move modal from footer, default "true"
|
|
22
|
+
stickyHeader: true, // keep sticky (visible) the header when scrolling, default "true"
|
|
23
|
+
stickyFooter: true, // keep sticky (visible) the footer when scrolling, default "true"
|
|
24
|
+
style: null, // add extra style css to the modal, default null
|
|
25
|
+
animationOnShow: 'animDropDown', // "animDropDown" or "animFadeIn" for enter animation, default "animDropDown"
|
|
26
|
+
animationOnDestroy: 'animDropUp', // "animDropUp" or "animFadeOut" for end animation, default "animDropUp"
|
|
27
|
+
animationDuration: 500, // anim duration in ms, default "500"
|
|
28
|
+
beforeShow: () => {console.log("before show");}, // callback before show modal
|
|
29
|
+
afterShow: () => {console.log("after show");}, // callback after destroy modal
|
|
30
|
+
beforeDestroy: () => {console.log("before destroy");}, // callback before destroy modal
|
|
31
|
+
afterDestroy: () => {console.log("after destroy");}, // callback after destroy modal
|
|
32
|
+
onCancelButton: () => {console.log("on cancel button");}, // callback after trigger cancel button
|
|
33
|
+
onConfirmButton: () => {console.log("on confirm button");}, // callback after trigger confirm button
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const myModal2 = new WebcimesModal({
|
|
37
|
+
titleHtml: "My title", // html for title, default "null"
|
|
38
|
+
bodyHtml: document.querySelector(".test").outerHTML, // html for body, default "null"
|
|
39
|
+
buttonCancelHtml: "Cancel", // html for cancel button, default "null"
|
|
40
|
+
buttonConfirmHtml: "Confirm", // html for confirm button, default "null"
|
|
41
|
+
closeOnConfirmButton: false, // close the modal after trigger confirm button, default "true"
|
|
42
|
+
afterShow: () => {console.log(myModal2.webcimesModals); console.log(myModal2.modal);}, // callback before show modal
|
|
43
|
+
onConfirmButton: () => {myModal2.destroy();}, // callback after trigger confirm button
|
|
44
|
+
});
|
|
45
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcimes-modal",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Simply create and animate modals. It works with vanilla javascript + html + css.",
|
|
5
5
|
"main": "./dist/js/webcimes-modal.udm.js",
|
|
6
6
|
"module": "./dist/js/webcimes-modal.esm.js",
|
|
@@ -31,12 +31,11 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"css-loader": "^6.8.1",
|
|
33
33
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
34
|
+
"filemanager-webpack-plugin": "^8.0.0",
|
|
34
35
|
"mini-css-extract-plugin": "^2.7.6",
|
|
35
|
-
"remove-files-webpack-plugin": "^1.5.0",
|
|
36
36
|
"ts-loader": "^9.4.4",
|
|
37
37
|
"ts-node": "^10.9.1",
|
|
38
38
|
"typescript": "^5.2.2",
|
|
39
|
-
"typescript-declaration-webpack-plugin": "^0.3.0",
|
|
40
39
|
"webpack": "^5.88.2",
|
|
41
40
|
"webpack-cli": "^5.1.4"
|
|
42
41
|
}
|
package/test/test.html
CHANGED
|
@@ -7,13 +7,6 @@
|
|
|
7
7
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
8
8
|
<title>Demo webcimes-modal ESM</title>
|
|
9
9
|
<link rel="stylesheet" href="../dist/css/webcimes-modal.css">
|
|
10
|
-
<script type="importmap">
|
|
11
|
-
{
|
|
12
|
-
"imports": {
|
|
13
|
-
"webcimes-modal": "../dist/js/webcimes-modal.esm.js"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
10
|
<script type="module" src="script.js"></script>
|
|
18
11
|
</head>
|
|
19
12
|
<body>
|
package/webpack.config.ts
CHANGED
|
@@ -3,8 +3,7 @@ import webpack from "webpack";
|
|
|
3
3
|
import TerserPlugin from "terser-webpack-plugin";
|
|
4
4
|
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
5
5
|
import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
|
|
6
|
-
import
|
|
7
|
-
import TypescriptDeclarationPlugin from "typescript-declaration-webpack-plugin";
|
|
6
|
+
import FileManagerPlugin from "filemanager-webpack-plugin";
|
|
8
7
|
// const isProduction = process.env.NODE_ENV == "production";
|
|
9
8
|
|
|
10
9
|
// Config UDM
|
|
@@ -38,10 +37,15 @@ const configUDM: webpack.Configuration = {
|
|
|
38
37
|
],
|
|
39
38
|
},
|
|
40
39
|
plugins: [
|
|
41
|
-
new
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
new FileManagerPlugin({
|
|
41
|
+
events: {
|
|
42
|
+
onEnd: {
|
|
43
|
+
copy: [
|
|
44
|
+
{ source: "./src/ts/webcimes-modal.d.ts", destination: './dist/js/webcimes-modal.udm.d.ts' },
|
|
45
|
+
],
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
},
|
|
45
49
|
}),
|
|
46
50
|
],
|
|
47
51
|
};
|
|
@@ -80,10 +84,15 @@ const configESM: webpack.Configuration = {
|
|
|
80
84
|
],
|
|
81
85
|
},
|
|
82
86
|
plugins: [
|
|
83
|
-
new
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
new FileManagerPlugin({
|
|
88
|
+
events: {
|
|
89
|
+
onEnd: {
|
|
90
|
+
copy: [
|
|
91
|
+
{ source: "./src/ts/webcimes-modal.d.ts", destination: './dist/js/webcimes-modal.esm.d.ts' },
|
|
92
|
+
],
|
|
93
|
+
|
|
94
|
+
},
|
|
95
|
+
},
|
|
87
96
|
}),
|
|
88
97
|
],
|
|
89
98
|
};
|
|
@@ -126,22 +135,20 @@ const configCSS: webpack.Configuration = {
|
|
|
126
135
|
},
|
|
127
136
|
plugins: [
|
|
128
137
|
new MiniCssExtractPlugin({filename: "css/[name].css"}),
|
|
129
|
-
new
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
new FileManagerPlugin({
|
|
139
|
+
events: {
|
|
140
|
+
onStart: {
|
|
141
|
+
delete: [
|
|
142
|
+
"./dist",
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
onEnd: {
|
|
146
|
+
delete: [
|
|
147
|
+
"./dist/css/webcimes-modal.js",
|
|
148
|
+
"./dist/css/webcimes-modal.js.map",
|
|
149
|
+
],
|
|
150
|
+
}
|
|
134
151
|
},
|
|
135
|
-
after: {
|
|
136
|
-
test: [
|
|
137
|
-
{
|
|
138
|
-
folder: './dist/css',
|
|
139
|
-
method: (absoluteItemPath) => {
|
|
140
|
-
return new RegExp(/(\.js|\.js\.map)$/, 'm').test(absoluteItemPath); // Delete extra empty js file (can't ouput directly css)
|
|
141
|
-
},
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
}
|
|
145
152
|
}),
|
|
146
153
|
],
|
|
147
154
|
};
|