@things-factory/organization 6.0.34 → 6.0.40

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 (29) hide show
  1. package/client/bootstrap.ts +5 -3
  2. package/client/component/approval-line-items-editor-popup.ts +5 -1
  3. package/client/component/approval-line-items-editor.ts +16 -3
  4. package/client/grist-editor/grist-editor-approval-line.ts +6 -7
  5. package/client/grist-editor/grist-editor-assignees.ts +6 -7
  6. package/client/grist-editor/grist-renderer-approval-line.ts +12 -0
  7. package/client/grist-editor/grist-renderer-assignees.ts +12 -0
  8. package/dist-client/bootstrap.js +5 -3
  9. package/dist-client/bootstrap.js.map +1 -1
  10. package/dist-client/component/approval-line-items-editor-popup.js +4 -1
  11. package/dist-client/component/approval-line-items-editor-popup.js.map +1 -1
  12. package/dist-client/component/approval-line-items-editor.js +16 -3
  13. package/dist-client/component/approval-line-items-editor.js.map +1 -1
  14. package/dist-client/grist-editor/grist-editor-approval-line.js +5 -5
  15. package/dist-client/grist-editor/grist-editor-approval-line.js.map +1 -1
  16. package/dist-client/grist-editor/grist-editor-assignees.js +5 -5
  17. package/dist-client/grist-editor/grist-editor-assignees.js.map +1 -1
  18. package/dist-client/grist-editor/grist-renderer-approval-line.d.ts +3 -0
  19. package/dist-client/grist-editor/grist-renderer-approval-line.js +10 -0
  20. package/dist-client/grist-editor/grist-renderer-approval-line.js.map +1 -0
  21. package/dist-client/grist-editor/grist-renderer-assignees.d.ts +3 -0
  22. package/dist-client/grist-editor/grist-renderer-assignees.js +10 -0
  23. package/dist-client/grist-editor/grist-renderer-assignees.js.map +1 -0
  24. package/dist-client/tsconfig.tsbuildinfo +1 -1
  25. package/dist-server/service/approval-line/approval-line-query.js +4 -4
  26. package/dist-server/service/approval-line/approval-line-query.js.map +1 -1
  27. package/dist-server/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +2 -2
  29. package/server/service/approval-line/approval-line-query.ts +4 -4
@@ -1,9 +1,11 @@
1
- import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
1
+ import { registerEditor, registerRenderer } from '@operato/data-grist'
2
2
 
