@mediusinc/mng-commons 0.2.1-rc → 0.2.4
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/esm2020/lib/api/models/builders/query-param.builder.mjs +48 -0
- package/esm2020/lib/api/models/filter-match-type.model.mjs +26 -0
- package/esm2020/lib/api/models/filter-param.model.mjs +46 -0
- package/esm2020/lib/api/models/index.mjs +9 -0
- package/esm2020/lib/api/models/mappers.mjs +17 -0
- package/esm2020/lib/api/models/query-mode.model.mjs +19 -0
- package/esm2020/lib/api/models/query-param.model.mjs +69 -0
- package/esm2020/lib/api/models/query-result.model.mjs +45 -0
- package/esm2020/lib/api/models/serialization.model.mjs +2 -0
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +72 -0
- package/esm2020/lib/api/services/index.mjs +2 -0
- package/esm2020/lib/api/utils/index.mjs +3 -0
- package/esm2020/lib/api/utils/medius-rest.util.mjs +122 -0
- package/esm2020/lib/api/utils/object-serializer.util.mjs +226 -0
- package/esm2020/lib/components/action/action.component.mjs +65 -0
- package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +148 -0
- package/esm2020/lib/components/action/index.mjs +4 -0
- package/esm2020/lib/components/action/models/action-confirmation-service.model.mjs +2 -0
- package/esm2020/lib/components/action/models/action-execution.model.mjs +58 -0
- package/esm2020/lib/components/action/models/index.mjs +3 -0
- package/esm2020/lib/components/action/route/action-route.component.mjs +144 -0
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +114 -0
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +113 -0
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +141 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +19 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +19 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +16 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +26 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +109 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +122 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +17 -0
- package/esm2020/lib/components/form/formly/fields/index.mjs +8 -0
- package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +17 -0
- package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +16 -0
- package/esm2020/lib/components/form/formly/wrappers/index.mjs +3 -0
- package/esm2020/lib/components/form/index.mjs +4 -0
- package/esm2020/lib/components/form/models/form-editor.event.mjs +7 -0
- package/esm2020/lib/components/form/models/index.mjs +2 -0
- package/esm2020/lib/components/layout/breadcrumb.component.mjs +17 -0
- package/esm2020/lib/components/layout/footer.component.mjs +17 -0
- package/esm2020/lib/components/layout/index.mjs +7 -0
- package/esm2020/lib/components/layout/main-layout.component.mjs +54 -0
- package/esm2020/lib/components/layout/menu-item.component.mjs +173 -0
- package/esm2020/lib/components/layout/menu.component.mjs +20 -0
- package/esm2020/lib/components/layout/services/index.mjs +2 -0
- package/esm2020/lib/components/layout/services/main-layout.component.service.mjs +190 -0
- package/esm2020/lib/components/layout/topbar.component.mjs +59 -0
- package/esm2020/lib/components/tableview/index.mjs +6 -0
- package/esm2020/lib/components/tableview/models/index.mjs +2 -0
- package/esm2020/lib/components/tableview/models/table.event.mjs +16 -0
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +24 -0
- package/esm2020/lib/components/tableview/services/index.mjs +2 -0
- package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +17 -0
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +74 -0
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +25 -0
- package/esm2020/lib/components/tableview/table/table.component.mjs +307 -0
- package/esm2020/lib/components/tableview/tableview.component.mjs +82 -0
- package/esm2020/lib/config/formly.config.mjs +136 -0
- package/esm2020/lib/config/index.mjs +2 -0
- package/esm2020/lib/config/models/index.mjs +2 -0
- package/esm2020/lib/config/models/mng-config.model.mjs +2 -0
- package/esm2020/lib/data-providers/base.data-provider.mjs +24 -0
- package/esm2020/lib/data-providers/editor.data-provider.mjs +37 -0
- package/esm2020/lib/data-providers/index.mjs +6 -0
- package/esm2020/lib/data-providers/lookup.data-provider.mjs +16 -0
- package/esm2020/lib/data-providers/table.data-provider.mjs +2 -0
- package/esm2020/lib/data-providers/tableview.data-provider.mjs +17 -0
- package/esm2020/lib/descriptors/action.descriptor.mjs +332 -0
- package/esm2020/lib/descriptors/editor.descriptor.mjs +670 -0
- package/esm2020/lib/descriptors/field.validator.mjs +21 -0
- package/esm2020/lib/descriptors/index.mjs +8 -0
- package/esm2020/lib/descriptors/lookup.descriptor.mjs +2 -0
- package/esm2020/lib/descriptors/model.descriptor.mjs +34 -0
- package/esm2020/lib/descriptors/table.descriptor.mjs +401 -0
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +131 -0
- package/esm2020/lib/directives/component.directive.mjs +23 -0
- package/esm2020/lib/directives/index.mjs +3 -0
- package/esm2020/lib/directives/template.directive.mjs +29 -0
- package/esm2020/lib/mng-commons.module.mjs +410 -0
- package/esm2020/lib/models/index.mjs +3 -0
- package/esm2020/lib/models/router.model.mjs +2 -0
- package/esm2020/lib/models/user.model.mjs +2 -0
- package/esm2020/lib/pipes/boolean.pipe.mjs +22 -0
- package/esm2020/lib/pipes/index.mjs +3 -0
- package/esm2020/lib/pipes/property-path.pipe.mjs +36 -0
- package/esm2020/lib/services/action.service.mjs +269 -0
- package/esm2020/lib/services/commons.service.mjs +354 -0
- package/esm2020/lib/services/configuration.service.mjs +78 -0
- package/esm2020/lib/services/index.mjs +5 -0
- package/esm2020/lib/services/navigation.service.mjs +48 -0
- package/esm2020/lib/services/providers/commons-init.provider.mjs +4 -0
- package/esm2020/lib/services/providers/config-service.provider.mjs +20 -0
- package/esm2020/lib/services/providers/formly-config.provider.mjs +31 -0
- package/esm2020/lib/services/providers/index.mjs +4 -0
- package/esm2020/lib/services/tokens/browser-storage.token.mjs +6 -0
- package/esm2020/lib/services/tokens/index.mjs +3 -0
- package/esm2020/lib/services/tokens/module-config.token.mjs +3 -0
- package/esm2020/lib/types/index.mjs +3 -0
- package/esm2020/lib/types/type.decorator.mjs +7 -0
- package/esm2020/lib/types/type.model.mjs +2 -0
- package/esm2020/lib/utils/editor-formly.util.mjs +176 -0
- package/esm2020/lib/utils/i18n.util.mjs +125 -0
- package/esm2020/lib/utils/index.mjs +6 -0
- package/esm2020/lib/utils/model.util.mjs +57 -0
- package/esm2020/lib/utils/toast.util.mjs +39 -0
- package/esm2020/lib/utils/type.util.mjs +39 -0
- package/esm2020/mediusinc-mng-commons.mjs +5 -0
- package/esm2020/public-api.mjs +36 -0
- package/fesm2015/mediusinc-mng-commons.mjs +6252 -0
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -0
- package/fesm2020/mediusinc-mng-commons.mjs +6177 -0
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -0
- package/lib/api/models/builders/query-param.builder.d.ts +11 -0
- package/{src/lib/api/models/query-mode.model.ts → lib/api/models/filter-match-type.model.d.ts} +11 -6
- package/lib/api/models/filter-param.model.d.ts +23 -0
- package/{src/lib/api/models/index.ts → lib/api/models/index.d.ts} +0 -2
- package/lib/api/models/mappers.d.ts +6 -0
- package/lib/api/models/query-mode.model.d.ts +16 -0
- package/lib/api/models/query-param.model.d.ts +31 -0
- package/lib/api/models/query-result.model.d.ts +36 -0
- package/{src/lib/api/models/serialization.model.ts → lib/api/models/serialization.model.d.ts} +0 -1
- package/lib/api/services/crud-api.abstract.service.d.ts +23 -0
- package/{src/lib/api/services/index.ts → lib/api/services/index.d.ts} +0 -0
- package/{src/lib/api/utils/index.ts → lib/api/utils/index.d.ts} +0 -0
- package/lib/api/utils/medius-rest.util.d.ts +12 -0
- package/lib/api/utils/object-serializer.util.d.ts +30 -0
- package/lib/components/action/action.component.d.ts +36 -0
- package/lib/components/action/dialog/action-dialog.component.d.ts +46 -0
- package/{src/lib/components/action/index.ts → lib/components/action/index.d.ts} +0 -0
- package/{src/lib/components/action/models/action-confirmation-service.model.ts → lib/components/action/models/action-confirmation-service.model.d.ts} +2 -3
- package/lib/components/action/models/action-execution.model.d.ts +53 -0
- package/{src/lib/components/action/models/index.ts → lib/components/action/models/index.d.ts} +0 -0
- package/lib/components/action/route/action-route.component.d.ts +32 -0
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +36 -0
- package/lib/components/form/dropdown/dropdown.component.d.ts +34 -0
- package/lib/components/form/editor/form-editor.component.d.ts +39 -0
- package/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +11 -0
- package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +11 -0
- package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +6 -0
- package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +12 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +17 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +36 -0
- package/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +6 -0
- package/{src/lib/components/form/formly/fields/index.ts → lib/components/form/formly/fields/index.d.ts} +0 -0
- package/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +8 -0
- package/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.d.ts +8 -0
- package/{src/lib/components/form/formly/wrappers/index.ts → lib/components/form/formly/wrappers/index.d.ts} +0 -0
- package/{src/lib/components/form/index.ts → lib/components/form/index.d.ts} +0 -0
- package/lib/components/form/models/form-editor.event.d.ts +5 -0
- package/{src/lib/components/form/models/index.ts → lib/components/form/models/index.d.ts} +0 -0
- package/lib/components/layout/breadcrumb.component.d.ts +8 -0
- package/lib/components/layout/footer.component.d.ts +9 -0
- package/{src/lib/components/layout/index.ts → lib/components/layout/index.d.ts} +0 -0
- package/lib/components/layout/main-layout.component.d.ts +21 -0
- package/lib/components/layout/menu-item.component.d.ts +29 -0
- package/lib/components/layout/menu.component.d.ts +10 -0
- package/{src/lib/components/layout/services/index.ts → lib/components/layout/services/index.d.ts} +0 -0
- package/lib/components/layout/services/main-layout.component.service.d.ts +65 -0
- package/lib/components/layout/topbar.component.d.ts +25 -0
- package/{src/lib/components/tableview/index.ts → lib/components/tableview/index.d.ts} +0 -0
- package/{src/lib/components/tableview/models/index.ts → lib/components/tableview/models/index.d.ts} +0 -0
- package/lib/components/tableview/models/table.event.d.ts +17 -0
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +14 -0
- package/{src/lib/components/tableview/services/index.ts → lib/components/tableview/services/index.d.ts} +0 -0
- package/lib/components/tableview/services/tableview.component.service.d.ts +13 -0
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +22 -0
- package/lib/components/tableview/table/column-value/column-value.component.d.ts +12 -0
- package/lib/components/tableview/table/table.component.d.ts +79 -0
- package/lib/components/tableview/tableview.component.d.ts +35 -0
- package/lib/config/formly.config.d.ts +14 -0
- package/{src/lib/config/index.ts → lib/config/index.d.ts} +0 -0
- package/{src/lib/config/models/index.ts → lib/config/models/index.d.ts} +0 -0
- package/{src/lib/config/models/mng-config.model.ts → lib/config/models/mng-config.model.d.ts} +8 -9
- package/lib/data-providers/base.data-provider.d.ts +17 -0
- package/lib/data-providers/editor.data-provider.d.ts +25 -0
- package/{src/lib/data-providers/index.ts → lib/data-providers/index.d.ts} +0 -0
- package/lib/data-providers/lookup.data-provider.d.ts +14 -0
- package/{src/lib/data-providers/table.data-provider.ts → lib/data-providers/table.data-provider.d.ts} +3 -5
- package/lib/data-providers/tableview.data-provider.d.ts +15 -0
- package/lib/descriptors/action.descriptor.d.ts +148 -0
- package/lib/descriptors/editor.descriptor.d.ts +255 -0
- package/lib/descriptors/field.validator.d.ts +18 -0
- package/{src/lib/descriptors/index.ts → lib/descriptors/index.d.ts} +0 -0
- package/{src/lib/descriptors/lookup.descriptor.ts → lib/descriptors/lookup.descriptor.d.ts} +6 -9
- package/lib/descriptors/model.descriptor.d.ts +15 -0
- package/lib/descriptors/table.descriptor.d.ts +164 -0
- package/lib/descriptors/tableview.descriptor.d.ts +39 -0
- package/lib/directives/component.directive.d.ts +11 -0
- package/{src/lib/directives/index.ts → lib/directives/index.d.ts} +0 -0
- package/lib/directives/template.directive.d.ts +13 -0
- package/lib/mng-commons.module.d.ts +79 -0
- package/{src/lib/models/index.ts → lib/models/index.d.ts} +0 -0
- package/lib/models/router.model.d.ts +14 -0
- package/{src/lib/models/user.model.ts → lib/models/user.model.d.ts} +2 -3
- package/lib/pipes/boolean.pipe.d.ts +7 -0
- package/{src/lib/pipes/index.ts → lib/pipes/index.d.ts} +0 -0
- package/lib/pipes/property-path.pipe.d.ts +7 -0
- package/lib/services/action.service.d.ts +92 -0
- package/lib/services/commons.service.d.ts +72 -0
- package/lib/services/configuration.service.d.ts +35 -0
- package/{src/lib/services/index.ts → lib/services/index.d.ts} +0 -0
- package/lib/services/navigation.service.d.ts +14 -0
- package/lib/services/providers/commons-init.provider.d.ts +2 -0
- package/lib/services/providers/config-service.provider.d.ts +5 -0
- package/lib/services/providers/formly-config.provider.d.ts +4 -0
- package/{src/lib/services/providers/index.ts → lib/services/providers/index.d.ts} +0 -0
- package/lib/services/tokens/browser-storage.token.d.ts +2 -0
- package/{src/lib/services/tokens/index.ts → lib/services/tokens/index.d.ts} +0 -0
- package/lib/services/tokens/module-config.token.d.ts +3 -0
- package/{src/lib/types/index.ts → lib/types/index.d.ts} +0 -0
- package/lib/types/type.decorator.d.ts +2 -0
- package/lib/types/type.model.d.ts +10 -0
- package/lib/utils/editor-formly.util.d.ts +9 -0
- package/lib/utils/i18n.util.d.ts +18 -0
- package/{src/lib/utils/index.ts → lib/utils/index.d.ts} +0 -0
- package/lib/utils/model.util.d.ts +7 -0
- package/lib/utils/toast.util.d.ts +13 -0
- package/lib/utils/type.util.d.ts +15 -0
- package/mediusinc-mng-commons.d.ts +5 -0
- package/package.json +27 -6
- package/{src/public-api.ts → public-api.d.ts} +0 -17
- package/.browserslistrc +0 -16
- package/karma.conf.js +0 -51
- package/ng-package.json +0 -14
- package/src/lib/api/models/builders/query-param.builder.ts +0 -54
- package/src/lib/api/models/filter-match-type.model.ts +0 -25
- package/src/lib/api/models/filter-param.model.ts +0 -59
- package/src/lib/api/models/mappers.ts +0 -18
- package/src/lib/api/models/query-param.model.ts +0 -99
- package/src/lib/api/models/query-result.model.ts +0 -77
- package/src/lib/api/services/crud-api.abstract.service.ts +0 -113
- package/src/lib/api/utils/medius-rest.util.ts +0 -146
- package/src/lib/api/utils/object-serializer.util.ts +0 -227
- package/src/lib/components/action/action.component.html +0 -30
- package/src/lib/components/action/action.component.ts +0 -77
- package/src/lib/components/action/dialog/action-dialog.component.html +0 -26
- package/src/lib/components/action/dialog/action-dialog.component.ts +0 -171
- package/src/lib/components/action/models/action-execution.model.ts +0 -81
- package/src/lib/components/action/route/action-route.component.html +0 -1
- package/src/lib/components/action/route/action-route.component.ts +0 -159
- package/src/lib/components/form/autocomplete/autocomplete.component.html +0 -16
- package/src/lib/components/form/autocomplete/autocomplete.component.ts +0 -113
- package/src/lib/components/form/dropdown/dropdown.component.html +0 -29
- package/src/lib/components/form/dropdown/dropdown.component.ts +0 -109
- package/src/lib/components/form/editor/form-editor.component.html +0 -5
- package/src/lib/components/form/editor/form-editor.component.ts +0 -149
- package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.html +0 -7
- package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.ts +0 -21
- package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.html +0 -9
- package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.ts +0 -22
- package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.html +0 -8
- package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.ts +0 -10
- package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.html +0 -56
- package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.ts +0 -22
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.html +0 -13
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.scss +0 -4
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.ts +0 -114
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.html +0 -37
- package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.ts +0 -133
- package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.html +0 -10
- package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.ts +0 -10
- package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.html +0 -7
- package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.ts +0 -13
- package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.html +0 -6
- package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.ts +0 -13
- package/src/lib/components/form/models/form-editor.event.ts +0 -7
- package/src/lib/components/layout/breadcrumb.component.html +0 -5
- package/src/lib/components/layout/breadcrumb.component.ts +0 -12
- package/src/lib/components/layout/footer.component.html +0 -7
- package/src/lib/components/layout/footer.component.ts +0 -15
- package/src/lib/components/layout/main-layout.component.html +0 -26
- package/src/lib/components/layout/main-layout.component.ts +0 -54
- package/src/lib/components/layout/menu-item.component.html +0 -41
- package/src/lib/components/layout/menu-item.component.ts +0 -170
- package/src/lib/components/layout/menu.component.html +0 -27
- package/src/lib/components/layout/menu.component.ts +0 -17
- package/src/lib/components/layout/services/main-layout.component.service.ts +0 -231
- package/src/lib/components/layout/topbar.component.html +0 -38
- package/src/lib/components/layout/topbar.component.ts +0 -62
- package/src/lib/components/tableview/models/table.event.ts +0 -22
- package/src/lib/components/tableview/route/tableview-route.abstract.component.ts +0 -31
- package/src/lib/components/tableview/services/tableview.component.service.ts +0 -22
- package/src/lib/components/tableview/table/column-filter/column-filter.component.html +0 -36
- package/src/lib/components/tableview/table/column-filter/column-filter.component.ts +0 -70
- package/src/lib/components/tableview/table/column-value/column-value.component.html +0 -14
- package/src/lib/components/tableview/table/column-value/column-value.component.ts +0 -19
- package/src/lib/components/tableview/table/table.component.html +0 -110
- package/src/lib/components/tableview/table/table.component.ts +0 -327
- package/src/lib/components/tableview/tableview.component.html +0 -37
- package/src/lib/components/tableview/tableview.component.ts +0 -78
- package/src/lib/config/formly.config.ts +0 -154
- package/src/lib/data-providers/base.data-provider.ts +0 -42
- package/src/lib/data-providers/editor.data-provider.ts +0 -60
- package/src/lib/data-providers/lookup.data-provider.ts +0 -29
- package/src/lib/data-providers/tableview.data-provider.ts +0 -29
- package/src/lib/descriptors/action.descriptor.ts +0 -439
- package/src/lib/descriptors/editor.descriptor.ts +0 -880
- package/src/lib/descriptors/field.validator.ts +0 -35
- package/src/lib/descriptors/model.descriptor.ts +0 -47
- package/src/lib/descriptors/table.descriptor.ts +0 -514
- package/src/lib/descriptors/tableview.descriptor.ts +0 -180
- package/src/lib/directives/component.directive.ts +0 -18
- package/src/lib/directives/template.directive.ts +0 -24
- package/src/lib/mng-commons.module.ts +0 -240
- package/src/lib/models/router.model.ts +0 -16
- package/src/lib/pipes/boolean.pipe.ts +0 -17
- package/src/lib/pipes/property-path.pipe.ts +0 -30
- package/src/lib/services/action.service.ts +0 -310
- package/src/lib/services/commons.service.ts +0 -407
- package/src/lib/services/configuration.service.ts +0 -98
- package/src/lib/services/navigation.service.ts +0 -42
- package/src/lib/services/providers/commons-init.provider.ts +0 -5
- package/src/lib/services/providers/config-service.provider.ts +0 -22
- package/src/lib/services/providers/formly-config.provider.ts +0 -39
- package/src/lib/services/tokens/browser-storage.token.ts +0 -9
- package/src/lib/services/tokens/module-config.token.ts +0 -5
- package/src/lib/types/type.decorator.ts +0 -7
- package/src/lib/types/type.model.ts +0 -12
- package/src/lib/utils/editor-formly.util.ts +0 -193
- package/src/lib/utils/i18n.util.ts +0 -148
- package/src/lib/utils/model.util.ts +0 -66
- package/src/lib/utils/toast.util.ts +0 -49
- package/src/lib/utils/type.util.ts +0 -44
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit, ChangeDetectorRef, OnDestroy, ChangeDetectionStrategy} from '@angular/core';
|
|
2
|
-
import {Router, NavigationEnd} from '@angular/router';
|
|
3
|
-
import {trigger, state, style, transition, animate} from '@angular/animations';
|
|
4
|
-
|
|
5
|
-
import {Subscription} from 'rxjs';
|
|
6
|
-
import {filter} from 'rxjs/operators';
|
|
7
|
-
|
|
8
|
-
import {MngCommonsService} from '../../services';
|
|
9
|
-
import {MngMainLayoutComponentService} from './services';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
/* tslint:disable:component-selector */
|
|
13
|
-
selector: '[mng-menuitem]',
|
|
14
|
-
/* tslint:enable:component-selector */
|
|
15
|
-
templateUrl: './menu-item.component.html',
|
|
16
|
-
host: {
|
|
17
|
-
'[class.layout-root-menuitem]': 'root',
|
|
18
|
-
'[class.active-menuitem]': 'active'
|
|
19
|
-
},
|
|
20
|
-
animations: [
|
|
21
|
-
trigger('children', [
|
|
22
|
-
state('void', style({
|
|
23
|
-
height: '0px'
|
|
24
|
-
})),
|
|
25
|
-
state('hiddenAnimated', style({
|
|
26
|
-
height: '0px'
|
|
27
|
-
})),
|
|
28
|
-
state('visibleAnimated', style({
|
|
29
|
-
height: '*'
|
|
30
|
-
})),
|
|
31
|
-
state('visible', style({
|
|
32
|
-
height: '*',
|
|
33
|
-
'z-index': 100
|
|
34
|
-
})),
|
|
35
|
-
state('hidden', style({
|
|
36
|
-
height: '0px',
|
|
37
|
-
'z-index': '*'
|
|
38
|
-
})),
|
|
39
|
-
transition('visibleAnimated => hiddenAnimated', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')),
|
|
40
|
-
transition('hiddenAnimated => visibleAnimated', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')),
|
|
41
|
-
transition('void => visibleAnimated, visibleAnimated => void', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
|
|
42
|
-
])
|
|
43
|
-
],
|
|
44
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
45
|
-
})
|
|
46
|
-
export class MngMenuItemComponent implements OnInit, OnDestroy {
|
|
47
|
-
|
|
48
|
-
@Input() item: any;
|
|
49
|
-
|
|
50
|
-
@Input() index: number = 0;
|
|
51
|
-
|
|
52
|
-
@Input() root: boolean = false;
|
|
53
|
-
|
|
54
|
-
@Input() parentKey: string|null = null;
|
|
55
|
-
|
|
56
|
-
active = false;
|
|
57
|
-
|
|
58
|
-
hover: boolean = false;
|
|
59
|
-
|
|
60
|
-
menuSourceSubscription: Subscription;
|
|
61
|
-
|
|
62
|
-
menuResetSubscription: Subscription;
|
|
63
|
-
|
|
64
|
-
key: string = '';
|
|
65
|
-
|
|
66
|
-
constructor(
|
|
67
|
-
public router: Router,
|
|
68
|
-
private cd: ChangeDetectorRef,
|
|
69
|
-
public mngCommons: MngCommonsService,
|
|
70
|
-
public mainLayoutService: MngMainLayoutComponentService
|
|
71
|
-
) {
|
|
72
|
-
this.menuSourceSubscription = this.mngCommons.menuActiveKey$.subscribe(key => {
|
|
73
|
-
// deactivate current active menu
|
|
74
|
-
if (this.active && this.key !== key && key.indexOf(this.key) !== 0) {
|
|
75
|
-
this.active = false;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
this.menuResetSubscription = this.mngCommons.menuReset$.subscribe(() => {
|
|
80
|
-
this.active = false;
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
this.router.events
|
|
84
|
-
.pipe(filter(event => event instanceof NavigationEnd))
|
|
85
|
-
.subscribe(params => {
|
|
86
|
-
if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
|
|
87
|
-
this.active = false;
|
|
88
|
-
} else {
|
|
89
|
-
if (this.item.routerLink) {
|
|
90
|
-
this.updateActiveStateFromRoute();
|
|
91
|
-
} else {
|
|
92
|
-
this.active = false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
ngOnInit() {
|
|
99
|
-
if (!this.mngCommons.menuModeIsSlim && this.item.routerLink) {
|
|
100
|
-
this.updateActiveStateFromRoute();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
this.key = this.parentKey ? this.parentKey + '-' + this.index : String(this.index);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
updateActiveStateFromRoute() {
|
|
107
|
-
this.active = this.router.isActive(this.item.routerLink[0], this.item.items ? false : true);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
itemClick(event: Event) {
|
|
111
|
-
// avoid processing disabled items
|
|
112
|
-
if (this.item.disabled) {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// navigate with hover in horizontal mode
|
|
118
|
-
if (this.root) {
|
|
119
|
-
this.mainLayoutService.menuHoverActive = !this.mainLayoutService.menuHoverActive;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// notify other items
|
|
123
|
-
this.mngCommons.menuChangeActiveKey(this.key);
|
|
124
|
-
|
|
125
|
-
// execute command
|
|
126
|
-
if (this.item.command) {
|
|
127
|
-
this.item.command({originalEvent: event, item: this.item});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// toggle active state
|
|
131
|
-
if (this.item.items) {
|
|
132
|
-
this.active = !this.active;
|
|
133
|
-
} else {
|
|
134
|
-
// activate item
|
|
135
|
-
this.active = true;
|
|
136
|
-
|
|
137
|
-
if (this.mainLayoutService.isMobile()) {
|
|
138
|
-
this.mainLayoutService.staticMenuMobileActive = false;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (this.mngCommons.menuModeIsOverlay) {
|
|
142
|
-
this.mainLayoutService.overlayMenuActive = false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// reset horizontal menu
|
|
146
|
-
if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()){
|
|
147
|
-
this.mngCommons.menuReset();
|
|
148
|
-
this.mainLayoutService.menuHoverActive = false;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
onMouseEnter() {
|
|
154
|
-
// activate item on hover
|
|
155
|
-
if (this.root && this.mainLayoutService.menuHoverActive && (this.mngCommons.menuModeIsSlim) && this.mainLayoutService.isDesktop()) {
|
|
156
|
-
this.mngCommons.menuChangeActiveKey(this.key);
|
|
157
|
-
this.active = true;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
ngOnDestroy() {
|
|
162
|
-
if (this.menuSourceSubscription) {
|
|
163
|
-
this.menuSourceSubscription.unsubscribe();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (this.menuResetSubscription) {
|
|
167
|
-
this.menuResetSubscription.unsubscribe();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<div class="layout-menu-wrapper" [ngClass]="{ 'layout-sidebar-active': (mainLayoutService.sidebarActive$ | async) }"
|
|
2
|
-
(click)="mainLayoutService.onSidebarClick($event)" (mouseover)="mainLayoutService.onSidebarMouseOver($event)" (mouseleave)="mainLayoutService.onSidebarMouseLeave($event)">
|
|
3
|
-
<div class="menu-logo">
|
|
4
|
-
|
|
5
|
-
<a routerLink="/" class="logo">
|
|
6
|
-
<img [src]="mngCommons.colorSchemeIsLight ? mngCommons.appLogoDark : mngCommons.appLogoLight" />
|
|
7
|
-
</a>
|
|
8
|
-
|
|
9
|
-
<a routerLink="/" class="app-name" *ngIf="!(mngCommons.menuModeIsSlim$ | async) || (mainLayoutService.isMobile$ | async)">
|
|
10
|
-
<img [src]="mngCommons.colorSchemeIsLight ? mngCommons.appLogoNameDark : mngCommons.appLogoNameLight" />
|
|
11
|
-
</a>
|
|
12
|
-
<a *ngIf="mngCommons.menuPinEnabled" class="menu-pin" (click)="mainLayoutService.onToggleMenu($event)">
|
|
13
|
-
<span *ngIf="mngCommons.menuModeIsOverlay$ | async" class="pi pi-times"></span>
|
|
14
|
-
<span *ngIf="(mngCommons.menuModeIsSidebar$ | async) && !(mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)" class="pi pi-unlock"></span>
|
|
15
|
-
<span *ngIf="(mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async) && (mainLayoutService.pinActive$ | async)" class="pi pi-lock"></span>
|
|
16
|
-
</a>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="layout-menu-container">
|
|
20
|
-
<ul class="layout-menu">
|
|
21
|
-
<ng-container *ngFor="let item of (mngCommons.menuItems); let i = index;">
|
|
22
|
-
<li mng-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
|
|
23
|
-
<li *ngIf="item.separator" class="menu-separator"></li>
|
|
24
|
-
</ng-container>
|
|
25
|
-
</ul>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {ChangeDetectionStrategy, Component} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import {MngCommonsService} from '../../services';
|
|
4
|
-
import {MngMainLayoutComponentService} from './services';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'mng-menu',
|
|
8
|
-
templateUrl: './menu.component.html',
|
|
9
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
10
|
-
})
|
|
11
|
-
export class MngMenuComponent {
|
|
12
|
-
|
|
13
|
-
constructor(
|
|
14
|
-
public mngCommons: MngCommonsService,
|
|
15
|
-
public mainLayoutService: MngMainLayoutComponentService
|
|
16
|
-
) {}
|
|
17
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import {Injectable} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import {MngCommonsService} from '../../../services';
|
|
4
|
-
import {BehaviorSubject, Observable, Subject} from 'rxjs';
|
|
5
|
-
import {map} from 'rxjs/operators';
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class MngMainLayoutComponentService {
|
|
9
|
-
|
|
10
|
-
private _overlayMenuActive: boolean = false;
|
|
11
|
-
private _overlayMenuActiveSubject: Subject<boolean> = new BehaviorSubject(this._overlayMenuActive);
|
|
12
|
-
private _staticMenuDesktopInactive = false;
|
|
13
|
-
private _staticMenuDesktopInactiveSubject: Subject<boolean> = new BehaviorSubject(this._staticMenuDesktopInactive);
|
|
14
|
-
private _staticMenuMobileActive: boolean = false;
|
|
15
|
-
private _staticMenuMobileActiveSubject: Subject<boolean> = new BehaviorSubject(this._staticMenuMobileActive);
|
|
16
|
-
|
|
17
|
-
private _sidebarActive = true;
|
|
18
|
-
private _sidebarActiveSubject: Subject<boolean> = new BehaviorSubject(this._sidebarActive);
|
|
19
|
-
private _sidebarStatic = true;
|
|
20
|
-
private _sidebarStaticSubject: Subject<boolean> = new BehaviorSubject(this._sidebarStatic);
|
|
21
|
-
|
|
22
|
-
private _menuClick: boolean = false;
|
|
23
|
-
private _menuHoverActive = false;
|
|
24
|
-
private _topbarItemClick: boolean = false;
|
|
25
|
-
|
|
26
|
-
private _activeTopbarItem: any = null;
|
|
27
|
-
private _activeTopbarItemSubject: Subject<any> = new BehaviorSubject(this._activeTopbarItem);
|
|
28
|
-
|
|
29
|
-
private _pinActive: boolean = true;
|
|
30
|
-
private _pinActiveSubject: Subject<boolean> = new BehaviorSubject(this._pinActive);
|
|
31
|
-
|
|
32
|
-
private _innerWidth: number = 1920;
|
|
33
|
-
private _innerWidthSubject: Subject<number> = new BehaviorSubject(this._innerWidth);
|
|
34
|
-
|
|
35
|
-
constructor(private mngCommons: MngCommonsService) { }
|
|
36
|
-
|
|
37
|
-
get overlayMenuActive$(): Observable<boolean> {
|
|
38
|
-
return this._overlayMenuActiveSubject.asObservable();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
set overlayMenuActive(value: boolean) {
|
|
42
|
-
this._overlayMenuActive = value;
|
|
43
|
-
this._overlayMenuActiveSubject.next(value);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get staticMenuDesktopInactive$(): Observable<boolean> {
|
|
47
|
-
return this._staticMenuDesktopInactiveSubject.asObservable();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
set staticMenuDesktopInactive(value: boolean) {
|
|
51
|
-
this._staticMenuDesktopInactive = value;
|
|
52
|
-
this._staticMenuDesktopInactiveSubject.next(value);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
get staticMenuMobileActive$(): Observable<boolean> {
|
|
56
|
-
return this._staticMenuMobileActiveSubject.asObservable();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
set staticMenuMobileActive(value: boolean) {
|
|
60
|
-
this._staticMenuMobileActive = value;
|
|
61
|
-
this._staticMenuMobileActiveSubject.next(value);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
get sidebarActive$(): Observable<boolean> {
|
|
65
|
-
return this._sidebarActiveSubject.asObservable();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
set sidebarActive(value: boolean) {
|
|
69
|
-
this._sidebarActive = value;
|
|
70
|
-
this._sidebarActiveSubject.next(value);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
get sidebarStatic$(): Observable<boolean> {
|
|
74
|
-
return this._sidebarStaticSubject.asObservable();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
set sidebarStatic(value: boolean) {
|
|
78
|
-
this._sidebarStatic = value;
|
|
79
|
-
this._sidebarStaticSubject.next(value);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
set menuHoverActive(value: boolean) {
|
|
83
|
-
this._menuHoverActive = value;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
set topbarItemClick(value: boolean) {
|
|
87
|
-
this._topbarItemClick = value;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
get activeTopbarItem$(): Observable<any> {
|
|
91
|
-
return this._activeTopbarItemSubject.asObservable();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
set activeTopbarItem(value: any) {
|
|
95
|
-
this._activeTopbarItem = value;
|
|
96
|
-
this._activeTopbarItemSubject.next(value);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
get pinActive$(): Observable<boolean> {
|
|
100
|
-
return this._pinActiveSubject.asObservable();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
set pinActive(value: boolean) {
|
|
104
|
-
this._pinActive = value;
|
|
105
|
-
this._pinActiveSubject.next(value);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
get isDesktop$() {
|
|
109
|
-
return this._innerWidthSubject.asObservable().pipe(map(e => this.isWidthDesktop(e)));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
get isMobile$() {
|
|
113
|
-
return this._innerWidthSubject.asObservable().pipe(map(e => this.isWidthMobile(e))) ;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
set innerWidth(value: number) {
|
|
117
|
-
this._innerWidth = value;
|
|
118
|
-
this._innerWidthSubject.next(value);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
onLayoutClick() {
|
|
122
|
-
if (!this._topbarItemClick) {
|
|
123
|
-
this.activeTopbarItem = null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (!this._menuClick) {
|
|
127
|
-
if (this.mngCommons.menuModeIsSlim && !this.isMobile()) {
|
|
128
|
-
this.mngCommons.menuReset();
|
|
129
|
-
this.menuHoverActive = false;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (this._overlayMenuActive || this._staticMenuMobileActive) {
|
|
133
|
-
this.overlayMenuActive = false;
|
|
134
|
-
this.staticMenuMobileActive = false;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
this._menuClick = false;
|
|
139
|
-
this.topbarItemClick = false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
onSidebarClick(event: any) {
|
|
143
|
-
this._menuClick = true;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
onToggleMenu(event: any) {
|
|
147
|
-
this._menuClick = true;
|
|
148
|
-
|
|
149
|
-
if (this._overlayMenuActive) {
|
|
150
|
-
this.overlayMenuActive = false;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (this._sidebarActive) {
|
|
154
|
-
this.sidebarStatic = !this._sidebarStatic;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
event.preventDefault();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
onSidebarMouseOver(event: any) {
|
|
161
|
-
if (this.mngCommons.menuModeIsSidebar && !this._sidebarStatic) {
|
|
162
|
-
this.sidebarActive = this.isDesktop();
|
|
163
|
-
setTimeout(() => {
|
|
164
|
-
this.pinActive = this.isDesktop();
|
|
165
|
-
}, 200);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
onSidebarMouseLeave(event: any) {
|
|
170
|
-
if (this.mngCommons.menuModeIsSidebar && !this._sidebarStatic) {
|
|
171
|
-
setTimeout(() => {
|
|
172
|
-
this.sidebarActive = false;
|
|
173
|
-
this.pinActive = false;
|
|
174
|
-
}, 250);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
onMenuButtonClick(event: any) {
|
|
179
|
-
this._menuClick = true;
|
|
180
|
-
|
|
181
|
-
if (this.mngCommons.menuModeIsOverlay) {
|
|
182
|
-
this.overlayMenuActive = !this._overlayMenuActive;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (this.isDesktop()) {
|
|
186
|
-
this.staticMenuDesktopInactive = !this._staticMenuDesktopInactive;
|
|
187
|
-
} else {
|
|
188
|
-
this.staticMenuMobileActive = !this._staticMenuMobileActive;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
event.preventDefault();
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
onTopbarItemClick(event: any, item: any) {
|
|
195
|
-
this._topbarItemClick = true;
|
|
196
|
-
|
|
197
|
-
if (this._activeTopbarItem === item) {
|
|
198
|
-
this.activeTopbarItem = null;
|
|
199
|
-
} else {
|
|
200
|
-
this.activeTopbarItem = item;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
onTopbarSubItemClick(event: any) {
|
|
207
|
-
event.preventDefault();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Checks if is desktop width, DO NOT use within HTML templates or within functions called by HTML templates
|
|
212
|
-
*/
|
|
213
|
-
public isDesktop() {
|
|
214
|
-
return this.isWidthDesktop(this._innerWidth);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Checks if is mobile width, DO NOT use within HTML templates or within functions called by HTML templates
|
|
219
|
-
*/
|
|
220
|
-
public isMobile() {
|
|
221
|
-
return this.isWidthMobile(this._innerWidth);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
private isWidthDesktop(width: number) {
|
|
225
|
-
return width > 991;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
private isWidthMobile(width: number) {
|
|
229
|
-
return width <= 991;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<div class="layout-topbar">
|
|
2
|
-
<div class="layout-topbar-left">
|
|
3
|
-
<a href="#" class="topbar-menu-button" (click)="mainLayoutService.onMenuButtonClick($event)" *ngIf="(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)">
|
|
4
|
-
<i class="pi pi-bars"></i>
|
|
5
|
-
</a>
|
|
6
|
-
|
|
7
|
-
<ng-container [mngComponent]="breadcrumbComponent"></ng-container>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<ng-container [mngComponent]="menuComponent"></ng-container>
|
|
11
|
-
|
|
12
|
-
<div class="layout-topbar-right">
|
|
13
|
-
<ul class="layout-topbar-right-items">
|
|
14
|
-
<li #profile class="profile-item" [ngClass]="{ 'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile }">
|
|
15
|
-
<a href="#" (click)="mainLayoutService.onTopbarItemClick($event,profile)">
|
|
16
|
-
<i class="pi pi-fw pi-user"></i>
|
|
17
|
-
</a>
|
|
18
|
-
<ul class="fadeInDown" *ngIf="user">
|
|
19
|
-
<li role="menuitem">
|
|
20
|
-
<a>
|
|
21
|
-
{{ user?.displayName ?? user?.username }}
|
|
22
|
-
</a>
|
|
23
|
-
</li>
|
|
24
|
-
<li role="menuitem" *ngIf="user?.logout || user?.logoutUrl">
|
|
25
|
-
<a [href]="user?.logoutUrl" (click)="logout(user, $event)">
|
|
26
|
-
<i class="pi pi-fw pi-sign-out"></i>
|
|
27
|
-
<span>{{ 'mngTopbar.logout' | translate }}</span>
|
|
28
|
-
</a>
|
|
29
|
-
</li>
|
|
30
|
-
</ul>
|
|
31
|
-
</li>
|
|
32
|
-
<li *ngIf="languages.length > 1" class="profile-item" [ngClass]="{ 'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile }">
|
|
33
|
-
<i class="pi pi-fw pi-globe"></i>
|
|
34
|
-
<p-dropdown [ngModel]="selectedLanguage" [options]="languages" (onChange)="switchLanguage($event.value)"></p-dropdown>
|
|
35
|
-
</li>
|
|
36
|
-
</ul>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {ChangeDetectionStrategy, Component, OnInit, QueryList, Type, ViewChildren} from '@angular/core';
|
|
2
|
-
import {ActivatedRoute} from '@angular/router';
|
|
3
|
-
|
|
4
|
-
import {MngMainLayoutComponentService} from './services';
|
|
5
|
-
import {MngCommonsService} from '../../services';
|
|
6
|
-
import {MngTemplateDirective} from '../../directives';
|
|
7
|
-
import {MngRouterData, IUser} from '../../models';
|
|
8
|
-
import {MngMenuComponent} from './menu.component';
|
|
9
|
-
import {MngBreadcrumbComponent} from './breadcrumb.component';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'mng-topbar',
|
|
13
|
-
templateUrl: './topbar.component.html',
|
|
14
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
15
|
-
})
|
|
16
|
-
export class MngTopbarComponent implements OnInit {
|
|
17
|
-
|
|
18
|
-
@ViewChildren(MngTemplateDirective) templates!: QueryList<MngTemplateDirective>;
|
|
19
|
-
|
|
20
|
-
public breadcrumbComponent: Type<any> = MngBreadcrumbComponent;
|
|
21
|
-
public menuComponent: Type<any> = MngMenuComponent;
|
|
22
|
-
|
|
23
|
-
public languages: Array<string> = ['en'];
|
|
24
|
-
public selectedLanguage: string = 'en';
|
|
25
|
-
public user?: IUser;
|
|
26
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
private route: ActivatedRoute,
|
|
29
|
-
public mngCommons: MngCommonsService,
|
|
30
|
-
public mainLayoutService: MngMainLayoutComponentService
|
|
31
|
-
) {}
|
|
32
|
-
|
|
33
|
-
ngOnInit(): void {
|
|
34
|
-
const routeData = this.route.snapshot.data as MngRouterData;
|
|
35
|
-
if (routeData?.breadcrumbComponent) {
|
|
36
|
-
this.breadcrumbComponent = routeData.breadcrumbComponent;
|
|
37
|
-
}
|
|
38
|
-
if (routeData?.menuComponent) {
|
|
39
|
-
this.menuComponent = routeData.menuComponent;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
this.languages = this.mngCommons.appLanguages;
|
|
43
|
-
this.selectedLanguage = this.mngCommons.appLanguage;
|
|
44
|
-
this.mngCommons.user$.subscribe(u => {
|
|
45
|
-
this.user = u;
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
ngAfterViewInit(): void {
|
|
50
|
-
this.mainLayoutService.innerWidth = window.innerWidth;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public switchLanguage(language: string) {
|
|
54
|
-
this.mngCommons.appLanguage = language;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public logout(user: IUser, event: Event) {
|
|
58
|
-
if (typeof user.logout === 'function') {
|
|
59
|
-
user.logout();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {LazyLoadEvent} from 'primeng/api';
|
|
2
|
-
|
|
3
|
-
import {MediusQueryParam} from '../../../api/models';
|
|
4
|
-
import {ColumnDescriptor} from '../../../descriptors';
|
|
5
|
-
|
|
6
|
-
export class MngTableLoadEvent {
|
|
7
|
-
public queryParam?: MediusQueryParam;
|
|
8
|
-
public originalEvent?: LazyLoadEvent;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class MngTableCellClickEvent<T> {
|
|
12
|
-
constructor(
|
|
13
|
-
public readonly column: ColumnDescriptor<any, T>,
|
|
14
|
-
public readonly rowItem: T,
|
|
15
|
-
public readonly rowIndex: number
|
|
16
|
-
) {}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class MngTableReloadEvent {
|
|
20
|
-
public resetParams: boolean = false;
|
|
21
|
-
public emitEvent: boolean = false;
|
|
22
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {Directive} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import {TableviewDescriptor, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorEditDescriptor, ActionEditorDetailsDescriptor} from '../../../descriptors';
|
|
4
|
-
import {ITableviewDataProvider} from '../../../data-providers';
|
|
5
|
-
|
|
6
|
-
@Directive()
|
|
7
|
-
export abstract class AMngTableviewRouteComponent<T, S> {
|
|
8
|
-
|
|
9
|
-
public descriptor: TableviewDescriptor<T>;
|
|
10
|
-
public dataProvider: ITableviewDataProvider<T, S>;
|
|
11
|
-
public actions: Array<ActionDescriptor<T>>;
|
|
12
|
-
|
|
13
|
-
protected constructor(
|
|
14
|
-
) {
|
|
15
|
-
this.descriptor = this.createTableviewDescriptor();
|
|
16
|
-
this.dataProvider = this.createTableviewDataProvider();
|
|
17
|
-
this.actions = this.createActionDescriptors();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected abstract createTableviewDescriptor(): TableviewDescriptor<T>;
|
|
21
|
-
protected abstract createTableviewDataProvider(): ITableviewDataProvider<T, S>;
|
|
22
|
-
|
|
23
|
-
protected createActionDescriptors(): Array<ActionDescriptor<T>> {
|
|
24
|
-
const actions: Array<ActionDescriptor<T>> = [];
|
|
25
|
-
actions.push(new ActionEditorDetailsDescriptor(this.descriptor.viewEditor));
|
|
26
|
-
actions.push(new ActionEditorAddDescriptor(this.descriptor.addEditor));
|
|
27
|
-
actions.push(new ActionEditorEditDescriptor(this.descriptor.editEditor));
|
|
28
|
-
actions.push(new ActionDeleteDescriptor(this.descriptor.model));
|
|
29
|
-
return actions;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {Injectable} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import {MessageService} from 'primeng/api';
|
|
4
|
-
|
|
5
|
-
import {ITableviewDataProvider} from '../../../data-providers';
|
|
6
|
-
import {ActionDescriptor} from '../../../descriptors';
|
|
7
|
-
|
|
8
|
-
@Injectable()
|
|
9
|
-
export class TableviewComponentService<T, S> {
|
|
10
|
-
|
|
11
|
-
dataProvider?: ITableviewDataProvider<T, S>;
|
|
12
|
-
messageService?: MessageService;
|
|
13
|
-
actions: Array<ActionDescriptor<T>> = [];
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
console.log('TableviewComponentService init.');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
reloadTable() {
|
|
20
|
-
// TODO: add callback functions to implement
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<p-columnFilter class="ml-auto"
|
|
2
|
-
[type]="primeType" matchMode="equals"
|
|
3
|
-
[field]="descriptor.property" [display]="primeDisplay"
|
|
4
|
-
[matchMode]="primeDefaultMatchMode"
|
|
5
|
-
[placeholder]="(descriptor.placeholder ?? 'mngTable.typeToFilter') | translate"
|
|
6
|
-
[showMatchModes]="primeType === 'text' || primeType === 'date' || primeType === 'numeric'"
|
|
7
|
-
[showOperator]="false" [showAddButton]="false" [hideOnClear]="true">
|
|
8
|
-
<ng-template *ngIf="lookupDescriptor" pTemplate="filter" let-value let-filterCallback="filterCallback">
|
|
9
|
-
<ng-container [ngSwitch]="lookupDescriptor.lookupType">
|
|
10
|
-
<mng-autocomplete *ngSwitchCase="lookupTypeAutocomplete"
|
|
11
|
-
[ngModel]="value"
|
|
12
|
-
[dataProvider]="lookupDescriptor.dataProvider"
|
|
13
|
-
[dataKeyProperty]="lookupDescriptor.dataKeyProperty"
|
|
14
|
-
[itemsLabelProperty]="lookupDescriptor.itemsLabelProperty"
|
|
15
|
-
[multiselect]="lookupDescriptor.multiselect"
|
|
16
|
-
[placeholder]="(descriptor.placeholder ?? 'mngTable.searchToFilter') | translate"
|
|
17
|
-
[className]="lookupDescriptor.className"
|
|
18
|
-
[dropdownClassName]="lookupDescriptor.dropdownClassName"
|
|
19
|
-
(onChange)="autocompleteFilter($event, filterCallback)">
|
|
20
|
-
</mng-autocomplete>
|
|
21
|
-
<mng-dropdown *ngSwitchCase="lookupTypeDropdown"
|
|
22
|
-
[ngModel]="value"
|
|
23
|
-
[dataProvider]="lookupDescriptor.dataProvider"
|
|
24
|
-
[dataKeyProperty]="lookupDescriptor.dataKeyProperty"
|
|
25
|
-
[itemsLabelProperty]="lookupDescriptor.itemsLabelProperty"
|
|
26
|
-
[itemsValueProperty]="lookupDescriptor.itemsValueProperty"
|
|
27
|
-
[multiselect]="lookupDescriptor.multiselect"
|
|
28
|
-
[placeholder]="(descriptor.placeholder ?? 'mngTable.selectToFilter') | translate"
|
|
29
|
-
[className]="lookupDescriptor.className"
|
|
30
|
-
[dropdownClassName]="lookupDescriptor.dropdownClassName"
|
|
31
|
-
[showClear]="true"
|
|
32
|
-
(onChange)="filterCallback($event)">
|
|
33
|
-
</mng-dropdown>
|
|
34
|
-
</ng-container>
|
|
35
|
-
</ng-template>
|
|
36
|
-
</p-columnFilter>
|