@things-factory/integration-ui 7.0.0-alpha.0 → 7.0.0-alpha.13

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.
Files changed (29) hide show
  1. package/client/editors/things-editor-oracle-procedure.ts +5 -14
  2. package/client/pages/integration-monitor.ts +9 -15
  3. package/client/viewparts/scenario-instance-log-view.ts +14 -7
  4. package/client/viewparts/scenario-instance-monitor.ts +7 -19
  5. package/client/viewparts/scenario-monitor.ts +22 -36
  6. package/client/viewparts/scenarios-monitor.ts +10 -13
  7. package/dist-client/editors/things-editor-oracle-procedure.js +3 -6
  8. package/dist-client/editors/things-editor-oracle-procedure.js.map +1 -1
  9. package/dist-client/pages/integration-monitor.js +9 -15
  10. package/dist-client/pages/integration-monitor.js.map +1 -1
  11. package/dist-client/tsconfig.tsbuildinfo +1 -1
  12. package/dist-client/viewparts/scenario-instance-log-view.d.ts +2 -0
  13. package/dist-client/viewparts/scenario-instance-log-view.js +19 -6
  14. package/dist-client/viewparts/scenario-instance-log-view.js.map +1 -1
  15. package/dist-client/viewparts/scenario-instance-monitor.js +2 -7
  16. package/dist-client/viewparts/scenario-instance-monitor.js.map +1 -1
  17. package/dist-client/viewparts/scenario-monitor.js +13 -26
  18. package/dist-client/viewparts/scenario-monitor.js.map +1 -1
  19. package/dist-client/viewparts/scenarios-monitor.js +10 -12
  20. package/dist-client/viewparts/scenarios-monitor.js.map +1 -1
  21. package/dist-server/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +5 -5
  23. package/translations/en.json +3 -0
  24. package/translations/ja.json +3 -0
  25. package/translations/ko.json +3 -0
  26. package/translations/ms.json +3 -0
  27. package/translations/zh.json +3 -0
  28. package/config/config.development.js +0 -1
  29. package/config/config.production.js +0 -1
@@ -286,13 +286,7 @@ export class ThingsEditorProcedureParameters extends OxFormField {
286
286
  accessor: accessor && String(accessor).trim()
287
287
  } as ProcedureParameterType
288
288
 
