@colijnit/sharedcomponents 1.0.18 → 1.0.20

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.
Files changed (44) hide show
  1. package/bundles/colijnit-sharedcomponents.umd.js +560 -83
  2. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
  3. package/colijnit-sharedcomponents.d.ts +9 -7
  4. package/colijnit-sharedcomponents.metadata.json +1 -1
  5. package/esm2015/colijnit-sharedcomponents.js +10 -8
  6. package/esm2015/lib/assets/dictionary/text.properties.js +11 -0
  7. package/esm2015/lib/components/layout-switcher/layout-switcher.component.js +74 -0
  8. package/esm2015/lib/components/layout-switcher/layout-switcher.module.js +21 -0
  9. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +87 -17
  10. package/esm2015/lib/components/stock/stock.component.js +17 -4
  11. package/esm2015/lib/components/stock/stock.module.js +3 -3
  12. package/esm2015/lib/enum/icon.enum.js +4 -1
  13. package/esm2015/lib/enum/language-code.enum.js +8 -0
  14. package/esm2015/lib/model/icon-svg.js +4 -1
  15. package/esm2015/lib/service/dictionary.service.js +76 -0
  16. package/esm2015/lib/service/options.service.js +71 -0
  17. package/esm2015/lib/service/shared-connector.service.js +262 -0
  18. package/esm2015/lib/service/shared.service.js +30 -0
  19. package/esm2015/lib/service/stock.service.js +21 -26
  20. package/esm2015/lib/utils/string-utils.js +64 -0
  21. package/esm2015/public-api.js +4 -1
  22. package/fesm2015/colijnit-sharedcomponents.js +462 -58
  23. package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
  24. package/lib/assets/dictionary/text.properties.d.ts +3 -0
  25. package/lib/components/layout-switcher/layout-switcher.component.d.ts +16 -0
  26. package/lib/components/layout-switcher/layout-switcher.module.d.ts +2 -0
  27. package/lib/components/layout-switcher/style/_layout.scss +96 -0
  28. package/lib/components/layout-switcher/style/_material-definition.scss +16 -0
  29. package/lib/components/layout-switcher/style/_theme.scss +6 -0
  30. package/lib/components/layout-switcher/style/material.scss +5 -0
  31. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +23 -6
  32. package/lib/components/send-method-dialog/style/_layout.scss +5 -0
  33. package/lib/components/stock/stock.component.d.ts +5 -1
  34. package/lib/enum/icon.enum.d.ts +3 -0
  35. package/lib/enum/language-code.enum.d.ts +6 -0
  36. package/lib/service/dictionary.service.d.ts +21 -0
  37. package/lib/service/options.service.d.ts +13 -0
  38. package/lib/service/{ione-connector-adapter.service.d.ts → shared-connector.service.d.ts} +5 -5
  39. package/lib/service/shared.service.d.ts +8 -0
  40. package/lib/service/stock.service.d.ts +2 -5
  41. package/lib/utils/string-utils.d.ts +22 -0
  42. package/package.json +1 -1
  43. package/public-api.d.ts +3 -0
  44. package/esm2015/lib/service/ione-connector-adapter.service.js +0 -265
