@things-factory/organization 10.1.34 → 10.1.38
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.
- package/dist-client/component/approval-line-items-editor-popup.d.ts +1 -0
- package/dist-client/component/approval-line-items-editor-popup.js +6 -8
- package/dist-client/component/approval-line-items-editor-popup.js.map +1 -1
- package/dist-client/component/approval-line-items-editor.d.ts +3 -0
- package/dist-client/component/approval-line-items-editor.js +31 -3
- package/dist-client/component/approval-line-items-editor.js.map +1 -1
- package/dist-client/component/approval-line-selector.d.ts +1 -0
- package/dist-client/component/approval-line-selector.js +6 -8
- package/dist-client/component/approval-line-selector.js.map +1 -1
- package/dist-client/component/assignees-editor-popup.d.ts +1 -0
- package/dist-client/component/assignees-editor-popup.js +6 -8
- package/dist-client/component/assignees-editor-popup.js.map +1 -1
- package/dist-client/component/copy-from.d.ts +13 -0
- package/dist-client/component/copy-from.js +16 -0
- package/dist-client/component/copy-from.js.map +1 -0
- package/dist-client/component/department-selector.d.ts +1 -0
- package/dist-client/component/department-selector.js +6 -8
- package/dist-client/component/department-selector.js.map +1 -1
- package/dist-client/component/popup-actions-row.test.d.ts +1 -0
- package/dist-client/component/popup-actions-row.test.js +42 -0
- package/dist-client/component/popup-actions-row.test.js.map +1 -0
- package/dist-client/component/recipients-editor-popup.d.ts +1 -0
- package/dist-client/component/recipients-editor-popup.js +6 -8
- package/dist-client/component/recipients-editor-popup.js.map +1 -1
- package/dist-client/grist-editor/grist-renderer-approval-line.d.ts +10 -0
- package/dist-client/grist-editor/grist-renderer-approval-line.js +27 -5
- package/dist-client/grist-editor/grist-renderer-approval-line.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/types/approval-line.d.ts +23 -0
- package/dist-client/types/approval-line.js +9 -0
- package/dist-client/types/approval-line.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/tests/approval-line-mark.test.ts +68 -0
- package/tests/copy-from.test.ts +17 -0
- package/translations/en.json +3 -1
- package/translations/ja.json +5 -3
- package/translations/ko.json +5 -3
- package/translations/ms.json +3 -1
- package/translations/zh.json +5 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* The five organization popups end in the shared popup action row (ADR-0056 decision 3).
|
|
5
|
+
*
|
|
6
|
+
* Each drew a `<div class="buttons">` of its own with a `.buttons .left` rule to push "empty" left.
|
|
7
|
+
* `<ox-popup-actions>` owns order, height, shape and colour now, so a row written by hand cannot
|
|
8
|
+
* drift from the others again.
|
|
9
|
+
*
|
|
10
|
+
* What this test holds is the mapping. "Empty" clears the field and closes - it is a side action,
|
|
11
|
+
* so it goes to the start slot. It is **not** marked destructive: the person can open the picker
|
|
12
|
+
* and choose again, and a red button on every ordinary case teaches people to stop reading red.
|
|
13
|
+
* Destructive is for what cannot be undone.
|
|
14
|
+
*/
|
|
15
|
+
const POPUPS = [
|
|
16
|
+
'approval-line-items-editor-popup.ts',
|
|
17
|
+
'approval-line-selector.ts',
|
|
18
|
+
'assignees-editor-popup.ts',
|
|
19
|
+
'department-selector.ts',
|
|
20
|
+
'recipients-editor-popup.ts'
|
|
21
|
+
];
|
|
22
|
+
const read = (name) => readFileSync(path.join(__dirname, name), 'utf-8');
|
|
23
|
+
describe.each(POPUPS)('%s', name => {
|
|
24
|
+
const source = read(name);
|
|
25
|
+
it('loads the shared row and uses it', () => {
|
|
26
|
+
expect(source.includes("import '@operato/popup/ox-popup-actions.js'")).toBe(true);
|
|
27
|
+
expect(/<ox-popup-actions>/.test(source)).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
it('no longer draws a row of its own', () => {
|
|
30
|
+
expect(/class="buttons"/.test(source)).toBe(false);
|
|
31
|
+
expect(/\.buttons \.left/.test(source)).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('puts "empty" at the start and does not call it destructive', () => {
|
|
34
|
+
expect(/<md-text-button slot="start" @click=\$\{this\.onEmpty/.test(source)).toBe(true);
|
|
35
|
+
expect(/slot="start" destructive/.test(source)).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
it('has exactly one way out and one main action', () => {
|
|
38
|
+
expect((source.match(/slot="cancel"/g) || []).length).toBe(1);
|
|
39
|
+
expect((source.match(/slot="confirm"/g) || []).length).toBe(1);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=popup-actions-row.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup-actions-row.test.js","sourceRoot":"","sources":["../../client/component/popup-actions-row.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,GAAG;IACb,qCAAqC;IACrC,2BAA2B;IAC3B,2BAA2B;IAC3B,wBAAwB;IACxB,4BAA4B;CAC7B,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;AAEhF,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IAEzB,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,6CAA6C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjF,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAClD,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACrD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,uDAAuD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvF,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC7D,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { readFileSync } from 'fs'\nimport path from 'path'\n\n/**\n * The five organization popups end in the shared popup action row (ADR-0056 decision 3).\n *\n * Each drew a `<div class=\"buttons\">` of its own with a `.buttons .left` rule to push \"empty\" left.\n * `<ox-popup-actions>` owns order, height, shape and colour now, so a row written by hand cannot\n * drift from the others again.\n *\n * What this test holds is the mapping. \"Empty\" clears the field and closes - it is a side action,\n * so it goes to the start slot. It is **not** marked destructive: the person can open the picker\n * and choose again, and a red button on every ordinary case teaches people to stop reading red.\n * Destructive is for what cannot be undone.\n */\n\nconst POPUPS = [\n 'approval-line-items-editor-popup.ts',\n 'approval-line-selector.ts',\n 'assignees-editor-popup.ts',\n 'department-selector.ts',\n 'recipients-editor-popup.ts'\n]\n\nconst read = (name: string) => readFileSync(path.join(__dirname, name), 'utf-8')\n\ndescribe.each(POPUPS)('%s', name => {\n const source = read(name)\n\n it('loads the shared row and uses it', () => {\n expect(source.includes(\"import '@operato/popup/ox-popup-actions.js'\")).toBe(true)\n expect(/<ox-popup-actions>/.test(source)).toBe(true)\n })\n\n it('no longer draws a row of its own', () => {\n expect(/class=\"buttons\"/.test(source)).toBe(false)\n expect(/\\.buttons \\.left/.test(source)).toBe(false)\n })\n\n it('puts \"empty\" at the start and does not call it destructive', () => {\n expect(/<md-text-button slot=\"start\" @click=\\$\\{this\\.onEmpty/.test(source)).toBe(true)\n expect(/slot=\"start\" destructive/.test(source)).toBe(false)\n })\n\n it('has exactly one way out and one main action', () => {\n expect((source.match(/slot=\"cancel\"/g) || []).length).toBe(1)\n expect((source.match(/slot=\"confirm\"/g) || []).length).toBe(1)\n })\n})\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@operato/popup/ox-popup-actions.js';
|
|
2
3
|
import '@material/web/icon/icon.js';
|
|
3
4
|
import '@material/web/button/text-button.js';
|
|
4
5
|
import '@material/web/button/filled-button.js';
|
|
@@ -35,9 +36,6 @@ let RecipientsEditorPopup = class RecipientsEditorPopup extends localize(i18next
|
|
|
35
36
|
*
|
|
36
37
|
* 「비우기」는 왼쪽에 둔다 — 되돌리는 것이라 저지르는 것들과 같은 자리에 두지 않는다.
|
|
37
38
|
*/
|
|
38
|
-
.buttons .left {
|
|
39
|
-
margin-right: auto;
|
|
40
|
-
}
|
|
41
39
|
:host {
|
|
42
40
|
display: flex;
|
|
43
41
|
flex-direction: column;
|
|
@@ -59,13 +57,13 @@ let RecipientsEditorPopup = class RecipientsEditorPopup extends localize(i18next
|
|
|
59
57
|
}}
|
|
60
58
|
></recipients-editor>
|
|
61
59
|
|
|
62
|
-
<
|
|
63
|
-
<md-text-button
|
|
60
|
+
<ox-popup-actions>
|
|
61
|
+
<md-text-button slot="start" @click=${this.onEmpty.bind(this)}>
|
|
64
62
|
${i18next.t('button.empty', { defaultValue: 'empty' })}
|
|
65
63
|
</md-text-button>
|
|
66
|
-
<md-text-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</md-text-button>
|
|
67
|
-
<md-filled-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm', { defaultValue: 'confirm' })}</md-filled-button>
|
|
68
|
-
</
|
|
64
|
+
<md-text-button slot="cancel" @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</md-text-button>
|
|
65
|
+
<md-filled-button slot="confirm" @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm', { defaultValue: 'confirm' })}</md-filled-button>
|
|
66
|
+
</ox-popup-actions>
|
|
69
67
|
`;
|
|
70
68
|
}
|
|
71
69
|
firstUpdated() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipients-editor-popup.js","sourceRoot":"","sources":["../../client/component/recipients-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,uCAAuC,CAAA;AAC9C,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,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGtD;;GAEG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAjE;;
|
|
1
|
+
{"version":3,"file":"recipients-editor-popup.js","sourceRoot":"","sources":["../../client/component/recipients-editor-popup.ts"],"names":[],"mappings":";AAAA,OAAO,oCAAoC,CAAA;AAC3C,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,uCAAuC,CAAA;AAC9C,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,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGtD;;GAEG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAjE;;QAqCL,wEAAwE;QAChE,iBAAY,GAAoB,IAAI,CAAC,KAAK,CAAA;IAuCpD,CAAC;aA5EQ,WAAM,GAAG;QACd,kBAAkB;QAClB,iBAAiB;QACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;KACF,AA7BY,CA6BZ;IAUD,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;;;;8CAIqC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACzD,OAAO,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;;+CAEjB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;kDACnD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;;KAElI,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,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AA5C0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;oDAAuB;AAErB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAA0D;AACzD;IAA3B,KAAK,CAAC,mBAAmB,CAAC;8BAAU,gBAAgB;IAErD,wEAAwE;;qDAFnB;AAnC1C,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CA6EjC","sourcesContent":["import '@operato/popup/ox-popup-actions.js'\nimport '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/button/filled-button.js'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonHeaderStyles, CommonPopupStyles } from '@operato/styles'\nimport { closePopup } from '@operato/popup'\n\nimport { RecipientsEditor } from './recipients-editor'\nimport { AssigneeItem } from '../types/org-member'\n\n/**\n * 결재선의 각 결재자 리스트를 편집한다.\n */\n@customElement('recipients-editor-popup')\nexport class RecipientsEditorPopup extends localize(i18next)(LitElement) {\n static styles = [\n CommonHeaderStyles,\n CommonPopupStyles,\n css`\n /*\n * 단추 줄은 **제품의 팝업 규약**을 쓴다(CommonPopupStyles 의 .buttons).\n *\n * 전에는 손으로 만든 .footer 였고 organization 의 팝업 다섯이 그것을 복사해 갖고 있었다.\n * 규약이 주는 것을 다 놓쳤다 — 팝업 안 단추의 알약 모서리(담는 카드가 둥그니 그 안도\n * 둥글다), 마우스와 손가락을 가르는 갈래(손가락에서는 카드 아래 폭을 채우는 액션바가 된다),\n * 단추 높이 통일.\n *\n * 단추는 Material 것으로 쓴다. 규약의 마우스 갈래는 **md-*-button 의 토큰으로만** 모양을\n * 말한다 — 평범한 button 을 두면 모서리가 0 으로 남는다(실측: 알약이어야 할 자리에 0px).\n * 제품의 다른 팝업도 같은 관용구다(operato-plant 의 maintenance-dialog).\n *\n * 「비우기」는 왼쪽에 둔다 — 되돌리는 것이라 저지르는 것들과 같은 자리에 두지 않는다.\n */\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n recipients-editor {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) value?: AssigneeItem[]\n\n @property({ type: Object }) confirmCallback?: (value?: AssigneeItem[] | null) => void\n @query('recipients-editor') editor!: RecipientsEditor\n\n /* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */\n private changedValue?: AssigneeItem[] = this.value\n\n render() {\n return html`\n <recipients-editor\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n this.changedValue = [...e.detail]\n }}\n ></recipients-editor>\n\n <ox-popup-actions>\n <md-text-button slot=\"start\" @click=${this.onEmpty.bind(this)}>\n ${i18next.t('button.empty', { defaultValue: 'empty' })}\n </md-text-button>\n <md-text-button slot=\"cancel\" @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm', { defaultValue: 'confirm' })}</md-filled-button>\n </ox-popup-actions>\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,3 +1,13 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { FieldRenderer } from '@operato/data-grist';
|
|
3
|
+
/**
|
|
4
|
+
* 결재선 칸 — **결재 단계를 센다. 줄의 길이가 아니다.**
|
|
5
|
+
*
|
|
6
|
+
* 전에는 `value.length` 로 갈랐다. 그러면 참조만 있는 줄이 사람 아이콘을 얻고, 목록을 읽는 사람은
|
|
7
|
+
* 결재자가 있는 것으로 본다. 참조는 의견을 낼 뿐 판정하지 않으므로 그 업무는 올라가기만 하고
|
|
8
|
+
* 아무도 못 내린다. 무엇을 그릴지는 `approvalLineMark` 한 자리가 답한다.
|
|
9
|
+
*
|
|
10
|
+
* 「참조만」은 빈 칸으로 두지 않는다 — 고칠 사람이 할 일이 다르다. 줄이 없으면 만들어야 하고,
|
|
11
|
+
* 참조만 있으면 그 줄에 결재자를 더해야 한다.
|
|
12
|
+
*/
|
|
3
13
|
export declare const GristRendererApprovalLine: FieldRenderer;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { html } from 'lit-html';
|
|
3
|
+
import { i18next } from '@operato/i18n';
|
|
4
|
+
import { approvalLineMark } from '../types/approval-line.js';
|
|
5
|
+
/**
|
|
6
|
+
* 결재선 칸 — **결재 단계를 센다. 줄의 길이가 아니다.**
|
|
7
|
+
*
|
|
8
|
+
* 전에는 `value.length` 로 갈랐다. 그러면 참조만 있는 줄이 사람 아이콘을 얻고, 목록을 읽는 사람은
|
|
9
|
+
* 결재자가 있는 것으로 본다. 참조는 의견을 낼 뿐 판정하지 않으므로 그 업무는 올라가기만 하고
|
|
10
|
+
* 아무도 못 내린다. 무엇을 그릴지는 `approvalLineMark` 한 자리가 답한다.
|
|
11
|
+
*
|
|
12
|
+
* 「참조만」은 빈 칸으로 두지 않는다 — 고칠 사람이 할 일이 다르다. 줄이 없으면 만들어야 하고,
|
|
13
|
+
* 참조만 있으면 그 줄에 결재자를 더해야 한다.
|
|
14
|
+
*/
|
|
3
15
|
export const GristRendererApprovalLine = (value, column, record, rowIndex, field) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
const icon = (name, key, muted = false) => html `<md-icon
|
|
17
|
+
style=${`--md-icon-size:1.3em${muted ? ';opacity:.55' : ''}`}
|
|
18
|
+
title=${i18next.t(key)}
|
|
19
|
+
>${name}</md-icon
|
|
20
|
+
>`;
|
|
21
|
+
switch (approvalLineMark(value)) {
|
|
22
|
+
case 'none':
|
|
23
|
+
return html ``;
|
|
24
|
+
case 'reference-only':
|
|
25
|
+
return icon('visibility', 'text.approval-line has references only', true);
|
|
26
|
+
case 'one':
|
|
27
|
+
return icon('person', 'text.approval-line has one approver');
|
|
28
|
+
default:
|
|
29
|
+
return icon('group', 'text.approval-line has several approvers');
|
|
30
|
+
}
|
|
9
31
|
};
|
|
10
32
|
//# sourceMappingURL=grist-renderer-approval-line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grist-renderer-approval-line.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-approval-line.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"grist-renderer-approval-line.js","sourceRoot":"","sources":["../../client/grist-editor/grist-renderer-approval-line.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACjG,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;YACrD,uBAAuB,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;YACpD,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;OACnB,IAAI;IACP,CAAA;IAEF,QAAQ,gBAAgB,CAAC,KAAY,CAAC,EAAE,CAAC;QACvC,KAAK,MAAM;YACT,OAAO,IAAI,CAAA,EAAE,CAAA;QACf,KAAK,gBAAgB;YACnB,OAAO,IAAI,CAAC,YAAY,EAAE,wCAAwC,EAAE,IAAI,CAAC,CAAA;QAC3E,KAAK,KAAK;YACR,OAAO,IAAI,CAAC,QAAQ,EAAE,qCAAqC,CAAC,CAAA;QAC9D;YACE,OAAO,IAAI,CAAC,OAAO,EAAE,0CAA0C,CAAC,CAAA;IACpE,CAAC;AACH,CAAC,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { html } from 'lit-html'\n\nimport { FieldRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\n\nimport { approvalLineMark } from '../types/approval-line.js'\n\n/**\n * 결재선 칸 — **결재 단계를 센다. 줄의 길이가 아니다.**\n *\n * 전에는 `value.length` 로 갈랐다. 그러면 참조만 있는 줄이 사람 아이콘을 얻고, 목록을 읽는 사람은\n * 결재자가 있는 것으로 본다. 참조는 의견을 낼 뿐 판정하지 않으므로 그 업무는 올라가기만 하고\n * 아무도 못 내린다. 무엇을 그릴지는 `approvalLineMark` 한 자리가 답한다.\n *\n * 「참조만」은 빈 칸으로 두지 않는다 — 고칠 사람이 할 일이 다르다. 줄이 없으면 만들어야 하고,\n * 참조만 있으면 그 줄에 결재자를 더해야 한다.\n */\nexport const GristRendererApprovalLine: FieldRenderer = (value, column, record, rowIndex, field) => {\n const icon = (name: string, key: string, muted = false) => html`<md-icon\n style=${`--md-icon-size:1.3em${muted ? ';opacity:.55' : ''}`}\n title=${i18next.t(key)}\n >${name}</md-icon\n >`\n\n switch (approvalLineMark(value as any)) {\n case 'none':\n return html``\n case 'reference-only':\n return icon('visibility', 'text.approval-line has references only', true)\n case 'one':\n return icon('person', 'text.approval-line has one approver')\n default:\n return icon('group', 'text.approval-line has several approvers')\n }\n}\n"]}
|
package/dist-client/route.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function route(page: string): "approval-line-
|
|
1
|
+
export default function route(page: string): "my-approval-line-templates-page" | "common-approval-line-templates-page" | "approval-line-list" | "employee-list" | "department-list" | undefined;
|