@operato/process 1.4.48 → 1.4.50

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/process",
3
- "version": "1.4.48",
3
+ "version": "1.4.50",
4
4
  "description": "Webcomponent for business process modeling following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "@open-wc/scoped-elements": "^2.1.3",
71
71
  "@operato/app": "^1.4.47",
72
- "@operato/board": "^1.4.48",
72
+ "@operato/board": "^1.4.50",
73
73
  "@operato/data-grist": "^1.4.39",
74
74
  "@operato/font": "^1.4.39",
75
75
  "@operato/graphql": "^1.4.20",
@@ -128,5 +128,5 @@
128
128
  "prettier --write"
129
129
  ]
130
130
  },
131
- "gitHead": "98c601e3a5a8bd67ad66f64746cdeff4d762d747"
131
+ "gitHead": "fafd040b94cba363dd96359543fd221cb7d27d64"
132
132
  }
@@ -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 '@operato/input/ox-input-value-map.js'
10
+ import '@operato/input/ox-input-value-ranges.js'
11
11
 
12
12
  import { css, html, LitElement, PropertyValues } from 'lit'
13
13
  import { property, query, state } from 'lit/decorators.js'
@@ -23,6 +23,7 @@ export type Rule =
23
23
  | any
24
24
 
25
25
  export type Mapping = {
26
+ source?: string
26
27
  rule: 'map' | 'range' | 'eval' | 'value'
27
28
  accessor?: string
28
29
  target?: string
@@ -170,7 +171,7 @@ export class DataBindingMapper extends LitElement {
170
171
  fontColor: 'color',
171
172
 
172
173
  data: 'object',
173
- source: 'object',
174
+ source: 'attachment',
174
175
  location: 'object',
175
176
  dimension: 'object',
176
177
 
@@ -180,6 +181,7 @@ export class DataBindingMapper extends LitElement {
180
181
  @state() _componentIds: { value: string; description: string }[] = []
181
182
 
182
183
  @query('#eval-editor') editor!: HTMLInputElement
184
+ @query('#source-input') source!: HTMLInputElement
183
185
  @query('#target-input') target!: HTMLInputElement
184
186
 
185
187
  firstUpdated() {
@@ -190,13 +192,35 @@ export class DataBindingMapper extends LitElement {
190
192
  changes.has('mapping') && this._onChangedMapping()
191
193
  }
192
194
 
195
+ findComponentIds() {
196
+ this._componentIds =
197
+ (this.scene &&
198
+ this.scene.ids.map(i => {
199
+ const id = i.key
200
+ return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
201
+ })) ||
202
+ []
203
+ }
204
+
193
205
  render() {
194
206
  const mapping = this.mapping || {
195
207
  rule: 'value'
196
208
  }
197
209
 
198
210
  return html`
199
- <label for="accessor-input"> <ox-i18n msgid="label.accessor">accessor</ox-i18n><ox-help-icon topic="board-modeller/accessor"> </label>
211
+ <label for="source-input"> <ox-i18n msgid="label.source">source</ox-i18n> </label>
212
+ <input
213
+ id="source-input"
214
+ type="text"
215
+ value-key="source"
216
+ list="source-list"
217
+ .value=${mapping.source || ''}
218
+ @focusin=${() => this.findComponentIds()}
219
+ />
220
+
221
+ <label for="accessor-input">
222
+ <ox-i18n msgid="label.accessor">accessor</ox-i18n><ox-help-icon topic="board-modeller/accessor"></ox-help-icon>
223
+ </label>
200
224
  <input
201
225
  id="accessor-input"
202
226
  value-key="accessor"
@@ -212,33 +236,36 @@ export class DataBindingMapper extends LitElement {
212
236
  value-key="target"
213
237
  list="target-list"
214
238
  .value=${mapping.target || ''}
215
- @focusin=${() => {
216
- this._componentIds =
217
- (this.scene &&
218
- this.scene.ids.map(i => {
219
- const id = i.key
220
- return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }
221
- })) ||
222
- []
223
- }}
239
+ @focusin=${() => this.findComponentIds()}
224
240
  />
241
+
242
+ <datalist id="source-list">
243
+ <option value="">(self)</option>
244
+ ${this._componentIds.length
245
+ ? html`
246
+ ${this._componentIds.map(
247
+ ({ value, description }) => html` <option value=${value}>${description}</option> `
248
+ )}
249
+ `
250
+ : html``}
251
+ </datalist>
252
+
225
253
  <datalist id="target-list">
226
254
  <option value="(self)"></option>
255
+ <option value="(children)"></option>
227
256
  <option value="(key)"></option>
228
257
  <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
- }
258
+ ${this._componentIds.length
259
+ ? html`
260
+ ${this._componentIds.map(
261
+ ({ value, description }) => html` <option value=${value}>${description}</option> `
262
+ )}
263
+ `
264
+ : html``}
238
265
  </datalist>
239
266
 
240
267
  <label for="property-input"> <ox-i18n msgid="label.property">property</ox-i18n> </label>
241
- <select id="property-input" value-key="property" .value=${mapping.property}>
268
+ <select id="property-input" value-key="property" .value=${mapping.property || ''}>
242
269
  ${this.properties.map(
243
270
  item => html` <option .value=${item.name} ?selected=${item.name == mapping.property}>${item.label}</option> `
244
271
  )}
@@ -363,7 +390,18 @@ export class DataBindingMapper extends LitElement {
363
390
 
364
391
  var value: string | boolean = element.value
365
392
 
366
- if (key === 'target') {
393
+ if (key === 'source') {
394
+ if (value.length > 0) {
395
+ value = value.trim()
396
+
397
+ this.source.value = value
398
+ }
399
+
400
+ this.mapping = {
401
+ ...this.mapping,
402
+ source: value
403
+ }
404
+ } else if (key === 'target') {
367
405
  if (value.length > 0 && !/^[.#(\[]/.test(value)) {
368
406
  value = '#' + value.trim()
369
407