@operato/process 1.1.34 → 1.1.36
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/CHANGELOG.md +18 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +1 -5
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js.map +1 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +2 -5
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +1 -1
- package/dist/src/ox-editor-process-selector.d.ts +15 -0
- package/dist/src/ox-editor-process-selector.js +86 -0
- package/dist/src/ox-editor-process-selector.js.map +1 -0
- package/dist/src/ox-process-selector.d.ts +15 -0
- package/dist/src/ox-process-selector.js +86 -0
- package/dist/src/ox-process-selector.js.map +1 -0
- package/dist/src/ox-property-editor-process-selector.d.ts +4 -0
- package/dist/src/ox-property-editor-process-selector.js +22 -0
- package/dist/src/ox-property-editor-process-selector.js.map +1 -0
- package/dist/src/selector/ox-process-creation-card.d.ts +14 -0
- package/dist/src/selector/ox-process-creation-card.js +87 -0
- package/dist/src/selector/ox-process-creation-card.js.map +1 -0
- package/dist/src/selector/ox-process-selector.d.ts +44 -0
- package/dist/src/selector/ox-process-selector.js +306 -0
- package/dist/src/selector/ox-process-selector.js.map +1 -0
- package/dist/src/selector/process-creation-card.d.ts +14 -0
- package/dist/src/selector/process-creation-card.js +87 -0
- package/dist/src/selector/process-creation-card.js.map +1 -0
- package/dist/src/selector/process-creation-popup.d.ts +19 -0
- package/dist/src/selector/process-creation-popup.js +100 -0
- package/dist/src/selector/process-creation-popup.js.map +1 -0
- package/dist/src/selector/process-selector.d.ts +44 -0
- package/dist/src/selector/process-selector.js +306 -0
- package/dist/src/selector/process-selector.js.map +1 -0
- package/dist/src/selector/process-thumbnail-card.d.ts +15 -0
- package/dist/src/selector/process-thumbnail-card.js +169 -0
- package/dist/src/selector/process-thumbnail-card.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -8
- package/src/modeller/property-sidebar/effects/property-event-hover.ts +1 -5
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +2 -5
- package/src/ox-editor-process-selector.ts +91 -0
- package/src/ox-property-editor-process-selector.ts +23 -0
- package/src/selector/ox-process-creation-card.ts +94 -0
- package/src/selector/ox-process-selector.ts +321 -0
- package/src/selector/process-creation-popup.ts +102 -0
- package/src/selector/process-thumbnail-card.ts +175 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [1.1.36](https://github.com/heartyoh/ioperato/compare/v1.1.35...v1.1.36) (2022-12-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* add ox-process-selector for process module ([e5b5f3e](https://github.com/heartyoh/ioperato/commit/e5b5f3e350777bff62987ec7ce8137d939edbc5e))
|
|
12
|
+
* migrate board/process related components from things-factory ([9099193](https://github.com/heartyoh/ioperato/commit/90991935dbb83a4b5bc84cfa8ef88e3d50c3e3d6))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### [1.1.35](https://github.com/heartyoh/ioperato/compare/v1.1.34...v1.1.35) (2022-12-16)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @operato/process
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.1.34](https://github.com/heartyoh/ioperato/compare/v1.1.33...v1.1.34) (2022-12-16)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @operato/process
|
|
@@ -35,11 +35,7 @@ export class PropertyEventHover extends LitElement {
|
|
|
35
35
|
|
|
36
36
|
${action == 'popup'
|
|
37
37
|
? html `
|
|
38
|
-
<
|
|
39
|
-
value-key="target"
|
|
40
|
-
.value=${target}
|
|
41
|
-
custom-editor
|
|
42
|
-
></things-editor-board-selector>
|
|
38
|
+
<ox-editor-process-selector value-key="target" .value=${target} custom-editor></ox-editor-process-selector>
|
|
43
39
|
`
|
|
44
40
|
: html `
|
|
45
41
|
<input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-event-hover.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-hover.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAMhD,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE9E,OAAO,IAAI,CAAA;sFACuE,SAAS;;;;;;0DAMrC,MAAM,IAAI,EAAE;;;;;;;;;;;;QAY9D,MAAM,IAAI,OAAO;YACjB,CAAC,CAAC,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"property-event-hover.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-hover.ts"],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,CAAC,CAAC,GAAG,CAAA;wBAChB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,MAAA,IAAI,CAAC,KAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,0CAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;oBAChF,CAAC,CAAC,CAAC;oBACP,EAAE,CACH,CAAA;YACH;gBACE,OAAO,EAAE,CAAA;SACZ;IACH,CAAC;IAED,cAAc,CAAC,CAAQ;QACrB,IAAI,OAAO,GAAG,CAAC,CAAC,MAAqB,CAAA;QACrC,IAAI,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;QAE3C,IAAI,CAAC,GAAG,EAAE;YACR,OAAM;SACP;QAED,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,IAAI,CAAC,KAAK;YACb,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;SACxB,CAAA;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AA3HM,yBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAc","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { EffectsSharedStyle } from './effects-shared-style.js'\nimport { convert } from './value-converter'\n\nexport class PropertyEventHover extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', emphasize, restore } = this.value || {}\n\n return html`\n <input id=\"checkbox-emphasize\" type=\"checkbox\" value-key=\"emphasize\" .checked=${emphasize} />\n <label for=\"checkbox-emphasize\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.emphasize\">emphasize</ox-i18n>\n </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select id=\"tap-select\" value-key=\"action\" .value=${action || ''}>\n <option value=\"\"></option>\n <option value=\"popup\">popup target process</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action == 'popup'\n ? html`\n <ox-editor-process-selector value-key=\"target\" .value=${target} custom-editor></ox-editor-process-selector>\n `\n : html`\n <input\n value-key=\"target\"\n .value=${target || ''}\n list=\"target-list\"\n .placeholder=\"${this._getPlaceHoder(action)}\"\n />\n\n <datalist id=\"target-list\">\n ${this._getTargetList(action).map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n `}\n ${action == 'data-set' || action == 'value-set'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n\n <input id=\"checkbox-restore\" type=\"checkbox\" value-key=\"restore\" .checked=${restore} />\n <label for=\"checkbox-restore\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.restore-on-leave\">restore on leave</ox-i18n>\n </label>\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'popup':\n case 'goto':\n return 'SCENE-100'\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getTargetList(action: string): { value: string; description: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n let ids =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n case 'infoWindow':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import '@operato/input/ox-input-data.js';
|
|
5
5
|
import '@operato/i18n/ox-i18n.js';
|
|
6
|
+
import '../../../ox-editor-process-selector.js';
|
|
6
7
|
import { LitElement } from 'lit';
|
|
7
8
|
import { Properties, Scene } from '@hatiolab/things-scene';
|
|
8
9
|
export declare class PropertyEventTap extends LitElement {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { __decorate } from "tslib";
|
|
5
5
|
import '@operato/input/ox-input-data.js';
|
|
6
6
|
import '@operato/i18n/ox-i18n.js';
|
|
7
|
+
import '../../../ox-editor-process-selector.js';
|
|
7
8
|
import { html, LitElement } from 'lit';
|
|
8
9
|
import { property, state } from 'lit/decorators.js';
|
|
9
10
|
import { scenarios } from '../../../graphql/scenario';
|
|
@@ -61,11 +62,7 @@ export class PropertyEventTap extends LitElement {
|
|
|
61
62
|
|
|
62
63
|
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
63
64
|
? html `
|
|
64
|
-
<
|
|
65
|
-
value-key="target"
|
|
66
|
-
.value=${target}
|
|
67
|
-
custom-editor
|
|
68
|
-
></things-editor-board-selector>
|
|
65
|
+
<ox-editor-process-selector value-key="target" .value=${target} custom-editor></ox-editor-process-selector>
|
|
69
66
|
`
|
|
70
67
|
: action !== 'run'
|
|
71
68
|
? html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-event-tap.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-tap.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAMW,cAAS,GAA6C,EAAE,CAAA;QACxD,eAAU,GAA6C,EAAE,CAAA;IAiMpE,CAAC;IA/LC,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAC5E,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE,MAAM,GAAG,IAA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G,KAAK,QAAQ,EAAE;YACvC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;YAEvC,IAAI,CAAC,KAAK,GAAG;gBACX,GAAG,IAAI,CAAC,KAAK;gBACb,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;iBACxB;aACF,CAAA;SACF;aAAM;YACL,IAAI,CAAC,KAAK,GAAG;gBACX,GAAG,IAAI,CAAC,KAAK;gBACb,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;aACxB,CAAA;SACF;QAED,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC3B,IAAI,MAAM,KAAK,MAAM,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,OAAO,CAAC,CAAA,EAAE;YACnD,0BAA0B;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAA;SAC1B;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AAtMM,uBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAEhC;IAAR,KAAK,EAAE;mDAAyD;AACxD;IAAR,KAAK,EAAE;oDAA0D","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { scenarios } from '../../../graphql/scenario'\nimport { EffectsSharedStyle } from './effects-shared-style'\nimport { convert } from './value-converter'\n\nexport class PropertyEventTap extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n @state() scenarios: { value: string; description: string }[] = []\n @state() targetList: { value: string; description: string }[] = []\n\n async firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', pressed, options } = this.value || {}\n var { input = '(self)', output = true } = options || {}\n\n return html`\n <input id=\"checkbox-pressed\" type=\"checkbox\" value-key=\"pressed\" .checked=${pressed} />\n <label for=\"checkbox-pressed\" class=\"checkbox-label\"> <ox-i18n msgid=\"label.pressed\">pressed</ox-i18n> </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select\n id=\"tap-select\"\n value-key=\"action\"\n .value=${action || ''}\n @change=${async (e: Event) => {\n if ((e.target as HTMLSelectElement).value.includes('scenario')) {\n this.scenarios = (await scenarios()).map(({ name, description }) => {\n return { value: name, description }\n })\n }\n }}\n >\n <option value=\"\"></option>\n <option value=\"run\">run this process</option>\n <option value=\"goto\">go to target process</option>\n <option value=\"link-open\">open new window for target link</option>\n <option value=\"link-move\">move to target link</option>\n <option value=\"route-page\">route to page</option>\n <option value=\"popup\">popup target process</option>\n <option value=\"modal-popup\">modal popup target process</option>\n <option value=\"close-scene\">close current process</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"toggle-info-window\">toggle infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n <option value=\"start-scenario\">start the given scenario</option>\n <option value=\"run-scenario\">run the given scenario</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <things-editor-board-selector\n value-key=\"target\"\n .value=${target}\n custom-editor\n ></things-editor-board-selector>\n `\n : action !== 'run'\n ? html`\n <input\n value-key=\"target\"\n .value=${target}\n list=\"target-list\"\n .placeholder=${this._getPlaceHoder(action)}\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n\n <datalist id=\"target-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n `\n : html``}\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <label for=\"input\"> <ox-i18n msgid=\"label.input-data\">input</ox-i18n> </label>\n <input\n id=\"input\"\n value-key=\"input\"\n .value=${input}\n list=\"input-list\"\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n <datalist id=\"input-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n ${\n /* currently 'goto' does not support returning result */\n action?.includes('popup')\n ? html` <input id=\"checkbox-output\" type=\"checkbox\" value-key=\"output\" .checked=${output} />\n <label for=\"checkbox-output\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.will-get-return\">will-get-return</ox-i18n>\n </label>`\n : html``\n }\n `\n : action === 'data-set' || action === 'value-set' || action === 'start-scenario' || action === 'run-scenario'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getInputList(action: string): { value: string; description: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n case 'popup':\n case 'modal-popup':\n let ids =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n case 'infoWindow':\n case 'toggle-info-window':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n case 'start-scenario':\n case 'run-scenario':\n return this.scenarios\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n if (key === 'input' || key === 'output') {\n var { options = {} } = this.value || {}\n\n this.value = {\n ...this.value,\n options: {\n ...options,\n [key]: convert(element)\n }\n }\n } else {\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n }\n\n var { action } = this.value\n if (action !== 'goto' && !action?.includes('popup')) {\n /* clear unused options */\n delete this.value.options\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"property-event-tap.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-tap.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AACjC,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE3C,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAMW,cAAS,GAA6C,EAAE,CAAA;QACxD,eAAU,GAA6C,EAAE,CAAA;IA6LpE,CAAC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AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAEhC;IAAR,KAAK,EAAE;mDAAyD;AACxD;IAAR,KAAK,EAAE;oDAA0D","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '../../../ox-editor-process-selector.js'\n\nimport { html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { scenarios } from '../../../graphql/scenario'\nimport { EffectsSharedStyle } from './effects-shared-style'\nimport { convert } from './value-converter'\n\nexport class PropertyEventTap extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n @state() scenarios: { value: string; description: string }[] = []\n @state() targetList: { value: string; description: string }[] = []\n\n async firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', pressed, options } = this.value || {}\n var { input = '(self)', output = true } = options || {}\n\n return html`\n <input id=\"checkbox-pressed\" type=\"checkbox\" value-key=\"pressed\" .checked=${pressed} />\n <label for=\"checkbox-pressed\" class=\"checkbox-label\"> <ox-i18n msgid=\"label.pressed\">pressed</ox-i18n> </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select\n id=\"tap-select\"\n value-key=\"action\"\n .value=${action || ''}\n @change=${async (e: Event) => {\n if ((e.target as HTMLSelectElement).value.includes('scenario')) {\n this.scenarios = (await scenarios()).map(({ name, description }) => {\n return { value: name, description }\n })\n }\n }}\n >\n <option value=\"\"></option>\n <option value=\"run\">run this process</option>\n <option value=\"goto\">go to target process</option>\n <option value=\"link-open\">open new window for target link</option>\n <option value=\"link-move\">move to target link</option>\n <option value=\"route-page\">route to page</option>\n <option value=\"popup\">popup target process</option>\n <option value=\"modal-popup\">modal popup target process</option>\n <option value=\"close-scene\">close current process</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"toggle-info-window\">toggle infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n <option value=\"start-scenario\">start the given scenario</option>\n <option value=\"run-scenario\">run the given scenario</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <ox-editor-process-selector value-key=\"target\" .value=${target} custom-editor></ox-editor-process-selector>\n `\n : action !== 'run'\n ? html`\n <input\n value-key=\"target\"\n .value=${target}\n list=\"target-list\"\n .placeholder=${this._getPlaceHoder(action)}\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n\n <datalist id=\"target-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n `\n : html``}\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <label for=\"input\"> <ox-i18n msgid=\"label.input-data\">input</ox-i18n> </label>\n <input\n id=\"input\"\n value-key=\"input\"\n .value=${input}\n list=\"input-list\"\n @focusin=${() => {\n this.targetList = this._getInputList(action)\n }}\n />\n <datalist id=\"input-list\">\n ${this.targetList.map(\n ({ value, description }) => html` <option .value=${value}>${description}</option> `\n )}\n </datalist>\n ${\n /* currently 'goto' does not support returning result */\n action?.includes('popup')\n ? html` <input id=\"checkbox-output\" type=\"checkbox\" value-key=\"output\" .checked=${output} />\n <label for=\"checkbox-output\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.will-get-return\">will-get-return</ox-i18n>\n </label>`\n : html``\n }\n `\n : action === 'data-set' || action === 'value-set' || action === 'start-scenario' || action === 'run-scenario'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getInputList(action: string): { value: string; description: string }[] {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n case 'popup':\n case 'modal-popup':\n let ids =\n (this.scene &&\n this.scene.ids.map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n ids.unshift({ value: '(self)', description: 'self component' })\n return ids\n case 'infoWindow':\n case 'toggle-info-window':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => {\n const id = i.key\n return { value: `#${id}`, description: this.scene!.findById(id)?.get('type') }\n })) ||\n []\n )\n case 'start-scenario':\n case 'run-scenario':\n return this.scenarios\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n if (key === 'input' || key === 'output') {\n var { options = {} } = this.value || {}\n\n this.value = {\n ...this.value,\n options: {\n ...options,\n [key]: convert(element)\n }\n }\n } else {\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n }\n\n var { action } = this.value\n if (action !== 'goto' && !action?.includes('popup')) {\n /* clear unused options */\n delete this.value.options\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -19,7 +19,7 @@ export declare class SceneInspector extends LitElement {
|
|
|
19
19
|
_onclick(e: MouseEvent): void;
|
|
20
20
|
_ondblclick(e: MouseEvent): void;
|
|
21
21
|
get extendedMap(): any;
|
|
22
|
-
getNodeHandleClass(component: Component): "
|
|
22
|
+
getNodeHandleClass(component: Component): "collapsed" | "extended" | "collapsespace";
|
|
23
23
|
isExtended(component: Component): boolean;
|
|
24
24
|
toggleExtended(component: Component): void;
|
|
25
25
|
toggleHidden(component: Component): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/mwc-icon';
|
|
5
|
+
import './selector/ox-process-selector';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
export declare class ProcessSelector extends LitElement {
|
|
8
|
+
static get styles(): import("lit").CSSResult[];
|
|
9
|
+
value?: string;
|
|
10
|
+
properties?: any;
|
|
11
|
+
private popup;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
_onInputChanged(e: Event): void;
|
|
14
|
+
openSelector(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@material/mwc-icon';
|
|
6
|
+
import './selector/ox-process-selector';
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { i18next } from '@operato/i18n';
|
|
10
|
+
import { openPopup } from '@operato/layout';
|
|
11
|
+
let ProcessSelector = class ProcessSelector extends LitElement {
|
|
12
|
+
static get styles() {
|
|
13
|
+
return [
|
|
14
|
+
css `
|
|
15
|
+
:host {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
input[type='text'] {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
mwc-icon {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html `
|
|
37
|
+
<input id="text" type="text" .value=${this.value || ''} @change=${(e) => this._onInputChanged(e)} />
|
|
38
|
+
|
|
39
|
+
<mwc-icon @click=${(e) => this.openSelector()}>dashboard</mwc-icon>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
_onInputChanged(e) {
|
|
43
|
+
var _a;
|
|
44
|
+
this.value = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
45
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
46
|
+
}
|
|
47
|
+
openSelector() {
|
|
48
|
+
if (this.popup) {
|
|
49
|
+
delete this.popup;
|
|
50
|
+
}
|
|
51
|
+
/*
|
|
52
|
+
* 기존 설정된 보드가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
|
|
53
|
+
* 주의. value는 object일 수도 있고, string일 수도 있다.
|
|
54
|
+
* string인 경우에는 해당 보드의 id로 해석한다.
|
|
55
|
+
*/
|
|
56
|
+
var value = this.value || {};
|
|
57
|
+
var template = html `
|
|
58
|
+
<ox-process-selector
|
|
59
|
+
.creatable=${true}
|
|
60
|
+
.value=${value}
|
|
61
|
+
@process-selected=${async (e) => {
|
|
62
|
+
var process = e.detail.process;
|
|
63
|
+
this.value = process.id;
|
|
64
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
65
|
+
this.popup && this.popup.close();
|
|
66
|
+
}}
|
|
67
|
+
></ox-process-selector>
|
|
68
|
+
`;
|
|
69
|
+
this.popup = openPopup(template, {
|
|
70
|
+
backdrop: true,
|
|
71
|
+
size: 'large',
|
|
72
|
+
title: i18next.t('title.select process')
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String })
|
|
78
|
+
], ProcessSelector.prototype, "value", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Object })
|
|
81
|
+
], ProcessSelector.prototype, "properties", void 0);
|
|
82
|
+
ProcessSelector = __decorate([
|
|
83
|
+
customElement('ox-editor-process-selector')
|
|
84
|
+
], ProcessSelector);
|
|
85
|
+
export { ProcessSelector };
|
|
86
|
+
//# sourceMappingURL=ox-editor-process-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-editor-process-selector.js","sourceRoot":"","sources":["../../src/ox-editor-process-selector.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAC3B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGpC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAC7C,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;OAkBF;SACF,CAAA;IACH,CAAC;IAOD,MAAM;QACJ,OAAO,IAAI,CAAA;4CAC6B,IAAI,CAAC,KAAK,IAAI,EAAE,YAAY,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;;yBAEpF,CAAC,CAAa,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;KAC1D,CAAA;IACH,CAAC;IAED,eAAe,CAAC,CAAQ;;QACtB,IAAI,CAAC,KAAK,GAAG,MAAC,CAAC,CAAC,MAAc,0CAAE,KAAK,CAAA;QACrC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;IAED,YAAY;QACV,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAED;;;;WAIG;QACH,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5B,IAAI,QAAQ,GAAG,IAAI,CAAA;;qBAEF,IAAI;iBACR,KAAK;4BACM,KAAK,EAAE,CAAc,EAAE,EAAE;YAC3C,IAAI,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA;YAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;YAEvB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YAEhF,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAClC,CAAC;;KAEJ,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;SACzC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnD6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAiB;AA1BjC,eAAe;IAD3B,aAAa,CAAC,4BAA4B,CAAC;GAC/B,eAAe,CA4E3B;SA5EY,eAAe","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-icon'\nimport './selector/ox-process-selector'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-editor-process-selector')\nexport class ProcessSelector extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n position: relative;\n display: inline-block;\n }\n\n input[type='text'] {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n mwc-icon {\n position: absolute;\n top: 0;\n right: 0;\n }\n `\n ]\n }\n\n @property({ type: String }) value?: string\n @property({ type: Object }) properties?: any\n\n private popup: any\n\n render() {\n return html`\n <input id=\"text\" type=\"text\" .value=${this.value || ''} @change=${(e: Event) => this._onInputChanged(e)} />\n\n <mwc-icon @click=${(e: MouseEvent) => this.openSelector()}>dashboard</mwc-icon>\n `\n }\n\n _onInputChanged(e: Event) {\n this.value = (e.target as any)?.value\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n /*\n * 기존 설정된 보드가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var value = this.value || {}\n\n var template = html`\n <ox-process-selector\n .creatable=${true}\n .value=${value}\n @process-selected=${async (e: CustomEvent) => {\n var process = e.detail.process\n this.value = process.id\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.popup && this.popup.close()\n }}\n ></ox-process-selector>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.select process')\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/mwc-icon';
|
|
5
|
+
import './selector/process-selector';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
export declare class ProcessSelector extends LitElement {
|
|
8
|
+
static get styles(): import("lit").CSSResult[];
|
|
9
|
+
value?: string;
|
|
10
|
+
properties?: any;
|
|
11
|
+
private popup;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
_onInputChanged(e: Event): void;
|
|
14
|
+
openSelector(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@material/mwc-icon';
|
|
6
|
+
import './selector/process-selector';
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { i18next } from '@operato/i18n';
|
|
10
|
+
import { openPopup } from '@operato/layout';
|
|
11
|
+
let ProcessSelector = class ProcessSelector extends LitElement {
|
|
12
|
+
static get styles() {
|
|
13
|
+
return [
|
|
14
|
+
css `
|
|
15
|
+
:host {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
input[type='text'] {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
mwc-icon {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html `
|
|
37
|
+
<input id="text" type="text" .value=${this.value || ''} @change=${(e) => this._onInputChanged(e)} />
|
|
38
|
+
|
|
39
|
+
<mwc-icon @click=${(e) => this.openSelector()}>dashboard</mwc-icon>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
_onInputChanged(e) {
|
|
43
|
+
var _a;
|
|
44
|
+
this.value = (_a = e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
45
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
46
|
+
}
|
|
47
|
+
openSelector() {
|
|
48
|
+
if (this.popup) {
|
|
49
|
+
delete this.popup;
|
|
50
|
+
}
|
|
51
|
+
/*
|
|
52
|
+
* 기존 설정된 보드가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
|
|
53
|
+
* 주의. value는 object일 수도 있고, string일 수도 있다.
|
|
54
|
+
* string인 경우에는 해당 보드의 id로 해석한다.
|
|
55
|
+
*/
|
|
56
|
+
var value = this.value || {};
|
|
57
|
+
var template = html `
|
|
58
|
+
<process-selector
|
|
59
|
+
.creatable=${true}
|
|
60
|
+
.value=${value}
|
|
61
|
+
@process-selected=${async (e) => {
|
|
62
|
+
var process = e.detail.process;
|
|
63
|
+
this.value = process.id;
|
|
64
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
65
|
+
this.popup && this.popup.close();
|
|
66
|
+
}}
|
|
67
|
+
></process-selector>
|
|
68
|
+
`;
|
|
69
|
+
this.popup = openPopup(template, {
|
|
70
|
+
backdrop: true,
|
|
71
|
+
size: 'large',
|
|
72
|
+
title: i18next.t('title.select process')
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String })
|
|
78
|
+
], ProcessSelector.prototype, "value", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Object })
|
|
81
|
+
], ProcessSelector.prototype, "properties", void 0);
|
|
82
|
+
ProcessSelector = __decorate([
|
|
83
|
+
customElement('ox-process-selector')
|
|
84
|
+
], ProcessSelector);
|
|
85
|
+
export { ProcessSelector };
|
|
86
|
+
//# sourceMappingURL=ox-process-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,KAAK;4BACM,KAAK,EAAE,CAAc,EAAE,EAAE;YAC3C,IAAI,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA;YAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;YAEvB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YAEhF,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAClC,CAAC;;KAEJ,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;SACzC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnD6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAiB;AA1BjC,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CA4E3B;SA5EY,eAAe","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-icon'\nimport './selector/process-selector'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-process-selector')\nexport class ProcessSelector extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n position: relative;\n display: inline-block;\n }\n\n input[type='text'] {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n mwc-icon {\n position: absolute;\n top: 0;\n right: 0;\n }\n `\n ]\n }\n\n @property({ type: String }) value?: string\n @property({ type: Object }) properties?: any\n\n private popup: any\n\n render() {\n return html`\n <input id=\"text\" type=\"text\" .value=${this.value || ''} @change=${(e: Event) => this._onInputChanged(e)} />\n\n <mwc-icon @click=${(e: MouseEvent) => this.openSelector()}>dashboard</mwc-icon>\n `\n }\n\n _onInputChanged(e: Event) {\n this.value = (e.target as any)?.value\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n /*\n * 기존 설정된 보드가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var value = this.value || {}\n\n var template = html`\n <process-selector\n .creatable=${true}\n .value=${value}\n @process-selected=${async (e: CustomEvent) => {\n var process = e.detail.process\n this.value = process.id\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.popup && this.popup.close()\n }}\n ></process-selector>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.select process')\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import './ox-editor-process-selector';
|
|
6
|
+
import { html } from 'lit';
|
|
7
|
+
import { customElement } from 'lit/decorators.js';
|
|
8
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
9
|
+
let PropertyEditorProcessSelector = class PropertyEditorProcessSelector extends OxPropertyEditor {
|
|
10
|
+
static get styles() {
|
|
11
|
+
return [...OxPropertyEditor.styles];
|
|
12
|
+
}
|
|
13
|
+
editorTemplate(value, spec) {
|
|
14
|
+
return html `
|
|
15
|
+
<ox-editor-process-selector id="editor" .value=${value} .properties=${spec.property}></ox-editor-process-selector>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
PropertyEditorProcessSelector = __decorate([
|
|
20
|
+
customElement('ox-property-editor-process-selector')
|
|
21
|
+
], PropertyEditorProcessSelector);
|
|
22
|
+
//# sourceMappingURL=ox-property-editor-process-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-property-editor-process-selector.js","sourceRoot":"","sources":["../../src/ox-property-editor-process-selector.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,8BAA8B,CAAA;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAGzE,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,gBAAgB;IAC1D,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAED,cAAc,CAAC,KAAU,EAAE,IAAkB;QAC3C,OAAO,IAAI,CAAA;uDACwC,KAAK,gBAAgB,IAAI,CAAC,QAAQ;KACpF,CAAA;IACH,CAAC;CACF,CAAA;AAVK,6BAA6B;IADlC,aAAa,CAAC,qCAAqC,CAAC;GAC/C,6BAA6B,CAUlC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-editor-process-selector'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\n\n@customElement('ox-property-editor-process-selector')\nclass PropertyEditorProcessSelector extends OxPropertyEditor {\n static get styles() {\n return [...OxPropertyEditor.styles]\n }\n\n editorTemplate(value: any, spec: PropertySpec) {\n return html`\n <ox-editor-process-selector id=\"editor\" .value=${value} .properties=${spec.property}></ox-editor-process-selector>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '@material/mwc-icon';
|
|
2
|
+
import './process-creation-popup';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
declare const ProcessCreationCard_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
5
|
+
export declare class ProcessCreationCard extends ProcessCreationCard_base {
|
|
6
|
+
static get styles(): import("lit").CSSResult[];
|
|
7
|
+
defaultGroup?: string;
|
|
8
|
+
groups: any;
|
|
9
|
+
private popup;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
onClick(): void;
|
|
12
|
+
reset(): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/mwc-icon';
|
|
3
|
+
import './process-creation-popup';
|
|
4
|
+
import { css, html, LitElement } from 'lit';
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
+
import { i18next, localize } from '@operato/i18n';
|
|
7
|
+
import { openPopup } from '@operato/layout';
|
|
8
|
+
let ProcessCreationCard = class ProcessCreationCard extends localize(i18next)(LitElement) {
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [
|
|
11
|
+
css `
|
|
12
|
+
:host {
|
|
13
|
+
display: flex;
|
|
14
|
+
border: var(--card-list-create-border);
|
|
15
|
+
border-radius: var(--card-list-create-border-radius);
|
|
16
|
+
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
|
|
19
|
+
align-content: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
div {
|
|
24
|
+
text-align: center;
|
|
25
|
+
font-size: 0.8em;
|
|
26
|
+
color: var(--card-list-create-color);
|
|
27
|
+
text-transform: capitalize;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
mwc-icon {
|
|
31
|
+
display: block;
|
|
32
|
+
font-size: 3.5em;
|
|
33
|
+
color: var(--card-list-create-icon-color);
|
|
34
|
+
}
|
|
35
|
+
`
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html `<div @click=${(e) => this.onClick()}>
|
|
40
|
+
<mwc-icon>add_circle_outline</mwc-icon>create process
|
|
41
|
+
</div> `;
|
|
42
|
+
}
|
|
43
|
+
onClick() {
|
|
44
|
+
if (this.popup) {
|
|
45
|
+
delete this.popup;
|
|
46
|
+
}
|
|
47
|
+
/*
|
|
48
|
+
* 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
|
|
49
|
+
* 주의. value는 object일 수도 있고, string일 수도 있다.
|
|
50
|
+
* string인 경우에는 해당 보드의 id로 해석한다.
|
|
51
|
+
*/
|
|
52
|
+
var template = html `
|
|
53
|
+
<process-creation-popup
|
|
54
|
+
.defaultGroup=${this.defaultGroup}
|
|
55
|
+
.groups=${this.groups}
|
|
56
|
+
@create-process=${async (e) => {
|
|
57
|
+
var { name, description, groupId } = e.detail;
|
|
58
|
+
this.dispatchEvent(new CustomEvent('create-process', {
|
|
59
|
+
detail: {
|
|
60
|
+
name,
|
|
61
|
+
description,
|
|
62
|
+
groupId
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
this.popup && this.popup.close();
|
|
66
|
+
}}
|
|
67
|
+
></process-creation-popup>
|
|
68
|
+
`;
|
|
69
|
+
this.popup = openPopup(template, {
|
|
70
|
+
backdrop: true,
|
|
71
|
+
size: 'large',
|
|
72
|
+
title: i18next.t('title.create-process')
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
reset() { }
|
|
76
|
+
};
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: String })
|
|
79
|
+
], ProcessCreationCard.prototype, "defaultGroup", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: Array })
|
|
82
|
+
], ProcessCreationCard.prototype, "groups", void 0);
|
|
83
|
+
ProcessCreationCard = __decorate([
|
|
84
|
+
customElement('ox-process-creation-card')
|
|
85
|
+
], ProcessCreationCard);
|
|
86
|
+
export { ProcessCreationCard };
|
|
87
|
+
//# sourceMappingURL=ox-process-creation-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-process-creation-card.js","sourceRoot":"","sources":["../../../src/selector/ox-process-creation-card.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGpC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IACpE,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;OAwBF;SACF,CAAA;IACH,CAAC;IAQD,MAAM;QACJ,OAAO,IAAI,CAAA,eAAe,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;;YAE9C,CAAA;IACV,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAED;;;;WAIG;QACH,IAAI,QAAQ,GAAG,IAAI,CAAA;;wBAEC,IAAI,CAAC,YAAY;kBACvB,IAAI,CAAC,MAAM;0BACH,KAAK,EAAE,CAAc,EAAE,EAAE;YACzC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,CAAA;YAE7C,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE;oBACN,IAAI;oBACJ,WAAW;oBACX,OAAO;iBACR;aACF,CAAC,CACH,CAAA;YAED,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAClC,CAAC;;KAEJ,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;SACzC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,KAAI,CAAC;CACX,CAAA;AAnD6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAY;AAjC3B,mBAAmB;IAD/B,aAAa,CAAC,0BAA0B,CAAC;GAC7B,mBAAmB,CAmF/B;SAnFY,mBAAmB","sourcesContent":["import '@material/mwc-icon'\nimport './process-creation-popup'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-process-creation-card')\nexport class ProcessCreationCard extends localize(i18next)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n border: var(--card-list-create-border);\n border-radius: var(--card-list-create-border-radius);\n\n background-color: #fff;\n\n align-content: center;\n justify-content: center;\n }\n\n div {\n text-align: center;\n font-size: 0.8em;\n color: var(--card-list-create-color);\n text-transform: capitalize;\n }\n\n mwc-icon {\n display: block;\n font-size: 3.5em;\n color: var(--card-list-create-icon-color);\n }\n `\n ]\n }\n\n /* default group id */\n @property({ type: String }) defaultGroup?: string\n @property({ type: Array }) groups: any\n\n private popup: any\n\n render() {\n return html`<div @click=${(e: Event) => this.onClick()}>\n <mwc-icon>add_circle_outline</mwc-icon>create process\n </div> `\n }\n\n onClick() {\n if (this.popup) {\n delete this.popup\n }\n\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <process-creation-popup\n .defaultGroup=${this.defaultGroup}\n .groups=${this.groups}\n @create-process=${async (e: CustomEvent) => {\n var { name, description, groupId } = e.detail\n\n this.dispatchEvent(\n new CustomEvent('create-process', {\n detail: {\n name,\n description,\n groupId\n }\n })\n )\n\n this.popup && this.popup.close()\n }}\n ></process-creation-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.create-process')\n })\n }\n\n reset() {}\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import './ox-process-creation-card';
|
|
2
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
declare const ProcessSelector_base: (new (...args: any[]) => {
|
|
4
|
+
_infiniteScrollOptions: {
|
|
5
|
+
threshold: number;
|
|
6
|
+
limit: number;
|
|
7
|
+
totalProp: string;
|
|
8
|
+
pageProp: string;
|
|
9
|
+
};
|
|
10
|
+
onScroll: import("lodash").DebouncedFunc<(e: any) => void>;
|
|
11
|
+
readonly scrollTargetEl: HTMLElement | null;
|
|
12
|
+
scrollAction(): Promise<void>;
|
|
13
|
+
}) & (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
14
|
+
export declare class ProcessSelector extends ProcessSelector_base {
|
|
15
|
+
static get styles(): import("lit").CSSResult[];
|
|
16
|
+
groups: {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
}[];
|
|
21
|
+
processes: any[];
|
|
22
|
+
group?: string;
|
|
23
|
+
creatable: boolean;
|
|
24
|
+
value?: string;
|
|
25
|
+
private _page;
|
|
26
|
+
private _total;
|
|
27
|
+
constructor();
|
|
28
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
29
|
+
get scrollTargetEl(): HTMLElement | null;
|
|
30
|
+
scrollAction(): Promise<void>;
|
|
31
|
+
firstUpdated(): void;
|
|
32
|
+
updated(changed: PropertyValues<this>): Promise<void>;
|
|
33
|
+
onClickSelect(process: any): void;
|
|
34
|
+
onCreateProcess(e: CustomEvent): Promise<void>;
|
|
35
|
+
refreshGroups(): Promise<void>;
|
|
36
|
+
refreshProcesses(): Promise<void>;
|
|
37
|
+
appendProcesses(): Promise<void>;
|
|
38
|
+
getProcesses({ page, limit }?: {
|
|
39
|
+
page?: number | undefined;
|
|
40
|
+
limit?: number | undefined;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
createProcess(name: string, description: string, groupId: string): Promise<any>;
|
|
43
|
+
}
|
|
44
|
+
export {};
|