@things-factory/meta-ui 8.0.6 → 9.0.0-beta.12

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 (116) hide show
  1. package/dist-client/tsconfig.tsbuildinfo +1 -1
  2. package/dist-client/utils/service-util.d.ts +2 -2
  3. package/dist-client/utils/service-util.js +4 -4
  4. package/dist-client/utils/service-util.js.map +1 -1
  5. package/dist-server/service/index.d.ts +2 -2
  6. package/dist-server/tsconfig.tsbuildinfo +1 -1
  7. package/package.json +24 -24
  8. package/client/bootstrap.ts +0 -170
  9. package/client/component/filter/filter-form-meta-code-select.ts +0 -102
  10. package/client/component/filter/filter-form-meta-object-select.ts +0 -107
  11. package/client/component/filter/filter-grist-meta-code-select.ts +0 -97
  12. package/client/component/filter/filter-grist-meta-object-select.ts +0 -102
  13. package/client/component/grist/editor/grist-editor-code-input.js +0 -96
  14. package/client/component/grist/editor/grist-editor-meta-code-selector.js +0 -157
  15. package/client/component/grist/editor/grist-editor-meta-object-selector.js +0 -122
  16. package/client/component/grist/renderer/grist-renderer-code-input.js +0 -20
  17. package/client/component/grist/renderer/grist-renderer-meta-code-selector.js +0 -28
  18. package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +0 -25
  19. package/client/component/popup/code-input-editor-popup.js +0 -111
  20. package/client/component/popup/file-upload-popup.js +0 -129
  21. package/client/component/popup/meta-object-selector-popup.ts +0 -356
  22. package/client/component/popup/record-based-code-editor-popup.ts +0 -141
  23. package/client/dynamic-menus.ts +0 -38
  24. package/client/index.ts +0 -18
  25. package/client/load-components.ts +0 -17
  26. package/client/mixin/meta-base-mixin.js +0 -323
  27. package/client/mixin/meta-basic-grist-mixin.js +0 -283
  28. package/client/mixin/meta-button-mixin.js +0 -116
  29. package/client/mixin/meta-form-mixin.js +0 -435
  30. package/client/mixin/meta-grist-tab-mixin.js +0 -335
  31. package/client/mixin/meta-main-tab-mixin.js +0 -267
  32. package/client/mixin/meta-master-detail-mixin.js +0 -395
  33. package/client/mixin/meta-service-mixin.js +0 -306
  34. package/client/mixin/meta-tab-detail-mixin.js +0 -283
  35. package/client/mixin/meta-tab-mixin.js +0 -190
  36. package/client/pages/activity/meta-activity-define-page.js +0 -422
  37. package/client/pages/activity/meta-activity-list-page.js +0 -262
  38. package/client/pages/activity/meta-activity-viewer-element.js +0 -35
  39. package/client/pages/activity/meta-activity-writer-element.js +0 -48
  40. package/client/pages/activity/meta-activiy-mixin.js +0 -79
  41. package/client/pages/button-role/button-role-detail.js +0 -50
  42. package/client/pages/button-role/button-role-page.js +0 -25
  43. package/client/pages/doc-number/doc-number-page.js +0 -24
  44. package/client/pages/doc-number/next-doc-number-popup.js +0 -25
  45. package/client/pages/entity/config-entity.js +0 -955
  46. package/client/pages/entity/main-menu-selector.js +0 -245
  47. package/client/pages/history/history-copy-list-popup.js +0 -145
  48. package/client/pages/history/history-json-list-popup.js +0 -159
  49. package/client/pages/menu/dynamic-menu-template.js +0 -92
  50. package/client/pages/menu/dynamic-menu.ts +0 -744
  51. package/client/pages/menu/export-menu-popup.js +0 -468
  52. package/client/pages/meta-form-element.js +0 -9
  53. package/client/pages/meta-grist-element.js +0 -12
  54. package/client/pages/meta-grist-page.js +0 -16
  55. package/client/pages/meta-grist-tab-element.js +0 -16
  56. package/client/pages/meta-grist-tab-page.js +0 -16
  57. package/client/pages/meta-main-tab-element.js +0 -12
  58. package/client/pages/meta-main-tab-page.js +0 -16
  59. package/client/pages/meta-master-detail-element.js +0 -12
  60. package/client/pages/meta-master-detail-page.js +0 -16
  61. package/client/pages/meta-tab-detail-element.js +0 -12
  62. package/client/pages/meta-tab-detail-page.js +0 -16
  63. package/client/pages/meta-tab-element.js +0 -15
  64. package/client/pages/printer-device/printer-device-page.js +0 -24
  65. package/client/pages/template/doc-template-page.js +0 -24
  66. package/client/pages/template/template-file-page.js +0 -24
  67. package/client/pages/terms/config-terminology.js +0 -214
  68. package/client/pages/work-code/work-code-detail-popup.js +0 -16
  69. package/client/pages/work-code/work-code-page.js +0 -23
  70. package/client/route.ts +0 -36
  71. package/client/tsconfig.json +0 -13
  72. package/client/utils/grist-default-value.js +0 -36
  73. package/client/utils/meta-api.js +0 -811
  74. package/client/utils/meta-crypto.js +0 -52
  75. package/client/utils/meta-ui-util.js +0 -3304
  76. package/client/utils/rest-service-util.js +0 -328
  77. package/client/utils/service-util.js +0 -1327
  78. package/client/utils/terms-util.ts +0 -119
  79. package/client/utils/ui-util.js +0 -338
  80. package/client/utils/value-util.js +0 -234
  81. package/server/activity/CommonActivity.ts +0 -68
  82. package/server/index.ts +0 -3
  83. package/server/routes.ts +0 -61
  84. package/server/service/button-role/button-role-mutation.ts +0 -105
  85. package/server/service/button-role/button-role-query.ts +0 -53
  86. package/server/service/button-role/button-role-type.ts +0 -39
  87. package/server/service/button-role/button-role.ts +0 -61
  88. package/server/service/button-role/index.ts +0 -7
  89. package/server/service/dynamic-menu/dynamic-menu-query.ts +0 -270
  90. package/server/service/dynamic-menu/dynamic-menu-type.ts +0 -74
  91. package/server/service/dynamic-menu/index.ts +0 -3
  92. package/server/service/entity-event-subscriber/entity-event-subscriber.ts +0 -80
  93. package/server/service/entity-event-subscriber/index.ts +0 -3
  94. package/server/service/index.ts +0 -41
  95. package/server/service/menu-button-auth/index.ts +0 -7
  96. package/server/service/menu-button-auth/menu-button-auth-mutation.ts +0 -133
  97. package/server/service/menu-button-auth/menu-button-auth-query.ts +0 -138
  98. package/server/service/menu-button-auth/menu-button-auth-type.ts +0 -63
  99. package/server/service/menu-button-auth/menu-button-auth.ts +0 -92
  100. package/server/service/meta-activity/index.ts +0 -5
  101. package/server/service/meta-activity/meta-activity-mutation.ts +0 -191
  102. package/server/service/meta-activity/meta-activity-query.ts +0 -43
  103. package/server/service/meta-activity/meta-activity-type.ts +0 -56
  104. package/server/service/set-translations/index.ts +0 -3
  105. package/server/service/set-translations/set-translation-resolver.ts +0 -63
  106. package/server/service/work-code/index.ts +0 -6
  107. package/server/service/work-code/work-code-mutation.ts +0 -147
  108. package/server/service/work-code/work-code-query.ts +0 -67
  109. package/server/service/work-code/work-code-type.ts +0 -60
  110. package/server/service/work-code/work-code.ts +0 -83
  111. package/server/service/work-code-detail/index.ts +0 -6
  112. package/server/service/work-code-detail/work-code-detail-mutation.ts +0 -149
  113. package/server/service/work-code-detail/work-code-detail-query.ts +0 -59
  114. package/server/service/work-code-detail/work-code-detail-type.ts +0 -50
  115. package/server/service/work-code-detail/work-code-detail.ts +0 -82
  116. package/server/tsconfig.json +0 -9
