@operato/process 9.0.0-beta.4 → 9.0.0-beta.5

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 (56) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/src/graphql/index.d.ts +3 -3
  3. package/dist/src/graphql/index.js +3 -3
  4. package/dist/src/graphql/index.js.map +1 -1
  5. package/dist/src/graphql/process-group.d.ts +1 -1
  6. package/dist/src/graphql/process-group.js.map +1 -1
  7. package/dist/src/graphql/process.d.ts +1 -1
  8. package/dist/src/graphql/process.js.map +1 -1
  9. package/dist/src/modeller/component-toolbar/component-menu.d.ts +3 -3
  10. package/dist/src/modeller/component-toolbar/component-menu.js +1 -1
  11. package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -1
  12. package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +2 -2
  13. package/dist/src/modeller/component-toolbar/component-toolbar.js +1 -1
  14. package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -1
  15. package/dist/src/modeller/edit-toolbar.js +1 -1
  16. package/dist/src/modeller/edit-toolbar.js.map +1 -1
  17. package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +4 -2
  18. package/dist/src/modeller/property-sidebar/effects/property-event-hover.js.map +1 -1
  19. package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +6 -6
  20. package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
  21. package/dist/src/modeller/property-sidebar/effects/property-event.d.ts +3 -3
  22. package/dist/src/modeller/property-sidebar/effects/property-event.js +4 -4
  23. package/dist/src/modeller/property-sidebar/effects/property-event.js.map +1 -1
  24. package/dist/src/modeller/property-sidebar/effects/property-shadow.js +1 -1
  25. package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +1 -1
  26. package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +1 -1
  27. package/dist/src/modeller/property-sidebar/property-sidebar.js +1 -1
  28. package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -1
  29. package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +1 -1
  30. package/dist/src/modeller/property-sidebar/shapes/shapes.js +3 -3
  31. package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -1
  32. package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +1 -1
  33. package/dist/src/modeller/property-sidebar/specifics/specifics.js +1 -1
  34. package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -1
  35. package/dist/src/ox-editor-process-selector.d.ts +1 -1
  36. package/dist/src/ox-editor-process-selector.js +1 -1
  37. package/dist/src/ox-editor-process-selector.js.map +1 -1
  38. package/dist/src/ox-process-list.js +3 -3
  39. package/dist/src/ox-process-list.js.map +1 -1
  40. package/dist/src/ox-process-modeller.d.ts +6 -6
  41. package/dist/src/ox-process-modeller.js +4 -4
  42. package/dist/src/ox-process-modeller.js.map +1 -1
  43. package/dist/src/ox-property-editor-process-selector.d.ts +1 -1
  44. package/dist/src/ox-property-editor-process-selector.js +1 -1
  45. package/dist/src/ox-property-editor-process-selector.js.map +1 -1
  46. package/dist/src/selector/ox-process-creation-card.d.ts +1 -1
  47. package/dist/src/selector/ox-process-creation-card.js +1 -1
  48. package/dist/src/selector/ox-process-creation-card.js.map +1 -1
  49. package/dist/src/selector/ox-process-selector.d.ts +1 -1
  50. package/dist/src/selector/ox-process-selector.js +1 -1
  51. package/dist/src/selector/ox-process-selector.js.map +1 -1
  52. package/dist/src/selector/process-creation-popup.d.ts +2 -2
  53. package/dist/src/selector/process-creation-popup.js +1 -1
  54. package/dist/src/selector/process-creation-popup.js.map +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"ox-process-list.js","sourceRoot":"","sources":["../../src/ox-process-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHlB,AAhHY,CAgHZ;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAwC;AACvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAiB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CAAmB;AAClB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAAsB;AAE7B;IAAlB,KAAK,CAAC,UAAU,CAAC;0CAAkB;AA3HhC,WAAW;IADhB,aAAa,CAAC,iBAAiB,CAAC;GAC3B,WAAW,CAiYhB","sourcesContent":["import '@operato/popup/ox-popup.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, FetchOption, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createProcess, fetchProcessList } from './graphql/process'\nimport { fetchFavoriteProcessList } from './graphql/favorite-process'\nimport { fetchProcessGroupList } from './graphql/process-group'\nimport { Process } from './types'\n\n@customElement('ox-process-list')\nclass ProcessList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--spacing-large);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--md-sys-color-surface);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --md-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--spacing-small);\n font-size: 1em;\n opacity: 0.5;\n color: var(--md-sys-color-on-primary-container);\n cursor: pointer;\n }\n\n #modes > md-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--md-sys-color-on-secondary-container);\n cursor: default;\n }\n #modes > md-icon:hover {\n opacity: 1;\n color: var(--md-sys-color-on-secondary-container);\n }\n\n #add button {\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n }\n\n #add button:hover {\n background-color: var(--md-sys-color-on-primary-container);\n color: var(--md-sys-color-primary-container);\n box-shadow: var(--box-shadow);\n }\n\n #add button md-icon {\n font-size: 1.5em;\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dim-color);\n padding: var(--spacing-small) var(--spacing-small) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters md-icon {\n position: absolute;\n top: 3px;\n color: var(--md-sys-color-on-secondary-container);\n }\n #filters * {\n margin-right: var(--spacing-medium);\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <md-icon>search</md-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group => html`\n <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option>\n `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><md-icon @click=${() => this.onCreateProcess()}>add</md-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: FetchOption) {\n const { items: records, total } = await this.getProcesses({ page, limit, sorters })\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchProcessGroupList()).processGroups.items\n\n if (this.groups) {\n await this.refreshProcesses()\n }\n }\n\n async getProcesses({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteProcesses({\n page,\n limit\n })\n\n var listParam = {\n filters: this.groupId\n ? [\n {\n name: 'groupId',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchProcessList(listParam)).processes\n }\n\n async getFavoriteProcesses({ page = 1, limit = 30 } = {}) {\n var listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteProcessList(listParam)).favoriteProcesses\n }\n\n async refreshProcesses() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateProcess() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <process-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-process=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId, model, thumbnail } = e.detail\n\n var process: Process = {\n name,\n description,\n groupId,\n model: model || {\n width: 1600,\n height: 1200\n },\n thumbnail\n }\n\n await createProcess(process)\n\n this.notify('info', 'new process created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></process-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"ox-process-list.js","sourceRoot":"","sources":["../../src/ox-process-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAmH+B,cAAS,GAAY,KAAK,CAAA;QAG3B,SAAI,GAA6B,MAAM,CAAA;QAExC,WAAM,GAAU,EAAE,CAAA;QAClB,cAAS,GAAU,EAAE,CAAA;IAwQlD,CAAC;IApQC,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAA;QAEhC,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,MAAM,UAAU,IAAI,6BAA6B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;;;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port '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, FetchOption, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createProcess, fetchProcessList } from './graphql/process.js'\nimport { fetchFavoriteProcessList } from './graphql/favorite-process.js'\nimport { fetchProcessGroupList } from './graphql/process-group.js'\nimport { Process } from './types.js'\n\n@customElement('ox-process-list')\nclass ProcessList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--spacing-large);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--md-sys-color-surface);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --md-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--spacing-small);\n font-size: 1em;\n opacity: 0.5;\n color: var(--md-sys-color-on-primary-container);\n cursor: pointer;\n }\n\n #modes > md-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--md-sys-color-on-secondary-container);\n cursor: default;\n }\n #modes > md-icon:hover {\n opacity: 1;\n color: var(--md-sys-color-on-secondary-container);\n }\n\n #add button {\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n }\n\n #add button:hover {\n background-color: var(--md-sys-color-on-primary-container);\n color: var(--md-sys-color-primary-container);\n box-shadow: var(--box-shadow);\n }\n\n #add button md-icon {\n font-size: 1.5em;\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dim-color);\n padding: var(--spacing-small) var(--spacing-small) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters md-icon {\n position: absolute;\n top: 3px;\n color: var(--md-sys-color-on-secondary-container);\n }\n #filters * {\n margin-right: var(--spacing-medium);\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <md-icon>search</md-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group => html`\n <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option>\n `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><md-icon @click=${() => this.onCreateProcess()}>add</md-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: FetchOption) {\n const { items: records, total } = await this.getProcesses({ page, limit, sorters })\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchProcessGroupList()).processGroups.items\n\n if (this.groups) {\n await this.refreshProcesses()\n }\n }\n\n async getProcesses({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteProcesses({\n page,\n limit\n })\n\n var listParam = {\n filters: this.groupId\n ? [\n {\n name: 'groupId',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchProcessList(listParam)).processes\n }\n\n async getFavoriteProcesses({ page = 1, limit = 30 } = {}) {\n var listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteProcessList(listParam)).favoriteProcesses\n }\n\n async refreshProcesses() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateProcess() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <process-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-process=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId, model, thumbnail } = e.detail\n\n var process: Process = {\n name,\n description,\n groupId,\n model: model || {\n width: 1600,\n height: 1200\n },\n thumbnail\n }\n\n await createProcess(process)\n\n this.notify('info', 'new process created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></process-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}
@@ -5,14 +5,14 @@ import '@operato/board/ox-scene-layer.js';
5
5
  import '@operato/board/ox-scene-property.js';
6
6
  import '@operato/board/ox-scene-viewer.js';
7
7
  import '@hatiolab/things-scene';
8
- import './ox-process-viewer';
8
+ import './ox-process-viewer.js';
9
9
  import { LitElement, PropertyValues } from 'lit';
10
10
  import { Scene, SCENE_MODE } from '@hatiolab/things-scene';
11
- import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar';
12
- import { EditToolbar } from './modeller/edit-toolbar';
13
- import { PropertySidebar } from './modeller/property-sidebar/property-sidebar';
14
- import { ComponentGroup, ComponentTemplate } from './types';
15
- declare const OxProcessModeller_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
11
+ import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar.js';
12
+ import { EditToolbar } from './modeller/edit-toolbar.js';
13
+ import { PropertySidebar } from './modeller/property-sidebar/property-sidebar.js';
14
+ import { ComponentGroup, ComponentTemplate } from './types.js';
15
+ declare const OxProcessModeller_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types.js").ScopedElementsHost>;
16
16
  export declare class OxProcessModeller extends OxProcessModeller_base {
17
17
  static styles: import("lit").CSSResult[];
18
18
  static registerGroup(group: ComponentGroup): void;
@@ -6,7 +6,7 @@ import '@operato/board/ox-scene-layer.js';
6
6
  import '@operato/board/ox-scene-property.js';
7
7
  import '@operato/board/ox-scene-viewer.js';
8
8
  import '@hatiolab/things-scene';
9
- import './ox-process-viewer';
9
+ import './ox-process-viewer.js';
10
10
  import { saveAs } from 'file-saver';
11
11
  import { css, html, LitElement } from 'lit';
12
12
  import { customElement, property, query } from 'lit/decorators.js';
@@ -14,9 +14,9 @@ import { SCENE_MODE } from '@hatiolab/things-scene';
14
14
  import { ScopedElementsMixin } from '@open-wc/scoped-elements';
15
15
  import { OxPopup } from '@operato/popup';
16
16
  import { isMacOS, togglefullscreen } from '@operato/utils';
17
- import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar';
18
- import { EditToolbar } from './modeller/edit-toolbar';
19
- import { PropertySidebar } from './modeller/property-sidebar/property-sidebar';
17
+ import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar.js';
18
+ import { EditToolbar } from './modeller/edit-toolbar.js';
19
+ import { PropertySidebar } from './modeller/property-sidebar/property-sidebar.js';
20
20
  const MACOS = isMacOS();
21
21
  const ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href;
22
22
  const ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-process-modeller.js","sourceRoot":"","sources":["../../src/ox-process-modeller.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AACzC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,mCAAmC,CAAA;AAC1C,OAAO,wBAAwB,CAAA;AAC/B,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAS,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAG9E,MAAM,KAAK,GAAG,OAAO,EAAE,CAAA;AAEvB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,iCAAiC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACxF,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,2CAA2C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC5G,MAAM,0BAA0B,GAAG,IAAI,GAAG,CA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AAC;qDAA4B;AACxB;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;wDAA+B;AAClC;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AAC1B;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AACvB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAA8B;AAE/C;IAAtC,KAAK,CAAC,sBAAsB,CAAC;sDAAkC;AAhIrD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAqY7B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/fab/fab.js'\n\nimport '@operato/board/ox-scene-handler.js'\nimport '@operato/board/ox-scene-layer.js'\nimport '@operato/board/ox-scene-property.js'\nimport '@operato/board/ox-scene-viewer.js'\nimport '@hatiolab/things-scene'\nimport './ox-process-viewer'\n\nimport { saveAs } from 'file-saver'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { Scene, SCENE_MODE } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPopup } from '@operato/popup'\nimport { isMacOS, togglefullscreen } from '@operato/utils'\n\nimport { ComponentToolbar } from './modeller/component-toolbar/component-toolbar'\nimport { EditToolbar } from './modeller/edit-toolbar'\nimport { PropertySidebar } from './modeller/property-sidebar/property-sidebar'\nimport { ComponentGroup, ComponentTemplate } from './types'\n\nconst MACOS = isMacOS()\n\nconst ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href\nconst ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href\nconst ICON_PROPERTIES_ARROW_TYPE = new URL('../../icons/icon-properties-arrow-type.png', import.meta.url).href\nconst ICON_PROPERTIES_LABEL = new URL('../../icons/icon-properties-label.png', import.meta.url).href\nconst ICON_PROPERTIES_PADDING = new URL('../../icons/icon-properties-padding.png', import.meta.url).href\n\nconst ICON_HTOOLBAR = new URL('../../icons/icon-htoolbar.png', import.meta.url).href\nconst ICON_FULLSCREEN = new URL('../../icons/icon-fullscreen.png', import.meta.url).href\nconst ICON_COLLAPSE = new URL('../../icons/icon-collapse.png', import.meta.url).href\nconst ICON_COLLAPSE_ACTIVE = new URL('../../icons/icon-collapse-active.png', import.meta.url).href\n\nconst ICON_SHELL_INSPECTOR = new URL('../../icons/icon-shell-inspector.png', import.meta.url).href\n\nvar Registry: ComponentGroup[] = []\n\n@customElement('ox-process-modeller')\nexport class OxProcessModeller extends ScopedElementsMixin(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n height: 100%;\n overflow: hidden;\n }\n\n process-edit-toolbar {\n flex: 45px;\n max-height: 45px;\n }\n\n div[content] {\n flex: 1;\n max-height: calc(100% - 45px);\n\n display: flex;\n flex-direction: row;\n }\n\n process-component-toolbar {\n max-height: 100%;\n }\n\n process-property-sidebar {\n overflow: hidden;\n }\n\n #scene-wrap {\n position: relative;\n\n flex: 1;\n display: flex;\n flex-direction: row;\n }\n\n ox-scene-viewer {\n flex: 1;\n width: 100%;\n height: 100%;\n }\n\n md-fab {\n position: absolute;\n right: 15px;\n bottom: 15px;\n }\n\n ox-popup {\n width: 90%;\n height: 90%;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n background: var(--md-sys-color-on-secondary-container, black);\n\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n ox-process-viewer {\n width: 98%;\n height: 98%;\n margin: auto;\n padding: 0;\n }\n `\n ]\n\n static registerGroup(group: ComponentGroup) {\n var found = Registry.find(inRegisterGroup => inRegisterGroup.name == group.name)\n\n if (found) {\n found = {\n ...found,\n ...group\n }\n } else {\n Registry.push(group)\n }\n }\n\n static registerTemplate(templates: ComponentTemplate[]): void {\n templates &&\n templates.forEach(template => {\n var groups: string[] = typeof template.group == 'string' ? [template.group] : template.group\n\n Registry.filter(group => groups.includes(group.name)).forEach(group => {\n if (!group.templates.find(inGroupTemplate => inGroupTemplate.type == template.type)) {\n group.templates.push(template)\n }\n })\n })\n }\n\n static get groups(): ComponentGroup[] {\n return Registry\n }\n\n static getGroup(name: string) {\n return Registry.find(group => group.name === name)\n }\n\n @property({ type: String }) processName: string = ''\n @property({ type: Object }) model: any = null\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Array }) selected: any[] = []\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT\n @property({ type: Object }) provider: any = null\n @property({ type: Boolean }) hideProperty: boolean = false\n @property({ type: String }) overlay: string = ''\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) componentGroupList: any[] = []\n @property({ type: Array }) fonts: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n @property({ type: Boolean, attribute: 'hide-data-binding' }) hideDataBinding: boolean = false\n @property({ type: Boolean, attribute: 'hide-effect' }) hideEffect: boolean = false\n @property({ type: Boolean, attribute: 'hide-inspector' }) hideInspector: boolean = false\n @property({ type: Boolean, attribute: 'hide-shape' }) hideShape: boolean = false\n @property({ type: Boolean, attribute: 'hide-style' }) hideStyle: boolean = false\n @property({ type: Boolean, attribute: 'hide-specific' }) hideSpecific: boolean = false\n\n @query('process-edit-toolbar') private editToolbar!: EditToolbar\n\n private group: string = ''\n private shortcutHandler?: (e: KeyboardEvent) => void\n\n constructor() {\n super()\n\n document.addEventListener('get-all-scene-component-ids', (e: Event) => {\n var { component, callback } = (e as CustomEvent).detail\n\n if (!this.scene) return\n\n var ids\n if (component) {\n ids = this.scene.findAll(component).map(c => c.model.id)\n } else {\n // @ts-ignore\n ids = this.scene.ids.map(({ key }) => key)\n }\n\n ids = ids.filter(Boolean).sort()\n callback(ids)\n })\n\n this.style.setProperty('--url-icon-properties', `url(${ICON_PROPERTIES})`)\n this.style.setProperty('--url-icon-properties-label', `url(${ICON_PROPERTIES_LABEL})`)\n this.style.setProperty('--url-icon-properties-padding', `url(${ICON_PROPERTIES_PADDING})`)\n this.style.setProperty('--url-icon-properties-line-type', `url(${ICON_PROPERTIES_LINE_TYPE})`)\n this.style.setProperty('--url-icon-properties-arrow-type', `url(${ICON_PROPERTIES_ARROW_TYPE})`)\n\n this.style.setProperty('--url-icon-htoolbar', `url(${ICON_HTOOLBAR})`)\n this.style.setProperty('--url-icon-fullscreen', `url(${ICON_FULLSCREEN})`)\n this.style.setProperty('--url-icon-collapse', `url(${ICON_COLLAPSE})`)\n this.style.setProperty('--url-icon-collapse-active', `url(${ICON_COLLAPSE_ACTIVE})`)\n\n this.style.setProperty('--url-icon-shell-inspector', `url(${ICON_SHELL_INSPECTOR})`)\n }\n\n static get scopedElements() {\n return {\n 'process-edit-toolbar': EditToolbar,\n 'process-property-sidebar': PropertySidebar,\n 'process-component-toolbar': ComponentToolbar\n }\n }\n\n render() {\n return html`\n <process-edit-toolbar\n .scene=${this.scene}\n .selected=${this.selected}\n @hide-property-changed=${(e: CustomEvent) => (this.hideProperty = e.detail.value)}\n @open-preview=${() => this.preview()}\n @download-model=${() => this.downloadModel()}\n @modeller-fullscreen=${() => togglefullscreen(this)}\n >\n ${this.renderBrandingZone()}\n </process-edit-toolbar>\n\n <div content>\n <process-component-toolbar\n .scene=${this.scene}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n .componentGroupList=${this.componentGroupList}\n .group=${this.group}\n >\n </process-component-toolbar>\n\n <div id=\"scene-wrap\">\n <ox-scene-viewer\n id=\"scene\"\n .scene=${this.scene}\n @scene-changed=${(e: CustomEvent) => {\n this.scene = e.detail.value\n }}\n .model=${this.model}\n .selected=${this.selected}\n @selected-changed=${(e: CustomEvent) => {\n this.selected = e.detail.value\n }}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n fit=\"ratio\"\n .baseUrl=${this.baseUrl}\n @contextmenu=${() => this.onContextMenu()}\n .provider=${this.provider}\n name=\"modeller\"\n >\n <ox-scene-layer type=\"selection-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"modeling-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"add-layer\"> </ox-scene-layer>\n <ox-scene-layer type=\"guide-layer\">\n <ox-scene-property name=\"ruler\" value=\"disabled\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"shift-layer\">\n <ox-scene-property name=\"text\" value=\"${this.overlay}\"></ox-scene-property>\n <ox-scene-property name=\"alpha\" value=\"0.3\"></ox-scene-property>\n <ox-scene-property name=\"fontFamily\" value=\"arial\"></ox-scene-property>\n <ox-scene-property name=\"fontSize\" value=\"30\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"fontColor\" value=\"navy\"></ox-scene-property>\n <ox-scene-property name=\"textBaseline\" value=\"top\"></ox-scene-property>\n <ox-scene-property name=\"textAlign\" value=\"left\"></ox-scene-property>\n <ox-scene-property name=\"paddingTop\" value=\"50\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"paddingLeft\" value=\"50\" type=\"number\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"decotag-layer\"></ox-scene-layer>\n <ox-scene-handler type=\"text-editor\"></ox-scene-handler>\n <ox-scene-handler type=\"move-handler\"></ox-scene-handler>\n </ox-scene-viewer>\n\n <md-fab @click=${() => this.onTapSave()} title=\"save\">\n <md-icon slot=\"icon\">save</md-icon>\n </md-fab>\n </div>\n\n <process-property-sidebar\n .scene=${this.scene}\n .selected=${this.selected}\n .collapsed=${this.hideProperty}\n .fonts=${this.fonts}\n .propertyEditor=${this.propertyEditor}\n ?hide-data-binding=${this.hideDataBinding}\n ?hide-effect=${this.hideEffect}\n ?hide-inspector=${this.hideInspector}\n ?hide-shape=${this.hideShape}\n ?hide-style=${this.hideStyle}\n ?hide-specific=${this.hideSpecific}\n >\n </process-property-sidebar>\n </div>\n `\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.bindShortcutEvent()\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.unbindShortcutEvent()\n }\n\n updated(changes: PropertyValues<this>): void {\n if (changes.has('scene')) {\n if (this.scene) {\n this.scene.anchorStarterTemplate = {\n type: 'streamline',\n lineWidth: 2,\n strokeStyle: 'black',\n begin: 'oval',\n beginSize: 'size9',\n end: 'arrow',\n endSize: 'size9',\n round: 10\n }\n }\n }\n }\n\n close() {\n this.model = null\n this.requestUpdate()\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n switch (e.code) {\n case 'KeyS':\n if (ctrlKey) {\n this.onTapSave()\n e.preventDefault()\n }\n break\n }\n }\n\n preview() {\n const process = {\n id: 'preview',\n model: this.scene?.model ? JSON.parse(JSON.stringify(this.scene.model)) : null\n }\n\n OxPopup.open({\n template: html`\n <ox-process-viewer style=\"flex: 1;\" .provider=${this.provider} .process=${process}></ox-process-viewer>\n `,\n style: 'width: 80vw; height: 80vh;',\n backdrop: true\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n downloadModel() {\n if (!this.scene) return\n\n var model = JSON.stringify(this.model, null, 2)\n var filename = (this.processName || 'NONAME') + '-' + Date.now() + '.json'\n saveAs(new Blob([model], { type: 'application/octet-stream' }), filename)\n }\n\n renderBrandingZone() {\n return html``\n }\n\n onTapSave() {\n this.dispatchEvent(new CustomEvent('save-model', { bubbles: true, composed: true, detail: { model: this.model } }))\n }\n\n bindShortcutEvent() {\n // TODO: Global Hotkey에 대한 정의를 process-edit-toolbar에서 가져올 수 있도록 수정해야 함.\n const GLOBAL_HOTKEYS = ['Digit1', 'Digit2', 'F11', 'KeyD', 'KeyP', 'KeyS']\n\n this.shortcutHandler = (e: KeyboardEvent) => {\n const target = e.composedPath()[0] as HTMLElement\n var tagName = target.tagName\n var isInput = target.isContentEditable || tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'\n var isGlobalHotkey = GLOBAL_HOTKEYS.includes(e.code)\n\n if (!isGlobalHotkey && isInput) return\n if (!this.editToolbar.onShortcut(e)) this.onShortcut(e)\n }\n\n document.addEventListener('keydown', this.shortcutHandler)\n }\n\n unbindShortcutEvent() {\n if (this.shortcutHandler) {\n document.removeEventListener('keydown', this.shortcutHandler)\n delete this.shortcutHandler\n }\n }\n\n undoable(): boolean {\n return !!this.scene?.undoable()\n }\n\n redoable(): boolean {\n return !!this.scene?.redoable()\n }\n\n preserve(): void {\n this.scene?.preserve()\n }\n\n hasUnpreservedChanges(): boolean {\n return !!this.scene?.hasUnpreservedChanges()\n }\n\n onContextMenu() {}\n}\n"]}
