@things-factory/organization 6.0.34 → 6.0.39

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.
@@ -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
  }
@@ -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"]}
@@ -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":";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,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;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":[],"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,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,EA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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,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,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAE5C,OAAO,IAAI,CAAA;QACP,CAAC,IAAI,CAAC,KAAK;YACX,CAAC,CAAC,IAAI,CAAA,EAAE;YACR,CAAC,CAAC,IAAI,CAAA,sCAAsC,IAAI,IAAI,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU;KAC/G,CAAA;IACH,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;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,KA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,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"]}