@things-factory/organization 6.1.17 → 6.1.22
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/client/bootstrap.ts +4 -0
- package/client/component/index.ts +4 -0
- package/client/component/recipients-editor-popup.ts +75 -0
- package/client/component/recipients-editor.ts +214 -0
- package/client/component/recipients-view.ts +55 -0
- package/client/grist-editor/grist-editor-recipients.ts +75 -0
- package/client/grist-editor/grist-renderer-recipients.ts +12 -0
- package/client/tsconfig.json +2 -0
- package/client/types/org-member.ts +6 -0
- package/dist-client/bootstrap.js +4 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/index.d.ts +3 -0
- package/dist-client/component/index.js +3 -0
- package/dist-client/component/index.js.map +1 -1
- package/dist-client/component/recipients-editor-popup.d.ts +20 -0
- package/dist-client/component/recipients-editor-popup.js +81 -0
- package/dist-client/component/recipients-editor-popup.js.map +1 -0
- package/dist-client/component/recipients-editor.d.ts +27 -0
- package/dist-client/component/recipients-editor.js +210 -0
- package/dist-client/component/recipients-editor.js.map +1 -0
- package/dist-client/component/recipients-view.d.ts +10 -0
- package/dist-client/component/recipients-view.js +55 -0
- package/dist-client/component/recipients-view.js.map +1 -0
- package/dist-client/grist-editor/grist-editor-recipients.d.ts +11 -0
- package/dist-client/grist-editor/grist-editor-recipients.js +64 -0
- package/dist-client/grist-editor/grist-editor-recipients.js.map +1 -0
- package/dist-client/grist-editor/grist-renderer-recipients.d.ts +3 -0
- package/dist-client/grist-editor/grist-renderer-recipients.js +10 -0
- package/dist-client/grist-editor/grist-renderer-recipients.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/types/org-member.d.ts +5 -0
- package/dist-client/types/org-member.js +2 -0
- package/dist-client/types/org-member.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/client/bootstrap.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { GristRendererDepartmentObject } from './grist-editor/grist-renderer-dep
|
|
|
4
4
|
import { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object'
|
|
5
5
|
import { GristEditorAssignees } from './grist-editor/grist-editor-assignees'
|
|
6
6
|
import { GristRendererAssignees } from './grist-editor/grist-renderer-assignees'
|
|
7
|
+
import { GristEditorRecipients } from './grist-editor/grist-editor-recipients'
|
|
8
|
+
import { GristRendererRecipients } from './grist-editor/grist-renderer-recipients'
|
|
7
9
|
import { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line'
|
|
8
10
|
import { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line'
|
|
9
11
|
|
|
@@ -12,8 +14,10 @@ export default function bootstrap() {
|
|
|
12
14
|
registerEditor('department-object', GristEditorDepartmentObject)
|
|
13
15
|
registerEditor('approval-line', GristEditorApprovalLine)
|
|
14
16
|
registerEditor('assignees', GristEditorAssignees)
|
|
17
|
+
registerEditor('recipients', GristEditorRecipients)
|
|
15
18
|
|
|
16
19
|
registerRenderer('department-object', GristRendererDepartmentObject)
|
|
17
20
|
registerRenderer('approval-line', GristRendererApprovalLine)
|
|
18
21
|
registerRenderer('assignees', GristRendererAssignees)
|
|
22
|
+
registerRenderer('recipients', GristRendererRecipients)
|
|
19
23
|
}
|
|
@@ -10,3 +10,7 @@ export * from './approval-line-items-editor-popup'
|
|
|
10
10
|
export * from './assignees-view'
|
|
11
11
|
export * from './assignees-editor'
|
|
12
12
|
export * from './assignees-editor-popup'
|
|
13
|
+
|
|
14
|
+
export * from './recipients-view'
|
|
15
|
+
export * from './recipients-editor'
|
|
16
|
+
export * from './recipients-editor-popup'
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit'
|
|
2
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
3
|
+
|
|
4
|
+
import { i18next, localize } from '@operato/i18n'
|
|
5
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
6
|
+
import { closePopup } from '@operato/popup'
|
|
7
|
+
|
|
8
|
+
import { RecipientsEditor } from './recipients-editor'
|
|
9
|
+
import { AssigneeItem } from '../types/org-member'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 결재선의 각 결재자 리스트를 편집한다.
|
|
13
|
+
*/
|
|
14
|
+
@customElement('recipients-editor-popup')
|
|
15
|
+
export class RecipientsEditorPopup extends localize(i18next)(LitElement) {
|
|
16
|
+
static styles = [
|
|
17
|
+
ButtonContainerStyles,
|
|
18
|
+
css`
|
|
19
|
+
:host {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
recipients-editor {
|
|
27
|
+
flex: 1;
|
|
28
|
+
}
|
|
29
|
+
`
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
@property({ type: Object }) value?: AssigneeItem[]
|
|
33
|
+
|
|
34
|
+
@property({ type: Object }) confirmCallback?: (value?: AssigneeItem[] | null) => void
|
|
35
|
+
@query('recipients-editor') editor!: RecipientsEditor
|
|
36
|
+
|
|
37
|
+
/* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */
|
|
38
|
+
private changedValue?: AssigneeItem[] = this.value
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
return html`
|
|
42
|
+
<recipients-editor
|
|
43
|
+
.value=${this.value}
|
|
44
|
+
@change=${(e: CustomEvent) => {
|
|
45
|
+
this.changedValue = [...e.detail]
|
|
46
|
+
}}
|
|
47
|
+
></recipients-editor>
|
|
48
|
+
|
|
49
|
+
<div class="button-container">
|
|
50
|
+
<mwc-button @click=${this.onEmpty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
|
|
51
|
+
<mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
|
|
52
|
+
<mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
|
|
53
|
+
</div>
|
|
54
|
+
`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
firstUpdated() {
|
|
58
|
+
this.changedValue = this.value
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
onEmpty() {
|
|
62
|
+
this.confirmCallback && this.confirmCallback(null)
|
|
63
|
+
closePopup(this)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
onCancel() {
|
|
67
|
+
closePopup(this)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onConfirm() {
|
|
71
|
+
this.confirmCallback && this.confirmCallback(this.changedValue)
|
|
72
|
+
|
|
73
|
+
closePopup(this)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import './recipients-view'
|
|
2
|
+
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
5
|
+
|
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
|
7
|
+
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist'
|
|
8
|
+
import { isMobileDevice } from '@operato/utils'
|
|
9
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
10
|
+
|
|
11
|
+
import { AssigneeItem } from '../types/org-member'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Assignee 리스트를 편집한다.
|
|
15
|
+
*/
|
|
16
|
+
@customElement('recipients-editor')
|
|
17
|
+
export class RecipientsEditor extends localize(i18next)(LitElement) {
|
|
18
|
+
static styles = [
|
|
19
|
+
ButtonContainerStyles,
|
|
20
|
+
css`
|
|
21
|
+
:host {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
recipients-view {
|
|
29
|
+
min-height: 100px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ox-grist {
|
|
33
|
+
flex: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#select {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: end;
|
|
39
|
+
padding: 10px;
|
|
40
|
+
}
|
|
41
|
+
`
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
@property({ type: Object }) value?: AssigneeItem[]
|
|
45
|
+
|
|
46
|
+
@state() gristConfig?: any
|
|
47
|
+
|
|
48
|
+
@query('ox-grist') grist?: DataGrist
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
return html`
|
|
52
|
+
<recipients-view .value=${this.value}></recipients-view>
|
|
53
|
+
|
|
54
|
+
<ox-grist
|
|
55
|
+
.mode=${isMobileDevice() ? 'CARD' : 'GRID'}
|
|
56
|
+
.config=${this.gristConfig}
|
|
57
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
58
|
+
@record-change=${e => {
|
|
59
|
+
this.value = ((this.grist as any)?._data.records || [])
|
|
60
|
+
.map(v => {
|
|
61
|
+
return { type: v.type, assignee: v.assignee }
|
|
62
|
+
})
|
|
63
|
+
.filter(v => v.type)
|
|
64
|
+
|
|
65
|
+
this.dispatchEvent(
|
|
66
|
+
new CustomEvent('change', {
|
|
67
|
+
bubbles: true,
|
|
68
|
+
composed: true,
|
|
69
|
+
detail: this.value
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<div slot="headroom">
|
|
75
|
+
<div id="select">
|
|
76
|
+
<mwc-button raised danger @click=${() => this.deleteDataItems()}>${i18next.t('button.delete')}</mwc-button>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</ox-grist>
|
|
80
|
+
`
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async firstUpdated() {
|
|
84
|
+
this.gristConfig = {
|
|
85
|
+
list: {
|
|
86
|
+
fields: ['type', 'assignee']
|
|
87
|
+
},
|
|
88
|
+
columns: [
|
|
89
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
90
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
91
|
+
{
|
|
92
|
+
type: 'gutter',
|
|
93
|
+
gutterName: 'button',
|
|
94
|
+
icon: 'arrow_upward',
|
|
95
|
+
handlers: {
|
|
96
|
+
click: 'move-up'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'gutter',
|
|
101
|
+
gutterName: 'button',
|
|
102
|
+
icon: 'arrow_downward',
|
|
103
|
+
handlers: {
|
|
104
|
+
click: 'move-down'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'select',
|
|
109
|
+
name: 'type',
|
|
110
|
+
header: i18next.t('field.type'),
|
|
111
|
+
record: {
|
|
112
|
+
editable: true,
|
|
113
|
+
options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']
|
|
114
|
+
},
|
|
115
|
+
width: 140
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'resource-object',
|
|
119
|
+
name: 'assignee',
|
|
120
|
+
header: i18next.t('field.assignee'),
|
|
121
|
+
record: {
|
|
122
|
+
editable: true,
|
|
123
|
+
editor: function (value, column, record, rowIndex, field) {
|
|
124
|
+
var options = {}
|
|
125
|
+
switch (record.type) {
|
|
126
|
+
case 'Employee':
|
|
127
|
+
options = {
|
|
128
|
+
title: i18next.t('title.employee list'),
|
|
129
|
+
queryName: 'employees',
|
|
130
|
+
columns: [
|
|
131
|
+
{ name: 'id', hidden: true },
|
|
132
|
+
{
|
|
133
|
+
name: 'controlNo',
|
|
134
|
+
header: { renderer: () => i18next.t('field.control-no') },
|
|
135
|
+
filter: 'search'
|
|
136
|
+
},
|
|
137
|
+
{ name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }
|
|
138
|
+
],
|
|
139
|
+
list: { fields: ['name', 'control-no'] },
|
|
140
|
+
valueField: 'id',
|
|
141
|
+
nameField: 'name',
|
|
142
|
+
descriptionField: 'controlNo'
|
|
143
|
+
}
|
|
144
|
+
break
|
|
145
|
+
case 'Department':
|
|
146
|
+
options = {
|
|
147
|
+
title: i18next.t('title.department list'),
|
|
148
|
+
queryName: 'departments'
|
|
149
|
+
}
|
|
150
|
+
break
|
|
151
|
+
case 'Role':
|
|
152
|
+
options = {
|
|
153
|
+
title: i18next.t('title.lookup role'),
|
|
154
|
+
queryName: 'roles'
|
|
155
|
+
}
|
|
156
|
+
break
|
|
157
|
+
default:
|
|
158
|
+
options = {}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var dynamicRecord = { ...column.record, options }
|
|
162
|
+
|
|
163
|
+
return getEditor(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)
|
|
164
|
+
},
|
|
165
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
166
|
+
var options = {}
|
|
167
|
+
switch (record.type) {
|
|
168
|
+
case 'Employee':
|
|
169
|
+
options = {
|
|
170
|
+
valueField: 'id',
|
|
171
|
+
nameField: 'name',
|
|
172
|
+
descriptionField: 'controlNo'
|
|
173
|
+
}
|
|
174
|
+
break
|
|
175
|
+
case 'Department':
|
|
176
|
+
case 'Role':
|
|
177
|
+
default:
|
|
178
|
+
break
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
var dynamicRecord = { ...column.record, options }
|
|
182
|
+
|
|
183
|
+
return getRenderer(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
width: 180
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
rows: {
|
|
190
|
+
selectable: {
|
|
191
|
+
multiple: true
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
pagination: {
|
|
195
|
+
infinite: true
|
|
196
|
+
},
|
|
197
|
+
sorters: []
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
async fetchHandler({ filters, page, limit, sortings = [] }) {
|
|
202
|
+
const value = [...(this.value || [])]
|
|
203
|
+
this.value = value
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
total: value.length,
|
|
207
|
+
records: value
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async deleteDataItems() {
|
|
212
|
+
this.grist?.deleteSelectedRecords(false)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from 'lit'
|
|
2
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
3
|
+
|
|
4
|
+
import { i18next, localize } from '@operato/i18n'
|
|
5
|
+
import { AssigneeItem } from '../types/org-member'
|
|
6
|
+
|
|
7
|
+
@customElement('recipients-view')
|
|
8
|
+
export class RecipientsView extends localize(i18next)(LitElement) {
|
|
9
|
+
static styles = [
|
|
10
|
+
css`
|
|
11
|
+
:host {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
|
|
16
|
+
gap: 10px;
|
|
17
|
+
padding: 10px;
|
|
18
|
+
|
|
19
|
+
align-items: center;
|
|
20
|
+
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
|
|
23
|
+
--mdc-icon-size: 3em;
|
|
24
|
+
color: var(--secondary-color, black);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
div[assignee] {
|
|
28
|
+
padding: 5px;
|
|
29
|
+
border-radius: 5px;
|
|
30
|
+
border: 2px solid var(--primary-color, black);
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
@property({ type: Object }) value?: AssigneeItem[]
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
const items = this.value || []
|
|
39
|
+
|
|
40
|
+
return html` ${items.map((item, order) => this.renderItem(item, order + 1))} `
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
renderItem(item: AssigneeItem, order: number): TemplateResult {
|
|
44
|
+
const { type, assignee } = item
|
|
45
|
+
const { name, description, controlNo } = assignee || {}
|
|
46
|
+
const subname = (description || controlNo) && `(${description || controlNo})`
|
|
47
|
+
|
|
48
|
+
return html`
|
|
49
|
+
<div assignee>
|
|
50
|
+
<div>${type}</div>
|
|
51
|
+
<div><span name>${name}</span>${subname}</div>
|
|
52
|
+
</div>
|
|
53
|
+
`
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import '../component/recipients-editor-popup.js'
|
|
2
|
+
|
|
3
|
+
import { html, TemplateResult } from 'lit'
|
|
4
|
+
import { customElement } from 'lit/decorators.js'
|
|
5
|
+
|
|
6
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
7
|
+
import { i18next } from '@operato/i18n'
|
|
8
|
+
import { openPopup, PopupHandle } from '@operato/layout'
|
|
9
|
+
|
|
10
|
+
@customElement('grist-editor-recipients')
|
|
11
|
+
export class GristEditorRecipients extends OxGristEditor {
|
|
12
|
+
private popup?: PopupHandle
|
|
13
|
+
private template?: TemplateResult
|
|
14
|
+
|
|
15
|
+
get editorTemplate() {
|
|
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>`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_onclick(e: Event): void {
|
|
25
|
+
e.stopPropagation()
|
|
26
|
+
this.openSelector()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_onkeydown(e: KeyboardEvent): void {
|
|
30
|
+
const key = e.key
|
|
31
|
+
if (key == 'Enter') {
|
|
32
|
+
e.stopPropagation()
|
|
33
|
+
this.openSelector()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
openSelector() {
|
|
38
|
+
if (this.popup) {
|
|
39
|
+
delete this.popup
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
43
|
+
this.dispatchEvent(
|
|
44
|
+
new CustomEvent('field-change', {
|
|
45
|
+
bubbles: true,
|
|
46
|
+
composed: true,
|
|
47
|
+
detail: {
|
|
48
|
+
before: this.value,
|
|
49
|
+
after: selected || [],
|
|
50
|
+
record: this.record,
|
|
51
|
+
column: this.column,
|
|
52
|
+
row: this.row
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var value = this.value || []
|
|
59
|
+
|
|
60
|
+
var template =
|
|
61
|
+
this.template ||
|
|
62
|
+
html`
|
|
63
|
+
<recipients-editor-popup
|
|
64
|
+
.value=${value}
|
|
65
|
+
.confirmCallback=${confirmCallback.bind(this)}
|
|
66
|
+
></recipients-editor-popup>
|
|
67
|
+
`
|
|
68
|
+
|
|
69
|
+
this.popup = openPopup(template, {
|
|
70
|
+
backdrop: true,
|
|
71
|
+
size: 'large',
|
|
72
|
+
title: i18next.t('title.recipients editor')
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -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 GristRendererRecipients: 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
|
+
}
|
package/client/tsconfig.json
CHANGED
package/dist-client/bootstrap.js
CHANGED
|
@@ -3,6 +3,8 @@ import { GristRendererDepartmentObject } from './grist-editor/grist-renderer-dep
|
|
|
3
3
|
import { GristEditorDepartmentObject } from './grist-editor/grist-editor-department-object';
|
|
4
4
|
import { GristEditorAssignees } from './grist-editor/grist-editor-assignees';
|
|
5
5
|
import { GristRendererAssignees } from './grist-editor/grist-renderer-assignees';
|
|
6
|
+
import { GristEditorRecipients } from './grist-editor/grist-editor-recipients';
|
|
7
|
+
import { GristRendererRecipients } from './grist-editor/grist-renderer-recipients';
|
|
6
8
|
import { GristEditorApprovalLine } from './grist-editor/grist-editor-approval-line';
|
|
7
9
|
import { GristRendererApprovalLine } from './grist-editor/grist-renderer-approval-line';
|
|
8
10
|
export default function bootstrap() {
|
|
@@ -10,8 +12,10 @@ export default function bootstrap() {
|
|
|
10
12
|
registerEditor('department-object', GristEditorDepartmentObject);
|
|
11
13
|
registerEditor('approval-line', GristEditorApprovalLine);
|
|
12
14
|
registerEditor('assignees', GristEditorAssignees);
|
|
15
|
+
registerEditor('recipients', GristEditorRecipients);
|
|
13
16
|
registerRenderer('department-object', GristRendererDepartmentObject);
|
|
14
17
|
registerRenderer('approval-line', GristRendererApprovalLine);
|
|
15
18
|
registerRenderer('assignees', GristRendererAssignees);
|
|
19
|
+
registerRenderer('recipients', GristRendererRecipients);
|
|
16
20
|
}
|
|
17
21
|
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAClF,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;IACjD,cAAc,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAA;IAEnD,gBAAgB,CAAC,mBAAmB,EAAE,6BAA6B,CAAC,CAAA;IACpE,gBAAgB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAA;IAC5D,gBAAgB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAA;IACrD,gBAAgB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;AACzD,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 { GristEditorRecipients } from './grist-editor/grist-editor-recipients'\nimport { GristRendererRecipients } from './grist-editor/grist-renderer-recipients'\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 registerEditor('recipients', GristEditorRecipients)\n\n registerRenderer('department-object', GristRendererDepartmentObject)\n registerRenderer('approval-line', GristRendererApprovalLine)\n registerRenderer('assignees', GristRendererAssignees)\n registerRenderer('recipients', GristRendererRecipients)\n}\n"]}
|
|
@@ -7,3 +7,6 @@ export * from './approval-line-items-editor-popup';
|
|
|
7
7
|
export * from './assignees-view';
|
|
8
8
|
export * from './assignees-editor';
|
|
9
9
|
export * from './assignees-editor-popup';
|
|
10
|
+
export * from './recipients-view';
|
|
11
|
+
export * from './recipients-editor';
|
|
12
|
+
export * from './recipients-editor-popup';
|
|
@@ -7,4 +7,7 @@ export * from './approval-line-items-editor-popup';
|
|
|
7
7
|
export * from './assignees-view';
|
|
8
8
|
export * from './assignees-editor';
|
|
9
9
|
export * from './assignees-editor-popup';
|
|
10
|
+
export * from './recipients-view';
|
|
11
|
+
export * from './recipients-editor';
|
|
12
|
+
export * from './recipients-editor-popup';
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAElD,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA","sourcesContent":["export * from './department-selector'\nexport * from './approval-line-selector'\n\nexport * from './department-view'\n\nexport * from './approval-line-view'\nexport * from './approval-line-items-editor'\nexport * from './approval-line-items-editor-popup'\n\nexport * from './assignees-view'\nexport * from './assignees-editor'\nexport * from './assignees-editor-popup'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAElD,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './department-selector'\nexport * from './approval-line-selector'\n\nexport * from './department-view'\n\nexport * from './approval-line-view'\nexport * from './approval-line-items-editor'\nexport * from './approval-line-items-editor-popup'\n\nexport * from './assignees-view'\nexport * from './assignees-editor'\nexport * from './assignees-editor-popup'\n\nexport * from './recipients-view'\nexport * from './recipients-editor'\nexport * from './recipients-editor-popup'\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { RecipientsEditor } from './recipients-editor';
|
|
3
|
+
import { AssigneeItem } from '../types/org-member';
|
|
4
|
+
declare const RecipientsEditorPopup_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* 결재선의 각 결재자 리스트를 편집한다.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RecipientsEditorPopup extends RecipientsEditorPopup_base {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
value?: AssigneeItem[];
|
|
11
|
+
confirmCallback?: (value?: AssigneeItem[] | null) => void;
|
|
12
|
+
editor: RecipientsEditor;
|
|
13
|
+
private changedValue?;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
firstUpdated(): void;
|
|
16
|
+
onEmpty(): void;
|
|
17
|
+
onCancel(): void;
|
|
18
|
+
onConfirm(): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
|
+
import { i18next, localize } from '@operato/i18n';
|
|
5
|
+
import { ButtonContainerStyles } from '@operato/styles';
|
|
6
|
+
import { closePopup } from '@operato/popup';
|
|
7
|
+
import { RecipientsEditor } from './recipients-editor';
|
|
8
|
+
/**
|
|
9
|
+
* 결재선의 각 결재자 리스트를 편집한다.
|
|
10
|
+
*/
|
|
11
|
+
let RecipientsEditorPopup = class RecipientsEditorPopup extends localize(i18next)(LitElement) {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */
|
|
15
|
+
this.changedValue = this.value;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return html `
|
|
19
|
+
<recipients-editor
|
|
20
|
+
.value=${this.value}
|
|
21
|
+
@change=${(e) => {
|
|
22
|
+
this.changedValue = [...e.detail];
|
|
23
|
+
}}
|
|
24
|
+
></recipients-editor>
|
|
25
|
+
|
|
26
|
+
<div class="button-container">
|
|
27
|
+
<mwc-button @click=${this.onEmpty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
|
|
28
|
+
<mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
|
|
29
|
+
<mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
firstUpdated() {
|
|
34
|
+
this.changedValue = this.value;
|
|
35
|
+
}
|
|
36
|
+
onEmpty() {
|
|
37
|
+
this.confirmCallback && this.confirmCallback(null);
|
|
38
|
+
closePopup(this);
|
|
39
|
+
}
|
|
40
|
+
onCancel() {
|
|
41
|
+
closePopup(this);
|
|
42
|
+
}
|
|
43
|
+
onConfirm() {
|
|
44
|
+
this.confirmCallback && this.confirmCallback(this.changedValue);
|
|
45
|
+
closePopup(this);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
RecipientsEditorPopup.styles = [
|
|
49
|
+
ButtonContainerStyles,
|
|
50
|
+
css `
|
|
51
|
+
:host {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
|
|
55
|
+
background-color: #fff;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
recipients-editor {
|
|
59
|
+
flex: 1;
|
|
60
|
+
}
|
|
61
|
+
`
|
|
62
|
+
];
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: Object }),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], RecipientsEditorPopup.prototype, "value", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
property({ type: Object }),
|
|
69
|
+
__metadata("design:type", Function)
|
|
70
|
+
], RecipientsEditorPopup.prototype, "confirmCallback", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
query('recipients-editor'),
|
|
73
|
+
__metadata("design:type", RecipientsEditor
|
|
74
|
+
/* this.value는 (원인불명으로) 값이 Reset되므로, 변화값을 유지하도록 별도로 changedValue를 사용함 */
|
|
75
|
+
)
|
|
76
|
+
], RecipientsEditorPopup.prototype, "editor", void 0);
|
|
77
|
+
RecipientsEditorPopup = __decorate([
|
|
78
|
+
customElement('recipients-editor-popup')
|
|
79
|
+
], RecipientsEditorPopup);
|
|
80
|
+
export { RecipientsEditorPopup };
|
|
81
|
+
//# sourceMappingURL=recipients-editor-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipients-editor-popup.js","sourceRoot":"","sources":["../../client/component/recipients-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,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGtD;;GAEG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAjE;;QAsBL,wEAAwE;QAChE,iBAAY,GAAoB,IAAI,CAAC,KAAK,CAAA;IAqCpD,CAAC;IAnCC,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,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AA1DM,4BAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAuB;AAElD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAA0D;AACrF;IAAC,KAAK,CAAC,mBAAmB,CAAC;8BAAU,gBAAgB;IAErD,wEAAwE;;qDAFnB;AApB1C,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CA4DjC;SA5DY,qBAAqB","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 { 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 ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n recipients-editor {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) 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 <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"]}
|