1
+ {"version":3,"file":"ox-process-modeller.js","sourceRoot":"","sources":["../../src/ox-process-modeller.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AACzC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,mCAAmC,CAAA;AAC1C,OAAO,wBAAwB,CAAA;AAC/B,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAS,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MA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EAAE,CAAC;kDAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAc;AACd;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6DAA+B;AAC9B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yDAA2B;AAEQ;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;0DAAiC;AACtC;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;qDAA4B;AACxB;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;wDAA+B;AAClC;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AAC1B;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AACvB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAA8B;AAE/C;IAAtC,KAAK,CAAC,sBAAsB,CAAC;sDAAkC;AAhIrD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAqY7B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/fab/fab.js'\n\nimport '@operato/board/ox-scene-handler.js'\nimport '@operato/board/ox-scene-layer.js'\nimport '@operato/board/ox-scene-property.js'\nimport '@operato/board/ox-scene-viewer.js'\nimport '@hatiolab/things-scene'\nimport './ox-process-viewer.js'\n\nimport { saveAs } from 'file-saver'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { Scene, SCENE_MODE } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { OxPopup } from '@operato/popup'\nimport { isMacOS, togglefullscreen } from '@operato/utils'\n\nimport { ComponentToolbar } from './modeller/component-toolbar/component-toolbar.js'\nimport { EditToolbar } from './modeller/edit-toolbar.js'\nimport { PropertySidebar } from './modeller/property-sidebar/property-sidebar.js'\nimport { ComponentGroup, ComponentTemplate } from './types.js'\n\nconst MACOS = isMacOS()\n\nconst ICON_PROPERTIES = new URL('../../icons/icon-properties.png', import.meta.url).href\nconst ICON_PROPERTIES_LINE_TYPE = new URL('../../icons/icon-properties-line-type.png', import.meta.url).href\nconst ICON_PROPERTIES_ARROW_TYPE = new URL('../../icons/icon-properties-arrow-type.png', import.meta.url).href\nconst ICON_PROPERTIES_LABEL = new URL('../../icons/icon-properties-label.png', import.meta.url).href\nconst ICON_PROPERTIES_PADDING = new URL('../../icons/icon-properties-padding.png', import.meta.url).href\n\nconst ICON_HTOOLBAR = new URL('../../icons/icon-htoolbar.png', import.meta.url).href\nconst ICON_FULLSCREEN = new URL('../../icons/icon-fullscreen.png', import.meta.url).href\nconst ICON_COLLAPSE = new URL('../../icons/icon-collapse.png', import.meta.url).href\nconst ICON_COLLAPSE_ACTIVE = new URL('../../icons/icon-collapse-active.png', import.meta.url).href\n\nconst ICON_SHELL_INSPECTOR = new URL('../../icons/icon-shell-inspector.png', import.meta.url).href\n\nvar Registry: ComponentGroup[] = []\n\n@customElement('ox-process-modeller')\nexport class OxProcessModeller extends ScopedElementsMixin(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n height: 100%;\n overflow: hidden;\n }\n\n process-edit-toolbar {\n flex: 45px;\n max-height: 45px;\n }\n\n div[content] {\n flex: 1;\n max-height: calc(100% - 45px);\n\n display: flex;\n flex-direction: row;\n }\n\n process-component-toolbar {\n max-height: 100%;\n }\n\n process-property-sidebar {\n overflow: hidden;\n }\n\n #scene-wrap {\n position: relative;\n\n flex: 1;\n display: flex;\n flex-direction: row;\n }\n\n ox-scene-viewer {\n flex: 1;\n width: 100%;\n height: 100%;\n }\n\n md-fab {\n position: absolute;\n right: 15px;\n bottom: 15px;\n }\n\n ox-popup {\n width: 90%;\n height: 90%;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n background: var(--md-sys-color-on-secondary-container, black);\n\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n\n ox-process-viewer {\n width: 98%;\n height: 98%;\n margin: auto;\n padding: 0;\n }\n `\n ]\n\n static registerGroup(group: ComponentGroup) {\n var found = Registry.find(inRegisterGroup => inRegisterGroup.name == group.name)\n\n if (found) {\n found = {\n ...found,\n ...group\n }\n } else {\n Registry.push(group)\n }\n }\n\n static registerTemplate(templates: ComponentTemplate[]): void {\n templates &&\n templates.forEach(template => {\n var groups: string[] = typeof template.group == 'string' ? [template.group] : template.group\n\n Registry.filter(group => groups.includes(group.name)).forEach(group => {\n if (!group.templates.find(inGroupTemplate => inGroupTemplate.type == template.type)) {\n group.templates.push(template)\n }\n })\n })\n }\n\n static get groups(): ComponentGroup[] {\n return Registry\n }\n\n static getGroup(name: string) {\n return Registry.find(group => group.name === name)\n }\n\n @property({ type: String }) processName: string = ''\n @property({ type: Object }) model: any = null\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Array }) selected: any[] = []\n @property({ type: Number }) mode: SCENE_MODE = SCENE_MODE.EDIT\n @property({ type: Object }) provider: any = null\n @property({ type: Boolean }) hideProperty: boolean = false\n @property({ type: String }) overlay: string = ''\n @property({ type: Object }) scene?: Scene\n @property({ type: Array }) componentGroupList: any[] = []\n @property({ type: Array }) fonts: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n @property({ type: Boolean, attribute: 'hide-data-binding' }) hideDataBinding: boolean = false\n @property({ type: Boolean, attribute: 'hide-effect' }) hideEffect: boolean = false\n @property({ type: Boolean, attribute: 'hide-inspector' }) hideInspector: boolean = false\n @property({ type: Boolean, attribute: 'hide-shape' }) hideShape: boolean = false\n @property({ type: Boolean, attribute: 'hide-style' }) hideStyle: boolean = false\n @property({ type: Boolean, attribute: 'hide-specific' }) hideSpecific: boolean = false\n\n @query('process-edit-toolbar') private editToolbar!: EditToolbar\n\n private group: string = ''\n private shortcutHandler?: (e: KeyboardEvent) => void\n\n constructor() {\n super()\n\n document.addEventListener('get-all-scene-component-ids', (e: Event) => {\n var { component, callback } = (e as CustomEvent).detail\n\n if (!this.scene) return\n\n var ids\n if (component) {\n ids = this.scene.findAll(component).map(c => c.model.id)\n } else {\n // @ts-ignore\n ids = this.scene.ids.map(({ key }) => key)\n }\n\n ids = ids.filter(Boolean).sort()\n callback(ids)\n })\n\n this.style.setProperty('--url-icon-properties', `url(${ICON_PROPERTIES})`)\n this.style.setProperty('--url-icon-properties-label', `url(${ICON_PROPERTIES_LABEL})`)\n this.style.setProperty('--url-icon-properties-padding', `url(${ICON_PROPERTIES_PADDING})`)\n this.style.setProperty('--url-icon-properties-line-type', `url(${ICON_PROPERTIES_LINE_TYPE})`)\n this.style.setProperty('--url-icon-properties-arrow-type', `url(${ICON_PROPERTIES_ARROW_TYPE})`)\n\n this.style.setProperty('--url-icon-htoolbar', `url(${ICON_HTOOLBAR})`)\n this.style.setProperty('--url-icon-fullscreen', `url(${ICON_FULLSCREEN})`)\n this.style.setProperty('--url-icon-collapse', `url(${ICON_COLLAPSE})`)\n this.style.setProperty('--url-icon-collapse-active', `url(${ICON_COLLAPSE_ACTIVE})`)\n\n this.style.setProperty('--url-icon-shell-inspector', `url(${ICON_SHELL_INSPECTOR})`)\n }\n\n static get scopedElements() {\n return {\n 'process-edit-toolbar': EditToolbar,\n 'process-property-sidebar': PropertySidebar,\n 'process-component-toolbar': ComponentToolbar\n }\n }\n\n render() {\n return html`\n <process-edit-toolbar\n .scene=${this.scene}\n .selected=${this.selected}\n @hide-property-changed=${(e: CustomEvent) => (this.hideProperty = e.detail.value)}\n @open-preview=${() => this.preview()}\n @download-model=${() => this.downloadModel()}\n @modeller-fullscreen=${() => togglefullscreen(this)}\n >\n ${this.renderBrandingZone()}\n </process-edit-toolbar>\n\n <div content>\n <process-component-toolbar\n .scene=${this.scene}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n .componentGroupList=${this.componentGroupList}\n .group=${this.group}\n >\n </process-component-toolbar>\n\n <div id=\"scene-wrap\">\n <ox-scene-viewer\n id=\"scene\"\n .scene=${this.scene}\n @scene-changed=${(e: CustomEvent) => {\n this.scene = e.detail.value\n }}\n .model=${this.model}\n .selected=${this.selected}\n @selected-changed=${(e: CustomEvent) => {\n this.selected = e.detail.value\n }}\n .mode=${this.mode}\n @mode-changed=${(e: CustomEvent) => {\n this.mode = e.detail.value\n }}\n fit=\"ratio\"\n .baseUrl=${this.baseUrl}\n @contextmenu=${() => this.onContextMenu()}\n .provider=${this.provider}\n name=\"modeller\"\n >\n <ox-scene-layer type=\"selection-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"modeling-layer\"></ox-scene-layer>\n <ox-scene-layer type=\"add-layer\"> </ox-scene-layer>\n <ox-scene-layer type=\"guide-layer\">\n <ox-scene-property name=\"ruler\" value=\"disabled\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"shift-layer\">\n <ox-scene-property name=\"text\" value=\"${this.overlay}\"></ox-scene-property>\n <ox-scene-property name=\"alpha\" value=\"0.3\"></ox-scene-property>\n <ox-scene-property name=\"fontFamily\" value=\"arial\"></ox-scene-property>\n <ox-scene-property name=\"fontSize\" value=\"30\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"fontColor\" value=\"navy\"></ox-scene-property>\n <ox-scene-property name=\"textBaseline\" value=\"top\"></ox-scene-property>\n <ox-scene-property name=\"textAlign\" value=\"left\"></ox-scene-property>\n <ox-scene-property name=\"paddingTop\" value=\"50\" type=\"number\"></ox-scene-property>\n <ox-scene-property name=\"paddingLeft\" value=\"50\" type=\"number\"></ox-scene-property>\n </ox-scene-layer>\n <ox-scene-layer type=\"decotag-layer\"></ox-scene-layer>\n <ox-scene-handler type=\"text-editor\"></ox-scene-handler>\n <ox-scene-handler type=\"move-handler\"></ox-scene-handler>\n </ox-scene-viewer>\n\n <md-fab @click=${() => this.onTapSave()} title=\"save\">\n <md-icon slot=\"icon\">save</md-icon>\n </md-fab>\n </div>\n\n <process-property-sidebar\n .scene=${this.scene}\n .selected=${this.selected}\n .collapsed=${this.hideProperty}\n .fonts=${this.fonts}\n .propertyEditor=${this.propertyEditor}\n ?hide-data-binding=${this.hideDataBinding}\n ?hide-effect=${this.hideEffect}\n ?hide-inspector=${this.hideInspector}\n ?hide-shape=${this.hideShape}\n ?hide-style=${this.hideStyle}\n ?hide-specific=${this.hideSpecific}\n >\n </process-property-sidebar>\n </div>\n `\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n this.bindShortcutEvent()\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n this.unbindShortcutEvent()\n }\n\n updated(changes: PropertyValues<this>): void {\n if (changes.has('scene')) {\n if (this.scene) {\n this.scene.anchorStarterTemplate = {\n type: 'streamline',\n lineWidth: 2,\n strokeStyle: 'black',\n begin: 'oval',\n beginSize: 'size9',\n end: 'arrow',\n endSize: 'size9',\n round: 10\n }\n }\n }\n }\n\n close() {\n this.model = null\n this.requestUpdate()\n }\n\n onShortcut(e: KeyboardEvent) {\n if (MACOS) var ctrlKey = e.metaKey\n else var ctrlKey = e.ctrlKey\n\n switch (e.code) {\n case 'KeyS':\n if (ctrlKey) {\n this.onTapSave()\n e.preventDefault()\n }\n break\n }\n }\n\n preview() {\n const process = {\n id: 'preview',\n model: this.scene?.model ? JSON.parse(JSON.stringify(this.scene.model)) : null\n }\n\n OxPopup.open({\n template: html`\n <ox-process-viewer style=\"flex: 1;\" .provider=${this.provider} .process=${process}></ox-process-viewer>\n `,\n style: 'width: 80vw; height: 80vh;',\n backdrop: true\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n downloadModel() {\n if (!this.scene) return\n\n var model = JSON.stringify(this.model, null, 2)\n var filename = (this.processName || 'NONAME') + '-' + Date.now() + '.json'\n saveAs(new Blob([model], { type: 'application/octet-stream' }), filename)\n }\n\n renderBrandingZone() {\n return html``\n }\n\n onTapSave() {\n this.dispatchEvent(new CustomEvent('save-model', { bubbles: true, composed: true, detail: { model: this.model } }))\n }\n\n bindShortcutEvent() {\n // TODO: Global Hotkey에 대한 정의를 process-edit-toolbar에서 가져올 수 있도록 수정해야 함.\n const GLOBAL_HOTKEYS = ['Digit1', 'Digit2', 'F11', 'KeyD', 'KeyP', 'KeyS']\n\n this.shortcutHandler = (e: KeyboardEvent) => {\n const target = e.composedPath()[0] as HTMLElement\n var tagName = target.tagName\n var isInput = target.isContentEditable || tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA'\n var isGlobalHotkey = GLOBAL_HOTKEYS.includes(e.code)\n\n if (!isGlobalHotkey && isInput) return\n if (!this.editToolbar.onShortcut(e)) this.onShortcut(e)\n }\n\n document.addEventListener('keydown', this.shortcutHandler)\n }\n\n unbindShortcutEvent() {\n if (this.shortcutHandler) {\n document.removeEventListener('keydown', this.shortcutHandler)\n delete this.shortcutHandler\n }\n }\n\n undoable(): boolean {\n return !!this.scene?.undoable()\n }\n\n redoable(): boolean {\n return !!this.scene?.redoable()\n }\n\n preserve(): void {\n this.scene?.preserve()\n }\n\n hasUnpreservedChanges(): boolean {\n return !!this.scene?.hasUnpreservedChanges()\n }\n\n onContextMenu() {}\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
- import './ox-editor-process-selector';
4
+ import './ox-editor-process-selector.js';
@@ -2,7 +2,7 @@
2
2
  * @license Copyright © HatioLab Inc. All rights reserved.
3
3
  */
4
4
  import { __decorate } from "tslib";
5
- import './ox-editor-process-selector';
5
+ import './ox-editor-process-selector.js';
6
6
  import { html } from 'lit';
7
7
  import { customElement } from 'lit/decorators.js';
8
8
  import { OxPropertyEditor } from '@operato/property-editor';
@@ -1 +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,EAAkB,MAAM,KAAK,CAAA;AAC1C,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, TemplateResult } 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): TemplateResult {\n return html`\n <ox-editor-process-selector id=\"editor\" .value=${value} .properties=${spec.property}></ox-editor-process-selector>\n `\n }\n}\n"]}
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,iCAAiC,CAAA;AAExC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,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.js'\n\nimport { html, TemplateResult } 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): TemplateResult {\n return html`\n <ox-editor-process-selector id=\"editor\" .value=${value} .properties=${spec.property}></ox-editor-process-selector>\n `\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
- import './process-creation-popup';
2
+ import './process-creation-popup.js';
3
3
  import { LitElement } from 'lit';
