@vgip/meta-ui 2.1.3 → 2.1.5

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 (111) hide show
  1. package/fesm2022/vgip-meta-ui.mjs +6092 -0
  2. package/fesm2022/vgip-meta-ui.mjs.map +1 -0
  3. package/index.d.ts +709 -0
  4. package/package.json +15 -3
  5. package/.eslintrc.json +0 -57
  6. package/karma.conf.js +0 -35
  7. package/ng-package.json +0 -10
  8. package/src/lib/common/fieldNormalizer/boolean.ts +0 -11
  9. package/src/lib/common/fieldNormalizer/datetime.ts +0 -8
  10. package/src/lib/common/fieldNormalizer/index.ts +0 -171
  11. package/src/lib/common/fieldNormalizer/number.ts +0 -13
  12. package/src/lib/common/fieldNormalizer/options.ts +0 -48
  13. package/src/lib/common/fieldNormalizer/radio.ts +0 -29
  14. package/src/lib/common/fieldNormalizer/reference.ts +0 -32
  15. package/src/lib/common/fieldNormalizer/richtext.ts +0 -15
  16. package/src/lib/common/fieldNormalizer/string.ts +0 -23
  17. package/src/lib/common/fieldNormalizer/text.ts +0 -17
  18. package/src/lib/common/fieldNormalizer/uniqueNameFilter.ts +0 -21
  19. package/src/lib/common/metaAutofocus.directive.ts +0 -31
  20. package/src/lib/common/metaContext.resolver.ts +0 -25
  21. package/src/lib/common/metaIcons.pipe.spec.ts +0 -15
  22. package/src/lib/common/metaIcons.pipe.ts +0 -29
  23. package/src/lib/common/metaModel.pipe.ts +0 -19
  24. package/src/lib/common/metaNormalizer.ts +0 -366
  25. package/src/lib/common/metaStripHtml.pipe.ts +0 -18
  26. package/src/lib/common/utils/colorThemes.ts +0 -86
  27. package/src/lib/common/utils/indexedDbStore/index.ts +0 -244
  28. package/src/lib/common/utils/indexedDbStore/indexedDbStore.spec.ts +0 -149
  29. package/src/lib/common/utils/relativeTimeBuilder.ts +0 -49
  30. package/src/lib/common/utils/resourceCardLabel.ts +0 -25
  31. package/src/lib/common/utils/smartProp.spec.ts +0 -24
  32. package/src/lib/common/utils/smartProp.ts +0 -28
  33. package/src/lib/common/utils/templateBuilder.ts +0 -99
  34. package/src/lib/field.scss +0 -207
  35. package/src/lib/fieldAbstract.ts +0 -327
  36. package/src/lib/fieldBoolean/index.ts +0 -55
  37. package/src/lib/fieldBoolean/style.scss +0 -22
  38. package/src/lib/fieldBoolean/test.spec.ts +0 -43
  39. package/src/lib/fieldBoolean/view.html +0 -30
  40. package/src/lib/fieldComposite/index.ts +0 -86
  41. package/src/lib/fieldComposite/style.scss +0 -6
  42. package/src/lib/fieldComposite/test.spec.ts +0 -43
  43. package/src/lib/fieldComposite/view.html +0 -9
  44. package/src/lib/fieldDatetime/index.ts +0 -359
  45. package/src/lib/fieldDatetime/style.scss +0 -81
  46. package/src/lib/fieldDatetime/test.spec.ts +0 -43
  47. package/src/lib/fieldDatetime/view.html +0 -26
  48. package/src/lib/fieldHidden/index.ts +0 -15
  49. package/src/lib/fieldHidden/view.html +0 -0
  50. package/src/lib/fieldInput/index.ts +0 -477
  51. package/src/lib/fieldInput/style.scss +0 -128
  52. package/src/lib/fieldInput/test.spec.ts +0 -43
  53. package/src/lib/fieldInput/view.html +0 -81
  54. package/src/lib/fieldList/index.ts +0 -73
  55. package/src/lib/fieldList/style.scss +0 -26
  56. package/src/lib/fieldList/test.spec.ts +0 -43
  57. package/src/lib/fieldList/view.html +0 -25
  58. package/src/lib/fieldRadio/index.ts +0 -93
  59. package/src/lib/fieldRadio/style.scss +0 -32
  60. package/src/lib/fieldRadio/test.spec.ts +0 -43
  61. package/src/lib/fieldRadio/view.html +0 -24
  62. package/src/lib/fieldReference/index.ts +0 -871
  63. package/src/lib/fieldReference/style.scss +0 -273
  64. package/src/lib/fieldReference/test.spec.ts +0 -44
  65. package/src/lib/fieldReference/view.html +0 -163
  66. package/src/lib/fieldRichtext/index.ts +0 -98
  67. package/src/lib/fieldRichtext/quill.scss +0 -6
  68. package/src/lib/fieldRichtext/style.scss +0 -87
  69. package/src/lib/fieldRichtext/test.spec.ts +0 -43
  70. package/src/lib/fieldRichtext/view.html +0 -17
  71. package/src/lib/fieldSelect/index.ts +0 -597
  72. package/src/lib/fieldSelect/style.scss +0 -165
  73. package/src/lib/fieldSelect/test.spec.ts +0 -44
  74. package/src/lib/fieldSelect/view.html +0 -128
  75. package/src/lib/fieldText/index.ts +0 -86
  76. package/src/lib/fieldText/style.scss +0 -24
  77. package/src/lib/fieldText/test.spec.ts +0 -43
  78. package/src/lib/fieldText/view.html +0 -23
  79. package/src/lib/fieldUnknown/index.ts +0 -15
  80. package/src/lib/fieldUnknown/test.spec.ts +0 -34
  81. package/src/lib/fieldUnknown/view.html +0 -9
  82. package/src/lib/index.ts +0 -127
  83. package/src/lib/layout/index.ts +0 -255
  84. package/src/lib/layout/style.scss +0 -67
  85. package/src/lib/layout/view.html +0 -45
  86. package/src/lib/metaField/index.ts +0 -133
  87. package/src/lib/metaField/test.spec.ts +0 -32
  88. package/src/lib/refDialog/index.ts +0 -157
  89. package/src/lib/refDialog/style.scss +0 -154
  90. package/src/lib/refDialog/view.html +0 -24
  91. package/src/lib/resource/index.ts +0 -559
  92. package/src/lib/resource/style.scss +0 -132
  93. package/src/lib/resource/view.html +0 -70
  94. package/src/lib/resourceCard/index.ts +0 -44
  95. package/src/lib/resourceCard/style.scss +0 -7
  96. package/src/lib/resourceCard/view.html +0 -14
  97. package/src/lib/services/metaContext/index.ts +0 -61
  98. package/src/lib/services/metaMsg/index.ts +0 -84
  99. package/src/lib/services/metaReference/index.ts +0 -98
  100. package/src/lib/services/metaResource/index.ts +0 -163
  101. package/src/lib/services/metaResource/metaHttpClient.ts +0 -76
  102. package/src/lib/services/metaResource/metaResource.spec.ts +0 -24
  103. package/src/lib/services/metaTracker/index.ts +0 -38
  104. package/src/lib/services/resourceDrafts/index.ts +0 -81
  105. package/src/lib/services/resourceDrafts/resourceDrafts.spec.ts +0 -24
  106. package/src/lib/styles.scss +0 -13
  107. package/src/public-api.ts +0 -5
  108. package/src/test.ts +0 -17
  109. package/tsconfig.lib.json +0 -25
  110. package/tsconfig.lib.prod.json +0 -9
  111. package/tsconfig.spec.json +0 -17