3
3
  import { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object'
4
4
  import { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'
5
5
  import { GristEditorAssignees } from './grist-editor/grist-editor-assignees'
6
+ import { GristRendererAssignees } from './grist-editor/grist-renderer-assignees'
6
7
  import { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'
8
+ import { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line'
7
9
 
8
10
  export default function bootstrap() {
9
11
  /* register grist renderer/editor for id */
@@ -12,6 +14,6 @@ export default function bootstrap() {
12
14
  registerEditor('assignees', GristEditorAssignees)
13
15
 
14
16
  registerRenderer('department-object', GristRendererDepartmentObject)
15
- registerRenderer('approval-line', OxGristRendererJson5)
16
- registerRenderer('assignees', OxGristRendererJson5)
17
+ registerRenderer('approval-line', GristRendererApprovalLine)
18
+ registerRenderer('assignees', GristRendererAssignees)
17
19
  }
@@ -68,7 +68,11 @@ export class ApprovalLineItemsEditorPopup extends localize(i18next)(LitElement)
68
68
  }
69
69
 
70
70
  onConfirm() {
71
- this.confirmCallback && this.confirmCallback(this.changedValue)
71
+ const result = (this.changedValue || []).map(v => {
72
+ return v.approver ? { type: v.type, value: v.approver.id } : v
73
+ })
74
+
75
+ this.confirmCallback && this.confirmCallback(result)
72
76
 
73
77
  closePopup(this)
74
78
  }
@@ -62,7 +62,7 @@ export class ApprovalLineItemsEditor extends localize(i18next)(LitElement) {
62
62
  .fetchHandler=${this.fetchHandler.bind(this)}
63
63
  @record-change=${e => {
64
64
  this.value = ((this.grist as any)?._data.records || []).map(v => {
65
- return { type: v.type, value: v.value, approver: v.approver }
65
+ return v.approver ? { type: v.type, value: v.approver.id } : { type: v.type }
66
66
  })
67
67
  this.dispatchEvent(
68
68
  new CustomEvent('change', {
@@ -148,7 +148,20 @@ export class ApprovalLineItemsEditor extends localize(i18next)(LitElement) {
148
148
  case 'Department':
149
149
  options = {
150
150
  title: i18next.t('title.department list'),
151
- queryName: 'departments'
151
+ queryName: 'departments',
152
+ columns: [
153
+ { name: 'id', hidden: true },
154
+ {
155
+ name: 'controlNo',
156
+ header: { renderer: () => i18next.t('field.control-no') },
157
+ filter: 'search'
158
+ },
159
+ { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }
160
+ ],
161
+ list: { fields: ['name', 'control-no'] },
162
+ valueField: 'id',
163
+ nameField: 'name',
164
+ descriptionField: 'controlNo'
152
165
  }
153
166
  break
154
167
  case 'Role':
@@ -158,7 +171,7 @@ export class ApprovalLineItemsEditor extends localize(i18next)(LitElement) {
158
171
  }
159
172
  break
160
173
  default:
161
- options = {}
174
+ return null
162
175
  }
163
176
 
164
177
  var dynamicRecord = { ...column.record, options }
@@ -13,13 +13,12 @@ export class GristEditorApprovalLine extends OxGristEditor {
13
13
  private template?: TemplateResult
14
14
 
15
15
  get editorTemplate() {
16
- var { name, description } = this.value || {}
17
-
18
- return html`
19
- ${!this.value
20
- ? html``
21
- : html` <span tabindex="0" style="flex:1">${name || ''}${(description && `(${description})`) || ''}</span> `}
22
- `
16
+ const value = this.value
17
+ return !value || !(value instanceof Array) || value.length == 0
18
+ ? html``
19
+ : value.length == 1
20
+ ? html`<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
21
+ : html`<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`
23
22
  }
24
23
 
25
24
  _onclick(e: Event): void {
@@ -13,13 +13,12 @@ export class GristEditorAssignees extends OxGristEditor {
13
13
  private template?: TemplateResult
14
14
 
15
15
  get editorTemplate() {
16
- var { name, description } = this.value || {}
17
-
18
- return html`
19
- ${!this.value
20
- ? html``
21
- : html` <span tabindex="0" style="flex:1">${name || ''}${(description && `(${description})`) || ''}</span> `}
22
- `
16
+ const value = this.value
17
+ return !value || !(value instanceof Array) || value.length == 0
18
+ ? html``
19
+ : value.length == 1
20
+ ? html`<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
21
+ : html`<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`
23
22
  }
24
23
 
25
24
  _onclick(e: Event): void {
@@ -0,0 +1,12 @@
1
+ import '@material/mwc-icon'
2
+ import { html } from 'lit-html'
3
+
4
+ import { FieldRenderer } from '@operato/data-grist'
5
+
6
+ export const GristRendererApprovalLine: FieldRenderer = (value, column, record, rowIndex, field) => {
7
+ return !value || !(value instanceof Array) || value.length == 0
8
+ ? html``
9
+ : value.length == 1
10
+ ? html`<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
11
+ : html`<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`
12
+ }
@@ -0,0 +1,12 @@
1
+ import '@material/mwc-icon'
2
+ import { html } from 'lit-html'
3
+
4
+ import { FieldRenderer } from '@operato/data-grist'
5
+
6
+ export const GristRendererAssignees: FieldRenderer = (value, column, record, rowIndex, field) => {
7
+ return !value || !(value instanceof Array) || value.length == 0
8
+ ? html``
9
+ : value.length == 1
10
+ ? html`<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
11
+ : html`<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`
12
+ }
@@ -1,15 +1,17 @@
1
- import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist';
1
+ import { registerEditor, registerRenderer } from '@operato/data-grist';
2
2
  import { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object';
3
3
  import { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object';
4
4
  import { GristEditorAssignees } from './grist-editor/grist-editor-assignees';
5
+ import { GristRendererAssignees } from './grist-editor/grist-renderer-assignees';
5
6
  import { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line';
7
+ import { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line';
6
8
  export default function bootstrap() {
7
9
  /* register grist renderer/editor for id */
8
10
  registerEditor('department-object', GristEditorDepartmentObject);
9
11
  registerEditor('approval-line', GristEditorApprovalLine);
10
12
  registerEditor('assignees', GristEditorAssignees);
11
13
  registerRenderer('department-object', GristRendererDepartmentObject);
12
- registerRenderer('approval-line', OxGristRendererJson5);
13
- registerRenderer('assignees', OxGristRendererJson5);
14
+ registerRenderer('approval-line', GristRendererApprovalLine);
15
+ registerRenderer('assignees', GristRendererAssignees);
14
16
  }
15
17
  //# sourceMappingURL=bootstrap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAA;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AAEnF,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,2CAA2C;IAC3C,cAAc,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,CAAA;IAChE,cAAc,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAA;IACxD,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;IAEjD,gBAAgB,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAA;IACpE,gBAAgB,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;IACvD,gBAAgB,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object'\nimport { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'\nimport { GristEditorAssignees } from './grist-editor/grist-editor-assignees'\nimport { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'\n\nexport default function bootstrap() {\n /* register grist renderer/editor for id */\n registerEditor('department-object', GristEditorDepartmentObject)\n registerEditor('approval-line', GristEditorApprovalLine)\n registerEditor('assignees', GristEditorAssignees)\n\n registerRenderer('department-object', GristRendererDepartmentObject)\n registerRenderer('approval-line', OxGristRendererJson5)\n registerRenderer('assignees', OxGristRendererJson5)\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAA;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAA;AAEvF,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,2CAA2C;IAC3C,cAAc,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,CAAA;IAChE,cAAc,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAA;IACxD,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;IAEjD,gBAAgB,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAA;IACpE,gBAAgB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAA;IAC5D,gBAAgB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { GristRendererDepartmentObject } from './grist-editor/grist-renderer-department-object'\nimport { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'\nimport { GristEditorAssignees } from './grist-editor/grist-editor-assignees'\nimport { GristRendererAssignees } from './grist-editor/grist-renderer-assignees'\nimport { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'\nimport { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line'\n\nexport default function bootstrap() {\n /* register grist renderer/editor for id */\n registerEditor('department-object', GristEditorDepartmentObject)\n registerEditor('approval-line', GristEditorApprovalLine)\n registerEditor('assignees', GristEditorAssignees)\n\n registerRenderer('department-object', GristRendererDepartmentObject)\n registerRenderer('approval-line', GristRendererApprovalLine)\n registerRenderer('assignees', GristRendererAssignees)\n}\n"]}
@@ -41,7 +41,10 @@ let ApprovalLineItemsEditorPopup = class ApprovalLineItemsEditorPopup extends lo
41
41
  closePopup(this);
42
42
  }
43
43
  onConfirm() {
44
- this.confirmCallback && this.confirmCallback(this.changedValue);
44
+ const result = (this.changedValue || []).map(v => {
45
+ return v.approver ? { type: v.type, value: v.approver.id } : v;
46
+ });
47
+ this.confirmCallback && this.confirmCallback(result);
45
48
  closePopup(this);
46
49
  }
47
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"approval-line-items-editor-popup.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAGtE;;GAEG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,QAAQ,CAAC,O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,CAAC;;qEAA8D;AACzF;IAAC,KAAK,CAAC,4BAA4B,CAAC;8BAAU,uBAAuB;IAErE,wEAAwE;;4DAFH;AApB1D,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CA4DxC;SA5DY,4BAA4B","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { closePopup } from '@operato/popup'\n\nimport { ApprovalLineItemsEditor } from './approval-line-items-editor'\nimport { ApprovalLineItem } from '../types/approval-line'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('approval-line-items-editor-popup')\nexport class ApprovalLineItemsEditorPopup extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n approval-line-items-editor {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) value?: ApprovalLineItem[]\n\n @property({ type: Object }) confirmCallback?: (value?: ApprovalLineItem[] | null) => void\n @query('approval-line-items-editor') editor!: ApprovalLineItemsEditor\n\n /* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */\n private changedValue?: ApprovalLineItem[] = this.value\n\n render() {\n return html`\n <approval-line-items-editor\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n this.changedValue = [...e.detail]\n }}\n ></approval-line-items-editor>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onEmpty.bind(this)}>${i18next.t('button.empty')}</mwc-button>\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n firstUpdated() {\n this.changedValue = this.value\n }\n\n onEmpty() {\n this.confirmCallback && this.confirmCallback(null)\n closePopup(this)\n }\n\n onCancel() {\n closePopup(this)\n }\n\n onConfirm() {\n this.confirmCallback && this.confirmCallback(this.changedValue)\n\n closePopup(this)\n }\n}\n"]}
1
+ {"version":3,"file":"approval-line-items-editor-popup.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAGtE;;GAEG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAxE;;QAsBL,wEAAwE;QAChE,iBAAY,GAAwB,IAAI,CAAC,KAAK,CAAA;IAyCxD,CAAC;IAvCC,MAAM;QACJ,OAAO,IAAI,CAAA;;iBAEE,IAAI,CAAC,KAAK;kBACT,CAAC,CAAc,EAAE,EAAE;YAC3B,IAAI,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;QACnC,CAAC;;;;6BAIoB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;6BACpD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;6BACtD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAEhF,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAA;IAChC,CAAC;IAED,OAAO;QACL,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QAClD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,QAAQ;QACN,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,SAAS;QACP,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YAC/C,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QAChE,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;QAEpD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AA9DM,mCAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DAA2B;AAEtD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAA8D;AACzF;IAAC,KAAK,CAAC,4BAA4B,CAAC;8BAAU,uBAAuB;IAErE,wEAAwE;;4DAFH;AApB1D,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CAgExC;SAhEY,4BAA4B","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { closePopup } from '@operato/popup'\n\nimport { ApprovalLineItemsEditor } from './approval-line-items-editor'\nimport { ApprovalLineItem } from '../types/approval-line'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('approval-line-items-editor-popup')\nexport class ApprovalLineItemsEditorPopup extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n approval-line-items-editor {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) value?: ApprovalLineItem[]\n\n @property({ type: Object }) confirmCallback?: (value?: ApprovalLineItem[] | null) => void\n @query('approval-line-items-editor') editor!: ApprovalLineItemsEditor\n\n /* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */\n private changedValue?: ApprovalLineItem[] = this.value\n\n render() {\n return html`\n <approval-line-items-editor\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n this.changedValue = [...e.detail]\n }}\n ></approval-line-items-editor>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onEmpty.bind(this)}>${i18next.t('button.empty')}</mwc-button>\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n firstUpdated() {\n this.changedValue = this.value\n }\n\n onEmpty() {\n this.confirmCallback && this.confirmCallback(null)\n closePopup(this)\n }\n\n onCancel() {\n closePopup(this)\n }\n\n onConfirm() {\n const result = (this.changedValue || []).map(v => {\n return v.approver ? { type: v.type, value: v.approver.id } : v\n })\n\n this.confirmCallback && this.confirmCallback(result)\n\n closePopup(this)\n }\n}\n"]}
@@ -23,7 +23,7 @@ let ApprovalLineItemsEditor = class ApprovalLineItemsEditor extends localize(i18
23
23
  @record-change=${e => {
24
24
  var _a;
25
25
  this.value = (((_a = this.grist) === null || _a === void 0 ? void 0 : _a._data.records) || []).map(v => {
26
- return { type: v.type, value: v.value, approver: v.approver };
26
+ return v.approver ? { type: v.type, value: v.approver.id } : { type: v.type };
27
27
  });
28
28
  this.dispatchEvent(new CustomEvent('change', {
29
29
  bubbles: true,
@@ -106,7 +106,20 @@ let ApprovalLineItemsEditor = class ApprovalLineItemsEditor extends localize(i18
106
106
  case 'Department':
107
107
  options = {
108
108
  title: i18next.t('title.department list'),
109
- queryName: 'departments'
109
+ queryName: 'departments',
110
+ columns: [
111
+ { name: 'id', hidden: true },
112
+ {
113
+ name: 'controlNo',
114
+ header: { renderer: () => i18next.t('field.control-no') },
115
+ filter: 'search'
116
+ },
117
+ { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }
118
+ ],
119
+ list: { fields: ['name', 'control-no'] },
120
+ valueField: 'id',
121
+ nameField: 'name',
122
+ descriptionField: 'controlNo'
110
123
  };
111
124
  break;
112
125
  case 'Role':
@@ -116,7 +129,7 @@ let ApprovalLineItemsEditor = class ApprovalLineItemsEditor extends localize(i18
116
129
  };
117
130
  break;
118
131
  default:
119
- options = {};
132
+ return null;
120
133
  }
121
134
  var dynamicRecord = Object.assign(Object.assign({}, column.record), { options });
122
135
  return getEditor(column.type)(value, Object.assign(Object.assign({}, column), { record: dynamicRecord }), record, rowIndex, field);
@@ -1 +1 @@
1
- {"version":3,"file":"approval-line-items-editor.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,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AAK,CAAC,oBAAoB,CAAC;8BAAQ,gBAAgB;qDAAA;AAhCzC,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAwOnC;SAxOY,uBAAuB","sourcesContent":["import './approval-line-view'\nimport './approval-line-selector'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { DataGrist, getEditor, getRenderer } from '@operato/data-grist'\nimport { isMobileDevice } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\nimport { ApprovalLineView } from './approval-line-view'\nimport { ApprovalLine, ApprovalLineItem } from '../types/approval-line'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('approval-line-items-editor')\nexport class ApprovalLineItemsEditor extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n approval-line-view {\n min-height: 100px;\n }\n\n ox-grist {\n flex: 1;\n }\n\n #select {\n display: flex;\n justify-content: end;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) value?: ApprovalLineItem[]\n\n @state() gristConfig?: any\n\n @query('ox-grist') grist?: DataGrist\n @query('approval-line-view') view?: ApprovalLineView\n\n private popup?: PopupHandle\n\n render() {\n return html`\n <approval-line-view .model=${this.value}></approval-line-view>\n <ox-grist\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @record-change=${e => {\n this.value = ((this.grist as any)?._data.records || []).map(v => {\n return { type: v.type, value: v.value, approver: v.approver }\n })\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n <div slot=\"headroom\">\n <div id=\"select\">\n <mwc-button @click=${this.openSelector.bind(this)}>${i18next.t('button.copy from')}</mwc-button>\n <mwc-button raised danger @click=${() => this.deleteDataItems()}>${i18next.t('button.delete')}</mwc-button>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async firstUpdated() {\n this.gristConfig = {\n list: {\n fields: ['type', 'approver']\n },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n editable: true,\n options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']\n },\n width: 140\n },\n {\n type: 'resource-object',\n name: 'approver',\n header: i18next.t('field.approver'),\n record: {\n editable: true,\n editor: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search'\n },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }\n ],\n list: { fields: ['name', 'control-no'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n options = {\n title: i18next.t('title.department list'),\n queryName: 'departments'\n }\n break\n case 'Role':\n options = {\n title: i18next.t('title.lookup role'),\n queryName: 'roles'\n }\n break\n default:\n options = {}\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getEditor(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n case 'Role':\n default:\n break\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getRenderer(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n }\n },\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }) {\n const value = [...(this.value || [])]\n this.value = value\n\n return {\n total: value.length,\n records: value\n }\n }\n\n async deleteDataItems() {\n this.grist?.deleteSelectedRecords(false)\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = async (selected?: ApprovalLine) => {\n this.value = [...(selected?.model || [])]\n\n this.grist!.fetch()\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n\n this.popup = openPopup(\n html` <approval-line-selector .confirmCallback=${confirmCallback.bind(this)}></approval-line-selector> `,\n {\n backdrop: true,\n size: 'large',\n search: {\n placeholder: i18next.t('title.approval-line template list'),\n handler: (instance: any, value: any) => {\n /* instance: template instance */\n instance.searchText(value)\n }\n }\n }\n )\n }\n}\n"]}
1
+ {"version":3,"file":"approval-line-items-editor.js","sourceRoot":"","sources":["../../client/component/approval-line-items-editor.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC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AAO;YACb,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,mCAAmC,CAAC;gBAC3D,OAAO,EAAE,CAAC,QAAa,EAAE,KAAU,EAAE,EAAE;oBACrC,iCAAiC;oBACjC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;gBAC5B,CAAC;aACF;SACF,CACF,CAAA;IACH,CAAC;;AAnPM,8BAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAA2B;AAEtD;IAAC,KAAK,EAAE;;4DAAkB;AAE1B;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;sDAAA;AACpC;IAAC,KAAK,CAAC,oBAAoB,CAAC;8BAAQ,gBAAgB;qDAAA;AAhCzC,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAqPnC;SArPY,uBAAuB","sourcesContent":["import './approval-line-view'\nimport './approval-line-selector'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { DataGrist, getEditor, getRenderer } from '@operato/data-grist'\nimport { isMobileDevice } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\nimport { ApprovalLineView } from './approval-line-view'\nimport { ApprovalLine, ApprovalLineItem } from '../types/approval-line'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('approval-line-items-editor')\nexport class ApprovalLineItemsEditor extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n approval-line-view {\n min-height: 100px;\n }\n\n ox-grist {\n flex: 1;\n }\n\n #select {\n display: flex;\n justify-content: end;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) value?: ApprovalLineItem[]\n\n @state() gristConfig?: any\n\n @query('ox-grist') grist?: DataGrist\n @query('approval-line-view') view?: ApprovalLineView\n\n private popup?: PopupHandle\n\n render() {\n return html`\n <approval-line-view .model=${this.value}></approval-line-view>\n <ox-grist\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @record-change=${e => {\n this.value = ((this.grist as any)?._data.records || []).map(v => {\n return v.approver ? { type: v.type, value: v.approver.id } : { type: v.type }\n })\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n <div slot=\"headroom\">\n <div id=\"select\">\n <mwc-button @click=${this.openSelector.bind(this)}>${i18next.t('button.copy from')}</mwc-button>\n <mwc-button raised danger @click=${() => this.deleteDataItems()}>${i18next.t('button.delete')}</mwc-button>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async firstUpdated() {\n this.gristConfig = {\n list: {\n fields: ['type', 'approver']\n },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n editable: true,\n options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']\n },\n width: 140\n },\n {\n type: 'resource-object',\n name: 'approver',\n header: i18next.t('field.approver'),\n record: {\n editable: true,\n editor: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search'\n },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }\n ],\n list: { fields: ['name', 'control-no'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n options = {\n title: i18next.t('title.department list'),\n queryName: 'departments',\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search'\n },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }\n ],\n list: { fields: ['name', 'control-no'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Role':\n options = {\n title: i18next.t('title.lookup role'),\n queryName: 'roles'\n }\n break\n default:\n return null\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getEditor(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n case 'Role':\n default:\n break\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getRenderer(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n }\n },\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }) {\n const value = [...(this.value || [])]\n this.value = value\n\n return {\n total: value.length,\n records: value\n }\n }\n\n async deleteDataItems() {\n this.grist?.deleteSelectedRecords(false)\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = async (selected?: ApprovalLine) => {\n this.value = [...(selected?.model || [])]\n\n this.grist!.fetch()\n\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n\n this.popup = openPopup(\n html` <approval-line-selector .confirmCallback=${confirmCallback.bind(this)}></approval-line-selector> `,\n {\n backdrop: true,\n size: 'large',\n search: {\n placeholder: i18next.t('title.approval-line template list'),\n handler: (instance: any, value: any) => {\n /* instance: template instance */\n instance.searchText(value)\n }\n }\n }\n )\n }\n}\n"]}
@@ -7,12 +7,12 @@ import { i18next } from '@operato/i18n';
7
7
  import { openPopup } from '@operato/layout';
8
8
  let GristEditorApprovalLine = class GristEditorApprovalLine extends OxGristEditor {
9
9
  get editorTemplate() {
10
- var { name, description } = this.value || {};
11
- return html `
12
- ${!this.value
10
+ const value = this.value;
11
+ return !value || !(value instanceof Array) || value.length == 0
13
12
  ? html ``
14
- : html ` <span tabindex="0" style="flex:1">${name || ''}${(description && `(${description})`) || ''}</span> `}
15
- `;
13
+ : value.length == 1
14
+ ? html `<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
15
+ : html `<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`;
16
16
  }
17
17
  _onclick(e) {
18
18
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"file":"grist-editor-approval-line.js","sourceRoot":"","sources":["../../client/grist-editor/grist-editor-approval-line.ts"],"names":[],"mappings":";AAAA,OAAO,kDAAkD,CAAA;AAEzD,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,iBAAiB,CAAA;AAGjD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,aAAa;IAIxD,IAAI,cAAc;QAChB,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5C,OAAO,IAAI,CAAA;QACP,CAAC,IAAI,CA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EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC;SAC/C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAjEY,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAiEnC;SAjEY,uBAAuB","sourcesContent":["import '../component/approval-line-items-editor-popup.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('grist-editor-approval-line')\nexport class GristEditorApprovalLine extends OxGristEditor {\n private popup?: PopupHandle\n private template?: TemplateResult\n\n get editorTemplate() {\n var { name, description } = this.value || {}\n\n return html`\n ${!this.value\n ? html``\n : html` <span tabindex=\"0\" style=\"flex:1\">${name || ''}${(description && `(${description})`) || ''}</span> `}\n `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: selected || [],\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n var value = this.value || []\n\n var template =\n this.template ||\n html`\n <approval-line-items-editor-popup\n .value=${value}\n .confirmCallback=${confirmCallback.bind(this)}\n ></approval-line-items-editor-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.approval-line editor')\n })\n }\n}\n"]}
1
+ {"version":3,"file":"grist-editor-approval-line.js","sourceRoot":"","sources":["../../client/grist-editor/grist-editor-approval-line.ts"],"names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QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,QAAQ,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5B,IAAI,QAAQ,GACV,IAAI,CAAC,QAAQ;YACb,IAAI,CAAA;;mBAES,KAAK;6BACK,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;;OAEhD,CAAA;QAEH,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC;SAC/C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhEY,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAgEnC;SAhEY,uBAAuB","sourcesContent":["import '../component/approval-line-items-editor-popup.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('grist-editor-approval-line')\nexport class GristEditorApprovalLine extends OxGristEditor {\n private popup?: PopupHandle\n private template?: TemplateResult\n\n get editorTemplate() {\n const value = this.value\n return !value || !(value instanceof Array) || value.length == 0\n ? html``\n : value.length == 1\n ? html`<mwc-icon style=\"--mdc-icon-size:1.3em\">person</mwc-icon>`\n : html`<mwc-icon style=\"--mdc-icon-size:1.3em\">group</mwc-icon>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: selected || [],\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n var value = this.value || []\n\n var template =\n this.template ||\n html`\n <approval-line-items-editor-popup\n .value=${value}\n .confirmCallback=${confirmCallback.bind(this)}\n ></approval-line-items-editor-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.approval-line editor')\n })\n }\n}\n"]}
@@ -7,12 +7,12 @@ import { i18next } from '@operato/i18n';
7
7
  import { openPopup } from '@operato/layout';
8
8
  let GristEditorAssignees = class GristEditorAssignees extends OxGristEditor {
9
9
  get editorTemplate() {
10
- var { name, description } = this.value || {};
11
- return html `
12
- ${!this.value
10
+ const value = this.value;
11
+ return !value || !(value instanceof Array) || value.length == 0
13
12
  ? html ``
14
- : html ` <span tabindex="0" style="flex:1">${name || ''}${(description && `(${description})`) || ''}</span> `}
15
- `;
13
+ : value.length == 1
14
+ ? html `<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
15
+ : html `<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`;
16
16
  }
17
17
  _onclick(e) {
18
18
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"file":"grist-editor-assignees.js","sourceRoot":"","sources":["../../client/grist-editor/grist-editor-assignees.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,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;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5B,IAAI,QAAQ,GACV,IAAI,CAAC,QAAQ;YACb,IAAI,CAAA;yCAC+B,KAAK,qBAAqB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;OACtF,CAAA;QAEH,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;SAC3C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA9DY,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA8DhC;SA9DY,oBAAoB","sourcesContent":["import '../component/assignees-editor-popup.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('grist-editor-assignees')\nexport class GristEditorAssignees extends OxGristEditor {\n private popup?: PopupHandle\n private template?: TemplateResult\n\n get editorTemplate() {\n var { name, description } = this.value || {}\n\n return html`\n ${!this.value\n ? html``\n : html` <span tabindex=\"0\" style=\"flex:1\">${name || ''}${(description && `(${description})`) || ''}</span> `}\n `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: selected || [],\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n var value = this.value || []\n\n var template =\n this.template ||\n html`\n <assignees-editor-popup .value=${value} .confirmCallback=${confirmCallback.bind(this)}></assignees-editor-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.assignees editor')\n })\n }\n}\n"]}
1
+ {"version":3,"file":"grist-editor-assignees.js","sourceRoot":"","sources":["../../client/grist-editor/grist-editor-assignees.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,iBAAiB,CAAA;AAGjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,aAAa;IAIrD,IAAI,cAAc;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;YAC7D,CAAC,CAAC,IAAI,CAAA,EAAE;YACR,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;gBACnB,CAAC,CAAC,IAAI,CAAA,2DAA2D;gBACjE,CAAC,CAAC,IAAI,CAAA,0DAA0D,CAAA;IACpE,CAAC;IAED,QAAQ,CAAC,CAAQ;QACf,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IAED,UAAU,CAAC,CAAgB;QACzB,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAA;QACjB,IAAI,GAAG,IAAI,OAAO,EAAE;YAClB,CAAC,CAAC,eAAe,EAAE,CAAA;YACnB,IAAI,CAAC,YAAY,EAAE,CAAA;SACpB;IACH,CAAC;IAED,YAAY;QACV,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAED,MAAM,eAAe,GAAG,CAAC,QAAmC,EAAE,EAAE;YAC9D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,QAAQ,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5B,IAAI,QAAQ,GACV,IAAI,CAAC,QAAQ;YACb,IAAI,CAAA;yCAC+B,KAAK,qBAAqB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;OACtF,CAAA;QAEH,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;SAC3C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA7DY,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA6DhC;SA7DY,oBAAoB","sourcesContent":["import '../component/assignees-editor-popup.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('grist-editor-assignees')\nexport class GristEditorAssignees extends OxGristEditor {\n private popup?: PopupHandle\n private template?: TemplateResult\n\n get editorTemplate() {\n const value = this.value\n return !value || !(value instanceof Array) || value.length == 0\n ? html``\n : value.length == 1\n ? html`<mwc-icon style=\"--mdc-icon-size:1.3em\">person</mwc-icon>`\n : html`<mwc-icon style=\"--mdc-icon-size:1.3em\">group</mwc-icon>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: selected || [],\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n var value = this.value || []\n\n var template =\n this.template ||\n html`\n <assignees-editor-popup .value=${value} .confirmCallback=${confirmCallback.bind(this)}></assignees-editor-popup>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.assignees editor')\n })\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import '@material/mwc-icon';
2
+ import { FieldRenderer } from '@operato/data-grist';
3
+ export declare const GristRendererApprovalLine: FieldRenderer;
@@ -0,0 +1,10 @@
1
+ import '@material/mwc-icon';
2
+ import { html } from 'lit-html';
3
+ export const GristRendererApprovalLine = (value, column, record, rowIndex, field) => {
4
+ return !value || !(value instanceof Array) || value.length == 0
5
+ ? html ``
6
+ : value.length == 1
7
+ ? html `<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
8
+ : html `<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`;
9
+ };
10
+ //# sourceMappingURL=grist-renderer-approval-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grist-renderer-approval-line.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-approval-line.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAI/B,MAAM,CAAC,MAAM,yBAAyB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACjG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAC7D,CAAC,CAAC,IAAI,CAAA,EAAE;QACR,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;YACnB,CAAC,CAAC,IAAI,CAAA,2DAA2D;YACjE,CAAC,CAAC,IAAI,CAAA,0DAA0D,CAAA;AACpE,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\nimport { html } from 'lit-html'\n\nimport { FieldRenderer } from '@operato/data-grist'\n\nexport const GristRendererApprovalLine: FieldRenderer = (value, column, record, rowIndex, field) => {\n return !value || !(value instanceof Array) || value.length == 0\n ? html``\n : value.length == 1\n ? html`<mwc-icon style=\"--mdc-icon-size:1.3em\">person</mwc-icon>`\n : html`<mwc-icon style=\"--mdc-icon-size:1.3em\">group</mwc-icon>`\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import '@material/mwc-icon';
2
+ import { FieldRenderer } from '@operato/data-grist';
3
+ export declare const GristRendererAssignees: FieldRenderer;
@@ -0,0 +1,10 @@
1
+ import '@material/mwc-icon';
2
+ import { html } from 'lit-html';
3
+ export const GristRendererAssignees = (value, column, record, rowIndex, field) => {
4
+ return !value || !(value instanceof Array) || value.length == 0
5
+ ? html ``
6
+ : value.length == 1
7
+ ? html `<mwc-icon style="--mdc-icon-size:1.3em">person</mwc-icon>`
8
+ : html `<mwc-icon style="--mdc-icon-size:1.3em">group</mwc-icon>`;
9
+ };
10
+ //# sourceMappingURL=grist-renderer-assignees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grist-renderer-assignees.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-assignees.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAI/B,MAAM,CAAC,MAAM,sBAAsB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC9F,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAC7D,CAAC,CAAC,IAAI,CAAA,EAAE;QACR,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;YACnB,CAAC,CAAC,IAAI,CAAA,2DAA2D;YACjE,CAAC,CAAC,IAAI,CAAA,0DAA0D,CAAA;AACpE,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\nimport { html } from 'lit-html'\n\nimport { FieldRenderer } from '@operato/data-grist'\n\nexport const GristRendererAssignees: FieldRenderer = (value, column, record, rowIndex, field) => {\n return !value || !(value instanceof Array) || value.length == 0\n ? html``\n : value.length == 1\n ? html`<mwc-icon style=\"--mdc-icon-size:1.3em\">person</mwc-icon>`\n : html`<mwc-icon style=\"--mdc-icon-size:1.3em\">group</mwc-icon>`\n}\n"]}