@operato/board 1.4.39 → 1.4.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/board",
3
- "version": "1.4.39",
3
+ "version": "1.4.41",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -148,5 +148,5 @@
148
148
  "prettier --write"
149
149
  ]
150
150
  },
151
- "gitHead": "e2c0291a2c1050d911df43414b4eefc7cd939157"
151
+ "gitHead": "f08abc45b71c195fb3b8e4db2d001acc8f7fe40a"
152
152
  }
@@ -5,8 +5,9 @@
5
5
  import '@operato/input/ox-input-data.js'
6
6
  import '@operato/i18n/ox-i18n.js'
7
7
 
8
- import { html, LitElement } from 'lit'
8
+ import { css, html, LitElement } from 'lit'
9
9
  import { property } from 'lit/decorators.js'
10
+ import { ifDefined } from 'lit/directives/if-defined.js'
10
11
 
11
12
  import { Properties, Scene } from '@hatiolab/things-scene'
12
13
 
@@ -14,7 +15,50 @@ import { EffectsSharedStyle } from './effects-shared-style.js'
14
15
  import { convert } from './value-converter'
15
16
 
16
17
  export class PropertyEventHover extends LitElement {
17
- static styles = [EffectsSharedStyle]
18
+ static styles = [
19
+ EffectsSharedStyle,
20
+ css`
21
+ datalist option.cursor-auto {
22
+ cursor: auto;
23
+ }
24
+
25
+ datalist option.cursor-pointer {
26
+ cursor: pointer;
27
+ }
28
+
29
+ datalist option.cursor-default {
30
+ cursor: default;
31
+ }
32
+
33
+ datalist option.cursor-move {
34
+ cursor: move;
35
+ }
36
+
37
+ datalist option.cursor-text {
38
+ cursor: text;
39
+ }
40
+
41
+ datalist option.cursor-wait {
42
+ cursor: wait;
43
+ }
44
+
45
+ datalist option.cursor-help {
46
+ cursor: help;
47
+ }
48
+
49
+ datalist option.cursor-crosshair {
50
+ cursor: crosshair;
51
+ }
52
+
53
+ datalist option.cursor-not-allowed {
54
+ cursor: not-allowed;
55
+ }
56
+
57
+ datalist option.cursor-grab {
58
+ cursor: grab;
59
+ }
60
+ `
61
+ ]
18
62
 
19
63
  @property({ type: Object }) value?: Properties
20
64
  @property({ type: Object }) scene?: Scene
@@ -36,11 +80,12 @@ export class PropertyEventHover extends LitElement {
36
80
  <select id="tap-select" value-key="action" .value=${action || ''}>
37
81
  <option value=""></option>
38
82
  <option value="popup">popup target board</option>
39
- <option value="infoWindow">open infowindow</option>
83
+ <option value="info-window">open infowindow</option>
40
84
  <option value="data-toggle">toggle(true/false) target component data</option>
41
85
  <option value="data-tristate">tristate(0/1/2) target component data</option>
42
86
  <option value="data-set">set value to target component data</option>
43
87
  <option value="value-set">set value to target component value</option>
88
+ <option value="mouse-cursor">change mouse cursor to target style</option>
44
89
  </select>
45
90
 
46
91
  <label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
@@ -59,7 +104,8 @@ export class PropertyEventHover extends LitElement {
59
104
 
60
105
  <datalist id="target-list">
61
106
  ${this._getTargetList(action).map(
62
- ({ value, description }) => html` <option .value=${value}>${description}</option> `
107
+ ({ value, description, class: clazz }) =>
108
+ html` <option .value=${value} class=${ifDefined(clazz)}>${description}</option> `
63
109
  )}
64
110
  </datalist>
65
111
  `}
@@ -90,7 +136,7 @@ export class PropertyEventHover extends LitElement {
90
136
  }
91
137
  }
92
138
 
93
- _getTargetList(action: string): { value: string; description: string }[] {
139
+ _getTargetList(action: string): { value: string; description?: string; class?: string }[] {
94
140
  switch (action) {
95
141
  case 'data-toggle':
96
142
  case 'data-tristate':
@@ -105,7 +151,8 @@ export class PropertyEventHover extends LitElement {
105
151
  []
106
152
  ids.unshift({ value: '(self)', description: 'self component' })
107
153
  return ids
108
- case 'infoWindow':
154
+
155
+ case 'info-window':
109
156
  return (
110
157
  (this.scene &&
111
158
  this.scene.ids
@@ -118,6 +165,14 @@ export class PropertyEventHover extends LitElement {
118
165
  })) ||
119
166
  []
120
167
  )
168
+
169
+ case 'mouse-cursor':
170
+ return ['auto', 'pointer', 'default', 'move', 'text', 'wait', 'help', 'crosshair', 'not-allowed', 'grab'].map(
171
+ style => {
172
+ return { value: style, class: `cursor-${style}` }
173
+ }
174
+ )
175
+
121
176
  default:
122
177
  return []
123
178
  }