@dflat-core/web 1.0.44 → 1.0.46
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/README.md +12 -16
- package/assets/variables.scss +3 -1
- package/fesm2022/dflat-core-web-core-data.mjs +416 -412
- package/fesm2022/dflat-core-web-core-data.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-model.mjs +229 -218
- package/fesm2022/dflat-core-web-core-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-services.mjs +1840 -1615
- package/fesm2022/dflat-core-web-core-services.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-ux.mjs +21444 -16366
- package/fesm2022/dflat-core-web-core-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core.mjs +585 -728
- package/fesm2022/dflat-core-web-core.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-data.mjs +2813 -1300
- package/fesm2022/dflat-core-web-system-data.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-model.mjs +282 -260
- package/fesm2022/dflat-core-web-system-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-root.mjs +1994 -681
- package/fesm2022/dflat-core-web-system-root.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-ux.mjs +21157 -8828
- package/fesm2022/dflat-core-web-system-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web.mjs +11 -15
- package/fesm2022/dflat-core-web.mjs.map +1 -1
- package/package.json +33 -31
- package/scss/dflat-app.scss +8 -2
- package/types/dflat-core-web-core-data.d.ts +108 -0
- package/types/dflat-core-web-core-model.d.ts +491 -0
- package/types/dflat-core-web-core-services.d.ts +426 -0
- package/types/dflat-core-web-core-ux.d.ts +5867 -0
- package/types/dflat-core-web-core.d.ts +137 -0
- package/types/dflat-core-web-system-data.d.ts +545 -0
- package/types/dflat-core-web-system-model.d.ts +1605 -0
- package/types/dflat-core-web-system-root.d.ts +557 -0
- package/types/dflat-core-web-system-ux.d.ts +3250 -0
- package/{index.d.ts → types/dflat-core-web.d.ts} +1 -1
- package/core/index.d.ts +0 -6
- package/core/lib/array.function.d.ts +0 -8
- package/core/lib/core.module.d.ts +0 -9
- package/core/lib/global/EnvironmentBase.d.ts +0 -27
- package/core/lib/nameof.function.d.ts +0 -4
- package/core/lib/services/ensuremoduleloadedonceguard.d.ts +0 -3
- package/core/lib/services/utilities.service.d.ts +0 -87
- package/core-data/index.d.ts +0 -3
- package/core-data/lib/core-data.module.d.ts +0 -7
- package/core-data/lib/services/data-service.d.ts +0 -69
- package/core-data/lib/services/entity-data-service.d.ts +0 -37
- package/core-model/index.d.ts +0 -4
- package/core-model/lib/core-model.module.d.ts +0 -7
- package/core-model/lib/interface.d.ts +0 -140
- package/core-model/lib/model/interface.generated.d.ts +0 -309
- package/core-model/lib/model/model.d.ts +0 -38
- package/core-services/index.d.ts +0 -25
- package/core-services/lib/core-services.module.d.ts +0 -10
- package/core-services/lib/model/model.d.ts +0 -25
- package/core-services/lib/services/app-keys.d.ts +0 -15
- package/core-services/lib/services/appConfig.service.d.ts +0 -8
- package/core-services/lib/services/application-menu.service.d.ts +0 -22
- package/core-services/lib/services/auth-guard.service.d.ts +0 -18
- package/core-services/lib/services/auth.interceptor.d.ts +0 -15
- package/core-services/lib/services/auth.service.d.ts +0 -67
- package/core-services/lib/services/breadcrumb.service.d.ts +0 -14
- package/core-services/lib/services/busmessage.service.d.ts +0 -19
- package/core-services/lib/services/can-activate-guard.service.d.ts +0 -12
- package/core-services/lib/services/filter.service.d.ts +0 -15
- package/core-services/lib/services/geolocation.service.d.ts +0 -29
- package/core-services/lib/services/headers.service.d.ts +0 -15
- package/core-services/lib/services/hub.service.d.ts +0 -33
- package/core-services/lib/services/local-store-manager.service.d.ts +0 -50
- package/core-services/lib/services/menu.service.d.ts +0 -27
- package/core-services/lib/services/message.service.d.ts +0 -14
- package/core-services/lib/services/module-menu-services.token.d.ts +0 -8
- package/core-services/lib/services/notifications.service.d.ts +0 -14
- package/core-services/lib/services/permission.service.d.ts +0 -12
- package/core-services/lib/services/screen.service.d.ts +0 -14
- package/core-services/lib/services/server-url.d.ts +0 -12
- package/core-services/lib/services/string.function.d.ts +0 -1
- package/core-services/lib/services/user.service.d.ts +0 -22
- package/core-ux/index.d.ts +0 -145
- package/core-ux/lib/components/actions/actions-content.component.d.ts +0 -10
- package/core-ux/lib/components/actions/actions.component.d.ts +0 -57
- package/core-ux/lib/components/actions/extended-action/extended-action.component.d.ts +0 -34
- package/core-ux/lib/components/base-editor/base-editor.component.d.ts +0 -93
- package/core-ux/lib/components/base-item-list/base-item-list.component.d.ts +0 -21
- package/core-ux/lib/components/basefilter/basefilter.component.d.ts +0 -275
- package/core-ux/lib/components/breadcrumb/breadcrumb.component.d.ts +0 -12
- package/core-ux/lib/components/datagrid-custom/datagrid-cell/datagrid-cell.component.d.ts +0 -32
- package/core-ux/lib/components/datagrid-custom/datagrid-custom.component.d.ts +0 -159
- package/core-ux/lib/components/datagrid-custom/datagrid-sorter.component.d.ts +0 -15
- package/core-ux/lib/components/datapage/layout-page/page-layout.component.d.ts +0 -13
- package/core-ux/lib/components/datapage/old/old.datapage.component.d.ts +0 -10
- package/core-ux/lib/components/datapage/old-layout-handler.directive.d.ts +0 -31
- package/core-ux/lib/components/dynamic-components/dynamic-field/dynamic-field.component.d.ts +0 -41
- package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter-extra.component.d.ts +0 -27
- package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter-panel.component.d.ts +0 -8
- package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter.component.d.ts +0 -54
- package/core-ux/lib/components/dynamic-components/dynamic-form/dynamic-form.component.d.ts +0 -122
- package/core-ux/lib/components/filtersummary/filtersummary.component.d.ts +0 -27
- package/core-ux/lib/components/form-password/form-password.component.d.ts +0 -9
- package/core-ux/lib/components/grid-row/grid-row.component.d.ts +0 -12
- package/core-ux/lib/components/image-display/image.component.d.ts +0 -20
- package/core-ux/lib/components/input-selector/input-selector.component.d.ts +0 -50
- package/core-ux/lib/components/input-tree-selector/input-tree-selector.component.d.ts +0 -25
- package/core-ux/lib/components/logs/logs.component.d.ts +0 -32
- package/core-ux/lib/components/menu/menu.component.d.ts +0 -39
- package/core-ux/lib/components/menu-dashboard/menu-dashboard.component.d.ts +0 -15
- package/core-ux/lib/components/paginator/paginator.component.d.ts +0 -17
- package/core-ux/lib/components/parameter-field/parameter-field.component.d.ts +0 -13
- package/core-ux/lib/components/parameter-field/parameter-types/base-array-parameter-type.component.d.ts +0 -16
- package/core-ux/lib/components/parameter-field/parameter-types/base-parameter-type.component.d.ts +0 -21
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-bool/parameter-type-bool.component.d.ts +0 -9
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-bool-array/parameter-type-bool-array.component.d.ts +0 -12
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-date/parameter-type-date.component.d.ts +0 -16
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-date-array/parameter-type-date-array.component.d.ts +0 -17
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-number/parameter-type-number.component.d.ts +0 -6
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-number-array/parameter-type-number-array.component.d.ts +0 -6
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-password/parameter-type-password.component.d.ts +0 -9
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-text/parameter-type-text.component.d.ts +0 -7
- package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-text-array/parameter-type-text-array.component.d.ts +0 -6
- package/core-ux/lib/components/property-grid/property-grid.component.d.ts +0 -125
- package/core-ux/lib/components/search-results/search-results.component.d.ts +0 -7
- package/core-ux/lib/components/tab/tab.component.d.ts +0 -14
- package/core-ux/lib/components/tabset/tabset.component.d.ts +0 -15
- package/core-ux/lib/components/text-viewer/text-viewer.component.d.ts +0 -21
- package/core-ux/lib/components/time-picker/time-picker.component.d.ts +0 -27
- package/core-ux/lib/components/tree/tree.component.d.ts +0 -39
- package/core-ux/lib/components/validation-error/validation-error.component.d.ts +0 -8
- package/core-ux/lib/components/wizard/wizard-step/wizard-step.component.d.ts +0 -26
- package/core-ux/lib/components/wizard/wizard.component.d.ts +0 -29
- package/core-ux/lib/core-ux.module.d.ts +0 -102
- package/core-ux/lib/directives/addclass.directive.d.ts +0 -11
- package/core-ux/lib/directives/collapse.directive.d.ts +0 -34
- package/core-ux/lib/directives/draggable.directive.d.ts +0 -39
- package/core-ux/lib/directives/droppable.directive.d.ts +0 -55
- package/core-ux/lib/directives/editMode.directive.d.ts +0 -8
- package/core-ux/lib/directives/focusable.directive.d.ts +0 -16
- package/core-ux/lib/directives/insertion.directive.d.ts +0 -8
- package/core-ux/lib/directives/onEnter.directive.d.ts +0 -11
- package/core-ux/lib/directives/tab-heading.d.ts +0 -8
- package/core-ux/lib/directives/tab-transclude.d.ts +0 -11
- package/core-ux/lib/directives/tooltip.directive.d.ts +0 -16
- package/core-ux/lib/directives/validate-on-enter.directive.d.ts +0 -10
- package/core-ux/lib/directives/viewMode.directive.d.ts +0 -8
- package/core-ux/lib/layout/default/default-layout.d.ts +0 -36
- package/core-ux/lib/layout/login/login-layout.d.ts +0 -15
- package/core-ux/lib/log.service.d.ts +0 -8
- package/core-ux/lib/modals/confirm-modal/confirm-modal.component.d.ts +0 -17
- package/core-ux/lib/modals/dialog/dialog.component.d.ts +0 -57
- package/core-ux/lib/modals/dialog-component.tokens.d.ts +0 -3
- package/core-ux/lib/modals/export-data-modal/export-data-modal.component.d.ts +0 -11
- package/core-ux/lib/modals/track-record-modal/track-record-modal.component.d.ts +0 -21
- package/core-ux/lib/modals/validation-modal/validation-modal.component.d.ts +0 -24
- package/core-ux/lib/model/datagrid.d.ts +0 -194
- package/core-ux/lib/model/model.d.ts +0 -222
- package/core-ux/lib/model/tree.d.ts +0 -12
- package/core-ux/lib/pipes/euro.pipe.d.ts +0 -9
- package/core-ux/lib/pipes/todefine.pipe.d.ts +0 -8
- package/core-ux/lib/pipes/tofixedsizeinteger.pipe.d.ts +0 -8
- package/core-ux/lib/services/action.service.d.ts +0 -42
- package/core-ux/lib/services/alert.service.d.ts +0 -51
- package/core-ux/lib/services/application.service.d.ts +0 -73
- package/core-ux/lib/services/can-deactivate-guard.d.ts +0 -12
- package/core-ux/lib/services/drag.service.d.ts +0 -54
- package/core-ux/lib/services/entity-selectors.d.ts +0 -37
- package/core-ux/lib/services/fire-authentication.service.d.ts +0 -13
- package/core-ux/lib/services/image.service.d.ts +0 -15
- package/core-ux/lib/services/modal-state.service.d.ts +0 -26
- package/core-ux/lib/services/modal.service.d.ts +0 -30
- package/core-ux/lib/services/presentation-profile.token.d.ts +0 -40
- package/core-ux/lib/services/selectorMapperBase.service.d.ts +0 -42
- package/core-ux/lib/v2/components/actions-panel/action-panel.component.d.ts +0 -48
- package/core-ux/lib/v2/components/base-component/base-component.d.ts +0 -80
- package/core-ux/lib/v2/components/cell-renderer/cell-renderer.component.d.ts +0 -11
- package/core-ux/lib/v2/components/data-grid/data-grid.component.d.ts +0 -104
- package/core-ux/lib/v2/components/data-grid/grid-field-descriptor/grid-field.component.d.ts +0 -55
- package/core-ux/lib/v2/components/data-list/data-list.component.d.ts +0 -29
- package/core-ux/lib/v2/components/editor-tab/editor-tab.component.d.ts +0 -15
- package/core-ux/lib/v2/components/editor-tabset/editor-tabset.component.d.ts +0 -18
- package/core-ux/lib/v2/components/field-descriptor/field.component.d.ts +0 -61
- package/core-ux/lib/v2/components/filter-form/filter-form.component.d.ts +0 -12
- package/core-ux/lib/v2/components/filter-summary/filter-summary.component.d.ts +0 -34
- package/core-ux/lib/v2/components/new-editor/new-editor.component.d.ts +0 -66
- package/core-ux/lib/v2/components/new-paginator/new-paginator.component.d.ts +0 -31
- package/core-ux/lib/v2/components/orderable/orderable-modal.component.d.ts +0 -36
- package/core-ux/lib/v2/components/orderable/orderable-modal.service.d.ts +0 -11
- package/core-ux/lib/v2/components/orderable/orderable.interface.d.ts +0 -52
- package/core-ux/lib/v2/components/property-editor/property-editor-component.d.ts +0 -89
- package/core-ux/lib/v2/components/selector/selector-registry.service.d.ts +0 -9
- package/core-ux/lib/v2/components/selector/selector.component.d.ts +0 -33
- package/core-ux/lib/v2/components/selector/selector.model.d.ts +0 -19
- package/core-ux/lib/v2/components/standard-page-layout/standard-page-layout.component.d.ts +0 -29
- package/core-ux/lib/v2/directives/base-shortcut.directive.d.ts +0 -15
- package/core-ux/lib/v2/directives/hide-on-threshold.directive.d.ts +0 -20
- package/core-ux/lib/v2/directives/layout-handler.directive.d.ts +0 -54
- package/core-ux/lib/v2/directives/row-ref.directive.d.ts +0 -21
- package/core-ux/lib/v2/models/aggregation-model.d.ts +0 -8
- package/core-ux/lib/v2/models/contexts/action-context.d.ts +0 -66
- package/core-ux/lib/v2/models/contexts/action-handler-context.d.ts +0 -49
- package/core-ux/lib/v2/models/contexts/base-form-context.d.ts +0 -42
- package/core-ux/lib/v2/models/contexts/change-detection-context.d.ts +0 -41
- package/core-ux/lib/v2/models/contexts/data-context.d.ts +0 -25
- package/core-ux/lib/v2/models/contexts/data-grid-style-context.d.ts +0 -36
- package/core-ux/lib/v2/models/contexts/editor-context.d.ts +0 -30
- package/core-ux/lib/v2/models/contexts/entity-config-context.d.ts +0 -49
- package/core-ux/lib/v2/models/contexts/filter-context.d.ts +0 -49
- package/core-ux/lib/v2/models/contexts/layout-context.d.ts +0 -57
- package/core-ux/lib/v2/models/contexts/logger-context.d.ts +0 -5
- package/core-ux/lib/v2/models/contexts/section-context.d.ts +0 -85
- package/core-ux/lib/v2/models/contexts/selection-context.d.ts +0 -45
- package/core-ux/lib/v2/models/entity-facade.d.ts +0 -35
- package/core-ux/lib/v2/models/guards/facade-load-guard.d.ts +0 -35
- package/core-ux/lib/v2/models/guards/filter-lifecycle-guard.d.ts +0 -29
- package/core-ux/lib/v2/models/states/sorting-state.d.ts +0 -14
- package/core-ux/lib/v2/models/utilities/action-definition.d.ts +0 -38
- package/core-ux/lib/v2/models/utilities/change-utilities.d.ts +0 -11
- package/core-ux/lib/v2/models/utilities/entity-updater.d.ts +0 -11
- package/core-ux/lib/v2/models/utilities/form-wrapper.d.ts +0 -30
- package/core-ux/lib/v2/models/utilities/row-registry.d.ts +0 -15
- package/core-ux/lib/v2/models/utilities/selection-styler.d.ts +0 -15
- package/core-ux/lib/v2/pipes/gridstyle.pipe.d.ts +0 -15
- package/core-ux/lib/v2/services/app-config.service.d.ts +0 -22
- package/core-ux/lib/v2/services/entity-facade-registry.service.d.ts +0 -28
- package/core-ux/lib/v2/services/facade-modal.service.d.ts +0 -21
- package/core-ux/lib/v2/services/layout.service.d.ts +0 -93
- package/core-ux/lib/v2/services/property-change-bus.service.d.ts +0 -9
- package/core-ux/lib/v2/services/selection.service.d.ts +0 -23
- package/core-ux/lib/v2/services/test.service.d.ts +0 -7
- package/core-ux/lib/v2/services/validation.service.d.ts +0 -10
- package/core-ux/lib/v2/services/view-model-loader.service.d.ts +0 -13
- package/system-data/index.d.ts +0 -68
- package/system-data/lib/data-services/account-service.generated.d.ts +0 -20
- package/system-data/lib/data-services/action-service.generated.d.ts +0 -15
- package/system-data/lib/data-services/address-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/checkout-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/company-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/config-service.generated.d.ts +0 -18
- package/system-data/lib/data-services/country-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/currency-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/custom-field-group-entity-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/custom-field-group-item-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/custom-field-group-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/custom-field-options-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/custom-field-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/custom-field-value-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/day-info-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/entity-files-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/error-category-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/exchange-rate-detail-service.generated.d.ts +0 -35
- package/system-data/lib/data-services/exchange-rate-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/files-service.generated.d.ts +0 -26
- package/system-data/lib/data-services/keyword-service.generated.d.ts +0 -12
- package/system-data/lib/data-services/meta-entity-field-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-form-field-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-form-section-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-form-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-keyword-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-relation-definition-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-relation-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-translation-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/meta-entity-view-field-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/news-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/parameter-section-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/parameter-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/parameter-value-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/permission-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/plugin-parameter-value-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/presentation-profile-item-service.generated.d.ts +0 -14
- package/system-data/lib/data-services/presentation-profile-service.generated.d.ts +0 -13
- package/system-data/lib/data-services/rating-service.generated.d.ts +0 -14
- package/system-data/lib/data-services/rating-summary-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/request-entity-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/request-result-service.generated.d.ts +0 -12
- package/system-data/lib/data-services/request-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/resource-key-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/resource-language-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/resource-translation-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/role-permission-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/role-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/subcompany-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/supplier-company-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/supplier-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/synchronized-company-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/tva-rate-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-account-company-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-account-news-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-account-role-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-account-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-account-token-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-favorite-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-group-definition-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-group-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-history-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-permission-view-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/user-session-service.generated.d.ts +0 -10
- package/system-data/lib/data-services/version-service.generated.d.ts +0 -10
- package/system-data/lib/system-data.module.d.ts +0 -9
- package/system-model/index.d.ts +0 -3
- package/system-model/lib/model/interface.generated.d.ts +0 -1588
- package/system-model/lib/model/model.d.ts +0 -11
- package/system-model/lib/system-model.module.d.ts +0 -7
- package/system-root/index.d.ts +0 -8
- package/system-root/lib/generated/system-entity-keys.generated.d.ts +0 -63
- package/system-root/lib/generated/system-menu-item-provider.generated.d.ts +0 -67
- package/system-root/lib/generated/system-menu-service.generated.d.ts +0 -26
- package/system-root/lib/generated/system-permissions.generated.d.ts +0 -368
- package/system-root/lib/system-entity-keys.d.ts +0 -11
- package/system-root/lib/system-menu-item-provider.d.ts +0 -11
- package/system-root/lib/system-menu-service.d.ts +0 -12
- package/system-root/lib/system-root.module.d.ts +0 -7
- package/system-ux/index.d.ts +0 -181
- package/system-ux/lib/activate/activate.component.d.ts +0 -36
- package/system-ux/lib/address/address-editor.component.d.ts +0 -12
- package/system-ux/lib/app/access-denied/access-denied.component.d.ts +0 -9
- package/system-ux/lib/app/dflat-app.module.d.ts +0 -49
- package/system-ux/lib/app/history/history.component.d.ts +0 -16
- package/system-ux/lib/app/homepage/homepage.component.d.ts +0 -19
- package/system-ux/lib/app/layout/dflat-layout.component.d.ts +0 -38
- package/system-ux/lib/app/search/search-result/search-result.component.d.ts +0 -42
- package/system-ux/lib/app/search/search.component.d.ts +0 -68
- package/system-ux/lib/app/services/dflat-app.service.d.ts +0 -21
- package/system-ux/lib/app/services/dflat-auth.interceptor.d.ts +0 -16
- package/system-ux/lib/app/services/dflat-permission.service.d.ts +0 -7
- package/system-ux/lib/app/spinner/dflat-spinner.component.d.ts +0 -11
- package/system-ux/lib/app/user-menu/user-menu.component.d.ts +0 -56
- package/system-ux/lib/app/user-profile/user-profile.component.d.ts +0 -35
- package/system-ux/lib/components/image-upload/image-upload.component.d.ts +0 -99
- package/system-ux/lib/config/config-component.d.ts +0 -22
- package/system-ux/lib/config/datawarehouse-supply/dw-supply.component.d.ts +0 -14
- package/system-ux/lib/custom-field/custom-field-editor.component.d.ts +0 -13
- package/system-ux/lib/custom-field-options/custom-field-options-editor.component.d.ts +0 -17
- package/system-ux/lib/data-components/address.component.d.ts +0 -7
- package/system-ux/lib/data-components/company.component.d.ts +0 -15
- package/system-ux/lib/data-components/country.component.d.ts +0 -6
- package/system-ux/lib/data-components/currency.component.d.ts +0 -6
- package/system-ux/lib/data-components/customfield.component.d.ts +0 -15
- package/system-ux/lib/data-components/customfieldgroup.component.d.ts +0 -21
- package/system-ux/lib/data-components/customfieldgroupentity.component.d.ts +0 -16
- package/system-ux/lib/data-components/customfieldgroupitem.component.d.ts +0 -25
- package/system-ux/lib/data-components/customfieldoptions.component.d.ts +0 -19
- package/system-ux/lib/data-components/customfieldvalue.component.d.ts +0 -10
- package/system-ux/lib/data-components/dayinfo.component.d.ts +0 -10
- package/system-ux/lib/data-components/errorcategory.component.d.ts +0 -10
- package/system-ux/lib/data-components/exchangerate.component.d.ts +0 -11
- package/system-ux/lib/data-components/files.component.d.ts +0 -10
- package/system-ux/lib/data-components/generated/address.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/company.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/country.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/currency.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/customfield.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/customfieldgroup.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/customfieldgroupentity.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/customfieldgroupitem.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/customfieldoptions.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/customfieldvalue.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/dayinfo.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/entityfiles.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/errorcategory.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/exchangerate.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/files.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/keyword.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentity.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentityfield.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentityform.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentityformfield.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/metaentityformsection.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentitykeyword.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/metaentityrelation.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/metaentityrelationdefinition.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/metaentitytranslation.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/metaentityviewfield.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/news.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/parameter.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/parametersection.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/parametervalue.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/permission.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/presentationprofile.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/presentationprofileitem.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/rating.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/ratingsummary.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/request.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/requestentity.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/requestresult.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/resourcekey.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/resourcelanguage.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/resourcetranslation.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/role.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/rolepermission.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/subcompany.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/supplier.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/suppliercompany.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/synchronizedcompany.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/system-components.generated.d.ts +0 -69
- package/system-ux/lib/data-components/generated/tvarate.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/useraccount.component.generated.d.ts +0 -25
- package/system-ux/lib/data-components/generated/useraccountcompany.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/useraccountnews.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/useraccountrole.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/useraccounttoken.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/userfavorite.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/usergroup.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/usergroupdefinition.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/userhistory.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/userpermissionview.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/usersession.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/generated/version.component.generated.d.ts +0 -18
- package/system-ux/lib/data-components/keyword.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentity.component.d.ts +0 -16
- package/system-ux/lib/data-components/metaentityfield.component.d.ts +0 -17
- package/system-ux/lib/data-components/metaentityform.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentityformfield.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentityformsection.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentitykeyword.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentityrelation.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentityrelationdefinition.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentitytranslation.component.d.ts +0 -10
- package/system-ux/lib/data-components/metaentityviewfield.component.d.ts +0 -10
- package/system-ux/lib/data-components/news.component.d.ts +0 -8
- package/system-ux/lib/data-components/parameter.component.d.ts +0 -10
- package/system-ux/lib/data-components/parametersection.component.d.ts +0 -10
- package/system-ux/lib/data-components/parametervalue.component.d.ts +0 -15
- package/system-ux/lib/data-components/permission.component.d.ts +0 -8
- package/system-ux/lib/data-components/presentationprofileitem.component.d.ts +0 -10
- package/system-ux/lib/data-components/rating.component.d.ts +0 -10
- package/system-ux/lib/data-components/ratingsummary.component.d.ts +0 -10
- package/system-ux/lib/data-components/request.component.d.ts +0 -16
- package/system-ux/lib/data-components/requestentity.component.d.ts +0 -10
- package/system-ux/lib/data-components/requestresult.component.d.ts +0 -10
- package/system-ux/lib/data-components/resourcekey.component.d.ts +0 -11
- package/system-ux/lib/data-components/resourcelanguage.component.d.ts +0 -9
- package/system-ux/lib/data-components/resourcetranslation.component.d.ts +0 -10
- package/system-ux/lib/data-components/role.component.d.ts +0 -10
- package/system-ux/lib/data-components/rolepermission.component.d.ts +0 -10
- package/system-ux/lib/data-components/subcompany.component.d.ts +0 -11
- package/system-ux/lib/data-components/supplier.component.d.ts +0 -8
- package/system-ux/lib/data-components/suppliercompany.component.d.ts +0 -10
- package/system-ux/lib/data-components/synchronizedcompany.component.d.ts +0 -15
- package/system-ux/lib/data-components/tvarate.component.d.ts +0 -14
- package/system-ux/lib/data-components/useraccount.component.d.ts +0 -11
- package/system-ux/lib/data-components/useraccountcompany.component.d.ts +0 -10
- package/system-ux/lib/data-components/useraccountnews.component.d.ts +0 -10
- package/system-ux/lib/data-components/useraccountrole.component.d.ts +0 -10
- package/system-ux/lib/data-components/useraccounttoken.component.d.ts +0 -10
- package/system-ux/lib/data-components/usercompany.component.d.ts +0 -19
- package/system-ux/lib/data-components/userfavorite.component.d.ts +0 -10
- package/system-ux/lib/data-components/usergroup.component.d.ts +0 -8
- package/system-ux/lib/data-components/usergroupdefinition.component.d.ts +0 -15
- package/system-ux/lib/data-components/userhistory.component.d.ts +0 -10
- package/system-ux/lib/data-components/userpermission.component.d.ts +0 -11
- package/system-ux/lib/data-components/userpermissionview.component.d.ts +0 -10
- package/system-ux/lib/data-components/userrole.component.d.ts +0 -17
- package/system-ux/lib/data-components/usersession.component.d.ts +0 -10
- package/system-ux/lib/data-components/version.component.d.ts +0 -10
- package/system-ux/lib/editor-components/company-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/country-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/currency-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/custom-field-group-editor.component.d.ts +0 -14
- package/system-ux/lib/editor-components/custom-field-group-entity-editor.component.d.ts +0 -13
- package/system-ux/lib/editor-components/custom-field-group-item-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/news-editor.component.d.ts +0 -28
- package/system-ux/lib/editor-components/permission-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/request-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/resource-translation-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/role-editor.component.d.ts +0 -27
- package/system-ux/lib/editor-components/user-account-editor.component.d.ts +0 -12
- package/system-ux/lib/editor-components/user-account-profile.component.d.ts +0 -31
- package/system-ux/lib/editor-components/user-group-editor.component.d.ts +0 -12
- package/system-ux/lib/entity-files/entity-files.component.d.ts +0 -37
- package/system-ux/lib/exchange-rate/exchange-rate-detail.component.d.ts +0 -17
- package/system-ux/lib/exchange-rate/exchange-rate-editor.component.d.ts +0 -25
- package/system-ux/lib/login/login.component.d.ts +0 -37
- package/system-ux/lib/meta-entity-field/meta-entity-field-editor.component.d.ts +0 -12
- package/system-ux/lib/presentation-profile/pp-facade.service.d.ts +0 -39
- package/system-ux/lib/presentation-profile/presentation-profile-action-service.d.ts +0 -16
- package/system-ux/lib/presentation-profile/presentation-profile-column-grid/presentation-profile-column.component.d.ts +0 -73
- package/system-ux/lib/presentation-profile/presentation-profile-column-grid/presentation-profile-items.component.d.ts +0 -50
- package/system-ux/lib/presentation-profile/presentation-profile-resolver.service.d.ts +0 -34
- package/system-ux/lib/presentation-profile/presentation-profile-transformer.d.ts +0 -48
- package/system-ux/lib/presentation-profile/presentation-profile.component.d.ts +0 -16
- package/system-ux/lib/presentation-profile/presentation-profile.service.d.ts +0 -58
- package/system-ux/lib/request-results/request-results.component.d.ts +0 -15
- package/system-ux/lib/reset-password/reset-password.component.d.ts +0 -32
- package/system-ux/lib/resource-language/resourcelanguage-editor.component.d.ts +0 -12
- package/system-ux/lib/services/custom-field-action-service.d.ts +0 -25
- package/system-ux/lib/services/custom-field-service.d.ts +0 -21
- package/system-ux/lib/services/rates-action-service.d.ts +0 -28
- package/system-ux/lib/services/select-user-company-action-service.d.ts +0 -23
- package/system-ux/lib/services/system-section.service.d.ts +0 -12
- package/system-ux/lib/services/system-selector-mapper.service.d.ts +0 -24
- package/system-ux/lib/services/user-action-service.d.ts +0 -20
- package/system-ux/lib/supplier/supplier-editor.component.d.ts +0 -12
- package/system-ux/lib/system-ux.module.d.ts +0 -131
- package/system-ux/lib/tva-rate/tva-rate-detail.component.d.ts +0 -17
- package/system-ux/lib/tva-rate/tva-rate-editor.component.d.ts +0 -25
|
@@ -1,743 +1,600 @@
|
|
|
1
|
-
import { CommonModule } from
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import moment from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import { HttpErrorResponse, HttpResponse, HttpResponseBase, provideHttpClient, withInterceptorsFromDi, withXhr } from "@angular/common/http";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { Injectable, NgModule, Optional, SkipSelf } from "@angular/core";
|
|
5
|
+
import moment from "moment";
|
|
6
|
+
var EnsureModuleLoadedOnceGuard = class {
|
|
7
|
+
constructor(targetModule) {
|
|
8
|
+
if (targetModule) throw new Error(`${targetModule.constructor.name} has already been loaded. Import this module in the AppModule only.`);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var CoreModule = class CoreModule extends EnsureModuleLoadedOnceGuard {
|
|
12
|
+
constructor(parentModule) {
|
|
13
|
+
super(parentModule);
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
17
|
+
minVersion: "12.0.0",
|
|
18
|
+
version: "22.2.1",
|
|
19
|
+
ngImport: i0,
|
|
20
|
+
type: CoreModule,
|
|
21
|
+
deps: [{
|
|
22
|
+
token: CoreModule,
|
|
23
|
+
optional: true,
|
|
24
|
+
skipSelf: true
|
|
25
|
+
}],
|
|
26
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
31
|
+
minVersion: "14.0.0",
|
|
32
|
+
version: "22.2.1",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: CoreModule,
|
|
35
|
+
imports: [CommonModule]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
static {
|
|
39
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.1",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: CoreModule,
|
|
44
|
+
providers: [provideHttpClient(withXhr(), withInterceptorsFromDi())],
|
|
45
|
+
imports: [CommonModule]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
50
|
+
minVersion: "12.0.0",
|
|
51
|
+
version: "22.2.1",
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
type: CoreModule,
|
|
54
|
+
decorators: [{
|
|
55
|
+
type: NgModule,
|
|
56
|
+
args: [{
|
|
57
|
+
exports: [],
|
|
58
|
+
declarations: [],
|
|
59
|
+
imports: [CommonModule],
|
|
60
|
+
providers: [provideHttpClient(withXhr(), withInterceptorsFromDi())]
|
|
61
|
+
}]
|
|
62
|
+
}],
|
|
63
|
+
ctorParameters: () => [{
|
|
64
|
+
type: CoreModule,
|
|
65
|
+
decorators: [{ type: Optional }, { type: SkipSelf }]
|
|
66
|
+
}]
|
|
67
|
+
});
|
|
68
|
+
const isArray = Array.isArray || ((x) => x && typeof x.length === "number");
|
|
45
69
|
function isNumeric(val) {
|
|
46
|
-
|
|
47
|
-
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
|
48
|
-
// subtraction forces infinities to NaN
|
|
49
|
-
// adding 1 corrects loss of precision from parseFloat (#15100)
|
|
50
|
-
return !isArray(val) && (val - parseFloat(val) + 1) >= 0;
|
|
70
|
+
return !isArray(val) && val - parseFloat(val) + 1 >= 0;
|
|
51
71
|
}
|
|
52
72
|
function sleep(ms) {
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
class Utilities {
|
|
56
|
-
static delay(arg0) {
|
|
57
|
-
throw new Error("Method not implemented.");
|
|
58
|
-
}
|
|
59
|
-
static { this.captionAndMessageSeparator = ":"; }
|
|
60
|
-
static { this.noNetworkMessageCaption = "No Network"; }
|
|
61
|
-
static { this.noNetworkMessageDetail = "The server cannot be reached"; }
|
|
62
|
-
static { this.accessDeniedMessageCaption = "Access Denied!"; }
|
|
63
|
-
static { this.accessDeniedMessageDetail = ""; }
|
|
64
|
-
static getHttpResponseMessage(data) {
|
|
65
|
-
let responses = [];
|
|
66
|
-
if (data instanceof HttpResponseBase) {
|
|
67
|
-
if (this.checkNoNetwork(data)) {
|
|
68
|
-
responses.push(`${this.noNetworkMessageCaption}${this.captionAndMessageSeparator} ${this.noNetworkMessageDetail}`);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
let responseObject = this.getResponseBody(data);
|
|
72
|
-
if (responseObject && (typeof responseObject === 'object' || responseObject instanceof Object)) {
|
|
73
|
-
for (let key in responseObject) {
|
|
74
|
-
if (key)
|
|
75
|
-
responses.push(`${key}${this.captionAndMessageSeparator} ${responseObject[key]}`);
|
|
76
|
-
else if (responseObject[key])
|
|
77
|
-
responses.push(responseObject[key].toString());
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (!responses.length && this.getResponseBody(data))
|
|
82
|
-
responses.push(`${data.statusText}: ${this.getResponseBody(data).toString()}`);
|
|
83
|
-
}
|
|
84
|
-
if (!responses.length)
|
|
85
|
-
responses.push(data.toString());
|
|
86
|
-
if (this.checkAccessDenied(data))
|
|
87
|
-
responses.splice(0, 0, `${this.accessDeniedMessageCaption}${this.captionAndMessageSeparator} ${this.accessDeniedMessageDetail}`);
|
|
88
|
-
return responses;
|
|
89
|
-
}
|
|
90
|
-
static findHttpResponseMessage(messageToFind, data, seachInCaptionOnly = true, includeCaptionInResult = false) {
|
|
91
|
-
let searchString = messageToFind.toLowerCase();
|
|
92
|
-
let httpMessages = this.getHttpResponseMessage(data);
|
|
93
|
-
for (let message of httpMessages) {
|
|
94
|
-
let fullMessage = Utilities.splitInTwo(message, this.captionAndMessageSeparator);
|
|
95
|
-
if (fullMessage.firstPart && fullMessage.firstPart.toLowerCase().indexOf(searchString) != -1) {
|
|
96
|
-
return includeCaptionInResult ? message : fullMessage.secondPart || fullMessage.firstPart;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (!seachInCaptionOnly) {
|
|
100
|
-
for (let message of httpMessages) {
|
|
101
|
-
if (message.toLowerCase().indexOf(searchString) != -1) {
|
|
102
|
-
if (includeCaptionInResult) {
|
|
103
|
-
return message;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
let fullMessage = Utilities.splitInTwo(message, this.captionAndMessageSeparator);
|
|
107
|
-
return fullMessage.secondPart || fullMessage.firstPart;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
static getResponseBody(response) {
|
|
115
|
-
if (response instanceof HttpResponse)
|
|
116
|
-
return response.body;
|
|
117
|
-
if (response instanceof HttpErrorResponse)
|
|
118
|
-
return response.error || response.message || response.statusText;
|
|
119
|
-
}
|
|
120
|
-
static checkNoNetwork(response) {
|
|
121
|
-
if (response instanceof HttpResponseBase) {
|
|
122
|
-
return response.status == 0;
|
|
123
|
-
}
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
static checkAccessDenied(response) {
|
|
127
|
-
if (response instanceof HttpResponseBase) {
|
|
128
|
-
return response.status == 403;
|
|
129
|
-
}
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
static checkNotFound(response) {
|
|
133
|
-
if (response instanceof HttpResponseBase) {
|
|
134
|
-
return response.status == 404;
|
|
135
|
-
}
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
static checkIsLocalHost(url, base) {
|
|
139
|
-
if (url) {
|
|
140
|
-
let location = new URL(url, base);
|
|
141
|
-
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
static getQueryParamsFromString(paramString) {
|
|
146
|
-
if (!paramString)
|
|
147
|
-
return null;
|
|
148
|
-
let params = {};
|
|
149
|
-
for (let param of paramString.split("&")) {
|
|
150
|
-
let keyValue = Utilities.splitInTwo(param, "=");
|
|
151
|
-
params[keyValue.firstPart] = keyValue.secondPart;
|
|
152
|
-
}
|
|
153
|
-
return params;
|
|
154
|
-
}
|
|
155
|
-
static splitInTwo(text, separator) {
|
|
156
|
-
let separatorIndex = text.indexOf(separator);
|
|
157
|
-
if (separatorIndex == -1)
|
|
158
|
-
return { firstPart: text, secondPart: null };
|
|
159
|
-
let part1 = text.substr(0, separatorIndex).trim();
|
|
160
|
-
let part2 = text.substr(separatorIndex + 1).trim();
|
|
161
|
-
return { firstPart: part1, secondPart: part2 };
|
|
162
|
-
}
|
|
163
|
-
static safeStringify(object) {
|
|
164
|
-
let result;
|
|
165
|
-
try {
|
|
166
|
-
result = JSON.stringify(object);
|
|
167
|
-
return result;
|
|
168
|
-
}
|
|
169
|
-
catch (error) {
|
|
170
|
-
}
|
|
171
|
-
let simpleObject = {};
|
|
172
|
-
for (let prop in object) {
|
|
173
|
-
if (!object.hasOwnProperty(prop)) {
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
if (typeof (object[prop]) == 'object') {
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
if (typeof (object[prop]) == 'function') {
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
simpleObject[prop] = object[prop];
|
|
183
|
-
}
|
|
184
|
-
result = "[***Sanitized Object***]: " + JSON.stringify(simpleObject);
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
static JSonTryParse(value) {
|
|
188
|
-
try {
|
|
189
|
-
return JSON.parse(value);
|
|
190
|
-
}
|
|
191
|
-
catch (e) {
|
|
192
|
-
if (value === "undefined")
|
|
193
|
-
return void 0;
|
|
194
|
-
return value;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
static isNonEmptyString(str) {
|
|
198
|
-
return str && str.length > 0;
|
|
199
|
-
}
|
|
200
|
-
static isEmptyString(str) {
|
|
201
|
-
return Utilities.IsNil(str) || str.length === 0;
|
|
202
|
-
}
|
|
203
|
-
static areValuesEqual(a, b) {
|
|
204
|
-
if (a === b)
|
|
205
|
-
return true;
|
|
206
|
-
if (a instanceof Date && b instanceof Date) {
|
|
207
|
-
return a.getTime() === b.getTime();
|
|
208
|
-
}
|
|
209
|
-
if (a?.valueOf && b?.valueOf) {
|
|
210
|
-
return a.valueOf() === b.valueOf();
|
|
211
|
-
}
|
|
212
|
-
if (typeof a !== 'object' && typeof b !== 'object') {
|
|
213
|
-
return a === b;
|
|
214
|
-
}
|
|
215
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
216
|
-
}
|
|
217
|
-
static TestIsObjectEmpty(obj) {
|
|
218
|
-
for (let prop in obj) {
|
|
219
|
-
if (obj.hasOwnProperty(prop)) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
static IsUndefined(value) {
|
|
226
|
-
return typeof value === 'undefined';
|
|
227
|
-
}
|
|
228
|
-
static IsNil(value) {
|
|
229
|
-
return (value == null) || value === undefined || typeof value === 'undefined';
|
|
230
|
-
}
|
|
231
|
-
static TestIsString(value) {
|
|
232
|
-
return typeof value === 'string' || value instanceof String;
|
|
233
|
-
}
|
|
234
|
-
static capitalizeFirstLetter(text) {
|
|
235
|
-
if (text)
|
|
236
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
237
|
-
else
|
|
238
|
-
return text;
|
|
239
|
-
}
|
|
240
|
-
static toTitleCase(text) {
|
|
241
|
-
return text.replace(/\w\S*/g, (subString) => {
|
|
242
|
-
return subString.charAt(0).toUpperCase() + subString.substr(1).toLowerCase();
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
static toLowerCase(items) {
|
|
246
|
-
if (items instanceof Array) {
|
|
247
|
-
let loweredRoles = [];
|
|
248
|
-
for (let i = 0; i < items.length; i++) {
|
|
249
|
-
loweredRoles[i] = items[i].toLowerCase();
|
|
250
|
-
}
|
|
251
|
-
return loweredRoles;
|
|
252
|
-
}
|
|
253
|
-
else if (typeof items === 'string' || items instanceof String) {
|
|
254
|
-
return items.toLowerCase();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
static uniqueId() {
|
|
258
|
-
return this.randomNumber(1000000, 9000000).toString();
|
|
259
|
-
}
|
|
260
|
-
static randomNumber(min, max) {
|
|
261
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
262
|
-
}
|
|
263
|
-
static baseUrl() {
|
|
264
|
-
let base = '';
|
|
265
|
-
if (window.location.origin)
|
|
266
|
-
base = window.location.origin;
|
|
267
|
-
else
|
|
268
|
-
base = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
|
|
269
|
-
return base.replace(/\/$/, '');
|
|
270
|
-
}
|
|
271
|
-
static printDateOnly(date) {
|
|
272
|
-
date = new Date(date);
|
|
273
|
-
let dayNames = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
|
274
|
-
let monthNames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
|
275
|
-
let dayOfWeek = date.getDay();
|
|
276
|
-
let dayOfMonth = date.getDate();
|
|
277
|
-
let sup = "";
|
|
278
|
-
let month = date.getMonth();
|
|
279
|
-
let year = date.getFullYear();
|
|
280
|
-
if (dayOfMonth == 1 || dayOfMonth == 21 || dayOfMonth == 31) {
|
|
281
|
-
sup = "st";
|
|
282
|
-
}
|
|
283
|
-
else if (dayOfMonth == 2 || dayOfMonth == 22) {
|
|
284
|
-
sup = "nd";
|
|
285
|
-
}
|
|
286
|
-
else if (dayOfMonth == 3 || dayOfMonth == 23) {
|
|
287
|
-
sup = "rd";
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
sup = "th";
|
|
291
|
-
}
|
|
292
|
-
let dateString = dayNames[dayOfWeek] + ", " + dayOfMonth + sup + " " + monthNames[month] + " " + year;
|
|
293
|
-
return dateString;
|
|
294
|
-
}
|
|
295
|
-
static printTimeOnly(date) {
|
|
296
|
-
date = new Date(date);
|
|
297
|
-
let period = "";
|
|
298
|
-
let minute = date.getMinutes().toString();
|
|
299
|
-
let hour = date.getHours();
|
|
300
|
-
period = hour < 12 ? "AM" : "PM";
|
|
301
|
-
if (hour == 0) {
|
|
302
|
-
hour = 12;
|
|
303
|
-
}
|
|
304
|
-
if (hour > 12) {
|
|
305
|
-
hour = hour - 12;
|
|
306
|
-
}
|
|
307
|
-
if (minute.length == 1) {
|
|
308
|
-
minute = "0" + minute;
|
|
309
|
-
}
|
|
310
|
-
let timeString = hour + ":" + minute + " " + period;
|
|
311
|
-
return timeString;
|
|
312
|
-
}
|
|
313
|
-
static printDate(date, separator = "at") {
|
|
314
|
-
return `${Utilities.printDateOnly(date)} ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
315
|
-
}
|
|
316
|
-
static printFriendlyDate(date, separator = "-") {
|
|
317
|
-
let today = new Date();
|
|
318
|
-
today.setHours(0, 0, 0, 0);
|
|
319
|
-
let yesterday = new Date(today);
|
|
320
|
-
yesterday.setDate(yesterday.getDate() - 1);
|
|
321
|
-
let test = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
322
|
-
if (test.toDateString() == today.toDateString())
|
|
323
|
-
return `Today ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
324
|
-
if (test.toDateString() == yesterday.toDateString())
|
|
325
|
-
return `Yesterday ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
326
|
-
else
|
|
327
|
-
return Utilities.printDate(date, separator);
|
|
328
|
-
}
|
|
329
|
-
static printShortDate(date, separator = "/", dateTimeSeparator = "-") {
|
|
330
|
-
var day = date.getDate().toString();
|
|
331
|
-
var month = (date.getMonth() + 1).toString();
|
|
332
|
-
var year = date.getFullYear();
|
|
333
|
-
if (day.length == 1)
|
|
334
|
-
day = "0" + day;
|
|
335
|
-
if (month.length == 1)
|
|
336
|
-
month = "0" + month;
|
|
337
|
-
return `${month}${separator}${day}${separator}${year} ${dateTimeSeparator} ${Utilities.printTimeOnly(date)}`;
|
|
338
|
-
}
|
|
339
|
-
static parseDate(date) {
|
|
340
|
-
if (date) {
|
|
341
|
-
if (date instanceof Date) {
|
|
342
|
-
return date;
|
|
343
|
-
}
|
|
344
|
-
if (typeof date === 'string' || date instanceof String) {
|
|
345
|
-
if (date.search(/[a-su-z+]/i) == -1)
|
|
346
|
-
date = date + "Z";
|
|
347
|
-
return new Date(date);
|
|
348
|
-
}
|
|
349
|
-
if (typeof date === 'number' || date instanceof Number) {
|
|
350
|
-
return new Date(date);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
static Format2Digits(n) {
|
|
355
|
-
return n > 9 ? "" + n : "0" + n;
|
|
356
|
-
}
|
|
357
|
-
static printDuration(start, end) {
|
|
358
|
-
start = new Date(start);
|
|
359
|
-
end = new Date(end);
|
|
360
|
-
// get total seconds between the times
|
|
361
|
-
let delta = Math.abs(start.valueOf() - end.valueOf()) / 1000;
|
|
362
|
-
// calculate (and subtract) whole days
|
|
363
|
-
let days = Math.floor(delta / 86400);
|
|
364
|
-
delta -= days * 86400;
|
|
365
|
-
// calculate (and subtract) whole hours
|
|
366
|
-
let hours = Math.floor(delta / 3600) % 24;
|
|
367
|
-
delta -= hours * 3600;
|
|
368
|
-
// calculate (and subtract) whole minutes
|
|
369
|
-
let minutes = Math.floor(delta / 60) % 60;
|
|
370
|
-
delta -= minutes * 60;
|
|
371
|
-
// what's left is seconds
|
|
372
|
-
let seconds = delta % 60; // in theory the modulus is not required
|
|
373
|
-
let printedDays = "";
|
|
374
|
-
if (days)
|
|
375
|
-
printedDays = `${days} days`;
|
|
376
|
-
if (hours)
|
|
377
|
-
printedDays += printedDays ? `, ${hours} hours` : `${hours} hours`;
|
|
378
|
-
if (minutes)
|
|
379
|
-
printedDays += printedDays ? `, ${minutes} minutes` : `${minutes} minutes`;
|
|
380
|
-
if (seconds)
|
|
381
|
-
printedDays += printedDays ? ` and ${seconds} seconds` : `${seconds} seconds`;
|
|
382
|
-
if (!printedDays)
|
|
383
|
-
printedDays = "0";
|
|
384
|
-
return printedDays;
|
|
385
|
-
}
|
|
386
|
-
static getAge(birthDate, otherDate) {
|
|
387
|
-
birthDate = new Date(birthDate);
|
|
388
|
-
otherDate = new Date(otherDate);
|
|
389
|
-
let years = (otherDate.getFullYear() - birthDate.getFullYear());
|
|
390
|
-
if (otherDate.getMonth() < birthDate.getMonth() ||
|
|
391
|
-
otherDate.getMonth() == birthDate.getMonth() && otherDate.getDate() < birthDate.getDate()) {
|
|
392
|
-
years--;
|
|
393
|
-
}
|
|
394
|
-
return years;
|
|
395
|
-
}
|
|
396
|
-
static isDateAEarlierThanDateB(dateA, dateB) {
|
|
397
|
-
return dateA.getFullYear() < dateB.getFullYear()
|
|
398
|
-
|| (dateA.getFullYear() == dateB.getFullYear() && dateA.getMonth() < dateB.getMonth())
|
|
399
|
-
|| (dateA.getMonth() == dateB.getMonth() && dateA.getDate() < dateB.getDate());
|
|
400
|
-
}
|
|
401
|
-
static searchArray(searchTerm, caseSensitive, ...values) {
|
|
402
|
-
if (!searchTerm)
|
|
403
|
-
return true;
|
|
404
|
-
if (!caseSensitive)
|
|
405
|
-
searchTerm = searchTerm.toLowerCase();
|
|
406
|
-
for (let value of values) {
|
|
407
|
-
if (value != null) {
|
|
408
|
-
let strValue = value.toString();
|
|
409
|
-
if (!caseSensitive)
|
|
410
|
-
strValue = strValue.toLowerCase();
|
|
411
|
-
if (strValue.indexOf(searchTerm) !== -1)
|
|
412
|
-
return true;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
return false;
|
|
416
|
-
}
|
|
417
|
-
static moveArrayItem(array, oldIndex, newIndex) {
|
|
418
|
-
while (oldIndex < 0) {
|
|
419
|
-
oldIndex += this.length;
|
|
420
|
-
}
|
|
421
|
-
while (newIndex < 0) {
|
|
422
|
-
newIndex += this.length;
|
|
423
|
-
}
|
|
424
|
-
if (newIndex >= this.length) {
|
|
425
|
-
var k = newIndex - this.length;
|
|
426
|
-
while ((k--) + 1) {
|
|
427
|
-
array.push(undefined);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
array.splice(newIndex, 0, array.splice(oldIndex, 1)[0]);
|
|
431
|
-
}
|
|
432
|
-
static expandCamelCase(text) {
|
|
433
|
-
if (!text)
|
|
434
|
-
return text;
|
|
435
|
-
return text.replace(/([A-Z][a-z]+)/g, " $1")
|
|
436
|
-
.replace(/([A-Z][A-Z]+)/g, " $1")
|
|
437
|
-
.replace(/([^A-Za-z ]+)/g, " $1");
|
|
438
|
-
}
|
|
439
|
-
static testIsAbsoluteUrl(url) {
|
|
440
|
-
let r = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
441
|
-
return r.test(url);
|
|
442
|
-
}
|
|
443
|
-
static convertToAbsoluteUrl(url) {
|
|
444
|
-
return Utilities.testIsAbsoluteUrl(url) ? url : '//' + url;
|
|
445
|
-
}
|
|
446
|
-
static removeNulls(obj) {
|
|
447
|
-
let isArray = obj instanceof Array;
|
|
448
|
-
for (let k in obj) {
|
|
449
|
-
if (obj[k] === null) {
|
|
450
|
-
isArray ? obj.splice(k, 1) : delete obj[k];
|
|
451
|
-
}
|
|
452
|
-
else if (typeof obj[k] == "object") {
|
|
453
|
-
Utilities.removeNulls(obj[k]);
|
|
454
|
-
}
|
|
455
|
-
if (isArray && obj.length == k) {
|
|
456
|
-
Utilities.removeNulls(obj);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
return obj;
|
|
460
|
-
}
|
|
461
|
-
static debounce(func, wait, immediate) {
|
|
462
|
-
var timeout;
|
|
463
|
-
return function () {
|
|
464
|
-
var context = this;
|
|
465
|
-
var args_ = arguments;
|
|
466
|
-
var later = function () {
|
|
467
|
-
timeout = null;
|
|
468
|
-
if (!immediate)
|
|
469
|
-
func.apply(context, args_);
|
|
470
|
-
};
|
|
471
|
-
var callNow = immediate && !timeout;
|
|
472
|
-
clearTimeout(timeout);
|
|
473
|
-
timeout = setTimeout(later, wait);
|
|
474
|
-
if (callNow)
|
|
475
|
-
func.apply(context, args_);
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
static { this.cookies = {
|
|
479
|
-
getItem: (sKey) => {
|
|
480
|
-
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
|
481
|
-
},
|
|
482
|
-
setItem: (sKey, sValue, vEnd, sPath, sDomain, bSecure) => {
|
|
483
|
-
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) {
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
486
|
-
var sExpires = "";
|
|
487
|
-
if (vEnd) {
|
|
488
|
-
switch (vEnd.constructor) {
|
|
489
|
-
case Number:
|
|
490
|
-
sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
|
|
491
|
-
break;
|
|
492
|
-
case String:
|
|
493
|
-
sExpires = "; expires=" + vEnd;
|
|
494
|
-
break;
|
|
495
|
-
case Date:
|
|
496
|
-
sExpires = "; expires=" + vEnd.toUTCString();
|
|
497
|
-
break;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
|
|
501
|
-
return true;
|
|
502
|
-
},
|
|
503
|
-
removeItem: (sKey, sPath, sDomain) => {
|
|
504
|
-
if (!sKey) {
|
|
505
|
-
return false;
|
|
506
|
-
}
|
|
507
|
-
document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
|
|
508
|
-
return true;
|
|
509
|
-
},
|
|
510
|
-
hasItem: (sKey) => {
|
|
511
|
-
return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
|
|
512
|
-
},
|
|
513
|
-
keys: () => {
|
|
514
|
-
var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
|
|
515
|
-
for (var nIdx = 0; nIdx < aKeys.length; nIdx++) {
|
|
516
|
-
aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);
|
|
517
|
-
}
|
|
518
|
-
return aKeys;
|
|
519
|
-
}
|
|
520
|
-
}; }
|
|
521
|
-
static isNumber(field) {
|
|
522
|
-
return (typeof field === 'number' || field instanceof Number);
|
|
523
|
-
}
|
|
524
|
-
static changeName(item) {
|
|
525
|
-
if (item)
|
|
526
|
-
return item.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '');
|
|
527
|
-
return item;
|
|
528
|
-
}
|
|
529
|
-
static transform(value, args = null) {
|
|
530
|
-
return Object.keys(value).map(k => {
|
|
531
|
-
return { key: k, value: value[k] };
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
static GetChannel(entityTypeKey) {
|
|
535
|
-
if (this.IsNil(entityTypeKey))
|
|
536
|
-
return entityTypeKey;
|
|
537
|
-
let k = entityTypeKey.toLowerCase();
|
|
538
|
-
switch (k) {
|
|
539
|
-
case "shipment":
|
|
540
|
-
return "SHP";
|
|
541
|
-
case "dataimport":
|
|
542
|
-
return "INP";
|
|
543
|
-
case "request":
|
|
544
|
-
return "RQT";
|
|
545
|
-
case "synchronizedcompany":
|
|
546
|
-
return "CPY";
|
|
547
|
-
case "sellingorder":
|
|
548
|
-
return "ORD";
|
|
549
|
-
case "purchaseorder":
|
|
550
|
-
return "ORD";
|
|
551
|
-
default:
|
|
552
|
-
return entityTypeKey;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
static getProp(object, property) {
|
|
556
|
-
return object[property];
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* static getCustomDvalue: stringate
|
|
560
|
-
*/
|
|
561
|
-
static getCustomDate(value) {
|
|
562
|
-
let m;
|
|
563
|
-
if (value.split("/").length > 1)
|
|
564
|
-
m = moment.utc(value, "DD/MM/YYYY");
|
|
565
|
-
else
|
|
566
|
-
m = moment.utc(value);
|
|
567
|
-
let date = new Date(m.year(), m.month(), m.date());
|
|
568
|
-
return isNaN(date.valueOf()) ? null : date;
|
|
569
|
-
}
|
|
570
|
-
static isLowerThan(value1, value2) {
|
|
571
|
-
let d1, d2;
|
|
572
|
-
if (typeof value1 === 'string')
|
|
573
|
-
d1 = this.getCustomDate(value1);
|
|
574
|
-
else
|
|
575
|
-
d1 = value1;
|
|
576
|
-
if (typeof value2 === 'string')
|
|
577
|
-
d2 = this.getCustomDate(value2);
|
|
578
|
-
else
|
|
579
|
-
d2 = value2;
|
|
580
|
-
return d1 < d2;
|
|
581
|
-
}
|
|
582
|
-
static getLogClass(log) {
|
|
583
|
-
let regexInfo = /INFO/g;
|
|
584
|
-
let regexData = /DATA/g;
|
|
585
|
-
let regexError = /ERROR/g;
|
|
586
|
-
let regexWarn = /WARNING/g;
|
|
587
|
-
if (regexInfo.test(log)) {
|
|
588
|
-
return "log-info";
|
|
589
|
-
}
|
|
590
|
-
if (regexData.test(log)) {
|
|
591
|
-
return "log-data";
|
|
592
|
-
}
|
|
593
|
-
if (regexError.test(log)) {
|
|
594
|
-
return "log-error";
|
|
595
|
-
}
|
|
596
|
-
if (regexWarn.test(log)) {
|
|
597
|
-
return "log-warning";
|
|
598
|
-
}
|
|
599
|
-
return "";
|
|
600
|
-
}
|
|
601
|
-
static deepCopy(obj) {
|
|
602
|
-
var copy;
|
|
603
|
-
// Handle the 3 simple types, and null or undefined
|
|
604
|
-
if (null == obj || "object" != typeof obj)
|
|
605
|
-
return obj;
|
|
606
|
-
// Handle Date
|
|
607
|
-
if (obj instanceof Date) {
|
|
608
|
-
copy = new Date();
|
|
609
|
-
copy.setTime(obj.getTime());
|
|
610
|
-
return copy;
|
|
611
|
-
}
|
|
612
|
-
// Handle Array
|
|
613
|
-
if (obj instanceof Array) {
|
|
614
|
-
copy = [];
|
|
615
|
-
for (var i = 0, len = obj.length; i < len; i++) {
|
|
616
|
-
copy[i] = Utilities.deepCopy(obj[i]);
|
|
617
|
-
}
|
|
618
|
-
return copy;
|
|
619
|
-
}
|
|
620
|
-
// Handle Object
|
|
621
|
-
if (obj instanceof Object) {
|
|
622
|
-
copy = {};
|
|
623
|
-
for (var attr in obj) {
|
|
624
|
-
if (obj.hasOwnProperty(attr))
|
|
625
|
-
copy[attr] = Utilities.deepCopy(obj[attr]);
|
|
626
|
-
}
|
|
627
|
-
return copy;
|
|
628
|
-
}
|
|
629
|
-
throw new Error("Unable to copy obj! Its type isn't supported.");
|
|
630
|
-
}
|
|
631
|
-
static getCleanNumber(initial) {
|
|
632
|
-
// Si la chaine est vide, on renvoie 0
|
|
633
|
-
let value = initial.replace(',', '.');
|
|
634
|
-
if (!isNumeric(value)) {
|
|
635
|
-
// On supprime tous les caractères qui ne sont pas des chiffres.
|
|
636
|
-
value = '';
|
|
637
|
-
let hasSeparator = false;
|
|
638
|
-
for (var i = 0; i < initial.length; i++) {
|
|
639
|
-
let ch = initial[i];
|
|
640
|
-
if (isNumeric(ch)) {
|
|
641
|
-
value = value + ch;
|
|
642
|
-
}
|
|
643
|
-
else if (!hasSeparator && (ch == '.' || ch == ',')) {
|
|
644
|
-
value = value + ch;
|
|
645
|
-
hasSeparator = true;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
value = value.replace(',', '.');
|
|
649
|
-
if (!isNumeric(value))
|
|
650
|
-
return 0;
|
|
651
|
-
}
|
|
652
|
-
let n = Number.parseFloat(value);
|
|
653
|
-
return n;
|
|
654
|
-
}
|
|
655
|
-
static addDays(date, days) {
|
|
656
|
-
var date = new Date(date.valueOf());
|
|
657
|
-
date.setDate(date.getDate() + days);
|
|
658
|
-
return date;
|
|
659
|
-
}
|
|
660
|
-
static getFormattedParams(params) {
|
|
661
|
-
// Dans le cas d'un tableau, parcours tous les éléments du tableau pour formatter les
|
|
662
|
-
let result;
|
|
663
|
-
if (Array.isArray(params)) {
|
|
664
|
-
if (params.length > 0 && typeof (params[0]) === 'number')
|
|
665
|
-
return JSON.stringify(params);
|
|
666
|
-
result = [];
|
|
667
|
-
params.forEach(entity => {
|
|
668
|
-
result.push(this.getFormattedParams(entity));
|
|
669
|
-
});
|
|
670
|
-
return JSON.stringify(result);
|
|
671
|
-
}
|
|
672
|
-
result = {};
|
|
673
|
-
for (let key in params) {
|
|
674
|
-
if (params.hasOwnProperty(key)) {
|
|
675
|
-
let val = params[key];
|
|
676
|
-
if (val !== undefined && val !== null) {
|
|
677
|
-
//Handle the Date javascript object
|
|
678
|
-
if (val instanceof Date) {
|
|
679
|
-
val = `${Utilities.Format2Digits(val.getFullYear())}-${Utilities.Format2Digits(val.getMonth() + 1)}-${Utilities.Format2Digits(val.getDate())}T00:00:00.000Z`;
|
|
680
|
-
}
|
|
681
|
-
result[key] = val;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
return result;
|
|
686
|
-
}
|
|
687
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: Utilities, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
688
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: Utilities }); }
|
|
73
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
689
74
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
75
|
+
var Utilities = class Utilities {
|
|
76
|
+
static delay(arg0) {
|
|
77
|
+
throw new Error("Method not implemented.");
|
|
78
|
+
}
|
|
79
|
+
static {
|
|
80
|
+
this.captionAndMessageSeparator = ":";
|
|
81
|
+
}
|
|
82
|
+
static {
|
|
83
|
+
this.noNetworkMessageCaption = "No Network";
|
|
84
|
+
}
|
|
85
|
+
static {
|
|
86
|
+
this.noNetworkMessageDetail = "The server cannot be reached";
|
|
87
|
+
}
|
|
88
|
+
static {
|
|
89
|
+
this.accessDeniedMessageCaption = "Access Denied!";
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.accessDeniedMessageDetail = "";
|
|
93
|
+
}
|
|
94
|
+
static getHttpResponseMessage(data) {
|
|
95
|
+
let responses = [];
|
|
96
|
+
if (data instanceof HttpResponseBase) {
|
|
97
|
+
if (this.checkNoNetwork(data)) responses.push(`${this.noNetworkMessageCaption}${this.captionAndMessageSeparator} ${this.noNetworkMessageDetail}`);
|
|
98
|
+
else {
|
|
99
|
+
let responseObject = this.getResponseBody(data);
|
|
100
|
+
if (responseObject && (typeof responseObject === "object" || responseObject instanceof Object)) {
|
|
101
|
+
for (let key in responseObject) if (key) responses.push(`${key}${this.captionAndMessageSeparator} ${responseObject[key]}`);
|
|
102
|
+
else if (responseObject[key]) responses.push(responseObject[key].toString());
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!responses.length && this.getResponseBody(data)) responses.push(`${data.statusText}: ${this.getResponseBody(data).toString()}`);
|
|
106
|
+
}
|
|
107
|
+
if (!responses.length) responses.push(data.toString());
|
|
108
|
+
if (this.checkAccessDenied(data)) responses.splice(0, 0, `${this.accessDeniedMessageCaption}${this.captionAndMessageSeparator} ${this.accessDeniedMessageDetail}`);
|
|
109
|
+
return responses;
|
|
110
|
+
}
|
|
111
|
+
static findHttpResponseMessage(messageToFind, data, seachInCaptionOnly = true, includeCaptionInResult = false) {
|
|
112
|
+
let searchString = messageToFind.toLowerCase();
|
|
113
|
+
let httpMessages = this.getHttpResponseMessage(data);
|
|
114
|
+
for (let message of httpMessages) {
|
|
115
|
+
let fullMessage = Utilities.splitInTwo(message, this.captionAndMessageSeparator);
|
|
116
|
+
if (fullMessage.firstPart && fullMessage.firstPart.toLowerCase().indexOf(searchString) != -1) return includeCaptionInResult ? message : fullMessage.secondPart || fullMessage.firstPart;
|
|
117
|
+
}
|
|
118
|
+
if (!seachInCaptionOnly) {
|
|
119
|
+
for (let message of httpMessages) if (message.toLowerCase().indexOf(searchString) != -1) {
|
|
120
|
+
if (includeCaptionInResult) return message;
|
|
121
|
+
else {
|
|
122
|
+
let fullMessage = Utilities.splitInTwo(message, this.captionAndMessageSeparator);
|
|
123
|
+
return fullMessage.secondPart || fullMessage.firstPart;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
static getResponseBody(response) {
|
|
130
|
+
if (response instanceof HttpResponse) return response.body;
|
|
131
|
+
if (response instanceof HttpErrorResponse) return response.error || response.message || response.statusText;
|
|
132
|
+
}
|
|
133
|
+
static checkNoNetwork(response) {
|
|
134
|
+
if (response instanceof HttpResponseBase) return response.status == 0;
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
static checkAccessDenied(response) {
|
|
138
|
+
if (response instanceof HttpResponseBase) return response.status == 403;
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
static checkNotFound(response) {
|
|
142
|
+
if (response instanceof HttpResponseBase) return response.status == 404;
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
static checkIsLocalHost(url, base) {
|
|
146
|
+
if (url) {
|
|
147
|
+
let location = new URL(url, base);
|
|
148
|
+
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
static getQueryParamsFromString(paramString) {
|
|
153
|
+
if (!paramString) return null;
|
|
154
|
+
let params = {};
|
|
155
|
+
for (let param of paramString.split("&")) {
|
|
156
|
+
let keyValue = Utilities.splitInTwo(param, "=");
|
|
157
|
+
params[keyValue.firstPart] = keyValue.secondPart;
|
|
158
|
+
}
|
|
159
|
+
return params;
|
|
160
|
+
}
|
|
161
|
+
static splitInTwo(text, separator) {
|
|
162
|
+
let separatorIndex = text.indexOf(separator);
|
|
163
|
+
if (separatorIndex == -1) return {
|
|
164
|
+
firstPart: text,
|
|
165
|
+
secondPart: null
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
firstPart: text.substr(0, separatorIndex).trim(),
|
|
169
|
+
secondPart: text.substr(separatorIndex + 1).trim()
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
static safeStringify(object) {
|
|
173
|
+
let result;
|
|
174
|
+
try {
|
|
175
|
+
result = JSON.stringify(object);
|
|
176
|
+
return result;
|
|
177
|
+
} catch (error) {}
|
|
178
|
+
let simpleObject = {};
|
|
179
|
+
for (let prop in object) {
|
|
180
|
+
if (!object.hasOwnProperty(prop)) continue;
|
|
181
|
+
if (typeof object[prop] == "object") continue;
|
|
182
|
+
if (typeof object[prop] == "function") continue;
|
|
183
|
+
simpleObject[prop] = object[prop];
|
|
184
|
+
}
|
|
185
|
+
result = "[***Sanitized Object***]: " + JSON.stringify(simpleObject);
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
static JSonTryParse(value) {
|
|
189
|
+
try {
|
|
190
|
+
return JSON.parse(value);
|
|
191
|
+
} catch (e) {
|
|
192
|
+
if (value === "undefined") return void 0;
|
|
193
|
+
return value;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
static isNonEmptyString(str) {
|
|
197
|
+
return str && str.length > 0;
|
|
198
|
+
}
|
|
199
|
+
static isEmptyString(str) {
|
|
200
|
+
return Utilities.IsNil(str) || str.length === 0;
|
|
201
|
+
}
|
|
202
|
+
static areValuesEqual(a, b) {
|
|
203
|
+
if (a === b) return true;
|
|
204
|
+
if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
|
|
205
|
+
if (a?.valueOf && b?.valueOf) return a.valueOf() === b.valueOf();
|
|
206
|
+
if (typeof a !== "object" && typeof b !== "object") return a === b;
|
|
207
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
208
|
+
}
|
|
209
|
+
static TestIsObjectEmpty(obj) {
|
|
210
|
+
for (let prop in obj) if (obj.hasOwnProperty(prop)) return false;
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
static IsUndefined(value) {
|
|
214
|
+
return typeof value === "undefined";
|
|
215
|
+
}
|
|
216
|
+
static IsNil(value) {
|
|
217
|
+
return value == null || value === void 0 || typeof value === "undefined";
|
|
218
|
+
}
|
|
219
|
+
static TestIsString(value) {
|
|
220
|
+
return typeof value === "string" || value instanceof String;
|
|
221
|
+
}
|
|
222
|
+
static capitalizeFirstLetter(text) {
|
|
223
|
+
if (text) return text.charAt(0).toUpperCase() + text.slice(1);
|
|
224
|
+
else return text;
|
|
225
|
+
}
|
|
226
|
+
static toTitleCase(text) {
|
|
227
|
+
return text.replace(/\w\S*/g, (subString) => {
|
|
228
|
+
return subString.charAt(0).toUpperCase() + subString.substr(1).toLowerCase();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
static toLowerCase(items) {
|
|
232
|
+
if (items instanceof Array) {
|
|
233
|
+
let loweredRoles = [];
|
|
234
|
+
for (let i = 0; i < items.length; i++) loweredRoles[i] = items[i].toLowerCase();
|
|
235
|
+
return loweredRoles;
|
|
236
|
+
} else if (typeof items === "string" || items instanceof String) return items.toLowerCase();
|
|
237
|
+
}
|
|
238
|
+
static uniqueId() {
|
|
239
|
+
return this.randomNumber(1e6, 9e6).toString();
|
|
240
|
+
}
|
|
241
|
+
static randomNumber(min, max) {
|
|
242
|
+
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
243
|
+
}
|
|
244
|
+
static baseUrl() {
|
|
245
|
+
let base = "";
|
|
246
|
+
if (window.location.origin) base = window.location.origin;
|
|
247
|
+
else base = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
|
|
248
|
+
return base.replace(/\/$/, "");
|
|
249
|
+
}
|
|
250
|
+
static printDateOnly(date) {
|
|
251
|
+
date = new Date(date);
|
|
252
|
+
let dayNames = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
|
253
|
+
let monthNames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
|
|
254
|
+
let dayOfWeek = date.getDay();
|
|
255
|
+
let dayOfMonth = date.getDate();
|
|
256
|
+
let sup = "";
|
|
257
|
+
let month = date.getMonth();
|
|
258
|
+
let year = date.getFullYear();
|
|
259
|
+
if (dayOfMonth == 1 || dayOfMonth == 21 || dayOfMonth == 31) sup = "st";
|
|
260
|
+
else if (dayOfMonth == 2 || dayOfMonth == 22) sup = "nd";
|
|
261
|
+
else if (dayOfMonth == 3 || dayOfMonth == 23) sup = "rd";
|
|
262
|
+
else sup = "th";
|
|
263
|
+
return dayNames[dayOfWeek] + ", " + dayOfMonth + sup + " " + monthNames[month] + " " + year;
|
|
264
|
+
}
|
|
265
|
+
static printTimeOnly(date) {
|
|
266
|
+
date = new Date(date);
|
|
267
|
+
let period = "";
|
|
268
|
+
let minute = date.getMinutes().toString();
|
|
269
|
+
let hour = date.getHours();
|
|
270
|
+
period = hour < 12 ? "AM" : "PM";
|
|
271
|
+
if (hour == 0) hour = 12;
|
|
272
|
+
if (hour > 12) hour = hour - 12;
|
|
273
|
+
if (minute.length == 1) minute = "0" + minute;
|
|
274
|
+
return hour + ":" + minute + " " + period;
|
|
275
|
+
}
|
|
276
|
+
static printDate(date, separator = "at") {
|
|
277
|
+
return `${Utilities.printDateOnly(date)} ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
278
|
+
}
|
|
279
|
+
static printFriendlyDate(date, separator = "-") {
|
|
280
|
+
let today = /* @__PURE__ */ new Date();
|
|
281
|
+
today.setHours(0, 0, 0, 0);
|
|
282
|
+
let yesterday = new Date(today);
|
|
283
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
284
|
+
let test = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
285
|
+
if (test.toDateString() == today.toDateString()) return `Today ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
286
|
+
if (test.toDateString() == yesterday.toDateString()) return `Yesterday ${separator} ${Utilities.printTimeOnly(date)}`;
|
|
287
|
+
else return Utilities.printDate(date, separator);
|
|
288
|
+
}
|
|
289
|
+
static printShortDate(date, separator = "/", dateTimeSeparator = "-") {
|
|
290
|
+
var day = date.getDate().toString();
|
|
291
|
+
var month = (date.getMonth() + 1).toString();
|
|
292
|
+
var year = date.getFullYear();
|
|
293
|
+
if (day.length == 1) day = "0" + day;
|
|
294
|
+
if (month.length == 1) month = "0" + month;
|
|
295
|
+
return `${month}${separator}${day}${separator}${year} ${dateTimeSeparator} ${Utilities.printTimeOnly(date)}`;
|
|
296
|
+
}
|
|
297
|
+
static parseDate(date) {
|
|
298
|
+
if (date) {
|
|
299
|
+
if (date instanceof Date) return date;
|
|
300
|
+
if (typeof date === "string" || date instanceof String) {
|
|
301
|
+
if (date.search(/[a-su-z+]/i) == -1) date = date + "Z";
|
|
302
|
+
return new Date(date);
|
|
303
|
+
}
|
|
304
|
+
if (typeof date === "number" || date instanceof Number) return new Date(date);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
static Format2Digits(n) {
|
|
308
|
+
return n > 9 ? "" + n : "0" + n;
|
|
309
|
+
}
|
|
310
|
+
static printDuration(start, end) {
|
|
311
|
+
start = new Date(start);
|
|
312
|
+
end = new Date(end);
|
|
313
|
+
let delta = Math.abs(start.valueOf() - end.valueOf()) / 1e3;
|
|
314
|
+
let days = Math.floor(delta / 86400);
|
|
315
|
+
delta -= days * 86400;
|
|
316
|
+
let hours = Math.floor(delta / 3600) % 24;
|
|
317
|
+
delta -= hours * 3600;
|
|
318
|
+
let minutes = Math.floor(delta / 60) % 60;
|
|
319
|
+
delta -= minutes * 60;
|
|
320
|
+
let seconds = delta % 60;
|
|
321
|
+
let printedDays = "";
|
|
322
|
+
if (days) printedDays = `${days} days`;
|
|
323
|
+
if (hours) printedDays += printedDays ? `, ${hours} hours` : `${hours} hours`;
|
|
324
|
+
if (minutes) printedDays += printedDays ? `, ${minutes} minutes` : `${minutes} minutes`;
|
|
325
|
+
if (seconds) printedDays += printedDays ? ` and ${seconds} seconds` : `${seconds} seconds`;
|
|
326
|
+
if (!printedDays) printedDays = "0";
|
|
327
|
+
return printedDays;
|
|
328
|
+
}
|
|
329
|
+
static getAge(birthDate, otherDate) {
|
|
330
|
+
birthDate = new Date(birthDate);
|
|
331
|
+
otherDate = new Date(otherDate);
|
|
332
|
+
let years = otherDate.getFullYear() - birthDate.getFullYear();
|
|
333
|
+
if (otherDate.getMonth() < birthDate.getMonth() || otherDate.getMonth() == birthDate.getMonth() && otherDate.getDate() < birthDate.getDate()) years--;
|
|
334
|
+
return years;
|
|
335
|
+
}
|
|
336
|
+
static isDateAEarlierThanDateB(dateA, dateB) {
|
|
337
|
+
return dateA.getFullYear() < dateB.getFullYear() || dateA.getFullYear() == dateB.getFullYear() && dateA.getMonth() < dateB.getMonth() || dateA.getMonth() == dateB.getMonth() && dateA.getDate() < dateB.getDate();
|
|
338
|
+
}
|
|
339
|
+
static searchArray(searchTerm, caseSensitive, ...values) {
|
|
340
|
+
if (!searchTerm) return true;
|
|
341
|
+
if (!caseSensitive) searchTerm = searchTerm.toLowerCase();
|
|
342
|
+
for (let value of values) if (value != null) {
|
|
343
|
+
let strValue = value.toString();
|
|
344
|
+
if (!caseSensitive) strValue = strValue.toLowerCase();
|
|
345
|
+
if (strValue.indexOf(searchTerm) !== -1) return true;
|
|
346
|
+
}
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
static moveArrayItem(array, oldIndex, newIndex) {
|
|
350
|
+
while (oldIndex < 0) oldIndex += this.length;
|
|
351
|
+
while (newIndex < 0) newIndex += this.length;
|
|
352
|
+
if (newIndex >= this.length) {
|
|
353
|
+
var k = newIndex - this.length;
|
|
354
|
+
while (k-- + 1) array.push(void 0);
|
|
355
|
+
}
|
|
356
|
+
array.splice(newIndex, 0, array.splice(oldIndex, 1)[0]);
|
|
357
|
+
}
|
|
358
|
+
static expandCamelCase(text) {
|
|
359
|
+
if (!text) return text;
|
|
360
|
+
return text.replace(/([A-Z][a-z]+)/g, " $1").replace(/([A-Z][A-Z]+)/g, " $1").replace(/([^A-Za-z ]+)/g, " $1");
|
|
361
|
+
}
|
|
362
|
+
static testIsAbsoluteUrl(url) {
|
|
363
|
+
return (/* @__PURE__ */ new RegExp("^(?:[a-z]+:)?//", "i")).test(url);
|
|
364
|
+
}
|
|
365
|
+
static convertToAbsoluteUrl(url) {
|
|
366
|
+
return Utilities.testIsAbsoluteUrl(url) ? url : "//" + url;
|
|
367
|
+
}
|
|
368
|
+
static removeNulls(obj) {
|
|
369
|
+
let isArray = obj instanceof Array;
|
|
370
|
+
for (let k in obj) {
|
|
371
|
+
if (obj[k] === null) isArray ? obj.splice(k, 1) : delete obj[k];
|
|
372
|
+
else if (typeof obj[k] == "object") Utilities.removeNulls(obj[k]);
|
|
373
|
+
if (isArray && obj.length == k) Utilities.removeNulls(obj);
|
|
374
|
+
}
|
|
375
|
+
return obj;
|
|
376
|
+
}
|
|
377
|
+
static debounce(func, wait, immediate) {
|
|
378
|
+
var timeout;
|
|
379
|
+
return function() {
|
|
380
|
+
var context = this;
|
|
381
|
+
var args_ = arguments;
|
|
382
|
+
var later = function() {
|
|
383
|
+
timeout = null;
|
|
384
|
+
if (!immediate) func.apply(context, args_);
|
|
385
|
+
};
|
|
386
|
+
var callNow = immediate && !timeout;
|
|
387
|
+
clearTimeout(timeout);
|
|
388
|
+
timeout = setTimeout(later, wait);
|
|
389
|
+
if (callNow) func.apply(context, args_);
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
static {
|
|
393
|
+
this.cookies = {
|
|
394
|
+
getItem: (sKey) => {
|
|
395
|
+
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
|
396
|
+
},
|
|
397
|
+
setItem: (sKey, sValue, vEnd, sPath, sDomain, bSecure) => {
|
|
398
|
+
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) return false;
|
|
399
|
+
var sExpires = "";
|
|
400
|
+
if (vEnd) switch (vEnd.constructor) {
|
|
401
|
+
case Number:
|
|
402
|
+
sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
|
|
403
|
+
break;
|
|
404
|
+
case String:
|
|
405
|
+
sExpires = "; expires=" + vEnd;
|
|
406
|
+
break;
|
|
407
|
+
case Date: sExpires = "; expires=" + vEnd.toUTCString();
|
|
408
|
+
}
|
|
409
|
+
document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
|
|
410
|
+
return true;
|
|
411
|
+
},
|
|
412
|
+
removeItem: (sKey, sPath, sDomain) => {
|
|
413
|
+
if (!sKey) return false;
|
|
414
|
+
document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
|
|
415
|
+
return true;
|
|
416
|
+
},
|
|
417
|
+
hasItem: (sKey) => {
|
|
418
|
+
return new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(document.cookie);
|
|
419
|
+
},
|
|
420
|
+
keys: () => {
|
|
421
|
+
var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
|
|
422
|
+
for (var nIdx = 0; nIdx < aKeys.length; nIdx++) aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);
|
|
423
|
+
return aKeys;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
static isNumber(field) {
|
|
428
|
+
return typeof field === "number" || field instanceof Number;
|
|
429
|
+
}
|
|
430
|
+
static changeName(item) {
|
|
431
|
+
if (item) return item.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, "");
|
|
432
|
+
return item;
|
|
433
|
+
}
|
|
434
|
+
static transform(value, args = null) {
|
|
435
|
+
return Object.keys(value).map((k) => {
|
|
436
|
+
return {
|
|
437
|
+
key: k,
|
|
438
|
+
value: value[k]
|
|
439
|
+
};
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
static GetChannel(entityTypeKey) {
|
|
443
|
+
if (this.IsNil(entityTypeKey)) return entityTypeKey;
|
|
444
|
+
switch (entityTypeKey.toLowerCase()) {
|
|
445
|
+
case "shipment": return "SHP";
|
|
446
|
+
case "dataimport": return "INP";
|
|
447
|
+
case "request": return "RQT";
|
|
448
|
+
case "synchronizedcompany": return "CPY";
|
|
449
|
+
case "sellingorder": return "ORD";
|
|
450
|
+
case "purchaseorder": return "ORD";
|
|
451
|
+
default: return entityTypeKey;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
static getProp(object, property) {
|
|
455
|
+
return object[property];
|
|
456
|
+
}
|
|
457
|
+
static getCustomDate(value) {
|
|
458
|
+
let m;
|
|
459
|
+
if (value.split("/").length > 1) m = moment.utc(value, "DD/MM/YYYY");
|
|
460
|
+
else m = moment.utc(value);
|
|
461
|
+
let date = new Date(m.year(), m.month(), m.date());
|
|
462
|
+
return isNaN(date.valueOf()) ? null : date;
|
|
463
|
+
}
|
|
464
|
+
static isLowerThan(value1, value2) {
|
|
465
|
+
let d1, d2;
|
|
466
|
+
if (typeof value1 === "string") d1 = this.getCustomDate(value1);
|
|
467
|
+
else d1 = value1;
|
|
468
|
+
if (typeof value2 === "string") d2 = this.getCustomDate(value2);
|
|
469
|
+
else d2 = value2;
|
|
470
|
+
return d1 < d2;
|
|
471
|
+
}
|
|
472
|
+
static getLogClass(log) {
|
|
473
|
+
let regexInfo = /INFO/g;
|
|
474
|
+
let regexData = /DATA/g;
|
|
475
|
+
let regexError = /ERROR/g;
|
|
476
|
+
let regexWarn = /WARNING/g;
|
|
477
|
+
if (regexInfo.test(log)) return "log-info";
|
|
478
|
+
if (regexData.test(log)) return "log-data";
|
|
479
|
+
if (regexError.test(log)) return "log-error";
|
|
480
|
+
if (regexWarn.test(log)) return "log-warning";
|
|
481
|
+
return "";
|
|
482
|
+
}
|
|
483
|
+
static deepCopy(obj) {
|
|
484
|
+
var copy;
|
|
485
|
+
if (null == obj || "object" != typeof obj) return obj;
|
|
486
|
+
if (obj instanceof Date) {
|
|
487
|
+
copy = /* @__PURE__ */ new Date();
|
|
488
|
+
copy.setTime(obj.getTime());
|
|
489
|
+
return copy;
|
|
490
|
+
}
|
|
491
|
+
if (obj instanceof Array) {
|
|
492
|
+
copy = [];
|
|
493
|
+
for (var i = 0, len = obj.length; i < len; i++) copy[i] = Utilities.deepCopy(obj[i]);
|
|
494
|
+
return copy;
|
|
495
|
+
}
|
|
496
|
+
if (obj instanceof Object) {
|
|
497
|
+
copy = {};
|
|
498
|
+
for (var attr in obj) if (obj.hasOwnProperty(attr)) copy[attr] = Utilities.deepCopy(obj[attr]);
|
|
499
|
+
return copy;
|
|
500
|
+
}
|
|
501
|
+
throw new Error("Unable to copy obj! Its type isn't supported.");
|
|
502
|
+
}
|
|
503
|
+
static getCleanNumber(initial) {
|
|
504
|
+
let value = initial.replace(",", ".");
|
|
505
|
+
if (!isNumeric(value)) {
|
|
506
|
+
value = "";
|
|
507
|
+
let hasSeparator = false;
|
|
508
|
+
for (var i = 0; i < initial.length; i++) {
|
|
509
|
+
let ch = initial[i];
|
|
510
|
+
if (isNumeric(ch)) value = value + ch;
|
|
511
|
+
else if (!hasSeparator && (ch == "." || ch == ",")) {
|
|
512
|
+
value = value + ch;
|
|
513
|
+
hasSeparator = true;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
value = value.replace(",", ".");
|
|
517
|
+
if (!isNumeric(value)) return 0;
|
|
518
|
+
}
|
|
519
|
+
return Number.parseFloat(value);
|
|
520
|
+
}
|
|
521
|
+
static addDays(date, days) {
|
|
522
|
+
var date = new Date(date.valueOf());
|
|
523
|
+
date.setDate(date.getDate() + days);
|
|
524
|
+
return date;
|
|
525
|
+
}
|
|
526
|
+
static getFormattedParams(params) {
|
|
527
|
+
let result;
|
|
528
|
+
if (Array.isArray(params)) {
|
|
529
|
+
if (params.length > 0 && typeof params[0] === "number") return JSON.stringify(params);
|
|
530
|
+
result = [];
|
|
531
|
+
params.forEach((entity) => {
|
|
532
|
+
result.push(this.getFormattedParams(entity));
|
|
533
|
+
});
|
|
534
|
+
return JSON.stringify(result);
|
|
535
|
+
}
|
|
536
|
+
result = {};
|
|
537
|
+
for (let key in params) if (params.hasOwnProperty(key)) {
|
|
538
|
+
let val = params[key];
|
|
539
|
+
if (val !== void 0 && val !== null) {
|
|
540
|
+
if (val instanceof Date) val = `${Utilities.Format2Digits(val.getFullYear())}-${Utilities.Format2Digits(val.getMonth() + 1)}-${Utilities.Format2Digits(val.getDate())}T00:00:00.000Z`;
|
|
541
|
+
result[key] = val;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return result;
|
|
545
|
+
}
|
|
546
|
+
static {
|
|
547
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
548
|
+
minVersion: "12.0.0",
|
|
549
|
+
version: "22.2.1",
|
|
550
|
+
ngImport: i0,
|
|
551
|
+
type: Utilities,
|
|
552
|
+
deps: [],
|
|
553
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
static {
|
|
557
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
558
|
+
minVersion: "12.0.0",
|
|
559
|
+
version: "22.2.1",
|
|
560
|
+
ngImport: i0,
|
|
561
|
+
type: Utilities
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
566
|
+
minVersion: "12.0.0",
|
|
567
|
+
version: "22.2.1",
|
|
568
|
+
ngImport: i0,
|
|
569
|
+
type: Utilities,
|
|
570
|
+
decorators: [{ type: Injectable }]
|
|
571
|
+
});
|
|
694
572
|
function nameof(f) {
|
|
695
|
-
|
|
696
|
-
get: (target, key) => key
|
|
697
|
-
});
|
|
698
|
-
return f(p);
|
|
573
|
+
return f(new Proxy({}, { get: (target, key) => key }));
|
|
699
574
|
}
|
|
700
|
-
|
|
701
|
-
// export function groupBy<TItem>(xs: TItem[], key: string) : {[key: string]: TItem[]}{
|
|
702
|
-
// return xs.reduce(function(rv, x) {
|
|
703
|
-
// (rv[x[key]] = rv[x[key]] || []).push(x);
|
|
704
|
-
// return rv;
|
|
705
|
-
// }, {});
|
|
706
|
-
// };
|
|
707
575
|
function groupBy(xs, key) {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
576
|
+
return xs.reduce(function(rv, x) {
|
|
577
|
+
(rv[x[key]] = rv[x[key]] || []).push(x);
|
|
578
|
+
return rv;
|
|
579
|
+
}, {});
|
|
712
580
|
}
|
|
713
|
-
;
|
|
714
581
|
function groupByFunc(xs, func) {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
582
|
+
return xs.reduce(function(rv, x) {
|
|
583
|
+
let k = func(x);
|
|
584
|
+
(rv[k] = rv[k] || []).push(x);
|
|
585
|
+
return rv;
|
|
586
|
+
}, {});
|
|
720
587
|
}
|
|
721
|
-
;
|
|
722
588
|
function sumOf(xs, func) {
|
|
723
|
-
|
|
589
|
+
return xs.map(func).reduce((a, b) => a + b);
|
|
724
590
|
}
|
|
725
|
-
// https://codereview.stackexchange.com/a/100843
|
|
726
591
|
function distinct(array) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}, []);
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
class EnvironmentBase {
|
|
592
|
+
return array.reduce(function(carry, item) {
|
|
593
|
+
if (item && !~carry.indexOf(item)) carry.push(item);
|
|
594
|
+
return carry;
|
|
595
|
+
}, []);
|
|
735
596
|
}
|
|
736
|
-
;
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Generated bundle index. Do not edit.
|
|
740
|
-
*/
|
|
741
|
-
|
|
597
|
+
var EnvironmentBase = class {};
|
|
742
598
|
export { CoreModule, EnsureModuleLoadedOnceGuard, EnvironmentBase, Utilities, distinct, groupBy, groupByFunc, isArray, isNumeric, nameof, sleep, sumOf };
|
|
743
|
-
|
|
599
|
+
|
|
600
|
+
//# sourceMappingURL=dflat-core-web-core.mjs.map
|