@@ -1,157 +0,0 @@
1
- import { Component, ElementRef, OnInit } from '@angular/core';
2
- import { metaDark, metaLight } from '../common/utils/colorThemes';
3
- import { MetaResourceService } from '../services/metaResource';
4
-
5
- @Component({
6
- templateUrl: './view.html',
7
- styleUrls: ['./style.scss'],
8
- standalone: false
9
- })
10
- export class MetaRefDialog implements OnInit {
11
- modal: HTMLElement;
12
- onComplete: (result?) => undefined;
13
- fullResource: any;
14
- resources: any = {};
15
- models: any = {};
16
- reference: any;
17
- currentResource: string;
18
- services: any = {};
19
- integrationCode: string;
20
- resource: any;
21
- metaResource: MetaResourceService;
22
- integrationIcon: string;
23
- preferResourceType: string;
24
- theme: string;
25
-
26
- constructor(
27
- private el: ElementRef
28
- ) { }
29
-
30
- get isEditable() {
31
- return this.resources[this.currentResource].meta.layout.editable !== false;
32
- }
33
-
34
- get isPersistent() {
35
- return this.resource && (this.resource.externalId || this.resource.id);
36
- }
37
-
38
- ngOnInit() {
39
- let references = (this.reference instanceof Array) ? this.reference : [this.reference];
40
- /* eslint-disable no-underscore-dangle */
41
- if (this.resource && this.resource._vgis) {
42
- this.fullResource = this.resource;
43
- this.resource = this.resource._vgis;
44
- }
45
- /* eslint-enable no-underscore-dangle */
46
- if (this.resource) {
47
- references = references.filter((r) => {
48
- const resType = r.name || r.resourceType || '';
49
- // comparing case insensitive, because of Zendesk comment vs Comment
50
- return (resType.id || resType || '').toLowerCase() === (this.resource.resourceType || this.resource.type || '').toLowerCase();
51
- });
52
- }
53
-
54
- for (const ref of references) {
55
- if (!ref.name) {
56
- ref.name = ref.resourceType; // when the resource comes from resources API, not from metadata
57
- }
58
- if (!this.currentResource) {
59
- this.currentResource = ref.name;
60
- }
61
- if (ref.name === this.preferResourceType) {
62
- this.currentResource = this.preferResourceType;
63
- }
64
- const rs: any = {
65
- integrationCode: this.integrationCode,
66
- resourceType: ref.resourceType || ref.name,
67
- ref
68
- };
69
- if (this.resource) {
70
- rs.externalId = this.resource.id || this.resource.externalId;
71
- if (this.resource.eventId) {
72
- rs.eventId = this.resource.eventId;
73
- }
74
- if (this.fullResource) {
75
- rs.activity = this.fullResource;
76
- }
77
- if (this.resource.layoutId) {
78
- rs.layoutId = this.resource.layoutId;
79
- }
80
- }
81
- rs.parent = ref.parent;
82
- this.resources[ref.name] = rs;
83
- this.models[ref.name] = {};
84
- if (this.resource) {
85
- this.models[ref.name]._vgis = this.resource; // eslint-disable-line no-underscore-dangle
86
- }
87
- }
88
-
89
- this.modal = this.el.nativeElement.childNodes[0];
90
- this.modal.classList.remove('Vlt-modal--out');
91
- this.modal.classList.add('Vlt-modal_visible');
92
- document.addEventListener('keydown', this.keyEventListener);
93
-
94
- if (this.integrationCode === 'mocks') {
95
- this.integrationIcon = 'Brand-icon-vonage';
96
- } else {
97
- switch (this.integrationCode.toLowerCase()) {
98
- case 'office365':
99
- this.integrationIcon = 'Brand-icon-office-color';
100
- break;
101
- case 'sugar':
102
- this.integrationIcon = 'Brand-icon-sugarcrm-color';
103
- break;
104
- case 'msdynamics':
105
- this.integrationIcon = 'Brand-icon-dynamics-color';
106
- break;
107
- default:
108
- this.integrationIcon = `Brand-icon-${(this.integrationCode || '').toLowerCase()}-color`;
109
- }
110
- }
111
-
112
- this.applyTheme();
113
- }
114
-
115
- close() {
116
- this.modal.classList.remove('Vlt-modal_visible');
117
- this.modal.classList.add('Vlt-modal--out');
118
- }
119
-
120
- dismiss(ev?) {
121
- this.close();
122
- this.onComplete(null);
123
- if (ev) {
124
- ev.preventDefault();
125
- ev.stopPropagation();
126
- return false;
127
- }
128
- }
129
-
130
- onResourceDone(result) {
131
- this.close();
132
- this.onComplete(result);
133
- }
134
-
135
- selectResource(ev, resource) {
136
- this.currentResource = resource;
137
- ev.preventDefault();
138
- ev.stopPropagation();
139
- return false;
140
- }
141
-
142
- keepOrder = (a) => a;
143
-
144
- private keyEventListener = (event) => {
145
- if (event && event.key === 'Escape') {
146
- document.removeEventListener('keydown', this.keyEventListener);
147
- this.dismiss();
148
- }
149
- };
150
-
151
- private applyTheme() {
152
- const metaTheme = this.theme === 'dark' ? metaDark : metaLight;
153
- for (const key of Object.keys(metaTheme.properties)) {
154
- this.el.nativeElement.style.setProperty(key, metaTheme.properties[key]);
155
- }
156
- }
157
- }
@@ -1,154 +0,0 @@
1
- .Vlt-modal_visible {
2
- background: var(--vgip-meta-overlay-background);
3
- }
4
- .Vlt-modal__panel {
5
- padding: 0;
6
- // border: 1px solid var(--vgip-meta-separator-color);
7
- background: var(--vgip-meta-resource-bg-color);
8
- overflow: hidden;
9
- @media only screen and (max-width: 575px) {
10
- height: 100%;
11
- width: 100%;
12
- max-height: none;
13
- border-bottom-left-radius: 0;
14
- border-bottom-right-radius: 0;
15
- margin: 10px 6px 0 6px;
16
- ::ng-deep .busy-mask {
17
- min-height: calc(100vh - 58px);
18
- }
19
- }
20
- .Vlt-tabs__header--background {
21
- border-top-left-radius: 5px;
22
- border-top-right-radius: 5px;
23
- }
24
- .Vlt-tabs__header {
25
- background: var(--vgip-meta-resource-bar-color);
26
- padding-left: 52px;
27
- padding-right: 45px;
28
- border-bottom: 0;
29
- flex-wrap: wrap;
30
- min-height: 52px;
31
- max-height: 52px;
32
- align-items: center;
33
- > .Vlt-icon {
34
- position: absolute;
35
- left: 14px;
36
- }
37
- h5 {
38
- margin-bottom: 0;
39
- font-weight: initial;
40
- }
41
- .Vlt-tabs__link {
42
- padding-top: 4px;
43
- padding-bottom: 2px;
44
- color: var(--vgip-meta-input-label-color);
45
- text-transform: capitalize;
46
- }
47
- .Vlt-tabs__link_active {
48
- color: var(--vgip-meta-input-accent-color);
49
- &:after {
50
- background: var(--vgip-meta-input-accent-color);
51
- }
52
- }
53
- .Vlt-modal__dismiss {
54
- background-image: none;
55
- width: 18px;
56
- height: 18px;
57
- opacity: initial;
58
- svg {
59
- width: 16px;
60
- height: 16px;
61
- fill: var(--vgip-meta-input-label-color);
62
- }
63
- &:hover svg {
64
- fill: var(--vgip-meta-input-accent-color);
65
- }
66
- }
67
- &::-webkit-scrollbar {
68
- width: 8px;
69
- }
70
- &::-webkit-scrollbar-thumb {
71
- background-color: var(--vgip-meta-scrollbar-color);
72
- border: 2px solid transparent;
73
- border-radius: 6px;
74
- background-clip: content-box;
75
- }
76
- }
77
- .Vlt-tabs__content {
78
- margin-top: 0;
79
- // border-top: 1px solid #e7ebee;
80
- .Vlt-tabs__link {
81
- font-size: 1.8rem;
82
- }
83
- }
84
- .Vlt-callout--banner {
85
- // padding-left: 16px;
86
- // padding-right: 20px;
87
- -webkit-box-pack: initial;
88
- justify-content: initial;
89
- text-align: initial;
90
- overflow-y: auto;
91
- &.Vlt-callout--dismissed {
92
- padding: 0;
93
- }
94
- &:not(.Vlt-callout--dismissed) {
95
- min-height: 78px;
96
- }
97
- }
98
- .Vlt-modal__cancel {
99
- z-index: 899;
100
- }
101
- .Vlt-modal__dismiss {
102
- right: 16px;
103
- top: 14px;
104
- // color: #c4cdd5;
105
- // &:hover {
106
- // color: #f8fafc;
107
- // }
108
- // background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3Csvg%20width%3D%2220px%22%20height%3D%2220px%22%20viewBox%3D%220%200%2020%2020%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%20%20%3C!--%20Generator%3A%20Sketch%2048.2%20(47327)%20-%20http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%20--%3E%0A%20%20%20%20%3Ctitle%3Eicn-close%3C%2Ftitle%3E%0A%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C%2Fdesc%3E%0A%20%20%20%20%3Cdefs%3E%3C%2Fdefs%3E%0A%20%20%20%20%3Cg%20id%3D%22Modals---Desktop%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate(-512.000000%2C%20-62.000000)%22%3E%0A%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Modal%22%20transform%3D%22translate(156.000000%2C%2040.000000)%22%20fill%3D%22%23f8fafc%22%20fill-rule%3D%22nonzero%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22icn-close%22%20transform%3D%22translate(356.000000%2C%2022.000000)%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group-12%22%20transform%3D%22translate(2.083333%2C%202.500000)%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolygon%20id%3D%22Path-252%22%20points%3D%221.42258898%2015.115968%2015.115968%201.42258898%2013.9374567%200.244077682%200.244077682%2013.9374567%22%3E%3C%2Fpolygon%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolygon%20id%3D%22Path-252-Copy%22%20points%3D%220.244077682%201.42258898%2013.9374567%2015.115968%2015.115968%2013.9374567%201.42258898%200.244077682%22%3E%3C%2Fpolygon%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E');
109
- }
110
- .Vlt-card__footer button {
111
- margin-top: 0;
112
- margin-bottom: 0;
113
- }
114
- .Vlt-select select:disabled {
115
- background: initial;
116
- cursor: not-allowed;
117
- }
118
- ::ng-deep .form-content {
119
- min-height: 0;
120
- max-height: calc(95vh - 172px);
121
- @media only screen and (max-width: 575px) {
122
- min-height: calc(100vh - 113px);
123
- }
124
- }
125
- }
126
-
127
- .resource-menu {
128
- button {
129
- margin: 0 -10px 0;
130
- &:not(:hover) .Vlt-icon {
131
- color: #616266;
132
- fill: #616266;
133
- }
134
- }
135
- }
136
-
137
- .busy-mask {
138
- position: absolute;
139
- top: 0;
140
- right: 0;
141
- bottom: 0;
142
- left: 0;
143
- background: rgba(0,0,0,.32);
144
- opacity: 1;
145
- z-index: 898;
146
- display: none;
147
- border-bottom-left-radius: 6px;
148
- border-bottom-right-radius: 6px;
149
- margin: 1px;
150
- cursor: progress;
151
- &.active {
152
- display: block;
153
- }
154
- }
@@ -1,24 +0,0 @@
1
- <div class='Vlt-modal Vlt-modal--large'>
2
- <div class="Vlt-modal__panel">
3
- <div class="Vlt-tabs">
4
- <div class='Vlt-tabs__header--background'>
5
- <div class="Vlt-tabs__header Vlt-tabs__header--shadow">
6
- <svg class="Vlt-icon" [ngStyle]="{fill: integrationIcon === 'Brand-icon-vonage' ? 'var(--vgip-meta-input-color)' : ''}"><use attr.xlink:href="volta/volta-brand-icons.svg#{{integrationIcon}}" /></svg>
7
- <a href='#' *ngFor='let r of resources | keyvalue: keepOrder' (click)='selectResource($event, r.key)' class="Vlt-tabs__link" [ngClass]="{ 'Vlt-tabs__link_active': currentResource === r.key}">
8
- {{r.key}}
9
- </a>
10
- <a href='#' class="Vlt-modal__dismiss" (click)="dismiss($event)">
11
- <svg class="Vlt-icon"><use xlink:href="volta/volta-icons.svg#Vlt-icon-cross" /></svg>
12
- </a>
13
- </div>
14
- </div>
15
- <div class="Vlt-tabs__content" style='min-height: 90px;'>
16
- <ng-container *ngFor='let r of resources | keyvalue: keepOrder'>
17
- <div *ngIf='currentResource === r.key' class="Vlt-tabs__panel Vlt-tabs__panel_active">
18
- <vgip-meta-resource [resource]='r.value' [model]='models[r.key]' [metaResourceServiceDelegated]='metaResource' (done)='onResourceDone($event)' theme='inherit' [attr.data-theme]='theme'></vgip-meta-resource>
19
- </div>
20
- </ng-container>
21
- </div>
22
- </div>
23
- </div>
24
- </div>