inviton-powerduck 0.0.86 → 0.0.89

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.
@@ -1,17 +1,19 @@
1
1
  import PowerduckState from '../app/powerduck-state';
2
2
  import { Language } from './enums/language';
3
- import LocalizedText from './localized-text';
3
+ import { ILocalizedText } from './localized-text';
4
4
  import { isNullOrEmpty } from './utils/is-null-or-empty';
5
5
 
6
- export default class LocalizedValueHelper {
7
- static getLocalizedValue(value: LocalizedText): string {
6
+ export default class LocalizedValueHelper {
7
+ static getValue(value: ILocalizedText, lang?: Language | string): string {
8
8
  if (value == null) {
9
9
  return null as any;
10
10
  }
11
11
 
12
- const lang = PowerduckState.getCurrentLanguage();
13
- const inLang = value[lang];
12
+ if (lang == null) {
13
+ lang = PowerduckState.getCurrentLanguage()
14
+ }
14
15
 
16
+ const inLang = value[lang];
15
17
  if (inLang != null) {
16
18
  return inLang;
17
19
  }
@@ -42,8 +44,8 @@ export default class LocalizedValueHelper {
42
44
  return null as any;
43
45
  }
44
46
 
45
- static validateLocalizedValue(locValArr: LocalizedText): boolean {
46
- if (isNullOrEmpty(LocalizedValueHelper.getLocalizedValue(locValArr))) {
47
+ static validateLocalizedValue(locValArr: ILocalizedText): boolean {
48
+ if (isNullOrEmpty(LocalizedValueHelper.getValue(locValArr))) {
47
49
  return false;
48
50
  }
49
51
 
@@ -1,7 +1,7 @@
1
1
  import { PortalUtils } from "./utils";
2
2
 
3
3
  export default class DropdownUtils {
4
- static bindDropdownOverflowHack(selector: string, cacheKey: string, hide: boolean): void {
4
+ static bindDropdownOverflowHack(selector: string, cacheKey: string, clonedRootCssClass: string, hide: boolean): void {
5
5
  if (DropdownUtils[cacheKey] == null) {
6
6
  DropdownUtils[cacheKey] = true;
7
7
 
@@ -30,11 +30,15 @@ export default class DropdownUtils {
30
30
  });
31
31
  }
32
32
 
33
+ thisDropdownCopy.find('button').addClass('show');
34
+ thisDropdownCopy.find('.dropdown-menu').addClass('show');
35
+ thisDropdownCopy.addClass(clonedRootCssClass);
36
+
33
37
  $("body").append(
34
38
  thisDropdownCopy.addClass(randomId + " show").css({
35
39
  position: "absolute",
36
40
  left: thisDropdown.offset().left,
37
- top: thisDropdown.offset().top - 10,
41
+ top: thisDropdown.offset().top,
38
42
  }),
39
43
  );
40
44
 
@@ -21,11 +21,11 @@
21
21
  } from "@vuelidate/validators";
22
22
  import { PowerduckViewModelBase } from "./base-component";
23
23
  import { Validation } from "@vuelidate/core";
24
- import LocalizedStringHelper from "./utils/localized-string";
25
24
  import { isNullOrEmpty } from "./utils/is-null-or-empty";
26
25
  import { capitalize } from "./utils/capitalize-string";
27
26
  import PowerduckState from "../app/powerduck-state";
28
27
  import { IValidationSet, ValidationRuleset, ValidationState } from "./static-wrappers/interfaces/validation-interface";
28
+ import LocalizedValueHelper from "./localized-value-helper";
29
29
 
30
30
  function getFirstUnsattisfiedValidatorName(valProp: Validation): string {
31
31
  const errors = valProp?.$errors || [];
@@ -158,7 +158,7 @@ export class ValidationBuilder {
158
158
 
159
159
  requiredLocalizedString(): ValidationBuilder {
160
160
  this._validationArgs.requiredLocalizedString = (value) => {
161
- if (value == null || isNullOrEmpty(LocalizedStringHelper.getValue(value, 'sk'))) {
161
+ if (value == null || isNullOrEmpty(LocalizedValueHelper.getValue(value, 'sk'))) {
162
162
  return false;
163
163
  }
164
164
 
@@ -62,8 +62,8 @@
62
62
  display: block;
63
63
  }
64
64
 
65
- .dt-table.dt-table-mode table > thead > tr.dt-header th,
66
- .dt-table.dt-table-mode table > thead > tr.dt-header-filter th {
65
+ .dt-table.dt-table-mode table>thead>tr.dt-header th,
66
+ .dt-table.dt-table-mode table>thead>tr.dt-header-filter th {
67
67
  z-index: 39;
68
68
  cursor: pointer;
69
69
  font-weight: 400;
@@ -79,20 +79,26 @@
79
79
  border-bottom: 0;
80
80
  letter-spacing: -0.5px;
81
81
  background: white;
82
- -webkit-touch-callout: none; /* iOS Safari */
83
- -webkit-user-select: none; /* Safari */
84
- -khtml-user-select: none; /* Konqueror HTML */
85
- -moz-user-select: none; /* Firefox */
86
- -ms-user-select: none; /* Internet Explorer/Edge */
87
- user-select: none; /* Non-prefixed version, currently
82
+ -webkit-touch-callout: none;
83
+ /* iOS Safari */
84
+ -webkit-user-select: none;
85
+ /* Safari */
86
+ -khtml-user-select: none;
87
+ /* Konqueror HTML */
88
+ -moz-user-select: none;
89
+ /* Firefox */
90
+ -ms-user-select: none;
91
+ /* Internet Explorer/Edge */
92
+ user-select: none;
93
+ /* Non-prefixed version, currently
88
94
  supported by Chrome and Opera */
89
95
  }
90
96
 
91
- .dt-table.dt-table-mode table > thead > tr.dt-header th.dt-header-notsortable {
97
+ .dt-table.dt-table-mode table>thead>tr.dt-header th.dt-header-notsortable {
92
98
  cursor: default;
93
99
  }
94
100
 
95
- .dt-table.dt-table-mode table > tbody .dt-col-indexlabel {
101
+ .dt-table.dt-table-mode table>tbody .dt-col-indexlabel {
96
102
  background: #0075bf;
97
103
  color: #fff;
98
104
  width: 25px;
@@ -107,16 +113,16 @@
107
113
  font-weight: 400;
108
114
  }
109
115
 
110
- .dt-table.dt-table-mode table > tbody > tr {
116
+ .dt-table.dt-table-mode table>tbody>tr {
111
117
  transition: background 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
112
118
  will-change: background;
113
119
  }
114
120
 
115
- .dt-table.dt-table-mode table > tbody > tr:hover {
121
+ .dt-table.dt-table-mode table>tbody>tr:hover {
116
122
  background: #eee;
117
123
  }
118
124
 
119
- .dt-table.dt-table-mode table > tbody > tr > td {
125
+ .dt-table.dt-table-mode table>tbody>tr>td {
120
126
  border: 0;
121
127
  border-bottom: 1px solid #efefef;
122
128
  color: #2c2c2c;
@@ -127,20 +133,20 @@
127
133
  background: white;
128
134
  }
129
135
 
130
- .dt-table.dt-table-mode table > tbody > tr > td.dt-no-results {
136
+ .dt-table.dt-table-mode table>tbody>tr>td.dt-no-results {
131
137
  border-bottom: 0;
132
138
  }
133
139
 
134
- .dt-table.dt-table-mode table > tbody > tr:nth-child(even) > td {
140
+ .dt-table.dt-table-mode table>tbody>tr:nth-child(even)>td {
135
141
  background: #fbfbfb;
136
142
  }
137
143
 
138
144
  .dt-table.dt-table-mode .dt-filter-input .form-control {
139
- background-color: #fff;
140
- border: 0px;
141
- font-size: 11px !important;
142
- padding: 0;
143
- min-height: 21.5px;
145
+ background-color: #fff;
146
+ border: 0px;
147
+ font-size: 11px !important;
148
+ padding: 0;
149
+ min-height: 21.5px;
144
150
  }
145
151
 
146
152
  .dt-table.dt-table-mode input.dt-filter-input,
@@ -228,7 +234,7 @@
228
234
  display: none;
229
235
  }
230
236
 
231
- .dt-table.dt-table-mode .select2-container.select2-container--default.select2-container--open > .select2-dropdown {
237
+ .dt-table.dt-table-mode .select2-container.select2-container--default.select2-container--open>.select2-dropdown {
232
238
  border-color: #d8d8d8;
233
239
  }
234
240
 
@@ -353,7 +359,7 @@
353
359
  display: none;
354
360
  }
355
361
 
356
- .dt-top .dt-buttons .dt-button > span > i.now-ui-icons {
362
+ .dt-top .dt-buttons .dt-button>span>i.now-ui-icons {
357
363
  transform: translateY(2px);
358
364
  }
359
365
 
@@ -390,11 +396,11 @@
390
396
  z-index: 59 !important;
391
397
  }
392
398
 
393
- .dt-massop-btn-wrap > .dropdown {
399
+ .dt-massop-btn-wrap>.dropdown {
394
400
  display: inline-block;
395
401
  }
396
402
 
397
- td.dt-col-index .dt-selection-checkbox > .form-group,
403
+ td.dt-col-index .dt-selection-checkbox>.form-group,
398
404
  th.dt-header-index .dt-header-indexcheckbox {
399
405
  position: absolute;
400
406
  top: 0;
@@ -406,7 +412,7 @@ th.dt-header-index .dt-header-indexcheckbox {
406
412
  left: 13px;
407
413
  }
408
414
 
409
- .dt-skin-compact .dt-table.dt-table-mode table > tbody > tr > td.dt-col-index .dt-selection-checkbox > .form-group {
415
+ .dt-skin-compact .dt-table.dt-table-mode table>tbody>tr>td.dt-col-index .dt-selection-checkbox>.form-group {
410
416
  top: -12px;
411
417
  }
412
418
 
@@ -427,10 +433,6 @@ th.dt-header-index .dt-header-indexcheckbox {
427
433
  right: 0;
428
434
  }
429
435
 
430
- body > .dropdown > .btn.btn-sm {
431
- font-size: 10.4px;
432
- }
433
-
434
436
  .dt-root.dt-breakpoint-desktop tbody .dropdown .dropdown-menu {
435
437
  display: none;
436
438
  }
@@ -439,11 +441,11 @@ body > .dropdown > .btn.btn-sm {
439
441
  display: none;
440
442
  }
441
443
 
442
- .dt-table.dt-table-mode table > tbody > tr > td {
444
+ .dt-table.dt-table-mode table>tbody>tr>td {
443
445
  transition: background 150ms ease-in;
444
446
  }
445
447
 
446
- .dt-table.dt-table-mode table > tbody > tr:hover > td {
448
+ .dt-table.dt-table-mode table>tbody>tr:hover>td {
447
449
  background: #eaeaea;
448
450
  }
449
451
 
@@ -490,8 +492,8 @@ body > .dropdown > .btn.btn-sm {
490
492
  justify-content: center;
491
493
  }
492
494
 
493
- .dt-pagination-length > span,
494
- .dt-pagination-length > span {
495
+ .dt-pagination-length>span,
496
+ .dt-pagination-length>span {
495
497
  font-size: 9px;
496
498
  position: absolute;
497
499
  left: 0px;
@@ -507,27 +509,28 @@ body > .dropdown > .btn.btn-sm {
507
509
  display: none;
508
510
  }
509
511
  }
512
+
510
513
  /*
511
514
  Compact mode - front is smaller and narrower
512
515
  */
513
- .dt-skin-compact .dt-table.dt-table-mode table > thead > tr.dt-header th,
514
- .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table > thead > tr.dt-header th {
516
+ .dt-skin-compact .dt-table.dt-table-mode table>thead>tr.dt-header th,
517
+ .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table>thead>tr.dt-header th {
515
518
  font-family: "BenchNine";
516
519
  font-weight: 100;
517
520
  text-transform: capitalize;
518
521
  font-size: 13px;
519
522
  }
520
523
 
521
- .dt-skin-compact .dt-table.dt-table-mode table > thead > tr.dt-header th,
522
- .dt-skin-compact .dt-table.dt-table-mode table > thead > tr.dt-header-filter th,
523
- .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table > thead > tr.dt-header th,
524
- .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table > thead > tr.dt-header-filter th {
524
+ .dt-skin-compact .dt-table.dt-table-mode table>thead>tr.dt-header th,
525
+ .dt-skin-compact .dt-table.dt-table-mode table>thead>tr.dt-header-filter th,
526
+ .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table>thead>tr.dt-header th,
527
+ .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table>thead>tr.dt-header-filter th {
525
528
  padding-left: 4px;
526
529
  padding-right: 4px;
527
530
  }
528
531
 
529
- .dt-skin-compact .dt-table.dt-table-mode table > tbody > tr > td,
530
- .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table > tbody > tr > td {
532
+ .dt-skin-compact .dt-table.dt-table-mode table>tbody>tr>td,
533
+ .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table>tbody>tr>td {
531
534
  font-weight: 400;
532
535
  text-transform: none;
533
536
  font-size: 11px;
@@ -536,8 +539,8 @@ body > .dropdown > .btn.btn-sm {
536
539
  color: #6d6d6d;
537
540
  }
538
541
 
539
- .dt-skin-compact .dt-table.dt-table-mode table > tbody .dt-col-indexlabel,
540
- .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table > tbody .dt-col-indexlabel {
542
+ .dt-skin-compact .dt-table.dt-table-mode table>tbody .dt-col-indexlabel,
543
+ .dt-breakpoint-mobile.dt-mobbehavior-compact .dt-table.dt-table-mode table>tbody .dt-col-indexlabel {
541
544
  width: 18px;
542
545
  height: 18px;
543
546
  font-size: 9px;
@@ -563,9 +566,9 @@ body > .dropdown > .btn.btn-sm {
563
566
  .dt-skin-compact .pagination .page-item .page-link,
564
567
  .dt-breakpoint-mobile.dt-mobbehavior-compact .pagination .page-item .page-link {
565
568
  min-width: 16px;
566
- height: 20px;
567
- line-height: 20px;
568
- font-size: 11px;
569
+ height: 20px;
570
+ line-height: 20px;
571
+ font-size: 11px;
569
572
  }
570
573
 
571
574
  .dt-skin-compact .dt-col-indexcheckbox {
@@ -574,7 +577,7 @@ body > .dropdown > .btn.btn-sm {
574
577
  height: auto;
575
578
  }
576
579
 
577
- .dt-skin-compact .dt-selection-checkbox > div {
580
+ .dt-skin-compact .dt-selection-checkbox>div {
578
581
  position: absolute;
579
582
  top: -10px;
580
583
  left: 0;
@@ -585,7 +588,7 @@ body > .dropdown > .btn.btn-sm {
585
588
  position: relative;
586
589
  }
587
590
 
588
- .dt-skin-compact .dt-header-indexcheckbox > div {
591
+ .dt-skin-compact .dt-header-indexcheckbox>div {
589
592
  position: absolute;
590
593
  z-index: 2;
591
594
  left: 7px;
@@ -597,7 +600,7 @@ body > .dropdown > .btn.btn-sm {
597
600
  position: relative;
598
601
  }
599
602
 
600
- .header-filter-cell.dt-filtertype-dropdown > .dt-filter-dropdown {
603
+ .header-filter-cell.dt-filtertype-dropdown>.dt-filter-dropdown {
601
604
  position: absolute;
602
605
  top: -2px;
603
606
  left: 9px;
@@ -605,33 +608,34 @@ body > .dropdown > .btn.btn-sm {
605
608
  z-index: 2;
606
609
  }
607
610
 
608
- .header-filter-cell.dt-filtertype-dropdown > .dt-filter-dropdown > .form-group {
611
+ .header-filter-cell.dt-filtertype-dropdown>.dt-filter-dropdown>.form-group {
609
612
  margin-bottom: 0;
610
613
  }
611
614
 
612
615
  .header-filter-cell .input-group .input-group-text {
613
- width: auto;
614
- min-height: auto;
615
- padding: 0px 3px;
616
- margin: auto 0;
617
- background-color: inherit;
618
- border: inherit;
619
- vertical-align: middle;
616
+ width: auto;
617
+ min-height: auto;
618
+ padding: 0px 3px;
619
+ margin: auto 0;
620
+ background-color: inherit;
621
+ border: inherit;
622
+ vertical-align: middle;
620
623
  }
621
624
 
622
- .dt-table.dt-table-mode table > thead > tr.dt-header th .dt-filter-dropdown,
623
- .dt-table.dt-table-mode table > thead > tr.dt-header-filter th .dt-filter-dropdown {
625
+ .dt-table.dt-table-mode table>thead>tr.dt-header th .dt-filter-dropdown,
626
+ .dt-table.dt-table-mode table>thead>tr.dt-header-filter th .dt-filter-dropdown {
624
627
  text-transform: none;
625
628
  }
626
629
 
627
- .dt-skin-compact .header-filter-cell.dt-filtertype-dropdown > .dt-filter-dropdown,
628
- .dt-mobbehavior-compact .header-filter-cell.dt-filtertype-dropdown > .dt-filter-dropdown {
630
+ .dt-skin-compact .header-filter-cell.dt-filtertype-dropdown>.dt-filter-dropdown,
631
+ .dt-mobbehavior-compact .header-filter-cell.dt-filtertype-dropdown>.dt-filter-dropdown {
629
632
  left: 4px;
630
633
  }
631
634
 
632
- .dt-device-desktop.dt-skin-default .header-filter-cell.dt-filtertype-dropdown > .dt-filter-dropdown {
635
+ .dt-device-desktop.dt-skin-default .header-filter-cell.dt-filtertype-dropdown>.dt-filter-dropdown {
633
636
  left: 5px;
634
637
  }
638
+
635
639
  /*
636
640
  Vertical transform - items displayed as blocks
637
641
  */
@@ -680,6 +684,7 @@ body > .dropdown > .btn.btn-sm {
680
684
  width: 58%;
681
685
  display: inline-block;
682
686
  }
687
+
683
688
  /*
684
689
  Mobile mode - some experimental shit
685
690
  */
@@ -796,11 +801,11 @@ body > .dropdown > .btn.btn-sm {
796
801
  display: flex;
797
802
  }
798
803
 
799
- .dt-mobile-filter-rowone > div {
804
+ .dt-mobile-filter-rowone>div {
800
805
  flex: 1;
801
806
  }
802
807
 
803
- .dt-mobile-filter-rowone > button {
808
+ .dt-mobile-filter-rowone>button {
804
809
  margin: 0;
805
810
  margin-left: 1px;
806
811
  }
@@ -815,6 +820,7 @@ body > .dropdown > .btn.btn-sm {
815
820
  top: 50%;
816
821
  margin-top: -15px;
817
822
  }
823
+
818
824
  /*
819
825
  Table sizing
820
826
  */
@@ -888,48 +894,49 @@ body > .dropdown > .btn.btn-sm {
888
894
  }
889
895
 
890
896
  @media (max-width: 767px) {
897
+
891
898
  html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile),
892
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body,
893
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper,
894
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel,
895
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel > .content,
896
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel > .content > .frm-flex-container,
897
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel > .content > .frm-flex-container > .frm-flex-child,
898
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel .card.single-card,
899
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel .card.single-card > .card-body {
899
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body,
900
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper,
901
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel,
902
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel>.content,
903
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel>.content>.frm-flex-container,
904
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel>.content>.frm-flex-container>.frm-flex-child,
905
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel .card.single-card,
906
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel .card.single-card>.card-body {
900
907
  height: 100%;
901
908
  }
902
909
 
903
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile) > body > .wrapper > .main-panel .card.single-card {
910
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile)>body>.wrapper>.main-panel .card.single-card {
904
911
  height: calc(100% - 6px);
905
912
  }
906
913
 
907
- html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile.dt-fullsize-skin-default) > body > .wrapper > .main-panel .card.single-card > .card-body {
914
+ html.has-dt-fullsize.has-dt-fullsize-mobile:not(.dt-fullsize-beh-mobile.dt-fullsize-skin-default)>body>.wrapper>.main-panel .card.single-card>.card-body {
908
915
  padding-bottom: 0;
909
916
  }
910
917
 
911
- html .has-dt-fullsize.has-dt-fullsize-mobile > body > .wrapper > .main-panel .card.single-card > .card-body .dt-root.dt-fullsize-table {
918
+ html .has-dt-fullsize.has-dt-fullsize-mobile>body>.wrapper>.main-panel .card.single-card>.card-body .dt-root.dt-fullsize-table {
912
919
  height: calc(100% - 10px);
913
920
  }
914
921
 
915
- html.has-dt-fullsize.has-dt-fullsize-mobile.has-dt-fullsize-ios > body > .wrapper > .main-panel .card.single-card > .card-body .dt-root.dt-fullsize-table {
922
+ html.has-dt-fullsize.has-dt-fullsize-mobile.has-dt-fullsize-ios>body>.wrapper>.main-panel .card.single-card>.card-body .dt-root.dt-fullsize-table {
916
923
  height: 100%;
917
924
  }
918
925
 
919
- html.has-dt-fullsize.has-dt-fullsize-mobile > body > .wrapper > .main-panel .card.single-card {
926
+ html.has-dt-fullsize.has-dt-fullsize-mobile>body>.wrapper>.main-panel .card.single-card {
920
927
  -webkit-overflow-scrolling: touch;
921
928
  overflow-y: auto;
922
929
  }
923
930
 
924
- html.has-dt-fullsize.has-dt-fullsize-mobile > body > .wrapper > .main-panel .card.single-card > .card-body {
931
+ html.has-dt-fullsize.has-dt-fullsize-mobile>body>.wrapper>.main-panel .card.single-card>.card-body {
925
932
  padding-top: 15px;
926
933
  }
927
934
 
928
- html.has-dt-fullsize.has-dt-fullsize-mobile > body > .wrapper > .main-panel .card.single-card > .card-header {
935
+ html.has-dt-fullsize.has-dt-fullsize-mobile>body>.wrapper>.main-panel .card.single-card>.card-header {
929
936
  display: none;
930
937
  }
931
938
 
932
- html.has-dt-fullsize > body > .wrapper > .main-panel .card.single-card > .card-body {
939
+ html.has-dt-fullsize>body>.wrapper>.main-panel .card.single-card>.card-body {
933
940
  padding-left: 10px;
934
941
  padding-right: 10px;
935
942
  overflow-y: auto;
@@ -949,7 +956,7 @@ body > .dropdown > .btn.btn-sm {
949
956
  }
950
957
 
951
958
  @media (min-width: 768px) {
952
- .table-upper-buttons-wrap + .dt-root .dt-massop-btn-wrap {
959
+ .table-upper-buttons-wrap+.dt-root .dt-massop-btn-wrap {
953
960
  padding-left: 0;
954
961
  padding-top: 5px;
955
962
  }
@@ -958,6 +965,7 @@ body > .dropdown > .btn.btn-sm {
958
965
  .has-dt-fullsize .dt-root.dt-mobbehavior-mobile.dt-breakpoint-mobile {
959
966
  height: auto !important;
960
967
  }
968
+
961
969
  /*
962
970
  iOS hacks
963
971
  */
@@ -970,10 +978,11 @@ body > .dropdown > .btn.btn-sm {
970
978
  margin-right: -20% !important;
971
979
  margin-bottom: -10px !important;
972
980
  }
981
+
973
982
  /*
974
983
  Other stylings
975
984
  */
976
- tr.dt-item > td button {
985
+ tr.dt-item>td button {
977
986
  margin-top: 0;
978
987
  margin-bottom: 0;
979
988
  }
@@ -983,6 +992,6 @@ tr.dt-item > td button {
983
992
  margin-bottom: 1px;
984
993
  }
985
994
 
986
- .table-upper-buttons-wrap + .dt-static {
995
+ .table-upper-buttons-wrap+.dt-static {
987
996
  margin-top: 20px;
988
- }
997
+ }
@@ -2334,7 +2334,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
2334
2334
 
2335
2335
  (function () {
2336
2336
  CheckboxUtils.bindTableShiftClick();
2337
- DropdownUtils.bindDropdownOverflowHack(".dt-root.dt-breakpoint-desktop tbody .dropdown", "dataTableDropdown", false);
2337
+ DropdownUtils.bindDropdownOverflowHack(".dt-root.dt-breakpoint-desktop tbody .dropdown", "dataTableDropdown", "dt-dropdown-button-cloned", false);
2338
2338
  })();
2339
2339
 
2340
2340
  const DataTable = toNative(DataTableComponent);
@@ -1,5 +1,5 @@
1
1
  import { Prop, toNative } from "vue-facing-decorator";
2
- import LocalizedText from "../../common/localized-text";
2
+ import { ILocalizedText } from "../../common/localized-text";
3
3
  import TsxComponent, { Component } from "../../app/vuetsx";
4
4
  import { Language } from "../../common/enums/language";
5
5
  import { isNullOrEmpty } from "../../common/utils/is-null-or-empty";
@@ -12,13 +12,13 @@ import { ValidationState } from "../../common/static-wrappers/interfaces/validat
12
12
  interface LocalizedInfoInputArgs {
13
13
  label: string;
14
14
  wrap?: boolean;
15
- value: LocalizedText;
15
+ value: ILocalizedText;
16
16
  placeholder?: string;
17
17
  subtitle?: string;
18
18
  hint?: string;
19
19
  displayType?: "input" | "textarea";
20
20
  validationState?: ValidationState;
21
- changed: (e: LocalizedText) => void;
21
+ changed: (e: ILocalizedText) => void;
22
22
  mandatory?: boolean;
23
23
  }
24
24
 
@@ -26,19 +26,19 @@ interface LocalizedInfoInputArgs {
26
26
  class LocalizedInfoInputComponent extends TsxComponent<LocalizedInfoInputArgs> implements LocalizedInfoInputArgs {
27
27
  @Prop() label: string;
28
28
  @Prop() wrap?: boolean;
29
- @Prop() value: LocalizedText;
29
+ @Prop() value: ILocalizedText;
30
30
  @Prop() placeholder!: string;
31
31
  @Prop() subtitle!: string;
32
32
  @Prop() hint!: string;
33
33
  @Prop() displayType: "input" | "textarea";
34
- @Prop() changed: (e: LocalizedText) => void;
34
+ @Prop() changed: (e: ILocalizedText) => void;
35
35
  @Prop() mandatory?: boolean;
36
36
 
37
37
  getValueForTmrLanguage(lang: Language): string {
38
38
  return this.value[lang];
39
39
  }
40
40
 
41
- getValue(value: LocalizedText): LocalizedText {
41
+ getValue(value: ILocalizedText): ILocalizedText {
42
42
  if (value == null) {
43
43
  return {
44
44
  cs: null,
@@ -62,13 +62,13 @@ class LocalizedInfoInputComponent extends TsxComponent<LocalizedInfoInputArgs> i
62
62
  };
63
63
  }
64
64
 
65
- valueChanged(e: LocalizedText): void {
65
+ valueChanged(e: ILocalizedText): void {
66
66
  if (e == null) {
67
67
  this.changed(null);
68
68
  return;
69
69
  }
70
70
 
71
- let retObj: LocalizedText = {} as any;
71
+ let retObj: ILocalizedText = {} as any;
72
72
  const addLocalizedValue = (lang: Language, value: string): void => {
73
73
  if (!isNullOrEmpty(value)) {
74
74
  retObj[lang] = value;
@@ -9,17 +9,17 @@ import { ButtonLayout } from "../button/button-layout";
9
9
  import { DropdownButtonItemArgs } from "../dropdown-button/dropdown-button-item";
10
10
  import { PortalUtils } from "../../common/utils/utils";
11
11
  import { LanguageUtils } from "../../common/utils/language-utils";
12
- import LocalizedStringHelper from "../../common/utils/localized-string";
13
12
  import { Language } from "../../common/enums/language";
14
13
  import { isNullOrEmpty } from "../../common/utils/is-null-or-empty";
15
14
  import globalIcon from './img/global.png';
16
15
  import PowerduckState from "../../app/powerduck-state";
17
- import LocalizedText from "../../common/localized-text";
16
+ import { ILocalizedText } from "../../common/localized-text";
18
17
  import "./css/localized-string-input.css";
18
+ import LocalizedValueHelper from "../../common/localized-value-helper";
19
19
 
20
20
  interface LocalizedStringInputArgs extends FormItemWrapperArgs {
21
- value: LocalizedText;
22
- changed: (e: LocalizedText) => void;
21
+ value: ILocalizedText;
22
+ changed: (e: ILocalizedText) => void;
23
23
  supportedLanguages?: Language[];
24
24
  placeholder?: string;
25
25
  }
@@ -29,8 +29,8 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
29
29
  @Prop() label!: string;
30
30
  @Prop() labelButtons!: DropdownButtonItemArgs[];
31
31
  @Prop() subtitle!: string;
32
- @Prop() value!: LocalizedText;
33
- @Prop() changed: (e: LocalizedText) => void;
32
+ @Prop() value!: ILocalizedText;
33
+ @Prop() changed: (e: ILocalizedText) => void;
34
34
  @Prop() supportedLanguages?: Language[];
35
35
  @Prop() marginType?: MarginType;
36
36
  @Prop() maxWidth?: number;
@@ -45,11 +45,11 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
45
45
  @Prop() prependIcon: string;
46
46
  @Prop() appendClicked: () => void;
47
47
  @Prop() prependClicked: () => void;
48
- currentValue: LocalizedText = null;
48
+ currentValue: ILocalizedText = null;
49
49
  modalWillShow: boolean = false;
50
50
  uuid: string = "lsw-" + PortalUtils.randomString(10);
51
51
 
52
- raiseChangeEvent(newValue: LocalizedText): void {
52
+ raiseChangeEvent(newValue: ILocalizedText): void {
53
53
  this.populateValidationDeclaration();
54
54
 
55
55
  if (this.changed != null) {
@@ -60,10 +60,10 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
60
60
  isAllSame(): boolean {
61
61
  if (this.value != null) {
62
62
  let langList = LanguageUtils.getLanguageList();
63
- let skValue = LocalizedStringHelper.getValue(this.value, Language.sk);
63
+ let skValue = LocalizedValueHelper.getValue(this.value, Language.sk);
64
64
 
65
65
  for (let i = 0, len = langList.length; i < len; i++) {
66
- if (LocalizedStringHelper.getValue(this.value, langList[i].id) != skValue) {
66
+ if (LocalizedValueHelper.getValue(this.value, langList[i].id) != skValue) {
67
67
  return false;
68
68
  }
69
69
  }
@@ -73,7 +73,7 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
73
73
  }
74
74
 
75
75
  hasSomeValue(): boolean {
76
- return !isNullOrEmpty(LocalizedStringHelper.getValue(this.value, Language.sk));
76
+ return !isNullOrEmpty(LocalizedValueHelper.getValue(this.value, Language.sk));
77
77
  }
78
78
 
79
79
  getModalContext(): JQuery {
@@ -117,7 +117,7 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
117
117
 
118
118
  if (currentVal == null || currentVal.length == 0) {
119
119
  var language: Language = $this.attr("data-inv-lang") as any;
120
- var lsValue = LocalizedStringHelper.getValue(value, language) || "";
120
+ var lsValue = LocalizedValueHelper.getValue(value, language) || "";
121
121
  $this.attr("placeholder", lsValue);
122
122
  }
123
123
  });
@@ -175,7 +175,7 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
175
175
  return (
176
176
  <div class={PowerduckState.getFormControlCssClass() + " localized-input"} onClick={(e) => this.showInputModal()}>
177
177
  <img src={globalIcon} />
178
- &nbsp;{LocalizedStringHelper.getValue(this.value, Language.sk)}
178
+ &nbsp;{LocalizedValueHelper.getValue(this.value, Language.sk)}
179
179
  </div>
180
180
  );
181
181
  }
@@ -190,7 +190,7 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
190
190
 
191
191
  let langValue = this.value[lang.id];
192
192
  let hasValue = !isNullOrEmpty(langValue);
193
- langValue = hasValue ? langValue : LocalizedStringHelper.getValue(this.value, lang.id);
193
+ langValue = hasValue ? langValue : LocalizedValueHelper.getValue(this.value, lang.id);
194
194
 
195
195
  return (
196
196
  <div class={"localized-input-item" + (hasValue ? "" : " lii-auto")}>
@@ -216,7 +216,7 @@ class LocalizedStringInputComponent extends TsxComponent<LocalizedStringInputArg
216
216
 
217
217
  let langValue = this.currentValue[lang.id];
218
218
  let hasValue = !isNullOrEmpty(langValue);
219
- langValue = hasValue ? langValue : LocalizedStringHelper.getValue(this.currentValue, lang.id);
219
+ langValue = hasValue ? langValue : LocalizedValueHelper.getValue(this.currentValue, lang.id);
220
220
 
221
221
  return (
222
222
  <div class="row align-items-end lsi-form-group">
@@ -8,11 +8,11 @@ import TextArea from "./textarea";
8
8
  import { LanguageUtils } from "../../common/utils/language-utils";
9
9
  import { Language } from "../../common/enums/language";
10
10
  import PowerduckState from "../../app/powerduck-state";
11
- import LocalizedText from "../../common/localized-text";
11
+ import {ILocalizedText} from "../../common/localized-text";
12
12
 
13
13
  interface LocalizedStringInputArgs extends FormItemWrapperArgs {
14
- value: LocalizedText;
15
- changed: (e: LocalizedText) => void;
14
+ value: ILocalizedText;
15
+ changed: (e: ILocalizedText) => void;
16
16
  supportedLanguages?: Language[];
17
17
  placeholder?: string;
18
18
  }
@@ -22,8 +22,8 @@ class LocalizedStringTextareaComponent extends TsxComponent<LocalizedStringInput
22
22
  @Prop() label!: string;
23
23
  @Prop() labelButtons!: DropdownButtonItemArgs[];
24
24
  @Prop() subtitle!: string;
25
- @Prop() value!: LocalizedText;
26
- @Prop() changed: (e: LocalizedText) => void;
25
+ @Prop() value!: ILocalizedText;
26
+ @Prop() changed: (e: ILocalizedText) => void;
27
27
  @Prop() supportedLanguages?: Language[];
28
28
  @Prop() marginType?: MarginType;
29
29
  @Prop() maxWidth?: number;
@@ -37,9 +37,9 @@ class LocalizedStringTextareaComponent extends TsxComponent<LocalizedStringInput
37
37
  @Prop() prependIcon: string;
38
38
  @Prop() appendClicked: () => void;
39
39
  @Prop() prependClicked: () => void;
40
- currentValue: LocalizedText = null;
40
+ currentValue: ILocalizedText = null;
41
41
 
42
- raiseChangeEvent (newValue: LocalizedText): void {
42
+ raiseChangeEvent (newValue: ILocalizedText): void {
43
43
  this.populateValidationDeclaration();
44
44
 
45
45
  if (this.changed != null) {
@@ -52,12 +52,12 @@ class LocalizedStringTextareaComponent extends TsxComponent<LocalizedStringInput
52
52
  }
53
53
 
54
54
  changeValue(lang: Language, newValue: string): void {
55
- let value = this.value || ({} as LocalizedText);
55
+ let value = this.value || ({} as ILocalizedText);
56
56
  value[lang] = newValue;
57
57
  this.raiseChangeEvent(value);
58
58
  }
59
59
 
60
- getActualValue (lang: Language, value: LocalizedText): string {
60
+ getActualValue (lang: Language, value: ILocalizedText): string {
61
61
  if (value == null) {
62
62
  return null;
63
63
  }
@@ -5,14 +5,14 @@ import Tabs, { TabsRenderMode } from "../tabs/tabs";
5
5
  import { TabPage } from "../tabs/tab-page";
6
6
  import { DropdownButtonItemArgs } from "../dropdown-button/dropdown-button-item";
7
7
  import WysiwigEditor from "./wysiwig";
8
- import LocalizedText from "../../common/localized-text";
8
+ import {ILocalizedText} from "../../common/localized-text";
9
9
  import { LanguageUtils } from "../../common/utils/language-utils";
10
10
  import { Language } from "../../common/enums/language";
11
11
  import PowerduckState from "../../app/powerduck-state";
12
12
 
13
13
  interface LocalizedStringInputArgs extends FormItemWrapperArgs {
14
- value: LocalizedText;
15
- changed: (e: LocalizedText) => void;
14
+ value: ILocalizedText;
15
+ changed: (e: ILocalizedText) => void;
16
16
  supportedLanguages?: Language[];
17
17
  placeholder?: string;
18
18
  resizable?: boolean
@@ -23,8 +23,8 @@ class LocalizedStringWysiwigComponent extends TsxComponent<LocalizedStringInputA
23
23
  @Prop() label!: string;
24
24
  @Prop() labelButtons!: DropdownButtonItemArgs[];
25
25
  @Prop() subtitle!: string;
26
- @Prop() value!: LocalizedText;
27
- @Prop() changed: (e: LocalizedText) => void;
26
+ @Prop() value!: ILocalizedText;
27
+ @Prop() changed: (e: ILocalizedText) => void;
28
28
  @Prop() supportedLanguages?: Language[];
29
29
  @Prop() marginType?: MarginType;
30
30
  @Prop() maxWidth?: number;
@@ -38,9 +38,9 @@ class LocalizedStringWysiwigComponent extends TsxComponent<LocalizedStringInputA
38
38
  @Prop() prependIcon: string;
39
39
  @Prop() appendClicked: () => void;
40
40
  @Prop() prependClicked: () => void;
41
- currentValue: LocalizedText = null;
41
+ currentValue: ILocalizedText = null;
42
42
 
43
- raiseChangeEvent(newValue: LocalizedText): void {
43
+ raiseChangeEvent(newValue: ILocalizedText): void {
44
44
  this.populateValidationDeclaration();
45
45
 
46
46
  if (this.changed != null) {
@@ -53,12 +53,12 @@ class LocalizedStringWysiwigComponent extends TsxComponent<LocalizedStringInputA
53
53
  }
54
54
 
55
55
  changeValue(lang: Language, newValue: string): void {
56
- let value = this.value || ({} as LocalizedText);
56
+ let value = this.value || ({} as ILocalizedText);
57
57
  value[lang] = newValue;
58
58
  this.raiseChangeEvent(value);
59
59
  }
60
60
 
61
- getActualValue(lang: Language, value: LocalizedText): string {
61
+ getActualValue(lang: Language, value: ILocalizedText): string {
62
62
  if (value == null) {
63
63
  return null;
64
64
  }
@@ -13,16 +13,16 @@ import FlexFormItem from "../form/form-item-flex";
13
13
  import { FileManagerDialog, FileManagerModalFileType } from "../modal/ts/file-manager-dialog";
14
14
  import { PortalUtils } from "../../common/utils/utils";
15
15
  import { LanguageUtils } from "../../common/utils/language-utils";
16
- import LocalizedStringHelper from "../../common/utils/localized-string";
17
16
  import { Language } from "../../common/enums/language";
18
17
  import { isNullOrEmpty } from "../../common/utils/is-null-or-empty";
19
18
  import globalIcon from './img/global.png';
20
19
  import PowerduckState from "../../app/powerduck-state";
21
- import LocalizedText from "../../common/localized-text";
20
+ import {ILocalizedText} from "../../common/localized-text";
21
+ import LocalizedValueHelper from "../../common/localized-value-helper";
22
22
 
23
23
  interface LocalizedUrlInputArgs extends FormItemWrapperArgs {
24
- value: LocalizedText;
25
- changed: (e: LocalizedText) => void;
24
+ value: ILocalizedText;
25
+ changed: (e: ILocalizedText) => void;
26
26
  supportedLanguages?: Language[];
27
27
  placeholder?: string;
28
28
  }
@@ -32,8 +32,8 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
32
32
  @Prop() label!: string;
33
33
  @Prop() labelButtons!: DropdownButtonItemArgs[];
34
34
  @Prop() subtitle!: string;
35
- @Prop() value!: LocalizedText;
36
- @Prop() changed: (e: LocalizedText) => void;
35
+ @Prop() value!: ILocalizedText;
36
+ @Prop() changed: (e: ILocalizedText) => void;
37
37
  @Prop() supportedLanguages?: Language[];
38
38
  @Prop() marginType?: MarginType;
39
39
  @Prop() maxWidth?: number;
@@ -47,12 +47,12 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
47
47
  @Prop() prependIcon: string;
48
48
  @Prop() appendClicked: () => void;
49
49
  @Prop() prependClicked: () => void;
50
- currentValue: LocalizedText = null;
50
+ currentValue: ILocalizedText = null;
51
51
  modalWillShow: boolean = false;
52
52
  isModal: boolean = false;
53
53
  uuid: string = "lsw-" + PortalUtils.randomString(10);
54
54
 
55
- raiseChangeEvent (newValue: LocalizedText): void {
55
+ raiseChangeEvent (newValue: ILocalizedText): void {
56
56
  this.populateValidationDeclaration();
57
57
 
58
58
  if (this.changed != null) {
@@ -63,10 +63,10 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
63
63
  isAllSame(): boolean {
64
64
  if (this.value != null) {
65
65
  let langList = LanguageUtils.getLanguageList();
66
- let skValue = LocalizedStringHelper.getValue(this.value, Language.sk);
66
+ let skValue = LocalizedValueHelper.getValue(this.value, Language.sk);
67
67
 
68
68
  for (let i = 0, len = langList.length; i < len; i++) {
69
- if (LocalizedStringHelper.getValue(this.value, langList[i].id) != skValue) {
69
+ if (LocalizedValueHelper.getValue(this.value, langList[i].id) != skValue) {
70
70
  return false;
71
71
  }
72
72
  }
@@ -76,7 +76,7 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
76
76
  }
77
77
 
78
78
  hasSomeValue(): boolean {
79
- return !isNullOrEmpty(LocalizedStringHelper.getValue(this.value, Language.sk));
79
+ return !isNullOrEmpty(LocalizedValueHelper.getValue(this.value, Language.sk));
80
80
  }
81
81
 
82
82
  getModalContext(): JQuery {
@@ -133,7 +133,7 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
133
133
 
134
134
  if (currentVal == null || currentVal.length == 0) {
135
135
  var language: Language = $this.attr("data-inv-lang") as any;
136
- var lsValue = LocalizedStringHelper.getValue(value, language) || "";
136
+ var lsValue = LocalizedValueHelper.getValue(value, language) || "";
137
137
  $this.attr("placeholder", lsValue);
138
138
  }
139
139
  });
@@ -207,7 +207,7 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
207
207
  }
208
208
 
209
209
  renderInputGlobalValue(h) {
210
- let langValue = LocalizedStringHelper.getValue(this.value, Language.sk);
210
+ let langValue = LocalizedValueHelper.getValue(this.value, Language.sk);
211
211
  return (
212
212
  <FlexContainer cssClass={"mb-1"} fullWidthOnMobile={false}>
213
213
  <FlexFormItem flexFill={true}>
@@ -255,7 +255,7 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
255
255
 
256
256
  let langValue = this.value[lang.id];
257
257
  let hasValue = !isNullOrEmpty(langValue);
258
- langValue = hasValue ? langValue : LocalizedStringHelper.getValue(this.value, lang.id);
258
+ langValue = hasValue ? langValue : LocalizedValueHelper.getValue(this.value, lang.id);
259
259
 
260
260
  return (
261
261
  <div class={"localized-input-item" + (hasValue ? "" : " lii-auto")}>
@@ -281,7 +281,7 @@ class LocalizedUrlInputComponent extends TsxComponent<LocalizedUrlInputArgs> imp
281
281
 
282
282
  let langValue = this.currentValue[lang.id];
283
283
  let hasValue = !isNullOrEmpty(langValue);
284
- langValue = hasValue ? langValue : LocalizedStringHelper.getValue(this.currentValue, lang.id);
284
+ langValue = hasValue ? langValue : LocalizedValueHelper.getValue(this.currentValue, lang.id);
285
285
 
286
286
  return (
287
287
  <FlexContainer cssClass={"mb-1"} fullWidthOnMobile={false}>
@@ -38,7 +38,7 @@
38
38
 
39
39
  .table-upper-buttons-wrap {
40
40
  position: absolute;
41
- top: 20px;
41
+ top: 8px;
42
42
  z-index: 1;
43
43
  }
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
- "version": "0.0.86",
3
+ "version": "0.0.89",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": " vite build && vue-tsc --declaration --emitDeclarationOnly",
@@ -1,83 +0,0 @@
1
- import { Language } from "../enums/language";
2
- import LocalizedText, { ILocalizedText } from "../localized-text";
3
- import { isNullOrEmpty } from "./is-null-or-empty";
4
- import { LanguageUtils } from "./language-utils";
5
-
6
- export interface ILocalizedString {
7
- Slovak: string;
8
- English: string;
9
- Czech: string;
10
- German: string;
11
- Latvian: string;
12
- Polish: string;
13
- Italian: string;
14
- Hungarian: string;
15
- }
16
-
17
- function getValueForPair(localizedString: any, langCode: string, lang: Language): string {
18
- return localizedString[langCode] || localizedString[lang];
19
- }
20
-
21
- export default class LocalizedStringHelper {
22
- static getValue(value: ILocalizedString | ILocalizedText, lang: Language | string) {
23
- if (value == null) {
24
- return null;
25
- }
26
-
27
- if (lang == Language.sk) {
28
- const skVal = getValueForPair(value, 'sk', Language.sk);
29
- if (!isNullOrEmpty(skVal)) {
30
- return skVal;
31
- }
32
-
33
- const csVal = getValueForPair(value, 'cs', Language.cs);
34
- if (!isNullOrEmpty(csVal)) {
35
- return csVal;
36
- }
37
- } else if (lang == Language.cs) {
38
- const csVal = getValueForPair(value, 'cs', Language.cs);
39
- if (!isNullOrEmpty(csVal)) {
40
- return csVal;
41
- }
42
-
43
- const skVal = getValueForPair(value, 'sk', Language.sk);
44
- if (!isNullOrEmpty(skVal)) {
45
- return skVal;
46
- }
47
- } else if (lang == Language.de) {
48
- const val = getValueForPair(value, 'de', Language.de);
49
- if (!isNullOrEmpty(val)) {
50
- return val;
51
- }
52
- } else if (lang == Language.pl) {
53
- const val = getValueForPair(value, 'pl', Language.pl);
54
- if (!isNullOrEmpty(val)) {
55
- return val;
56
- }
57
- } else if (lang == Language.it) {
58
- const val = getValueForPair(value, 'it', Language.it);
59
- if (!isNullOrEmpty(val)) {
60
- return val;
61
- }
62
- } else if (lang == Language.hu) {
63
- const val = getValueForPair(value, 'hu', Language.hu);
64
- if (!isNullOrEmpty(val)) {
65
- return val;
66
- }
67
- }
68
-
69
- const lastTry = getValueForPair(value, 'sk', Language.sk);
70
- if (!isNullOrEmpty(lastTry)) {
71
- return lastTry;
72
- }
73
-
74
- for (const propName in value) {
75
- const text = (value as any)[propName];
76
- if (text != null && text.toString().length > 0) {
77
- return text;
78
- }
79
- }
80
-
81
- return null;
82
- }
83
- }
@@ -1,36 +0,0 @@
1
- import LocalizedText from './../localized-text';
2
- import { Language } from './../enums/language';
3
-
4
- export default class LocalizedTextUtil {
5
- static getLocalizedTextValue(value: LocalizedText, langKey: string | Language): string {
6
- if (value == null) {
7
- return null as any;
8
- }
9
-
10
- let retVal = (value as any)[langKey];
11
- if (retVal == null) {
12
- if (langKey == "sk") {
13
- retVal = value.cs;
14
- } else if (langKey == "cs") {
15
- retVal = value.sk;
16
- } else {
17
- retVal = value.en;
18
- }
19
- }
20
-
21
- if (retVal == null) {
22
- if (value.sk != null) {
23
- return value.sk;
24
- }
25
-
26
- for (const propName in value) {
27
- const text = (value as any)[propName];
28
- if (text != null && text.toString().length > 0) {
29
- return text;
30
- }
31
- }
32
- }
33
-
34
- return retVal || value.sk;
35
- }
36
- }