@operato/board 1.2.24 → 1.2.25

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.2.24",
3
+ "version": "1.2.25",
4
4
  "description": "Webcomponent for board following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -87,16 +87,16 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@open-wc/scoped-elements": "^2.0.0-next.6",
90
- "@operato/app": "^1.2.24",
91
- "@operato/data-grist": "^1.2.17",
92
- "@operato/font": "^1.2.24",
90
+ "@operato/app": "^1.2.25",
91
+ "@operato/data-grist": "^1.2.25",
92
+ "@operato/font": "^1.2.25",
93
93
  "@operato/graphql": "^1.2.6",
94
94
  "@operato/i18n": "^1.2.0",
95
- "@operato/input": "^1.2.11",
95
+ "@operato/input": "^1.2.25",
96
96
  "@operato/layout": "^1.2.16",
97
97
  "@operato/markdown": "^1.2.0",
98
98
  "@operato/popup": "^1.2.11",
99
- "@operato/property-editor": "^1.2.24",
99
+ "@operato/property-editor": "^1.2.25",
100
100
  "@operato/styles": "^1.2.0",
101
101
  "@operato/utils": "^1.2.11",
102
102
  "@polymer/paper-dropdown-menu": "^3.2.0",
@@ -147,5 +147,5 @@
147
147
  "prettier --write"
148
148
  ]
149
149
  },
150
- "gitHead": "711e61fd82f4a112dc11091970bf2aeb0430bd85"
150
+ "gitHead": "73998868ecf0925a0691da776f8fd6df40e7a554"
151
151
  }
@@ -2,12 +2,12 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
 
5
- import '@operato/input/ox-input-value-map.js'
6
- import '@operato/input/ox-input-value-ranges.js'
7
5
  import '@operato/input/ox-buttons-radio.js'
8
6
  import '@operato/input/ox-input-code.js'
9
7
  import '@operato/i18n/ox-i18n.js'
10
8
  import '@operato/help/ox-help-icon.js'
9
+ import './data-binding-value-map.js'
10
+ import './data-binding-value-range.js'
11
11
 
12
12
  import { css, html, LitElement, PropertyValues } from 'lit'
13
13
  import { property, query, state } from 'lit/decorators.js'
@@ -170,7 +170,7 @@ export class DataBindingMapper extends LitElement {
170
170
  fontColor: 'color',
171
171
 
172
172
  data: 'object',
173
- source: 'object',
173
+ source: 'attachment',
174
174
  location: 'object',
175
175
  dimension: 'object',
176
176
 
@@ -196,7 +196,9 @@ export class DataBindingMapper extends LitElement {
196
196
  }
197
197
 
198
198
  return html`
199
- <label for="accessor-input"> <ox-i18n msgid="label.accessor">accessor</ox-i18n><ox-help-icon topic="board-modeller/accessor"> </label>
199
+ <label for="accessor-input">
200
+ <ox-i18n msgid="label.accessor">accessor</ox-i18n><ox-help-icon topic="board-modeller/accessor"></ox-help-icon>
201
+ </label>
200
202
  <input
201
203
  id="accessor-input"
202
204
  value-key="accessor"
@@ -226,19 +228,17 @@ export class DataBindingMapper extends LitElement {
226
228
  <option value="(self)"></option>
227
229
  <option value="(key)"></option>
228
230
  <option value="[propkey]"></option>
229
- ${
230
- this._componentIds.length
231
- ? html`
232
- ${this._componentIds.map(
233
- ({ value, description }) => html` <option value=${value}>${description}</option> `
234
- )}
235
- `
236
- : html``
237
- }
231
+ ${this._componentIds.length
232
+ ? html`
233
+ ${this._componentIds.map(
234
+ ({ value, description }) => html` <option value=${value}>${description}</option> `
235
+ )}
236
+ `
237
+ : html``}
238
238
  </datalist>
239
239
 
240
240
  <label for="property-input"> <ox-i18n msgid="label.property">property</ox-i18n> </label>
241
- <select id="property-input" value-key="property" .value=${mapping.property}>
241
+ <select id="property-input" value-key="property" .value=${mapping.property || ''}>
242
242
  ${this.properties.map(
243
243
  item => html` <option .value=${item.name} ?selected=${item.name == mapping.property}>${item.label}</option> `
244
244
  )}
@@ -253,21 +253,21 @@ export class DataBindingMapper extends LitElement {
253
253
  </ox-buttons-radio>
254
254
 
255
255
  <div rule-editors ?hidden=${mapping.rule == 'value'}>
256
- <ox-input-value-map
256
+ <data-binding-value-map
257
257
  value-key="map"
258
258
  .value=${this.rule.map || {}}
259
259
  .valuetype=${this._valuetype(mapping.property!)}
260
260
  ?active=${mapping.rule == 'map'}
261
261
  >
262
- </ox-input-value-map>
262
+ </data-binding-value-map>
263
263
 
264
- <ox-input-value-ranges
264
+ <data-binding-value-ranges
265
265
  value-key="range"
266
266
  .value=${this.rule.range || []}
267
267
  .valuetype=${this._valuetype(mapping.property!)}
268
268
  ?active=${mapping.rule == 'range'}
269
269
  >
270
- </ox-input-value-ranges>
270
+ </data-binding-value-ranges>
271
271
 
272
272
  <ox-input-code
273
273
  value-key="eval"
@@ -0,0 +1,19 @@
1
+ import { html } from 'lit'
2
+ import { customElement } from 'lit/decorators.js'
3
+ import { ifDefined } from 'lit/directives/if-defined.js'
4
+
5
+ import { OxInputValueMap } from '@operato/input'
6
+
7
+ import '@operato/attachment/ox-attachment-selector.js'
8
+
9
+ @customElement('data-binding-value-map')
10
+ export class DataBindingValueMap extends OxInputValueMap {
11
+ static styles = OxInputValueMap.styles
12
+
13
+ valueInputTemplate(value?: any) {
14
+ if (this.valuetype == 'attachment') {
15
+ return html`<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`
16
+ }
17
+ return super.valueInputTemplate(value)
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ import { html } from 'lit'
2
+ import { customElement } from 'lit/decorators.js'
3
+ import { ifDefined } from 'lit/directives/if-defined.js'
4
+
5
+ import { OxInputValueRange } from '@operato/input'
6
+
7
+ import '@operato/attachment/ox-attachment-selector.js'
8
+
9
+ @customElement('data-binding-value-range')
10
+ export class DataBindingValueRange extends OxInputValueRange {
11
+ static styles = OxInputValueRange.styles
12
+
13
+ valueInputTemplate(value?: any) {
14
+ if (this.valuetype == 'attachment') {
15
+ return html`<ox-attachment-selector data-value value=${ifDefined(value)}></ox-attachment-selector>`
16
+ }
17
+ return super.valueInputTemplate(value)
18
+ }
19
+ }