@lemonadejs/modal 2.4.9 → 2.5.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/react.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- /**
2
- * Official Type definitions for Jspreadsheet React
3
- * https://jspreadsheet.com/v10/docs/react
4
- * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
- */
6
-
7
-
8
- import ModalComponent from './index';
9
-
10
- interface Modal {
11
- (): any
12
- [key: string]: any
13
- }
14
-
15
- declare function Modal<Modal>(props: ModalComponent.Options): any;
16
-
17
- export default Modal;
1
+ /**
2
+ * Official Type definitions for Jspreadsheet React
3
+ * https://jspreadsheet.com/v10/docs/react
4
+ * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ */
6
+
7
+
8
+ import ModalComponent from './index';
9
+
10
+ interface Modal {
11
+ (): any
12
+ [key: string]: any
13
+ }
14
+
15
+ declare function Modal<Modal>(props: ModalComponent.Options): any;
16
+
17
+ export default Modal;
package/dist/react.js CHANGED
@@ -1,37 +1,37 @@
1
- import React, { useRef, useEffect } from "react";
2
- import { renderToStaticMarkup } from 'react-dom/server';
3
- import Component from './index';
4
-
5
-
6
- export default React.forwardRef((props, mainReference) => {
7
- // Dom element
8
- const Ref = useRef(null);
9
-
10
- const template = renderToStaticMarkup(props.children)
11
-
12
- // Get the properties for the spreadsheet
13
- let options = { ...props };
14
-
15
- useEffect(() => {
16
- if (!Ref.current.innerHTML) {
17
- mainReference.current = Component(Ref.current, options, template);
18
- }
19
- }, []);
20
-
21
- useEffect(() => {
22
- for (let key in props) {
23
- if (props.hasOwnProperty(key) && mainReference.current.hasOwnProperty(key)) {
24
- if (props[key] !== mainReference.current[key]) {
25
- mainReference.current[key] = props[key];
26
- }
27
- }
28
- }
29
- }, [props])
30
-
31
- let prop = {
32
- ref: Ref,
33
- style: { height: '100%', width: '100%' }
34
- };
35
-
36
- return React.createElement("div", prop);
1
+ import React, { useRef, useEffect } from "react";
2
+ import { renderToStaticMarkup } from 'react-dom/server';
3
+ import Component from './index';
4
+
5
+
6
+ export default React.forwardRef((props, mainReference) => {
7
+ // Dom element
8
+ const Ref = useRef(null);
9
+
10
+ const template = renderToStaticMarkup(props.children)
11
+
12
+ // Get the properties for the spreadsheet
13
+ let options = { ...props };
14
+
15
+ useEffect(() => {
16
+ if (!Ref.current.innerHTML) {
17
+ mainReference.current = Component(Ref.current, options, template);
18
+ }
19
+ }, []);
20
+
21
+ useEffect(() => {
22
+ for (let key in props) {
23
+ if (props.hasOwnProperty(key) && mainReference.current.hasOwnProperty(key)) {
24
+ if (props[key] !== mainReference.current[key]) {
25
+ mainReference.current[key] = props[key];
26
+ }
27
+ }
28
+ }
29
+ }, [props])
30
+
31
+ let prop = {
32
+ ref: Ref,
33
+ style: { height: '100%', width: '100%' }
34
+ };
35
+
36
+ return React.createElement("div", prop);
37
37
  })
package/dist/style.css CHANGED
@@ -1,166 +1,173 @@
1
- .lm-modal {
2
- position: fixed;
3
- min-width: 300px;
4
- min-height: 240px;
5
- border-radius: 5px;
6
- z-index: 15;
7
- background-color: #fff;
8
- box-sizing: border-box;
9
- box-shadow: 0 0 12px rgb(0 0 0 / 22%);
10
- opacity: 1;
11
- transition: opacity 0.5s ease;
12
- will-change: transform;
13
- border: 1px solid #bbb;
14
- outline: none;
15
- margin: 0;
16
- display: flex;
17
- flex-direction: column;
18
- }
19
-
20
- .lm-modal-title {
21
- width: 100%;
22
- border-bottom: 1px solid #e9e9e9;
23
- padding: 10px;
24
- box-sizing: border-box;
25
- font-size: 1.2em;
26
- line-height: 24px;
27
- position: sticky;
28
- top: 0;
29
- background: #fff;
30
- user-select: none;
31
- display: flex;
32
- border-radius: 5px;
33
- }
34
-
35
- .lm-modal-title:empty {
36
- display: none;
37
- }
38
-
39
- .lm-modal-title[data-icon]::before {
40
- content: attr(data-icon);
41
- width: 24px;
42
- height: 24px;
43
- font-size: 24px;
44
- font-family: "Material Icons";
45
- margin-right: 5px;
46
- }
47
-
48
- .lm-modal[closable="true"]::after {
49
- content: 'close';
50
- width: 24px;
51
- height: 24px;
52
- font-size: 24px;
53
- font-family: "Material Icons";
54
- position: absolute;
55
- top: 10px;
56
- right: 10px;
57
- cursor: pointer;
58
- }
59
-
60
- .lm-modal[minimizable="true"] .lm-modal-title::after {
61
- content: '\2500';
62
- width: 24px;
63
- height: 24px;
64
- font-size: 24px;
65
- font-family: "Material Icons";
66
- }
67
-
68
- .lm-modal[closed="true"] {
69
- display: none !important;
70
- }
71
-
72
- .lm-modal[minimized="true"] {
73
- bottom: 0;
74
- top: initial !important;
75
- left: initial !important;
76
- width: 200px !important;
77
- height: 45px !important;
78
- min-width: initial;
79
- min-height: initial;
80
- overflow: hidden;
81
- transition: margin 0.2s ease-in-out;
82
- }
83
-
84
- .lm-modal[minimized="true"]::after {
85
- content: 'open_in_full';
86
- }
87
-
88
- @keyframes slide-bottom-in {
89
- 0% { transform: translateY(100%); }
90
- 100% { transform: translateY(0%); }
91
- }
92
-
93
- .lm-modal.hide {
94
- opacity: 0;
95
- }
96
-
97
- .lm-modal-layers:focus {
98
- z-index: 999;
99
- }
100
-
101
- .lm-modal-animation {
102
- transform: none;
103
- animation: slide-bottom-in 0.4s forwards;
104
- }
105
-
106
- .lm-modal[data-responsive].fullscreen {
107
- top: 0;
108
- height: 100% !important;
109
- }
110
-
111
- .lm-modal.moving {
112
- cursor: move !important;
113
- }
114
-
115
- .lm-modal-backdrop {
116
- position: fixed;
117
- top: 0;
118
- left: 0;
119
- width: 100vw;
120
- height: 100vh;
121
- background-color: #00000020;
122
- z-index: 999;
123
- }
124
-
125
- .lm-modal > div:last-child {
126
- width: 100%;
127
- height: 100%;
128
- }
129
-
130
- .lm-modal[overflow="true"] > div:last-child {
131
- overflow: auto;
132
- scrollbar-width: thin;
133
- scrollbar-color: #333 transparent;
134
- }
135
-
136
- .lm-modal > div:last-child::-webkit-scrollbar {
137
- width: 12px;
138
- height: 12px;
139
- }
140
-
141
- .lm-modal > div:last-child::-webkit-scrollbar-track {
142
- background: #eee;
143
- }
144
-
145
- .lm-modal > div:last-child::-webkit-scrollbar-thumb {
146
- background: #888;
147
- }
148
-
149
- .lm-modal[position="left"] {
150
- top: 0;
151
- left: 0;
152
- width: 280px;
153
- height: 100vh;
154
- border-width: 0;
155
- border-radius: initial;
156
- }
157
-
158
- .lm-modal[position="right"] {
159
- top: 0;
160
- left: initial;
161
- right: 0;
162
- width: 280px;
163
- height: 100vh;
164
- border-width: 0;
165
- border-radius: initial;
1
+ .lm-modal {
2
+ position: fixed;
3
+ min-width: 300px;
4
+ min-height: 240px;
5
+ border-radius: 5px;
6
+ z-index: 15;
7
+ background-color: #fff;
8
+ box-sizing: border-box;
9
+ box-shadow: 0 0 12px rgb(0 0 0 / 22%);
10
+ opacity: 1;
11
+ will-change: transform;
12
+ border: 1px solid #bbb;
13
+ outline: none;
14
+ margin: 0;
15
+ display: flex;
16
+ flex-direction: column;
17
+ transition: opacity 0.4s ease, top 0.4s ease, left 0.4s ease, width 0.4s ease, height 0.4s ease;
18
+ }
19
+
20
+ .lm-modal-title {
21
+ width: 100%;
22
+ border-bottom: 1px solid #e9e9e9;
23
+ padding: 10px;
24
+ box-sizing: border-box;
25
+ font-size: 1.2em;
26
+ line-height: 24px;
27
+ background: #fff;
28
+ user-select: none;
29
+ display: flex;
30
+ border-radius: 5px;
31
+ }
32
+
33
+ .lm-modal-title:empty {
34
+ display: none;
35
+ }
36
+
37
+ .lm-modal-title[data-icon]::before {
38
+ content: attr(data-icon);
39
+ width: 24px;
40
+ height: 24px;
41
+ font-size: 24px;
42
+ font-family: "Material Icons";
43
+ margin-right: 5px;
44
+ }
45
+
46
+ .lm-modal[closable="true"]::after {
47
+ content: 'close';
48
+ width: 24px;
49
+ height: 24px;
50
+ font-size: 24px;
51
+ font-family: "Material Icons";
52
+ position: absolute;
53
+ top: 10px;
54
+ right: 10px;
55
+ cursor: pointer;
56
+ }
57
+
58
+ .lm-modal[minimizable="true"]::before {
59
+ content: '\2500';
60
+ width: 24px;
61
+ height: 24px;
62
+ font-size: 24px;
63
+ font-family: "Material Icons";
64
+ position: absolute;
65
+ top: 10px;
66
+ right: 15px;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .lm-modal[closable="true"].lm-modal[minimizable="true"]::before {
71
+ right: 35px;
72
+ }
73
+
74
+ .lm-modal[closed="true"] {
75
+ display: none !important;
76
+ }
77
+
78
+ .lm-modal[minimized="true"]:before {
79
+ content: '\e5d7';
80
+ }
81
+
82
+ .lm-modal.hide {
83
+ opacity: 0;
84
+ }
85
+
86
+ .lm-modal-layers:focus {
87
+ z-index: 999;
88
+ }
89
+
90
+ .lm-modal[data-responsive].fullscreen {
91
+ top: 0;
92
+ height: 100% !important;
93
+ }
94
+
95
+ .lm-modal.moving {
96
+ cursor: move !important;
97
+ transition: initial;
98
+ }
99
+
100
+ .lm-modal.resizing {
101
+ transition: initial;
102
+ }
103
+
104
+ .lm-modal-backdrop {
105
+ position: fixed;
106
+ top: 0;
107
+ left: 0;
108
+ width: 100vw;
109
+ height: 100vh;
110
+ background-color: #00000020;
111
+ z-index: 999;
112
+ }
113
+
114
+ .lm-modal > div:last-child {
115
+ width: 100%;
116
+ height: 100%;
117
+ }
118
+
119
+ .lm-modal[overflow="true"] > div:last-child {
120
+ overflow: auto;
121
+ scrollbar-width: thin;
122
+ scrollbar-color: #333 transparent;
123
+ }
124
+
125
+ .lm-modal > div:last-child::-webkit-scrollbar {
126
+ width: 12px;
127
+ height: 12px;
128
+ }
129
+
130
+ .lm-modal > div:last-child::-webkit-scrollbar-track {
131
+ background: #eee;
132
+ }
133
+
134
+ .lm-modal > div:last-child::-webkit-scrollbar-thumb {
135
+ background: #888;
136
+ }
137
+
138
+ .lm-modal[position="left"] {
139
+ top: 0;
140
+ left: 0;
141
+ width: 280px;
142
+ height: 100vh !important;
143
+ border-width: 0;
144
+ border-radius: initial;
145
+ }
146
+
147
+ .lm-modal[position="right"] {
148
+ top: 0;
149
+ left: auto;
150
+ right: 0;
151
+ width: 280px;
152
+ height: 100vh !important;
153
+ border-width: 0;
154
+ border-radius: initial;
155
+ }
156
+
157
+ .lm-modal[position="bottom"] {
158
+ top: auto;
159
+ left: 0;
160
+ bottom: 0;
161
+ width: 100vw !important;
162
+ height: 280px;
163
+ border-width: 0;
164
+ border-radius: initial;
165
+ }
166
+
167
+ .lm-modal[minimized="true"] {
168
+ width: 200px !important;
169
+ height: 45px !important;
170
+ min-width: initial;
171
+ min-height: initial;
172
+ overflow: hidden;
166
173
  }
package/dist/vue.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- /**
2
- * Official Type definitions for the LemonadeJS plugins
3
- * https://lemonadejs.net
4
- * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
- */
6
- import Component from './index';
7
-
8
- interface Modal {
9
- (): any
10
- [key: string]: any
11
- }
12
-
13
- declare function Modal<Modal>(props: Component.Options): any;
14
-
1
+ /**
2
+ * Official Type definitions for the LemonadeJS plugins
3
+ * https://lemonadejs.net
4
+ * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ */
6
+ import Component from './index';
7
+
8
+ interface Modal {
9
+ (): any
10
+ [key: string]: any
11
+ }
12
+
13
+ declare function Modal<Modal>(props: Component.Options): any;
14
+
15
15
  export default Modal;
package/dist/vue.js CHANGED
@@ -1,53 +1,53 @@
1
- import { h } from 'vue';
2
- import component from "./index.js";
3
-
4
- export const Modal = {
5
- inheritAttrs: false,
6
- mounted() {
7
- let options = {
8
- ...this.$attrs
9
- };
10
-
11
- this.el = this.$refs.container;
12
-
13
- this.current = component(this.$refs.container, options);
14
- },
15
- setup(_, context) {
16
- let containerProps = {
17
- ref: 'container',
18
- style: {
19
- width: '100%',
20
- height: '100%',
21
- }
22
- };
23
-
24
- let vnode = [];
25
-
26
- if (context.slots.default && typeof(context.slots.default) === 'function') {
27
- vnode = context.slots.default()
28
- }
29
-
30
- return () => h('div', containerProps, vnode);
31
- },
32
- watch: {
33
- $attrs: {
34
- deep: true,
35
- handler() {
36
- this.updateState();
37
- }
38
- }
39
- },
40
- methods: {
41
- updateState() {
42
- for (let key in this.$attrs) {
43
- if (this.$attrs.hasOwnProperty(key) && this.current.hasOwnProperty(key)) {
44
- if (this.$attrs[key] !== this.current[key]) {
45
- this.current[key] = this.$attrs[key];
46
- }
47
- }
48
- }
49
- }
50
- }
51
- };
52
-
1
+ import { h } from 'vue';
2
+ import component from "./index.js";
3
+
4
+ export const Modal = {
5
+ inheritAttrs: false,
6
+ mounted() {
7
+ let options = {
8
+ ...this.$attrs
9
+ };
10
+
11
+ this.el = this.$refs.container;
12
+
13
+ this.current = component(this.$refs.container, options);
14
+ },
15
+ setup(_, context) {
16
+ let containerProps = {
17
+ ref: 'container',
18
+ style: {
19
+ width: '100%',
20
+ height: '100%',
21
+ }
22
+ };
23
+
24
+ let vnode = [];
25
+
26
+ if (context.slots.default && typeof(context.slots.default) === 'function') {
27
+ vnode = context.slots.default()
28
+ }
29
+
30
+ return () => h('div', containerProps, vnode);
31
+ },
32
+ watch: {
33
+ $attrs: {
34
+ deep: true,
35
+ handler() {
36
+ this.updateState();
37
+ }
38
+ }
39
+ },
40
+ methods: {
41
+ updateState() {
42
+ for (let key in this.$attrs) {
43
+ if (this.$attrs.hasOwnProperty(key) && this.current.hasOwnProperty(key)) {
44
+ if (this.$attrs[key] !== this.current[key]) {
45
+ this.current[key] = this.$attrs[key];
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ };
52
+
53
53
  export default Modal;
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "name": "@lemonadejs/modal",
3
- "title": "JavaScript Modal",
4
- "description": "LemonadeJS modal is a JavaScript component to create floating modals.",
5
- "author": {
6
- "name": "Contact <contact@lemonadejs.net>",
7
- "url": "https://lemonadejs.net"
8
- },
9
- "keywords": [
10
- "javascript modal",
11
- "lemonadejs modal",
12
- "js modal",
13
- "modal js"
14
- ],
15
- "dependencies": {
16
- "lemonadejs": "^4.0.7"
17
- },
18
- "main": "dist/index.js",
19
- "types": "dist/index.d.ts",
20
- "version": "2.4.9"
21
- }
1
+ {
2
+ "name": "@lemonadejs/modal",
3
+ "title": "JavaScript Modal",
4
+ "description": "LemonadeJS modal is a JavaScript component to create floating modals.",
5
+ "author": {
6
+ "name": "Contact <contact@lemonadejs.net>",
7
+ "url": "https://lemonadejs.net"
8
+ },
9
+ "keywords": [
10
+ "javascript modal",
11
+ "lemonadejs modal",
12
+ "js modal",
13
+ "modal js"
14
+ ],
15
+ "dependencies": {
16
+ "lemonadejs": "^4.0.7"
17
+ },
18
+ "main": "dist/index.js",
19
+ "types": "dist/index.d.ts",
20
+ "version": "2.5.0"
21
+ }