@operato/process 1.1.77 → 1.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/process",
3
- "version": "1.1.77",
3
+ "version": "1.1.80",
4
4
  "description": "Webcomponent for business process modeling following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -67,18 +67,18 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@open-wc/scoped-elements": "^2.1.3",
70
- "@operato/app": "^1.1.77",
71
- "@operato/board": "^1.1.77",
72
- "@operato/data-grist": "^1.1.77",
73
- "@operato/font": "^1.1.77",
74
- "@operato/graphql": "^1.1.53",
75
- "@operato/i18n": "^1.1.53",
76
- "@operato/input": "^1.1.77",
77
- "@operato/markdown": "^1.1.77",
78
- "@operato/popup": "^1.1.77",
79
- "@operato/property-editor": "^1.1.77",
80
- "@operato/styles": "^1.1.77",
81
- "@operato/utils": "^1.1.66",
70
+ "@operato/app": "^1.1.80",
71
+ "@operato/board": "^1.1.80",
72
+ "@operato/data-grist": "^1.1.80",
73
+ "@operato/font": "^1.1.80",
74
+ "@operato/graphql": "^1.1.79",
75
+ "@operato/i18n": "^1.1.79",
76
+ "@operato/input": "^1.1.80",
77
+ "@operato/markdown": "^1.1.79",
78
+ "@operato/popup": "^1.1.80",
79
+ "@operato/property-editor": "^1.1.80",
80
+ "@operato/styles": "^1.1.79",
81
+ "@operato/utils": "^1.1.79",
82
82
  "@polymer/paper-dropdown-menu": "^3.2.0",
83
83
  "@types/file-saver": "^2.0.4",
84
84
  "@types/sortablejs": "^1.10.7",
@@ -127,5 +127,5 @@
127
127
  "prettier --write"
128
128
  ]
129
129
  },
130
- "gitHead": "58e6e0aa8134ef783d85f42bf4e789edc6566f87"
130
+ "gitHead": "d35d64d05d106e8039e98312414223c5b9c2cb39"
131
131
  }