@@ -0,0 +1,3 @@
1
+ export declare class Dictionary {
2
+ strings: {};
3
+ }
@@ -0,0 +1,16 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import { Icon } from "../../enum/icon.enum";
3
+ import { IconCacheService } from "../../service/icon-cache.service";
4
+ export declare class LayoutSwitcherComponent {
5
+ iconCacheService: IconCacheService;
6
+ readonly icon: typeof Icon;
7
+ showClass(): boolean;
8
+ layoutItems: string[];
9
+ layoutSwitchEmit: EventEmitter<string>;
10
+ get activeIndex(): number;
11
+ set activeIndex(index: number);
12
+ showMaskSidebar: boolean;
13
+ private _activeIndex;
14
+ constructor(iconCacheService: IconCacheService);
15
+ toggleMaskSidebar(): void;
16
+ }
@@ -0,0 +1,2 @@
1
+ export declare class LayoutSwitcherModule {
2
+ }
@@ -0,0 +1,96 @@
1
+ @import "../../../style/mixin";
2
+
3
+ @include export-module('layout-switcher-layout') {
4
+ .layout-switcher {
5
+
6
+ position: relative;
7
+ min-width: $layout-switcher-mask-min-width;
8
+ height: 100%;
9
+ .icon-wrapper {
10
+ cursor: pointer;
11
+ position: relative;
12
+ -webkit-user-select: none;
13
+ -moz-user-select: none;
14
+ -ms-user-select: none;
15
+ user-select: none;
16
+ display: flex;
17
+ flex-direction: row;
18
+ align-items: center;
19
+ justify-content: space-evenly;
20
+ width: $layout-switcher-mask-min-width;
21
+ height: $layout-switcher-mask-min-height;
22
+
23
+ .icon-mask {
24
+
25
+
26
+ position: absolute;
27
+ left: $layout-switcher-main-icon-left-position;
28
+ width: 30px;
29
+ height: 30px;
30
+ }
31
+
32
+ .icon-mask-sidebar-handle {
33
+ position: absolute;
34
+ left: $layout-switcher-main-icon-active-left-position;
35
+ width: 30px;
36
+ height: 30px;
37
+ }
38
+ }
39
+
40
+ .mask-wrapper {
41
+ left: 6em;
42
+ display: flex;
43
+ flex-direction: row;
44
+ position: absolute;
45
+ min-height: $layout-switcher-mask-min-height;
46
+ min-width: $layout-switcher-mask-min-width;
47
+ background: white;
48
+ z-index: 10;
49
+ border-right: 1px solid $layout-switcher-color-border;
50
+
51
+ }
52
+
53
+ .mask-wrapper-active {
54
+ border: $layout-switcher-border;
55
+ border-radius: 8px;
56
+ }
57
+
58
+ .mask-content {
59
+ margin-top: 2rem;
60
+ margin-left: 2rem;
61
+ min-width: 350px;
62
+ background: white;
63
+ overflow: hidden;
64
+ display: flex;
65
+ flex-direction: column;
66
+
67
+ span {
68
+ padding: 1rem;
69
+ font-size: $layout-switcher-big-text-font-size;
70
+ font-weight: $layout-switcher-font-weight;
71
+ color: $layout-switcher-color-text-main;
72
+ text-decoration: none;
73
+ height: 50%;
74
+ width: 50%;
75
+
76
+ &.active {
77
+ background-color: #f0f5ff;
78
+ border: 1px solid #e5ebfa;
79
+ border-radius: 8px;
80
+ color: #3c7dff;
81
+ }
82
+
83
+ p {
84
+ padding: 1rem;
85
+ margin-bottom: 1rem;
86
+ margin-right: 1rem;
87
+ font-size: $layout-switcher-big-text-font-size;
88
+ }
89
+ }
90
+
91
+
92
+ }
93
+
94
+
95
+ }
96
+ }
@@ -0,0 +1,16 @@
1
+ $layout-switcher-mask-min-width: 120px !default;
2
+ $layout-switcher-mask-min-height: 120px !default;
3
+
4
+ $layout-switcher-big-text-font-size: 24px !default;
5
+
6
+ $layout-switcher-color-text-main: #171721 !default;
7
+ $layout-switcher-font-weight: bold !default;
8
+
9
+ $color-border: #e5ebfa !default;
10
+
11
+ $layout-switcher-border: 1px solid $color-border !default;
12
+
13
+ $layout-switcher-color-border: #e5ebfa !default;
14
+
15
+ $layout-switcher-main-icon-left-position: 10px;
16
+ $layout-switcher-main-icon-active-left-position: 65px;
@@ -0,0 +1,6 @@
1
+ @import "../../../style/mixin";
2
+
3
+ @include export-module('layout-switcher-theme') {
4
+ .layout-switcher {
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ @import "./material-definition";
2
+ @import "./layout";
3
+ @import "./theme";
4
+
5
+
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, EventEmitter } from "@angular/core";
1
+ import { ChangeDetectorRef, EventEmitter, OnDestroy } from "@angular/core";
2
2
  import { Icon } from "../../enum/icon.enum";
3
3
  import { IconCacheService } from "../../service/icon-cache.service";
4
4
  import { SendOption } from "./enums/send-option";
@@ -6,14 +6,24 @@ import { Printer } from "@colijnit/sharedapi/build/model/report/printer.bo";
6
6
  import { StockService } from "../../service/stock.service";
7
7
  import { StockStickersPrintLayoutsBo } from "@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo";
8
8
  import { CoDropDownListFields } from "../stock/stock-transfer/co-drop-down-list-fields.interface";
9
- export declare class SendMethodDialogComponent implements AfterViewInit {
9
+ import { OptionsService } from "../../service/options.service";
10
+ import { DictionaryService } from "../../service/dictionary.service";
11
+ export declare class SendMethodDialogComponent implements OnDestroy {
10
12
  iconCacheService: IconCacheService;
11
13
  stockService: StockService;
14
+ private _optionsService;
15
+ private _dictionary;
16
+ private _changeDetector;
12
17
  readonly icons: typeof Icon;
13
18
  readonly sendOption: typeof SendOption;
19
+ showEmailOption: boolean;
20
+ showPrintOption: boolean;
21
+ showPdfOption: boolean;
22
+ showXmlOption: boolean;
14
23
  sendOptions: {
15
24
  option: SendOption;
16
25
  iconName: Icon;
26
+ show: boolean;
17
27
  }[];
18
28
  activeSendOption: SendOption;
19
29
  showStandardPrinterOptions: boolean;
@@ -22,25 +32,32 @@ export declare class SendMethodDialogComponent implements AfterViewInit {
22
32
  defaultPrinter: Printer;
23
33
  printTemplates: StockStickersPrintLayoutsBo[];
24
34
  printTemplatesField: CoDropDownListFields;
35
+ upAndLoaded: boolean;
25
36
  emails: any[];
26
37
  models: boolean[];
27
38
  layouts: any[];
28
39
  selectedLayout: 'Layout 1';
29
40
  set options(value: any);
41
+ get options(): any;
30
42
  showDialog: boolean;
31
43
  headerTitle: string;
32
44
  printerList: Printer[];
33
- articleData: any;
45
+ set articleData(data: any);
34
46
  startSignatureClicked: EventEmitter<any>;
35
47
  printButtonClicked: EventEmitter<any>;
36
48
  showClass(): boolean;
37
- constructor(iconCacheService: IconCacheService, stockService: StockService);
38
- ngAfterViewInit(): void;
49
+ private _subscriptions;
50
+ private _publicOptions;
51
+ private _options;
52
+ constructor(iconCacheService: IconCacheService, stockService: StockService, _optionsService: OptionsService, _dictionary: DictionaryService, _changeDetector: ChangeDetectorRef);
53
+ ngOnDestroy(): void;
39
54
  getPrinters(): Promise<void>;
40
55
  closeDialogClick(): void;
41
56
  handleSignatureStart(): void;
42
57
  handlePrintClicked(): void;
43
58
  togglePrinterSelection(): void;
44
59
  onPrinterClicked(printer: any): void;
45
- getPrintTemplates(): void;
60
+ getPrintTemplates(): any;
61
+ private _handleSettingsLoaded;
62
+ private _initConnection;
46
63
  }
@@ -49,6 +49,11 @@
49
49
  rect {
50
50
  fill: white
51
51
  }
52
+
53
+ .show-option {
54
+ display: none;
55
+ }
56
+
52
57
  }
53
58
  }
54
59
 
@@ -5,8 +5,10 @@ import { ArticleExtended } from "@colijnit/articleapi/build/model/article-extend
5
5
  import { ArticleStock } from "@colijnit/articleapi/build/model/article-stock";
6
6
  import { StockHistoryBo } from "@colijnit/articleapi/build/model/stock-history.bo";
7
7
  import { ArticleDetailsBo } from "@colijnit/articleapi/build/model/article-details.bo";
8
+ import { OptionsService } from "../../service/options.service";
8
9
  export declare class StockComponent {
9
10
  stockService: StockService;
11
+ private _optionsService;
10
12
  stock: StockComponent;
11
13
  handleStickerClicked: EventEmitter<any>;
12
14
  set options(value: any);
@@ -25,7 +27,9 @@ export declare class StockComponent {
25
27
  stockHistory: StockHistoryBo[];
26
28
  allAvailableStock: number;
27
29
  allTechnicalStock: number;
28
- constructor(stockService: StockService);
30
+ private _publicOptions;
31
+ private _options;
32
+ constructor(stockService: StockService, _optionsService: OptionsService);
29
33
  backToStockLinesClicked(): void;
30
34
  handleStockTransferClick(event: any): void;
31
35
  backToStock(): void;
@@ -1,7 +1,10 @@
1
1
  /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
2
2
  export declare enum Icon {
3
+ AngleLeftSolid = "angle_left_solid",
4
+ AngleRightSolid = "angle_right_solid",
3
5
  ArrowFatRight = "arrow_fat_right",
4
6
  ArrowPointRight = "arrow_point_right",
7
+ BringForwardRegular = "bring_forward_regular",
5
8
  DeleteLeftRegular = "delete_left_regular",
6
9
  DeliveryTruck = "delivery_truck",
7
10
  Email = "email",
@@ -0,0 +1,6 @@
1
+ export declare enum LanguageCode {
2
+ Dutch = "nl-NL",
3
+ English = "en-GB",
4
+ German = "de-DE",
5
+ French = "fr-FR"
6
+ }
@@ -0,0 +1,21 @@
1
+ export declare class DictionaryService {
2
+ private readonly dictionaryUrl;
3
+ get language(): string;
4
+ set rootUrl(value: string);
5
+ private _dictBasePath;
6
+ private _rootUrl;
7
+ private _dictionaries;
8
+ private _language;
9
+ private readonly _placeholder;
10
+ constructor();
11
+ setDictionary(language: string): Promise<void>;
12
+ private _loadDictionary;
13
+ /**
14
+ * Returns the localized text for the given dictionary key.
15
+ * @param {string} key
16
+ * @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
17
+ * @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
18
+ * @returns {string} The translated text for given dictionary key
19
+ */
20
+ get(key: string, upperCaseFirst?: boolean, ...replacementTexts: string[]): string;
21
+ }
@@ -0,0 +1,13 @@
1
+ import { BehaviorSubject } from "rxjs";
2
+ import { DictionaryService } from "./dictionary.service";
3
+ export declare class OptionsService {
4
+ private _dictionary;
5
+ optionsInitialized: BehaviorSubject<boolean>;
6
+ set options(value: any);
7
+ get options(): any;
8
+ optionsLoaded: BehaviorSubject<boolean>;
9
+ private _options;
10
+ constructor(_dictionary: DictionaryService);
11
+ createSettingsFromObject(obj: any): Promise<void>;
12
+ initialize(options: any): Promise<void>;
13
+ }
@@ -16,14 +16,14 @@ import { StockManagementWarehouses } from "@colijnit/articleapi/build/model/stoc
16
16
  import { StockLocation } from "@colijnit/articleapi/build/model/stock-location.bo";
17
17
  import { ArticleTransaction } from "@colijnit/articleapi/build/model/article-transaction";
18
18
  import { ArticleTransaction as ArticleTransactionBo } from "@colijnit/articleapi/build/model/article-transaction.bo";
19
- export declare class IoneConnectorAdapterService {
20
- options: any;
19
+ import { OptionsService } from "./options.service";
20
+ export declare class SharedConnectorService {
21
+ private _optionsService;
21
22
  connector: Articles;
22
23
  sharedConnector: Sharedapi;
23
24
  private _boFactory;
24
- constructor();
25
- connect(options: any): Promise<void>;
26
- disconnect(): Promise<void>;
25
+ constructor(_optionsService: OptionsService);
26
+ connect(): Promise<void>;
27
27
  getAllPrinters(showAll?: boolean): Promise<Printer[]>;
28
28
  getPrintStockStickers(request: PrintStockStickers): Promise<PrintStockStickers>;
29
29
  getArticleFullObject(goodId: number): Promise<ArticleExtended>;
@@ -0,0 +1,8 @@
1
+ import { SharedConnectorService } from "./shared-connector.service";
2
+ import { OptionsService } from "./options.service";
3
+ export declare class SharedService {
4
+ protected options: OptionsService;
5
+ protected connector: SharedConnectorService;
6
+ constructor(options: OptionsService, connector: SharedConnectorService);
7
+ init(options: any): Promise<void>;
8
+ }
@@ -1,4 +1,3 @@
1
- import { IoneConnectorAdapterService } from "./ione-connector-adapter.service";
2
1
  import { PrintStockStickers } from "@colijnit/sharedapi/build/model/print-stock-stickers";
3
2
  import { Printer } from "@colijnit/sharedapi/build/model/report/printer.bo";
4
3
  import { GetStockHistoryRequest } from "@colijnit/articleapi/build/model/get-stock-history-request";
@@ -14,12 +13,10 @@ import { StockLocation } from "@colijnit/articleapi/build/model/stock-location.b
14
13
  import { DataServiceResponseData } from "@colijnit/articleapi/build/model/data-service-response-data";
15
14
  import { ArticleTransaction } from "@colijnit/articleapi/build/model/article-transaction";
16
15
  import { ArticleTransaction as ArticleTransactionBo } from "@colijnit/articleapi/build/model/article-transaction.bo";
17
- export declare class StockService {
18
- private _connector;
16
+ import { SharedService } from "./shared.service";
17
+ export declare class StockService extends SharedService {
19
18
  stockStickers: PrintStockStickers;
20
19
  printSticker: PrintStockStickers;
21
- constructor(_connector: IoneConnectorAdapterService);
22
- connectConnector(options: any): void;
23
20
  getPrintStockStickers(data: PrintStockStickers): Promise<void>;
24
21
  getAllPrinters(showAll?: boolean): Promise<Printer[]>;
25
22
  getStockHistory(data: GetStockHistoryRequest): Promise<StockHistoryBo[]>;
@@ -0,0 +1,22 @@
1
+ export declare class StringUtils {
2
+ /**
3
+ * Returns a new string where given placeholder in given source string are replaced by given replacement texts.
4
+ *
5
+ * Example usage:
6
+ *
7
+ * source = "ABCDABCD"
8
+ * placeholder = "BC"
9
+ * replacementTexts = "Z", "Z" (REST arguments)
10
+ * OUTPUT = "AZDAZD"
11
+ *
12
+ * @param {string} source
13
+ * @param {string} placeholder
14
+ * @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
15
+ * If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
16
+ */
17
+ static ReplaceOccurrencesIn(source: string, placeholder: string, ...replacementTexts: string[]): string;
18
+ static ParseString(arg: any, defaultValue?: string): string;
19
+ static IsString(str: any): boolean;
20
+ static IsStringWithLength(str: string): boolean;
21
+ private static _escapeRegExp;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/sharedcomponents",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@colijnit/sharedapi": "^1.0.1",
package/public-api.d.ts CHANGED
@@ -6,3 +6,6 @@ export * from './lib/components/send-method-dialog/send-method-dialog.component'
6
6
  export * from './lib/components/send-method-dialog/send-method-dialog.module';
7
7
  export * from './lib/components/key-pad/key-pad.component';
8
8
  export * from './lib/components/key-pad/key-pad.module';
9
+ export * from './lib/components/layout-switcher/layout-switcher.component';
10
+ export * from './lib/components/layout-switcher/layout-switcher.module';
11
+ export * from './lib/service/shared.service';