@things-factory/organization 6.1.84 → 6.1.87

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 (35) hide show
  1. package/client/component/department-view.ts +4 -3
  2. package/client/pages/employee/employee-list-page.ts +122 -50
  3. package/client/pages/employee/employees-by-department.ts +468 -0
  4. package/client/route.ts +4 -0
  5. package/dist-client/component/department-view.js +8 -8
  6. package/dist-client/component/department-view.js.map +1 -1
  7. package/dist-client/pages/employee/employee-list-page.js +120 -48
  8. package/dist-client/pages/employee/employee-list-page.js.map +1 -1
  9. package/dist-client/pages/employee/employees-by-department.d.ts +38 -0
  10. package/dist-client/pages/employee/employees-by-department.js +464 -0
  11. package/dist-client/pages/employee/employees-by-department.js.map +1 -0
  12. package/dist-client/route.d.ts +1 -1
  13. package/dist-client/route.js +3 -0
  14. package/dist-client/route.js.map +1 -1
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/service/employee/employee-history.js +36 -0
  17. package/dist-server/service/employee/employee-history.js.map +1 -1
  18. package/dist-server/service/employee/employee-query.js +1 -1
  19. package/dist-server/service/employee/employee-query.js.map +1 -1
  20. package/dist-server/service/employee/employee-type.js +40 -0
  21. package/dist-server/service/employee/employee-type.js.map +1 -1
  22. package/dist-server/service/employee/employee.js +21 -1
  23. package/dist-server/service/employee/employee.js.map +1 -1
  24. package/dist-server/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +3 -3
  26. package/server/service/employee/employee-history.ts +31 -1
  27. package/server/service/employee/employee-query.ts +2 -2
  28. package/server/service/employee/employee-type.ts +30 -0
  29. package/server/service/employee/employee.ts +17 -1
  30. package/things-factory.config.js +1 -0
  31. package/translations/en.json +6 -1
  32. package/translations/ja.json +6 -1
  33. package/translations/ko.json +6 -1
  34. package/translations/ms.json +6 -1
  35. package/translations/zh.json +6 -1