@@ -1,15 +0,0 @@
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
- }
@@ -1,86 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-process-selector.js","sourceRoot":"","sources":["../../src/ox-process-selector.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAC3B,OAAO,6BAA6B,CAAA;AAEpC,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,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E,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"]}
@@ -1,14 +0,0 @@
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 {};
@@ -1,87 +0,0 @@
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('process-creation-card')
85
- ], ProcessCreationCard);
86
- export { ProcessCreationCard };
87
- //# sourceMappingURL=process-creation-card.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-creation-card.js","sourceRoot":"","sources":["../../../src/selector/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,uBAAuB,CAAC;GAC1B,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('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"]}
@@ -1,44 +0,0 @@
1
- import './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 {};
@@ -1,306 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import './process-creation-card';
3
- import gql from 'graphql-tag';
4
- import { css, html, LitElement } from 'lit';
5
- import { customElement, property } from 'lit/decorators.js';
6
- import { buildArgs, client, gqlContext } from '@operato/graphql';
7
- import { i18next, localize } from '@operato/i18n';
8
- import { ScrollbarStyles } from '@operato/styles';
9
- import InfiniteScrollable from '@operato/utils/mixins/infinite-scrollable.js';
10
- const FETCH_PROCESS_LIST_GQL = (listParam) => {
11
- return gql `
12
- {
13
- processes(${buildArgs(listParam)}) {
14
- items {
15
- id
16
- name
17
- description
18
- thumbnail
19
- }
20
- total
21
- }
22
- }
23
- `;
24
- };
25
- const FETCH_PROCESS_GROUP_LIST_GQL = gql `
26
- {
27
- processGroups {
28
- items {
29
- id
30
- name
31
- description
32
- }
33
- total
34
- }
35
- }
36
- `;
37
- const CREATE_PROCESS_GQL = gql `
38
- mutation CreateProcess($process: NewProcess!) {
39
- createProcess(process: $process) {
40
- id
41
- name
42
- description
43
- model
44
- createdAt
45
- updatedAt
46
- }
47
- }
48
- `;
49
- let ProcessSelector = class ProcessSelector extends InfiniteScrollable(localize(i18next)(LitElement)) {
50
- static get styles() {
51
- return [
52
- ScrollbarStyles,
53
- css `
54
- :host {
55
- display: grid;
56
- grid-template-rows: auto auto 1fr;
57
- overflow: hidden;
58
- background-color: var(--popup-content-background-color);
59
- }
60
-
61
- #main {
62
- overflow: auto;
63
- padding: var(--popup-content-padding);
64
- display: grid;
65
- grid-template-columns: var(--card-list-template);
66
- grid-auto-rows: var(--card-list-rows-height);
67
- grid-gap: 20px;
68
- }
69
-
70
- .card {
71
- display: flex;
72
- flex-direction: column;
73
- align-items: center;
74
- overflow: hidden;
75
- border-radius: var(--card-list-border-radius);
76
- background-color: var(--card-list-background-color);
77
- }
78
-
79
- .card[selected] {
80
- border: red solid;
81
- }
82
-
83
- .card.create {
84
- overflow: visible;
85
- }
86
-
87
- .card:hover {
88
- cursor: pointer;
89
- }
90
-
91
- .card > .name {
92
- background-color: var(--board-renderer-name-background-color);
93
- opacity: 0.8;
94
- margin-top: -35px;
95
- width: 100%;
96
- color: #fff;
97
- font-weight: bolder;
98
- font-size: 13px;
99
- text-indent: 7px;
100
- }
101
-
102
- .card > .description {
103
- background-color: rgba(0, 0, 0, 0.7);
104
- width: 100%;
105
- min-height: 15px;
106
- font-size: 0.6rem;
107
- color: #fff;
108
- text-indent: 7px;
109
- }
110
- .card img {
111
- max-height: 100%;
112
- min-height: 100%;
113
- }
114
-
115
- #filter {
116
- padding: var(--popup-content-padding);
117
- background-color: #fff;
118
- box-shadow: var(--box-shadow);
119
- }
120
-
121
- #filter * {
122
- font-size: 15px;
123
- }
124
-
125
- select {
126
- text-transform: capitalize;
127
- float: right;
128
- }
129
- `
130
- ];
131
- }
132
- constructor() {
133
- super();
134
- this.groups = [];
135
- this.processes = [];
136
- this.creatable = false;
137
- this._page = 1;
138
- this._total = 0;
139
- this._infiniteScrollOptions.limit = 20;
140
- }
141
- render() {
142
- return html `
143
- <div id="filter">
144
- <select
145
- @change=${(e) => {
146
- var _a;
147
- this.group = (_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
148
- this.requestUpdate();
149
- }}
150
- >
151
- <option value="">${i18next.t('label.all')}</option>
152
- ${this.groups.map(group => html ` <option value=${group.id}>${group.description}</option> `)}
153
- </select>
154
- </div>
155
-
156
- <div
157
- id="main"
158
- @scroll=${(e) => {
159
- this.onScroll(e);
160
- }}
161
- >
162
- ${this.creatable
163
- ? html `
164
- <process-creation-card
165
- class="card create"
166
- .groups=${this.groups}
167
- .defaultGroup=${this.group}
168
- @create-process=${(e) => this.onCreateProcess(e)}
169
- ></process-creation-card>
170
- `
171
- : html ``}
172
- ${this.processes.map(process => html `
173
- <div
174
- class="card"
175
- @click=${(e) => this.onClickSelect(process)}
176
- ?selected=${this.value === process.id}
177
- >
178
- <img src=${process.thumbnail} />
179
- <div class="name">${process.name}</div>
180
- <div class="description">${process.description}</div>
181
- </div>
182
- `)}
183
- </div>
184
- `;
185
- }
186
- //@ts-ignore
187
- get scrollTargetEl() {
188
- return this.renderRoot.querySelector('#main');
189
- }
190
- async scrollAction() {
191
- return this.appendProcesses();
192
- }
193
- firstUpdated() {
194
- this.refreshGroups();
195
- }
196
- async updated(changed) {
197
- if (changed.has('group')) {
198
- this.refreshProcesses();
199
- }
200
- }
201
- onClickSelect(process) {
202
- this.dispatchEvent(new CustomEvent('process-selected', {
203
- composed: true,
204
- bubbles: true,
205
- detail: {
206
- process
207
- }
208
- }));
209
- }
210
- async onCreateProcess(e) {
211
- var { name, description, groupId } = e.detail;
212
- await this.createProcess(name, description, groupId);
213
- this.refreshProcesses();
214
- }
215
- async refreshGroups() {
216
- var groupListResponse = await client.query({
217
- query: FETCH_PROCESS_GROUP_LIST_GQL,
218
- context: gqlContext()
219
- });
220
- if (!groupListResponse || !groupListResponse.data)
221
- return;
222
- var groups = groupListResponse.data.processGroups.items;
223
- this.groups = [...groups];
224
- this.group = groups.filter((group) => group.id == this.group).length > 0 ? this.group : '';
225
- }
226
- async refreshProcesses() {
227
- var processes = await this.getProcesses();
228
- this.processes = [...processes];
229
- var creationCard = this.renderRoot.querySelector('process-creation-card');
230
- if (creationCard) {
231
- ;
232
- creationCard.reset();
233
- }
234
- }
235
- async appendProcesses() {
236
- var processes = await this.getProcesses({ page: this._page + 1 });
237
- this.processes = [...this.processes, ...processes];
238
- }
239
- async getProcesses({ page = 1, limit = this._infiniteScrollOptions.limit } = {}) {
240
- var filters = [];
241
- var sortings = [];
242
- var pagination = {
243
- limit,
244
- page
245
- };
246
- if (this.group)
247
- filters.push({
248
- name: 'groupId',
249
- operator: 'eq',
250
- value: this.group
251
- });
252
- var params = {
253
- filters,
254
- sortings,
255
- pagination
256
- };
257
- var processListResponse = await client.query({
258
- query: FETCH_PROCESS_LIST_GQL(params),
259
- context: gqlContext()
260
- });
261
- if (!processListResponse || !processListResponse.data)
262
- return [];
263
- this._total = processListResponse.data.processes.total;
264
- this._page = page;
265
- return processListResponse.data.processes.items;
266
- }
267
- async createProcess(name, description, groupId) {
268
- var model = JSON.stringify({
269
- width: 800,
270
- height: 600
271
- });
272
- const response = await client.mutate({
273
- mutation: CREATE_PROCESS_GQL,
274
- variables: {
275
- process: {
276
- name,
277
- description,
278
- groupId,
279
- model
280
- }
281
- },
282
- context: gqlContext()
283
- });
284
- return response.data;
285
- }
286
- };
287
- __decorate([
288
- property({ type: Array })
289
- ], ProcessSelector.prototype, "groups", void 0);
290
- __decorate([
291
- property({ type: Array })
292
- ], ProcessSelector.prototype, "processes", void 0);
293
- __decorate([
294
- property({ type: String })
295
- ], ProcessSelector.prototype, "group", void 0);
296
- __decorate([
297
- property({ type: Boolean })
298
- ], ProcessSelector.prototype, "creatable", void 0);
299
- __decorate([
300
- property({ type: String })
301
- ], ProcessSelector.prototype, "value", void 0);
302
- ProcessSelector = __decorate([
303
- customElement('process-selector')
304
- ], ProcessSelector);
305
- export { ProcessSelector };
306
- //# sourceMappingURL=process-selector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-selector.js","sourceRoot":"","sources":["../../../src/selector/process-selector.ts"],"names":[],"mappings":";AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAA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AI;YAAE,OAAO,EAAE,CAAA;QAChE,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACtD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QAEjB,OAAO,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;IACjD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAY,EAAE,WAAmB,EAAE,OAAe;QACpE,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;YACzB,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,WAAW;oBACX,OAAO;oBACP,KAAK;iBACN;aACF;YACD,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF,CAAA;AAtL4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAiE;AAChE;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAsB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AACb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAe;AAxF/B,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CA0Q3B;SA1QY,eAAe","sourcesContent":["import './process-creation-card'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { buildArgs, client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport InfiniteScrollable from '@operato/utils/mixins/infinite-scrollable.js'\n\nconst FETCH_PROCESS_LIST_GQL = (listParam: any) => {\n return gql`\n {\n processes(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n }\n total\n }\n }\n`\n}\n\nconst FETCH_PROCESS_GROUP_LIST_GQL = gql`\n {\n processGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n`\n\nconst CREATE_PROCESS_GQL = gql`\n mutation CreateProcess($process: NewProcess!) {\n createProcess(process: $process) {\n id\n name\n description\n model\n createdAt\n updatedAt\n }\n }\n`\n\n@customElement('process-selector')\nexport class ProcessSelector extends InfiniteScrollable(localize(i18next)(LitElement)) {\n static get styles() {\n return [\n ScrollbarStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: auto auto 1fr;\n overflow: hidden;\n background-color: var(--popup-content-background-color);\n }\n\n #main {\n overflow: auto;\n padding: var(--popup-content-padding);\n display: grid;\n grid-template-columns: var(--card-list-template);\n grid-auto-rows: var(--card-list-rows-height);\n grid-gap: 20px;\n }\n\n .card {\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n border-radius: var(--card-list-border-radius);\n background-color: var(--card-list-background-color);\n }\n\n .card[selected] {\n border: red solid;\n }\n\n .card.create {\n overflow: visible;\n }\n\n .card:hover {\n cursor: pointer;\n }\n\n .card > .name {\n background-color: var(--board-renderer-name-background-color);\n opacity: 0.8;\n margin-top: -35px;\n width: 100%;\n color: #fff;\n font-weight: bolder;\n font-size: 13px;\n text-indent: 7px;\n }\n\n .card > .description {\n background-color: rgba(0, 0, 0, 0.7);\n width: 100%;\n min-height: 15px;\n font-size: 0.6rem;\n color: #fff;\n text-indent: 7px;\n }\n .card img {\n max-height: 100%;\n min-height: 100%;\n }\n\n #filter {\n padding: var(--popup-content-padding);\n background-color: #fff;\n box-shadow: var(--box-shadow);\n }\n\n #filter * {\n font-size: 15px;\n }\n\n select {\n text-transform: capitalize;\n float: right;\n }\n `\n ]\n }\n\n @property({ type: Array }) groups: { id: string; name: string; description: string }[] = []\n @property({ type: Array }) processes: any[] = []\n @property({ type: String }) group?: string\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: String }) value?: string\n\n private _page: number = 1\n private _total: number = 0\n\n constructor() {\n super()\n\n this._infiniteScrollOptions.limit = 20\n }\n\n render() {\n return html`\n <div id=\"filter\">\n <select\n @change=${(e: Event) => {\n this.group = (e.currentTarget as any)?.value\n this.requestUpdate()\n }}\n >\n <option value=\"\">${i18next.t('label.all')}</option>\n ${this.groups.map(group => html` <option value=${group.id}>${group.description}</option> `)}\n </select>\n </div>\n\n <div\n id=\"main\"\n @scroll=${(e: Event) => {\n this.onScroll(e)\n }}\n >\n ${this.creatable\n ? html`\n <process-creation-card\n class=\"card create\"\n .groups=${this.groups}\n .defaultGroup=${this.group}\n @create-process=${(e: CustomEvent) => this.onCreateProcess(e)}\n ></process-creation-card>\n `\n : html``}\n ${this.processes.map(\n process => html`\n <div\n class=\"card\"\n @click=${(e: Event) => this.onClickSelect(process)}\n ?selected=${this.value === process.id}\n >\n <img src=${process.thumbnail} />\n <div class=\"name\">${process.name}</div>\n <div class=\"description\">${process.description}</div>\n </div>\n `\n )}\n </div>\n `\n }\n\n //@ts-ignore\n get scrollTargetEl(): HTMLElement | null {\n return this.renderRoot.querySelector('#main') as HTMLElement\n }\n\n async scrollAction() {\n return this.appendProcesses()\n }\n\n firstUpdated() {\n this.refreshGroups()\n }\n\n async updated(changed: PropertyValues<this>) {\n if (changed.has('group')) {\n this.refreshProcesses()\n }\n }\n\n onClickSelect(process: any) {\n this.dispatchEvent(\n new CustomEvent('process-selected', {\n composed: true,\n bubbles: true,\n detail: {\n process\n }\n })\n )\n }\n\n async onCreateProcess(e: CustomEvent) {\n var { name, description, groupId } = e.detail\n\n await this.createProcess(name, description, groupId)\n this.refreshProcesses()\n }\n\n async refreshGroups() {\n var groupListResponse = await client.query({\n query: FETCH_PROCESS_GROUP_LIST_GQL,\n context: gqlContext()\n })\n\n if (!groupListResponse || !groupListResponse.data) return\n\n var groups = groupListResponse.data.processGroups.items\n this.groups = [...groups]\n\n this.group = groups.filter((group: { id: string }) => group.id == this.group).length > 0 ? this.group : ''\n }\n\n async refreshProcesses() {\n var processes = await this.getProcesses()\n this.processes = [...processes]\n\n var creationCard = this.renderRoot.querySelector('process-creation-card')\n if (creationCard) {\n ;(creationCard as any).reset()\n }\n }\n\n async appendProcesses() {\n var processes = await this.getProcesses({ page: this._page + 1 })\n this.processes = [...this.processes, ...processes]\n }\n\n async getProcesses({ page = 1, limit = this._infiniteScrollOptions.limit } = {}) {\n var filters = []\n var sortings = [] as any[]\n var pagination = {\n limit,\n page\n }\n\n if (this.group)\n filters.push({\n name: 'groupId',\n operator: 'eq',\n value: this.group\n })\n\n var params = {\n filters,\n sortings,\n pagination\n }\n var processListResponse = await client.query({\n query: FETCH_PROCESS_LIST_GQL(params),\n context: gqlContext()\n })\n\n if (!processListResponse || !processListResponse.data) return []\n this._total = processListResponse.data.processes.total\n this._page = page\n\n return processListResponse.data.processes.items\n }\n\n async createProcess(name: string, description: string, groupId: string) {\n var model = JSON.stringify({\n width: 800,\n height: 600\n })\n\n const response = await client.mutate({\n mutation: CREATE_PROCESS_GQL,\n variables: {\n process: {\n name,\n description,\n groupId,\n model\n }\n },\n context: gqlContext()\n })\n\n return response.data\n }\n}\n"]}