@@ -1,245 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
-
3
- import { css, html, LitElement } from 'lit'
4
-
5
- import { i18next, localize } from '@operato/i18n'
6
- import { ScrollbarStyles, CommonGristStyles, ButtonContainerStyles } from '@operato/styles'
7
-
8
- import { TermsUtil } from './../../utils/terms-util'
9
- import { UiUtil } from '../../utils/ui-util'
10
- import { MetaApi } from '../../utils/meta-api'
11
-
12
- /**
13
- * @license
14
- * Copyright © HatioLab Inc. All rights reserved.
15
- * @author Shortstop <shortstop@hatiolab.com>
16
- * @description 메인 메뉴 선택 화면
17
- */
18
- export class MainMenuSelector extends localize(i18next)(LitElement) {
19
- /**
20
- * @description 스타일 정의
21
- ***********************************
22
- * @returns {Object} 화면의 스타일 정의
23
- */
24
- static get styles() {
25
- let styles = [
26
- ScrollbarStyles,
27
- CommonGristStyles,
28
- ButtonContainerStyles,
29
- css`
30
- :host {
31
- display: flex;
32
- flex-direction: column;
33
- overflow-x: auto;
34
- }
35
-
36
- .container {
37
- flex: 1;
38
- display: grid;
39
- overflow: hidden;
40
- }
41
-
42
- .container_detail {
43
- background-color: var(--md-sys-color-background);
44
- display: flex;
45
- flex-direction: column;
46
- flex: 1;
47
- overflow-y: auto;
48
- }
49
-
50
- h2 {
51
- padding: var(--subtitle-padding);
52
- font: var(--subtitle-font);
53
- color: var(--subtitle-text-color);
54
- border-bottom: var(--subtitle-border-bottom);
55
- }
56
-
57
- .container_detail h2 {
58
- margin: var(--grist-title-margin);
59
- border: var(--grist-title-border);
60
- font: var(--grist-title-font);
61
- color: var(--md-sys-color-secondary);
62
- }
63
-
64
- .container_detail h2 md-icon {
65
- --md-icon-size: var(--grist-title-icon-size);
66
- vertical-align: middle;
67
- margin: var(--grist-title-icon-margin);
68
- color: var(--grist-title-icon-color);
69
- }
70
-
71
- h2 {
72
- padding-bottom: var(--grist-title-with-grid-padding);
73
- }
74
-
75
- ox-grist {
76
- overflow-y: auto;
77
- flex: 1;
78
- }
79
-
80
- ox-filters-form {
81
- flex: 1;
82
- }
83
- `
84
- ]
85
- return styles
86
- }
87
-
88
- /**
89
- * @description 프로퍼티 정의
90
- ***********************************
91
- * @returns {Object} 화면의 프로퍼티 정의
92
- */
93
- static get properties() {
94
- return {
95
- /**
96
- * @description 메인 메뉴 리스트
97
- ****************************
98
- * @type {Array}
99
- */
100
- items: {
101
- type: Array
102
- },
103
-
104
- /**
105
- * @description 총 메인 메뉴 건수
106
- ******************************
107
- * @type {Number}
108
- */
109
- total: {
110
- type: Number
111
- },
112
-
113
- /**
114
- * @description 메인 메뉴 선택 이후 콜백 함수
115
- ***************************************
116
- * @type {Function}
117
- */
118
- selectCallback: {
119
- type: Function
120
- }
121
- }
122
- }
123
-
124
- /**
125
- * @description 라이트 사이클
126
- ***************************
127
- */
128
- async connectedCallback() {
129
- // 메뉴 그룹 그리드 설정
130
- this.gridConfig = {
131
- rows: MetaApi.getGristSelectableConfig(false),
132
- pagination: { pages: [1000] },
133
- appendable: true,
134
- columns: [
135
- ...MetaApi.getGristGuttersConfig(true, false),
136
- {
137
- name: 'rank',
138
- header: TermsUtil.tLabel('rank'),
139
- width: 80,
140
- record: {
141
- editable: false,
142
- format: '#,###',
143
- align: 'left'
144
- },
145
- sortable: true
146
- },
147
- MetaApi.getGristColumnConfig('string', 'name', 'left', true, false, 300),
148
- {
149
- type: 'string',
150
- name: 'title',
151
- header: TermsUtil.tLabel('title'),
152
- record: {
153
- editable: false,
154
- align: 'left',
155
- renderer: (value, column, record, rowIndex, field) => {
156
- return record.name ? TermsUtil.tMenu(record.name) : ''
157
- }
158
- },
159
- sortable: false,
160
- width: 350
161
- },
162
- await MetaApi.getGristCodeSelectorColumnConfig('menuType', 'menu_type', 'left', false, 100, true, 'MENU_TYPE')
163
- ]
164
- }
165
-
166
- if (super.connectedCallback) {
167
- await super.connectedCallback()
168
- }
169
- }
170
-
171
- /**
172
- * @description 라이프 사이클
173
- ***************************
174
- */
175
- render() {
176
- return html` <div id="container" class="container">
177
- <div class="container_detail">
178
- <ox-grist
179
- id="ox-grist"
180
- .config=${this.gridConfig}
181
- .mode=${'GRID'}
182
- auto-fetch
183
- .fetchHandler=${this.fetchMainMenus.bind(this)}
184
- >
185
- </ox-grist>
186
- <div class="button-container">
187
- <button hidden id="receive" @click=${this.selectMainMenu.bind(this)}>
188
- <md-icon>menu_open</md-icon>${TermsUtil.tButton('create-menu')}
189
- </button>
190
- </div>
191
- </div>
192
- </div>`
193
- }
194
-
195
- /**
196
- * @description 그리드 리턴
197
- **************************
198
- * @returns {Object} 그리드
199
- */
200
- get grist() {
201
- return this.shadowRoot.querySelector('#ox-grist')
202
- }
203
-
204
- /**
205
- * @description 메인 메뉴 조회
206
- ***************************
207
- * @returns
208
- */
209
- async fetchMainMenus() {
210
- let filters = [{ name: 'parentId', operator: 'is_null', value: '' }]
211
- let sorters = [{ name: 'rank' }]
212
- let selectFields = `
213
- id
214
- name
215
- rank
216
- description
217
- menuType
218
- category
219
- `
220
- let result = await MetaApi.searchByPagination('menus', filters, sorters, 0, 0, selectFields)
221
- this.items = result.records
222
- this.total = result.total
223
- return { total: this.total, records: this.items }
224
- }
225
-
226
- /**
227
- * @description 메인 메뉴 선택 시 액션 - 콜백 함수 호출
228
- ************************************************
229
- */
230
- async selectMainMenu(e) {
231
- const records = this.grist.selected
232
- if (!records || records.length == 0) {
233
- UiUtil.showCustomAlert('title.info', 'text.NOTHING_SELECTED', 'info', 'button.confirm')
234
- } else {
235
- if (this.selectCallback) {
236
- let res = await this.selectCallback(records[0].id)
237
- if (res.success) {
238
- history.back()
239
- }
240
- }
241
- }
242
- }
243
- }
244
-
245
- customElements.define('main-menu-selector', MainMenuSelector)
@@ -1,145 +0,0 @@
1
- import { css, html, LitElement } from 'lit'
2
-
3
- import { i18next, localize } from '@operato/i18n'
4
- import { ScrollbarStyles, CommonGristStyles } from '@operato/styles'
5
-
6
- import { MetaApi } from '../../utils/meta-api'
7
-
8
- /**
9
- * @license
10
- * Copyright © HatioLab Inc. All rights reserved.
11
- * @author Yang
12
- * @description 변경 이력 (COPY) 타입 조회 팝업
13
- */
14
- export class HistoryCopyListPopup extends localize(i18next)(LitElement) {
15
- /**
16
- * @description 스타일 정의
17
- ***********************************
18
- * @returns {Object} 화면의 스타일 정의
19
- */
20
- static get styles() {
21
- let styles = [
22
- ScrollbarStyles,
23
- CommonGristStyles,
24
- css`
25
- :host {
26
- display: flex;
27
- flex-direction: column;
28
- overflow-x: auto;
29
- }
30
-
31
- ox-grist {
32
- overflow-y: auto;
33
- flex: 1;
34
- }
35
-
36
- ox-filters-form {
37
- flex: 1;
38
- }
39
- `
40
- ]
41
- return styles
42
- }
43
-
44
- /**
45
- * @description 프로퍼티 정의
46
- ***********************************
47
- * @returns {Object} 화면의 프로퍼티 정의
48
- */
49
- static get properties() {
50
- return {
51
- parent_id: String
52
- }
53
- }
54
-
55
- /**
56
- * @description 라이트 사이클
57
- ***************************
58
- */
59
- async connectedCallback() {
60
- // 메뉴 그룹 그리드 설정
61
- let parentGristConfig = this.open_param.gristConfig
62
- this.gqlFunc = this.open_param.gqlFunc
63
-
64
- delete parentGristConfig.list
65
- delete parentGristConfig.rows
66
-
67
- parentGristConfig.rows = {
68
- appendable: false,
69
- selectable: false
70
- }
71
-
72
- parentGristConfig.sorters = [{ name: 'dataRevisionNo', desc: true }]
73
-
74
- let gristColumns = parentGristConfig.columns.filter(x => x.type != 'gutter' && x.unusable !== true)
75
- gristColumns.forEach(x => {
76
- if (x.filter) delete x.filter
77
- if (!x.record) x.record = {}
78
-
79
- x.sortable = false
80
- x.record.editable = false
81
- })
82
-
83
- parentGristConfig.columns = [
84
- { type: 'gutter', gutterName: 'dirty' },
85
- MetaApi.getGristColumnConfig2('integer', 'dataRevisionNo', 'data_revision_no', 'center', false, true, 90),
86
- MetaApi.getGristColumnConfig2('string', 'dataRevisionAction', 'data_revision_action', 'center', false, false, 90),
87
- ...gristColumns
88
- ]
89
-
90
- this.gridConfig = parentGristConfig
91
-
92
- if (super.connectedCallback) {
93
- await super.connectedCallback()
94
- }
95
- }
96
-
97
- /**
98
- * @description 라이프 사이클
99
- ***************************
100
- */
101
- render() {
102
- return html`
103
- <ox-grist
104
- id="ox-grist"
105
- .config=${this.gridConfig}
106
- .mode=${'GRID'}
107
- auto-fetch
108
- .fetchHandler=${this.fetchHandler.bind(this)}
109
- >
110
- </ox-grist>
111
- `
112
- }
113
-
114
- /**
115
- * @description 그리드 리턴
116
- **************************
117
- * @returns {Object} 그리드
118
- */
119
- get grist() {
120
- return this.shadowRoot.querySelector('#ox-grist')
121
- }
122
-
123
- /**
124
- * @description 이력 조회
125
- ***************************
126
- * @returns
127
- */
128
- async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
129
- let filter = [{ name: 'originalId', operator: 'eq', value: this.parent_id }, ...filters]
130
-
131
- let selectFields = MetaApi.getSelectColumns(this.gridConfig.columns)
132
-
133
- let result = await MetaApi.searchByPagination(
134
- `${this.gqlFunc}Histories`,
135
- filter,
136
- sortings,
137
- page,
138
- limit,
139
- selectFields
140
- )
141
- return result
142
- }
143
- }
144
-
145
- customElements.define('history-copy-list-popup', HistoryCopyListPopup)
@@ -1,159 +0,0 @@
1
- import { css, html, LitElement } from 'lit'
2
-
3
- import { i18next, localize } from '@operato/i18n'
4
- import { ScrollbarStyles, CommonGristStyles } from '@operato/styles'
5
-
6
- import { TermsUtil } from './../../utils/terms-util'
7
- import { UiUtil } from '../../utils/ui-util'
8
- import { MetaApi } from '../../utils/meta-api'
9
-
10
- /**
11
- * @license
12
- * Copyright © HatioLab Inc. All rights reserved.
13
- * @author Yang
14
- * @description 변경 이력 (JSON) 타입 조회 팝업
15
- */
16
- export class HistoryJsonListPopup extends localize(i18next)(LitElement) {
17
- /**
18
- * @description 스타일 정의
19
- ***********************************
20
- * @returns {Object} 화면의 스타일 정의
21
- */
22
- static get styles() {
23
- let styles = [
24
- ScrollbarStyles,
25
- CommonGristStyles,
26
- css`
27
- :host {
28
- display: flex;
29
- flex-direction: column;
30
- overflow-x: auto;
31
- }
32
- ox-grist {
33
- overflow-y: auto;
34
- flex: 1;
35
- }
36
-
37
- ox-filters-form {
38
- flex: 1;
39
- }
40
- `
41
- ]
42
- return styles
43
- }
44
-
45
- /**
46
- * @description 프로퍼티 정의
47
- ***********************************
48
- * @returns {Object} 화면의 프로퍼티 정의
49
- */
50
- static get properties() {
51
- return {
52
- parent_id: String
53
- }
54
- }
55
-
56
- /**
57
- * @description 라이트 사이클
58
- ***************************
59
- */
60
- async connectedCallback() {
61
- // 메뉴 그룹 그리드 설정
62
- let parentGristConfig = this.open_param.gristConfig
63
- this.gqlFunc = this.open_param.gqlFunc
64
-
65
- delete parentGristConfig.list
66
- delete parentGristConfig.rows
67
-
68
- parentGristConfig.rows = {
69
- appendable: false,
70
- selectable: false
71
- }
72
-
73
- parentGristConfig.sorters = [{ name: 'dataRevisionNo', desc: true }]
74
-
75
- let gristColumns = parentGristConfig.columns.filter(x => x.type != 'gutter' && x.unusable !== true)
76
- gristColumns.forEach(x => {
77
- if (x.filter) delete x.filter
78
- if (!x.record) x.record = {}
79
-
80
- x.sortable = false
81
- x.record.editable = false
82
- })
83
-
84
- parentGristConfig.columns = [
85
- { type: 'gutter', gutterName: 'dirty' },
86
- MetaApi.getGristColumnConfig2('integer', 'dataRevisionNo', 'data_revision_no', 'center', false, true, 90),
87
- MetaApi.getGristColumnConfig2('string', 'dataRevisionAction', 'data_revision_action', 'center', false, false, 90),
88
- ...gristColumns
89
- ]
90
-
91
- this.gridConfig = parentGristConfig
92
-
93
- if (super.connectedCallback) {
94
- await super.connectedCallback()
95
- }
96
- }
97
-
98
- /**
99
- * @description 라이프 사이클
100
- ***************************
101
- */
102
- render() {
103
- return html`
104
- <ox-grist
105
- id="ox-grist"
106
- .config=${this.gridConfig}
107
- .mode=${'GRID'}
108
- auto-fetch
109
- .fetchHandler=${this.fetchHandler.bind(this)}
110
- >
111
- </ox-grist>
112
- `
113
- }
114
-
115
- /**
116
- * @description 그리드 리턴
117
- **************************
118
- * @returns {Object} 그리드
119
- */
120
- get grist() {
121
- return this.shadowRoot.querySelector('#ox-grist')
122
- }
123
-
124
- /**
125
- * @description 이력 조회
126
- ***************************
127
- * @returns
128
- */
129
- async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
130
- let filter = [{ name: 'originalId', operator: 'eq', value: this.parent_id }, ...filters]
131
-
132
- let selectFields = `
133
- id
134
- originalId
135
- dataRevisionNo
136
- dataRevisionAction
137
- historyJson
138
- `
139
-
140
- let result = await MetaApi.searchByPagination(
141
- `${this.gqlFunc}Histories`,
142
- filter,
143
- sortings,
144
- page,
145
- limit,
146
- selectFields
147
- )
148
-
149
- result.records = result.records.map(x => {
150
- return {
151
- ...JSON.parse(x.historyJson),
152
- ...x
153
- }
154
- })
155
- return result
156
- }
157
- }
158
-
159
- customElements.define('history-json-list-popup', HistoryJsonListPopup)
@@ -1,92 +0,0 @@
1
- import { css, html, LitElement } from 'lit'
2
- import { i18next, localize } from '@operato/i18n'
3
- import { ScrollbarStyles } from '@operato/styles'
4
-
5
- import '@operato/input/ox-input-code.js'
6
-
7
- import { MetaApi } from '../../utils/meta-api'
8
-
9
- class DynamicMenuTemplate extends localize(i18next)(LitElement) {
10
- static get properties() {
11
- return {
12
- title: String,
13
- recordId: String
14
- }
15
- }
16
-
17
- static get styles() {
18
- let styles = [
19
- ScrollbarStyles,
20
- css`
21
- :host {
22
- display: flex;
23
- flex-direction: column;
24
- overflow-x: overlay;
25
- background-color: var(--md-sys-color-background);
26
- }
27
- legend {
28
- margin: 10px;
29
- text-transform: capitalize;
30
- padding: var(--legend-padding);
31
- font: var(--legend-font);
32
- color: var(--legend-text-color);
33
- border-bottom: var(--legend-border-bottom);
34
- }
35
- ox-input-code {
36
- margin: 10px;
37
- overflow-y: auto;
38
- flex: 1;
39
- }
40
- .button-container {
41
- padding: var(--button-container-padding);
42
- margin: var(--button-container-margin);
43
- text-align: var(--button-container-align);
44
- background-color: var(--button-container-background);
45
- height: var(--button-container-height);
46
- text-align: right;
47
- padding-right: 12px;
48
- }
49
- `
50
- ]
51
-
52
- return styles
53
- }
54
-
55
- async firstUpdated() {
56
- if (super.firstUpdated) {
57
- await super.firstUpdated()
58
- }
59
-
60
- let menu = await MetaApi.findOne('menu', this.recordId, 'template')
61
- let codeData = menu ? menu.template || '' : ''
62
- this.codeEditor.value = codeData
63
- this.codeEditor.orgValue = this.codeEditor.value
64
- }
65
-
66
- render() {
67
- return html` <legend>${this.title}</legend>
68
- <ox-input-code mode="javascript" value=${this.codeValueNew}></ox-input-code>
69
- <div class="button-container"></div>`
70
- }
71
-
72
- get codeEditor() {
73
- return this.shadowRoot.querySelector('ox-input-code')
74
- }
75
-
76
- async save() {
77
- if (this.codeEditor.orgValue == this.codeEditor.value) {
78
- MetaApi.showAlertPopup('text.nothing_changed', 'text.there_is_nothing_to_save', 'info', 'confirm')
79
- return
80
- }
81
-
82
- let template = this.codeEditor.value
83
-
84
- let patches = [{ id: this.recordId, template: template, cuFlag: 'M' }]
85
- let result = await MetaApi.updateMultiple('updateMultipleMenu', patches)
86
- if (result) {
87
- history.back()
88
- }
89
- }
90
- }
91
-
92
- customElements.define('dynamic-menu-template', DynamicMenuTemplate)