@things-factory/meta-ui 9.0.0-beta.24 → 9.0.0-beta.27
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/package.json +9 -9
- package/dist-client/bootstrap.d.ts +0 -7
- package/dist-client/bootstrap.js +0 -142
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/component/filter/filter-form-meta-code-select.d.ts +0 -4
- package/dist-client/component/filter/filter-form-meta-code-select.js +0 -80
- package/dist-client/component/filter/filter-form-meta-code-select.js.map +0 -1
- package/dist-client/component/filter/filter-form-meta-object-select.d.ts +0 -4
- package/dist-client/component/filter/filter-form-meta-object-select.js +0 -82
- package/dist-client/component/filter/filter-form-meta-object-select.js.map +0 -1
- package/dist-client/component/filter/filter-grist-meta-code-select.d.ts +0 -3
- package/dist-client/component/filter/filter-grist-meta-code-select.js +0 -76
- package/dist-client/component/filter/filter-grist-meta-code-select.js.map +0 -1
- package/dist-client/component/filter/filter-grist-meta-object-select.d.ts +0 -3
- package/dist-client/component/filter/filter-grist-meta-object-select.js +0 -81
- package/dist-client/component/filter/filter-grist-meta-object-select.js.map +0 -1
- package/dist-client/component/grist/editor/grist-editor-code-input.d.ts +0 -15
- package/dist-client/component/grist/editor/grist-editor-code-input.js +0 -81
- package/dist-client/component/grist/editor/grist-editor-code-input.js.map +0 -1
- package/dist-client/component/grist/editor/grist-editor-meta-code-selector.d.ts +0 -15
- package/dist-client/component/grist/editor/grist-editor-meta-code-selector.js +0 -130
- package/dist-client/component/grist/editor/grist-editor-meta-code-selector.js.map +0 -1
- package/dist-client/component/grist/editor/grist-editor-meta-object-selector.d.ts +0 -15
- package/dist-client/component/grist/editor/grist-editor-meta-object-selector.js +0 -98
- package/dist-client/component/grist/editor/grist-editor-meta-object-selector.js.map +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-code-input.d.ts +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-code-input.js +0 -19
- package/dist-client/component/grist/renderer/grist-renderer-code-input.js.map +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.d.ts +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.js +0 -29
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.js.map +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.d.ts +0 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js +0 -23
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js.map +0 -1
- package/dist-client/component/popup/code-input-editor-popup.d.ts +0 -36
- package/dist-client/component/popup/code-input-editor-popup.js +0 -103
- package/dist-client/component/popup/code-input-editor-popup.js.map +0 -1
- package/dist-client/component/popup/file-upload-popup.d.ts +0 -1
- package/dist-client/component/popup/file-upload-popup.js +0 -118
- package/dist-client/component/popup/file-upload-popup.js.map +0 -1
- package/dist-client/component/popup/meta-object-selector-popup.d.ts +0 -60
- package/dist-client/component/popup/meta-object-selector-popup.js +0 -300
- package/dist-client/component/popup/meta-object-selector-popup.js.map +0 -1
- package/dist-client/component/popup/record-based-code-editor-popup.d.ts +0 -52
- package/dist-client/component/popup/record-based-code-editor-popup.js +0 -174
- package/dist-client/component/popup/record-based-code-editor-popup.js.map +0 -1
- package/dist-client/dynamic-menus.d.ts +0 -1
- package/dist-client/dynamic-menus.js +0 -16
- package/dist-client/dynamic-menus.js.map +0 -1
- package/dist-client/index.d.ts +0 -17
- package/dist-client/index.js +0 -18
- package/dist-client/index.js.map +0 -1
- package/dist-client/load-components.d.ts +0 -15
- package/dist-client/load-components.js +0 -17
- package/dist-client/load-components.js.map +0 -1
- package/dist-client/mixin/meta-base-mixin.d.ts +0 -89
- package/dist-client/mixin/meta-base-mixin.js +0 -287
- package/dist-client/mixin/meta-base-mixin.js.map +0 -1
- package/dist-client/mixin/meta-basic-grist-mixin.d.ts +0 -108
- package/dist-client/mixin/meta-basic-grist-mixin.js +0 -253
- package/dist-client/mixin/meta-basic-grist-mixin.js.map +0 -1
- package/dist-client/mixin/meta-button-mixin.d.ts +0 -106
- package/dist-client/mixin/meta-button-mixin.js +0 -106
- package/dist-client/mixin/meta-button-mixin.js.map +0 -1
- package/dist-client/mixin/meta-form-mixin.d.ts +0 -153
- package/dist-client/mixin/meta-form-mixin.js +0 -373
- package/dist-client/mixin/meta-form-mixin.js.map +0 -1
- package/dist-client/mixin/meta-grist-tab-mixin.d.ts +0 -132
- package/dist-client/mixin/meta-grist-tab-mixin.js +0 -301
- package/dist-client/mixin/meta-grist-tab-mixin.js.map +0 -1
- package/dist-client/mixin/meta-main-tab-mixin.d.ts +0 -109
- package/dist-client/mixin/meta-main-tab-mixin.js +0 -242
- package/dist-client/mixin/meta-main-tab-mixin.js.map +0 -1
- package/dist-client/mixin/meta-master-detail-mixin.d.ts +0 -172
- package/dist-client/mixin/meta-master-detail-mixin.js +0 -359
- package/dist-client/mixin/meta-master-detail-mixin.js.map +0 -1
- package/dist-client/mixin/meta-service-mixin.d.ts +0 -66
- package/dist-client/mixin/meta-service-mixin.js +0 -268
- package/dist-client/mixin/meta-service-mixin.js.map +0 -1
- package/dist-client/mixin/meta-tab-detail-mixin.d.ts +0 -110
- package/dist-client/mixin/meta-tab-detail-mixin.js +0 -255
- package/dist-client/mixin/meta-tab-detail-mixin.js.map +0 -1
- package/dist-client/mixin/meta-tab-mixin.d.ts +0 -108
- package/dist-client/mixin/meta-tab-mixin.js +0 -168
- package/dist-client/mixin/meta-tab-mixin.js.map +0 -1
- package/dist-client/pages/activity/meta-activity-define-page.d.ts +0 -1
- package/dist-client/pages/activity/meta-activity-define-page.js +0 -398
- package/dist-client/pages/activity/meta-activity-define-page.js.map +0 -1
- package/dist-client/pages/activity/meta-activity-list-page.d.ts +0 -1
- package/dist-client/pages/activity/meta-activity-list-page.js +0 -223
- package/dist-client/pages/activity/meta-activity-list-page.js.map +0 -1
- package/dist-client/pages/activity/meta-activity-viewer-element.d.ts +0 -25
- package/dist-client/pages/activity/meta-activity-viewer-element.js +0 -29
- package/dist-client/pages/activity/meta-activity-viewer-element.js.map +0 -1
- package/dist-client/pages/activity/meta-activity-writer-element.d.ts +0 -27
- package/dist-client/pages/activity/meta-activity-writer-element.js +0 -38
- package/dist-client/pages/activity/meta-activity-writer-element.js.map +0 -1
- package/dist-client/pages/activity/meta-activiy-mixin.d.ts +0 -17
- package/dist-client/pages/activity/meta-activiy-mixin.js +0 -70
- package/dist-client/pages/activity/meta-activiy-mixin.js.map +0 -1
- package/dist-client/pages/button-role/button-role-detail.d.ts +0 -74
- package/dist-client/pages/button-role/button-role-detail.js +0 -39
- package/dist-client/pages/button-role/button-role-detail.js.map +0 -1
- package/dist-client/pages/button-role/button-role-page.d.ts +0 -82
- package/dist-client/pages/button-role/button-role-page.js +0 -21
- package/dist-client/pages/button-role/button-role-page.js.map +0 -1
- package/dist-client/pages/doc-number/doc-number-page.d.ts +0 -1
- package/dist-client/pages/doc-number/doc-number-page.js +0 -20
- package/dist-client/pages/doc-number/doc-number-page.js.map +0 -1
- package/dist-client/pages/doc-number/next-doc-number-popup.d.ts +0 -1
- package/dist-client/pages/doc-number/next-doc-number-popup.js +0 -21
- package/dist-client/pages/doc-number/next-doc-number-popup.js.map +0 -1
- package/dist-client/pages/entity/config-entity.d.ts +0 -1
- package/dist-client/pages/entity/config-entity.js +0 -801
- package/dist-client/pages/entity/config-entity.js.map +0 -1
- package/dist-client/pages/entity/main-menu-selector.d.ts +0 -61
- package/dist-client/pages/entity/main-menu-selector.js +0 -233
- package/dist-client/pages/entity/main-menu-selector.js.map +0 -1
- package/dist-client/pages/history/history-copy-list-popup.d.ts +0 -50
- package/dist-client/pages/history/history-copy-list-popup.js +0 -122
- package/dist-client/pages/history/history-copy-list-popup.js.map +0 -1
- package/dist-client/pages/history/history-json-list-popup.d.ts +0 -50
- package/dist-client/pages/history/history-json-list-popup.js +0 -132
- package/dist-client/pages/history/history-json-list-popup.js.map +0 -1
- package/dist-client/pages/menu/dynamic-menu-template.d.ts +0 -1
- package/dist-client/pages/menu/dynamic-menu-template.js +0 -80
- package/dist-client/pages/menu/dynamic-menu-template.js.map +0 -1
- package/dist-client/pages/menu/dynamic-menu.d.ts +0 -83
- package/dist-client/pages/menu/dynamic-menu.js +0 -663
- package/dist-client/pages/menu/dynamic-menu.js.map +0 -1
- package/dist-client/pages/menu/export-menu-popup.d.ts +0 -55
- package/dist-client/pages/menu/export-menu-popup.js +0 -392
- package/dist-client/pages/menu/export-menu-popup.js.map +0 -1
- package/dist-client/pages/meta-form-element.d.ts +0 -63
- package/dist-client/pages/meta-form-element.js +0 -8
- package/dist-client/pages/meta-form-element.js.map +0 -1
- package/dist-client/pages/meta-grist-element.d.ts +0 -70
- package/dist-client/pages/meta-grist-element.js +0 -11
- package/dist-client/pages/meta-grist-element.js.map +0 -1
- package/dist-client/pages/meta-grist-page.d.ts +0 -70
- package/dist-client/pages/meta-grist-page.js +0 -14
- package/dist-client/pages/meta-grist-page.js.map +0 -1
- package/dist-client/pages/meta-grist-tab-element.d.ts +0 -82
- package/dist-client/pages/meta-grist-tab-element.js +0 -14
- package/dist-client/pages/meta-grist-tab-element.js.map +0 -1
- package/dist-client/pages/meta-grist-tab-page.d.ts +0 -82
- package/dist-client/pages/meta-grist-tab-page.js +0 -14
- package/dist-client/pages/meta-grist-tab-page.js.map +0 -1
- package/dist-client/pages/meta-main-tab-element.d.ts +0 -75
- package/dist-client/pages/meta-main-tab-element.js +0 -11
- package/dist-client/pages/meta-main-tab-element.js.map +0 -1
- package/dist-client/pages/meta-main-tab-page.d.ts +0 -75
- package/dist-client/pages/meta-main-tab-page.js +0 -14
- package/dist-client/pages/meta-main-tab-page.js.map +0 -1
- package/dist-client/pages/meta-master-detail-element.d.ts +0 -80
- package/dist-client/pages/meta-master-detail-element.js +0 -11
- package/dist-client/pages/meta-master-detail-element.js.map +0 -1
- package/dist-client/pages/meta-master-detail-page.d.ts +0 -80
- package/dist-client/pages/meta-master-detail-page.js +0 -14
- package/dist-client/pages/meta-master-detail-page.js.map +0 -1
- package/dist-client/pages/meta-tab-detail-element.d.ts +0 -76
- package/dist-client/pages/meta-tab-detail-element.js +0 -11
- package/dist-client/pages/meta-tab-detail-element.js.map +0 -1
- package/dist-client/pages/meta-tab-detail-page.d.ts +0 -76
- package/dist-client/pages/meta-tab-detail-page.js +0 -14
- package/dist-client/pages/meta-tab-detail-page.js.map +0 -1
- package/dist-client/pages/meta-tab-element.d.ts +0 -57
- package/dist-client/pages/meta-tab-element.js +0 -13
- package/dist-client/pages/meta-tab-element.js.map +0 -1
- package/dist-client/pages/printer-device/printer-device-page.d.ts +0 -1
- package/dist-client/pages/printer-device/printer-device-page.js +0 -20
- package/dist-client/pages/printer-device/printer-device-page.js.map +0 -1
- package/dist-client/pages/template/doc-template-page.d.ts +0 -1
- package/dist-client/pages/template/doc-template-page.js +0 -20
- package/dist-client/pages/template/doc-template-page.js.map +0 -1
- package/dist-client/pages/template/template-file-page.d.ts +0 -1
- package/dist-client/pages/template/template-file-page.js +0 -20
- package/dist-client/pages/template/template-file-page.js.map +0 -1
- package/dist-client/pages/terms/config-terminology.d.ts +0 -1
- package/dist-client/pages/terms/config-terminology.js +0 -188
- package/dist-client/pages/terms/config-terminology.js.map +0 -1
- package/dist-client/pages/work-code/work-code-detail-popup.d.ts +0 -69
- package/dist-client/pages/work-code/work-code-detail-popup.js +0 -13
- package/dist-client/pages/work-code/work-code-detail-popup.js.map +0 -1
- package/dist-client/pages/work-code/work-code-page.d.ts +0 -1
- package/dist-client/pages/work-code/work-code-page.js +0 -19
- package/dist-client/pages/work-code/work-code-page.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -30
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/utils/grist-default-value.d.ts +0 -8
- package/dist-client/utils/grist-default-value.js +0 -33
- package/dist-client/utils/grist-default-value.js.map +0 -1
- package/dist-client/utils/meta-api.d.ts +0 -572
- package/dist-client/utils/meta-api.js +0 -728
- package/dist-client/utils/meta-api.js.map +0 -1
- package/dist-client/utils/meta-crypto.d.ts +0 -4
- package/dist-client/utils/meta-crypto.js +0 -45
- package/dist-client/utils/meta-crypto.js.map +0 -1
- package/dist-client/utils/meta-ui-util.d.ts +0 -566
- package/dist-client/utils/meta-ui-util.js +0 -2985
- package/dist-client/utils/meta-ui-util.js.map +0 -1
- package/dist-client/utils/rest-service-util.d.ts +0 -120
- package/dist-client/utils/rest-service-util.js +0 -291
- package/dist-client/utils/rest-service-util.js.map +0 -1
- package/dist-client/utils/service-util.d.ts +0 -286
- package/dist-client/utils/service-util.js +0 -1204
- package/dist-client/utils/service-util.js.map +0 -1
- package/dist-client/utils/terms-util.d.ts +0 -81
- package/dist-client/utils/terms-util.js +0 -105
- package/dist-client/utils/terms-util.js.map +0 -1
- package/dist-client/utils/ui-util.d.ts +0 -153
- package/dist-client/utils/ui-util.js +0 -307
- package/dist-client/utils/ui-util.js.map +0 -1
- package/dist-client/utils/value-util.d.ts +0 -99
- package/dist-client/utils/value-util.js +0 -214
- package/dist-client/utils/value-util.js.map +0 -1
- package/dist-server/activity/CommonActivity.d.ts +0 -2
- package/dist-server/activity/CommonActivity.js +0 -58
- package/dist-server/activity/CommonActivity.js.map +0 -1
- package/dist-server/index.d.ts +0 -2
- package/dist-server/index.js +0 -6
- package/dist-server/index.js.map +0 -1
- package/dist-server/routes.d.ts +0 -1
- package/dist-server/routes.js +0 -58
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/button-role/button-role-mutation.d.ts +0 -9
- package/dist-server/service/button-role/button-role-mutation.js +0 -112
- package/dist-server/service/button-role/button-role-mutation.js.map +0 -1
- package/dist-server/service/button-role/button-role-query.d.ts +0 -11
- package/dist-server/service/button-role/button-role-query.js +0 -79
- package/dist-server/service/button-role/button-role-query.js.map +0 -1
- package/dist-server/service/button-role/button-role-type.d.ts +0 -15
- package/dist-server/service/button-role/button-role-type.js +0 -57
- package/dist-server/service/button-role/button-role-type.js.map +0 -1
- package/dist-server/service/button-role/button-role.d.ts +0 -15
- package/dist-server/service/button-role/button-role.js +0 -69
- package/dist-server/service/button-role/button-role.js.map +0 -1
- package/dist-server/service/button-role/index.d.ts +0 -5
- package/dist-server/service/button-role/index.js +0 -9
- package/dist-server/service/button-role/index.js.map +0 -1
- package/dist-server/service/dynamic-menu/dynamic-menu-query.d.ts +0 -11
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js +0 -244
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js.map +0 -1
- package/dist-server/service/dynamic-menu/dynamic-menu-type.d.ts +0 -30
- package/dist-server/service/dynamic-menu/dynamic-menu-type.js +0 -109
- package/dist-server/service/dynamic-menu/dynamic-menu-type.js.map +0 -1
- package/dist-server/service/dynamic-menu/index.d.ts +0 -2
- package/dist-server/service/dynamic-menu/index.js +0 -6
- package/dist-server/service/dynamic-menu/index.js.map +0 -1
- package/dist-server/service/entity-event-subscriber/entity-event-subscriber.d.ts +0 -6
- package/dist-server/service/entity-event-subscriber/entity-event-subscriber.js +0 -71
- package/dist-server/service/entity-event-subscriber/entity-event-subscriber.js.map +0 -1
- package/dist-server/service/entity-event-subscriber/index.d.ts +0 -2
- package/dist-server/service/entity-event-subscriber/index.js +0 -6
- package/dist-server/service/entity-event-subscriber/index.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -9
- package/dist-server/service/index.js +0 -42
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/menu-button-auth/index.d.ts +0 -5
- package/dist-server/service/menu-button-auth/index.js +0 -9
- package/dist-server/service/menu-button-auth/index.js.map +0 -1
- package/dist-server/service/menu-button-auth/menu-button-auth-mutation.d.ts +0 -10
- package/dist-server/service/menu-button-auth/menu-button-auth-mutation.js +0 -127
- package/dist-server/service/menu-button-auth/menu-button-auth-mutation.js.map +0 -1
- package/dist-server/service/menu-button-auth/menu-button-auth-query.d.ts +0 -16
- package/dist-server/service/menu-button-auth/menu-button-auth-query.js +0 -167
- package/dist-server/service/menu-button-auth/menu-button-auth-query.js.map +0 -1
- package/dist-server/service/menu-button-auth/menu-button-auth-type.d.ts +0 -24
- package/dist-server/service/menu-button-auth/menu-button-auth-type.js +0 -90
- package/dist-server/service/menu-button-auth/menu-button-auth-type.js.map +0 -1
- package/dist-server/service/menu-button-auth/menu-button-auth.d.ts +0 -23
- package/dist-server/service/menu-button-auth/menu-button-auth.js +0 -102
- package/dist-server/service/menu-button-auth/menu-button-auth.js.map +0 -1
- package/dist-server/service/meta-activity/index.d.ts +0 -3
- package/dist-server/service/meta-activity/index.js +0 -7
- package/dist-server/service/meta-activity/index.js.map +0 -1
- package/dist-server/service/meta-activity/meta-activity-mutation.d.ts +0 -18
- package/dist-server/service/meta-activity/meta-activity-mutation.js +0 -183
- package/dist-server/service/meta-activity/meta-activity-mutation.js.map +0 -1
- package/dist-server/service/meta-activity/meta-activity-query.d.ts +0 -10
- package/dist-server/service/meta-activity/meta-activity-query.js +0 -66
- package/dist-server/service/meta-activity/meta-activity-query.js.map +0 -1
- package/dist-server/service/meta-activity/meta-activity-type.d.ts +0 -21
- package/dist-server/service/meta-activity/meta-activity-type.js +0 -80
- package/dist-server/service/meta-activity/meta-activity-type.js.map +0 -1
- package/dist-server/service/set-translations/index.d.ts +0 -2
- package/dist-server/service/set-translations/index.js +0 -6
- package/dist-server/service/set-translations/index.js.map +0 -1
- package/dist-server/service/set-translations/set-translation-resolver.d.ts +0 -4
- package/dist-server/service/set-translations/set-translation-resolver.js +0 -67
- package/dist-server/service/set-translations/set-translation-resolver.js.map +0 -1
- package/dist-server/service/work-code/index.d.ts +0 -5
- package/dist-server/service/work-code/index.js +0 -9
- package/dist-server/service/work-code/index.js.map +0 -1
- package/dist-server/service/work-code/work-code-mutation.d.ts +0 -10
- package/dist-server/service/work-code/work-code-mutation.js +0 -136
- package/dist-server/service/work-code/work-code-mutation.js.map +0 -1
- package/dist-server/service/work-code/work-code-query.d.ts +0 -14
- package/dist-server/service/work-code/work-code-query.js +0 -106
- package/dist-server/service/work-code/work-code-query.js.map +0 -1
- package/dist-server/service/work-code/work-code-type.d.ts +0 -23
- package/dist-server/service/work-code/work-code-type.js +0 -89
- package/dist-server/service/work-code/work-code-type.js.map +0 -1
- package/dist-server/service/work-code/work-code.d.ts +0 -20
- package/dist-server/service/work-code/work-code.js +0 -94
- package/dist-server/service/work-code/work-code.js.map +0 -1
- package/dist-server/service/work-code-detail/index.d.ts +0 -5
- package/dist-server/service/work-code-detail/index.js +0 -9
- package/dist-server/service/work-code-detail/index.js.map +0 -1
- package/dist-server/service/work-code-detail/work-code-detail-mutation.d.ts +0 -10
- package/dist-server/service/work-code-detail/work-code-detail-mutation.js +0 -138
- package/dist-server/service/work-code-detail/work-code-detail-mutation.js.map +0 -1
- package/dist-server/service/work-code-detail/work-code-detail-query.d.ts +0 -13
- package/dist-server/service/work-code-detail/work-code-detail-query.js +0 -89
- package/dist-server/service/work-code-detail/work-code-detail-query.js.map +0 -1
- package/dist-server/service/work-code-detail/work-code-detail-type.d.ts +0 -20
- package/dist-server/service/work-code-detail/work-code-detail-type.js +0 -74
- package/dist-server/service/work-code-detail/work-code-detail-type.js.map +0 -1
- package/dist-server/service/work-code-detail/work-code-detail.d.ts +0 -19
- package/dist-server/service/work-code-detail/work-code-detail.js +0 -93
- package/dist-server/service/work-code-detail/work-code-detail.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
|
@@ -1,2985 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js';
|
|
2
|
-
import '@operato/data-grist/ox-record-creator.js';
|
|
3
|
-
import 'ses';
|
|
4
|
-
import { css, html, render, nothing } from 'lit';
|
|
5
|
-
import { getEditor, getRenderer } from '@operato/data-grist';
|
|
6
|
-
import { getValueGenerators } from '@operato/time-calculator';
|
|
7
|
-
import moment from '@operato/moment-timezone-es';
|
|
8
|
-
import { ScrollbarStyles, CommonGristStyles, CommonButtonStyles, ButtonContainerStyles, CommonHeaderStyles } from '@operato/styles';
|
|
9
|
-
import { MetaCrypto } from './meta-crypto';
|
|
10
|
-
import { TermsUtil } from './terms-util';
|
|
11
|
-
import { ValueUtil } from './value-util';
|
|
12
|
-
import { ServiceUtil } from './service-util';
|
|
13
|
-
import { UiUtil } from './ui-util';
|
|
14
|
-
import { MetaApi } from './meta-api';
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
18
|
-
* @author Shortstop shortstop@hatiolab.com
|
|
19
|
-
* @description 메타 UI에서 필요한 유틸리티 함수 정의
|
|
20
|
-
*/
|
|
21
|
-
export class MetaUiUtil {
|
|
22
|
-
/**
|
|
23
|
-
* @description 메뉴 ID 정보로 메뉴 메타 정보 조회
|
|
24
|
-
********************************************
|
|
25
|
-
* @param {String} menuId 메뉴 ID 값
|
|
26
|
-
* @returns {Object} 메뉴 메타 정보
|
|
27
|
-
*/
|
|
28
|
-
static async findMenuMeta(menuId) {
|
|
29
|
-
let menu = await ServiceUtil.findOne('menu', menuId, 'template');
|
|
30
|
-
if (!menu) {
|
|
31
|
-
throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${menuId}` }));
|
|
32
|
-
}
|
|
33
|
-
if (!menu.template) {
|
|
34
|
-
throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` }));
|
|
35
|
-
}
|
|
36
|
-
this.menuId = menuId;
|
|
37
|
-
return JSON.parse(menu.template);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @description 메뉴 라우팅 정보로 메뉴 메타 정보 조회
|
|
41
|
-
**********************************************
|
|
42
|
-
* @param {String} menuRouting 메뉴 route 값
|
|
43
|
-
* @returns {Object} 메뉴 메타 정보 (암호)
|
|
44
|
-
*/
|
|
45
|
-
static async getMenuMetaData(menuRouting) {
|
|
46
|
-
let filters = [{ name: 'routing', operator: 'eq', value: menuRouting }];
|
|
47
|
-
let data = await ServiceUtil.searchByPagination('menus', filters, null, 0, 0, 'id,template');
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @description 메뉴 라우팅 정보로 메뉴 메타 정보 조회
|
|
52
|
-
**********************************************
|
|
53
|
-
* @param {Object} pageView
|
|
54
|
-
* @param {String} menuRouting 메뉴 route 값
|
|
55
|
-
* @returns {Object} 메뉴 메타 정보
|
|
56
|
-
*/
|
|
57
|
-
static async findMenuMetaByRouting(pageView, menuRouting) {
|
|
58
|
-
let data = await MetaUiUtil.getMenuMetaData(menuRouting);
|
|
59
|
-
let menu = undefined;
|
|
60
|
-
if (!data || !data.records || data.records.length == 0) {
|
|
61
|
-
if (pageView.defaultPageConfig) {
|
|
62
|
-
menu = { id: menuRouting, template: pageView.defaultPageConfig };
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
menu = data.records[0];
|
|
67
|
-
if (!menu.template && pageView.defaultPageConfig) {
|
|
68
|
-
menu.template = pageView.defaultPageConfig;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (!menu) {
|
|
72
|
-
throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${menuRouting}` }));
|
|
73
|
-
}
|
|
74
|
-
else if (!menu.template) {
|
|
75
|
-
throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` }));
|
|
76
|
-
}
|
|
77
|
-
pageView.menuId = menu.id;
|
|
78
|
-
return JSON.parse(MetaCrypto.dec(menu.template));
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @description 기본 그리스트 페이지 프로퍼티 리턴
|
|
82
|
-
*******************************************
|
|
83
|
-
* @returns {Object} 기본 그리스트 페이지 프로퍼티
|
|
84
|
-
*/
|
|
85
|
-
static getBasicGristPageProperties() {
|
|
86
|
-
return {
|
|
87
|
-
/* 메뉴 메타 정보 */
|
|
88
|
-
menuInfo: Object, // 메뉴 기본 정보
|
|
89
|
-
gridConfig: Object, // 그리드 구성 정보
|
|
90
|
-
gridColumnConfig: Array, // 그리드 컬럼 정보
|
|
91
|
-
formColumnConfig: Array, // form 컬럼 정보
|
|
92
|
-
buttonConfig: Array, // 버튼 구성 정보
|
|
93
|
-
searchConfig: Array, // 서치폼 구성 정보
|
|
94
|
-
gqlInfo: String, // GraphQL 정보
|
|
95
|
-
gqlFetchField: String, // GraphQL 조회 필드
|
|
96
|
-
searchFormElement: String, // 화면에서 사용 되는 서치폼 (grist, filter, not)
|
|
97
|
-
useFilterForm: Boolean, // 그리드내 filter 폼 사용 여부
|
|
98
|
-
/* 화면 구성 */
|
|
99
|
-
gristConfigSet: Object, // 메타정보에서 변환된 그리드 구성 정보
|
|
100
|
-
formConfigSet: Array, // 메타정보에서 변환된 폼 구성 정보
|
|
101
|
-
useButtonExport: Boolean, // 내보내기 버튼 사용 여부
|
|
102
|
-
useButtonImport: Boolean, // 가져오기 버튼 사용 여부
|
|
103
|
-
useButtonAdd: Boolean, // 추가 버튼 사용 여부
|
|
104
|
-
gridMobileMode: String, // 모바일 기기에서 그리드 뷰
|
|
105
|
-
gridDeskMode: String, // 데스크탑에서 그리드 뷰
|
|
106
|
-
gridViewOptions: Array, // 그리드 뷰 옵션
|
|
107
|
-
gridMode: String, // 현재 그리드 뷰 모드
|
|
108
|
-
infinityPage: true, // 페이지 사용시 false
|
|
109
|
-
route_name: String, // Element 로드시 화면을 그릴 메뉴 정보,
|
|
110
|
-
parent_id: String, // 상세 폼 뷰 상위 데이터 ID
|
|
111
|
-
/* 속성 ? */
|
|
112
|
-
is_detail: {
|
|
113
|
-
// 페이지 컴포넌트 여부
|
|
114
|
-
type: Boolean,
|
|
115
|
-
converter(value) {
|
|
116
|
-
let retVal = Boolean(value);
|
|
117
|
-
return retVal;
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
is_popup: {
|
|
121
|
-
// 팝업 여부
|
|
122
|
-
type: Boolean,
|
|
123
|
-
converter(value) {
|
|
124
|
-
let retVal = Boolean(value);
|
|
125
|
-
return retVal;
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
is_activity: {
|
|
129
|
-
// 작업 결재 관련 화면에서 호출 여부
|
|
130
|
-
type: Boolean,
|
|
131
|
-
converter(value) {
|
|
132
|
-
let retVal = Boolean(value);
|
|
133
|
-
return retVal;
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
is_readonly: {
|
|
137
|
-
// 수정 불가 페이지
|
|
138
|
-
type: Boolean,
|
|
139
|
-
converter(value) {
|
|
140
|
-
let retVal = Boolean(value);
|
|
141
|
-
return retVal;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* @description 메뉴 메타 정보를 조회한 후 파싱...
|
|
148
|
-
********************************************
|
|
149
|
-
* @param {HTMLElement} pageView
|
|
150
|
-
* @returns {Object} 메뉴 메타 정보
|
|
151
|
-
*/
|
|
152
|
-
static async getMenuMeta(pageView) {
|
|
153
|
-
// 1. 라우팅 추출 및 메뉴 메타 정보 조회
|
|
154
|
-
let currentRouting = pageView.isPage ? UiUtil.currentRouting() : pageView.route_name;
|
|
155
|
-
pageView.currentRouting = currentRouting;
|
|
156
|
-
let menuMetaData = await MetaUiUtil.findMenuMetaByRouting(pageView, currentRouting);
|
|
157
|
-
// 2. Activity 여부에 따라 버튼 / 검색 삭제
|
|
158
|
-
if (pageView.is_activity === true) {
|
|
159
|
-
menuMetaData.grid.option.grid_refresh_when_page_activated = false;
|
|
160
|
-
menuMetaData.grid.option.use_row_checker = false;
|
|
161
|
-
menuMetaData.grid.option.pages = 'unlimited';
|
|
162
|
-
menuMetaData.grid.use_filter_form = false;
|
|
163
|
-
menuMetaData.grid.button = [];
|
|
164
|
-
menuMetaData.button = menuMetaData.button.filter(x => x.name == 'add');
|
|
165
|
-
}
|
|
166
|
-
// 3. 화면이 읽기 전용인 경우 그리드 Configuration 처리
|
|
167
|
-
if (pageView.is_readonly === true) {
|
|
168
|
-
menuMetaData.grid_column.forEach(x => {
|
|
169
|
-
x.editable = false;
|
|
170
|
-
});
|
|
171
|
-
menuMetaData.button = menuMetaData.button.filter(x => x.name != 'add');
|
|
172
|
-
}
|
|
173
|
-
// 4. 필터 폼 사용 여부 강제 설정
|
|
174
|
-
if (pageView.use_filter_form === false) {
|
|
175
|
-
menuMetaData.grid.use_filter_form = false;
|
|
176
|
-
}
|
|
177
|
-
// 5. 필드 변경 이벤트 처리자 설정
|
|
178
|
-
menuMetaData.grid_column
|
|
179
|
-
.filter(x => x.change_event_handler)
|
|
180
|
-
.forEach(x => {
|
|
181
|
-
if (!pageView.fieldChangeHandlers)
|
|
182
|
-
pageView.fieldChangeHandlers = {};
|
|
183
|
-
pageView.fieldChangeHandlers[x.name] = x.change_event_handler;
|
|
184
|
-
});
|
|
185
|
-
// 6. 그리드 타입 통합 처리 : object, resource-object -> meta-object-selector, resource-code-selector -> meta-code-selector
|
|
186
|
-
menuMetaData.grid_column.forEach(x => {
|
|
187
|
-
if (['resource-object', 'object'].includes(x.type)) {
|
|
188
|
-
x.type = 'meta-object-selector';
|
|
189
|
-
}
|
|
190
|
-
else if (['resource-code-selector'].includes(x.type)) {
|
|
191
|
-
x.type = 'meta-code-selector';
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
// 7. 검색 필드의 검색 Operator가 in인 경우 디폴트 값을 배열로 변경
|
|
195
|
-
if (menuMetaData.search && menuMetaData.search.length > 0) {
|
|
196
|
-
menuMetaData.search.forEach(c => {
|
|
197
|
-
let value = c.value;
|
|
198
|
-
if (value && c.operator == 'in' && value.indexOf(',') > 0) {
|
|
199
|
-
c.value = value.split(',');
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
// 8. 메뉴 메타 정보 리턴
|
|
204
|
-
return menuMetaData;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* @description 파라미터로 받은 pageLimits로 페이지네이션 페이지 수를 표시
|
|
208
|
-
***************************************************************
|
|
209
|
-
* @param {Array} 페이지네이션 페이지 수 배열
|
|
210
|
-
* @returns {Object} 페이지네이션 페이지 수
|
|
211
|
-
*/
|
|
212
|
-
static getGristPaginationCustomConfig(...pageLimits) {
|
|
213
|
-
return { pages: pageLimits };
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* @description 그리스트 기본 gutter 설정 리턴
|
|
217
|
-
********************************************
|
|
218
|
-
* @param {Boolean} useRowSelector 행 선택 기능 사용 여부
|
|
219
|
-
* @param {Boolean} multiple 여러 행 선택 가능 여부
|
|
220
|
-
* @returns {Object} 그리스트 기본 gutter 설정
|
|
221
|
-
*/
|
|
222
|
-
static getGristGuttersConfig(useRowSelector, multiple) {
|
|
223
|
-
let configList = [
|
|
224
|
-
{ type: 'gutter', gutterName: 'dirty' },
|
|
225
|
-
{ type: 'gutter', gutterName: 'sequence' }
|
|
226
|
-
];
|
|
227
|
-
if (useRowSelector) {
|
|
228
|
-
configList.push({ type: 'gutter', gutterName: 'row-selector', multiple: multiple });
|
|
229
|
-
}
|
|
230
|
-
return configList;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* @description 그리스트 선택 모드 설정
|
|
234
|
-
***************************************
|
|
235
|
-
* @returns {Object} 그리스트 선택 모드 설정
|
|
236
|
-
*/
|
|
237
|
-
static getGristSelectableConfig(multiple) {
|
|
238
|
-
return { selectable: { multiple: multiple } };
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* @description 메뉴 메타 정보를 기반으로 그리드 설정 셋을 파싱하여 리턴
|
|
242
|
-
************************************************************
|
|
243
|
-
* @param {Object} pageView 페이지
|
|
244
|
-
* @returns {Object} 그리드 설정 셋
|
|
245
|
-
*/
|
|
246
|
-
static async parseGridConfigSet(pageView) {
|
|
247
|
-
// 0. GraphQL 예외 처리를 위한 오브젝트 초기 화
|
|
248
|
-
if (!pageView.gqlInfo)
|
|
249
|
-
pageView.gqlInfo = {};
|
|
250
|
-
if (!pageView.gqlInfo.query)
|
|
251
|
-
pageView.gqlInfo.query = {};
|
|
252
|
-
if (!pageView.gqlInfo.query.after_set_fields)
|
|
253
|
-
pageView.gqlInfo.query.after_set_fields = {};
|
|
254
|
-
if (!pageView.gqlInfo.mutation)
|
|
255
|
-
pageView.gqlInfo.mutation = {};
|
|
256
|
-
if (!pageView.gqlInfo.mutation.multiple)
|
|
257
|
-
pageView.gqlInfo.mutation.multiple = {};
|
|
258
|
-
if (!pageView.gqlInfo.mutation.multiple.skip_fields)
|
|
259
|
-
pageView.gqlInfo.mutation.multiple.skip_fields = [];
|
|
260
|
-
// 1. 그리드 옵션
|
|
261
|
-
let gridOption = MetaUiUtil.getGridOptionSet(pageView);
|
|
262
|
-
// 2. 그리드 리스트 설정
|
|
263
|
-
let gridList = MetaUiUtil.getGridListSet(pageView);
|
|
264
|
-
// 3. 그리드 row 설정
|
|
265
|
-
let gridRow = MetaUiUtil.getGridRowSet(pageView);
|
|
266
|
-
// 4. 그리드 버튼 설정
|
|
267
|
-
let gridButton = MetaUiUtil.getGridButtonSet(pageView);
|
|
268
|
-
// 5. 그리드 컬럼 설정
|
|
269
|
-
let gridColumns = await MetaUiUtil.getGridColumnSet(pageView);
|
|
270
|
-
// 6. 그리드 meta-object-selector 타입이면서 검색 조건에 해당하는 컬럼을 찾아 숨김 컬럼으로 등록
|
|
271
|
-
gridColumns
|
|
272
|
-
.filter(x => ['meta-object-selector'].includes(x.type))
|
|
273
|
-
.forEach(col => {
|
|
274
|
-
pageView.searchConfig
|
|
275
|
-
.filter(x => x.name == col.name)
|
|
276
|
-
.forEach(x => {
|
|
277
|
-
const options = col.record.options;
|
|
278
|
-
// 6.1. 검색 필드 명 설정
|
|
279
|
-
const filterName = options.referenceField ? options.referenceField : `${col.name}Id`;
|
|
280
|
-
// 6.2. 검색 필드 설정 찾기
|
|
281
|
-
const filterIdx = pageView.searchConfig.findIndex(item => {
|
|
282
|
-
return item.name == col.name;
|
|
283
|
-
});
|
|
284
|
-
// 6.3. 검색 필드를 그리드 컬럼 리스트에 추가
|
|
285
|
-
gridColumns.push({
|
|
286
|
-
type: 'meta-object-selector',
|
|
287
|
-
header: col.header,
|
|
288
|
-
name: filterName,
|
|
289
|
-
hidden: true,
|
|
290
|
-
record: {
|
|
291
|
-
editable: false,
|
|
292
|
-
mandatory: false,
|
|
293
|
-
options: options
|
|
294
|
-
},
|
|
295
|
-
unusable: true
|
|
296
|
-
});
|
|
297
|
-
// 6.4. 조회시 skip 필드 추가
|
|
298
|
-
pageView.gqlInfo.query.after_set_fields[filterName] = 'x';
|
|
299
|
-
// 6.5. 저장시 skip 필드 추가
|
|
300
|
-
pageView.gqlInfo.mutation.multiple.skip_fields.push(filterName);
|
|
301
|
-
// 6.6. 검색 설정 이름 변경
|
|
302
|
-
pageView.searchConfig[filterIdx].name = filterName;
|
|
303
|
-
pageView.searchConfig[filterIdx].type = 'meta-object-selector';
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
// 7. 누적 계산 설정 컬럼 추출
|
|
307
|
-
let accumulatorCols = gridColumns.filter(col => (col.accumulator ? true : false));
|
|
308
|
-
if (accumulatorCols && accumulatorCols.length > 0) {
|
|
309
|
-
gridRow.accumulator = true;
|
|
310
|
-
}
|
|
311
|
-
// 8. default 그리드 gutter
|
|
312
|
-
let gutterConfigs = MetaUiUtil.getGristGuttersConfig(gridOption.use_row_checker, gridRow.selectable.multiple);
|
|
313
|
-
// 9. 필터 폼에 검색 조건 필드 정의
|
|
314
|
-
if (pageView.useFilterForm == true) {
|
|
315
|
-
gridColumns = MetaUiUtil.setGridColumnSearchOption(pageView, gridColumns);
|
|
316
|
-
}
|
|
317
|
-
// 10. 그리드 강조 설정
|
|
318
|
-
if (pageView.gridEmphasized) {
|
|
319
|
-
// 10.1. 그리드 row
|
|
320
|
-
if (pageView.gridEmphasized && pageView.gridEmphasized.row && pageView.gridEmphasized.row.length > 0) {
|
|
321
|
-
gridRow.classifier = function (recordData, rowIdx) {
|
|
322
|
-
let settings = pageView.gridEmphasized.row;
|
|
323
|
-
for (let idx = 0; idx < settings.length; idx++) {
|
|
324
|
-
const logic = settings[idx].logic;
|
|
325
|
-
const c = new Compartment({ record: recordData, rowIdx });
|
|
326
|
-
const evalFunc = c.evaluate(`(record, rowIdx) => {
|
|
327
|
-
${logic}
|
|
328
|
-
}`);
|
|
329
|
-
if (evalFunc(recordData, rowIdx)) {
|
|
330
|
-
return {
|
|
331
|
-
emphasized: [settings[idx].backgroundColor, settings[idx].fontColor]
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
// 10.2. 그리드 column
|
|
338
|
-
if (pageView.gridEmphasized && pageView.gridEmphasized.column) {
|
|
339
|
-
let columSetting = pageView.gridEmphasized.column;
|
|
340
|
-
Object.keys(columSetting).forEach(key => {
|
|
341
|
-
let settings = columSetting[key];
|
|
342
|
-
let colIdx = gridColumns.findIndex(x => x.name == key);
|
|
343
|
-
if (!gridColumns[colIdx].record)
|
|
344
|
-
gridColumns[colIdx].record = {};
|
|
345
|
-
gridColumns[colIdx].record.classifier = function (recordData, rowIdx) {
|
|
346
|
-
for (let idx = 0; idx < settings.length; idx++) {
|
|
347
|
-
const logic = settings[idx].logic;
|
|
348
|
-
const c = new Compartment({ record: recordData, rowIdx });
|
|
349
|
-
const evalFunc = c.evaluate(`(record, rowIdx) => {
|
|
350
|
-
${logic}
|
|
351
|
-
}`);
|
|
352
|
-
if (evalFunc(recordData, rowIdx)) {
|
|
353
|
-
return {
|
|
354
|
-
emphasized: [settings[idx].backgroundColor, settings[idx].fontColor]
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
// 11. 그리드 최종 Configuration
|
|
363
|
-
return {
|
|
364
|
-
list: gridList,
|
|
365
|
-
pagination: gridOption.pages,
|
|
366
|
-
sorters: gridOption.sorters,
|
|
367
|
-
rows: gridRow,
|
|
368
|
-
columns: [...gutterConfigs, ...gridButton, ...gridColumns]
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* @description 메뉴 메타 정보를 기반으로 폼 설정 셋을 파싱하여 리턴
|
|
373
|
-
********************************************************
|
|
374
|
-
* @param {Object} pageView 페이지
|
|
375
|
-
* @returns {Object} 폼 설정 셋
|
|
376
|
-
*/
|
|
377
|
-
static async parseFormConfigSet(pageView) {
|
|
378
|
-
let formColumnConfig = pageView.formColumnConfig;
|
|
379
|
-
let columns = [];
|
|
380
|
-
let defaultValueGenerators = Object.keys(getValueGenerators());
|
|
381
|
-
for (let idx = 0; idx < formColumnConfig.length; idx++) {
|
|
382
|
-
let { type = 'string', name = undefined, header = undefined, hidden = false, editable = true, mandatory = false, align = 'left', select_opt = undefined, object_opt = undefined, default_value = undefined } = formColumnConfig[idx];
|
|
383
|
-
// 컬럼 config 으로 변경 및 문자열 처리
|
|
384
|
-
let column = {
|
|
385
|
-
type: type,
|
|
386
|
-
name: name,
|
|
387
|
-
header_txt: ValueUtil.isEmpty(header) ? TermsUtil.tLabel(name) : TermsUtil.tLabel(header),
|
|
388
|
-
header: {
|
|
389
|
-
renderer: function (column) {
|
|
390
|
-
return column.header_txt;
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
hidden: hidden,
|
|
394
|
-
record: {
|
|
395
|
-
editable: editable,
|
|
396
|
-
mandatory: mandatory,
|
|
397
|
-
align: align,
|
|
398
|
-
classifier: function () { },
|
|
399
|
-
renderer: getRenderer(type)
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
if (editable) {
|
|
403
|
-
column.record.editor = getEditor(type);
|
|
404
|
-
}
|
|
405
|
-
if (default_value) {
|
|
406
|
-
let defaultSet = default_value.split(',');
|
|
407
|
-
let defaultName = defaultSet[0];
|
|
408
|
-
if (defaultValueGenerators.includes(defaultName)) {
|
|
409
|
-
column.record.defaultValue =
|
|
410
|
-
defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } };
|
|
411
|
-
}
|
|
412
|
-
else {
|
|
413
|
-
column.record.defaultValue = type === 'number' ? Number(default_value) : default_value;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (type == 'boolean-all') {
|
|
417
|
-
column.type = 'boolean';
|
|
418
|
-
}
|
|
419
|
-
// meta- 로 시작 되는 타입은 공통으로 메뉴를 조회 template 을 가져간다.
|
|
420
|
-
if (type.startsWith('meta-') && object_opt && object_opt.menu) {
|
|
421
|
-
object_opt = await MetaUiUtil.getGristMetaObjectOptions(type, object_opt);
|
|
422
|
-
}
|
|
423
|
-
// select-option
|
|
424
|
-
if (type === 'select' && ValueUtil.isNotEmpty(select_opt)) {
|
|
425
|
-
if (Array.isArray(select_opt)) {
|
|
426
|
-
column.record.options = select_opt;
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
429
|
-
if (select_opt.type === 'code') {
|
|
430
|
-
// 공통 코드
|
|
431
|
-
column.record.options = await ServiceUtil.getCodeSelectorData(select_opt.values ? select_opt.values : select_opt.name);
|
|
432
|
-
}
|
|
433
|
-
else if (select_opt.type === 'scenario') {
|
|
434
|
-
// 시나리오
|
|
435
|
-
column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args);
|
|
436
|
-
}
|
|
437
|
-
else if (select_opt.type === 'entity') {
|
|
438
|
-
// 엔티티
|
|
439
|
-
column.record.options = await ServiceUtil.getCodeByEntity(select_opt.args);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
if (type === 'meta-object-selector' && ValueUtil.isNotEmpty(object_opt)) {
|
|
444
|
-
column.record.options = Object.assign({}, object_opt);
|
|
445
|
-
}
|
|
446
|
-
else if (type === 'meta-code-selector' && ValueUtil.isNotEmpty(object_opt)) {
|
|
447
|
-
if (object_opt.dispField) {
|
|
448
|
-
object_opt.codes = await ServiceUtil.getCodeByEntity(object_opt);
|
|
449
|
-
}
|
|
450
|
-
column.record.options = Object.assign({}, object_opt);
|
|
451
|
-
}
|
|
452
|
-
columns.push(column);
|
|
453
|
-
}
|
|
454
|
-
return columns;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* @description 메타 설정에서 그리드 옵션을 추출
|
|
458
|
-
*****************************************
|
|
459
|
-
* @param {Object} pageView
|
|
460
|
-
* @returns {Object}
|
|
461
|
-
*/
|
|
462
|
-
static getGridOptionSet(pageView) {
|
|
463
|
-
let gridConfig = pageView.gridConfig;
|
|
464
|
-
pageView.useFilterForm = gridConfig && gridConfig.use_filter_form != undefined ? gridConfig.use_filter_form : true;
|
|
465
|
-
let { mobile_mode = 'LIST', desk_mode = 'GRID', view_mode = [], use_row_checker = true, sorters = [], pages = [50, 100, 500, 1000] } = ValueUtil.isEmpty(gridConfig.option) ? {} : gridConfig.option;
|
|
466
|
-
// 페이지 설정 변환
|
|
467
|
-
if (pages === 'unlimited' || pages === '-1') {
|
|
468
|
-
pageView.infinityPage = true;
|
|
469
|
-
pages = { infinite: true };
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
pageView.infinityPage = false;
|
|
473
|
-
pages.sort(function (a, b) {
|
|
474
|
-
return a - b;
|
|
475
|
-
});
|
|
476
|
-
pages = { pages: pages };
|
|
477
|
-
}
|
|
478
|
-
// 모바일 데스크 뷰 모드
|
|
479
|
-
if (ValueUtil.isNotEmpty(view_mode)) {
|
|
480
|
-
if (view_mode.length == 1) {
|
|
481
|
-
desk_mode = view_mode[0];
|
|
482
|
-
mobile_mode = view_mode[0];
|
|
483
|
-
}
|
|
484
|
-
else if (view_mode.length >= 2) {
|
|
485
|
-
if (!view_mode.includes(mobile_mode)) {
|
|
486
|
-
mobile_mode = view_mode[1];
|
|
487
|
-
}
|
|
488
|
-
if (!view_mode.includes(desk_mode)) {
|
|
489
|
-
desk_mode = view_mode[0];
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
pageView.gridMobileMode = mobile_mode;
|
|
494
|
-
pageView.gridDeskMode = desk_mode;
|
|
495
|
-
pageView.gridViewOptions = view_mode;
|
|
496
|
-
pageView.gridMode = UiUtil.isMobileEnv() ? pageView.gridMobileMode : pageView.gridDeskMode;
|
|
497
|
-
return {
|
|
498
|
-
use_row_checker: use_row_checker,
|
|
499
|
-
sorters: sorters,
|
|
500
|
-
pages: pages
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* @description 메타 설정에서 그리드 리스트 설정을 추출
|
|
505
|
-
***********************************************
|
|
506
|
-
* @param {Object} pageView
|
|
507
|
-
* @returns {Object}
|
|
508
|
-
*/
|
|
509
|
-
static getGridListSet(pageView) {
|
|
510
|
-
let gridList = {
|
|
511
|
-
fields: [ValueUtil.getParams(pageView.menuInfo, 'name'), ValueUtil.getParams(pageView.menuInfo, 'desc')]
|
|
512
|
-
};
|
|
513
|
-
// 기본 리스트 설정과 메타에서 가져온 설정 merge
|
|
514
|
-
if (pageView.gridConfig.list) {
|
|
515
|
-
Object.assign(gridList, pageView.gridConfig.list);
|
|
516
|
-
}
|
|
517
|
-
return gridList;
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* @description 메타 설정에서 그리드 Row 옵션을 추출
|
|
521
|
-
*********************************************
|
|
522
|
-
* @param {Object} pageView
|
|
523
|
-
* @returns {Object}
|
|
524
|
-
*/
|
|
525
|
-
static getGridRowSet(pageView) {
|
|
526
|
-
// 기본 옵션, 메타와 상관없이 그리드 로우 멀티 셀렉트는 false, click 이벤트는 없다.
|
|
527
|
-
let { multiple_select = false, click = undefined } = ValueUtil.isEmpty(pageView.gridConfig.row)
|
|
528
|
-
? {}
|
|
529
|
-
: pageView.gridConfig.row;
|
|
530
|
-
let retObject = {
|
|
531
|
-
selectable: { multiple: multiple_select },
|
|
532
|
-
appendable: pageView.useButtonAdd
|
|
533
|
-
};
|
|
534
|
-
if (ValueUtil.isNotEmpty(click)) {
|
|
535
|
-
retObject.handlers = { click: click };
|
|
536
|
-
}
|
|
537
|
-
return retObject;
|
|
538
|
-
}
|
|
539
|
-
/**
|
|
540
|
-
* @description 메타 설정에서 그리드 버튼 옵션을 추출
|
|
541
|
-
*********************************************
|
|
542
|
-
* @param {Object} pageView
|
|
543
|
-
* @returns {Array}
|
|
544
|
-
*/
|
|
545
|
-
static getGridButtonSet(pageView) {
|
|
546
|
-
let gridButtons = pageView.gridConfig.button;
|
|
547
|
-
return ValueUtil.isEmpty(gridButtons)
|
|
548
|
-
? []
|
|
549
|
-
: // 그리드 버튼 정보로 버튼 설정 정보를 구성하여 리턴
|
|
550
|
-
gridButtons.map(btn => {
|
|
551
|
-
// 기본 그리드 버튼
|
|
552
|
-
let button = { type: 'gutter', gutterName: 'button' };
|
|
553
|
-
// 레코드 특정 필드 값 조건에 따라서 아이콘을 변경 ...
|
|
554
|
-
if (ValueUtil.isNotEmpty(btn.icon)) {
|
|
555
|
-
// 아이콘이 Array 타입
|
|
556
|
-
if (Array.isArray(btn.icon)) {
|
|
557
|
-
// 지정 된 조건에 따라 아이콘을 바꾼다.
|
|
558
|
-
button.icon = record => {
|
|
559
|
-
if (ValueUtil.isNotEmpty(record)) {
|
|
560
|
-
// 지정된 조건 Loop
|
|
561
|
-
for (let i = 0; i < btn.icon.length; i++) {
|
|
562
|
-
let logic = btn.icon[i];
|
|
563
|
-
let useIcon = ValueUtil.compareObjectValues(logic, record, Object.keys(logic).filter(key => key != 'icon'));
|
|
564
|
-
if (useIcon === true) {
|
|
565
|
-
return logic.icon;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
else {
|
|
572
|
-
button.icon = btn.icon;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
// 이름이 지정되어 있으면 변환
|
|
576
|
-
if (ValueUtil.isNotEmpty(btn.name)) {
|
|
577
|
-
button.name = btn.name;
|
|
578
|
-
}
|
|
579
|
-
// Tooltip
|
|
580
|
-
if (ValueUtil.isNotEmpty(btn.label)) {
|
|
581
|
-
button.title = TermsUtil.tButton(btn.label);
|
|
582
|
-
}
|
|
583
|
-
// 버튼 유형이 기본이면 ( 그리스트 기본 제공 기능 및 추가 기능 )
|
|
584
|
-
if (btn.type === 'basic') {
|
|
585
|
-
let logicTxt = ValueUtil.getParams(btn, 'logic');
|
|
586
|
-
if (['history_copy', 'history_json'].includes(logicTxt)) {
|
|
587
|
-
button.handlers = {
|
|
588
|
-
click: (_columns, _data, _column, record, _rowIdx) => {
|
|
589
|
-
if (record.id) {
|
|
590
|
-
let action = {
|
|
591
|
-
title: 'data_history_list',
|
|
592
|
-
type: 'popup',
|
|
593
|
-
tagname: logicTxt == 'history_copy' ? 'history-copy-list-popup' : 'history-json-list-popup',
|
|
594
|
-
location: logicTxt == 'history_copy'
|
|
595
|
-
? 'pages/hgistory/history-copy-list-popup.js'
|
|
596
|
-
: 'pages/hgistory/history-json-list-popup.js',
|
|
597
|
-
menu: pageView.currentRouting,
|
|
598
|
-
size: 'large',
|
|
599
|
-
popup_field: 'open_param',
|
|
600
|
-
parent_field: 'id'
|
|
601
|
-
};
|
|
602
|
-
let params = Object.assign(Object.assign({}, record), { gqlFunc: ValueUtil.getParams(pageView.gqlInfo, 'query', 'find_one_func'), gristConfig: JSON.parse(JSON.stringify(pageView.grist.config)) });
|
|
603
|
-
MetaUiUtil.gristButtonHandler(pageView, { logic: action }, params);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
button.handlers = { click: logicTxt };
|
|
610
|
-
}
|
|
611
|
-
// 버튼 유형이 커스텀이면 ...
|
|
612
|
-
}
|
|
613
|
-
else {
|
|
614
|
-
button.handlers = {
|
|
615
|
-
click: (_columns, _data, _column, record, _rowIdx) => {
|
|
616
|
-
if (record.id) {
|
|
617
|
-
MetaUiUtil.gristButtonHandler(pageView, btn, record);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
return button;
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* @description 메타 데이터에서 그리드 렌더링 config 을 생성
|
|
627
|
-
***************************************************
|
|
628
|
-
* @param {Object} pageView 페이지
|
|
629
|
-
* @returns {Array} 그리드 컬럼 설정 리스트
|
|
630
|
-
*/
|
|
631
|
-
static async getGridColumnSet(pageView) {
|
|
632
|
-
let gridColumnConfig = pageView.gridColumnConfig;
|
|
633
|
-
// 메타에 그리드 컬럼 정보가 없으면
|
|
634
|
-
if (ValueUtil.isEmpty(gridColumnConfig)) {
|
|
635
|
-
return [];
|
|
636
|
-
}
|
|
637
|
-
// CARD, LIST인 경우 컬럼 정보를 표시하기 위한 컬럼들 추출
|
|
638
|
-
let mobileDisplayColumns = UiUtil.isMobileEnv() && pageView.etcConfig && pageView.etcConfig.mobile_display_columns
|
|
639
|
-
? pageView.etcConfig.mobile_display_columns.split(',')
|
|
640
|
-
: [];
|
|
641
|
-
let defaultValueGenerators = Object.keys(getValueGenerators());
|
|
642
|
-
let columns = [];
|
|
643
|
-
for (let idx = 0; idx < gridColumnConfig.length; idx++) {
|
|
644
|
-
let { type = 'string', name = undefined, header = undefined, hidden = false, editable = true, mandatory = false, sortable = false, align = 'left', width = 0, exportable = false, select_opt = undefined, object_opt = undefined, format = undefined, default_value = undefined, accumulator = undefined, fixed = false } = gridColumnConfig[idx];
|
|
645
|
-
// 컬럼 config 으로 변경 및 문자열 처리
|
|
646
|
-
let column = {
|
|
647
|
-
type: type,
|
|
648
|
-
name: name,
|
|
649
|
-
header: ValueUtil.isEmpty(header) ? '' : TermsUtil.tLabel(header),
|
|
650
|
-
hidden: hidden,
|
|
651
|
-
sortable: sortable,
|
|
652
|
-
width: width,
|
|
653
|
-
fixed: fixed,
|
|
654
|
-
record: { editable: editable, mandatory: mandatory, align: align, format: format }
|
|
655
|
-
};
|
|
656
|
-
// accumulator 설정이 있고 type이 number이면 accumulator 설정 추가
|
|
657
|
-
if (type.indexOf('number') >= 0 && accumulator) {
|
|
658
|
-
column.accumulator = accumulator;
|
|
659
|
-
}
|
|
660
|
-
if (default_value) {
|
|
661
|
-
let defaultSet = default_value.split(',');
|
|
662
|
-
let defaultName = defaultSet[0];
|
|
663
|
-
if (defaultValueGenerators.includes(defaultName)) {
|
|
664
|
-
column.record.defaultValue =
|
|
665
|
-
defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } };
|
|
666
|
-
}
|
|
667
|
-
else {
|
|
668
|
-
column.record.defaultValue = type === 'number' ? Number(default_value) : default_value;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
if (type == 'boolean-all') {
|
|
672
|
-
column.type = 'boolean';
|
|
673
|
-
let colHeaderTxt = column.header;
|
|
674
|
-
column.header = {
|
|
675
|
-
renderer: function (col) {
|
|
676
|
-
return html `
|
|
677
|
-
<span>${colHeaderTxt}
|
|
678
|
-
<input type='checkbox'
|
|
679
|
-
@change=${e => {
|
|
680
|
-
e.stopPropagation();
|
|
681
|
-
let targetElement = e.target;
|
|
682
|
-
let selected = targetElement.checked;
|
|
683
|
-
let grist = pageView.grist;
|
|
684
|
-
if (grist._data && grist._data.records) {
|
|
685
|
-
let records = grist._data.records;
|
|
686
|
-
for (let idx = 0; idx < records.length; idx++) {
|
|
687
|
-
targetElement.dispatchEvent(new CustomEvent('field-change', {
|
|
688
|
-
bubbles: true,
|
|
689
|
-
composed: true,
|
|
690
|
-
detail: {
|
|
691
|
-
before: records[idx][col.name],
|
|
692
|
-
after: selected,
|
|
693
|
-
record: records[idx],
|
|
694
|
-
column: col,
|
|
695
|
-
row: idx
|
|
696
|
-
}
|
|
697
|
-
}));
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
}}
|
|
701
|
-
></input>
|
|
702
|
-
</span>
|
|
703
|
-
`;
|
|
704
|
-
}
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
// meta- 로 시작 되는 타입은 공통으로 메뉴를 조회 template 을 가져간다.
|
|
708
|
-
if (type.startsWith('meta-') && object_opt && object_opt.menu) {
|
|
709
|
-
object_opt = await MetaUiUtil.getGristMetaObjectOptions(type, object_opt);
|
|
710
|
-
}
|
|
711
|
-
// select-option
|
|
712
|
-
if (type === 'select' && ValueUtil.isNotEmpty(select_opt)) {
|
|
713
|
-
if (Array.isArray(select_opt)) {
|
|
714
|
-
column.record.options = select_opt;
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
// 공통 코드
|
|
718
|
-
if (select_opt.type === 'code') {
|
|
719
|
-
column.record.options = await ServiceUtil.getCodeSelectorData(select_opt.values ? select_opt.values : select_opt.name);
|
|
720
|
-
// 시나리오
|
|
721
|
-
}
|
|
722
|
-
else if (select_opt.type === 'scenario') {
|
|
723
|
-
column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args);
|
|
724
|
-
// 엔티티
|
|
725
|
-
}
|
|
726
|
-
else if (select_opt.type === 'entity') {
|
|
727
|
-
column.record.options = await ServiceUtil.getCodeByEntity(select_opt.args);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
// object-option
|
|
732
|
-
if (type === 'meta-object-selector' && ValueUtil.isNotEmpty(object_opt)) {
|
|
733
|
-
column.record.options = Object.assign({}, object_opt);
|
|
734
|
-
}
|
|
735
|
-
else if (type === 'meta-code-selector' && ValueUtil.isNotEmpty(object_opt)) {
|
|
736
|
-
if (object_opt.dispField) {
|
|
737
|
-
object_opt.codes = await ServiceUtil.getCodeByEntity(object_opt);
|
|
738
|
-
}
|
|
739
|
-
column.record.options = Object.assign({}, object_opt);
|
|
740
|
-
}
|
|
741
|
-
// attributes (확장 속성)
|
|
742
|
-
if (type === 'attributes' && format) {
|
|
743
|
-
column.record.options = await ServiceUtil.getAttributeSetOptionFor(format);
|
|
744
|
-
}
|
|
745
|
-
// mask
|
|
746
|
-
if (type == 'mask') {
|
|
747
|
-
column.record.renderer = (value, column, record, rowIndex, field) => {
|
|
748
|
-
let maskVal = '';
|
|
749
|
-
if (value) {
|
|
750
|
-
let valCount = value.length;
|
|
751
|
-
for (let i = 1; i <= valCount; i++) {
|
|
752
|
-
maskVal += '*';
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
else {
|
|
756
|
-
maskVal = '********';
|
|
757
|
-
}
|
|
758
|
-
return maskVal;
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
// LIST, CARD 에서 컬럼 정보 표시
|
|
762
|
-
if (mobileDisplayColumns.includes(name)) {
|
|
763
|
-
column.record.renderer = (value, column, record, rowIndex, field) => {
|
|
764
|
-
return TermsUtil.tLabel(header) + ': ' + value;
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
// 내보내기 버튼 사용, 컬럼 내보내기 옵션
|
|
768
|
-
if (pageView.useButtonExport === true && exportable === true) {
|
|
769
|
-
column.imex = { header: column.header, key: column.name, width: column.width / 6, type: column.type };
|
|
770
|
-
}
|
|
771
|
-
columns.push(column);
|
|
772
|
-
}
|
|
773
|
-
if (this.is_activity !== true) {
|
|
774
|
-
return columns;
|
|
775
|
-
}
|
|
776
|
-
return columns;
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* @description meta-object, meta-code에 대한 설정을 가져온다. (menu or 설정)
|
|
780
|
-
***********************************************************************
|
|
781
|
-
* @param {String} type 컬럼 타입
|
|
782
|
-
* @param {Object} options 컬럼 오브젝트 설정
|
|
783
|
-
* @returns {Object} 메타 변경 결과
|
|
784
|
-
*/
|
|
785
|
-
static async getGristMetaObjectOptions(type, options) {
|
|
786
|
-
let data = await MetaUiUtil.getMenuMetaData(options.menu);
|
|
787
|
-
if (data && data.records && data.records.length > 0 && data.records[0].template) {
|
|
788
|
-
let menu = data.records[0];
|
|
789
|
-
let menu_template = JSON.parse(MetaCrypto.dec(menu.template));
|
|
790
|
-
if (!options.queryName) {
|
|
791
|
-
options.queryName = menu_template.gql.query.list_func;
|
|
792
|
-
}
|
|
793
|
-
if (!options.select) {
|
|
794
|
-
options.select = menu_template.grid_column;
|
|
795
|
-
}
|
|
796
|
-
if (!options.filterFields || options.filterFields.length == 0) {
|
|
797
|
-
options.filterFields = menu_template.search;
|
|
798
|
-
}
|
|
799
|
-
if (!options.selectorName) {
|
|
800
|
-
options.selectorName = menu_template.menu.title;
|
|
801
|
-
}
|
|
802
|
-
if (!options.filters) {
|
|
803
|
-
options.filters = menu_template.gql.query.filters || [];
|
|
804
|
-
}
|
|
805
|
-
if (type.includes('-object-')) {
|
|
806
|
-
if (!options.nameField) {
|
|
807
|
-
options.nameField = menu_template.menu.name || 'name';
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
else if (type.includes('-code-')) {
|
|
811
|
-
if (!options.codeField) {
|
|
812
|
-
options.codeField = menu_template.menu.name || 'code';
|
|
813
|
-
}
|
|
814
|
-
if (!options.dispField) {
|
|
815
|
-
options.dispField = menu_template.menu.desc || undefined;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
return options;
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* @description 필터 폼에 검색 조건 필드 정의
|
|
823
|
-
*****************************************
|
|
824
|
-
* @param {HTMLElement} pageView 페이지
|
|
825
|
-
* @param {Array} gridColumns 그리드 컬럼 설정
|
|
826
|
-
* @returns
|
|
827
|
-
*/
|
|
828
|
-
static setGridColumnSearchOption(pageView, gridColumns) {
|
|
829
|
-
let searchConfig = pageView.searchConfig;
|
|
830
|
-
if (searchConfig) {
|
|
831
|
-
searchConfig.forEach(config => {
|
|
832
|
-
if (typeof config === 'string') {
|
|
833
|
-
gridColumns
|
|
834
|
-
.filter(col => col.name == config)
|
|
835
|
-
.forEach(col => {
|
|
836
|
-
col.filter = 'search';
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
else if (typeof config === 'object') {
|
|
840
|
-
gridColumns
|
|
841
|
-
.filter(col => col.name == config.name)
|
|
842
|
-
.forEach(col => {
|
|
843
|
-
col.filter = config;
|
|
844
|
-
col.filter.type = col.type === 'datetime' && config.operator == 'eq' ? 'datetime-local' : col.type;
|
|
845
|
-
let defValue = col.filter.value;
|
|
846
|
-
let dateKeywords = ['today', 'year', 'month', 'date', 'hour', 'min', 'sec'];
|
|
847
|
-
if (defValue &&
|
|
848
|
-
typeof defValue == 'string' &&
|
|
849
|
-
dateKeywords.filter(x => defValue.startsWith(x)).length > 0) {
|
|
850
|
-
let defRes = [];
|
|
851
|
-
let dateFormat = { date: 'YYYY-MM-DD', datetime: 'YYYY-MM-DD HH:mm:ss' };
|
|
852
|
-
let durationType = {
|
|
853
|
-
today: 'day',
|
|
854
|
-
year: 'year',
|
|
855
|
-
month: 'month',
|
|
856
|
-
date: 'day',
|
|
857
|
-
hour: 'hour',
|
|
858
|
-
min: 'minute',
|
|
859
|
-
sec: 'second'
|
|
860
|
-
};
|
|
861
|
-
let defDates = defValue.split(',');
|
|
862
|
-
defDates.forEach(x => {
|
|
863
|
-
const todayMoment = moment();
|
|
864
|
-
if (dateKeywords.includes(x)) {
|
|
865
|
-
defRes.push(todayMoment.startOf(durationType[x]).format(dateFormat[col.type]));
|
|
866
|
-
}
|
|
867
|
-
else if (x.includes('-')) {
|
|
868
|
-
let wordSplits = x.split('-');
|
|
869
|
-
let key = wordSplits[0];
|
|
870
|
-
let value = wordSplits[1];
|
|
871
|
-
defRes.push(todayMoment
|
|
872
|
-
.subtract(value, durationType[key])
|
|
873
|
-
.startOf(durationType[key])
|
|
874
|
-
.format(dateFormat[col.type]));
|
|
875
|
-
}
|
|
876
|
-
else if (x.includes('+')) {
|
|
877
|
-
let wordSplits = x.split('+');
|
|
878
|
-
let key = wordSplits[0];
|
|
879
|
-
let value = wordSplits[1];
|
|
880
|
-
defRes.push(todayMoment.add(value, durationType[key]).startOf(durationType[key]).format(dateFormat[col.type]));
|
|
881
|
-
}
|
|
882
|
-
});
|
|
883
|
-
if (defRes.length > 0)
|
|
884
|
-
col.filter.value = defRes.length == 1 ? defRes[0] : defRes;
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
return gridColumns;
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* @description 컨텍스트 오브젝트 리턴
|
|
894
|
-
**********************************
|
|
895
|
-
* @param {Object} pageView
|
|
896
|
-
* @returns {Object} 컨텍스트 오브젝트
|
|
897
|
-
*/
|
|
898
|
-
static getContextObject(pageView) {
|
|
899
|
-
let ctx = pageView && pageView.menuInfo
|
|
900
|
-
? {
|
|
901
|
-
title: TermsUtil.tTitle(pageView.menuInfo.title),
|
|
902
|
-
help: pageView.menuInfo.help || '',
|
|
903
|
-
actions: [...MetaUiUtil.getContextButtons(pageView)]
|
|
904
|
-
}
|
|
905
|
-
: {};
|
|
906
|
-
// export 버튼
|
|
907
|
-
if (pageView.useButtonExport) {
|
|
908
|
-
ctx.exportable = {
|
|
909
|
-
name: ctx.title,
|
|
910
|
-
data: pageView.export.bind(pageView)
|
|
911
|
-
};
|
|
912
|
-
}
|
|
913
|
-
// import 버튼
|
|
914
|
-
if (pageView.useButtonImport) {
|
|
915
|
-
ctx.importable = {
|
|
916
|
-
handler: pageView.import.bind(pageView)
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
// Context
|
|
920
|
-
return ctx;
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* @description 메뉴 컨텍스트에서 사용할 버튼 정보 추출
|
|
924
|
-
**********************************************
|
|
925
|
-
* @param {Object} pageView 페이지 뷰
|
|
926
|
-
* @returns {Array} 버튼 엘리먼트 리스트
|
|
927
|
-
*/
|
|
928
|
-
static getContextButtons(pageView) {
|
|
929
|
-
let buttonConfig = pageView.buttonConfig;
|
|
930
|
-
return ValueUtil.isEmpty(buttonConfig)
|
|
931
|
-
? []
|
|
932
|
-
: buttonConfig
|
|
933
|
-
.filter(b => b.name != 'export' && b.name != 'import' && b.name != 'add')
|
|
934
|
-
.map(btn => {
|
|
935
|
-
let { name = undefined, label = undefined, style = undefined, type = 'basic', action = undefined, logic = undefined } = btn;
|
|
936
|
-
if (ValueUtil.isEmpty(name)) {
|
|
937
|
-
return { title: '-1' };
|
|
938
|
-
}
|
|
939
|
-
if (ValueUtil.isEmpty(label))
|
|
940
|
-
label = name;
|
|
941
|
-
if (ValueUtil.isEmpty(style))
|
|
942
|
-
style = name;
|
|
943
|
-
if (ValueUtil.isEmpty(action))
|
|
944
|
-
action = name;
|
|
945
|
-
let btnStylecss = ValueUtil.isNotEmpty(style)
|
|
946
|
-
? CommonButtonStyles[style] || {
|
|
947
|
-
icon: style,
|
|
948
|
-
emphasis: {
|
|
949
|
-
raised: true,
|
|
950
|
-
outlined: false,
|
|
951
|
-
dense: false,
|
|
952
|
-
danger: false
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
: {};
|
|
956
|
-
return Object.assign({ title: TermsUtil.tButton(label), action: MetaUiUtil.getButtonActionHandler(pageView, type, action, logic) }, btnStylecss);
|
|
957
|
-
})
|
|
958
|
-
.filter(btn => btn.title != '-1');
|
|
959
|
-
}
|
|
960
|
-
/**
|
|
961
|
-
* @description element로 로드시 버튼 element를 container에 직접 추가
|
|
962
|
-
****************************************************************
|
|
963
|
-
* @param {Object} pageView 페이지 뷰
|
|
964
|
-
* @returns {Array} 버튼 엘리먼트 리스트
|
|
965
|
-
*/
|
|
966
|
-
static getContainerButtons(pageView) {
|
|
967
|
-
let buttonConfig = pageView && pageView.buttonConfig ? pageView.buttonConfig : null;
|
|
968
|
-
return !buttonConfig
|
|
969
|
-
? []
|
|
970
|
-
: buttonConfig
|
|
971
|
-
.filter(b => b.name != 'add')
|
|
972
|
-
.map(b => {
|
|
973
|
-
let { name = undefined, label = undefined, style = undefined, type = 'basic', action = undefined, logic = undefined } = b;
|
|
974
|
-
if (ValueUtil.isEmpty(label))
|
|
975
|
-
label = name;
|
|
976
|
-
if (ValueUtil.isEmpty(style))
|
|
977
|
-
style = name;
|
|
978
|
-
if (ValueUtil.isEmpty(action))
|
|
979
|
-
action = name;
|
|
980
|
-
let btn = MetaUiUtil.createButtonElement(TermsUtil.tButton(label), style);
|
|
981
|
-
btn.onclick = MetaUiUtil.getButtonActionHandler(pageView, type, action, logic);
|
|
982
|
-
return btn;
|
|
983
|
-
});
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* @description 버튼 엘리먼트를 생성
|
|
987
|
-
********************************
|
|
988
|
-
* @param {String} buttonName
|
|
989
|
-
* @param {String} style
|
|
990
|
-
* @returns {HTMLElement} 버튼 엘리먼트
|
|
991
|
-
*/
|
|
992
|
-
static createButtonElement(buttonName, style) {
|
|
993
|
-
let btnStyle = CommonButtonStyles[style] || {
|
|
994
|
-
icon: style,
|
|
995
|
-
emphasis: {
|
|
996
|
-
raised: true,
|
|
997
|
-
outlined: false,
|
|
998
|
-
dense: false,
|
|
999
|
-
danger: false
|
|
1000
|
-
}
|
|
1001
|
-
};
|
|
1002
|
-
const { raised, outlined, dense, danger, icon } = btnStyle.emphasis;
|
|
1003
|
-
const template = html `
|
|
1004
|
-
<button ?dense=${dense} ?raised=${raised} ?outlined=${outlined} ?danger=${danger}>
|
|
1005
|
-
<md-icon>${icon || 'done'}</md-icon>
|
|
1006
|
-
${buttonName}
|
|
1007
|
-
</button>
|
|
1008
|
-
`;
|
|
1009
|
-
const container = document.createElement('div');
|
|
1010
|
-
render(template, container);
|
|
1011
|
-
const element = container.firstElementChild;
|
|
1012
|
-
return container.removeChild(element);
|
|
1013
|
-
}
|
|
1014
|
-
/**
|
|
1015
|
-
* @description 버튼과 연결할 핸들러를 리턴
|
|
1016
|
-
*************************************
|
|
1017
|
-
* @param {Object} pageView 화면
|
|
1018
|
-
* @param {String} type 버튼 유형 (기본, 커스텀, 그리드 버튼)
|
|
1019
|
-
* @param {String} action 버튼 명
|
|
1020
|
-
* @param {Object} logic 버튼 로직 (String || JSON)
|
|
1021
|
-
* @returns {Function} 버튼 클릭시 실행될 액션 핸들러
|
|
1022
|
-
*/
|
|
1023
|
-
static getButtonActionHandler(pageView, type, action, logic) {
|
|
1024
|
-
if (type == 'basic') {
|
|
1025
|
-
if (pageView[action]) {
|
|
1026
|
-
return pageView[action].bind(pageView);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
else if (type == 'custom') {
|
|
1030
|
-
return () => MetaUiUtil.customButtonHandler(pageView, action, logic);
|
|
1031
|
-
}
|
|
1032
|
-
// 버튼과 연결된 함수가 없습니다.
|
|
1033
|
-
return () => {
|
|
1034
|
-
UiUtil.showAlertPopup('title.warning', 'text.button_bind_func_is_not_exist', 'info', 'confirm');
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* @description 그리스트 버튼 (그리드에 추가된 버튼)에 대한 커스텀 액션 분기
|
|
1039
|
-
***************************************************************
|
|
1040
|
-
* @param {Object} pageView
|
|
1041
|
-
* @param {Object} actionInfo
|
|
1042
|
-
* @param {Object} record
|
|
1043
|
-
*/
|
|
1044
|
-
static async gristButtonHandler(pageView, actionInfo, record) {
|
|
1045
|
-
let action = ValueUtil.getParams(actionInfo, 'logic');
|
|
1046
|
-
let buttonName = ValueUtil.getParams(actionInfo, 'name');
|
|
1047
|
-
let eventType = ValueUtil.getParams(action, 'type');
|
|
1048
|
-
// 폼 팝업
|
|
1049
|
-
if (eventType === 'form') {
|
|
1050
|
-
// 상세 폼 뷰는 기본 정의된 로직으로 셋팅
|
|
1051
|
-
action.tagname = 'meta-form-element';
|
|
1052
|
-
action.location = 'pages/meta-form-element.js';
|
|
1053
|
-
action.parent_field = 'id';
|
|
1054
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, action, record);
|
|
1055
|
-
// 다른 객체로 파라미터 전달
|
|
1056
|
-
}
|
|
1057
|
-
else if (eventType === 'pass_param') {
|
|
1058
|
-
MetaUiUtil.gristButtonPassParam(pageView, action, record);
|
|
1059
|
-
// 페이지 이동
|
|
1060
|
-
}
|
|
1061
|
-
else if (eventType === 'page') {
|
|
1062
|
-
let passParams = action.param_field ? {} : record;
|
|
1063
|
-
if (action.param_field) {
|
|
1064
|
-
Object.keys(record)
|
|
1065
|
-
.filter(x => Object.keys(action.param_field).includes(x))
|
|
1066
|
-
.map(x => {
|
|
1067
|
-
if (Object.keys(action.param_field).includes(x)) {
|
|
1068
|
-
let data = record[x];
|
|
1069
|
-
passParams[action.param_field[x]] =
|
|
1070
|
-
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data;
|
|
1071
|
-
}
|
|
1072
|
-
});
|
|
1073
|
-
}
|
|
1074
|
-
UiUtil.pageNavigate(action.url, [passParams]);
|
|
1075
|
-
// 팝업 실행
|
|
1076
|
-
}
|
|
1077
|
-
else if (eventType === 'popup') {
|
|
1078
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, action, record);
|
|
1079
|
-
// 서비스 호출
|
|
1080
|
-
}
|
|
1081
|
-
else if (eventType === 'graphql') {
|
|
1082
|
-
await MetaUiUtil.commonButtonCallService(pageView, action, record, record);
|
|
1083
|
-
// 시나리오 호출
|
|
1084
|
-
}
|
|
1085
|
-
else if (eventType === 'scenario') {
|
|
1086
|
-
await MetaUiUtil.commonButtonCallScenario(pageView, buttonName, action, record);
|
|
1087
|
-
// 설정된 조건에 따라 커스텀 로직 처리
|
|
1088
|
-
}
|
|
1089
|
-
else if (eventType === 'value_reference') {
|
|
1090
|
-
await MetaUiUtil.gristButtonValueReference(pageView, action, record);
|
|
1091
|
-
// 첨부파일 다운로드 처리
|
|
1092
|
-
}
|
|
1093
|
-
else if (eventType === 'download') {
|
|
1094
|
-
MetaUiUtil.downloadFile(action, record);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
* @description 폼 화면에서의 커스텀 버튼에 대한 액션
|
|
1099
|
-
*********************************************
|
|
1100
|
-
* @param {Object} pageView
|
|
1101
|
-
* @param {String} buttonName
|
|
1102
|
-
* @param {Object} logic
|
|
1103
|
-
*/
|
|
1104
|
-
static async formScreenCustomButtonHandler(pageView, buttonName, logic) {
|
|
1105
|
-
if (ValueUtil.isEmpty(logic))
|
|
1106
|
-
return;
|
|
1107
|
-
// TODO 현재 폼 엘리먼트에 검색 폼 기능이 없으므로 추후 추가 필요 && gristButtonHandler 함수와 거의 동일하게 로직이 처리되어야 하는데 로직이 약간 다름...
|
|
1108
|
-
let formData = pageView.currentData;
|
|
1109
|
-
let eventType = ValueUtil.getParams(logic, 'type');
|
|
1110
|
-
let paramInfo = ValueUtil.getParams(logic, 'param');
|
|
1111
|
-
let params = { form: paramInfo && paramInfo.includes('form_changed') ? pageView.patchData() : formData };
|
|
1112
|
-
/**
|
|
1113
|
-
* data 정보가 있는 경우 폼 데이터로 부터 아래 구조대로 변형 처리
|
|
1114
|
-
* data: {
|
|
1115
|
-
* "id": "$id",
|
|
1116
|
-
* "name": "$name",
|
|
1117
|
-
* "description": "$description",
|
|
1118
|
-
* "activeFlag": true,
|
|
1119
|
-
* "cuFlag": "M"
|
|
1120
|
-
* }
|
|
1121
|
-
*/
|
|
1122
|
-
let dataSchema = ValueUtil.getParams(logic, 'data');
|
|
1123
|
-
// data schema (데이터 형태) 추출
|
|
1124
|
-
if (ValueUtil.isNotEmpty(dataSchema)) {
|
|
1125
|
-
params.form = ValueUtil.replaceVariableObject(dataSchema, formData);
|
|
1126
|
-
}
|
|
1127
|
-
// 페이지 이동
|
|
1128
|
-
if (eventType === 'page') {
|
|
1129
|
-
UiUtil.pageNavigate(logic.url, [params.form]);
|
|
1130
|
-
// 팝업 오픈
|
|
1131
|
-
}
|
|
1132
|
-
else if (eventType === 'popup') {
|
|
1133
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, logic, params);
|
|
1134
|
-
// 서비스 호출
|
|
1135
|
-
}
|
|
1136
|
-
else if (eventType === 'graphql') {
|
|
1137
|
-
await MetaUiUtil.commonButtonCallService(pageView, logic, params.filter, params.form);
|
|
1138
|
-
// 시나리오 호출
|
|
1139
|
-
}
|
|
1140
|
-
else if (eventType === 'scenario') {
|
|
1141
|
-
await MetaUiUtil.commonButtonCallScenario(pageView, buttonName, logic, params);
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
/**
|
|
1145
|
-
* @description 그리드 화면에서의 커스텀 버튼에 대한 액션
|
|
1146
|
-
************************************************
|
|
1147
|
-
* @param {Object} pageView 화면
|
|
1148
|
-
* @param {String} buttonName 버튼 명
|
|
1149
|
-
* @param {Object} logic 버튼 커스텀 로직 JSON
|
|
1150
|
-
*/
|
|
1151
|
-
static async gristScreenCustomButtonHandler(pageView, buttonName, logic) {
|
|
1152
|
-
var _a, _b;
|
|
1153
|
-
if (ValueUtil.isEmpty(logic))
|
|
1154
|
-
return;
|
|
1155
|
-
let grist = pageView.grist;
|
|
1156
|
-
let filterForm = pageView.filterForm;
|
|
1157
|
-
let eventType = ValueUtil.getParams(logic, 'type');
|
|
1158
|
-
let paramInfo = ValueUtil.getParams(logic, 'param');
|
|
1159
|
-
let includeGristParams = paramInfo.filter(p => p.startsWith('grist'));
|
|
1160
|
-
// 오류 메시지 처리
|
|
1161
|
-
if (ValueUtil.isNotEmpty(includeGristParams)) {
|
|
1162
|
-
// 그리스트 존재 여부
|
|
1163
|
-
if (!grist) {
|
|
1164
|
-
// 그리드가 없습니다.
|
|
1165
|
-
UiUtil.showAlertPopup('title.info', 'text.grid_is_not_exist', 'info', 'confirm');
|
|
1166
|
-
return;
|
|
1167
|
-
}
|
|
1168
|
-
// 그리스트 데이터 존재 여부 (편집중 데이터도 체크)
|
|
1169
|
-
if ((((_a = grist === null || grist === void 0 ? void 0 : grist.data) === null || _a === void 0 ? void 0 : _a.records) || []).length == 0 && (((_b = grist === null || grist === void 0 ? void 0 : grist.dirtyData) === null || _b === void 0 ? void 0 : _b.records) || []).length == 0) {
|
|
1170
|
-
// 비어있는 그리드 입니다.
|
|
1171
|
-
UiUtil.showAlertPopup('title.info', 'text.grid_data_is_empty', 'info', 'confirm');
|
|
1172
|
-
return;
|
|
1173
|
-
}
|
|
1174
|
-
if (paramInfo.includes('grist_one') || paramInfo.includes('grist_selected')) {
|
|
1175
|
-
// 선택된 행이 있는지 확인
|
|
1176
|
-
let selectedRows = grist.selected;
|
|
1177
|
-
if (ValueUtil.isEmpty(selectedRows)) {
|
|
1178
|
-
// 선택된 항목이 없습니다.
|
|
1179
|
-
UiUtil.showAlertPopup('text.nothing_selected', 'text.there_is_no_selected_items', 'info', 'confirm');
|
|
1180
|
-
return;
|
|
1181
|
-
}
|
|
1182
|
-
if (paramInfo.includes('grist_one')) {
|
|
1183
|
-
// 하나의 행만 선택 되었는지 확인
|
|
1184
|
-
if (selectedRows.length > 1) {
|
|
1185
|
-
// 하나의 항목만 선택해주세요.
|
|
1186
|
-
UiUtil.showAlertPopup('title.info', 'text.please_select_only_one', 'info', 'confirm');
|
|
1187
|
-
return;
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
let params = {};
|
|
1193
|
-
if (paramInfo.includes('filter')) {
|
|
1194
|
-
if (!filterForm) {
|
|
1195
|
-
// 서치폼이 없습니다.
|
|
1196
|
-
UiUtil.showAlertPopup('title.info', 'text.search_form_is_not_exist', 'info', 'confirm');
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
let filterValues = filterForm ? await filterForm.getQueryFilters() : [];
|
|
1200
|
-
params['filter'] = filterValues;
|
|
1201
|
-
}
|
|
1202
|
-
if (paramInfo.includes('grist_all')) {
|
|
1203
|
-
params['grist'] = grist.data.records;
|
|
1204
|
-
}
|
|
1205
|
-
else if (paramInfo.includes('grist_one')) {
|
|
1206
|
-
params['grist'] = grist.selected[0];
|
|
1207
|
-
}
|
|
1208
|
-
else if (paramInfo.includes('grist_selected')) {
|
|
1209
|
-
params['grist'] = grist.selected;
|
|
1210
|
-
}
|
|
1211
|
-
else if (paramInfo.includes('grist_changed')) {
|
|
1212
|
-
let changedList = ServiceUtil.patchesForUpdateMultiple(grist);
|
|
1213
|
-
if (!changedList) {
|
|
1214
|
-
return;
|
|
1215
|
-
}
|
|
1216
|
-
// 화면이 팝업 화면이라면 부모 ID를 레코드에 추가한다.
|
|
1217
|
-
let pId = pageView.parent_id ? pageView.parent_id : null;
|
|
1218
|
-
let parentIdField = ValueUtil.getParams(logic, 'parent_field');
|
|
1219
|
-
changedList.forEach(item => {
|
|
1220
|
-
if (pId && parentIdField && !item[parentIdField]) {
|
|
1221
|
-
item[parentIdField] = pId;
|
|
1222
|
-
}
|
|
1223
|
-
});
|
|
1224
|
-
params['grist'] = changedList;
|
|
1225
|
-
}
|
|
1226
|
-
// 페이지 이동
|
|
1227
|
-
if (eventType === 'page') {
|
|
1228
|
-
let records = Array.isArray(params['grist']) ? params['grist'] : [params['grist']];
|
|
1229
|
-
let passParams = logic.param_field ? null : records;
|
|
1230
|
-
if (logic.param_field) {
|
|
1231
|
-
passParams = records.map(record => {
|
|
1232
|
-
let recordParams = {};
|
|
1233
|
-
Object.keys(record)
|
|
1234
|
-
.filter(x => Object.keys(logic.param_field).includes(x))
|
|
1235
|
-
.map(x => {
|
|
1236
|
-
if (Object.keys(logic.param_field).includes(x)) {
|
|
1237
|
-
let data = record[x];
|
|
1238
|
-
recordParams[logic.param_field[x]] =
|
|
1239
|
-
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data;
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
return recordParams;
|
|
1243
|
-
});
|
|
1244
|
-
}
|
|
1245
|
-
UiUtil.pageNavigate(logic.url, passParams);
|
|
1246
|
-
// 팝업 오픈
|
|
1247
|
-
}
|
|
1248
|
-
else if (eventType === 'popup') {
|
|
1249
|
-
let convParam = Object.assign(Object.assign({}, (params['grist'] ? params['grist'] : {})), (params['filter'] ? params['filter'] : {}));
|
|
1250
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, logic, convParam);
|
|
1251
|
-
// 서비스 호출
|
|
1252
|
-
}
|
|
1253
|
-
else if (eventType === 'graphql') {
|
|
1254
|
-
let filterParam = params['filter'] ? params['filter'] : {};
|
|
1255
|
-
let dataParams = params['grist'] ? params['grist'] : filterParam;
|
|
1256
|
-
await MetaUiUtil.commonButtonCallService(pageView, logic, filterParam, dataParams);
|
|
1257
|
-
// 시나리오 호출
|
|
1258
|
-
}
|
|
1259
|
-
else if (eventType === 'scenario') {
|
|
1260
|
-
await MetaUiUtil.commonButtonCallScenario(pageView, buttonName, logic, params);
|
|
1261
|
-
// 첨부파일 다운로드 처리
|
|
1262
|
-
}
|
|
1263
|
-
else if (eventType == 'download' && paramInfo.includes('grist_one')) {
|
|
1264
|
-
MetaUiUtil.downloadFile(logic, params['grist']);
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
/**
|
|
1268
|
-
* @description 커스텀 버튼에 대한 액션 처리
|
|
1269
|
-
**************************************
|
|
1270
|
-
* @param {Object} pageView 화면
|
|
1271
|
-
* @param {String} buttonName 버튼 명
|
|
1272
|
-
* @param {Object} logic 커스텀 버튼 로직 JSON
|
|
1273
|
-
*/
|
|
1274
|
-
static async customButtonHandler(pageView, buttonName, logic) {
|
|
1275
|
-
// 폼 화면의 버튼 핸들링인지 그리드 계열 화면의 버튼 핸들링 인지 구분
|
|
1276
|
-
if (pageView.localName.startsWith('meta-form')) {
|
|
1277
|
-
await MetaUiUtil.formScreenCustomButtonHandler(pageView, buttonName, logic);
|
|
1278
|
-
}
|
|
1279
|
-
else {
|
|
1280
|
-
await MetaUiUtil.gristScreenCustomButtonHandler(pageView, buttonName, logic);
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* @description 파라미터 전달 버튼 처리
|
|
1285
|
-
**********************************
|
|
1286
|
-
* @param {Object} pageView
|
|
1287
|
-
* @param {Object} action
|
|
1288
|
-
* @param {Object} record
|
|
1289
|
-
*/
|
|
1290
|
-
static gristButtonPassParam(pageView, action, record) {
|
|
1291
|
-
// 파라미터 전달 정보
|
|
1292
|
-
let passInfoAll = action.pass_field;
|
|
1293
|
-
let elementTagName = pageView.tagName.toLowerCase();
|
|
1294
|
-
let pageElement = pageView;
|
|
1295
|
-
let passInfo = elementTagName.startsWith('meta-grist-tab-') || elementTagName.startsWith('meta-master-detail-')
|
|
1296
|
-
? passInfoAll.detail
|
|
1297
|
-
? Object.assign({}, passInfoAll) : { detail: Object.assign({}, passInfoAll) }
|
|
1298
|
-
: Object.assign({}, passInfoAll); // tab+tab or tab+etc or main-tab
|
|
1299
|
-
Object.keys(passInfo).forEach(tab => {
|
|
1300
|
-
if (tab == 'master') {
|
|
1301
|
-
pageElement = pageView.rootElement.masterElement;
|
|
1302
|
-
}
|
|
1303
|
-
else if (tab == 'detail') {
|
|
1304
|
-
pageElement = pageView.rootElement ? pageView.rootElement.detailElement : pageView.detailElement;
|
|
1305
|
-
}
|
|
1306
|
-
else if (tab == 'self') {
|
|
1307
|
-
pageElement = pageView;
|
|
1308
|
-
}
|
|
1309
|
-
if (pageElement) {
|
|
1310
|
-
if (pageElement.tagName.toLowerCase().startsWith('meta-tab-element')) {
|
|
1311
|
-
// Object Key로 Element 검색.
|
|
1312
|
-
Object.keys(passInfo[tab]).forEach(elementId => {
|
|
1313
|
-
let targetElement = pageElement.shadowRoot.querySelector(`#${elementId}`);
|
|
1314
|
-
// 상위 데이터 ID
|
|
1315
|
-
if (record.id) {
|
|
1316
|
-
targetElement.setParentId(record.id);
|
|
1317
|
-
}
|
|
1318
|
-
// 대상 엘리먼트에 매치할 필드 정보
|
|
1319
|
-
let matchInfo = passInfo[tab][elementId];
|
|
1320
|
-
// 필드 정보 Loop tField : target , sField : source
|
|
1321
|
-
Object.keys(matchInfo).forEach(tField => {
|
|
1322
|
-
let sField = matchInfo[tField];
|
|
1323
|
-
// param 값이 * 이면 record 전체
|
|
1324
|
-
let param = sField === '*' ? record : record[sField];
|
|
1325
|
-
// tElement.tField에 파라미터 set
|
|
1326
|
-
targetElement[tField] = param;
|
|
1327
|
-
});
|
|
1328
|
-
});
|
|
1329
|
-
}
|
|
1330
|
-
else {
|
|
1331
|
-
let targetElement = pageElement;
|
|
1332
|
-
// 상위 데이터 ID
|
|
1333
|
-
if (record.id) {
|
|
1334
|
-
targetElement.setParentId(record.id);
|
|
1335
|
-
}
|
|
1336
|
-
// 대상 엘리먼트에 매치할 필드 정보
|
|
1337
|
-
let matchInfo = passInfo[tab];
|
|
1338
|
-
// 필드 정보 Loop tField : target , sField : source
|
|
1339
|
-
Object.keys(matchInfo).forEach(tField => {
|
|
1340
|
-
let sField = matchInfo[tField];
|
|
1341
|
-
// param 값이 * 이면 record 전체
|
|
1342
|
-
let param = sField === '*' ? record : record[sField];
|
|
1343
|
-
// tElement.tField에 파라미터 set
|
|
1344
|
-
targetElement[tField] = param;
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
/**
|
|
1351
|
-
* @description 팝업 오픈 버튼 처리
|
|
1352
|
-
********************************
|
|
1353
|
-
* @param {Object} pageView
|
|
1354
|
-
* @param {Object} action
|
|
1355
|
-
* @param {Object} record
|
|
1356
|
-
*/
|
|
1357
|
-
static async commonButtonOpenPopup(pageView, action, record) {
|
|
1358
|
-
// 타이틀 변환
|
|
1359
|
-
let title = TermsUtil.tTitle(action.title);
|
|
1360
|
-
// 타이틀 상세 필드 정의 확인
|
|
1361
|
-
if (ValueUtil.isNotEmpty(action.title_detail)) {
|
|
1362
|
-
title = `${title}(${ValueUtil.getParams(record, ...action.title_detail.split('.'))})`;
|
|
1363
|
-
}
|
|
1364
|
-
// closeCallback
|
|
1365
|
-
let closeCallback = action.after && typeof action.after === 'string' && action.after === 'fetch' && pageView && pageView.fetch
|
|
1366
|
-
? pageView.fetch.bind(pageView)
|
|
1367
|
-
: undefined;
|
|
1368
|
-
// 팝업 오픈
|
|
1369
|
-
UiUtil.openDynamicPopup(title, action, record, closeCallback);
|
|
1370
|
-
}
|
|
1371
|
-
/**
|
|
1372
|
-
* @description 서비스 호출 버튼 처리
|
|
1373
|
-
*************************************
|
|
1374
|
-
* @param {Object} pageView 페이지 뷰
|
|
1375
|
-
* @param {Object} action 액션
|
|
1376
|
-
* @param {Object or Array} filterParam 필터 파라미터
|
|
1377
|
-
* @param {Object or Array} records 선택 레코드
|
|
1378
|
-
*/
|
|
1379
|
-
static async commonButtonCallService(pageView, action, filterParam, records) {
|
|
1380
|
-
// Graphql 서비스 호출
|
|
1381
|
-
let response = await ServiceUtil.callService(pageView, action, filterParam, records);
|
|
1382
|
-
// 후 처리 액션 처리
|
|
1383
|
-
if (!response.errors && action.after && ValueUtil.isNotEmpty(action.after)) {
|
|
1384
|
-
let afterParams = null;
|
|
1385
|
-
if (typeof action.after === 'object') {
|
|
1386
|
-
afterParams = Array.isArray(response) ? response : [response];
|
|
1387
|
-
}
|
|
1388
|
-
await MetaUiUtil.afterActionHandler(pageView, action, afterParams);
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
/**
|
|
1392
|
-
* @description 시나리오 호출 버튼 처리
|
|
1393
|
-
***********************************
|
|
1394
|
-
* @param {Object} pageView
|
|
1395
|
-
* @param {String} buttonName
|
|
1396
|
-
* @param {Object} action
|
|
1397
|
-
* @param {Object or Array} params
|
|
1398
|
-
*/
|
|
1399
|
-
static async commonButtonCallScenario(pageView, buttonName, action, params) {
|
|
1400
|
-
// 시나리오 호출
|
|
1401
|
-
let response = await ServiceUtil.callScenario(buttonName, action.name, params);
|
|
1402
|
-
// 처리 중 에러가 발생했거나 시나리오 호출 후 처리가 없으면 return
|
|
1403
|
-
if (!response.errors && action.after && ValueUtil.isNotEmpty(action.after)) {
|
|
1404
|
-
let afterParams = null;
|
|
1405
|
-
// after가 오브젝트이면 후 처리 로직
|
|
1406
|
-
if (typeof action.after === 'object') {
|
|
1407
|
-
let after = action.after;
|
|
1408
|
-
afterParams = ValueUtil.getParams(response.data.runScenario.result, ...after.result_name.split('.'));
|
|
1409
|
-
if (Array.isArray(afterParams) == false) {
|
|
1410
|
-
afterParams = [afterParams];
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
// 후 처리 처리
|
|
1414
|
-
await MetaUiUtil.afterActionHandler(pageView, action, afterParams);
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* @description 버튼 처리 후 처리
|
|
1419
|
-
*******************************
|
|
1420
|
-
* @param {Object} pageView
|
|
1421
|
-
* @param {Object} action
|
|
1422
|
-
* @param {Object or Array} afterParams
|
|
1423
|
-
*/
|
|
1424
|
-
static async afterActionHandler(pageView, action, afterParams) {
|
|
1425
|
-
// after가 오브젝트이면 후 처리 로직
|
|
1426
|
-
if (typeof action.after === 'object') {
|
|
1427
|
-
let after = action.after;
|
|
1428
|
-
// 상세 폼 뷰 팝업 실행
|
|
1429
|
-
if (after.type === 'form') {
|
|
1430
|
-
after.tagname = 'meta-form-element';
|
|
1431
|
-
after.location = 'pages/meta-form-element.js';
|
|
1432
|
-
after.parent_field = 'id';
|
|
1433
|
-
afterParams = afterParams[0];
|
|
1434
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, after, afterParams);
|
|
1435
|
-
// 페이지 이동 처리
|
|
1436
|
-
}
|
|
1437
|
-
else if (after.type === 'page') {
|
|
1438
|
-
let records = afterParams;
|
|
1439
|
-
let passParams = after.param_field ? null : records;
|
|
1440
|
-
if (after.param_field) {
|
|
1441
|
-
passParams = records.map(record => {
|
|
1442
|
-
let recordParams = {};
|
|
1443
|
-
Object.keys(record)
|
|
1444
|
-
.filter(x => Object.keys(after.param_field).includes(x))
|
|
1445
|
-
.map(x => {
|
|
1446
|
-
if (Object.keys(after.param_field).includes(x)) {
|
|
1447
|
-
let data = record[x];
|
|
1448
|
-
recordParams[after.param_field[x]] =
|
|
1449
|
-
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data;
|
|
1450
|
-
}
|
|
1451
|
-
});
|
|
1452
|
-
return recordParams;
|
|
1453
|
-
});
|
|
1454
|
-
}
|
|
1455
|
-
UiUtil.pageNavigate(after.url, passParams);
|
|
1456
|
-
// 다른 객체로 파라미터 전달
|
|
1457
|
-
}
|
|
1458
|
-
else if (after.type === 'pass_param') {
|
|
1459
|
-
afterParams = afterParams[0];
|
|
1460
|
-
MetaUiUtil.gristButtonPassParam(pageView, after, afterParams);
|
|
1461
|
-
// 팝업 오픈
|
|
1462
|
-
}
|
|
1463
|
-
else if (after.type === 'popup') {
|
|
1464
|
-
afterParams = afterParams[0];
|
|
1465
|
-
await MetaUiUtil.commonButtonOpenPopup(pageView, after, afterParams);
|
|
1466
|
-
// 설정된 조건에 따라 커스텀 로직 처리
|
|
1467
|
-
}
|
|
1468
|
-
else if (after.type === 'value_reference') {
|
|
1469
|
-
afterParams = afterParams[0];
|
|
1470
|
-
await MetaUiUtil.gristButtonValueReference(pageView, after, afterParams);
|
|
1471
|
-
}
|
|
1472
|
-
// after가 fetch이면 리프레쉬
|
|
1473
|
-
}
|
|
1474
|
-
else if (action.after === 'fetch') {
|
|
1475
|
-
pageView.fetch();
|
|
1476
|
-
// after가 close이면 팝업 닫기
|
|
1477
|
-
}
|
|
1478
|
-
else if (action.after == 'close') {
|
|
1479
|
-
UiUtil.closePopupBy(pageView);
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
/**
|
|
1483
|
-
* @description UI에서 파일 다운로드 처리
|
|
1484
|
-
*************************************
|
|
1485
|
-
* @param {Object} config 설정
|
|
1486
|
-
* @param {Object} record 레코드
|
|
1487
|
-
*/
|
|
1488
|
-
static downloadFile(config, record) {
|
|
1489
|
-
let attachmentRoot = config.attachment_root;
|
|
1490
|
-
let attachColumn = config.attachment_column;
|
|
1491
|
-
let downloadColumn = config.download_name_column ? config.download_name_column : null;
|
|
1492
|
-
if (!attachColumn) {
|
|
1493
|
-
throw new Error('attachmentColumn 정보가 없습니다.');
|
|
1494
|
-
}
|
|
1495
|
-
let attachColumns = attachColumn.split('.');
|
|
1496
|
-
let fileData = record[attachColumns[0]];
|
|
1497
|
-
let fileName = attachColumns.length == 1 ? fileData : fileData[attachColumns[1]];
|
|
1498
|
-
let downloadName = downloadColumn ? record[downloadColumn] : fileName;
|
|
1499
|
-
const link = document.createElement('a');
|
|
1500
|
-
link.setAttribute('href', `./${attachmentRoot}/${fileName}`);
|
|
1501
|
-
link.setAttribute('download', downloadName);
|
|
1502
|
-
document.body.appendChild(link);
|
|
1503
|
-
link.click();
|
|
1504
|
-
link.parentNode.removeChild(link);
|
|
1505
|
-
}
|
|
1506
|
-
/**
|
|
1507
|
-
* @description 설정된 조건과 record 의 값을 비교. 로직 처리
|
|
1508
|
-
****************************************************
|
|
1509
|
-
* @param {Object} pageView
|
|
1510
|
-
* @param {Object} config
|
|
1511
|
-
* @param {Object} record
|
|
1512
|
-
*/
|
|
1513
|
-
static async gristButtonValueReference(pageView, config, record) {
|
|
1514
|
-
// 지정된 조건 Loop
|
|
1515
|
-
for (let idx = 0; idx < config.relation.length; idx++) {
|
|
1516
|
-
let relation = config.relation[idx];
|
|
1517
|
-
let useRelation = ValueUtil.compareObjectValues(relation, record, Object.keys(relation).filter(key => key != 'logic'));
|
|
1518
|
-
if (useRelation === true) {
|
|
1519
|
-
// 조건 체크 후 버튼 핸들러 호출
|
|
1520
|
-
await MetaUiUtil.gristButtonHandler(pageView, relation, record);
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
/**
|
|
1525
|
-
* @description 그리스트 Hidden 컬럼 설정
|
|
1526
|
-
*************************************
|
|
1527
|
-
* @param {String} type
|
|
1528
|
-
* @param {String} name
|
|
1529
|
-
* @returns {Object} 그리스트 Hidden 컬럼 설정
|
|
1530
|
-
*/
|
|
1531
|
-
static getGristHiddenColumnConfig(type, name) {
|
|
1532
|
-
return {
|
|
1533
|
-
type: type,
|
|
1534
|
-
name: name,
|
|
1535
|
-
sortable: false,
|
|
1536
|
-
hidden: true
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
/**
|
|
1540
|
-
* @description 그리스트 기본 컬럼 설정
|
|
1541
|
-
***********************************
|
|
1542
|
-
* @param {String} type
|
|
1543
|
-
* @param {String} name
|
|
1544
|
-
* @param {String} align
|
|
1545
|
-
* @param {Boolean} editable
|
|
1546
|
-
* @param {Boolean} sortable
|
|
1547
|
-
* @param {Number} width
|
|
1548
|
-
* @returns {Object} 그리스트 기본 컬럼 설정
|
|
1549
|
-
*/
|
|
1550
|
-
static getGristColumnConfig(type, name, align, editable, sortable, width) {
|
|
1551
|
-
let dispName = TermsUtil.tLabel(name);
|
|
1552
|
-
return {
|
|
1553
|
-
type: type,
|
|
1554
|
-
name: name,
|
|
1555
|
-
header: dispName,
|
|
1556
|
-
record: {
|
|
1557
|
-
align: align,
|
|
1558
|
-
editable: editable
|
|
1559
|
-
},
|
|
1560
|
-
sortable: sortable,
|
|
1561
|
-
width: width,
|
|
1562
|
-
imex: {
|
|
1563
|
-
width: Math.floor(width / 6),
|
|
1564
|
-
header: dispName,
|
|
1565
|
-
type: type,
|
|
1566
|
-
key: name
|
|
1567
|
-
}
|
|
1568
|
-
};
|
|
1569
|
-
}
|
|
1570
|
-
/**
|
|
1571
|
-
* @description 그리스트 컬럼 설정
|
|
1572
|
-
*******************************
|
|
1573
|
-
* @param {String} type
|
|
1574
|
-
* @param {String} name
|
|
1575
|
-
* @param {String} displayName
|
|
1576
|
-
* @param {String} align
|
|
1577
|
-
* @param {Boolean} editable
|
|
1578
|
-
* @param {Boolean} sortable
|
|
1579
|
-
* @param {Number} width
|
|
1580
|
-
* @returns {Object} 그리스트 기본 컬럼 설정
|
|
1581
|
-
*/
|
|
1582
|
-
static getGristColumnConfig2(type, name, displayName, align, editable, sortable, width) {
|
|
1583
|
-
let dispName = TermsUtil.tLabel(displayName);
|
|
1584
|
-
return {
|
|
1585
|
-
type: type,
|
|
1586
|
-
name: name,
|
|
1587
|
-
header: dispName,
|
|
1588
|
-
record: {
|
|
1589
|
-
align: align,
|
|
1590
|
-
editable: editable
|
|
1591
|
-
},
|
|
1592
|
-
sortable: sortable,
|
|
1593
|
-
width: width,
|
|
1594
|
-
imex: {
|
|
1595
|
-
width: Math.floor(width / 6),
|
|
1596
|
-
header: dispName,
|
|
1597
|
-
type: type,
|
|
1598
|
-
key: name
|
|
1599
|
-
}
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
/**
|
|
1603
|
-
* @description 그리스트 컬럼 설정
|
|
1604
|
-
*******************************
|
|
1605
|
-
* @param {String} type
|
|
1606
|
-
* @param {String} name
|
|
1607
|
-
* @param {String} displayName
|
|
1608
|
-
* @param {String} align
|
|
1609
|
-
* @param {Boolean} editable
|
|
1610
|
-
* @param {Boolean} sortable
|
|
1611
|
-
* @param {Boolean} mandatory
|
|
1612
|
-
* @param {Number} width
|
|
1613
|
-
* @returns {Object} 그리스트 기본 컬럼 설정
|
|
1614
|
-
*/
|
|
1615
|
-
static getGristColumnConfig3(type, name, displayName, align, editable, sortable, mandatory, width) {
|
|
1616
|
-
let dispName = TermsUtil.tLabel(displayName);
|
|
1617
|
-
return {
|
|
1618
|
-
type: type,
|
|
1619
|
-
name: name,
|
|
1620
|
-
header: dispName,
|
|
1621
|
-
record: {
|
|
1622
|
-
align: align,
|
|
1623
|
-
editable: editable,
|
|
1624
|
-
mandatory: mandatory
|
|
1625
|
-
},
|
|
1626
|
-
sortable: sortable,
|
|
1627
|
-
width: width,
|
|
1628
|
-
imex: {
|
|
1629
|
-
width: Math.floor(width / 6),
|
|
1630
|
-
header: dispName,
|
|
1631
|
-
type: type,
|
|
1632
|
-
key: name
|
|
1633
|
-
}
|
|
1634
|
-
};
|
|
1635
|
-
}
|
|
1636
|
-
/**
|
|
1637
|
-
* @description 그리스트 Selector 컬럼 설정
|
|
1638
|
-
***************************************
|
|
1639
|
-
* @param {String} name
|
|
1640
|
-
* @param {String} displayName
|
|
1641
|
-
* @param {String} align
|
|
1642
|
-
* @param {Boolean} sortable
|
|
1643
|
-
* @param {Number} width
|
|
1644
|
-
* @param {Boolean} mandatory
|
|
1645
|
-
* @param {Array} optionValues
|
|
1646
|
-
* @returns {Object} 그리스트 기본 컬럼 설정
|
|
1647
|
-
*/
|
|
1648
|
-
static getGristSelectorColumnConfig(name, displayName, align, sortable, width, mandatory, optionValues) {
|
|
1649
|
-
let dispName = TermsUtil.tLabel(displayName);
|
|
1650
|
-
return {
|
|
1651
|
-
type: 'select',
|
|
1652
|
-
name: name,
|
|
1653
|
-
header: dispName,
|
|
1654
|
-
record: {
|
|
1655
|
-
align: align,
|
|
1656
|
-
editable: true,
|
|
1657
|
-
mandatory: mandatory,
|
|
1658
|
-
options: optionValues
|
|
1659
|
-
},
|
|
1660
|
-
sortable: sortable,
|
|
1661
|
-
width: width,
|
|
1662
|
-
imex: {
|
|
1663
|
-
width: Math.floor(width / 6),
|
|
1664
|
-
header: dispName,
|
|
1665
|
-
type: 'string',
|
|
1666
|
-
key: name
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1670
|
-
/**
|
|
1671
|
-
* @description 그리스트 Code Selector 컬럼 설정
|
|
1672
|
-
********************************************
|
|
1673
|
-
* @param {String} name
|
|
1674
|
-
* @param {String} displayName
|
|
1675
|
-
* @param {String} align
|
|
1676
|
-
* @param {Boolean} sortable
|
|
1677
|
-
* @param {Number} width
|
|
1678
|
-
* @param {Boolean} mandatory
|
|
1679
|
-
* @param {String} codeName
|
|
1680
|
-
* @returns {Object} 그리스트 기본 컬럼 설정
|
|
1681
|
-
*/
|
|
1682
|
-
static async getGristCodeSelectorColumnConfig(name, displayName, align, sortable, width, mandatory, codeName) {
|
|
1683
|
-
let optionValue = await ServiceUtil.getCodeSelectorData(codeName);
|
|
1684
|
-
return MetaUiUtil.getGristSelectorColumnConfig(name, displayName, align, sortable, width, mandatory, optionValue);
|
|
1685
|
-
}
|
|
1686
|
-
/**
|
|
1687
|
-
* @description 그리스트 검색 편집기 설정
|
|
1688
|
-
************************************
|
|
1689
|
-
* @param {String} name
|
|
1690
|
-
* @param {String} type
|
|
1691
|
-
* @param {String} label
|
|
1692
|
-
* @param {String} operator
|
|
1693
|
-
* @param {Array} optionValues
|
|
1694
|
-
* @returns {Object} 그리스트 검색 편집기 설정
|
|
1695
|
-
*/
|
|
1696
|
-
static getGristSearchColumnConfig(name, type, label, operator, optionValues) {
|
|
1697
|
-
let dispName = TermsUtil.tLabel(label);
|
|
1698
|
-
let column = {
|
|
1699
|
-
name: name,
|
|
1700
|
-
type: type,
|
|
1701
|
-
label: dispName,
|
|
1702
|
-
operator: operator,
|
|
1703
|
-
imex: {
|
|
1704
|
-
width: 16,
|
|
1705
|
-
header: dispName,
|
|
1706
|
-
type: type,
|
|
1707
|
-
key: name
|
|
1708
|
-
}
|
|
1709
|
-
};
|
|
1710
|
-
if (optionValues) {
|
|
1711
|
-
column.options = optionValues;
|
|
1712
|
-
}
|
|
1713
|
-
return column;
|
|
1714
|
-
}
|
|
1715
|
-
/**
|
|
1716
|
-
* @description 그리스트 검색 코드 편집기 설정
|
|
1717
|
-
***************************************
|
|
1718
|
-
* @param {String} name 검색 필드 명
|
|
1719
|
-
* @param {String} type 검색 편집기 유형
|
|
1720
|
-
* @param {String} label 검색 필드 라벨명
|
|
1721
|
-
* @param {String} operator 검색 연산자
|
|
1722
|
-
* @param {String} codeName 코드 이름
|
|
1723
|
-
* @returns {Object} 그리스트 검색 코드 편집기 설정
|
|
1724
|
-
*/
|
|
1725
|
-
static async getGristSearchCodeColumnConfig(name, type, label, operator, codeName) {
|
|
1726
|
-
let optionValues = await ServiceUtil.getCodeSelectorData(codeName);
|
|
1727
|
-
return MetaUiUtil.getGristSearchColumnConfig(name, type, label, operator, optionValues);
|
|
1728
|
-
}
|
|
1729
|
-
/**
|
|
1730
|
-
* @description 기본 컨텍스트 버튼이 아닌 커스텀 버튼 컨테이너 스타일
|
|
1731
|
-
*********************************************************
|
|
1732
|
-
* @returns {Array} 커스텀 버튼 컨테이너 CSS 리턴
|
|
1733
|
-
*/
|
|
1734
|
-
static getCustomButtonContainerStyles() {
|
|
1735
|
-
return [ButtonContainerStyles];
|
|
1736
|
-
}
|
|
1737
|
-
/**
|
|
1738
|
-
* @description 그리스트 강조 스타일 리턴
|
|
1739
|
-
************************************
|
|
1740
|
-
* @returns {Array} 그리스트 강조 스타일 CSS
|
|
1741
|
-
*/
|
|
1742
|
-
static getGristEmphasizedStyles() {
|
|
1743
|
-
return [
|
|
1744
|
-
css `
|
|
1745
|
-
:host {
|
|
1746
|
-
--grid-record-emphasized-background-color: red;
|
|
1747
|
-
--grid-record-emphasized-color: yellow;
|
|
1748
|
-
}
|
|
1749
|
-
`
|
|
1750
|
-
];
|
|
1751
|
-
}
|
|
1752
|
-
/**
|
|
1753
|
-
* @description 기본 그리스트 스타일 리턴
|
|
1754
|
-
************************************
|
|
1755
|
-
* @returns {Array} 기본 그리스트 스타일 CSS 리턴
|
|
1756
|
-
*/
|
|
1757
|
-
static getBasicGristStyles() {
|
|
1758
|
-
return [
|
|
1759
|
-
ScrollbarStyles,
|
|
1760
|
-
CommonGristStyles,
|
|
1761
|
-
CommonHeaderStyles,
|
|
1762
|
-
css `
|
|
1763
|
-
:host {
|
|
1764
|
-
display: flex;
|
|
1765
|
-
flex-direction: column;
|
|
1766
|
-
overflow-x: overlay;
|
|
1767
|
-
background-color: var(--md-sys-color-background);
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
ox-grist {
|
|
1771
|
-
overflow-y: auto;
|
|
1772
|
-
flex: 1;
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
ox-filters-form {
|
|
1776
|
-
flex: 1;
|
|
1777
|
-
}
|
|
1778
|
-
`,
|
|
1779
|
-
...MetaUiUtil.getGristEmphasizedStyles(),
|
|
1780
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
1781
|
-
];
|
|
1782
|
-
}
|
|
1783
|
-
/**
|
|
1784
|
-
* @description 기본 그리스트 탭 스타일 리턴
|
|
1785
|
-
**************************************
|
|
1786
|
-
* @returns {Array} 기본 그리스트 탭 스타일 CSS 리턴
|
|
1787
|
-
*/
|
|
1788
|
-
static getBasicGristTabStyles() {
|
|
1789
|
-
return [
|
|
1790
|
-
ScrollbarStyles,
|
|
1791
|
-
CommonGristStyles,
|
|
1792
|
-
CommonHeaderStyles,
|
|
1793
|
-
css `
|
|
1794
|
-
:host {
|
|
1795
|
-
display: flex;
|
|
1796
|
-
flex-direction: column;
|
|
1797
|
-
overflow-x: overlay;
|
|
1798
|
-
background-color: var(--md-sys-color-background);
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
.container {
|
|
1802
|
-
flex: 1;
|
|
1803
|
-
display: grid;
|
|
1804
|
-
overflow: hidden;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
.container_detail {
|
|
1808
|
-
background-color: var(--md-sys-color-background);
|
|
1809
|
-
display: flex;
|
|
1810
|
-
flex-direction: column;
|
|
1811
|
-
flex: 1;
|
|
1812
|
-
overflow-y: auto;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
h2 {
|
|
1816
|
-
padding: var(--subtitle-padding);
|
|
1817
|
-
font: var(--subtitle-font);
|
|
1818
|
-
color: var(--subtitle-text-color);
|
|
1819
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
.container_detail h2 {
|
|
1823
|
-
margin: var(--grist-title-margin);
|
|
1824
|
-
border: var(--grist-title-border);
|
|
1825
|
-
font: var(--grist-title-font);
|
|
1826
|
-
color: var(--md-sys-color-secondary);
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
.container_detail h2 md-icon {
|
|
1830
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
1831
|
-
vertical-align: middle;
|
|
1832
|
-
margin: var(--grist-title-icon-margin);
|
|
1833
|
-
color: var(--grist-title-icon-color);
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
h2 {
|
|
1837
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
ox-grist {
|
|
1841
|
-
overflow-y: auto;
|
|
1842
|
-
flex: 1;
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
ox-filters-form {
|
|
1846
|
-
flex: 1;
|
|
1847
|
-
}
|
|
1848
|
-
`,
|
|
1849
|
-
...MetaUiUtil.getGristEmphasizedStyles(),
|
|
1850
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
1851
|
-
];
|
|
1852
|
-
}
|
|
1853
|
-
/**
|
|
1854
|
-
* @description 기본 마스터 디테일 스타일 리턴
|
|
1855
|
-
****************************************
|
|
1856
|
-
* @returns {Array} 기본 마스터 디테일 스타일 CSS 리턴
|
|
1857
|
-
*/
|
|
1858
|
-
static getBasicMasterDetailStyles() {
|
|
1859
|
-
return [
|
|
1860
|
-
ScrollbarStyles,
|
|
1861
|
-
CommonGristStyles,
|
|
1862
|
-
CommonHeaderStyles,
|
|
1863
|
-
css `
|
|
1864
|
-
:host {
|
|
1865
|
-
display: flex;
|
|
1866
|
-
flex-direction: column;
|
|
1867
|
-
overflow-x: overlay;
|
|
1868
|
-
background-color: var(--md-sys-color-background);
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
.container {
|
|
1872
|
-
flex: 1;
|
|
1873
|
-
display: grid;
|
|
1874
|
-
overflow: hidden;
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
.container_detail {
|
|
1878
|
-
background-color: var(--md-sys-color-background);
|
|
1879
|
-
display: flex;
|
|
1880
|
-
flex-direction: column;
|
|
1881
|
-
flex: 1;
|
|
1882
|
-
overflow-y: auto;
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
h2 {
|
|
1886
|
-
padding: var(--subtitle-padding);
|
|
1887
|
-
font: var(--subtitle-font);
|
|
1888
|
-
color: var(--subtitle-text-color);
|
|
1889
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
.container_detail h2 {
|
|
1893
|
-
margin: var(--grist-title-margin);
|
|
1894
|
-
border: var(--grist-title-border);
|
|
1895
|
-
font: var(--grist-title-font);
|
|
1896
|
-
color: var(--md-sys-color-secondary);
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
.container_detail h2 md-icon {
|
|
1900
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
1901
|
-
vertical-align: middle;
|
|
1902
|
-
margin: var(--grist-title-icon-margin);
|
|
1903
|
-
color: var(--grist-title-icon-color);
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
h2 {
|
|
1907
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
ox-grist {
|
|
1911
|
-
overflow-y: auto;
|
|
1912
|
-
flex: 1;
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
ox-filters-form {
|
|
1916
|
-
flex: 1;
|
|
1917
|
-
}
|
|
1918
|
-
`,
|
|
1919
|
-
...MetaUiUtil.getGristEmphasizedStyles(),
|
|
1920
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
1921
|
-
];
|
|
1922
|
-
}
|
|
1923
|
-
/**
|
|
1924
|
-
* @description 기본 TAB 디테일 스타일 리턴
|
|
1925
|
-
**************************************
|
|
1926
|
-
* @returns {Array} 기본 TAB 디테일 스타일 CSS 리턴
|
|
1927
|
-
*/
|
|
1928
|
-
static getBasicTabDetailStyles() {
|
|
1929
|
-
return [
|
|
1930
|
-
ScrollbarStyles,
|
|
1931
|
-
CommonGristStyles,
|
|
1932
|
-
CommonHeaderStyles,
|
|
1933
|
-
css `
|
|
1934
|
-
:host {
|
|
1935
|
-
display: flex;
|
|
1936
|
-
flex-direction: column;
|
|
1937
|
-
overflow-x: overlay;
|
|
1938
|
-
background-color: var(--md-sys-color-background);
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
.container {
|
|
1942
|
-
flex: 1;
|
|
1943
|
-
display: grid;
|
|
1944
|
-
overflow: hidden;
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
.container_detail {
|
|
1948
|
-
background-color: var(--md-sys-color-background);
|
|
1949
|
-
display: flex;
|
|
1950
|
-
flex-direction: column;
|
|
1951
|
-
flex: 1;
|
|
1952
|
-
overflow-y: auto;
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
h2 {
|
|
1956
|
-
padding: var(--subtitle-padding);
|
|
1957
|
-
font: var(--subtitle-font);
|
|
1958
|
-
color: var(--subtitle-text-color);
|
|
1959
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
.container_detail h2 {
|
|
1963
|
-
margin: var(--grist-title-margin);
|
|
1964
|
-
border: var(--grist-title-border);
|
|
1965
|
-
font: var(--grist-title-font);
|
|
1966
|
-
color: var(--md-sys-color-secondary);
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
.container_detail h2 md-icon {
|
|
1970
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
1971
|
-
vertical-align: middle;
|
|
1972
|
-
margin: var(--grist-title-icon-margin);
|
|
1973
|
-
color: var(--grist-title-icon-color);
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
h2 {
|
|
1977
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
ox-grist {
|
|
1981
|
-
overflow-y: auto;
|
|
1982
|
-
flex: 1;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
ox-filters-form {
|
|
1986
|
-
flex: 1;
|
|
1987
|
-
}
|
|
1988
|
-
`,
|
|
1989
|
-
...MetaUiUtil.getGristEmphasizedStyles(),
|
|
1990
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
1991
|
-
];
|
|
1992
|
-
}
|
|
1993
|
-
/**
|
|
1994
|
-
* @description 기본 MAIN TAB 스타일 리턴
|
|
1995
|
-
**************************************
|
|
1996
|
-
* @returns {Array} 기본 MAIN TAB 스타일 CSS 리턴
|
|
1997
|
-
*/
|
|
1998
|
-
static getBasicMainTabStyles() {
|
|
1999
|
-
return [
|
|
2000
|
-
ScrollbarStyles,
|
|
2001
|
-
CommonGristStyles,
|
|
2002
|
-
CommonHeaderStyles,
|
|
2003
|
-
css `
|
|
2004
|
-
:host {
|
|
2005
|
-
display: flex;
|
|
2006
|
-
flex-direction: column;
|
|
2007
|
-
overflow-x: overlay;
|
|
2008
|
-
background-color: var(--md-sys-color-background);
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
.container {
|
|
2012
|
-
flex: 1;
|
|
2013
|
-
display: grid;
|
|
2014
|
-
overflow: hidden;
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
ox-grist {
|
|
2018
|
-
overflow-y: auto;
|
|
2019
|
-
flex: 1;
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
ox-filters-form {
|
|
2023
|
-
flex: 1;
|
|
2024
|
-
}
|
|
2025
|
-
`,
|
|
2026
|
-
...MetaUiUtil.getGristEmphasizedStyles(),
|
|
2027
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
2028
|
-
];
|
|
2029
|
-
}
|
|
2030
|
-
/**
|
|
2031
|
-
* @description 기본 마스터 디테일 그리스트 스타일 리턴
|
|
2032
|
-
*********************************************************
|
|
2033
|
-
* @param {String} masterDetailType top-down / left-right
|
|
2034
|
-
* @returns {Array} 마스터 디테일 그리스트 스타일 CSS
|
|
2035
|
-
*/
|
|
2036
|
-
static getBasicMasterDetailGristStyle(masterDetailType) {
|
|
2037
|
-
if (masterDetailType == 'top-down') {
|
|
2038
|
-
return MetaUiUtil.getMasterDetailTopDownGristStyle();
|
|
2039
|
-
}
|
|
2040
|
-
else {
|
|
2041
|
-
return MetaUiUtil.getMasterDetailLeftRightGristStyle();
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
/**
|
|
2045
|
-
* @description top-down 형태의 마스터 디테일 그리스트 스타일 리턴
|
|
2046
|
-
************************************************************
|
|
2047
|
-
* @returns {Array} top-down 형태의 마스터 디테일 그리스트 스타일 CSS
|
|
2048
|
-
*/
|
|
2049
|
-
static getMasterDetailTopDownGristStyle() {
|
|
2050
|
-
return [
|
|
2051
|
-
ButtonContainerStyles,
|
|
2052
|
-
CommonGristStyles,
|
|
2053
|
-
CommonHeaderStyles,
|
|
2054
|
-
ScrollbarStyles,
|
|
2055
|
-
css `
|
|
2056
|
-
:host {
|
|
2057
|
-
display: flex;
|
|
2058
|
-
flex-direction: column;
|
|
2059
|
-
overflow-x: auto;
|
|
2060
|
-
background-color: var(--md-sys-color-background);
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
|
-
.container {
|
|
2064
|
-
flex: 1;
|
|
2065
|
-
display: grid;
|
|
2066
|
-
overflow: hidden;
|
|
2067
|
-
grid-template-rows: 50% 50%;
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
|
-
.container_detail {
|
|
2071
|
-
background-color: var(--md-sys-color-background);
|
|
2072
|
-
display: flex;
|
|
2073
|
-
flex-direction: column;
|
|
2074
|
-
flex: 1;
|
|
2075
|
-
overflow-y: auto;
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
h2 {
|
|
2079
|
-
padding: var(--subtitle-padding);
|
|
2080
|
-
font: var(--subtitle-font);
|
|
2081
|
-
color: var(--subtitle-text-color);
|
|
2082
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
.container_detail h2 {
|
|
2086
|
-
margin: var(--grist-title-margin);
|
|
2087
|
-
border: var(--grist-title-border);
|
|
2088
|
-
font: var(--grist-title-font);
|
|
2089
|
-
color: var(--md-sys-color-secondary);
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
.container_detail h2 md-icon {
|
|
2093
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
2094
|
-
vertical-align: middle;
|
|
2095
|
-
margin: var(--grist-title-icon-margin);
|
|
2096
|
-
color: var(--grist-title-icon-color);
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
|
-
h2 {
|
|
2100
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
ox-grist {
|
|
2104
|
-
overflow-y: auto;
|
|
2105
|
-
flex: 1;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
ox-filters-form {
|
|
2109
|
-
flex: 1;
|
|
2110
|
-
}
|
|
2111
|
-
`
|
|
2112
|
-
];
|
|
2113
|
-
}
|
|
2114
|
-
/**
|
|
2115
|
-
* @description left-rigth 형태의 마스터 디테일 그리스트 스타일 리턴
|
|
2116
|
-
**************************************************************
|
|
2117
|
-
* @returns {Array} left-rigth 형태의 마스터 디테일 그리스트 스타일 CSS
|
|
2118
|
-
*/
|
|
2119
|
-
static getMasterDetailLeftRightGristStyle() {
|
|
2120
|
-
return [
|
|
2121
|
-
ButtonContainerStyles,
|
|
2122
|
-
CommonGristStyles,
|
|
2123
|
-
CommonHeaderStyles,
|
|
2124
|
-
ScrollbarStyles,
|
|
2125
|
-
css `
|
|
2126
|
-
:host {
|
|
2127
|
-
display: flex;
|
|
2128
|
-
flex-direction: column;
|
|
2129
|
-
overflow-x: auto;
|
|
2130
|
-
background-color: var(--md-sys-color-background);
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
.container {
|
|
2134
|
-
flex: 1;
|
|
2135
|
-
display: grid;
|
|
2136
|
-
overflow: hidden;
|
|
2137
|
-
grid-template-columns: 50% 50%;
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
.container_detail {
|
|
2141
|
-
background-color: var(--md-sys-color-background);
|
|
2142
|
-
display: flex;
|
|
2143
|
-
flex-direction: column;
|
|
2144
|
-
flex: 1;
|
|
2145
|
-
overflow-y: auto;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
h2 {
|
|
2149
|
-
padding: var(--subtitle-padding);
|
|
2150
|
-
font: var(--subtitle-font);
|
|
2151
|
-
color: var(--subtitle-text-color);
|
|
2152
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
.container_detail h2 {
|
|
2156
|
-
margin: var(--grist-title-margin);
|
|
2157
|
-
border: var(--grist-title-border);
|
|
2158
|
-
font: var(--grist-title-font);
|
|
2159
|
-
color: var(--md-sys-color-secondary);
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
.container_detail h2 md-icon {
|
|
2163
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
2164
|
-
vertical-align: middle;
|
|
2165
|
-
margin: var(--grist-title-icon-margin);
|
|
2166
|
-
color: var(--grist-title-icon-color);
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
h2 {
|
|
2170
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
ox-grist {
|
|
2174
|
-
overflow-y: auto;
|
|
2175
|
-
flex: 1;
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
ox-filters-form {
|
|
2179
|
-
flex: 1;
|
|
2180
|
-
}
|
|
2181
|
-
`
|
|
2182
|
-
];
|
|
2183
|
-
}
|
|
2184
|
-
/**
|
|
2185
|
-
* @description 기본 폼 스타일 리턴
|
|
2186
|
-
************************************
|
|
2187
|
-
* @returns {Array} 기본 폼 스타일 CSS 리턴
|
|
2188
|
-
*/
|
|
2189
|
-
static getBasicFormStyles() {
|
|
2190
|
-
return [
|
|
2191
|
-
ScrollbarStyles,
|
|
2192
|
-
CommonHeaderStyles,
|
|
2193
|
-
css `
|
|
2194
|
-
:host {
|
|
2195
|
-
display: flex;
|
|
2196
|
-
flex: 1;
|
|
2197
|
-
flex-direction: column;
|
|
2198
|
-
overflow-x: overlay;
|
|
2199
|
-
background-color: var(--md-sys-color-background);
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
.container {
|
|
2203
|
-
display: grid;
|
|
2204
|
-
grid-auto-rows: min-content;
|
|
2205
|
-
grid-gap: var(--record-view-gap);
|
|
2206
|
-
padding: var(--record-view-padding);
|
|
2207
|
-
overflow-y: auto;
|
|
2208
|
-
height: 100%;
|
|
2209
|
-
border-bottom: var(--record-view-border-bottom);
|
|
2210
|
-
}
|
|
2211
|
-
|
|
2212
|
-
.root_container {
|
|
2213
|
-
display: flex;
|
|
2214
|
-
flex: 1;
|
|
2215
|
-
flex-direction: column;
|
|
2216
|
-
padding: var(--record-view-padding);
|
|
2217
|
-
overflow-y: auto;
|
|
2218
|
-
height: 100%;
|
|
2219
|
-
border-bottom: var(--record-view-border-bottom);
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
.content_container {
|
|
2223
|
-
display: grid;
|
|
2224
|
-
grid-auto-rows: min-content;
|
|
2225
|
-
grid-gap: var(--record-view-gap);
|
|
2226
|
-
padding: var(--record-view-padding);
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
h2 {
|
|
2230
|
-
border: var(--grist-title-border);
|
|
2231
|
-
font: var(--grist-title-font);
|
|
2232
|
-
color: var(--md-sys-color-secondary);
|
|
2233
|
-
margin: var(--grist-title-margin);
|
|
2234
|
-
padding-bottom: var(--grist-title-with-grid-padding);
|
|
2235
|
-
padding-top: var(--grist-title-with-grid-padding);
|
|
2236
|
-
border-bottom: var(--subtitle-border-bottom);
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
h2 md-icon {
|
|
2240
|
-
--md-icon-size: var(--grist-title-icon-size);
|
|
2241
|
-
vertical-align: middle;
|
|
2242
|
-
margin: var(--grist-title-icon-margin);
|
|
2243
|
-
color: var(--grist-title-icon-color);
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
label {
|
|
2247
|
-
display: flex;
|
|
2248
|
-
align-items: center;
|
|
2249
|
-
position: relative;
|
|
2250
|
-
text-transform: capitalize;
|
|
2251
|
-
|
|
2252
|
-
padding: var(--record-view-item-padding);
|
|
2253
|
-
border-bottom: var(--record-view-border-bottom);
|
|
2254
|
-
font: var(--record-view-label-font);
|
|
2255
|
-
color: var(--record-view-label-color);
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
label md-icon {
|
|
2259
|
-
display: none;
|
|
2260
|
-
}
|
|
2261
|
-
|
|
2262
|
-
label[editable] md-icon {
|
|
2263
|
-
--md-icon-size: var(--record-view-label-icon-size);
|
|
2264
|
-
display: inline-block;
|
|
2265
|
-
opacity: 0.5;
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
ox-grid-field {
|
|
2269
|
-
border-top: none;
|
|
2270
|
-
border-bottom: var(--record-view-border-bottom);
|
|
2271
|
-
font: var(--record-view-font);
|
|
2272
|
-
color: var(--record-view-color);
|
|
2273
|
-
background-color: transparent;
|
|
2274
|
-
margin-right: 10px;
|
|
2275
|
-
}
|
|
2276
|
-
|
|
2277
|
-
ox-grid-field[editing='true'] {
|
|
2278
|
-
border-bottom: var(--record-view-edit-border-bottom);
|
|
2279
|
-
}
|
|
2280
|
-
`,
|
|
2281
|
-
...MetaUiUtil.getCustomButtonContainerStyles()
|
|
2282
|
-
];
|
|
2283
|
-
}
|
|
2284
|
-
/**
|
|
2285
|
-
* @description 기본 탭 스타일 리턴
|
|
2286
|
-
************************************
|
|
2287
|
-
* @returns {Array} 기본 탭 스타일 CSS 리턴
|
|
2288
|
-
*/
|
|
2289
|
-
static getBasicTabStyles() {
|
|
2290
|
-
return [
|
|
2291
|
-
css `
|
|
2292
|
-
:host {
|
|
2293
|
-
display: flex;
|
|
2294
|
-
flex: 1;
|
|
2295
|
-
flex-direction: column;
|
|
2296
|
-
overflow-x: overlay;
|
|
2297
|
-
background-color: var(--md-sys-color-background);
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
.tabs {
|
|
2301
|
-
display: flex;
|
|
2302
|
-
padding: 0 0 0 var(--spacing-medium);
|
|
2303
|
-
border-bottom: 1px solid var(--md-sys-color-primary);
|
|
2304
|
-
}
|
|
2305
|
-
|
|
2306
|
-
.tab {
|
|
2307
|
-
background-color: var(--md-sys-color-secondary-container);
|
|
2308
|
-
color: var(--md-sys-color-on-secondary-container);
|
|
2309
|
-
margin-top: var(--spacing-medium);
|
|
2310
|
-
padding: var(--spacing-small) var(--spacing-large) 0 var(--spacing-large);
|
|
2311
|
-
border-radius: 9px 9px 0 0;
|
|
2312
|
-
border-right: 1px solid rgba(0, 0, 0, 0.4);
|
|
2313
|
-
text-transform: capitalize;
|
|
2314
|
-
opacity: 0.7;
|
|
2315
|
-
font-size: 15px;
|
|
2316
|
-
cursor: pointer;
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
.tab[activate] {
|
|
2320
|
-
background-color: var(--md-sys-color-primary);
|
|
2321
|
-
color: var(--md-sys-color-on-primary);
|
|
2322
|
-
box-shadow: 2px -2px 2px 0px rgba(0, 0, 0, 0.15);
|
|
2323
|
-
opacity: 1;
|
|
2324
|
-
font-weight: bold;
|
|
2325
|
-
}
|
|
2326
|
-
|
|
2327
|
-
.tab > md-icon {
|
|
2328
|
-
width: 15px;
|
|
2329
|
-
height: 20px;
|
|
2330
|
-
padding: 0;
|
|
2331
|
-
margin: 0;
|
|
2332
|
-
--md-icon-size: 15px;
|
|
2333
|
-
vertical-align: middle;
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
.content-container {
|
|
2337
|
-
flex: 1;
|
|
2338
|
-
display: flex;
|
|
2339
|
-
flex-direction: column;
|
|
2340
|
-
background-color: var(--md-sys-color-surface);
|
|
2341
|
-
border-radius: 0 var(--border-radius) var(--border-radius) var(--border-radius);
|
|
2342
|
-
border: var(--border-dim-color);
|
|
2343
|
-
border-width: 0 1px 1px 1px;
|
|
2344
|
-
box-shadow: var(--box-shadow);
|
|
2345
|
-
overflow: auto;
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
|
-
.tab-contents {
|
|
2349
|
-
display: flex;
|
|
2350
|
-
flex: 1;
|
|
2351
|
-
flex-direction: column;
|
|
2352
|
-
overflow-x: overlay;
|
|
2353
|
-
background-color: var(--md-sys-color-background);
|
|
2354
|
-
}
|
|
2355
|
-
`
|
|
2356
|
-
];
|
|
2357
|
-
}
|
|
2358
|
-
/**
|
|
2359
|
-
* @description 그리드 설정에 버튼 이름이 buttonName인 버튼이 있는지 체크
|
|
2360
|
-
**************************************************************
|
|
2361
|
-
* @param {Object} buttonConfig 버튼 설정
|
|
2362
|
-
* @param {String} buttonName 버튼 명
|
|
2363
|
-
* @returns
|
|
2364
|
-
*/
|
|
2365
|
-
static isButtonExist(buttonConfig, buttonName) {
|
|
2366
|
-
let button = buttonConfig
|
|
2367
|
-
? buttonConfig.find(b => {
|
|
2368
|
-
return b.name == buttonName;
|
|
2369
|
-
})
|
|
2370
|
-
: null;
|
|
2371
|
-
return button ? true : false;
|
|
2372
|
-
}
|
|
2373
|
-
/**
|
|
2374
|
-
* @description 그리드 설정에 버튼 이름이 buttonName인 버튼이 있는지 체크
|
|
2375
|
-
**************************************************************
|
|
2376
|
-
* @param {Object} gridConfig 그리드 설정
|
|
2377
|
-
* @param {String} buttonName 버튼 명
|
|
2378
|
-
* @returns
|
|
2379
|
-
*/
|
|
2380
|
-
static isGridButtonExist(gridConfig, buttonName) {
|
|
2381
|
-
let button = gridConfig && gridConfig.button
|
|
2382
|
-
? gridConfig.button.find(b => {
|
|
2383
|
-
return b.name == buttonName;
|
|
2384
|
-
})
|
|
2385
|
-
: null;
|
|
2386
|
-
return button ? true : false;
|
|
2387
|
-
}
|
|
2388
|
-
/**
|
|
2389
|
-
* @description 그리드 설정에서 셀렉트 컬럼을 추출
|
|
2390
|
-
*******************************************
|
|
2391
|
-
* @param {Array} gridColumns 그리드 컬럼 설정
|
|
2392
|
-
* @returns {String} 셀렉트 필드 정보
|
|
2393
|
-
*/
|
|
2394
|
-
static getSelectColumns(gridColumns) {
|
|
2395
|
-
let fields = '';
|
|
2396
|
-
gridColumns
|
|
2397
|
-
.filter(x => x.type != 'gutter')
|
|
2398
|
-
.forEach(c => {
|
|
2399
|
-
fields += '\n';
|
|
2400
|
-
fields += ['meta-object-selector', 'object', 'resource-object'].includes(c.type)
|
|
2401
|
-
? `${c.name}\n{${MetaUiUtil.getObjctColumnSelectFields(c)}}`
|
|
2402
|
-
: c.type == 'board'
|
|
2403
|
-
? `${c.name}\n{${'\nid\nname\nthumbnail'}}`
|
|
2404
|
-
: c.name;
|
|
2405
|
-
});
|
|
2406
|
-
return fields;
|
|
2407
|
-
}
|
|
2408
|
-
/**
|
|
2409
|
-
* Object 타입의 컬럼에 대한 셀렉트 필드 추출 후 리턴
|
|
2410
|
-
********************************************
|
|
2411
|
-
* @param {Object} gridCol
|
|
2412
|
-
* @returns {String} Object 타입의 필드 문자열
|
|
2413
|
-
*/
|
|
2414
|
-
static getObjctColumnSelectFields(gridCol) {
|
|
2415
|
-
let colStr = '';
|
|
2416
|
-
if (ValueUtil.isNotEmpty(gridCol.record) &&
|
|
2417
|
-
ValueUtil.isNotEmpty(gridCol.record.options) &&
|
|
2418
|
-
ValueUtil.isNotEmpty(gridCol.record.options.select)) {
|
|
2419
|
-
// 설정에 정의가 되어 있으면
|
|
2420
|
-
gridCol.record.options.select.forEach(x => {
|
|
2421
|
-
if (x.name && x.name !== '') {
|
|
2422
|
-
if (['meta-object-selector', 'object', 'resource-object'].includes(x.type)) {
|
|
2423
|
-
colStr += `\n${x.name} { ${MetaUiUtil.getObjctColumnSelectFields(x)} \n }`;
|
|
2424
|
-
}
|
|
2425
|
-
else {
|
|
2426
|
-
colStr += `\n${x.name}`;
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
});
|
|
2430
|
-
}
|
|
2431
|
-
if (colStr == '') {
|
|
2432
|
-
// 설정에 정의가 되어 있지 않으면 기본 id, name, description 필드
|
|
2433
|
-
colStr += '\nid\nname\ndescription';
|
|
2434
|
-
}
|
|
2435
|
-
return colStr;
|
|
2436
|
-
}
|
|
2437
|
-
/**
|
|
2438
|
-
* @description pageView의 그리드 정보로 기본 그리스트 Html을 생성하여 리턴
|
|
2439
|
-
*****************************************************************
|
|
2440
|
-
* @param {String} pageView 페이지 뷰
|
|
2441
|
-
* @returns {HTMLElement} 그리스트 HTML
|
|
2442
|
-
*/
|
|
2443
|
-
static getBasicGristHtml(pageView) {
|
|
2444
|
-
let gristConfigSet = pageView.gristConfigSet;
|
|
2445
|
-
if (!gristConfigSet) {
|
|
2446
|
-
return html ``;
|
|
2447
|
-
}
|
|
2448
|
-
else {
|
|
2449
|
-
let gristElementId = pageView.gristId ? pageView.gristId : 'ox-grist';
|
|
2450
|
-
let gridMode = pageView.gridMode;
|
|
2451
|
-
return html `
|
|
2452
|
-
<ox-grist
|
|
2453
|
-
id=${gristElementId}
|
|
2454
|
-
.config=${gristConfigSet}
|
|
2455
|
-
.mode=${gridMode}
|
|
2456
|
-
auto-fetch
|
|
2457
|
-
.personalConfigProvider=${pageView.getPagePreferenceProvider(gristElementId)}
|
|
2458
|
-
.fetchHandler=${pageView.fetchHandler.bind(pageView)}
|
|
2459
|
-
>
|
|
2460
|
-
${MetaUiUtil.getGridDetailHtml(pageView)}
|
|
2461
|
-
|
|
2462
|
-
<ox-grist-personalizer slot="setting"></ox-grist-personalizer>
|
|
2463
|
-
</ox-grist>
|
|
2464
|
-
`;
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
/**
|
|
2468
|
-
* @description pageView의 폼 정보로 기본 폼 Html을 생성하여 리턴
|
|
2469
|
-
*********************************************************
|
|
2470
|
-
* @param {Object} pageView 페이지 뷰
|
|
2471
|
-
* @returns {HTMLElement} 폼을 HTML
|
|
2472
|
-
*/
|
|
2473
|
-
static getBasicFormHtml(pageView) {
|
|
2474
|
-
if (!pageView)
|
|
2475
|
-
return html ``;
|
|
2476
|
-
if (!pageView.formConfigSet)
|
|
2477
|
-
return html ``;
|
|
2478
|
-
let cols = pageView.formConfigSet;
|
|
2479
|
-
let record = pageView.record || {};
|
|
2480
|
-
let columns = cols.filter(x => x.hidden == false);
|
|
2481
|
-
// 폼 렌더링 옵션 여부
|
|
2482
|
-
if (ValueUtil.isEmpty(pageView.formRenderConfig)) {
|
|
2483
|
-
return MetaUiUtil.getBasicFormHtmlNoOption(pageView, columns, record);
|
|
2484
|
-
}
|
|
2485
|
-
else {
|
|
2486
|
-
return MetaUiUtil.getBasicFormHtmlOnOption(pageView, columns, record);
|
|
2487
|
-
}
|
|
2488
|
-
}
|
|
2489
|
-
/**
|
|
2490
|
-
* @description pageView의 폼 정보로 폼렌더링 옵션을 적용한 폼 Html을 생성하여 리턴
|
|
2491
|
-
***********************************************************************
|
|
2492
|
-
* @param {Object} pageView 페이지 뷰
|
|
2493
|
-
* @param {Array} columns 구성 컬럼
|
|
2494
|
-
* @param {Object} record 표현 데이터
|
|
2495
|
-
* @returns {HTMLElement} 폼을 HTML
|
|
2496
|
-
*/
|
|
2497
|
-
static getBasicFormHtmlOnOption(pageView, columns, record) {
|
|
2498
|
-
let renderConfig = pageView.formRenderConfig;
|
|
2499
|
-
return html `
|
|
2500
|
-
<div class="root_container">
|
|
2501
|
-
${renderConfig.map(config => {
|
|
2502
|
-
let renderCols = [];
|
|
2503
|
-
config.column_list.forEach(x => {
|
|
2504
|
-
let columnInfo = columns.filter(col => x == col.name) || [];
|
|
2505
|
-
if (columnInfo.length > 0) {
|
|
2506
|
-
renderCols.push(columnInfo[0]);
|
|
2507
|
-
}
|
|
2508
|
-
});
|
|
2509
|
-
// 그리드 구분 스타일
|
|
2510
|
-
let divStyle = 'height:auto;grid-template-columns:';
|
|
2511
|
-
for (let i = 0; i < config.column; i++) {
|
|
2512
|
-
divStyle += ' 1fr 2fr';
|
|
2513
|
-
}
|
|
2514
|
-
divStyle += ';';
|
|
2515
|
-
let rowIndex = 0;
|
|
2516
|
-
return html `
|
|
2517
|
-
<h2><md-icon>list_alt</md-icon>${TermsUtil.tTitle(config.display)}</h2>
|
|
2518
|
-
<div id="content_container" class="content_container" style="${divStyle}">
|
|
2519
|
-
${renderCols.map(column => {
|
|
2520
|
-
let { editable = false, mandatory = false } = column.record;
|
|
2521
|
-
let dirtyFields = record['__dirtyfields__'] || {};
|
|
2522
|
-
return html `
|
|
2523
|
-
<label ?editable=${editable}
|
|
2524
|
-
><span>${mandatory ? '*' : ''}${column.header_txt}</span>
|
|
2525
|
-
${editable ? html `<md-icon>edit</md-icon>` : ''}
|
|
2526
|
-
</label>
|
|
2527
|
-
<ox-grid-field
|
|
2528
|
-
.rowIndex=${rowIndex}
|
|
2529
|
-
.column=${column}
|
|
2530
|
-
.record=${record}
|
|
2531
|
-
.value=${record[column.name]}
|
|
2532
|
-
?dirty=${!!dirtyFields[column.name]}
|
|
2533
|
-
></ox-grid-field>
|
|
2534
|
-
`;
|
|
2535
|
-
})}
|
|
2536
|
-
</div>
|
|
2537
|
-
`;
|
|
2538
|
-
})}
|
|
2539
|
-
</div>
|
|
2540
|
-
${pageView.isPage ? html `` : MetaUiUtil.getButtonContainer(pageView)}
|
|
2541
|
-
`;
|
|
2542
|
-
}
|
|
2543
|
-
/**
|
|
2544
|
-
* @description pageView의 폼 정보로 기본 폼 Html을 생성하여 리턴
|
|
2545
|
-
*********************************************************
|
|
2546
|
-
* @param {Object} pageView 페이지 뷰
|
|
2547
|
-
* @param {Array} columns 구성 컬럼
|
|
2548
|
-
* @param {Object} record 표현 데이터
|
|
2549
|
-
* @returns {HTMLElement} 폼을 HTML
|
|
2550
|
-
*/
|
|
2551
|
-
static getBasicFormHtmlNoOption(pageView, columns, record) {
|
|
2552
|
-
// 그리드 구분 스타일
|
|
2553
|
-
let divStyle = 'grid-template-columns:';
|
|
2554
|
-
if (!pageView.column || pageView.column == 0) {
|
|
2555
|
-
pageView.column = 1;
|
|
2556
|
-
}
|
|
2557
|
-
pageView.column = parseInt((pageView.etcConfig || {}).default_form_column || pageView.column);
|
|
2558
|
-
for (let i = 0; i < pageView.column; i++) {
|
|
2559
|
-
divStyle += ' 1fr 2fr';
|
|
2560
|
-
}
|
|
2561
|
-
divStyle += ';';
|
|
2562
|
-
let rowIndex = 0;
|
|
2563
|
-
return html `
|
|
2564
|
-
<div id="container" class="container" style="${divStyle}">
|
|
2565
|
-
${columns.map(column => {
|
|
2566
|
-
let { editable = false, mandatory = false } = column.record;
|
|
2567
|
-
let dirtyFields = record['__dirtyfields__'] || {};
|
|
2568
|
-
return html `
|
|
2569
|
-
<label ?editable=${editable}
|
|
2570
|
-
><span>${mandatory ? '*' : ''}${column.header_txt}</span>
|
|
2571
|
-
${editable ? html `<md-icon>edit</md-icon>` : ''}
|
|
2572
|
-
</label>
|
|
2573
|
-
<ox-grid-field
|
|
2574
|
-
.rowIndex=${rowIndex}
|
|
2575
|
-
.column=${column}
|
|
2576
|
-
.record=${record}
|
|
2577
|
-
.value=${record[column.name]}
|
|
2578
|
-
?dirty=${!!dirtyFields[column.name]}
|
|
2579
|
-
></ox-grid-field>
|
|
2580
|
-
`;
|
|
2581
|
-
})}
|
|
2582
|
-
</div>
|
|
2583
|
-
${pageView.isPage ? html `` : MetaUiUtil.getButtonContainer(pageView)}
|
|
2584
|
-
`;
|
|
2585
|
-
}
|
|
2586
|
-
/**
|
|
2587
|
-
* @description pageView의 탭 정보로 기본 탭 Html을 생성하여 리턴
|
|
2588
|
-
**********************************************************
|
|
2589
|
-
* @param {Object} pageView 페이지 뷰
|
|
2590
|
-
* @returns {HTMLElement} 탭 HTML
|
|
2591
|
-
*/
|
|
2592
|
-
static getBasicTabHtml(pageView) {
|
|
2593
|
-
var _a;
|
|
2594
|
-
if (!pageView)
|
|
2595
|
-
return html ``;
|
|
2596
|
-
if (!pageView.tabRenderConfig)
|
|
2597
|
-
return html ``;
|
|
2598
|
-
let tabs = pageView.tabRenderConfig;
|
|
2599
|
-
if (!pageView.currentTabKey)
|
|
2600
|
-
pageView.currentTabKey = ((_a = tabs[0]) === null || _a === void 0 ? void 0 : _a.name) || undefined;
|
|
2601
|
-
return html `
|
|
2602
|
-
<div class="tabs">
|
|
2603
|
-
${tabs.map(tab => {
|
|
2604
|
-
let label = TermsUtil.tLabel(tab.display);
|
|
2605
|
-
let key = tab.name;
|
|
2606
|
-
return html `
|
|
2607
|
-
<div
|
|
2608
|
-
class="tab"
|
|
2609
|
-
?activate="${key === pageView.currentTabKey}"
|
|
2610
|
-
@click="${() => (pageView.currentTabKey = key)}"
|
|
2611
|
-
>
|
|
2612
|
-
${tab.icon ? html `<md-icon>${tab.icon}</md-icon>` : html ``}
|
|
2613
|
-
<span>${label}</span>
|
|
2614
|
-
</div>
|
|
2615
|
-
`;
|
|
2616
|
-
})}
|
|
2617
|
-
</div>
|
|
2618
|
-
<div class="content-container">
|
|
2619
|
-
${tabs.map(tab => {
|
|
2620
|
-
let displayStyle = 'display:none';
|
|
2621
|
-
let key = tab.name;
|
|
2622
|
-
if (key == pageView.currentTabKey) {
|
|
2623
|
-
displayStyle = 'display:flex';
|
|
2624
|
-
}
|
|
2625
|
-
return html `
|
|
2626
|
-
<div class="tab-contents" style="${displayStyle}">${MetaUiUtil.getBasicTabContent(pageView, tab)}</div>
|
|
2627
|
-
`;
|
|
2628
|
-
})}
|
|
2629
|
-
</div>
|
|
2630
|
-
`;
|
|
2631
|
-
}
|
|
2632
|
-
/**
|
|
2633
|
-
* @description Grist 탭 Html을 생성하여 리턴
|
|
2634
|
-
*****************************************
|
|
2635
|
-
* @param {Object} pageView 페이지 뷰
|
|
2636
|
-
* @returns {HTMLElement} 탭 HTML
|
|
2637
|
-
*/
|
|
2638
|
-
static getGristTabHtml(pageView) {
|
|
2639
|
-
let type = (pageView.etcConfig || {}).master_detail_type || 'top_bottom';
|
|
2640
|
-
let size = (pageView.etcConfig || {}).master_detail_size || '50% 50%';
|
|
2641
|
-
let layoutContainerStyle = type == 'left_right' ? `grid-template-columns:${size};` : `grid-template-rows:${size};`;
|
|
2642
|
-
let currentRouting = pageView.isPage ? UiUtil.currentRouting() : pageView.route_name;
|
|
2643
|
-
return html `
|
|
2644
|
-
${pageView.useMasterFilterForm == false
|
|
2645
|
-
? html ``
|
|
2646
|
-
: html `
|
|
2647
|
-
<div slot="headroom" class="header">
|
|
2648
|
-
<div class="filters">
|
|
2649
|
-
<ox-filters-form-base
|
|
2650
|
-
id="ox-filters-form"
|
|
2651
|
-
.filters=${pageView.searchFields || []}
|
|
2652
|
-
.value=${pageView.searchFieldValues || []}
|
|
2653
|
-
@filters-change=${e => {
|
|
2654
|
-
var _a;
|
|
2655
|
-
(_a = pageView.grist) === null || _a === void 0 ? void 0 : _a.fetch();
|
|
2656
|
-
}}
|
|
2657
|
-
></ox-filters-form-base>
|
|
2658
|
-
</div>
|
|
2659
|
-
</div>
|
|
2660
|
-
`}
|
|
2661
|
-
<div id="container" class="container" style="${layoutContainerStyle}">
|
|
2662
|
-
<div class="container_detail">
|
|
2663
|
-
${MetaApi.getBasicGristHtml(pageView)} ${MetaUiUtil.getButtonContainer(pageView)}
|
|
2664
|
-
</div>
|
|
2665
|
-
<div class="container_detail">
|
|
2666
|
-
${pageView.is_activity === true
|
|
2667
|
-
? html `${pageView.is_readonly === true
|
|
2668
|
-
? html `<meta-tab-element
|
|
2669
|
-
id="detail"
|
|
2670
|
-
route_name="${currentRouting}"
|
|
2671
|
-
.activityDataSet=${(pageView.activityDataSet || {}).detail}
|
|
2672
|
-
is_readonly="true"
|
|
2673
|
-
is_activity="true"
|
|
2674
|
-
is_detail="true"
|
|
2675
|
-
>
|
|
2676
|
-
</meta-tab-element>`
|
|
2677
|
-
: html `<meta-tab-element
|
|
2678
|
-
id="detail"
|
|
2679
|
-
route_name="${currentRouting}"
|
|
2680
|
-
.activityDataSet=${(pageView.activityDataSet || {}).detail}
|
|
2681
|
-
is_activity="true"
|
|
2682
|
-
is_detail="true"
|
|
2683
|
-
>
|
|
2684
|
-
</meta-tab-element>`}`
|
|
2685
|
-
: html `${pageView.is_readonly === true
|
|
2686
|
-
? html `<meta-tab-element
|
|
2687
|
-
id="detail"
|
|
2688
|
-
route_name="${currentRouting}"
|
|
2689
|
-
is_readonly="true"
|
|
2690
|
-
is_detail="true"
|
|
2691
|
-
></meta-tab-element>`
|
|
2692
|
-
: html `<meta-tab-element
|
|
2693
|
-
id="detail"
|
|
2694
|
-
route_name="${currentRouting}"
|
|
2695
|
-
is_detail="true"
|
|
2696
|
-
></meta-tab-element>`}`}
|
|
2697
|
-
</div>
|
|
2698
|
-
</div>
|
|
2699
|
-
`;
|
|
2700
|
-
}
|
|
2701
|
-
/**
|
|
2702
|
-
* @description Tab Detail Html을 생성하여 리턴
|
|
2703
|
-
********************************************
|
|
2704
|
-
* @param {Object} pageView 페이지 뷰
|
|
2705
|
-
* @returns {HTMLElement} 탭 HTML
|
|
2706
|
-
*/
|
|
2707
|
-
static getTabDetailHtml(pageView) {
|
|
2708
|
-
let type = pageView.etcConfig.master_detail_type || 'top_bottom';
|
|
2709
|
-
let size = pageView.etcConfig.master_detail_size || '50% 50%';
|
|
2710
|
-
let detailInfoTxt = pageView.etcConfig.master_detail_element;
|
|
2711
|
-
let detailInfo = JSON.parse(detailInfoTxt || '{}');
|
|
2712
|
-
let layoutContainerStyle = type == 'left_right' ? `grid-template-columns:${size};` : `grid-template-rows:${size};`;
|
|
2713
|
-
MetaUiUtil.createMasterElement(pageView);
|
|
2714
|
-
MetaUiUtil.createDetailElement(pageView, detailInfo);
|
|
2715
|
-
return html `
|
|
2716
|
-
${pageView.useMasterFilterForm == false
|
|
2717
|
-
? html ``
|
|
2718
|
-
: html `
|
|
2719
|
-
<div slot="headroom" class="header">
|
|
2720
|
-
<div class="filters">
|
|
2721
|
-
<ox-filters-form-base
|
|
2722
|
-
id="ox-filters-form"
|
|
2723
|
-
.filters=${pageView.searchFields || []}
|
|
2724
|
-
.value=${pageView.searchFieldValues || []}
|
|
2725
|
-
@filters-change=${e => {
|
|
2726
|
-
pageView.fetch();
|
|
2727
|
-
}}
|
|
2728
|
-
></ox-filters-form-base>
|
|
2729
|
-
</div>
|
|
2730
|
-
</div>
|
|
2731
|
-
`}
|
|
2732
|
-
<div id="container" class="container" style="${layoutContainerStyle}">
|
|
2733
|
-
<div class="container_detail">${pageView.masterElement}</div>
|
|
2734
|
-
<div class="container_detail">
|
|
2735
|
-
${detailInfo.tagname == '' || detailInfo.tagname == 'meta-tab-element'
|
|
2736
|
-
? html ``
|
|
2737
|
-
: html `<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${detailInfo.display}`)}</h2>`}
|
|
2738
|
-
${pageView.detailElement}
|
|
2739
|
-
</div>
|
|
2740
|
-
</div>
|
|
2741
|
-
`;
|
|
2742
|
-
}
|
|
2743
|
-
/**
|
|
2744
|
-
* @description 메인 탭 Html을 생성하여 리턴
|
|
2745
|
-
***************************************
|
|
2746
|
-
* @param {Object} pageView 페이지 뷰
|
|
2747
|
-
* @returns {HTMLElement} 탭 HTML
|
|
2748
|
-
*/
|
|
2749
|
-
static getMainTabHtml(pageView) {
|
|
2750
|
-
MetaUiUtil.createMasterElement(pageView);
|
|
2751
|
-
return html `
|
|
2752
|
-
${pageView.useMasterFilterForm == false
|
|
2753
|
-
? html ``
|
|
2754
|
-
: html `
|
|
2755
|
-
<div slot="headroom" class="header">
|
|
2756
|
-
<div class="filters">
|
|
2757
|
-
<ox-filters-form-base
|
|
2758
|
-
id="ox-filters-form"
|
|
2759
|
-
.filters=${pageView.searchFields || []}
|
|
2760
|
-
.value=${pageView.searchFieldValues || []}
|
|
2761
|
-
@filters-change=${e => {
|
|
2762
|
-
pageView.fetch();
|
|
2763
|
-
}}
|
|
2764
|
-
></ox-filters-form-base>
|
|
2765
|
-
</div>
|
|
2766
|
-
</div>
|
|
2767
|
-
`}
|
|
2768
|
-
<div id="container" class="container">${pageView.masterElement}</div>
|
|
2769
|
-
`;
|
|
2770
|
-
}
|
|
2771
|
-
/**
|
|
2772
|
-
* @description 마스터 디테일 Html을 생성하여 리턴
|
|
2773
|
-
********************************************
|
|
2774
|
-
* @param {Object} pageView 페이지 뷰
|
|
2775
|
-
* @returns {HTMLElement} 탭 HTML
|
|
2776
|
-
*/
|
|
2777
|
-
static getMasterDetailHtml(pageView) {
|
|
2778
|
-
let type = pageView.etcConfig.master_detail_type || 'top_bottom';
|
|
2779
|
-
let size = pageView.etcConfig.master_detail_size || '50% 50%';
|
|
2780
|
-
let masterDisplay = (pageView.masterOption || {}).display;
|
|
2781
|
-
let detailInfoTxt = pageView.etcConfig.master_detail_element;
|
|
2782
|
-
let detailInfo = JSON.parse(detailInfoTxt || '{}');
|
|
2783
|
-
let layoutContainerStyle = type == 'left_right' ? `grid-template-columns:${size};` : `grid-template-rows:${size};`;
|
|
2784
|
-
MetaUiUtil.createDetailElement(pageView, detailInfo);
|
|
2785
|
-
return html `
|
|
2786
|
-
${pageView.useMasterFilterForm == false
|
|
2787
|
-
? html ``
|
|
2788
|
-
: html `
|
|
2789
|
-
<div slot="headroom" class="header">
|
|
2790
|
-
<div class="filters">
|
|
2791
|
-
<ox-filters-form-base
|
|
2792
|
-
id="ox-filters-form"
|
|
2793
|
-
.filters=${pageView.searchFields || []}
|
|
2794
|
-
.value=${pageView.searchFieldValues || []}
|
|
2795
|
-
@filters-change=${e => {
|
|
2796
|
-
var _a;
|
|
2797
|
-
(_a = pageView.grist) === null || _a === void 0 ? void 0 : _a.fetch();
|
|
2798
|
-
}}
|
|
2799
|
-
></ox-filters-form-base>
|
|
2800
|
-
</div>
|
|
2801
|
-
</div>
|
|
2802
|
-
`}
|
|
2803
|
-
<div id="container" class="container" style="${layoutContainerStyle}">
|
|
2804
|
-
<div class="container_detail">
|
|
2805
|
-
${pageView.useFilterForm
|
|
2806
|
-
? masterDisplay
|
|
2807
|
-
? html `<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${masterDisplay}`)}</h2>`
|
|
2808
|
-
: html ``
|
|
2809
|
-
: html ``}
|
|
2810
|
-
${MetaApi.getBasicGristHtml(pageView)} ${MetaUiUtil.getButtonContainer(pageView)}
|
|
2811
|
-
</div>
|
|
2812
|
-
<div class="container_detail">
|
|
2813
|
-
${detailInfo.tagname == '' || detailInfo.tagname == 'meta-tab-element'
|
|
2814
|
-
? html ``
|
|
2815
|
-
: detailInfo.display
|
|
2816
|
-
? html `<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${detailInfo.display}`)}</h2>`
|
|
2817
|
-
: html ``}
|
|
2818
|
-
${pageView.detailElement}
|
|
2819
|
-
</div>
|
|
2820
|
-
</div>
|
|
2821
|
-
`;
|
|
2822
|
-
}
|
|
2823
|
-
/**
|
|
2824
|
-
* @descrtiption 디테일 엘리먼트 렌더링
|
|
2825
|
-
**********************************
|
|
2826
|
-
* @param {Object} pageView
|
|
2827
|
-
* @param {Object} detailInfo
|
|
2828
|
-
* @returns htmlElement
|
|
2829
|
-
*/
|
|
2830
|
-
static createDetailElement(pageView, detailInfo) {
|
|
2831
|
-
if (!pageView.detailElement) {
|
|
2832
|
-
let name = detailInfo.name ? detailInfo.name : 'detail';
|
|
2833
|
-
let elementTxt = `<${detailInfo.tagname} id="${name}" name="${name}" route_name="${detailInfo.routing}" ${pageView.is_activity === true ? 'is_activity=true' : ''} ${pageView.is_readonly === true ? 'is_readonly=true' : ''} is_detail=true style="flex:1;"></${detailInfo.tagname}>`;
|
|
2834
|
-
pageView.detailElement = UiUtil.htmlToElement(elementTxt);
|
|
2835
|
-
pageView.detailElement.activityDataSet = (pageView.activityDataSet || {}).detail;
|
|
2836
|
-
if (pageView.tagName.toLowerCase().startsWith('meta-tab-detail-')) {
|
|
2837
|
-
pageView.detailElement.rootElement = pageView;
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
/**
|
|
2842
|
-
* @descrtiption 마스터 엘리먼트 렌더링
|
|
2843
|
-
**********************************
|
|
2844
|
-
* @param {Object} pageView
|
|
2845
|
-
* @returns {HTMLElement} 마스터 엘리먼트 HTML
|
|
2846
|
-
*/
|
|
2847
|
-
static createMasterElement(pageView) {
|
|
2848
|
-
if (!pageView.masterElement && pageView.filterForm) {
|
|
2849
|
-
let name = 'master';
|
|
2850
|
-
let elementTxt = `<meta-tab-element id="${name}" name="${name}" route_name="${pageView.currentRouting}" ${pageView.is_activity === true ? 'is_activity=true' : ''} ${pageView.is_readonly === true ? 'is_readonly=true' : ''} is_detail=true style="flex:1;"></meta-tab-element>`;
|
|
2851
|
-
pageView.masterElement = UiUtil.htmlToElement(elementTxt);
|
|
2852
|
-
pageView.masterElement.activityDataSet = (pageView.activityDataSet || {}).master;
|
|
2853
|
-
pageView.masterElement.includeMainList = true;
|
|
2854
|
-
pageView.masterElement.mainFilterForm = pageView.filterForm;
|
|
2855
|
-
pageView.masterElement.rootElement = pageView;
|
|
2856
|
-
}
|
|
2857
|
-
}
|
|
2858
|
-
/**
|
|
2859
|
-
* @descrtiption 기본 탭 컨텐트 리턴
|
|
2860
|
-
********************************
|
|
2861
|
-
* @param {Object} pageView
|
|
2862
|
-
* @param {Object} tabConfig
|
|
2863
|
-
* @returns {HTMLElement} 탭 컨텐트 HTML
|
|
2864
|
-
*/
|
|
2865
|
-
static getBasicTabContent(pageView, tabConfig) {
|
|
2866
|
-
if (!pageView.tabElements) {
|
|
2867
|
-
pageView.tabElements = {};
|
|
2868
|
-
}
|
|
2869
|
-
if (Object.keys(pageView.tabElements).filter(key => key == tabConfig.name).length > 0) {
|
|
2870
|
-
return pageView.tabElements[tabConfig.name];
|
|
2871
|
-
}
|
|
2872
|
-
let htmlText = `<${tabConfig.tagname} id='${tabConfig.name}' route_name='${tabConfig.menu}' style="flex:1;" ${pageView.is_activity === true ? 'is_activity=true' : ''} ${pageView.is_readonly === true ? 'is_readonly=true' : ''} is_detail=true></${tabConfig.tagname}>`;
|
|
2873
|
-
let tabElement = UiUtil.htmlToElement(htmlText);
|
|
2874
|
-
tabElement.activityDataSet = (pageView.activityDataSet || {})[tabConfig.name];
|
|
2875
|
-
if (pageView.parent_id) {
|
|
2876
|
-
tabElement.parent_id = pageView.parent_id;
|
|
2877
|
-
}
|
|
2878
|
-
if (pageView.rootElement) {
|
|
2879
|
-
tabElement.rootElement = pageView.rootElement;
|
|
2880
|
-
}
|
|
2881
|
-
else {
|
|
2882
|
-
tabElement.detailElement = pageView;
|
|
2883
|
-
}
|
|
2884
|
-
if (tabConfig.filter_from === false) {
|
|
2885
|
-
tabElement.use_filter_form = false;
|
|
2886
|
-
}
|
|
2887
|
-
if (tabConfig.main_filter_form) {
|
|
2888
|
-
tabElement.mainFilterForm = tabConfig.main_filter_form;
|
|
2889
|
-
}
|
|
2890
|
-
pageView.tabElements[tabConfig.name] = tabElement;
|
|
2891
|
-
return tabElement;
|
|
2892
|
-
}
|
|
2893
|
-
/**
|
|
2894
|
-
* @description 그리드 상세 내용 HTML 생성
|
|
2895
|
-
**************************************
|
|
2896
|
-
* @param {Object} pageView 페이지 뷰
|
|
2897
|
-
* @returns {HTMLElement} 그리드 상세 내용 HTML
|
|
2898
|
-
*/
|
|
2899
|
-
static getGridDetailHtml(pageView) {
|
|
2900
|
-
let useAddButton = pageView.useButtonAdd;
|
|
2901
|
-
let useFilterForm = pageView.useFilterForm;
|
|
2902
|
-
let useFilterAddButton = JSON.parse((pageView.etcConfig || {}).use_filter_add_button || 'false');
|
|
2903
|
-
let recordCreationCallback = pageView.recordCreationCallback;
|
|
2904
|
-
let useSortButton = JSON.parse((pageView.etcConfig || {}).use_grid_sort_button || 'false');
|
|
2905
|
-
useFilterAddButton = useFilterAddButton === true && useAddButton === true;
|
|
2906
|
-
return html `
|
|
2907
|
-
${useFilterForm
|
|
2908
|
-
? html `
|
|
2909
|
-
<div slot="headroom" class="header">
|
|
2910
|
-
<div class="filters">
|
|
2911
|
-
<ox-filters-form></ox-filters-form>
|
|
2912
|
-
${useSortButton
|
|
2913
|
-
? html `
|
|
2914
|
-
<div id="sorters">
|
|
2915
|
-
<md-icon
|
|
2916
|
-
@click=${e => {
|
|
2917
|
-
const target = e.currentTarget;
|
|
2918
|
-
target.nextElementSibling.open({
|
|
2919
|
-
right: 0,
|
|
2920
|
-
top: target.offsetTop + target.offsetHeight
|
|
2921
|
-
});
|
|
2922
|
-
}}
|
|
2923
|
-
>sort</md-icon
|
|
2924
|
-
>
|
|
2925
|
-
<ox-popup id="sorter-control">
|
|
2926
|
-
<ox-sorters-control></ox-sorters-control>
|
|
2927
|
-
</ox-popup>
|
|
2928
|
-
</div>
|
|
2929
|
-
`
|
|
2930
|
-
: nothing}
|
|
2931
|
-
${MetaUiUtil.getGridViewOption(pageView)}
|
|
2932
|
-
<ox-record-creator id="add" ?hidden="${!useFilterAddButton}" .callback=${recordCreationCallback}>
|
|
2933
|
-
<button style="display: flex; justify-content: center">
|
|
2934
|
-
<md-icon>add</md-icon>
|
|
2935
|
-
</button>
|
|
2936
|
-
</ox-record-creator>
|
|
2937
|
-
</div>
|
|
2938
|
-
</div>
|
|
2939
|
-
`
|
|
2940
|
-
: nothing}
|
|
2941
|
-
`;
|
|
2942
|
-
}
|
|
2943
|
-
/**
|
|
2944
|
-
* @description 그리드 보기 옵션 버튼을 그린다.
|
|
2945
|
-
****************************************
|
|
2946
|
-
* @param {Object} pageView 페이지 뷰
|
|
2947
|
-
* @return {HTMLElement} 그리드 뷰 옵션 HTML
|
|
2948
|
-
*/
|
|
2949
|
-
static getGridViewOption(pageView) {
|
|
2950
|
-
if (ValueUtil.isEmpty(pageView.gridViewOptions) || pageView.gridViewOptions.length == 1) {
|
|
2951
|
-
return html ``;
|
|
2952
|
-
}
|
|
2953
|
-
else {
|
|
2954
|
-
return html `
|
|
2955
|
-
<div id="modes">
|
|
2956
|
-
${pageView.gridViewOptions.includes('GRID')
|
|
2957
|
-
? html `<md-icon @click="${() => (pageView.gridMode = 'GRID')}" ?active="${pageView.gridMode == 'GRID'}"
|
|
2958
|
-
>grid_on</md-icon
|
|
2959
|
-
>`
|
|
2960
|
-
: ``}
|
|
2961
|
-
${pageView.gridViewOptions.includes('LIST')
|
|
2962
|
-
? html `<md-icon @click="${() => (pageView.gridMode = 'LIST')}" ?active="${pageView.gridMode == 'LIST'}"
|
|
2963
|
-
>format_list_bulleted</md-icon
|
|
2964
|
-
>`
|
|
2965
|
-
: ``}
|
|
2966
|
-
${pageView.gridViewOptions.includes('CARD')
|
|
2967
|
-
? html `<md-icon @click="${() => (pageView.gridMode = 'CARD')}" ?active="${pageView.gridMode == 'CARD'}"
|
|
2968
|
-
>apps</md-icon
|
|
2969
|
-
>`
|
|
2970
|
-
: ``}
|
|
2971
|
-
</div>
|
|
2972
|
-
`;
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
/**
|
|
2976
|
-
* @description 버튼 컨테이너 엘리먼트 생성
|
|
2977
|
-
*************************************
|
|
2978
|
-
* @param {Object} pageView
|
|
2979
|
-
* @returns {HTMLElement}
|
|
2980
|
-
*/
|
|
2981
|
-
static getButtonContainer(pageView) {
|
|
2982
|
-
return html `<div class="button-container">${MetaUiUtil.getContainerButtons(pageView)}</div>`;
|
|
2983
|
-
}
|
|
2984
|
-
}
|
|
2985
|
-
//# sourceMappingURL=meta-ui-util.js.map
|