4
4
  declare const ProcessCreationCard_base: (new (...args: any[]) => LitElement) & typeof LitElement;
5
5
  export declare class ProcessCreationCard extends ProcessCreationCard_base {
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
- import './process-creation-popup';
3
+ import './process-creation-popup.js';
4
4
  import { css, html, LitElement } from 'lit';
5
5
  import { customElement, property } from 'lit/decorators.js';
6
6
  import { i18next, localize } from '@operato/i18n';
@@ -1 +1 @@
1
- {"version":3,"file":"ox-process-creation-card.js","sourceRoot":"","sources":["../../../src/selector/ox-process-creation-card.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,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;;;;;;;;;;;;;;;;;;;;;;;;;OAyBF;SACF,CAAA;IACH,CAAC;IAQD,MAAM;QACJ,OAAO,IAAI,CAAA,eAAe,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,6DAA6D,CAAA;IACrH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;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,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAA;YAE/D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE;oBACN,IAAI;oBACJ,WAAW;oBACX,OAAO;oBACP,KAAK;oBACL,SAAS;iBACV;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;AAlC3B,mBAAmB;IAD/B,aAAa,CAAC,0BAA0B,CAAC;GAC7B,mBAAmB,CAoF/B","sourcesContent":["import '@material/web/icon/icon.js'\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: var(--md-sys-color-surface);\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 md-icon {\n --md-icon-size: 42px;\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()}><md-icon>add_circle_outline</md-icon>create process</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, model, thumbnail } = e.detail\n\n this.dispatchEvent(\n new CustomEvent('create-process', {\n detail: {\n name,\n description,\n groupId,\n model,\n thumbnail\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
+ {"version":3,"file":"ox-process-creation-card.js","sourceRoot":"","sources":["../../../src/selector/ox-process-creation-card.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,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,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;;;;;;;;;;;;;;;;;;;;;;;;;OAyBF;SACF,CAAA;IACH,CAAC;IAQD,MAAM;QACJ,OAAO,IAAI,CAAA,eAAe,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,6DAA6D,CAAA;IACrH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;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,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAA;YAE/D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE;oBACN,IAAI;oBACJ,WAAW;oBACX,OAAO;oBACP,KAAK;oBACL,SAAS;iBACV;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;AAlC3B,mBAAmB;IAD/B,aAAa,CAAC,0BAA0B,CAAC;GAC7B,mBAAmB,CAoF/B","sourcesContent":["import '@material/web/icon/icon.js'\nimport './process-creation-popup.js'\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: var(--md-sys-color-surface);\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 md-icon {\n --md-icon-size: 42px;\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()}><md-icon>add_circle_outline</md-icon>create process</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, model, thumbnail } = e.detail\n\n this.dispatchEvent(\n new CustomEvent('create-process', {\n detail: {\n name,\n description,\n groupId,\n model,\n thumbnail\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,4 +1,4 @@
1
- import './ox-process-creation-card';
1
+ import './ox-process-creation-card.js';
2
2
  import { LitElement, PropertyValues } from 'lit';
3
3
  declare const ProcessSelector_base: (new (...args: any[]) => {
4
4
  _infiniteScrollOptions: {
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import './ox-process-creation-card';
2
+ import './ox-process-creation-card.js';
3
3
  import gql from 'graphql-tag';
4
4
  import { css, html, LitElement } from 'lit';
5
5
  import { customElement, property } from 'lit/decorators.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ox-process-selector.js","sourceRoot":"","sources":["../../../src/selector/ox-process-selector.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,kBAAkB,MAAM,8CAA8C,CAAA;AAE7E,MAAM,sBAAsB,GAAG,CAAC,SAAc,EAAE,EAAE;IAChD,OAAO,GAAG,CAAA;;gBAEI,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;CAUnC,CAAA;AACD,CAAC,CAAA;AAED,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;CAWvC,CAAA;AAED,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;;;;CAW7B,CAAA;AAGM,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IACpF,MAAM,KAAK,MAAM;QACf,OAAO;YACL,eAAe;YACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6EF;SACF,CAAA;IACH,CAAC;IAWD;QACE,KAAK,EAAE,CAA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AI,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;AAzF/B,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CA6Q3B","sourcesContent":["import './ox-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('ox-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 color: var(--popup-content-color);\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: repeat(auto-fill, minmax(260px, 1fr));\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: var(--md-sys-color-surface);\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 <ox-process-creation-card\n class=\"card create\"\n .groups=${this.groups}\n .defaultGroup=${this.group}\n @create-process=${(e: CustomEvent) => this.onCreateProcess(e)}\n ></ox-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 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, model, thumbnail } = e.detail\n\n await this.createProcess(name, description, groupId, model, thumbnail)\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('ox-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, modelTemplate: any, thumbnail: string) {\n var model = JSON.stringify(\n modelTemplate || {\n width: 1200,\n height: 800,\n fillStyle: 'white'\n }\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"]}
1
+ {"version":3,"file":"ox-process-selector.js","sourceRoot":"","sources":["../../../src/selector/ox-process-selector.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAA;AAEtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,kBAAkB,MAAM,8CAA8C,CAAA;AAE7E,MAAM,sBAAsB,GAAG,CAAC,SAAc,EAAE,EAAE;IAChD,OAAO,GAAG,CAAA;;gBAEI,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;CAUnC,CAAA;AACD,CAAC,CAAA;AAED,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;CAWvC,CAAA;AAED,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;;;;CAW7B,CAAA;AAGM,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IACpF,MAAM,KAAK,MAAM;QACf,OAAO;YACL,eAAe;YACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6EF;SACF,C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DAAsB;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;AAzF/B,eAAe;IAD3B,aAAa,CAAC,qBAAqB,CAAC;GACxB,eAAe,CA6Q3B","sourcesContent":["import './ox-process-creation-card.js'\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('ox-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 color: var(--popup-content-color);\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: repeat(auto-fill, minmax(260px, 1fr));\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: var(--md-sys-color-surface);\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 <ox-process-creation-card\n class=\"card create\"\n .groups=${this.groups}\n .defaultGroup=${this.group}\n @create-process=${(e: CustomEvent) => this.onCreateProcess(e)}\n ></ox-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 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, model, thumbnail } = e.detail\n\n await this.createProcess(name, description, groupId, model, thumbnail)\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('ox-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, modelTemplate: any, thumbnail: string) {\n var model = JSON.stringify(\n modelTemplate || {\n width: 1200,\n height: 800,\n fillStyle: 'white'\n }\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"]}
@@ -2,9 +2,9 @@ import '@material/web/textfield/filled-text-field.js';
2
2
  import '@material/web/button/text-button.js';
3
3
  import '@material/web/select/filled-select.js';
4
4
  import '@material/web/select/select-option.js';
5
- import '../ox-process-template-list';
5
+ import '../ox-process-template-list.js';
6
6
  import { LitElement } from 'lit';
7
- import { OxProcessTemplateList } from '../ox-process-template-list';
7
+ import { OxProcessTemplateList } from '../ox-process-template-list.js';
8
8
  declare const ProcessCreationPopup_base: (new (...args: any[]) => LitElement) & typeof LitElement;
9
9
  export declare class ProcessCreationPopup extends ProcessCreationPopup_base {
10
10
  static get styles(): import("lit").CSSResult[];
@@ -3,7 +3,7 @@ import '@material/web/textfield/filled-text-field.js';
3
3
  import '@material/web/button/text-button.js';
4
4
  import '@material/web/select/filled-select.js';
5
5
  import '@material/web/select/select-option.js';
6
- import '../ox-process-template-list';
6
+ import '../ox-process-template-list.js';
7
7
  import { css, html, LitElement } from 'lit';
8
8
  import { customElement, property, query } from 'lit/decorators.js';
9
9
  import { i18next, localize } from '@operato/i18n';
@@ -1 +1 @@
1
- {"version":3,"file":"process-creation-popup.js","sourceRoot":"","sources":["../../../src/selector/process-creation-popup.ts"],"names":[],"mappings":";AAAA,OAAO,8CAA8C,CAAA;AACrD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,C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EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;;YAC7E,OAAO,MAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,IAAI,GAAG,CAAS,0CAAE,KAAK,CAAA;QACzE,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAA;QAE7D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE;YAChC,MAAM,EAAE;gBACN,IAAI;gBACJ,WAAW;gBACX,OAAO;gBACP,KAAK,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK;gBACtB,SAAS,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS;aAC/B;SACF,CAAC,CACH,CAAA;IACH,CAAC;CACF,CAAA;AA/E6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAAwC;AAE/B;IAAlC,KAAK,CAAC,0BAA0B,CAAC;iEAA4C;AA7DnE,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAyIhC","sourcesContent":["import '@material/web/textfield/filled-text-field.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/select/filled-select.js'\nimport '@material/web/select/select-option.js'\nimport '../ox-process-template-list'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { OxProcessTemplateList } from '../ox-process-template-list'\n\n@customElement('process-creation-popup')\nexport class ProcessCreationPopup extends localize(i18next)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n\n background-color: var(--md-sys-color-surface);\n }\n\n [body] {\n flex: 1;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n\n overflow: hidden;\n }\n\n [content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n overflow: auto;\n }\n\n [content] > md-filled-text-field[type='textarea'] {\n flex: 1;\n resize: none;\n }\n\n [templates] {\n flex: 2;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n [templates] > ox-process-template-list {\n flex: 1;\n overflow: hidden;\n }\n\n md-text-button {\n --_container-color: var(--md-sys-color-primary);\n --_label-text-color: var(--md-sys-color-on-primary);\n }\n `\n ]\n }\n\n @property({ type: String }) defaultGroup?: string\n @property({ type: Array }) groups?: { id: string; name: string }[]\n\n @query('ox-process-template-list') processTemplateList!: OxProcessTemplateList\n\n render() {\n var groups = this.groups || []\n\n return html`\n <div body>\n <div content>\n <md-filled-text-field\n label=${String(i18next.t('label.name'))}\n name=\"name\"\n required\n field-name\n ></md-filled-text-field>\n <md-filled-text-field\n type=\"textarea\"\n label=${String(i18next.t('label.description'))}\n name=\"description\"\n field-description\n ></md-filled-text-field>\n <md-filled-select\n label=${String(i18next.t('label.group'))}\n field-group\n helper=\"If there is no group to choose, you can leave it empty.\"\n >\n ${groups.map(\n group => html`\n <md-select-option value=${group.id} ?selected=${this.defaultGroup == group.id}\n >${group.name}</md-select-option\n >\n `\n )}\n </md-filled-select>\n </div>\n\n <div templates>\n <div>${i18next.t('label.process-template')}</div>\n <ox-process-template-list></ox-process-template-list>\n </div>\n </div>\n\n <md-text-button @click=${(e: MouseEvent) => this.onClickSubmit()}\n >${String(i18next.t('button.create'))}</md-text-button\n >\n `\n }\n\n firstUpdated() {\n setTimeout(() => {\n ;(this.renderRoot.querySelector('md-filled-text-field') as any)?.focus()\n }, 100)\n }\n\n async onClickSubmit() {\n var [name, description, groupId] = ['name', 'description', 'group'].map(attr => {\n return (this.renderRoot.querySelector(`[field-${attr}]`) as any)?.value\n })\n\n if (!name) {\n return\n }\n\n const template = await this.processTemplateList.getSelected()\n\n this.dispatchEvent(\n new CustomEvent('create-process', {\n detail: {\n name,\n description,\n groupId,\n model: template?.model,\n thumbnail: template?.thumbnail\n }\n })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"process-creation-popup.js","sourceRoot":"","sources":["../../../src/selector/process-creation-popup.ts"],"names":[],"mappings":";AAAA,OAAO,8CAA8C,CAAA;AACrD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAI1C,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IACrE,MAAM,KAAK,MAAM;QACf,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDF;SACF,CAAA;IACH,CAAC;IAOD,MAAM;QACJ,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAA;QAE9B,OAAO,IAAI,CAAA;;;;oBAIK,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;;;;;;;oBAO/B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;;;;;oBAKtC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;;;;cAItC,MAAM,CAAC,GAAG,CACV,KAAK,CAAC,EAAE,CAA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A;AA/E6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAAwC;AAE/B;IAAlC,KAAK,CAAC,0BAA0B,CAAC;iEAA4C;AA7DnE,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAyIhC","sourcesContent":["import '@material/web/textfield/filled-text-field.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/select/filled-select.js'\nimport '@material/web/select/select-option.js'\nimport '../ox-process-template-list.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { OxProcessTemplateList } from '../ox-process-template-list.js'\n\n@customElement('process-creation-popup')\nexport class ProcessCreationPopup extends localize(i18next)(LitElement) {\n static get styles() {\n return [\n css`\n :host {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n\n background-color: var(--md-sys-color-surface);\n }\n\n [body] {\n flex: 1;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n\n overflow: hidden;\n }\n\n [content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n overflow: auto;\n }\n\n [content] > md-filled-text-field[type='textarea'] {\n flex: 1;\n resize: none;\n }\n\n [templates] {\n flex: 2;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n [templates] > ox-process-template-list {\n flex: 1;\n overflow: hidden;\n }\n\n md-text-button {\n --_container-color: var(--md-sys-color-primary);\n --_label-text-color: var(--md-sys-color-on-primary);\n }\n `\n ]\n }\n\n @property({ type: String }) defaultGroup?: string\n @property({ type: Array }) groups?: { id: string; name: string }[]\n\n @query('ox-process-template-list') processTemplateList!: OxProcessTemplateList\n\n render() {\n var groups = this.groups || []\n\n return html`\n <div body>\n <div content>\n <md-filled-text-field\n label=${String(i18next.t('label.name'))}\n name=\"name\"\n required\n field-name\n ></md-filled-text-field>\n <md-filled-text-field\n type=\"textarea\"\n label=${String(i18next.t('label.description'))}\n name=\"description\"\n field-description\n ></md-filled-text-field>\n <md-filled-select\n label=${String(i18next.t('label.group'))}\n field-group\n helper=\"If there is no group to choose, you can leave it empty.\"\n >\n ${groups.map(\n group => html`\n <md-select-option value=${group.id} ?selected=${this.defaultGroup == group.id}\n >${group.name}</md-select-option\n >\n `\n )}\n </md-filled-select>\n </div>\n\n <div templates>\n <div>${i18next.t('label.process-template')}</div>\n <ox-process-template-list></ox-process-template-list>\n </div>\n </div>\n\n <md-text-button @click=${(e: MouseEvent) => this.onClickSubmit()}\n >${String(i18next.t('button.create'))}</md-text-button\n >\n `\n }\n\n firstUpdated() {\n setTimeout(() => {\n ;(this.renderRoot.querySelector('md-filled-text-field') as any)?.focus()\n }, 100)\n }\n\n async onClickSubmit() {\n var [name, description, groupId] = ['name', 'description', 'group'].map(attr => {\n return (this.renderRoot.querySelector(`[field-${attr}]`) as any)?.value\n })\n\n if (!name) {\n return\n }\n\n const template = await this.processTemplateList.getSelected()\n\n this.dispatchEvent(\n new CustomEvent('create-process', {\n detail: {\n name,\n description,\n groupId,\n model: template?.model,\n thumbnail: template?.thumbnail\n }\n })\n )\n }\n}\n"]}