@lemonadejs/contextmenu 1.1.2 → 1.1.3

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/README.md CHANGED
@@ -69,6 +69,79 @@ export default function App() {
69
69
  }
70
70
  ```
71
71
 
72
+ Quick example with React
73
+
74
+ ```jsx
75
+ import React, { useRef } from 'react';
76
+ import Contextmenu from '@lemonadejs/contextmenu/dist/react';
77
+ import '@lemonadejs/contextmenu/dist/style.css';
78
+ import '@lemonadejs/modal/dist/style.css';
79
+
80
+ const options = [
81
+ {
82
+ title: 'Console.log',
83
+ onclick: function () {
84
+ console.log('Hello!')
85
+ },
86
+ },
87
+ {
88
+ title: 'Show Alert',
89
+ onclick: function () {
90
+ alert('Hello!')
91
+ },
92
+ },
93
+ ];
94
+ export default function App() {
95
+ const contextmenu = useRef();
96
+
97
+ return (
98
+ <div style={{ backgroundColor: '#2222AA', width: '100px', height: '100px' }}>
99
+ <Contextmenu options={options} ref={contextmenu} />
100
+ </div>);
101
+ }
102
+ ```
103
+
104
+ Quick example with Vue
105
+
106
+ ```vue
107
+ <template>
108
+ <div style="background-color: #2222AA; width: 100px; height: 100px;">
109
+ <Contextmenu :options="options" />
110
+ </div>
111
+ </template>
112
+
113
+ <script>
114
+ import Contextmenu from '@lemonadejs/contextmenu/dist/vue'
115
+ import '@lemonadejs/contextmenu/dist/style.css';
116
+ import '@lemonadejs/modal/dist/style.css';
117
+
118
+ export default {
119
+ name: 'App',
120
+ components: {
121
+ Contextmenu
122
+ },
123
+ data() {
124
+ return {
125
+ options: [
126
+ {
127
+ title: 'Console.log',
128
+ onclick:function() {
129
+ console.log('Hello!')
130
+ },
131
+ },
132
+ {
133
+ title: 'Show Alert',
134
+ onclick:function() {
135
+ alert('Hello!')
136
+ },
137
+ },
138
+ ]
139
+ }
140
+ }
141
+ }
142
+ </script>
143
+ ```
144
+
72
145
  ### Properties
73
146
 
74
147
  | Property | Type | Description |
@@ -94,5 +167,5 @@ The [LemonadeJS](https://lemonadejs.net) Context Menu is released under the MIT.
94
167
 
95
168
  ## Other Tools
96
169
 
97
- - [jSuites](https://jsuites.net/v4/)
170
+ - [jSuites](https://jsuites.net/docs)
98
171
  - [Jspreadsheet Data Grid](https://jspreadsheet.com)
package/dist/index.js CHANGED
@@ -302,14 +302,14 @@ if (! Modal && typeof (require) === 'function') {
302
302
  if (modal.closed === false) {
303
303
  // Close modals with higher level
304
304
  self.close(1);
305
- // Define new position
306
- modal.top = y;
307
- modal.left = x;
308
305
  // Update the data
309
306
  if (modal.options !== options) {
310
307
  // Refresh content
311
308
  modal.options = options;
312
309
  }
310
+ // Define new position
311
+ modal.top = y;
312
+ modal.left = x;
313
313
  onopen(self, options);
314
314
  }
315
315
  }
package/dist/style.css CHANGED
@@ -1,7 +1,7 @@
1
1
  .lm-menu .lm-modal {
2
2
  color: #555;
3
3
  user-select: none;
4
- border: 1px solid transparent;
4
+ border: 1px solid var(--lm-border-color-light, #e9e9e9);
5
5
  border-radius: 4px;
6
6
  box-shadow: 0 2px 6px 2px rgba(60,64,67,.2);
7
7
  max-height: 300px;
@@ -9,6 +9,8 @@
9
9
  height: initial;
10
10
  min-width: 250px;
11
11
  min-height: initial;
12
+ padding-top: 4px;
13
+ padding-bottom: 4px;
12
14
  }
13
15
 
14
16
  .lm-menu-submenu {
@@ -50,11 +52,11 @@
50
52
 
51
53
  .lm-menu-submenu > div.lm-menu-item:hover,
52
54
  .lm-menu-submenu > div.lm-menu-item[data-cursor="true"] {
53
- background: #ebebeb;
55
+ background-color: var(--lm-background-color-hover, #ebebeb);
54
56
  }
55
57
 
56
58
  .lm-menu-submenu hr {
57
- border: 1px solid #e9e9e9;
59
+ border: 1px solid var(--lm-border-color-light, #e9e9e9);
58
60
  border-bottom: 0;
59
61
  margin-top:5px;
60
62
  margin-bottom:5px;
@@ -67,4 +69,5 @@
67
69
  line-height: 24px;
68
70
  margin-right: 10px;
69
71
  width: 16px;
72
+ color: var(--lm-icon-color, #777);
70
73
  }
package/package.json CHANGED
@@ -14,10 +14,10 @@
14
14
  "build": "webpack --config webpack.config.js"
15
15
  },
16
16
  "dependencies": {
17
- "@lemonadejs/modal": "^2.7.1",
18
- "lemonadejs": "^4.0.7"
17
+ "@lemonadejs/modal": "^2.8.1",
18
+ "lemonadejs": "^4.2.2"
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "types": "dist/index.d.ts",
22
- "version": "1.1.2"
22
+ "version": "1.1.3"
23
23
  }