@@ -0,0 +1,468 @@
1
+ import '@operato/data-tree'
2
+
3
+ import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
4
+ import { PageView, store } from '@operato/shell'
5
+ import { css, html } from 'lit'
6
+ import { customElement, property, query, state } from 'lit/decorators.js'
7
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements'
8
+ import { client } from '@operato/graphql'
9
+ import { i18next, localize } from '@operato/i18n'
10
+ import { notify, openPopup } from '@operato/layout'
11
+ import { OxPopup } from '@operato/popup'
12
+ import { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'
13
+
14
+ import { connect } from 'pwa-helpers/connect-mixin'
15
+ import gql from 'graphql-tag'
16
+
17
+ import { DepartmentImporter } from '../department/department-importer'
18
+ import { Department } from '../../types/department'
19
+
20
+ import { DepartmentView } from '../../component/department-view'
21
+ import { EmployeeListPage } from './employee-list-page'
22
+
23
+ const departmentFragment = gql`
24
+ fragment Department_department on Department {
25
+ id
26
+ controlNo
27
+ name
28
+ description
29
+
30
+ manager {
31
+ id
32
+ name
33
+ controlNo
34
+ photo
35
+ email
36
+ }
37
+ active
38
+ state
39
+ picture
40
+
41
+ updater {
42
+ id
43
+ name
44
+ }
45
+ updatedAt
46
+ }
47
+ `
48
+
49
+ @customElement('employees-by-department')
50
+ export class EmployeesByDepartment extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
51
+ static styles = [
52
+ ScrollbarStyles,
53
+ CommonGristStyles,
54
+ css`
55
+ :host {
56
+ display: flex;
57
+ flex-direction: row;
58
+ overflow: auto;
59
+ }
60
+ ox-tree {
61
+ flex: 1;
62
+ overflow: auto;
63
+ }
64
+ ox-grist {
65
+ flex: 4;
66
+ }
67
+ `
68
+ ]
69
+
70
+ static get scopedElements() {
71
+ return {
72
+ 'department-importer': DepartmentImporter
73
+ }
74
+ }
75
+
76
+ @query('ox-grist') private grist!: DataGrist
77
+ @property({ type: Object }) gristConfig: any
78
+
79
+ @state() root?: Department
80
+ @state() selected?: Department
81
+
82
+ @query('employee-list-page') employeeListPage!: EmployeeListPage
83
+
84
+ get context() {
85
+ return {
86
+ title: i18next.t('title.employees-by-department'),
87
+ actions: []
88
+ }
89
+ }
90
+
91
+ render() {
92
+ return html`
93
+ <ox-tree
94
+ .data=${this.root}
95
+ .selected=${this.selected}
96
+ @select=${this.onSelect.bind(this)}
97
+ label-property="name"
98
+ ></ox-tree>
99
+
100
+ <ox-grist .config=${this.gristConfig} .fetchHandler=${this.fetchEmployees.bind(this)}>
101
+ <div slot="headroom">
102
+ <div id="filters">
103
+ <ox-filters-form autofocus></ox-filters-form>
104
+ </div>
105
+ </div>
106
+ </ox-grist>
107
+ `
108
+ }
109
+
110
+ async pageInitialized(lifecycle: any) {
111
+ this.gristConfig = {
112
+ pagination: { pages: [100] },
113
+ list: {
114
+ thumbnail: 'profile',
115
+ fields: ['controlNo', 'name'],
116
+ details: ['email', 'department', 'hiredOn', 'updatedAt']
117
+ },
118
+ columns: [
119
+ { type: 'gutter', gutterName: 'sequence' },
120
+ {
121
+ type: 'string',
122
+ name: 'controlNo',
123
+ header: i18next.t('field.control-no'),
124
+ record: {
125
+ editable: true
126
+ },
127
+ filter: 'search',
128
+ sortable: true,
129
+ width: 105
130
+ },
131
+ {
132
+ type: 'string',
133
+ name: 'name',
134
+ header: i18next.t('field.name'),
135
+ record: {
136
+ editable: true
137
+ },
138
+ filter: 'search',
139
+ sortable: true,
140
+ width: 100
141
+ },
142
+ {
143
+ type: 'string',
144
+ name: 'alias',
145
+ header: i18next.t('label.alias'),
146
+ record: {
147
+ editable: true
148
+ },
149
+ filter: 'search',
150
+ sortable: true,
151
+ width: 110
152
+ },
153
+ {
154
+ type: 'resource-object',
155
+ name: 'user',
156
+ header: i18next.t('field.user'),
157
+ record: {
158
+ editable: true,
159
+ options: {
160
+ title: i18next.t('title.lookup user'),
161
+ queryName: 'users',
162
+ basicArgs: { filters: [{ name: 'userType', operator: 'eq', value: 'user' }] },
163
+ descriptionField: 'email',
164
+ columns: [
165
+ { name: 'id', hidden: true },
166
+ { name: 'name', header: i18next.t('field.name'), filter: 'search' },
167
+ { name: 'email', header: i18next.t('field.email'), filter: 'search' }
168
+ ],
169
+ list: { fields: ['name', 'email'] }
170
+ }
171
+ },
172
+ sortable: true,
173
+ filter: false,
174
+ width: 100
175
+ },
176
+ {
177
+ type: 'code',
178
+ name: 'type',
179
+ header: i18next.t('field.type'),
180
+ width: 115,
181
+ sortable: false,
182
+ filter: false,
183
+ record: {
184
+ editable: true,
185
+ codeName: 'EMPLOYEE_TYPE'
186
+ }
187
+ },
188
+ {
189
+ type: 'department-object',
190
+ name: 'department',
191
+ header: i18next.t('field.department'),
192
+ record: {
193
+ editable: true
194
+ },
195
+ sortable: true,
196
+ filter: false,
197
+ width: 130
198
+ },
199
+ {
200
+ type: 'resource-object',
201
+ name: 'supervisor',
202
+ header: i18next.t('field.supervisor'),
203
+ record: {
204
+ editable: true,
205
+ options: {
206
+ title: i18next.t('title.employee list'),
207
+ queryName: 'employees',
208
+ pagination: { pages: [100, 200, 500] },
209
+ basicArgs: {
210
+ filters: [{
211
+ name: 'active', operator: 'eq', value: true
212
+ }]
213
+ },
214
+ list: { fields: ['controlNo', 'name', 'alias', 'hiredOn', 'active'] },
215
+ select: [
216
+ { name: 'id', hidden: true },
217
+ { type: 'string', name: 'controlNo', header: { renderer: () => i18next.t('field.control-no') }, width: 130, filter: 'search', sortable: true },
218
+ { type: 'string', name: 'name', header: { renderer: () => i18next.t('field.name') }, width: 150, filter: 'search' },
219
+ { type: 'string', name: 'alias', header: { renderer: () => i18next.t('label.alias') }, width: 150, filter: 'search' },
220
+ { type: 'string', name: 'hiredOn', header: { renderer: () => i18next.t('field.hired-on'), width: 100 } },
221
+ {
222
+ type: 'checkbox',
223
+ name: 'active',
224
+ label: true,
225
+ header: i18next.t('field.active'),
226
+ record: {
227
+ align: 'center',
228
+ editable: true
229
+ },
230
+ sortable: true,
231
+ width: 85
232
+ }
233
+ ],
234
+ valueField: 'id',
235
+ nameField: 'name',
236
+ descriptionField: 'controlNo'
237
+ }
238
+ },
239
+ sortable: true,
240
+ width: 120
241
+ },
242
+ {
243
+ type: 'string',
244
+ name: 'email',
245
+ header: i18next.t('field.email'),
246
+ width: 200,
247
+ record: {
248
+ editable: false,
249
+ renderer: function (value, column, record, rowIndex, field) {
250
+ return record.contact ? record.contact.email : '';
251
+ }
252
+ },
253
+ sortable: true
254
+ },
255
+ {
256
+ type: 'string',
257
+ name: 'phone',
258
+ header: i18next.t('field.phone'),
259
+ width: 110,
260
+ record: {
261
+ editable: false,
262
+ renderer: function (value, column, record, rowIndex, field) {
263
+ return record.contact ? record.contact.phone : '';
264
+ }
265
+ },
266
+ sortable: true
267
+ },
268
+ {
269
+ type: 'code',
270
+ name: 'jobResponsibility',
271
+ header: i18next.t('label.job-responsibility'),
272
+ width: 100,
273
+ record: {
274
+ editable: true,
275
+ codeName: 'JOB_RESPONSIBILITY'
276
+ }
277
+ },
278
+ {
279
+ type: 'code',
280
+ name: 'jobPosition',
281
+ header: i18next.t('label.job-position'),
282
+ width: 100,
283
+ record: {
284
+ editable: true,
285
+ codeName: 'JOB_POSITION'
286
+ }
287
+ },
288
+ {
289
+ type: 'date',
290
+ name: 'hiredOn',
291
+ header: i18next.t('field.hired-on'),
292
+ width: 100,
293
+ record: {
294
+ editable: true
295
+ },
296
+ sortable: true
297
+ },
298
+ {
299
+ type: 'date',
300
+ name: 'retiredAt',
301
+ header: i18next.t('label.retired-at'),
302
+ width: 100,
303
+ record: {
304
+ editable: true
305
+ }
306
+ },
307
+ {
308
+ type: 'checkbox',
309
+ name: 'active',
310
+ label: true,
311
+ header: i18next.t('field.active'),
312
+ width: 85,
313
+ record: {
314
+ align: 'center',
315
+ editable: true
316
+ },
317
+ filter: true,
318
+ sortable: true
319
+ },
320
+ {
321
+ type: 'string',
322
+ name: 'note',
323
+ header: i18next.t('field.note'),
324
+ width: 200,
325
+ record: {
326
+ editable: true
327
+ },
328
+ filter: 'search'
329
+ }
330
+ ],
331
+ rows: {
332
+ selectable: {
333
+ multiple: false
334
+ }
335
+ },
336
+ sorters: [{
337
+ name: 'controlNo'
338
+ }]
339
+ };
340
+
341
+ this.fetchDepartments()
342
+ }
343
+
344
+ async pageUpdated(changes: any, lifecycle: any) {
345
+ if (this.active) {
346
+ }
347
+ }
348
+
349
+ async onSelect(e: CustomEvent) {
350
+ this.selected = e.detail as Department
351
+ this.grist.fetch()
352
+ this.updateContext()
353
+ }
354
+
355
+ async fetchEmployees({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
356
+ if (this.selected) {
357
+ filters.push({
358
+ name: 'departmentId',
359
+ operator: 'eq',
360
+ value: this.selected.id
361
+ })
362
+ }
363
+
364
+ const response = await client.query({
365
+ query: gql`
366
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
367
+ responses: employees(filters: $filters, pagination: $pagination, sortings: $sortings) {
368
+ items {
369
+ id
370
+ controlNo
371
+ name
372
+ alias
373
+ type
374
+ jobResponsibility
375
+ jobPosition
376
+ active
377
+ email
378
+ phone
379
+ user {
380
+ id
381
+ name
382
+ }
383
+ department {
384
+ id
385
+ name
386
+ description
387
+ }
388
+ supervisor {
389
+ id
390
+ name
391
+ controlNo
392
+ }
393
+ note
394
+ hiredOn
395
+ retiredAt
396
+ contact {
397
+ id
398
+ email
399
+ phone
400
+ address
401
+ }
402
+ profile {
403
+ left
404
+ top
405
+ zoom
406
+ picture
407
+ }
408
+ updater {
409
+ id
410
+ name
411
+ }
412
+ updatedAt
413
+ }
414
+ total
415
+ }
416
+ }
417
+ `,
418
+ variables: {
419
+ filters,
420
+ pagination: { page, limit },
421
+ sortings
422
+ }
423
+ })
424
+
425
+ const records = response.data.responses.items
426
+ return {
427
+ total: response.data.responses.total || 0,
428
+ records
429
+ }
430
+ }
431
+
432
+ async fetchDepartments() {
433
+ const response = await client.query({
434
+ query: gql`
435
+ query {
436
+ responses: departmentRoot {
437
+ ...Department_department
438
+ children {
439
+ ...Department_department
440
+ children {
441
+ ...Department_department
442
+ children {
443
+ ...Department_department
444
+ children {
445
+ ...Department_department
446
+ children {
447
+ ...Department_department
448
+ children {
449
+ ...Department_department
450
+ children {
451
+ ...Department_department
452
+ }
453
+ }
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ }
461
+
462
+ ${departmentFragment}
463
+ `
464
+ })
465
+
466
+ this.root = response.data.responses
467
+ }
468
+ }
package/client/route.ts CHANGED
@@ -8,6 +8,10 @@ export default function route(page: string) {
8
8
  import('./pages/department/department-list-page')
9
9
  return page
10
10
 
11
+ case 'employees-by-department':
12
+ import('./pages/employee/employees-by-department')
13
+ return page
14
+
11
15
  case 'common-approval-line-templates-page':
12
16
  import('./pages/approval-line/common-approval-line-templates-page')
13
17
  return page
@@ -48,14 +48,14 @@ let DepartmentView = class DepartmentView extends localize(i18next)(ScopedElemen
48
48
  name: 'active',
49
49
  label: 'active'
50
50
  },
51
- {
52
- type: 'select',
53
- name: 'state',
54
- label: 'state',
55
- property: {
56
- options: ['', 'STATUS_A', 'STATUS_B']
57
- }
58
- },
51
+ /*{
52
+ type: 'select',
53
+ name: 'state',
54
+ label: 'state',
55
+ property: {
56
+ options: ['', 'STATUS_A', 'STATUS_B']
57
+ }
58
+ },*/
59
59
  {
60
60
  type: 'image',
61
61
  name: 'picture',
@@ -1 +1 @@
1
- {"version":3,"file":"department-view.js","sourceRoot":"","sources":["../../client/component/department-view.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,wDAAwD,CAAA;AAE/D,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAoB,MAAM,KAAK,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG1C,IA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D,UAAU,EAAE,IAAI;oBAChB,SAAS,EAAE,MAAM;oBACjB,gBAAgB,EAAE,WAAW;iBAC9B;aACF;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;aAChB;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,QAAQ,EAAE;oBACR,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,CAAC;iBACtC;aACF;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;aACjB;SACF,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;iBAEE,IAAI,CAAC,UAAU;iBACf,IAAI,CAAC,UAAU;2BACL,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;;KAEtD,CAAA;IACH,CAAC;IAED,gBAAgB,CAAC,CAAc;QAC7B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,MAAM,CAAA;IAC5B,CAAC;;AA3FM,qBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAgB;AAE3C;IAAC,KAAK,CAAC,4BAA4B,CAAC;;mDAAkB;AAEtD;IAAC,KAAK,EAAE;;kDAAwB;AArBrB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CA6F1B;SA7FY,cAAc","sourcesContent":["import '@operato/property-editor'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\n\nimport { LitElement, css, html, PropertyValueMap } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('department-view')\nexport class DepartmentView extends localize(i18next)(ScopedElementsMixin(LitElement)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: auto;\n }\n\n ox-properties-dynamic-view {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) department: any\n\n @query('ox-properties-dynamic-view') dynamicView!: any\n\n @state() private properties: any\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.properties = [\n {\n type: 'string',\n name: 'controlNo',\n label: 'control-no'\n },\n {\n type: 'string',\n name: 'name',\n label: 'name'\n },\n {\n type: 'string',\n name: 'description',\n label: 'description'\n },\n {\n type: 'resource-object',\n name: 'manager',\n label: 'manager',\n property: {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n columns: [\n { name: 'id', hidden: true },\n { name: 'controlNo', header: { renderer: () => i18next.t('field.control-no') }, filter: 'search' },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' },\n { name: 'email', header: { renderer: () => i18next.t('field.email') } }\n ],\n list: { fields: ['controlNo', 'name', 'email'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n {\n type: 'boolean',\n name: 'active',\n label: 'active'\n },\n {\n type: 'select',\n name: 'state',\n label: 'state',\n property: {\n options: ['', 'STATUS_A', 'STATUS_B']\n }\n },\n {\n type: 'image',\n name: 'picture',\n label: 'picture'\n }\n ]\n }\n\n render() {\n return html`\n <ox-properties-dynamic-view\n .props=${this.properties}\n .value=${this.department}\n @property-change=${this.onPropertyChange.bind(this)}\n ></ox-properties-dynamic-view>\n `\n }\n\n onPropertyChange(e: CustomEvent) {\n this.department = e.detail\n }\n}\n"]}
1
+ {"version":3,"file":"department-view.js","sourceRoot":"","sources":["../../client/component/department-view.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,wDAAwD,CAAA;AAE/D,OAAO,EAAE,UAAU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-dynamic-view.js'\n\nimport { LitElement, css, html, PropertyValueMap } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { getCodeByName } from '@things-factory/code-base'\n\n@customElement('department-view')\nexport class DepartmentView extends localize(i18next)(ScopedElementsMixin(LitElement)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: auto;\n }\n\n ox-properties-dynamic-view {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) department: any\n\n @query('ox-properties-dynamic-view') dynamicView!: any\n\n @state() private properties: any\n\n protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n this.properties = [\n {\n type: 'string',\n name: 'controlNo',\n label: 'control-no'\n },\n {\n type: 'string',\n name: 'name',\n label: 'name'\n },\n {\n type: 'string',\n name: 'description',\n label: 'description'\n },\n {\n type: 'resource-object',\n name: 'manager',\n label: 'manager',\n property: {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n columns: [\n { name: 'id', hidden: true },\n { name: 'controlNo', header: { renderer: () => i18next.t('field.control-no') }, filter: 'search' },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' },\n { name: 'email', header: { renderer: () => i18next.t('field.email') } }\n ],\n list: { fields: ['controlNo', 'name', 'email'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n },\n {\n type: 'boolean',\n name: 'active',\n label: 'active'\n },\n /*{\n type: 'select',\n name: 'state',\n label: 'state',\n property: {\n options: ['', 'STATUS_A', 'STATUS_B'] \n }\n },*/\n {\n type: 'image',\n name: 'picture',\n label: 'picture'\n }\n ]\n }\n\n render() {\n return html`\n <ox-properties-dynamic-view\n .props=${this.properties}\n .value=${this.department}\n @property-change=${this.onPropertyChange.bind(this)}\n ></ox-properties-dynamic-view>\n `\n }\n\n onPropertyChange(e: CustomEvent) {\n this.department = e.detail\n }\n}\n"]}