@mediusinc/mng-commons 0.0.1-rc.3 → 0.2.1-rc
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/.browserslistrc +16 -0
- package/README.md +96 -1
- package/assets/i18n/en.json +156 -0
- package/assets/i18n/sl.json +156 -0
- package/assets/images/effect-ondark.png +0 -0
- package/assets/images/effect-ondark.svg +38 -0
- package/assets/images/effect-ondark@2x.png +0 -0
- package/assets/images/effect-onlight.png +0 -0
- package/assets/images/effect-onlight.svg +38 -0
- package/assets/images/effect-onlight@2x.png +0 -0
- package/assets/images/pages/exception-ondark.png +0 -0
- package/assets/images/pages/exception-onlight.png +0 -0
- package/assets/images/pages/login-ondark.png +0 -0
- package/assets/images/pages/login-onlight.png +0 -0
- package/assets/templates/tableview-route.component.html +5 -0
- package/karma.conf.js +51 -0
- package/ng-package.json +14 -0
- package/package.json +3 -24
- package/scss/common/layout/_breadcrumb.scss +96 -0
- package/scss/common/layout/_config.scss +101 -0
- package/scss/common/layout/_dashboard.scss +16 -0
- package/scss/common/layout/_exception.scss +131 -0
- package/scss/common/layout/_footer.scss +29 -0
- package/scss/common/layout/_help.scss +157 -0
- package/scss/common/layout/_inlinemenu.scss +55 -0
- package/scss/common/layout/_invoice.scss +176 -0
- package/scss/common/layout/_landing.scss +639 -0
- package/scss/common/layout/_layout_dark.scss +23 -0
- package/scss/common/layout/_layout_light.scss +23 -0
- package/scss/common/layout/_loader.scss +18 -0
- package/scss/common/layout/_login.scss +106 -0
- package/scss/common/layout/_main.scss +45 -0
- package/scss/common/layout/_mixins.scss +214 -0
- package/scss/common/layout/_rightmenu.scss +125 -0
- package/scss/common/layout/_topbar.scss +189 -0
- package/scss/common/layout/_typography.scss +63 -0
- package/scss/common/layout/_utils.scss +96 -0
- package/scss/common/layout/_widgets.scss +391 -0
- package/scss/common/layout/menu/_menu.scss +7 -0
- package/scss/common/layout/menu/_menu_common.scss +183 -0
- package/scss/common/layout/menu/_menu_overlay.scss +52 -0
- package/scss/common/layout/menu/_menu_sidebar.scss +232 -0
- package/scss/common/layout/menu/_menu_slim.scss +138 -0
- package/scss/common/layout/menu/_menu_static.scss +70 -0
- package/scss/common/layout/menu/_menu_theme.scss +365 -0
- package/scss/common/theme/_theme_dark.scss +5 -0
- package/scss/common/theme/_theme_light.scss +5 -0
- package/scss/common/theme/designer/_colors.scss +18 -0
- package/scss/common/theme/designer/_common.scss +40 -0
- package/scss/common/theme/designer/_components.scss +101 -0
- package/scss/common/theme/designer/_mixins.scss +174 -0
- package/scss/common/theme/designer/components/button/_button.scss +560 -0
- package/scss/common/theme/designer/components/button/_speeddial.scss +79 -0
- package/scss/common/theme/designer/components/button/_splitbutton.scss +1 -0
- package/scss/common/theme/designer/components/data/_carousel.scss +37 -0
- package/scss/common/theme/designer/components/data/_datatable.scss +266 -0
- package/scss/common/theme/designer/components/data/_dataview.scss +55 -0
- package/scss/common/theme/designer/components/data/_filter.scss +138 -0
- package/scss/common/theme/designer/components/data/_fullcalendar.scss +324 -0
- package/scss/common/theme/designer/components/data/_orderlist.scss +91 -0
- package/scss/common/theme/designer/components/data/_organizationchart.scss +50 -0
- package/scss/common/theme/designer/components/data/_paginator.scss +83 -0
- package/scss/common/theme/designer/components/data/_picklist.scss +91 -0
- package/scss/common/theme/designer/components/data/_timeline.scss +38 -0
- package/scss/common/theme/designer/components/data/_tree.scss +144 -0
- package/scss/common/theme/designer/components/data/_treetable.scss +242 -0
- package/scss/common/theme/designer/components/data/_virtualscroller.scss +28 -0
- package/scss/common/theme/designer/components/file/_fileupload.scss +58 -0
- package/scss/common/theme/designer/components/input/_autocomplete.scss +103 -0
- package/scss/common/theme/designer/components/input/_calendar.scss +212 -0
- package/scss/common/theme/designer/components/input/_cascadeselect.scss +98 -0
- package/scss/common/theme/designer/components/input/_checkbox.scss +85 -0
- package/scss/common/theme/designer/components/input/_chips.scss +41 -0
- package/scss/common/theme/designer/components/input/_colorpicker.scss +19 -0
- package/scss/common/theme/designer/components/input/_dropdown.scss +136 -0
- package/scss/common/theme/designer/components/input/_editor.scss +122 -0
- package/scss/common/theme/designer/components/input/_inputgroup.scss +69 -0
- package/scss/common/theme/designer/components/input/_inputmask.scss +3 -0
- package/scss/common/theme/designer/components/input/_inputnumber.scss +3 -0
- package/scss/common/theme/designer/components/input/_inputswitch.scss +58 -0
- package/scss/common/theme/designer/components/input/_inputtext.scss +97 -0
- package/scss/common/theme/designer/components/input/_listbox.scss +82 -0
- package/scss/common/theme/designer/components/input/_multiselect.scss +164 -0
- package/scss/common/theme/designer/components/input/_password.scss +33 -0
- package/scss/common/theme/designer/components/input/_radiobutton.scss +78 -0
- package/scss/common/theme/designer/components/input/_rating.scss +48 -0
- package/scss/common/theme/designer/components/input/_selectbutton.scss +50 -0
- package/scss/common/theme/designer/components/input/_slider.scss +69 -0
- package/scss/common/theme/designer/components/input/_togglebutton.scss +48 -0
- package/scss/common/theme/designer/components/input/_treeselect.scss +89 -0
- package/scss/common/theme/designer/components/menu/_breadcrumb.scss +42 -0
- package/scss/common/theme/designer/components/menu/_contextmenu.scss +50 -0
- package/scss/common/theme/designer/components/menu/_dock.scss +51 -0
- package/scss/common/theme/designer/components/menu/_megamenu.scss +102 -0
- package/scss/common/theme/designer/components/menu/_menu.scss +41 -0
- package/scss/common/theme/designer/components/menu/_menubar.scss +179 -0
- package/scss/common/theme/designer/components/menu/_panelmenu.scss +137 -0
- package/scss/common/theme/designer/components/menu/_slidemenu.scss +55 -0
- package/scss/common/theme/designer/components/menu/_steps.scss +55 -0
- package/scss/common/theme/designer/components/menu/_tabmenu.scss +49 -0
- package/scss/common/theme/designer/components/menu/_tieredmenu.scss +56 -0
- package/scss/common/theme/designer/components/messages/_inlinemessage.scss +64 -0
- package/scss/common/theme/designer/components/messages/_message.scss +102 -0
- package/scss/common/theme/designer/components/messages/_toast.scss +95 -0
- package/scss/common/theme/designer/components/misc/_avatar.scss +30 -0
- package/scss/common/theme/designer/components/misc/_badge.scss +48 -0
- package/scss/common/theme/designer/components/misc/_blockui.scss +3 -0
- package/scss/common/theme/designer/components/misc/_chip.scss +36 -0
- package/scss/common/theme/designer/components/misc/_inplace.scss +17 -0
- package/scss/common/theme/designer/components/misc/_progressbar.scss +17 -0
- package/scss/common/theme/designer/components/misc/_scrolltop.scss +20 -0
- package/scss/common/theme/designer/components/misc/_skeleton.scss +8 -0
- package/scss/common/theme/designer/components/misc/_tag.scss +33 -0
- package/scss/common/theme/designer/components/misc/_terminal.scss +11 -0
- package/scss/common/theme/designer/components/multimedia/_galleria.scss +141 -0
- package/scss/common/theme/designer/components/overlay/_confirmpopup.scss +67 -0
- package/scss/common/theme/designer/components/overlay/_dialog.scss +63 -0
- package/scss/common/theme/designer/components/overlay/_overlaypanel.scss +62 -0
- package/scss/common/theme/designer/components/overlay/_sidebar.scss +27 -0
- package/scss/common/theme/designer/components/overlay/_tooltip.scss +33 -0
- package/scss/common/theme/designer/components/panel/_accordion.scss +119 -0
- package/scss/common/theme/designer/components/panel/_card.scss +30 -0
- package/scss/common/theme/designer/components/panel/_divider.scss +31 -0
- package/scss/common/theme/designer/components/panel/_fieldset.scss +47 -0
- package/scss/common/theme/designer/components/panel/_panel.scss +42 -0
- package/scss/common/theme/designer/components/panel/_scrollpanel.scss +6 -0
- package/scss/common/theme/designer/components/panel/_splitter.scss +19 -0
- package/scss/common/theme/designer/components/panel/_tabview.scss +66 -0
- package/scss/common/theme/designer/components/panel/_toolbar.scss +10 -0
- package/scss/common/theme/extensions/_button.scss +99 -0
- package/scss/common/theme/extensions/_calendar.scss +18 -0
- package/scss/common/theme/extensions/_card.scss +6 -0
- package/scss/common/theme/extensions/_carousel.scss +13 -0
- package/scss/common/theme/extensions/_checkbox.scss +10 -0
- package/scss/common/theme/extensions/_contextmenu.scss +16 -0
- package/scss/common/theme/extensions/_datatable.scss +83 -0
- package/scss/common/theme/extensions/_dialog.scss +14 -0
- package/scss/common/theme/extensions/_fieldset.scss +6 -0
- package/scss/common/theme/extensions/_galleria.scss +25 -0
- package/scss/common/theme/extensions/_megamenu.scss +18 -0
- package/scss/common/theme/extensions/_menu.scss +14 -0
- package/scss/common/theme/extensions/_menubar.scss +14 -0
- package/scss/common/theme/extensions/_orderlist.scss +38 -0
- package/scss/common/theme/extensions/_paginator.scss +19 -0
- package/scss/common/theme/extensions/_panelmenu.scss +20 -0
- package/scss/common/theme/extensions/_password.scss +5 -0
- package/scss/common/theme/extensions/_picklist.scss +38 -0
- package/scss/common/theme/extensions/_radiobutton.scss +8 -0
- package/scss/common/theme/extensions/_sidebar.scss +19 -0
- package/scss/common/theme/extensions/_slidemenu.scss +10 -0
- package/scss/common/theme/extensions/_slider.scss +6 -0
- package/scss/common/theme/extensions/_steps.scss +50 -0
- package/scss/common/theme/extensions/_tieredmenu.scss +14 -0
- package/scss/common/theme/extensions/_toast.scss +6 -0
- package/scss/common/theme/extensions/_tree.scss +36 -0
- package/scss/common/theme/extensions/_treetable.scss +35 -0
- package/scss/common/theme/extensions/_vendor_extensions.scss +27 -0
- package/scss/common/variables/layout/_common.scss +12 -0
- package/scss/common/variables/layout/_layout_dark.scss +71 -0
- package/scss/common/variables/layout/_layout_light.scss +71 -0
- package/scss/common/variables/theme/_theme_dark.scss +897 -0
- package/scss/common/variables/theme/_theme_light.scss +885 -0
- package/scss/layout/default/_mng-variables-layout-dark.scss +2 -0
- package/scss/layout/default/_mng-variables-layout-light.scss +2 -0
- package/scss/layout/default/layout-dark.scss +2 -0
- package/scss/layout/default/layout-light.scss +2 -0
- package/scss/mng-commons-dark.scss +5 -0
- package/scss/mng-commons-light.scss +5 -0
- package/scss/mng-overrides/_layout_action.scss +3 -0
- package/scss/mng-overrides/_layout_dialog.scss +34 -0
- package/scss/mng-overrides/_layout_forms.scss +31 -0
- package/scss/mng-overrides/_layout_radio.scss +3 -0
- package/scss/mng-overrides/_layout_styles.scss +4 -0
- package/scss/mng-overrides/_theme_datatable.scss +9 -0
- package/scss/mng-overrides/_theme_dialog.scss +9 -0
- package/scss/mng-overrides/_theme_dropdown.scss +6 -0
- package/scss/mng-overrides/_theme_styles.scss +9 -0
- package/scss/mng-overrides/_theme_tableview.scss +94 -0
- package/scss/theme/default/_mng-variables-theme-dark.scss +8 -0
- package/scss/theme/default/_mng-variables-theme-light.scss +8 -0
- package/scss/theme/default/theme-dark.scss +2 -0
- package/scss/theme/default/theme-light.scss +2 -0
- package/src/lib/api/models/builders/query-param.builder.ts +54 -0
- package/src/lib/api/models/filter-match-type.model.ts +25 -0
- package/src/lib/api/models/filter-param.model.ts +59 -0
- package/{lib/api/models/index.d.ts → src/lib/api/models/index.ts} +10 -8
- package/src/lib/api/models/mappers.ts +18 -0
- package/{lib/api/models/query-mode.model.d.ts → src/lib/api/models/query-mode.model.ts} +18 -16
- package/src/lib/api/models/query-param.model.ts +99 -0
- package/src/lib/api/models/query-result.model.ts +77 -0
- package/{lib/api/models/serialization.model.d.ts → src/lib/api/models/serialization.model.ts} +9 -8
- package/src/lib/api/services/crud-api.abstract.service.ts +113 -0
- package/src/lib/api/services/index.ts +1 -0
- package/{lib/api/utils/index.d.ts → src/lib/api/utils/index.ts} +2 -2
- package/src/lib/api/utils/medius-rest.util.ts +146 -0
- package/src/lib/api/utils/object-serializer.util.ts +227 -0
- package/src/lib/components/action/action.component.html +30 -0
- package/src/lib/components/action/action.component.ts +77 -0
- package/src/lib/components/action/dialog/action-dialog.component.html +26 -0
- package/src/lib/components/action/dialog/action-dialog.component.ts +171 -0
- package/{lib/components/action/index.d.ts → src/lib/components/action/index.ts} +3 -3
- package/src/lib/components/action/models/action-confirmation-service.model.ts +7 -0
- package/src/lib/components/action/models/action-execution.model.ts +81 -0
- package/src/lib/components/action/models/index.ts +2 -0
- package/src/lib/components/action/route/action-route.component.html +1 -0
- package/src/lib/components/action/route/action-route.component.ts +159 -0
- package/src/lib/components/form/autocomplete/autocomplete.component.html +16 -0
- package/src/lib/components/form/autocomplete/autocomplete.component.ts +113 -0
- package/src/lib/components/form/dropdown/dropdown.component.html +29 -0
- package/src/lib/components/form/dropdown/dropdown.component.ts +109 -0
- package/src/lib/components/form/editor/form-editor.component.html +5 -0
- package/src/lib/components/form/editor/form-editor.component.ts +149 -0
- package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.html +7 -0
- package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.ts +21 -0
- package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.html +9 -0
- package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.ts +22 -0
- package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.html +8 -0
- package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.ts +10 -0
- package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.html +56 -0
- package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.ts +22 -0
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.html +13 -0
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.scss +4 -0
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.ts +114 -0
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.html +37 -0
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.ts +133 -0
- package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.html +10 -0
- package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.ts +10 -0
- package/{lib/components/form/formly/fields/index.d.ts → src/lib/components/form/formly/fields/index.ts} +7 -7
- package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.html +7 -0
- package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.ts +13 -0
- package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.html +6 -0
- package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.ts +13 -0
- package/{lib/components/form/formly/wrappers/index.d.ts → src/lib/components/form/formly/wrappers/index.ts} +2 -2
- package/src/lib/components/form/index.ts +3 -0
- package/src/lib/components/form/models/form-editor.event.ts +7 -0
- package/src/lib/components/form/models/index.ts +1 -0
- package/src/lib/components/layout/breadcrumb.component.html +5 -0
- package/src/lib/components/layout/breadcrumb.component.ts +12 -0
- package/src/lib/components/layout/footer.component.html +7 -0
- package/src/lib/components/layout/footer.component.ts +15 -0
- package/src/lib/components/layout/index.ts +6 -0
- package/src/lib/components/layout/main-layout.component.html +26 -0
- package/src/lib/components/layout/main-layout.component.ts +54 -0
- package/src/lib/components/layout/menu-item.component.html +41 -0
- package/src/lib/components/layout/menu-item.component.ts +170 -0
- package/src/lib/components/layout/menu.component.html +27 -0
- package/src/lib/components/layout/menu.component.ts +17 -0
- package/src/lib/components/layout/services/index.ts +1 -0
- package/src/lib/components/layout/services/main-layout.component.service.ts +231 -0
- package/src/lib/components/layout/topbar.component.html +38 -0
- package/src/lib/components/layout/topbar.component.ts +62 -0
- package/{lib/components/tableview/index.d.ts → src/lib/components/tableview/index.ts} +5 -3
- package/src/lib/components/tableview/models/index.ts +1 -0
- package/src/lib/components/tableview/models/table.event.ts +22 -0
- package/src/lib/components/tableview/route/tableview-route.abstract.component.ts +31 -0
- package/src/lib/components/tableview/services/index.ts +1 -0
- package/src/lib/components/tableview/services/tableview.component.service.ts +22 -0
- package/src/lib/components/tableview/table/column-filter/column-filter.component.html +36 -0
- package/src/lib/components/tableview/table/column-filter/column-filter.component.ts +70 -0
- package/src/lib/components/tableview/table/column-value/column-value.component.html +14 -0
- package/src/lib/components/tableview/table/column-value/column-value.component.ts +19 -0
- package/src/lib/components/tableview/table/table.component.html +110 -0
- package/src/lib/components/tableview/table/table.component.ts +327 -0
- package/src/lib/components/tableview/tableview.component.html +37 -0
- package/src/lib/components/tableview/tableview.component.ts +78 -0
- package/src/lib/config/formly.config.ts +154 -0
- package/{lib/config/index.d.ts → src/lib/config/index.ts} +1 -1
- package/{lib/models/config/index.d.ts → src/lib/config/models/index.ts} +1 -1
- package/src/lib/config/models/mng-config.model.ts +35 -0
- package/src/lib/data-providers/base.data-provider.ts +42 -0
- package/src/lib/data-providers/editor.data-provider.ts +60 -0
- package/src/lib/data-providers/index.ts +5 -0
- package/src/lib/data-providers/lookup.data-provider.ts +29 -0
- package/src/lib/data-providers/table.data-provider.ts +8 -0
- package/src/lib/data-providers/tableview.data-provider.ts +29 -0
- package/src/lib/descriptors/action.descriptor.ts +439 -0
- package/src/lib/descriptors/editor.descriptor.ts +880 -0
- package/src/lib/descriptors/field.validator.ts +35 -0
- package/src/lib/descriptors/index.ts +7 -0
- package/src/lib/descriptors/lookup.descriptor.ts +20 -0
- package/src/lib/descriptors/model.descriptor.ts +47 -0
- package/src/lib/descriptors/table.descriptor.ts +514 -0
- package/src/lib/descriptors/tableview.descriptor.ts +180 -0
- package/src/lib/directives/component.directive.ts +18 -0
- package/src/lib/directives/index.ts +2 -0
- package/src/lib/directives/template.directive.ts +24 -0
- package/src/lib/mng-commons.module.ts +240 -0
- package/src/lib/models/index.ts +2 -0
- package/src/lib/models/router.model.ts +16 -0
- package/src/lib/models/user.model.ts +9 -0
- package/src/lib/pipes/boolean.pipe.ts +17 -0
- package/{lib/pipes/index.d.ts → src/lib/pipes/index.ts} +2 -1
- package/src/lib/pipes/property-path.pipe.ts +30 -0
- package/src/lib/services/action.service.ts +310 -0
- package/src/lib/services/commons.service.ts +407 -0
- package/src/lib/services/configuration.service.ts +98 -0
- package/{lib/services/index.d.ts → src/lib/services/index.ts} +4 -6
- package/src/lib/services/navigation.service.ts +42 -0
- package/src/lib/services/providers/commons-init.provider.ts +5 -0
- package/src/lib/services/providers/config-service.provider.ts +22 -0
- package/src/lib/services/providers/formly-config.provider.ts +39 -0
- package/{lib/services/providers/index.d.ts → src/lib/services/providers/index.ts} +3 -2
- package/src/lib/services/tokens/browser-storage.token.ts +9 -0
- package/src/lib/services/tokens/index.ts +2 -0
- package/src/lib/services/tokens/module-config.token.ts +5 -0
- package/{lib/models/types/index.d.ts → src/lib/types/index.ts} +2 -2
- package/src/lib/types/type.decorator.ts +7 -0
- package/src/lib/types/type.model.ts +12 -0
- package/src/lib/utils/editor-formly.util.ts +193 -0
- package/src/lib/utils/i18n.util.ts +148 -0
- package/{lib/utils/index.d.ts → src/lib/utils/index.ts} +5 -4
- package/src/lib/utils/model.util.ts +66 -0
- package/src/lib/utils/toast.util.ts +49 -0
- package/src/lib/utils/type.util.ts +44 -0
- package/{public-api.d.ts → src/public-api.ts} +42 -22
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/api/models/builders/query-param.builder.mjs +0 -49
- package/esm2020/lib/api/models/filter-match-type.model.mjs +0 -24
- package/esm2020/lib/api/models/filter-param.model.mjs +0 -46
- package/esm2020/lib/api/models/index.mjs +0 -9
- package/esm2020/lib/api/models/mappers.mjs +0 -17
- package/esm2020/lib/api/models/query-mode.model.mjs +0 -19
- package/esm2020/lib/api/models/query-param.model.mjs +0 -69
- package/esm2020/lib/api/models/query-result.model.mjs +0 -45
- package/esm2020/lib/api/models/serialization.model.mjs +0 -2
- package/esm2020/lib/api/services/abstract-crud-api.service.mjs +0 -72
- package/esm2020/lib/api/services/index.mjs +0 -2
- package/esm2020/lib/api/utils/index.mjs +0 -3
- package/esm2020/lib/api/utils/medius-rest.util.mjs +0 -70
- package/esm2020/lib/api/utils/object-serializer.util.mjs +0 -226
- package/esm2020/lib/components/action/action.component.mjs +0 -63
- package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -148
- package/esm2020/lib/components/action/index.mjs +0 -4
- package/esm2020/lib/components/action/route/action-route.component.mjs +0 -144
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +0 -140
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +0 -58
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +0 -51
- package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +0 -16
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +0 -26
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +0 -94
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +0 -124
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +0 -17
- package/esm2020/lib/components/form/formly/fields/index.mjs +0 -8
- package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +0 -17
- package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +0 -16
- package/esm2020/lib/components/form/formly/wrappers/index.mjs +0 -3
- package/esm2020/lib/components/form/index.mjs +0 -2
- package/esm2020/lib/components/layout/app.breadcrumb.component.mjs +0 -27
- package/esm2020/lib/components/layout/app.footer.component.mjs +0 -35
- package/esm2020/lib/components/layout/app.main.component.mjs +0 -25
- package/esm2020/lib/components/layout/app.main.component.service.mjs +0 -133
- package/esm2020/lib/components/layout/app.menu.component.mjs +0 -38
- package/esm2020/lib/components/layout/app.menuitem.component.mjs +0 -243
- package/esm2020/lib/components/layout/app.topbar.component.mjs +0 -135
- package/esm2020/lib/components/layout/index.mjs +0 -7
- package/esm2020/lib/components/tableview/index.mjs +0 -4
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +0 -31
- package/esm2020/lib/components/tableview/table/table.component.mjs +0 -173
- package/esm2020/lib/components/tableview/tableview.component.mjs +0 -82
- package/esm2020/lib/components/tableview/tableview.component.service.mjs +0 -18
- package/esm2020/lib/config/formly.config.mjs +0 -165
- package/esm2020/lib/config/index.mjs +0 -2
- package/esm2020/lib/directives/index.mjs +0 -2
- package/esm2020/lib/directives/template.directive.mjs +0 -25
- package/esm2020/lib/mng-commons.module.mjs +0 -338
- package/esm2020/lib/models/action/action.model.mjs +0 -58
- package/esm2020/lib/models/action/index.mjs +0 -2
- package/esm2020/lib/models/config/index.mjs +0 -2
- package/esm2020/lib/models/config/mng-config.model.mjs +0 -3
- package/esm2020/lib/models/descriptors/action-descriptor.model.mjs +0 -283
- package/esm2020/lib/models/descriptors/editor-descriptor.model.mjs +0 -647
- package/esm2020/lib/models/descriptors/index.mjs +0 -6
- package/esm2020/lib/models/descriptors/model-descriptor.model.mjs +0 -34
- package/esm2020/lib/models/descriptors/table-descriptor.model.mjs +0 -123
- package/esm2020/lib/models/descriptors/tableview-descriptor.model.mjs +0 -124
- package/esm2020/lib/models/events/editor-event.model.mjs +0 -14
- package/esm2020/lib/models/events/index.mjs +0 -3
- package/esm2020/lib/models/events/table-event.model.mjs +0 -16
- package/esm2020/lib/models/interfaces/confirmation-service.model.mjs +0 -2
- package/esm2020/lib/models/interfaces/index.mjs +0 -2
- package/esm2020/lib/models/providers/data-provider.model.mjs +0 -86
- package/esm2020/lib/models/providers/index.mjs +0 -2
- package/esm2020/lib/models/types/index.mjs +0 -3
- package/esm2020/lib/models/types/type.decorator.mjs +0 -8
- package/esm2020/lib/models/types/type.model.mjs +0 -2
- package/esm2020/lib/models/validators/field.validator.mjs +0 -21
- package/esm2020/lib/models/validators/index.mjs +0 -2
- package/esm2020/lib/pipes/index.mjs +0 -2
- package/esm2020/lib/pipes/property-path.pipe.mjs +0 -36
- package/esm2020/lib/services/action.service.mjs +0 -239
- package/esm2020/lib/services/breadcrumb.service.mjs +0 -21
- package/esm2020/lib/services/configuration.service.mjs +0 -77
- package/esm2020/lib/services/index.mjs +0 -7
- package/esm2020/lib/services/menu.service.mjs +0 -26
- package/esm2020/lib/services/navigation.service.mjs +0 -49
- package/esm2020/lib/services/providers/config-service.provider.mjs +0 -12
- package/esm2020/lib/services/providers/formly-config.provider.mjs +0 -31
- package/esm2020/lib/services/providers/index.mjs +0 -3
- package/esm2020/lib/services/settings.service.mjs +0 -40
- package/esm2020/lib/utils/editor-formly.util.mjs +0 -165
- package/esm2020/lib/utils/i18n.util.mjs +0 -75
- package/esm2020/lib/utils/index.mjs +0 -5
- package/esm2020/lib/utils/model.util.mjs +0 -38
- package/esm2020/lib/utils/type.util.mjs +0 -43
- package/esm2020/mediusinc-mng-commons.mjs +0 -5
- package/esm2020/public-api.mjs +0 -33
- package/fesm2015/mediusinc-mng-commons.mjs +0 -5056
- package/fesm2015/mediusinc-mng-commons.mjs.map +0 -1
- package/fesm2020/mediusinc-mng-commons.mjs +0 -5012
- package/fesm2020/mediusinc-mng-commons.mjs.map +0 -1
- package/lib/api/models/builders/query-param.builder.d.ts +0 -11
- package/lib/api/models/filter-match-type.model.d.ts +0 -21
- package/lib/api/models/filter-param.model.d.ts +0 -23
- package/lib/api/models/mappers.d.ts +0 -6
- package/lib/api/models/query-param.model.d.ts +0 -31
- package/lib/api/models/query-result.model.d.ts +0 -36
- package/lib/api/services/abstract-crud-api.service.d.ts +0 -23
- package/lib/api/services/index.d.ts +0 -1
- package/lib/api/utils/medius-rest.util.d.ts +0 -6
- package/lib/api/utils/object-serializer.util.d.ts +0 -30
- package/lib/components/action/action.component.d.ts +0 -36
- package/lib/components/action/dialog/action-dialog.component.d.ts +0 -48
- package/lib/components/action/route/action-route.component.d.ts +0 -32
- package/lib/components/form/editor/form-editor.component.d.ts +0 -37
- package/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -21
- package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -19
- package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +0 -6
- package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -12
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -17
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +0 -36
- package/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +0 -6
- package/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +0 -8
- package/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.d.ts +0 -8
- package/lib/components/form/index.d.ts +0 -1
- package/lib/components/layout/app.breadcrumb.component.d.ts +0 -16
- package/lib/components/layout/app.footer.component.d.ts +0 -8
- package/lib/components/layout/app.main.component.d.ts +0 -12
- package/lib/components/layout/app.main.component.service.d.ts +0 -40
- package/lib/components/layout/app.menu.component.d.ts +0 -14
- package/lib/components/layout/app.menuitem.component.d.ts +0 -31
- package/lib/components/layout/app.topbar.component.d.ts +0 -16
- package/lib/components/layout/index.d.ts +0 -6
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +0 -15
- package/lib/components/tableview/table/table.component.d.ts +0 -47
- package/lib/components/tableview/tableview.component.d.ts +0 -36
- package/lib/components/tableview/tableview.component.service.d.ts +0 -11
- package/lib/config/formly.config.d.ts +0 -8
- package/lib/directives/index.d.ts +0 -1
- package/lib/directives/template.directive.d.ts +0 -11
- package/lib/mng-commons.module.d.ts +0 -74
- package/lib/models/action/action.model.d.ts +0 -53
- package/lib/models/action/index.d.ts +0 -1
- package/lib/models/config/mng-config.model.d.ts +0 -19
- package/lib/models/descriptors/action-descriptor.model.d.ts +0 -124
- package/lib/models/descriptors/editor-descriptor.model.d.ts +0 -248
- package/lib/models/descriptors/index.d.ts +0 -5
- package/lib/models/descriptors/model-descriptor.model.d.ts +0 -15
- package/lib/models/descriptors/table-descriptor.model.d.ts +0 -45
- package/lib/models/descriptors/tableview-descriptor.model.d.ts +0 -38
- package/lib/models/events/editor-event.model.d.ts +0 -11
- package/lib/models/events/index.d.ts +0 -2
- package/lib/models/events/table-event.model.d.ts +0 -17
- package/lib/models/interfaces/confirmation-service.model.d.ts +0 -6
- package/lib/models/interfaces/index.d.ts +0 -1
- package/lib/models/providers/data-provider.model.d.ts +0 -62
- package/lib/models/providers/index.d.ts +0 -1
- package/lib/models/types/type.decorator.d.ts +0 -2
- package/lib/models/types/type.model.d.ts +0 -10
- package/lib/models/validators/field.validator.d.ts +0 -18
- package/lib/models/validators/index.d.ts +0 -1
- package/lib/pipes/property-path.pipe.d.ts +0 -7
- package/lib/services/action.service.d.ts +0 -92
- package/lib/services/breadcrumb.service.d.ts +0 -9
- package/lib/services/configuration.service.d.ts +0 -35
- package/lib/services/menu.service.d.ts +0 -11
- package/lib/services/navigation.service.d.ts +0 -14
- package/lib/services/providers/config-service.provider.d.ts +0 -5
- package/lib/services/providers/formly-config.provider.d.ts +0 -4
- package/lib/services/settings.service.d.ts +0 -18
- package/lib/utils/editor-formly.util.d.ts +0 -9
- package/lib/utils/i18n.util.d.ts +0 -14
- package/lib/utils/model.util.d.ts +0 -5
- package/lib/utils/type.util.d.ts +0 -15
- package/mediusinc-mng-commons-0.0.1-rc.3.tgz +0 -0
- package/mediusinc-mng-commons.d.ts +0 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {AbstractControl} from '@angular/forms';
|
|
2
|
+
import {FormlyFieldConfig} from '@ngx-formly/core';
|
|
3
|
+
|
|
4
|
+
import {Observable} from 'rxjs';
|
|
5
|
+
|
|
6
|
+
export class FieldValidator {
|
|
7
|
+
private readonly _name: string;
|
|
8
|
+
private readonly _expression?: (control: AbstractControl) => boolean;
|
|
9
|
+
private readonly _message?: (err: any, field: FormlyFieldConfig) => string | Observable<string>;
|
|
10
|
+
private readonly _options?: { errorPath: string };
|
|
11
|
+
|
|
12
|
+
constructor(name: string, expression?: (control: AbstractControl) => boolean,
|
|
13
|
+
message?: (err: any, field: FormlyFieldConfig) => string | Observable<string>, options?: { errorPath: string }) {
|
|
14
|
+
this._name = name;
|
|
15
|
+
this._expression = expression;
|
|
16
|
+
this._message = message;
|
|
17
|
+
this._options = options;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public get name(): string {
|
|
21
|
+
return this._name;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public get expression() {
|
|
25
|
+
return this._expression;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public get message() {
|
|
29
|
+
return this._message;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public get options() {
|
|
33
|
+
return this._options;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './action.descriptor';
|
|
2
|
+
export * from './editor.descriptor';
|
|
3
|
+
export * from './field.validator';
|
|
4
|
+
export * from './lookup.descriptor';
|
|
5
|
+
export * from './model.descriptor';
|
|
6
|
+
export * from './table.descriptor';
|
|
7
|
+
export * from './tableview.descriptor';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {Type} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {Observable} from 'rxjs';
|
|
4
|
+
|
|
5
|
+
import {ILookupDataProvider} from '../data-providers';
|
|
6
|
+
import {ClassType} from '../types';
|
|
7
|
+
import {MediusQueryParam} from '../api/models';
|
|
8
|
+
|
|
9
|
+
export interface ILookupDescriptor<T> {
|
|
10
|
+
modelType: ClassType<T>|null;
|
|
11
|
+
itemsLabelProperty?: string;
|
|
12
|
+
itemsValueProperty?: string;
|
|
13
|
+
dataKeyProperty?: string;
|
|
14
|
+
dataProvider?: ILookupDataProvider<T, any>;
|
|
15
|
+
withItemsLabelProperty(itemsLabelProperty: string): this;
|
|
16
|
+
withItemsValueProperty(itemsLabelProperty: string): this;
|
|
17
|
+
withDataKeyProperty(dataKeyProperty: string): this;
|
|
18
|
+
withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
|
|
19
|
+
withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {ClassType} from '../types';
|
|
2
|
+
import {ModelUtil, TypeUtil} from '../utils';
|
|
3
|
+
|
|
4
|
+
export class ModelDescriptor<T> {
|
|
5
|
+
private readonly _type: ClassType<T>;
|
|
6
|
+
private readonly _typeName: string;
|
|
7
|
+
private _idPropertyName?: string;
|
|
8
|
+
private _titlePropertyName?: string;
|
|
9
|
+
|
|
10
|
+
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string) {
|
|
11
|
+
this._type = modelType;
|
|
12
|
+
this._idPropertyName = idProperty ?? (ModelUtil.findIdAttribute(modelType) ?? undefined);
|
|
13
|
+
this._titlePropertyName = titleProperty ?? (ModelUtil.findTitleAttribute(modelType) ?? undefined);
|
|
14
|
+
this._typeName = TypeUtil.findTypeName(this._type);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public get type() {
|
|
18
|
+
return this._type;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public get typeName() {
|
|
22
|
+
return this._typeName;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public get idPropertyName() {
|
|
26
|
+
return this._idPropertyName;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public get titlePropertyName() {
|
|
30
|
+
return this._titlePropertyName;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public withIdPropertyName(idProperty: string): this {
|
|
34
|
+
this._idPropertyName = idProperty;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public withTitlePropertyName(titleProperty: string): this {
|
|
39
|
+
this._titlePropertyName = titleProperty;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public copy(): ModelDescriptor<T> {
|
|
44
|
+
const model = new ModelDescriptor(this._type, this._idPropertyName, this._titlePropertyName);
|
|
45
|
+
return model;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import {Type} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {Observable} from 'rxjs';
|
|
4
|
+
|
|
5
|
+
import {ModelDescriptor} from './model.descriptor';
|
|
6
|
+
import {ILookupDescriptor} from './lookup.descriptor';
|
|
7
|
+
import {ClassType} from '../types';
|
|
8
|
+
import {ILookupDataProvider, LookupDataProvider} from '../data-providers';
|
|
9
|
+
import {ModelUtil} from '../utils';
|
|
10
|
+
import {MediusQueryParam} from '../api/models';
|
|
11
|
+
|
|
12
|
+
export class TableDescriptor<T> {
|
|
13
|
+
|
|
14
|
+
private readonly _model: ModelDescriptor<T>;
|
|
15
|
+
private _filterDisplay: TableDescriptor.FilterDisplayEnum = TableDescriptor.FilterDisplayEnum.Menu;
|
|
16
|
+
private _paginationMode: TableDescriptor.PaginationModeEnum = TableDescriptor.PaginationModeEnum.Pagination;
|
|
17
|
+
private _columns: Array<ColumnDescriptor<any, T>> = [];
|
|
18
|
+
private _title?: string;
|
|
19
|
+
private _dataKeyProperty?: string;
|
|
20
|
+
private _hasDefaultSort: boolean = false;
|
|
21
|
+
private _defaultSortProperty: string[] = [];
|
|
22
|
+
private _defaultSortAsc: boolean[] = [];
|
|
23
|
+
|
|
24
|
+
private _rowHeight: number = 45;
|
|
25
|
+
private _tableFullHeightOffset: number = 315;
|
|
26
|
+
|
|
27
|
+
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string) {
|
|
28
|
+
this._model = new ModelDescriptor<T>(modelType, idProperty, titleProperty);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public get model() {
|
|
32
|
+
return this._model;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public get filterDisplay() {
|
|
36
|
+
return this._filterDisplay;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public get paginationMode() {
|
|
40
|
+
return this._paginationMode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public get columns() {
|
|
44
|
+
return this._columns;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public get title() {
|
|
48
|
+
return this._title;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public get dataKeyProperty() {
|
|
52
|
+
return this._dataKeyProperty;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public get hasDefaultSort() {
|
|
56
|
+
return this._hasDefaultSort;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public get defaultSortProperty() {
|
|
60
|
+
return this._defaultSortProperty;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public get defaultSortAsc() {
|
|
64
|
+
return this._defaultSortAsc;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public get rowHeight() {
|
|
68
|
+
return this._rowHeight;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public get tableFullHeightOffset() {
|
|
72
|
+
return this._tableFullHeightOffset;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T> {
|
|
76
|
+
this._columns.push(column);
|
|
77
|
+
this.setDataKeyFromColumn();
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public addColumn(property: string): ColumnDescriptor<string, T> {
|
|
82
|
+
const column = new ColumnDescriptor<string, T>(this, property);
|
|
83
|
+
this._columns.push(column);
|
|
84
|
+
this.setDataKeyFromColumn();
|
|
85
|
+
return column;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T> {
|
|
89
|
+
const column = new ColumnDescriptor<number, T>(this, property);
|
|
90
|
+
column.asNumber(displayFormat);
|
|
91
|
+
this._columns.push(column);
|
|
92
|
+
this.setDataKeyFromColumn();
|
|
93
|
+
return column;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T> {
|
|
97
|
+
const column = new ColumnDescriptor<Date, T>(this, property);
|
|
98
|
+
column.asDate(displayFormat);
|
|
99
|
+
this._columns.push(column);
|
|
100
|
+
this.setDataKeyFromColumn();
|
|
101
|
+
return column;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public addColumnBoolean(property: string): ColumnDescriptor<boolean, T> {
|
|
105
|
+
const column = new ColumnDescriptor<boolean, T>(this, property);
|
|
106
|
+
column.asBoolean();
|
|
107
|
+
this._columns.push(column);
|
|
108
|
+
this.setDataKeyFromColumn();
|
|
109
|
+
return column;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T> {
|
|
113
|
+
const column = new ColumnDescriptor<CT, T>(this, property);
|
|
114
|
+
column.withModelType(modelType);
|
|
115
|
+
column.withDisplayPropertyPath(displayProperty);
|
|
116
|
+
this._columns.push(column);
|
|
117
|
+
this.setDataKeyFromColumn();
|
|
118
|
+
return column;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this {
|
|
122
|
+
this._filterDisplay = filterDisplayType;
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
public withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this {
|
|
127
|
+
this._paginationMode = paginationMode;
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public withTitle(title: string): TableDescriptor<T> {
|
|
132
|
+
this._title = title;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public withDataKeyProperty(property: string): TableDescriptor<T> {
|
|
137
|
+
this._dataKeyProperty = property;
|
|
138
|
+
return this;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public withDefaultSort(property: string, asc: boolean = true): TableDescriptor<T> {
|
|
142
|
+
this._hasDefaultSort = true;
|
|
143
|
+
this._defaultSortProperty.push(property);
|
|
144
|
+
this._defaultSortAsc.push(asc);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public withRowHeight(rowHeight: number): TableDescriptor<T> {
|
|
149
|
+
this._rowHeight = rowHeight;
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public withTableFullHeightOffset(tableFullHeightOffset: number): TableDescriptor<T> {
|
|
154
|
+
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private setDataKeyFromColumn() {
|
|
159
|
+
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
160
|
+
this._dataKeyProperty = this._columns[0].property;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
public copy(): TableDescriptor<T> {
|
|
165
|
+
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
166
|
+
descriptor._columns = this.columns.map(c => c.copy());
|
|
167
|
+
descriptor._title = this._title;
|
|
168
|
+
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
169
|
+
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
170
|
+
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
171
|
+
descriptor._filterDisplay = this._filterDisplay;
|
|
172
|
+
return descriptor;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export namespace TableDescriptor {
|
|
177
|
+
export enum PaginationModeEnum {
|
|
178
|
+
Pagination,
|
|
179
|
+
InfiniteScroll
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export enum FilterDisplayEnum {
|
|
183
|
+
Row,
|
|
184
|
+
Menu
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export class ColumnDescriptor<T, TT> {
|
|
189
|
+
|
|
190
|
+
private readonly _table: TableDescriptor<TT>;
|
|
191
|
+
private readonly _property: string;
|
|
192
|
+
private _modelType: ClassType<T>|null = null;
|
|
193
|
+
private _columnType: ColumnDescriptor.TypeEnum = ColumnDescriptor.TypeEnum.String;
|
|
194
|
+
private _title?: string;
|
|
195
|
+
private _displayPropertyPath?: string;
|
|
196
|
+
private _isSortEnabled: boolean = false;
|
|
197
|
+
private _filterDescriptor?: FilterDescriptor<T>;
|
|
198
|
+
private _displayFormat?: string;
|
|
199
|
+
|
|
200
|
+
constructor(table: TableDescriptor<TT>, property: string) {
|
|
201
|
+
this._table = table;
|
|
202
|
+
this._property = property;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
public get table() {
|
|
206
|
+
return this._table;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public get property() {
|
|
210
|
+
return this._property;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
public get modelType() {
|
|
214
|
+
return this._modelType;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public get displayPropertyPath() {
|
|
218
|
+
return this._displayPropertyPath;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public get title() {
|
|
222
|
+
return this._title;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public get isSortEnabled() {
|
|
226
|
+
return this._isSortEnabled;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public get columnType() {
|
|
230
|
+
return this._columnType;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public get filterDescriptor() {
|
|
234
|
+
return this._filterDescriptor;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public get displayFormat() {
|
|
238
|
+
return this._displayFormat;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
public asType(type: ColumnDescriptor.TypeEnum = ColumnDescriptor.TypeEnum.String): this {
|
|
242
|
+
this._columnType = type;
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
public asNumber(displayFormat: string = '1.0-0'): this {
|
|
247
|
+
this._columnType = ColumnDescriptor.TypeEnum.Number;
|
|
248
|
+
this._displayFormat = displayFormat;
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
public asDate(displayFormat: string = 'dd.MM.yyyy'): this {
|
|
253
|
+
this._columnType = ColumnDescriptor.TypeEnum.Date;
|
|
254
|
+
this._displayFormat = displayFormat;
|
|
255
|
+
return this;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
public asBoolean(): this {
|
|
259
|
+
this._columnType = ColumnDescriptor.TypeEnum.Boolean;
|
|
260
|
+
return this;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public withModelType(modelType: ClassType<T>): this {
|
|
264
|
+
this._modelType = modelType;
|
|
265
|
+
return this;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
public withTitle(title: string): this {
|
|
269
|
+
this._title = title;
|
|
270
|
+
return this;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
public withDisplayPropertyPath(displayPropertyPath: string): this {
|
|
274
|
+
this._displayPropertyPath = displayPropertyPath;
|
|
275
|
+
return this;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
public withFilter(): FilterDescriptor<T> {
|
|
279
|
+
this._filterDescriptor = new FilterDescriptor<any>(this._property);
|
|
280
|
+
this._filterDescriptor.asFilterType(this._columnType);
|
|
281
|
+
return this._filterDescriptor;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
public withFilterLookup(): FilterLookupDescriptor<T> {
|
|
285
|
+
const filterDescriptor = new FilterLookupDescriptor<any>(this._property, this._modelType);
|
|
286
|
+
this._filterDescriptor = filterDescriptor;
|
|
287
|
+
return filterDescriptor;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
public withSort(isEnabled: boolean = true): this {
|
|
291
|
+
this._isSortEnabled = isEnabled;
|
|
292
|
+
return this;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
public copy(): ColumnDescriptor<T, TT> {
|
|
296
|
+
const descriptor = new ColumnDescriptor<T, TT>(this._table, this._property);
|
|
297
|
+
descriptor._displayPropertyPath = this._displayPropertyPath;
|
|
298
|
+
descriptor._title = this._title;
|
|
299
|
+
descriptor._isSortEnabled = this._isSortEnabled;
|
|
300
|
+
descriptor._columnType = this._columnType;
|
|
301
|
+
descriptor._filterDescriptor = this._filterDescriptor?.copy();
|
|
302
|
+
return descriptor;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export namespace ColumnDescriptor {
|
|
307
|
+
export enum TypeEnum {
|
|
308
|
+
String,
|
|
309
|
+
Number,
|
|
310
|
+
Boolean,
|
|
311
|
+
Date
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export class FilterDescriptor<T> {
|
|
316
|
+
|
|
317
|
+
protected readonly _property: string;
|
|
318
|
+
protected _filterType = FilterDescriptor.TypeEnum.String;
|
|
319
|
+
protected _filterProperty?: string;
|
|
320
|
+
|
|
321
|
+
protected _placeholder?: string;
|
|
322
|
+
protected _className: string = '';
|
|
323
|
+
|
|
324
|
+
constructor(property: string) {
|
|
325
|
+
this._property = property;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
public get property() {
|
|
329
|
+
return this._property;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
public get filterType() {
|
|
333
|
+
return this._filterType;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public get filterProperty() {
|
|
337
|
+
return this._filterProperty;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
public get placeholder() {
|
|
341
|
+
return this._placeholder;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
public get className() {
|
|
345
|
+
return this._className;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
public asFilterType(filterType: ColumnDescriptor.TypeEnum) {
|
|
349
|
+
this._filterType = filterType;
|
|
350
|
+
return this;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Sets different filter property name instead of default property. Use this if API requires different property provided to perform correct filter.
|
|
355
|
+
* @param filterProperty
|
|
356
|
+
*/
|
|
357
|
+
public withFilterProperty(filterProperty: string): this {
|
|
358
|
+
this._filterProperty = filterProperty;
|
|
359
|
+
return this;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
public withPlaceholder(placeholder: string): this {
|
|
363
|
+
this._placeholder = placeholder;
|
|
364
|
+
return this;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
public withClassName(className: string): this {
|
|
368
|
+
this._className = className;
|
|
369
|
+
return this;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
protected copyFieldsTo(descriptor: FilterDescriptor<T>) {
|
|
373
|
+
descriptor._filterType = this._filterType;
|
|
374
|
+
descriptor._filterProperty = this._filterProperty;
|
|
375
|
+
descriptor._placeholder = this._placeholder;
|
|
376
|
+
descriptor._className = this._className;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
public copy(): FilterDescriptor<T> {
|
|
380
|
+
const descriptor = new FilterDescriptor<T>(this._property);
|
|
381
|
+
this.copyFieldsTo(descriptor);
|
|
382
|
+
return descriptor;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export namespace FilterDescriptor {
|
|
387
|
+
export enum TypeEnum {
|
|
388
|
+
String,
|
|
389
|
+
Number,
|
|
390
|
+
Boolean,
|
|
391
|
+
Date,
|
|
392
|
+
Lookup
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export class FilterLookupDescriptor<T> extends FilterDescriptor<T> implements ILookupDescriptor<T> {
|
|
397
|
+
|
|
398
|
+
private readonly _modelType: ClassType<T>|null = null;
|
|
399
|
+
private _lookupType?: FilterLookupDescriptor.LookupTypeEnum = FilterLookupDescriptor.LookupTypeEnum.Dropdown;
|
|
400
|
+
|
|
401
|
+
private _dataProvider?: ILookupDataProvider<T, any>;
|
|
402
|
+
private _itemsLabelProperty?: string;
|
|
403
|
+
private _itemsValueProperty?: string;
|
|
404
|
+
private _dataKeyProperty? : string;
|
|
405
|
+
|
|
406
|
+
private _multiselect: boolean = false;
|
|
407
|
+
protected _dropdownClassName: string = 'mng-filter-lookup-dropdown';
|
|
408
|
+
|
|
409
|
+
constructor(property: string, modelType: ClassType<T>|null) {
|
|
410
|
+
super(property);
|
|
411
|
+
this._modelType = modelType;
|
|
412
|
+
this._filterType = FilterDescriptor.TypeEnum.Lookup;
|
|
413
|
+
ModelUtil.trySetLookupItemsProperties(this);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
public get modelType() {
|
|
417
|
+
return this._modelType;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
public get lookupType() {
|
|
421
|
+
return this._lookupType;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
public get itemsLabelProperty() {
|
|
425
|
+
return this._itemsLabelProperty;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
public get itemsValueProperty() {
|
|
429
|
+
return this._itemsValueProperty;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
public get dataKeyProperty() {
|
|
433
|
+
return this._dataKeyProperty;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public get dataProvider() {
|
|
437
|
+
return this._dataProvider;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
public get multiselect() {
|
|
441
|
+
return this._multiselect;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
public withItemsLabelProperty(itemsLabelProperty: string): this {
|
|
445
|
+
this._itemsLabelProperty = itemsLabelProperty;
|
|
446
|
+
return this;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
public withItemsValueProperty(itemsValueProperty: string): this {
|
|
450
|
+
this._itemsValueProperty = itemsValueProperty;
|
|
451
|
+
return this;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
public withDataKeyProperty(dataKeyProperty: string): this {
|
|
455
|
+
this._dataKeyProperty = dataKeyProperty;
|
|
456
|
+
return this;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
public get dropdownClassName() {
|
|
460
|
+
return this._dropdownClassName;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
public withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this {
|
|
464
|
+
const dataProvider = new LookupDataProvider<T, S>(this._modelType);
|
|
465
|
+
if (serviceType) {
|
|
466
|
+
dataProvider.withServiceType(serviceType);
|
|
467
|
+
}
|
|
468
|
+
dataProvider.withLookup(lookup);
|
|
469
|
+
this._dataProvider = dataProvider;
|
|
470
|
+
return this;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
public withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this {
|
|
474
|
+
this._dataProvider = dataProvider;
|
|
475
|
+
return this;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
public withMultiselect(multiselect = true) {
|
|
479
|
+
this._multiselect = multiselect;
|
|
480
|
+
return this;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
public withDropdownClassName(dropdownClassName: string): this {
|
|
484
|
+
this._dropdownClassName = dropdownClassName;
|
|
485
|
+
return this;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
public asAutocomplete(): this {
|
|
489
|
+
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
490
|
+
return this;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
protected override copyFieldsTo(descriptor: FilterLookupDescriptor<T>) {
|
|
494
|
+
super.copyFieldsTo(descriptor);
|
|
495
|
+
descriptor._dataProvider = this._dataProvider;
|
|
496
|
+
descriptor._lookupType = this._lookupType;
|
|
497
|
+
descriptor._itemsLabelProperty = this._itemsLabelProperty;
|
|
498
|
+
descriptor._itemsValueProperty = this._itemsValueProperty;
|
|
499
|
+
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
public override copy(): FilterLookupDescriptor<T> {
|
|
503
|
+
const descriptor = new FilterLookupDescriptor<T>(this._property, this._modelType);
|
|
504
|
+
this.copyFieldsTo(descriptor);
|
|
505
|
+
return descriptor;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export namespace FilterLookupDescriptor {
|
|
510
|
+
export enum LookupTypeEnum {
|
|
511
|
+
Dropdown,
|
|
512
|
+
Autocomplete
|
|
513
|
+
}
|
|
514
|
+
}
|