289
- if (
290
- dir != 'In' &&
291
- (type == 'String' || type == 'Buffer') &&
292
- maxSize !== null &&
293
- maxSize !== undefined &&
294
- !isNaN(maxSize)
295
- ) {
289
+ if (dir != 'In' && (type == 'String' || type == 'Buffer') && maxSize !== null && maxSize !== undefined && !isNaN(maxSize)) {
296
290
  entry.maxSize = maxSize
297
291
  }
298
292
 
@@ -322,9 +316,7 @@ export class ThingsEditorProcedureParameters extends OxFormField {
322
316
  const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value
323
317
  const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber
324
318
 
325
- const inputs = record.querySelectorAll(
326
- '[data-type]:not([style*="display: none"])'
327
- ) as NodeListOf<HTMLInputElement>
319
+ const inputs = record.querySelectorAll('[data-type]:not([style*="display: none"])') as NodeListOf<HTMLInputElement>
328
320
 
329
321
  if (!inputs || inputs.length == 0) {
330
322
  continue
@@ -354,9 +346,7 @@ export class ThingsEditorProcedureParameters extends OxFormField {
354
346
  _add() {
355
347
  this._build(true)
356
348
 
357
- const inputs = this.renderRoot.querySelectorAll(
358
- '[data-record-new] input:not([style*="display: none"])'
359
- ) as NodeListOf<HTMLInputElement & { value: any }>
349
+ const inputs = this.renderRoot.querySelectorAll('[data-record-new] input:not([style*="display: none"])') as NodeListOf<HTMLInputElement & { value: any }>
360
350
 
361
351
  for (var i = 0; i < inputs.length; i++) {
362
352
  let input = inputs[i]
@@ -418,9 +408,10 @@ export class ThingsEditorProcedureParameters extends OxFormField {
418
408
  const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value
419
409
  const type = (record.querySelector('[data-type]') as HTMLInputElement).value
420
410
  const val = (record.querySelector('[data-val]') as HTMLInputElement).value
411
+ const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value
421
412
  const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber
422
413
 
423
- return this._adjust({ name, dir, type, val, maxSize })
414
+ return this._adjust({ name, dir, type, val, accessor, maxSize })
424
415
  })
425
416
 
426
417
  this._updateValue()
@@ -9,7 +9,7 @@ import { customElement, property, query } from 'lit/decorators.js'
9
9
 
10
10
  import { client, subscribe } from '@operato/graphql'
11
11
  import { i18next, localize } from '@operato/i18n'
12
- import { PageView } from '@operato/shell'
12
+ import { PageView, InheritedValueType } from '@operato/shell'
13
13
  import { ScrollbarStyles } from '@operato/styles'
14
14
 
15
15
  function IS_SCENARIO_RUNNING(state) {
@@ -108,18 +108,9 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
108
108
 
109
109
  render() {
110
110
  return html`
111
- <integration-summary
112
- .pendings=${this.pendings}
113
- .scenarios=${this.scenarios}
114
- .connections=${this.connections}
115
- ></integration-summary>
111
+ <integration-summary .pendings=${this.pendings} .scenarios=${this.scenarios} .connections=${this.connections}></integration-summary>
116
112
  <content>
117
- <scenarios-monitor
118
- .scenarios=${this.scenarios}
119
- .pendings=${this.pendings}
120
- .colorIndex=${this.colorIndex || {}}
121
- .running=${!!this.active}
122
- ></scenarios-monitor>
113
+ <scenarios-monitor .scenarios=${this.scenarios} .pendings=${this.pendings} .colorIndex=${this.colorIndex || {}} .running=${!!this.active}></scenarios-monitor>
123
114
  <connections-monitor .connections=${this.connections}></connections-monitor>
124
115
  </content>
125
116
  `
@@ -140,8 +131,8 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
140
131
  async fetchScenarios() {
141
132
  const response = await client.query({
142
133
  query: gql`
143
- query {
144
- responses: scenarios {
134
+ query ($inherited: InheritedValueType) {
135
+ responses: scenarios(inherited: $inherited) {
145
136
  items {
146
137
  id
147
138
  name
@@ -173,7 +164,10 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
173
164
  total
174
165
  }
175
166
  }
176
- `
167
+ `,
168
+ variables: {
169
+ inherited: InheritedValueType.Include
170
+ }
177
171
  })
178
172
 
179
173
  var colorIndex = {}
@@ -1,5 +1,8 @@
1
+ import '@material/mwc-fab'
2
+
1
3
  import gql from 'graphql-tag'
2
- import { css, html, LitElement } from 'lit'
4
+
5
+ import { css, html, LitElement, nothing } from 'lit'
3
6
  import { customElement, property, query } from 'lit/decorators.js'
4
7
  import { connect } from 'pwa-helpers/connect-mixin'
5
8
 
@@ -44,12 +47,20 @@ export class ScenarioInstanceLogView extends connect(store)(LitElement) {
44
47
  span {
45
48
  color: var(--secondary-text-color);
46
49
  }
50
+
51
+ #start {
52
+ position: absolute;
53
+ bottom: 15px;
54
+ right: 16px;
55
+ text-decoration: auto;
56
+ }
47
57
  `
48
58
  ]
49
59
 
50
60
  @property({ type: String }) scenarioName?: string
51
61
  @property({ type: String }) instanceName?: string
52
62
  @property({ type: Array }) logs: any
63
+ @property({ type: Boolean }) startable: boolean = false
53
64
 
54
65
  subscription: any
55
66
 
@@ -70,14 +81,10 @@ export class ScenarioInstanceLogView extends connect(store)(LitElement) {
70
81
  <div options></div>
71
82
  <div content>
72
83
  ${logs.map(
73
- ({ timestamp, message, level }) =>
74
- html`
75
- <div class="${level}">
76
- <span>${new Date(timestamp).toLocaleString()}</span> <strong>${level}</strong> ${message}
77
- </div>
78
- `
84
+ ({ timestamp, message, level }) => html` <div class="${level}"><span>${new Date(timestamp).toLocaleString()}</span> <strong>${level}</strong> ${message}</div> `
79
85
  )}
80
86
  </div>
87
+ ${this.startable ? html`<mwc-fab id="start" icon="play_arrow" title="start" @click=${() => this.dispatchEvent(new CustomEvent('start'))}> </mwc-fab>` : nothing}
81
88
  `
82
89
  }
83
90
 
@@ -112,10 +112,7 @@ export class ScenarioInstanceMonitor extends localize(i18next)(LitElement) {
112
112
  <div buttons>
113
113
  <span><strong>${rounds}</strong> round</span>
114
114
  <mwc-icon-button @click=${e => this.showInstanceDetail()} icon="wysiwyg"></mwc-icon-button>
115
- <mwc-icon-button
116
- @click=${e => (running ? this.stopScenario(instance) : this.startScenario(instance))}
117
- icon=${running ? 'pause' : 'play_arrow'}
118
- ></mwc-icon-button>
115
+ <mwc-icon-button @click=${e => (running ? this.stopScenario(instance) : this.startScenario(instance))} icon=${running ? 'pause' : 'play_arrow'}></mwc-icon-button>
119
116
  </div>
120
117
  `
121
118
  }
@@ -137,9 +134,7 @@ export class ScenarioInstanceMonitor extends localize(i18next)(LitElement) {
137
134
 
138
135
  notify({
139
136
  level: 'info',
140
- message: `${IS_SCENARIO_RUNNING(response.data.startScenario.state) ? 'success' : 'fail'} to start scenario : ${
141
- instance.scenarioName
142
- }`
137
+ message: `${IS_SCENARIO_RUNNING(response.data.startScenario.state) ? 'success' : 'fail'} to start scenario : ${instance.scenarioName}`
143
138
  })
144
139
  }
145
140
 
@@ -159,22 +154,15 @@ export class ScenarioInstanceMonitor extends localize(i18next)(LitElement) {
159
154
 
160
155
  notify({
161
156
  level: 'info',
162
- message: `${IS_SCENARIO_RUNNING(response.data.stopScenario.state) ? 'fail' : 'success'} to stop instance : ${
163
- instance.instanceName
164
- }`
157
+ message: `${IS_SCENARIO_RUNNING(response.data.stopScenario.state) ? 'fail' : 'success'} to stop instance : ${instance.instanceName}`
165
158
  })
166
159
  }
167
160
 
168
161
  async showInstanceDetail() {
169
162
  const { instanceName, scenarioName } = this.instance
170
- openPopup(
171
- html`
172
- <scenario-instance-view .instanceName=${instanceName} .scenarioName=${scenarioName}></scenario-instance-view>
173
- `,
174
- {
175
- size: 'large',
176
- title: `${i18next.t('title.scenario-instance')}`
177
- }
178
- )
163
+ openPopup(html` <scenario-instance-view .instanceName=${instanceName} .scenarioName=${scenarioName}></scenario-instance-view> `, {
164
+ size: 'large',
165
+ title: `${i18next.t('title.scenario-instance')}`
166
+ })
179
167
  }
180
168
  }
@@ -4,7 +4,7 @@ import './scenario-instance-monitor'
4
4
 
5
5
  import gql from 'graphql-tag'
6
6
  import { css, html, LitElement } from 'lit'
7
- import { customElement, property, query } from 'lit/decorators.js'
7
+ import { customElement, property, query, state } from 'lit/decorators.js'
8
8
 
9
9
  import { client } from '@operato/graphql'
10
10
  import { i18next, localize } from '@operato/i18n'
@@ -23,7 +23,6 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
23
23
  :host {
24
24
  display: flex;
25
25
  flex-direction: row;
26
- margin: var(--margin-default);
27
26
 
28
27
  border: var(--border-dark-color);
29
28
  background-color: var(--theme-white-color);
@@ -38,9 +37,10 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
38
37
  display: flex;
39
38
  flex-direction: column;
40
39
  padding: var(--padding-default);
41
- width: 200px;
42
40
  color: var(--secondary-color);
43
41
  font-size: var(--fontsize-small);
42
+ width: 100%;
43
+ box-sizing: border-box;
44
44
  }
45
45
 
46
46
  [desc] [detail-info] {
@@ -114,9 +114,15 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
114
114
  margin: var(--margin-default) 0 0 0;
115
115
  }
116
116
 
117
+ :host([mode='detail']) [desc] {
118
+ flex: unset;
119
+ width: 200px;
120
+ }
121
+
117
122
  :host([mode='detail']) [desc] [buttons] {
118
123
  display: none;
119
124
  }
125
+
120
126
  :host([mode='detail']) [buttons] {
121
127
  border-top: none;
122
128
  padding: var(--padding-default);
@@ -137,7 +143,6 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
137
143
  position: relative;
138
144
  margin: var(--margin-default);
139
145
  min-width: 140px;
140
- max-width: 180px;
141
146
  border: 1px solid black;
142
147
  border-radius: var(--border-radius);
143
148
  font-size: 12px;
@@ -154,21 +159,12 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
154
159
  @media screen and (max-width: 480px) {
155
160
  :host {
156
161
  margin: var(--margin-narrow);
157
- max-width: 46%;
158
- }
159
-
160
- :host([mode='detail']) {
161
- max-width: initial;
162
162
  }
163
163
 
164
164
  [desc] {
165
165
  padding: var(--padding-narrow);
166
166
  }
167
167
 
168
- :host([mode='detail']) > [desc] {
169
- max-width: 125px;
170
- }
171
-
172
168
  [desc] [detail-info] {
173
169
  height: 38px;
174
170
  }
@@ -192,7 +188,7 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
192
188
 
193
189
  return html`
194
190
  <div desc>
195
- <div detail-info>
191
+ <div detail-info title=${name}>
196
192
  <strong>${name}</strong>
197
193
  ${description}
198
194
  <span>${instances.length}</span>
@@ -224,32 +220,26 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
224
220
 
225
221
  renderButtons(scenario) {
226
222
  const instances = scenario.instances || []
227
- const scenarioInstance = instances.find(instance => instance.instanceName == scenario.name)
223
+ const scenarioInstance = instances.find(instance => instance.instanceName == scenario.name) || null
228
224
 
229
225
  return html`
230
226
  <div buttons ?detail=${this.mode == 'detail'}>
231
227
  <mwc-icon-button @click=${e => this.popupLogView(scenario)} icon="text_snippet"></mwc-icon-button>
232
228
  ${!scenarioInstance
233
- ? html` <mwc-icon-button
234
- icon="play_circle_outline"
235
- @click=${e => this.startScenario(scenario)}
236
- ></mwc-icon-button>`
237
- : html`
238
- <mwc-icon-button
239
- icon="pause_circle_outline"
240
- @click=${e => this.stopScenario(scenario)}
241
- stop
242
- ></mwc-icon-button>
243
- `}
229
+ ? html` <mwc-icon-button icon="play_circle_outline" @click=${e => this.startScenario(scenario)}></mwc-icon-button>`
230
+ : html` <mwc-icon-button icon="pause_circle_outline" @click=${e => this.stopScenario(scenario)} stop></mwc-icon-button> `}
244
231
  </div>
245
232
  `
246
233
  }
247
234
 
248
235
  async popupLogView(scenario) {
249
- openPopup(html` <scenario-instance-log-view .scenarioName=${scenario.name}></scenario-instance-log-view> `, {
250
- size: 'large',
251
- title: `${i18next.t('title.scenario-log')} (${scenario.name})`
252
- })
236
+ const popup = openPopup(
237
+ html` <scenario-instance-log-view .scenarioName=${scenario.name} @start=${() => this.startScenario(scenario)} startable></scenario-instance-log-view> `,
238
+ {
239
+ size: 'large',
240
+ title: `${i18next.t('title.scenario-log')} (${scenario.name})`
241
+ }
242
+ )
253
243
  }
254
244
 
255
245
  async startScenario(scenario) {
@@ -268,9 +258,7 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
268
258
 
269
259
  notify({
270
260
  level: 'info',
271
- message: `${!IS_SCENARIO_RUNNING(response.data.startScenario.state) ? 'fail' : 'success'} to start instance : ${
272
- scenario.name
273
- }`
261
+ message: `${!IS_SCENARIO_RUNNING(response.data.startScenario.state) ? 'fail' : 'success'} to start instance : ${scenario.name}`
274
262
  })
275
263
  }
276
264
 
@@ -290,9 +278,7 @@ export class ScenarioMonitor extends localize(i18next)(LitElement) {
290
278
 
291
279
  notify({
292
280
  level: 'info',
293
- message: `${IS_SCENARIO_RUNNING(response.data.stopScenario.state) ? 'fail' : 'success'} to stop instance : ${
294
- scenario.name
295
- }`
281
+ message: `${IS_SCENARIO_RUNNING(response.data.stopScenario.state) ? 'fail' : 'success'} to stop instance : ${scenario.name}`
296
282
  })
297
283
  }
298
284
  }
@@ -8,10 +8,6 @@ import { customElement, property, query } from 'lit/decorators.js'
8
8
  import { i18next, localize } from '@operato/i18n'
9
9
  import { ScrollbarStyles } from '@operato/styles'
10
10
 
11
- function IS_SCENARIO_RUNNING(state) {
12
- return state && state !== 'UNLOADED'
13
- }
14
-
15
11
  @customElement('scenarios-monitor')
16
12
  export class ScenariosMonitor extends localize(i18next)(LitElement) {
17
13
  static styles = [
@@ -84,12 +80,17 @@ export class ScenariosMonitor extends localize(i18next)(LitElement) {
84
80
  [scenarios] [flowbox] {
85
81
  display: flex;
86
82
  flex-direction: column;
87
- min-height: min-content;
83
+ padding: 10px;
84
+ gap: 12px;
88
85
  }
89
86
 
90
87
  [scenarios][mode='brief'] [flowbox] {
91
- flex-flow: row wrap;
92
- align-self: start;
88
+ overflow: auto;
89
+ display: grid;
90
+
91
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
92
+ grid-auto-rows: max-content;
93
+ grid-gap: 12px;
93
94
  }
94
95
 
95
96
  scenario-monitor {
@@ -128,16 +129,12 @@ export class ScenariosMonitor extends localize(i18next)(LitElement) {
128
129
  </div>
129
130
 
130
131
  <div content>
131
- <pending-q-monitor
132
- .pendings=${this.pendings}
133
- .colorIndex=${this.colorIndex || {}}
134
- .running=${this.running}
135
- ></pending-q-monitor>
132
+ <pending-q-monitor .pendings=${this.pendings} .colorIndex=${this.colorIndex || {}} .running=${this.running}></pending-q-monitor>
136
133
 
137
134
  <div scenarios mode=${mode}>
138
135
  <div flowbox>
139
136
  ${scenarios
140
- .filter(scenario => scenario.name.indexOf(filter) == 0)
137
+ .filter(scenario => new RegExp(filter, 'i').test(scenario.name))
141
138
  .map(scenario => html`<scenario-monitor .scenario=${scenario} mode=${mode}></scenario-monitor>`)}
142
139
  </div>
143
140
  </div>
@@ -166,11 +166,7 @@ let ThingsEditorProcedureParameters = class ThingsEditorProcedureParameters exte
166
166
  dir,
167
167
  accessor: accessor && String(accessor).trim()
168
168
  };
169
- if (dir != 'In' &&
170
- (type == 'String' || type == 'Buffer') &&
171
- maxSize !== null &&
172
- maxSize !== undefined &&
173
- !isNaN(maxSize)) {
169
+ if (dir != 'In' && (type == 'String' || type == 'Buffer') && maxSize !== null && maxSize !== undefined && !isNaN(maxSize)) {
174
170
  entry.maxSize = maxSize;
175
171
  }
176
172
  if (dir != 'Out' && val !== null && val !== undefined && val != '') {
@@ -262,8 +258,9 @@ let ThingsEditorProcedureParameters = class ThingsEditorProcedureParameters exte
262
258
  const dir = record.querySelector('[data-dir]').value;
263
259
  const type = record.querySelector('[data-type]').value;
264
260
  const val = record.querySelector('[data-val]').value;
261
+ const accessor = record.querySelector('[data-accessor]').value;
265
262
  const maxSize = record.querySelector('[data-max-size]').valueAsNumber;
266
- return this._adjust({ name, dir, type, val, maxSize });
263
+ return this._adjust({ name, dir, type, val, accessor, maxSize });
267
264
  });
268
265
  this._updateValue();
269
266
  }
@@ -1 +1 @@
1
- {"version":3,"file":"things-editor-oracle-procedure.js","sourceRoot":"","sources":["../../client/editors/things-editor-oracle-procedure.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAE3B,OAAO,0BAA0B,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE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OAAO,GAAI,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAsB,CAAC,aAAa,CAAA;YAE3F,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;;AApYM,sCAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmFF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAAsB;AACjD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;8DAAqB;AAE/C;IAAC,KAAK,EAAE;;kEAAgC;AACxC;IAAC,KAAK,EAAE;;mEAAmD;AAG3D;IAAC,QAAQ,CAAC,eAAe,CAAC;;gEAAkC;AA/FjD,+BAA+B;IAD3C,aAAa,CAAC,gCAAgC,CAAC;GACnC,+BAA+B,CAsY3C;SAtYY,+BAA+B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-icon'\n\nimport '@operato/i18n/ox-i18n.js'\nimport { css, html } from 'lit'\nimport { customElement, property, queryAll, state } from 'lit/decorators.js'\n\nimport { OxFormField } from '@operato/input'\n\ntype ProcedureParameterType = {\n name: string\n dir: string\n type: string\n val?: any\n accessor?: string\n maxSize?: number\n}\n\ntype ValueType = {\n code?: string\n procedure?: string\n parameters?: ProcedureParameterType[]\n}\n\n/**\n input component for procedure-parameters\n \n Example:\n \n <things-editor-oracle-procedure \n value=${map}\n </things-editor-oracle-procedure>\n */\n@customElement('things-editor-oracle-procedure')\nexport class ThingsEditorProcedureParameters extends OxFormField {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n margin-bottom: var(--margin-wide);\n }\n\n div {\n display: flex;\n flex-flow: row nowrap;\n gap: var(--margin-default);\n margin-bottom: var(--margin-narrow);\n }\n\n pre {\n flex: 1;\n background-color: #333;\n color: white;\n margin: 0;\n padding: 4px 6px;\n font-size: 1.5em;\n display: flex;\n }\n\n code {\n flex: 1;\n white-space: normal;\n min-height: 32px;\n }\n\n button {\n border: var(--button-border);\n border-radius: var(--border-radius);\n background-color: var(--button-background-color);\n padding: var(--padding-narrow) var(--padding-default);\n line-height: 0.8;\n color: var(--button-color);\n cursor: pointer;\n }\n\n button + button {\n margin-left: -5px;\n }\n\n button mwc-icon {\n font-size: var(--fontsize-default);\n }\n\n button:focus,\n button:hover,\n button:active {\n border: var(--button-activ-border);\n background-color: var(--button-background-focus-color);\n color: var(--theme-white-color);\n }\n\n input {\n flex: 1;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--input-padding);\n font: var(--input-font);\n color: var(--primary-text-color);\n min-width: 50px;\n }\n\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--primary-color);\n }\n\n button.hidden {\n opacity: 0;\n cursor: default;\n }\n\n select,\n ox-select,\n input:not([type='checkbox']) {\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n }\n `\n ]\n\n @property({ type: Object }) value: ValueType = {}\n @property({ type: Array }) steps: string[] = []\n\n @state() private procedure?: string = ''\n @state() private parameters?: ProcedureParameterType[] = []\n private _changingNow: boolean = false\n\n @queryAll('[data-record]') records!: NodeListOf<HTMLElement>\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onChange.bind(this))\n }\n\n render() {\n const code = this.value?.code || ''\n const parameters = this.parameters || []\n const procedure = this.procedure || ''\n\n const steps = this.steps || []\n\n return html`\n <div>\n <label><ox-i18n msgid=\"label.procedure-code\"></ox-i18n></label>\n </div>\n\n <div>\n <pre>\n <code>${code}</code>\n </pre\n >\n </div>\n\n <div>\n <label><ox-i18n msgid=\"label.procedure-name\"></ox-i18n></label>\n </div>\n\n <div>\n <input type=\"text\" data-procedure .value=${procedure} />\n </div>\n\n <div>\n <label><ox-i18n msgid=\"label.parameters\"></ox-i18n></label>\n </div>\n\n ${parameters.map(\n item => html`\n <div data-record>\n <input type=\"text\" data-name placeholder=\"name\" .value=${item.name} />\n <select data-dir placeholder=\"dir\" .value=${item.dir}>\n <option value=\"\" ?selected=${item.dir == ''}>&nbsp;</option>\n <option value=\"In\" ?selected=${item.dir == 'In'}>In</option>\n <option value=\"Inout\" ?selected=${item.dir == 'Inout'}>Inout</option>\n <option value=\"Out\" ?selected=${item.dir == 'Out'}>Out</option>\n </select>\n <select data-type placeholder=\"type\" .value=${item.type}>\n <option value=\"\" ?selected=${item.type == ''}>&nbsp;</option>\n <option value=\"String\" ?selected=${item.type == 'String'}>String</option>\n <option value=\"Number\" ?selected=${item.type == 'Number'}>Number</option>\n <option value=\"Date\" ?selected=${item.type == 'Date'}>Date</option>\n <!-- \n <option value=\"Buffer\" ?selected=${item.type == 'Buffer'}>Buffer</option>\n <option value=\"Blob\" ?selected=${item.type == 'Blob'}>Blob</option>\n <option value=\"Clob\" ?selected=${item.type == 'Clob'}>Clob</option>\n -->\n <option value=\"Cursor\" ?selected=${item.type == 'Cursor'}>Cursor</option>\n </select>\n <input type=\"text\" data-accessor placeholder=\"accessor\" .value=${item.accessor || ''} list=\"step-list\" />\n <input type=\"text\" data-val placeholder=\"val\" .value=${item.val || ''} />\n <input type=\"number\" data-max-size placeholder=\"max-size\" .value=${String(item.maxSize)} />\n\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._delete(e)} tabindex=\"-1\">\n <mwc-icon>remove</mwc-icon>\n </button>\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._up(e)} tabindex=\"-1\">\n <mwc-icon>arrow_upward</mwc-icon>\n </button>\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._down(e)} tabindex=\"-1\">\n <mwc-icon>arrow_downward</mwc-icon>\n </button>\n </div>\n `\n )}\n\n <div data-record-new>\n <input type=\"text\" data-name placeholder=\"name\" value=\"\" />\n <select data-dir placeholder=\"dir\">\n <option value=\"\" selected>&nbsp;</option>\n <option value=\"In\">In</option>\n <option value=\"Inout\">Inout</option>\n <option value=\"Out\">Out</option>\n </select>\n <select data-type placeholder=\"type\" value=\"\">\n <option value=\"\" selected>&nbsp;</option>\n <option value=\"String\">String</option>\n <option value=\"Number\">Number</option>\n <option value=\"Date\">Date</option>\n <!--\n <option value=\"Buffer\">Buffer</option>\n <option value=\"Blob\">Blob</option>\n <option value=\"Clob\">Clob</option>\n -->\n <option value=\"Cursor\">Cursor</option>\n </select>\n <input type=\"text\" data-accessor placeholder=\"accessor\" value=\"\" list=\"step-list\" />\n <input type=\"text\" data-val placeholder=\"val\" value=\"\" />\n <input type=\"number\" data-max-size placeholder=\"max-size\" value=\"\" />\n\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._add()} tabindex=\"-1\">\n <mwc-icon>add</mwc-icon>\n </button>\n <button class=\"hidden\"><mwc-icon>add</mwc-icon></button>\n <button class=\"hidden\"><mwc-icon>add</mwc-icon></button>\n </div>\n\n <datalist id=\"step-list\">${steps.map(id => html` <option value=${id}></option> `)}</datalist>\n `\n }\n\n updated(changes: any) {\n if (changes.has('value')) {\n /* 하위 호환성때문에, Array타입 값을 처리하도록 함. 다음 마이너 업그레이드시에 제거할 것. */\n const value = (Array.isArray(this.value) ? { parameters: this.value } : this.value) as ValueType\n\n const { procedure, parameters } = value\n\n this.procedure = procedure\n this.parameters = parameters\n }\n }\n\n _onChange(e: Event) {\n if (this._changingNow) {\n return\n }\n\n this._changingNow = true\n\n const input = e.target as HTMLInputElement\n\n if (input.hasAttribute('data-procedure')) {\n this.procedure = input.value\n this._updateValue()\n } else {\n const record = (e.target as Element).closest('[data-record],[data-record-new]') as HTMLElement\n\n if (record.hasAttribute('data-record')) {\n this._build()\n } else if (record.hasAttribute('data-record-new') && input.hasAttribute('data-type')) {\n this._add()\n }\n }\n\n this._changingNow = false\n }\n\n _adjust({ name, type, dir, maxSize, val, accessor }: ProcedureParameterType): ProcedureParameterType {\n const entry = {\n name: name && String(name).trim(),\n type,\n dir,\n accessor: accessor && String(accessor).trim()\n } as ProcedureParameterType\n\n if (\n dir != 'In' &&\n (type == 'String' || type == 'Buffer') &&\n maxSize !== null &&\n maxSize !== undefined &&\n !isNaN(maxSize)\n ) {\n entry.maxSize = maxSize\n }\n\n if (dir != 'Out' && val !== null && val !== undefined && val != '') {\n entry.val = type == 'Number' ? Number(val) : val\n }\n\n return entry\n }\n\n _build(includeNewRecord?: boolean) {\n if (includeNewRecord) {\n var records = this.renderRoot.querySelectorAll('[data-record],[data-record-new]') as NodeListOf<HTMLElement>\n } else {\n var records = this.renderRoot.querySelectorAll('[data-record]') as NodeListOf<HTMLElement>\n }\n\n var newmap: ProcedureParameterType[] = []\n\n for (var i = 0; i < records.length; i++) {\n var record = records[i]\n\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n const inputs = record.querySelectorAll(\n '[data-type]:not([style*=\"display: none\"])'\n ) as NodeListOf<HTMLInputElement>\n\n if (!inputs || inputs.length == 0) {\n continue\n }\n\n if (name) {\n newmap.push(this._adjust({ name, type, dir, val, accessor, maxSize }))\n }\n }\n\n this.parameters = newmap\n this._updateValue()\n }\n\n _updateValue() {\n const args = (this.parameters || []).map(p => ':' + p.name).join(', ')\n\n this.value = {\n code: `${this.procedure}(${args});`,\n procedure: this.procedure,\n parameters: this.parameters\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n }\n\n _add() {\n this._build(true)\n\n const inputs = this.renderRoot.querySelectorAll(\n '[data-record-new] input:not([style*=\"display: none\"])'\n ) as NodeListOf<HTMLInputElement & { value: any }>\n\n for (var i = 0; i < inputs.length; i++) {\n let input = inputs[i]\n\n input.value = ''\n }\n\n inputs[0].focus()\n }\n\n _delete(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n\n ;(record!.querySelector('[data-name]') as HTMLInputElement)!.value = ''\n\n this._build()\n }\n\n _up(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n const array = Array.from(this.records)\n const index = array.indexOf(record) - 1\n\n if (index < 0) {\n return\n }\n\n const deleted = array.splice(index, 1)\n array.splice(index + 1, 0, ...deleted)\n\n this.parameters = array.map(record => {\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n return this._adjust({ name, dir, type, val, accessor, maxSize })\n })\n\n this._updateValue()\n }\n\n _down(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n const array = Array.from(this.records)\n const index = array.indexOf(record)\n\n if (index > array.length) {\n return\n }\n\n array.splice(index, 1)\n array.splice(index + 1, 0, record)\n\n this.parameters = array.map(record => {\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n return this._adjust({ name, dir, type, val, maxSize })\n })\n\n this._updateValue()\n }\n}\n"]}
1
+ {"version":3,"file":"things-editor-oracle-procedure.js","sourceRoot":"","sources":["../../client/editors/things-editor-oracle-proc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YAAY,CAAsB,CAAC,KAAK,CAAA;YAC1E,MAAM,IAAI,GAAI,MAAM,CAAC,aAAa,CAAC,aAAa,CAAsB,CAAC,KAAK,CAAA;YAC5E,MAAM,GAAG,GAAI,MAAM,CAAC,aAAa,CAAC,YAAY,CAAsB,CAAC,KAAK,CAAA;YAC1E,MAAM,QAAQ,GAAI,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAsB,CAAC,KAAK,CAAA;YACpF,MAAM,OAAO,GAAI,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAsB,CAAC,aAAa,CAAA;YAE3F,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;QAClE,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;;AA3XM,sCAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmFF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAAsB;AACjD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;8DAAqB;AAE/C;IAAC,KAAK,EAAE;;kEAAgC;AACxC;IAAC,KAAK,EAAE;;mEAAmD;AAG3D;IAAC,QAAQ,CAAC,eAAe,CAAC;;gEAAkC;AA/FjD,+BAA+B;IAD3C,aAAa,CAAC,gCAAgC,CAAC;GACnC,+BAA+B,CA6X3C;SA7XY,+BAA+B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-icon'\n\nimport '@operato/i18n/ox-i18n.js'\nimport { css, html } from 'lit'\nimport { customElement, property, queryAll, state } from 'lit/decorators.js'\n\nimport { OxFormField } from '@operato/input'\n\ntype ProcedureParameterType = {\n name: string\n dir: string\n type: string\n val?: any\n accessor?: string\n maxSize?: number\n}\n\ntype ValueType = {\n code?: string\n procedure?: string\n parameters?: ProcedureParameterType[]\n}\n\n/**\n input component for procedure-parameters\n \n Example:\n \n <things-editor-oracle-procedure \n value=${map}\n </things-editor-oracle-procedure>\n */\n@customElement('things-editor-oracle-procedure')\nexport class ThingsEditorProcedureParameters extends OxFormField {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n margin-bottom: var(--margin-wide);\n }\n\n div {\n display: flex;\n flex-flow: row nowrap;\n gap: var(--margin-default);\n margin-bottom: var(--margin-narrow);\n }\n\n pre {\n flex: 1;\n background-color: #333;\n color: white;\n margin: 0;\n padding: 4px 6px;\n font-size: 1.5em;\n display: flex;\n }\n\n code {\n flex: 1;\n white-space: normal;\n min-height: 32px;\n }\n\n button {\n border: var(--button-border);\n border-radius: var(--border-radius);\n background-color: var(--button-background-color);\n padding: var(--padding-narrow) var(--padding-default);\n line-height: 0.8;\n color: var(--button-color);\n cursor: pointer;\n }\n\n button + button {\n margin-left: -5px;\n }\n\n button mwc-icon {\n font-size: var(--fontsize-default);\n }\n\n button:focus,\n button:hover,\n button:active {\n border: var(--button-activ-border);\n background-color: var(--button-background-focus-color);\n color: var(--theme-white-color);\n }\n\n input {\n flex: 1;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--input-padding);\n font: var(--input-font);\n color: var(--primary-text-color);\n min-width: 50px;\n }\n\n input:focus {\n outline: none;\n border-bottom: 1px solid var(--primary-color);\n }\n\n button.hidden {\n opacity: 0;\n cursor: default;\n }\n\n select,\n ox-select,\n input:not([type='checkbox']) {\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n }\n `\n ]\n\n @property({ type: Object }) value: ValueType = {}\n @property({ type: Array }) steps: string[] = []\n\n @state() private procedure?: string = ''\n @state() private parameters?: ProcedureParameterType[] = []\n private _changingNow: boolean = false\n\n @queryAll('[data-record]') records!: NodeListOf<HTMLElement>\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onChange.bind(this))\n }\n\n render() {\n const code = this.value?.code || ''\n const parameters = this.parameters || []\n const procedure = this.procedure || ''\n\n const steps = this.steps || []\n\n return html`\n <div>\n <label><ox-i18n msgid=\"label.procedure-code\"></ox-i18n></label>\n </div>\n\n <div>\n <pre>\n <code>${code}</code>\n </pre\n >\n </div>\n\n <div>\n <label><ox-i18n msgid=\"label.procedure-name\"></ox-i18n></label>\n </div>\n\n <div>\n <input type=\"text\" data-procedure .value=${procedure} />\n </div>\n\n <div>\n <label><ox-i18n msgid=\"label.parameters\"></ox-i18n></label>\n </div>\n\n ${parameters.map(\n item => html`\n <div data-record>\n <input type=\"text\" data-name placeholder=\"name\" .value=${item.name} />\n <select data-dir placeholder=\"dir\" .value=${item.dir}>\n <option value=\"\" ?selected=${item.dir == ''}>&nbsp;</option>\n <option value=\"In\" ?selected=${item.dir == 'In'}>In</option>\n <option value=\"Inout\" ?selected=${item.dir == 'Inout'}>Inout</option>\n <option value=\"Out\" ?selected=${item.dir == 'Out'}>Out</option>\n </select>\n <select data-type placeholder=\"type\" .value=${item.type}>\n <option value=\"\" ?selected=${item.type == ''}>&nbsp;</option>\n <option value=\"String\" ?selected=${item.type == 'String'}>String</option>\n <option value=\"Number\" ?selected=${item.type == 'Number'}>Number</option>\n <option value=\"Date\" ?selected=${item.type == 'Date'}>Date</option>\n <!-- \n <option value=\"Buffer\" ?selected=${item.type == 'Buffer'}>Buffer</option>\n <option value=\"Blob\" ?selected=${item.type == 'Blob'}>Blob</option>\n <option value=\"Clob\" ?selected=${item.type == 'Clob'}>Clob</option>\n -->\n <option value=\"Cursor\" ?selected=${item.type == 'Cursor'}>Cursor</option>\n </select>\n <input type=\"text\" data-accessor placeholder=\"accessor\" .value=${item.accessor || ''} list=\"step-list\" />\n <input type=\"text\" data-val placeholder=\"val\" .value=${item.val || ''} />\n <input type=\"number\" data-max-size placeholder=\"max-size\" .value=${String(item.maxSize)} />\n\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._delete(e)} tabindex=\"-1\">\n <mwc-icon>remove</mwc-icon>\n </button>\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._up(e)} tabindex=\"-1\">\n <mwc-icon>arrow_upward</mwc-icon>\n </button>\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._down(e)} tabindex=\"-1\">\n <mwc-icon>arrow_downward</mwc-icon>\n </button>\n </div>\n `\n )}\n\n <div data-record-new>\n <input type=\"text\" data-name placeholder=\"name\" value=\"\" />\n <select data-dir placeholder=\"dir\">\n <option value=\"\" selected>&nbsp;</option>\n <option value=\"In\">In</option>\n <option value=\"Inout\">Inout</option>\n <option value=\"Out\">Out</option>\n </select>\n <select data-type placeholder=\"type\" value=\"\">\n <option value=\"\" selected>&nbsp;</option>\n <option value=\"String\">String</option>\n <option value=\"Number\">Number</option>\n <option value=\"Date\">Date</option>\n <!--\n <option value=\"Buffer\">Buffer</option>\n <option value=\"Blob\">Blob</option>\n <option value=\"Clob\">Clob</option>\n -->\n <option value=\"Cursor\">Cursor</option>\n </select>\n <input type=\"text\" data-accessor placeholder=\"accessor\" value=\"\" list=\"step-list\" />\n <input type=\"text\" data-val placeholder=\"val\" value=\"\" />\n <input type=\"number\" data-max-size placeholder=\"max-size\" value=\"\" />\n\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._add()} tabindex=\"-1\">\n <mwc-icon>add</mwc-icon>\n </button>\n <button class=\"hidden\"><mwc-icon>add</mwc-icon></button>\n <button class=\"hidden\"><mwc-icon>add</mwc-icon></button>\n </div>\n\n <datalist id=\"step-list\">${steps.map(id => html` <option value=${id}></option> `)}</datalist>\n `\n }\n\n updated(changes: any) {\n if (changes.has('value')) {\n /* 하위 호환성때문에, Array타입 값을 처리하도록 함. 다음 마이너 업그레이드시에 제거할 것. */\n const value = (Array.isArray(this.value) ? { parameters: this.value } : this.value) as ValueType\n\n const { procedure, parameters } = value\n\n this.procedure = procedure\n this.parameters = parameters\n }\n }\n\n _onChange(e: Event) {\n if (this._changingNow) {\n return\n }\n\n this._changingNow = true\n\n const input = e.target as HTMLInputElement\n\n if (input.hasAttribute('data-procedure')) {\n this.procedure = input.value\n this._updateValue()\n } else {\n const record = (e.target as Element).closest('[data-record],[data-record-new]') as HTMLElement\n\n if (record.hasAttribute('data-record')) {\n this._build()\n } else if (record.hasAttribute('data-record-new') && input.hasAttribute('data-type')) {\n this._add()\n }\n }\n\n this._changingNow = false\n }\n\n _adjust({ name, type, dir, maxSize, val, accessor }: ProcedureParameterType): ProcedureParameterType {\n const entry = {\n name: name && String(name).trim(),\n type,\n dir,\n accessor: accessor && String(accessor).trim()\n } as ProcedureParameterType\n\n if (dir != 'In' && (type == 'String' || type == 'Buffer') && maxSize !== null && maxSize !== undefined && !isNaN(maxSize)) {\n entry.maxSize = maxSize\n }\n\n if (dir != 'Out' && val !== null && val !== undefined && val != '') {\n entry.val = type == 'Number' ? Number(val) : val\n }\n\n return entry\n }\n\n _build(includeNewRecord?: boolean) {\n if (includeNewRecord) {\n var records = this.renderRoot.querySelectorAll('[data-record],[data-record-new]') as NodeListOf<HTMLElement>\n } else {\n var records = this.renderRoot.querySelectorAll('[data-record]') as NodeListOf<HTMLElement>\n }\n\n var newmap: ProcedureParameterType[] = []\n\n for (var i = 0; i < records.length; i++) {\n var record = records[i]\n\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n const inputs = record.querySelectorAll('[data-type]:not([style*=\"display: none\"])') as NodeListOf<HTMLInputElement>\n\n if (!inputs || inputs.length == 0) {\n continue\n }\n\n if (name) {\n newmap.push(this._adjust({ name, type, dir, val, accessor, maxSize }))\n }\n }\n\n this.parameters = newmap\n this._updateValue()\n }\n\n _updateValue() {\n const args = (this.parameters || []).map(p => ':' + p.name).join(', ')\n\n this.value = {\n code: `${this.procedure}(${args});`,\n procedure: this.procedure,\n parameters: this.parameters\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n }\n\n _add() {\n this._build(true)\n\n const inputs = this.renderRoot.querySelectorAll('[data-record-new] input:not([style*=\"display: none\"])') as NodeListOf<HTMLInputElement & { value: any }>\n\n for (var i = 0; i < inputs.length; i++) {\n let input = inputs[i]\n\n input.value = ''\n }\n\n inputs[0].focus()\n }\n\n _delete(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n\n ;(record!.querySelector('[data-name]') as HTMLInputElement)!.value = ''\n\n this._build()\n }\n\n _up(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n const array = Array.from(this.records)\n const index = array.indexOf(record) - 1\n\n if (index < 0) {\n return\n }\n\n const deleted = array.splice(index, 1)\n array.splice(index + 1, 0, ...deleted)\n\n this.parameters = array.map(record => {\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n return this._adjust({ name, dir, type, val, accessor, maxSize })\n })\n\n this._updateValue()\n }\n\n _down(e: MouseEvent) {\n const record = (e.target as Element).closest('[data-record]') as HTMLElement\n const array = Array.from(this.records)\n const index = array.indexOf(record)\n\n if (index > array.length) {\n return\n }\n\n array.splice(index, 1)\n array.splice(index + 1, 0, record)\n\n this.parameters = array.map(record => {\n const name = (record.querySelector('[data-name]') as HTMLInputElement).value\n const dir = (record.querySelector('[data-dir]') as HTMLInputElement).value\n const type = (record.querySelector('[data-type]') as HTMLInputElement).value\n const val = (record.querySelector('[data-val]') as HTMLInputElement).value\n const accessor = (record.querySelector('[data-accessor]') as HTMLInputElement).value\n const maxSize = (record.querySelector('[data-max-size]') as HTMLInputElement).valueAsNumber\n\n return this._adjust({ name, dir, type, val, accessor, maxSize })\n })\n\n this._updateValue()\n }\n}\n"]}
@@ -8,7 +8,7 @@ import { css, html } from 'lit';
8
8
  import { customElement, property } from 'lit/decorators.js';
9
9
  import { client, subscribe } from '@operato/graphql';
10
10
  import { i18next, localize } from '@operato/i18n';
11
- import { PageView } from '@operato/shell';
11
+ import { PageView, InheritedValueType } from '@operato/shell';
12
12
  import { ScrollbarStyles } from '@operato/styles';
13
13
  function IS_SCENARIO_RUNNING(state) {
14
14
  return state && state !== 'UNLOADED';
@@ -37,18 +37,9 @@ let IntegrationMonitor = class IntegrationMonitor extends localize(i18next)(Page
37
37
  }
38
38
  render() {
39
39
  return html `
40
- <integration-summary
41
- .pendings=${this.pendings}
42
- .scenarios=${this.scenarios}
43
- .connections=${this.connections}
44
- ></integration-summary>
40
+ <integration-summary .pendings=${this.pendings} .scenarios=${this.scenarios} .connections=${this.connections}></integration-summary>
45
41
  <content>
46
- <scenarios-monitor
47
- .scenarios=${this.scenarios}
48
- .pendings=${this.pendings}
49
- .colorIndex=${this.colorIndex || {}}
50
- .running=${!!this.active}
51
- ></scenarios-monitor>
42
+ <scenarios-monitor .scenarios=${this.scenarios} .pendings=${this.pendings} .colorIndex=${this.colorIndex || {}} .running=${!!this.active}></scenarios-monitor>
52
43
  <connections-monitor .connections=${this.connections}></connections-monitor>
53
44
  </content>
54
45
  `;
@@ -68,8 +59,8 @@ let IntegrationMonitor = class IntegrationMonitor extends localize(i18next)(Page
68
59
  async fetchScenarios() {
69
60
  const response = await client.query({
70
61
  query: gql `
71
- query {
72
- responses: scenarios {
62
+ query ($inherited: InheritedValueType) {
63
+ responses: scenarios(inherited: $inherited) {
73
64
  items {
74
65
  id
75
66
  name
@@ -101,7 +92,10 @@ let IntegrationMonitor = class IntegrationMonitor extends localize(i18next)(Page
101
92
  total
102
93
  }
103
94
  }
104
- `
95
+ `,
96
+ variables: {
97
+ inherited: InheritedValueType.Include
98
+ }
105
99
  });
106
100
  var colorIndex = {};
107
101
  this.scenarios = (response.data.responses.items || []).map(scenario => {