@colijnit/sharedcomponents 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -11
- package/bundles/colijnit-sharedcomponents.umd.js +3704 -0
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
- package/colijnit-sharedcomponents.d.ts +16 -0
- package/colijnit-sharedcomponents.metadata.json +1 -0
- package/esm2015/colijnit-sharedcomponents.js +17 -0
- package/esm2015/lib/assets/dictionary/text.properties.js +11 -0
- package/esm2015/lib/components/circular-gauge/co-circular-gauge.component.js +124 -0
- package/esm2015/lib/components/circular-gauge/co-circular-gauge.module.js +21 -0
- package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
- package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
- package/esm2015/lib/components/docsign/docsign.component.js +225 -0
- package/esm2015/lib/components/docsign/docsign.module.js +23 -0
- package/esm2015/lib/components/key-pad/key-pad.component.js +191 -0
- package/esm2015/lib/components/key-pad/key-pad.module.js +21 -0
- package/esm2015/lib/components/layout-switcher/layout-switcher.component.js +74 -0
- package/esm2015/lib/components/layout-switcher/layout-switcher.module.js +21 -0
- package/esm2015/lib/components/linear-gauge/co-linear-gauge.component.js +55 -0
- package/esm2015/lib/components/linear-gauge/co-linear-gauge.module.js +19 -0
- package/esm2015/lib/components/send-method-dialog/enums/send-option.js +8 -0
- package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +309 -0
- package/esm2015/lib/components/send-method-dialog/send-method-dialog.module.js +31 -0
- package/esm2015/lib/components/statusbar/statusbar.component.js +81 -0
- package/esm2015/lib/components/statusbar/statusbar.module.js +23 -0
- package/esm2015/lib/components/stock/stock-information/stock-information.component.js +54 -0
- package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +350 -0
- package/esm2015/lib/components/stock/stock-location/stock-location.component.js +62 -0
- package/esm2015/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.js +2 -0
- package/esm2015/lib/components/stock/stock-transfer/stock-change-amount.component.js +68 -0
- package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +130 -0
- package/esm2015/lib/components/stock/stock.component.js +140 -0
- package/esm2015/lib/components/stock/stock.module.js +48 -0
- package/esm2015/lib/enum/icon.enum.js +19 -0
- package/esm2015/lib/enum/keyboard-code.enum.js +32 -0
- package/esm2015/lib/enum/language-code.enum.js +8 -0
- package/esm2015/lib/factory/business-object-factory.js +120 -0
- package/esm2015/lib/factory/decorators/boolean.decorator.js +102 -0
- package/esm2015/lib/factory/decorators/complex-array.decorator.js +55 -0
- package/esm2015/lib/factory/decorators/complex-field.decorator.js +57 -0
- package/esm2015/lib/factory/decorators/date-field.decorator.js +36 -0
- package/esm2015/lib/factory/decorators/string-number.decorator.js +43 -0
- package/esm2015/lib/model/business-object.js +81 -0
- package/esm2015/lib/model/icon-svg.js +18 -0
- package/esm2015/lib/service/dictionary.service.js +76 -0
- package/esm2015/lib/service/icon-cache.service.js +51 -0
- package/esm2015/lib/service/options.service.js +71 -0
- package/esm2015/lib/service/shared-connector.service.js +278 -0
- package/esm2015/lib/service/shared.service.js +30 -0
- package/esm2015/lib/service/stock.service.js +95 -0
- package/esm2015/lib/utils/array-utils.js +183 -0
- package/esm2015/lib/utils/is-nill.function.js +5 -0
- package/esm2015/lib/utils/string-utils.js +64 -0
- package/esm2015/public-api.js +21 -0
- package/fesm2015/colijnit-sharedcomponents.js +3514 -0
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
- package/lib/assets/dictionary/text.properties.d.ts +3 -0
- package/lib/components/circular-gauge/co-circular-gauge.component.d.ts +20 -0
- package/lib/components/circular-gauge/co-circular-gauge.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_layout.scss +6 -3
- package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/circular-gauge/style/material.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/agenda/style/material.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/component/calendar/style/material.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/date-planning/style/material.scss +0 -0
- package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
- package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
- package/lib/components/docsign/docsign.component.d.ts +92 -0
- package/lib/components/docsign/docsign.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/material.scss +0 -0
- package/lib/components/key-pad/key-pad.component.d.ts +36 -0
- package/lib/components/key-pad/key-pad.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/key-pad/style/material.scss +0 -0
- package/lib/components/layout-switcher/layout-switcher.component.d.ts +16 -0
- package/lib/components/layout-switcher/layout-switcher.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/layout-switcher/style/material.scss +0 -0
- package/lib/components/linear-gauge/co-linear-gauge.component.d.ts +16 -0
- package/lib/components/linear-gauge/co-linear-gauge.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/linear-gauge/style/material.scss +0 -0
- package/lib/components/send-method-dialog/enums/send-option.d.ts +6 -0
- package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +62 -0
- package/lib/components/send-method-dialog/send-method-dialog.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/send-method-dialog/style/material.scss +0 -0
- package/lib/components/statusbar/statusbar.component.d.ts +22 -0
- package/lib/components/statusbar/statusbar.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/statusbar/style/material.scss +0 -0
- package/lib/components/stock/stock-information/stock-information.component.d.ts +10 -0
- package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +60 -0
- package/lib/components/stock/stock-location/stock-location.component.d.ts +15 -0
- package/{projects/sharedcomponents/src/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.ts → lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.d.ts} +2 -2
- package/lib/components/stock/stock-transfer/stock-change-amount.component.d.ts +18 -0
- package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +36 -0
- package/lib/components/stock/stock.component.d.ts +42 -0
- package/lib/components/stock/stock.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/material.scss +0 -0
- package/{projects/sharedcomponents/src/lib/enum/icon.enum.ts → lib/enum/icon.enum.d.ts} +2 -3
- package/lib/enum/keyboard-code.enum.d.ts +30 -0
- package/lib/enum/language-code.enum.d.ts +6 -0
- package/lib/factory/business-object-factory.d.ts +23 -0
- package/lib/factory/decorators/boolean.decorator.d.ts +43 -0
- package/lib/factory/decorators/complex-array.decorator.d.ts +25 -0
- package/lib/factory/decorators/complex-field.decorator.d.ts +25 -0
- package/lib/factory/decorators/date-field.decorator.d.ts +17 -0
- package/lib/factory/decorators/string-number.decorator.d.ts +22 -0
- package/lib/model/business-object.d.ts +7 -0
- package/lib/model/icon-svg.d.ts +4 -0
- package/lib/service/dictionary.service.d.ts +21 -0
- package/lib/service/icon-cache.service.d.ts +18 -0
- package/lib/service/options.service.d.ts +13 -0
- package/lib/service/shared-connector.service.d.ts +43 -0
- package/lib/service/shared.service.d.ts +8 -0
- package/lib/service/stock.service.d.ts +38 -0
- package/{projects/sharedcomponents/src/lib → lib}/style/_mixin.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/style/_variables.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/style/sharedcomponents-globals.scss +0 -0
- package/lib/utils/array-utils.d.ts +57 -0
- package/lib/utils/is-nill.function.d.ts +1 -0
- package/lib/utils/string-utils.d.ts +22 -0
- package/package.json +26 -74
- package/{projects/sharedcomponents/src/public-api.ts → public-api.d.ts} +0 -5
- package/.browserslistrc +0 -16
- package/.editorconfig +0 -16
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/tasks.json +0 -42
- package/Sharedcomponents.iml +0 -11
- package/angular.json +0 -133
- package/karma.conf.js +0 -44
- package/move-assets.js +0 -14
- package/projects/sharedcomponents/.browserslistrc +0 -16
- package/projects/sharedcomponents/README.md +0 -24
- package/projects/sharedcomponents/karma.conf.js +0 -44
- package/projects/sharedcomponents/ng-package.json +0 -17
- package/projects/sharedcomponents/package.json +0 -18
- package/projects/sharedcomponents/src/lib/assets/dictionary/text.properties.ts +0 -8
- package/projects/sharedcomponents/src/lib/assets/icons/angle_left_solid.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/angle_right_solid.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/arrow_fat_right.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/arrow_point_left.svg +0 -8
- package/projects/sharedcomponents/src/lib/assets/icons/arrow_point_right.svg +0 -4
- package/projects/sharedcomponents/src/lib/assets/icons/bring_forward_regular.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/check_round.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/delete_left_regular.svg +0 -1
- package/projects/sharedcomponents/src/lib/assets/icons/delivery_truck.svg +0 -12
- package/projects/sharedcomponents/src/lib/assets/icons/email.svg +0 -5
- package/projects/sharedcomponents/src/lib/assets/icons/pdf.svg +0 -15
- package/projects/sharedcomponents/src/lib/assets/icons/print.svg +0 -10
- package/projects/sharedcomponents/src/lib/assets/icons/signature_field.svg +0 -9
- package/projects/sharedcomponents/src/lib/assets/icons/xml.svg +0 -9
- package/projects/sharedcomponents/src/lib/components/circular-gauge/co-circular-gauge.component.ts +0 -139
- package/projects/sharedcomponents/src/lib/components/circular-gauge/co-circular-gauge.module.ts +0 -19
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-base-view.component.ts +0 -68
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-day-view.component.ts +0 -31
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-event.component.ts +0 -67
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-events.component.ts +0 -48
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.ts +0 -81
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-header.component.ts +0 -265
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-cell.component.ts +0 -38
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.ts +0 -50
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-hour-view.component.ts +0 -46
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-month-view.component.ts +0 -65
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-view.component.ts +0 -38
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-week-select-view.component.ts +0 -63
- package/projects/sharedcomponents/src/lib/components/date-planning/component/agenda/agenda-week-view.component.ts +0 -46
- package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-all-months.component.ts +0 -37
- package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-all-years.component.ts +0 -52
- package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-header.component.ts +0 -124
- package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar-view.component.ts +0 -201
- package/projects/sharedcomponents/src/lib/components/date-planning/component/calendar/calendar.component.ts +0 -35
- package/projects/sharedcomponents/src/lib/components/date-planning/date-planning.component.ts +0 -133
- package/projects/sharedcomponents/src/lib/components/date-planning/date-planning.module.ts +0 -56
- package/projects/sharedcomponents/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
- package/projects/sharedcomponents/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
- package/projects/sharedcomponents/src/lib/components/docsign/docsign.component.ts +0 -252
- package/projects/sharedcomponents/src/lib/components/docsign/docsign.module.ts +0 -22
- package/projects/sharedcomponents/src/lib/components/key-pad/key-pad.component.ts +0 -205
- package/projects/sharedcomponents/src/lib/components/key-pad/key-pad.module.ts +0 -19
- package/projects/sharedcomponents/src/lib/components/layout-switcher/layout-switcher.component.ts +0 -98
- package/projects/sharedcomponents/src/lib/components/layout-switcher/layout-switcher.module.ts +0 -21
- package/projects/sharedcomponents/src/lib/components/linear-gauge/co-linear-gauge.component.ts +0 -56
- package/projects/sharedcomponents/src/lib/components/linear-gauge/co-linear-gauge.module.ts +0 -17
- package/projects/sharedcomponents/src/lib/components/send-method-dialog/enums/send-option.ts +0 -6
- package/projects/sharedcomponents/src/lib/components/send-method-dialog/send-method-dialog.component.ts +0 -342
- package/projects/sharedcomponents/src/lib/components/send-method-dialog/send-method-dialog.module.ts +0 -33
- package/projects/sharedcomponents/src/lib/components/statusbar/statusbar.component.ts +0 -97
- package/projects/sharedcomponents/src/lib/components/statusbar/statusbar.module.ts +0 -21
- package/projects/sharedcomponents/src/lib/components/stock/stock-in-order/stock-in-order.component.ts +0 -0
- package/projects/sharedcomponents/src/lib/components/stock/stock-information/stock-information.component.ts +0 -64
- package/projects/sharedcomponents/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -384
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/stock-location.component.ts +0 -84
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-change-amount.component.ts +0 -73
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -153
- package/projects/sharedcomponents/src/lib/components/stock/stock.component.ts +0 -165
- package/projects/sharedcomponents/src/lib/components/stock/stock.module.ts +0 -51
- package/projects/sharedcomponents/src/lib/enum/calendar-view.enum.ts +0 -6
- package/projects/sharedcomponents/src/lib/enum/keyboard-code.enum.ts +0 -30
- package/projects/sharedcomponents/src/lib/enum/language-code.enum.ts +0 -6
- package/projects/sharedcomponents/src/lib/enum/month.enum.ts +0 -15
- package/projects/sharedcomponents/src/lib/enum/time-period.enum.ts +0 -9
- package/projects/sharedcomponents/src/lib/factory/business-object-factory.ts +0 -120
- package/projects/sharedcomponents/src/lib/factory/decorators/boolean.decorator.ts +0 -113
- package/projects/sharedcomponents/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
- package/projects/sharedcomponents/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
- package/projects/sharedcomponents/src/lib/factory/decorators/date-field.decorator.ts +0 -41
- package/projects/sharedcomponents/src/lib/factory/decorators/string-number.decorator.ts +0 -48
- package/projects/sharedcomponents/src/lib/model/agenda-event-per-day.model.ts +0 -6
- package/projects/sharedcomponents/src/lib/model/agenda-event.model.ts +0 -17
- package/projects/sharedcomponents/src/lib/model/agenda-null-objects.ts +0 -11
- package/projects/sharedcomponents/src/lib/model/business-object.ts +0 -85
- package/projects/sharedcomponents/src/lib/model/constant/all-months.ts +0 -17
- package/projects/sharedcomponents/src/lib/model/date-range.ts +0 -10
- package/projects/sharedcomponents/src/lib/model/day.model.ts +0 -9
- package/projects/sharedcomponents/src/lib/model/icon-svg.ts +0 -18
- package/projects/sharedcomponents/src/lib/model/month.model.ts +0 -11
- package/projects/sharedcomponents/src/lib/model/time-window.bo.ts +0 -21
- package/projects/sharedcomponents/src/lib/model/week.model.ts +0 -5
- package/projects/sharedcomponents/src/lib/model/weekday.model.ts +0 -17
- package/projects/sharedcomponents/src/lib/pipe/array-number.pipe.ts +0 -14
- package/projects/sharedcomponents/src/lib/pipe/master-pipes.ts +0 -7
- package/projects/sharedcomponents/src/lib/pipe/ucfirst.pipe.ts +0 -14
- package/projects/sharedcomponents/src/lib/service/dictionary.service.ts +0 -86
- package/projects/sharedcomponents/src/lib/service/icon-cache.service.ts +0 -51
- package/projects/sharedcomponents/src/lib/service/options.service.ts +0 -66
- package/projects/sharedcomponents/src/lib/service/shared-connector.service.ts +0 -258
- package/projects/sharedcomponents/src/lib/service/shared-initializer.service.ts +0 -29
- package/projects/sharedcomponents/src/lib/service/shared.service.ts +0 -21
- package/projects/sharedcomponents/src/lib/service/stock.service.ts +0 -95
- package/projects/sharedcomponents/src/lib/utils/array-utils.ts +0 -202
- package/projects/sharedcomponents/src/lib/utils/calendar.utils.ts +0 -75
- package/projects/sharedcomponents/src/lib/utils/date-utils.ts +0 -302
- package/projects/sharedcomponents/src/lib/utils/function/not-nill.function.ts +0 -4
- package/projects/sharedcomponents/src/lib/utils/is-nill.function.ts +0 -4
- package/projects/sharedcomponents/src/lib/utils/string-utils.ts +0 -67
- package/projects/sharedcomponents/src/test.ts +0 -27
- package/projects/sharedcomponents/tsconfig.lib.json +0 -18
- package/projects/sharedcomponents/tsconfig.lib.prod.json +0 -10
- package/projects/sharedcomponents/tsconfig.spec.json +0 -17
- package/script/merge-icons.js +0 -39
- package/src/app/app.component.scss +0 -9
- package/src/app/app.component.spec.ts +0 -31
- package/src/app/app.component.ts +0 -156
- package/src/app/app.module.ts +0 -60
- package/src/assets/.gitkeep +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -16
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -13
- package/src/main.ts +0 -12
- package/src/polyfills.ts +0 -53
- package/src/styles.scss +0 -40
- package/src/test.ts +0 -26
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -65
- package/tsconfig.spec.json +0 -18
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {DateUtils} from "./date-utils";
|
|
2
|
-
import {Weekday} from "../model/weekday.model";
|
|
3
|
-
import {Inject, LOCALE_ID} from "@angular/core";
|
|
4
|
-
import {LanguageCode} from "../enum/language-code.enum";
|
|
5
|
-
import {Week} from "../model/week.model";
|
|
6
|
-
|
|
7
|
-
export class CalendarUtils {
|
|
8
|
-
public static Locale: LanguageCode;
|
|
9
|
-
|
|
10
|
-
public static Now: Date = new Date();
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
@Inject(LOCALE_ID) private readonly _locale: LanguageCode
|
|
14
|
-
) {
|
|
15
|
-
CalendarUtils.Locale = _locale;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public static GetCurrentYear(): number {
|
|
19
|
-
return this.Now.getFullYear();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public static GetCurrentMonth(): number {
|
|
23
|
-
return this.Now.getUTCMonth() + 1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public static GetDayHours(day: Date): Date[] {
|
|
27
|
-
const datesByTheHour: Date[] = [];
|
|
28
|
-
if (day) {
|
|
29
|
-
let newDate: Date = new Date(day);
|
|
30
|
-
newDate.setHours(0, 0, 0, 0);
|
|
31
|
-
datesByTheHour.push(newDate);
|
|
32
|
-
for (let i: number = 0; i < 23; i++) {
|
|
33
|
-
newDate = new Date(newDate);
|
|
34
|
-
newDate.setHours(newDate.getHours() + 1);
|
|
35
|
-
datesByTheHour.push(newDate);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return datesByTheHour;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public static GetDaysOfWeek(date: Date): Week {
|
|
42
|
-
let day: Date = DateUtils.GetFirstDayOfWeek(date);
|
|
43
|
-
const daysOfWeek: Weekday[] = [];
|
|
44
|
-
let options: any;
|
|
45
|
-
let month: number;
|
|
46
|
-
for (let i: number = 0; i < 7; i++) {
|
|
47
|
-
const dayPerWeek: Weekday = new Weekday();
|
|
48
|
-
const dayHours: Date[] = CalendarUtils.GetDayHours(day);
|
|
49
|
-
dayPerWeek.newMonth = day.getMonth() !== month;
|
|
50
|
-
dayPerWeek.weekdaySelected = day.getDay() === date.getDay();
|
|
51
|
-
dayPerWeek.weekdayDay = day.getDate();
|
|
52
|
-
options = { weekday: "short" };
|
|
53
|
-
dayPerWeek.weekdayShort = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
54
|
-
options = { weekday: "long" };
|
|
55
|
-
dayPerWeek.weekdayLong = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
56
|
-
|
|
57
|
-
options = { month: "short" };
|
|
58
|
-
dayPerWeek.weekdayMonthShort = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
59
|
-
options = { month: "long" };
|
|
60
|
-
dayPerWeek.weekdayMonthLong = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
61
|
-
dayPerWeek.weekdayYear = day.getFullYear();
|
|
62
|
-
|
|
63
|
-
dayPerWeek.date = new Date(day);
|
|
64
|
-
dayPerWeek.datesByTheHour = dayHours;
|
|
65
|
-
daysOfWeek.push(dayPerWeek);
|
|
66
|
-
month = day.getMonth();
|
|
67
|
-
day = new Date(day);
|
|
68
|
-
day.setDate(day.getDate() + 1);
|
|
69
|
-
}
|
|
70
|
-
const week: Week = new Week();
|
|
71
|
-
week.weekDays = daysOfWeek;
|
|
72
|
-
return week;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import {Month} from "../enum/month.enum";
|
|
2
|
-
import {ALL_MONTHS} from "../model/constant/all-months";
|
|
3
|
-
import {notNill} from "./function/not-nill.function";
|
|
4
|
-
import * as moment from "moment";
|
|
5
|
-
import {Moment} from "moment";
|
|
6
|
-
import {DatePipe} from "@angular/common";
|
|
7
|
-
import {DateRange} from "../model/date-range";
|
|
8
|
-
|
|
9
|
-
Date.prototype.toJSON = function() {
|
|
10
|
-
return moment(this).format('YYYY-MM-DD[T]HH:mm:ss');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// static utility function holder related to dates
|
|
14
|
-
export class DateUtils {
|
|
15
|
-
public static readonly BACKEND_DATE_FORMAT: string = 'YYYY-MM-DD[T]HH:mm:ss';
|
|
16
|
-
public static datePipe: DatePipe;
|
|
17
|
-
|
|
18
|
-
public static NowAsString(): string {
|
|
19
|
-
return DateUtils.ParseDate(new Date(), DateUtils.BACKEND_DATE_FORMAT);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public static ParseDate(date: Date, format: string = "d-m-y"): string {
|
|
23
|
-
if (!date) {
|
|
24
|
-
return "";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const day: string = ("0" + date.getDate()).slice(-2);
|
|
28
|
-
const month: string = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
29
|
-
const year: string = date.getFullYear() + "";
|
|
30
|
-
|
|
31
|
-
const formatParts: string[] = format.split("-");
|
|
32
|
-
const dateParts: string[] = [];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (let i: number = 0, l: number = formatParts.length; i < l; i++) {
|
|
36
|
-
switch (formatParts[i]) {
|
|
37
|
-
case "d" :
|
|
38
|
-
case "DD" :
|
|
39
|
-
dateParts.push(day);
|
|
40
|
-
break;
|
|
41
|
-
case "m" :
|
|
42
|
-
case "MM" :
|
|
43
|
-
dateParts.push(month);
|
|
44
|
-
break;
|
|
45
|
-
case "y" :
|
|
46
|
-
case "YYYY" :
|
|
47
|
-
dateParts.push(year);
|
|
48
|
-
break;
|
|
49
|
-
default:
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return dateParts.join("-");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public static GetWeekNumber(date: Date): number {
|
|
57
|
-
date = new Date(date.getTime());
|
|
58
|
-
date.setHours(0, 0, 0, 0);
|
|
59
|
-
date.setDate(date.getDate() + 4 - (date.getDay() || 7));
|
|
60
|
-
return Math.ceil((((date.getTime() - new Date(date.getFullYear(), 0, 1).getTime()) / 8.64e7) + 1) / 7);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Returns the number of days from now, for the given date in the future. Returns negative days if given date is in the past from now.
|
|
64
|
-
public static GetDaysFromNow(date: Date): number {
|
|
65
|
-
return DateUtils.GetDayDifference(new Date(Date.now()), date);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public static StringAsDate(str: string, format: string = DateUtils.BACKEND_DATE_FORMAT): Date {
|
|
69
|
-
if (notNill(str)) {
|
|
70
|
-
if (!isNaN(Number(str))) {
|
|
71
|
-
return new Date(str);
|
|
72
|
-
} else {
|
|
73
|
-
const time: any = moment(str, format, true);
|
|
74
|
-
return time.isValid() ? new Date(time) : undefined;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public static MomentToDate(time: Moment): Date {
|
|
82
|
-
if (!time || !time.isValid()) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const d: Date = new Date(time.format(DateUtils.BACKEND_DATE_FORMAT));
|
|
87
|
-
d.setHours(time.hours());
|
|
88
|
-
d.setMinutes(time.minutes());
|
|
89
|
-
d.setSeconds(time.seconds());
|
|
90
|
-
return d;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public static GetCurrentMonth(): Month {
|
|
94
|
-
return ALL_MONTHS[new Date().getMonth()];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// @returns e.g. ["FEBRUARI", "MARCH", ..] if it's Februari today, otherwise e.g. ["APRIL", "MAY", ...] if it's April today
|
|
98
|
-
public static Get12MonthsArrayWithFirstMonthIsCurrentMonth(): Month[] {
|
|
99
|
-
const answer: Month[] = [];
|
|
100
|
-
|
|
101
|
-
let monthNrToAdd: number = new Date().getMonth();
|
|
102
|
-
for (let i: number = 0; i < 12; i++) {
|
|
103
|
-
answer.push(ALL_MONTHS[monthNrToAdd]);
|
|
104
|
-
monthNrToAdd = (monthNrToAdd + 1) % ALL_MONTHS.length;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return answer;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
public static GetFirstDayOfWeek(date: Date): Date {
|
|
111
|
-
if (!DateUtils._ValidDate(date)) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
let firstDay: Date;
|
|
115
|
-
const dayOfWeek: number = date.getDay() || 7;
|
|
116
|
-
if (dayOfWeek === 1) {
|
|
117
|
-
firstDay = new Date(date);
|
|
118
|
-
} else {
|
|
119
|
-
firstDay = new Date(date);
|
|
120
|
-
firstDay.setHours(-24 * (dayOfWeek - 1));
|
|
121
|
-
}
|
|
122
|
-
return firstDay;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
public static GetLastDayOfWeek(date: Date): Date {
|
|
126
|
-
const firstDayOfWeek: Date = DateUtils.GetFirstDayOfWeek(date);
|
|
127
|
-
const lastDayOfWeek: Date = new Date(firstDayOfWeek);
|
|
128
|
-
lastDayOfWeek.setDate(firstDayOfWeek.getDate() + 6);
|
|
129
|
-
return lastDayOfWeek;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
public static GetFirstDayOfMonth(date: Date): Date {
|
|
133
|
-
if (!DateUtils._ValidDate(date)) {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
const year: number = date.getFullYear();
|
|
137
|
-
const month: number = date.getMonth();
|
|
138
|
-
return new Date(year, month, 1);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
public static GetLastDayOfMonth(date: Date): Date {
|
|
142
|
-
if (!DateUtils._ValidDate(date)) {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
const year: number = date.getFullYear();
|
|
146
|
-
const month: number = date.getMonth();
|
|
147
|
-
return new Date(year, month + 1, 0);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
public static DatesEqual(date1: Date, date2: Date): boolean {
|
|
151
|
-
let result: boolean = false;
|
|
152
|
-
if (DateUtils._ValidDate(date1) && DateUtils._ValidDate(date2)) {
|
|
153
|
-
result =
|
|
154
|
-
date1.getDate() === date2.getDate() &&
|
|
155
|
-
date1.getMonth() === date2.getMonth() &&
|
|
156
|
-
date1.getFullYear() === date2.getFullYear();
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
public static DateRangeEqual(dates1: DateRange, dates2: DateRange): boolean {
|
|
162
|
-
return (this.DatesEqual(dates1.startDate, dates2.startDate) &&
|
|
163
|
-
this.DatesEqual(dates1.endDate, dates2.endDate));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
public static AddMinutes(date: Date, minutes: number): Date {
|
|
167
|
-
return new Date(date.getTime() + (minutes * 60000));
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
public static AddDays(date: Date, days: number): Date {
|
|
171
|
-
const result: Date = new Date(date);
|
|
172
|
-
result.setDate(result.getDate() + days);
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
public static AddMonths(date: Date, months: number): Date {
|
|
177
|
-
const result: Date = new Date(date);
|
|
178
|
-
result.setMonth(result.getMonth() + months);
|
|
179
|
-
return result;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
public static DetermineDSTBreakpoints(): { start: string, end: string } {
|
|
183
|
-
const endOfYear: Date = new Date(new Date().getFullYear(), 11, 1);
|
|
184
|
-
let checkDate: Date = new Date(new Date().getFullYear(), 0, 1);
|
|
185
|
-
let offset: number = checkDate.getTimezoneOffset();
|
|
186
|
-
|
|
187
|
-
const periodStart: Date = new Date();
|
|
188
|
-
let periodStartSet: boolean = false;
|
|
189
|
-
const periodEnd: Date = new Date();
|
|
190
|
-
let periodEndSet: boolean = false;
|
|
191
|
-
while (checkDate.getTime() < endOfYear.getTime()) {
|
|
192
|
-
checkDate = this.AddMinutes(checkDate, 60);
|
|
193
|
-
if (offset < checkDate.getTimezoneOffset()) {
|
|
194
|
-
periodEnd.setTime(checkDate.getTime());
|
|
195
|
-
periodEndSet = true;
|
|
196
|
-
} else if (offset > checkDate.getTimezoneOffset()) {
|
|
197
|
-
periodStart.setTime(checkDate.getTime());
|
|
198
|
-
periodStartSet = true;
|
|
199
|
-
}
|
|
200
|
-
offset = checkDate.getTimezoneOffset();
|
|
201
|
-
if (periodStartSet && periodEndSet) {
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (periodStartSet && periodEndSet) {
|
|
207
|
-
return {
|
|
208
|
-
start: this._DateToTimeStringWithDateFormat(periodStart),
|
|
209
|
-
end: this._DateToTimeStringWithDateFormat(periodEnd)
|
|
210
|
-
};
|
|
211
|
-
} else {
|
|
212
|
-
return {start: undefined, end: undefined}; // important otherwise we return new Date() for both
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
private static _ValidDate(date: Date): boolean {
|
|
217
|
-
return date !== null && date !== undefined;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Returns the difference between the two given days as the number of days, in float precision (date to - date from).
|
|
222
|
-
* Returns negative values of the 'from' date is later than in time than the 'to' date.
|
|
223
|
-
*/
|
|
224
|
-
public static GetDayDifference(from: Date, to: Date): number {
|
|
225
|
-
if (!from || !to) {
|
|
226
|
-
return NaN;
|
|
227
|
-
}
|
|
228
|
-
return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
public static IsSameDay(dateOne: Date, dateTwo: Date): boolean {
|
|
232
|
-
return (dateOne && dateTwo &&
|
|
233
|
-
dateOne.getDate() === dateTwo.getDate()
|
|
234
|
-
&& dateOne.getMonth() === dateTwo.getMonth()
|
|
235
|
-
&& dateOne.getFullYear() === dateTwo.getFullYear());
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
public static IsInBetween(date: Date, startDate: Date, endDate: Date, withTime: boolean = true): boolean {
|
|
239
|
-
if (startDate && endDate) {
|
|
240
|
-
if (withTime) {
|
|
241
|
-
return (date > startDate && date < endDate);
|
|
242
|
-
} else {
|
|
243
|
-
const dateWithoutTime: number = new Date(date).setHours(0, 0, 0, 0),
|
|
244
|
-
dateFromWithoutTime: number = new Date(startDate).setHours(0, 0, 0, 0),
|
|
245
|
-
dateToWithoutTime: number = new Date(endDate).setHours(0, 0, 0, 0);
|
|
246
|
-
return dateWithoutTime >= dateFromWithoutTime && dateWithoutTime <= dateToWithoutTime;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
public static IsMonday(date: Date): boolean {
|
|
252
|
-
return date.getDay() === 1;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
public static IsSunday(date: Date): boolean {
|
|
256
|
-
return date.getDay() === 0;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
public static IsToday(date: Date): boolean {
|
|
260
|
-
const today: Date = new Date();
|
|
261
|
-
return DateUtils.IsSameDay(today, date);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Returns date format like it would when using a pipe in the templete, ie: "1 okt. 2020"
|
|
265
|
-
public static ParseDateInShortDateFormat(date: Date, locale: string): string {
|
|
266
|
-
this.datePipe = new DatePipe(locale);
|
|
267
|
-
const parsedDate: string = this.datePipe.transform(date);
|
|
268
|
-
return parsedDate;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Transforms a string that is formatted like "'17-08-2014'<=?<='17-08-2021'" into "'17-08-2014' Untill '17-08-2021'"
|
|
272
|
-
public static getFormattedDateRangeString(dateRangeString: string, separator: string = " - "): string {
|
|
273
|
-
let newString: string = dateRangeString;
|
|
274
|
-
newString = newString.replace("<=?<=", ` ${separator} `);
|
|
275
|
-
newString = newString.replace(/'/g, "");
|
|
276
|
-
|
|
277
|
-
return newString;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
public static SetDateOrDateRangeObjectHoursZero(date: Date | DateRange): void {
|
|
281
|
-
if (date instanceof DateRange) {
|
|
282
|
-
if (date.startDate) {
|
|
283
|
-
date.startDate.setHours(0, 0, 0);
|
|
284
|
-
}
|
|
285
|
-
if (date.endDate) {
|
|
286
|
-
date.endDate.setHours(0, 0, 0);
|
|
287
|
-
}
|
|
288
|
-
} else if (!!date && (date instanceof Date)) {
|
|
289
|
-
date.setHours(0, 0, 0, 0);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
private static _DateToTimeStringWithDateFormat(value: Date, dateFormat: string = "d-m-y"): string {
|
|
294
|
-
if (!value) {
|
|
295
|
-
return "";
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const hours: string = value.getHours() < 10 ? "0" + value.getHours() : "" + value.getHours();
|
|
299
|
-
const minutes: string = value.getMinutes() < 10 ? "0" + value.getMinutes() : "" + value.getMinutes();
|
|
300
|
-
return this.ParseDate(value, dateFormat) + " " + [hours, minutes].join(":");
|
|
301
|
-
}
|
|
302
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Static utility functions holder related to strings.
|
|
2
|
-
export class StringUtils {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Returns a new string where given placeholder in given source string are replaced by given replacement texts.
|
|
6
|
-
*
|
|
7
|
-
* Example usage:
|
|
8
|
-
*
|
|
9
|
-
* source = "ABCDABCD"
|
|
10
|
-
* placeholder = "BC"
|
|
11
|
-
* replacementTexts = "Z", "Z" (REST arguments)
|
|
12
|
-
* OUTPUT = "AZDAZD"
|
|
13
|
-
*
|
|
14
|
-
* @param {string} source
|
|
15
|
-
* @param {string} placeholder
|
|
16
|
-
* @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
|
|
17
|
-
* If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
|
|
18
|
-
*/
|
|
19
|
-
public static ReplaceOccurrencesIn(source: string, placeholder: string, ...replacementTexts: string[]): string {
|
|
20
|
-
// parameter guards
|
|
21
|
-
if (!(source)) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
if (!placeholder || replacementTexts.length === 0) {
|
|
25
|
-
return source;
|
|
26
|
-
}
|
|
27
|
-
let outString: string = source;
|
|
28
|
-
// one replacementText means replace for all
|
|
29
|
-
if (replacementTexts.length === 1) {
|
|
30
|
-
// "g" is the g flag to replace globally
|
|
31
|
-
outString = outString.replace(placeholder, replacementTexts[0]);
|
|
32
|
-
} else {
|
|
33
|
-
// replace occurence i by replacementTexts[i], one at a time in loop (there might be a faster way..)
|
|
34
|
-
for (let i: number = 0, len: number = replacementTexts.length; i < len; i++) {
|
|
35
|
-
outString = outString.replace(placeholder, replacementTexts[i]);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return outString;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Returns the given argument as a string. Returns given defaultValue if conversion of argument to string was impossible.
|
|
42
|
-
public static ParseString(arg: any, defaultValue: string = ""): string {
|
|
43
|
-
if (!StringUtils.IsString(arg)) {
|
|
44
|
-
if (arg && typeof arg.toString === "function") {
|
|
45
|
-
arg = arg.toString();
|
|
46
|
-
} else {
|
|
47
|
-
arg = defaultValue;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return arg;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public static IsString(str: any): boolean {
|
|
54
|
-
return typeof str === 'string';
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Returns whether given str is a string and has a length > 0.
|
|
58
|
-
public static IsStringWithLength(str: string): boolean {
|
|
59
|
-
return str && StringUtils.IsString(str) && str.length > 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Returns given string, escaped for use as string literal in regular expressions.
|
|
63
|
-
private static _escapeRegExp(str: string): string {
|
|
64
|
-
return str;// .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, "\\$&");
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js';
|
|
4
|
-
import 'zone.js/testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
declare const require: {
|
|
12
|
-
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
-
<T>(id: string): T;
|
|
14
|
-
keys(): string[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// First, initialize the Angular testing environment.
|
|
19
|
-
getTestBed().initTestEnvironment(
|
|
20
|
-
BrowserDynamicTestingModule,
|
|
21
|
-
platformBrowserDynamicTesting(),
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
// Then we find all the tests.
|
|
25
|
-
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
-
// And load the modules.
|
|
27
|
-
context.keys().map(context);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"src/test.ts",
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
],
|
|
15
|
-
"types": [
|
|
16
|
-
"src/lib/@types"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|
package/script/merge-icons.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const icons = {};
|
|
3
|
-
const srcDir = 'projects/sharedcomponents/src/lib/assets/icons/';
|
|
4
|
-
const dataFile = 'projects/sharedcomponents/src/lib/model/icon-svg.ts';
|
|
5
|
-
const enumFile = 'projects/sharedcomponents/src/lib/enum/icon.enum.ts';
|
|
6
|
-
const warning = '/** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function minifyXml(xml) {
|
|
10
|
-
return xml
|
|
11
|
-
.replace(/(<\?xml.*\?>)|(<!--.*-->)|(\n)|(\t)|(\r)|(xmlns:.*?".*?"\s?)|(id=".*?"\s?)|(data-name=".*?"\s?)|(xml:space=".*?"\s?)/gim, '')
|
|
12
|
-
.replace(/\s{2,}/g, ' ')
|
|
13
|
-
.replace(/> </g, '><');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function toPascalCase(icon) {
|
|
17
|
-
return icon.charAt(0).toUpperCase() + icon.slice(1).replace(/(_[a-z]?)/gi, (match) => {
|
|
18
|
-
return match.toUpperCase().replace(/_/g, '');
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
fs.readdirSync(srcDir)
|
|
23
|
-
.filter(file => file.substr(-4).toLowerCase() === '.svg')
|
|
24
|
-
.reduce((icons, file) => {
|
|
25
|
-
icons[file.substr(0, file.length - 4)] = minifyXml(fs.readFileSync(srcDir + file, {encoding : 'utf-8'}));
|
|
26
|
-
return icons;
|
|
27
|
-
}, icons);
|
|
28
|
-
|
|
29
|
-
fs.writeFileSync(dataFile, `${warning}
|
|
30
|
-
|
|
31
|
-
export const IconSvg: {[iconName: string]: string} = ${JSON.stringify(icons, null, 1)};`
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
fs.writeFileSync(enumFile, `${warning}
|
|
35
|
-
|
|
36
|
-
export enum Icon {
|
|
37
|
-
${Object.keys(icons).map(icon => toPascalCase(icon) + ' = "' + icon + '"').join(",\n ")}
|
|
38
|
-
}`
|
|
39
|
-
);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
import { AppComponent } from './app.component';
|
|
3
|
-
|
|
4
|
-
describe('AppComponent', () => {
|
|
5
|
-
beforeEach(async () => {
|
|
6
|
-
await TestBed.configureTestingModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
AppComponent
|
|
9
|
-
],
|
|
10
|
-
}).compileComponents();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should create the app', () => {
|
|
14
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
15
|
-
const app = fixture.componentInstance;
|
|
16
|
-
expect(app).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it(`should have as title 'Sharedcomponents'`, () => {
|
|
20
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
21
|
-
const app = fixture.componentInstance;
|
|
22
|
-
expect(app.title).toEqual('Sharedcomponents');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should render title', () => {
|
|
26
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
27
|
-
fixture.detectChanges();
|
|
28
|
-
const compiled = fixture.nativeElement as HTMLElement;
|
|
29
|
-
expect(compiled.querySelector('.content span')?.textContent).toContain('Sharedcomponents app is running!');
|
|
30
|
-
});
|
|
31
|
-
});
|