@pepperi-addons/ngx-lib 0.3.7 → 0.3.9-beta.11
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/bundles/pepperi-addons-ngx-lib-draggable-items.umd.js +173 -0
- package/bundles/pepperi-addons-ngx-lib-draggable-items.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +9 -8
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-icon.umd.js +40 -14
- package/bundles/pepperi-addons-ngx-lib-icon.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-link.umd.js +488 -0
- package/bundles/pepperi-addons-ngx-lib-link.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-lib-list.umd.js +13 -12
- package/bundles/pepperi-addons-ngx-lib-list.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js +567 -0
- package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-lib-search.umd.js +27 -6
- package/bundles/pepperi-addons-ngx-lib-search.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib.umd.js +24 -1
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/customization/customization.model.d.ts +6 -0
- package/draggable-items/draggable-item/draggable-item.component.d.ts +8 -0
- package/draggable-items/draggable-items.component.d.ts +31 -0
- package/draggable-items/draggable-items.component.theme.scss +12 -0
- package/draggable-items/draggable-items.model.d.ts +7 -0
- package/draggable-items/draggable-items.module.d.ts +5 -0
- package/draggable-items/package.json +14 -0
- package/draggable-items/pepperi-addons-ngx-lib-draggable-items.d.ts +4 -0
- package/draggable-items/pepperi-addons-ngx-lib-draggable-items.metadata.json +1 -0
- package/draggable-items/public-api.d.ts +4 -0
- package/esm2015/core/common/services/utilities.service.js +4 -2
- package/esm2015/core/customization/customization.model.js +17 -1
- package/esm2015/draggable-items/draggable-item/draggable-item.component.js +25 -0
- package/esm2015/draggable-items/draggable-items.component.js +90 -0
- package/esm2015/draggable-items/draggable-items.model.js +2 -0
- package/esm2015/draggable-items/draggable-items.module.js +43 -0
- package/esm2015/draggable-items/pepperi-addons-ngx-lib-draggable-items.js +5 -0
- package/esm2015/draggable-items/public-api.js +8 -0
- package/esm2015/form/field-generator.component.js +2 -2
- package/esm2015/form/form.component.js +5 -5
- package/esm2015/form/form.module.js +3 -1
- package/esm2015/icon/icon-generated-all.model.js +2 -1
- package/esm2015/icon/icon-generated.model.js +5 -1
- package/esm2015/icon/icon.component.js +7 -20
- package/esm2015/icon/icon.module.js +3 -2
- package/esm2015/icon/icon.service.js +32 -0
- package/esm2015/icon/public-api.js +2 -1
- package/esm2015/link/link.component.js +391 -0
- package/esm2015/link/link.module.js +51 -0
- package/esm2015/link/link.pipes.js +15 -0
- package/esm2015/link/pepperi-addons-ngx-lib-link.js +6 -0
- package/esm2015/link/public-api.js +6 -0
- package/esm2015/list/list.component.js +12 -11
- package/esm2015/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.js +5 -0
- package/esm2015/profile-data-views-list/profile-data-view/profile-data-view.component.js +35 -0
- package/esm2015/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.js +60 -0
- package/esm2015/profile-data-views-list/profile-data-views-list.component.js +86 -0
- package/esm2015/profile-data-views-list/profile-data-views-list.model.js +2 -0
- package/esm2015/profile-data-views-list/profile-data-views-list.module.js +57 -0
- package/esm2015/profile-data-views-list/public-api.js +9 -0
- package/esm2015/search/search.component.js +24 -7
- package/esm2015/search/search.model.js +1 -1
- package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +2 -2
- package/esm2015/top-bar/top-bar.component.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js +164 -0
- package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-lib-form.js +7 -5
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-icon.js +38 -15
- package/fesm2015/pepperi-addons-ngx-lib-icon.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-link.js +460 -0
- package/fesm2015/pepperi-addons-ngx-lib-link.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-lib-list.js +11 -10
- package/fesm2015/pepperi-addons-ngx-lib-list.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js +242 -0
- package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-lib-search.js +23 -6
- package/fesm2015/pepperi-addons-ngx-lib-search.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.js +20 -2
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/form/pepperi-addons-ngx-lib-form.metadata.json +1 -1
- package/icon/icon-generated-all.model.d.ts +1 -0
- package/icon/icon-generated.model.d.ts +5 -1
- package/icon/icon.component.d.ts +3 -6
- package/icon/icon.service.d.ts +10 -0
- package/icon/pepperi-addons-ngx-lib-icon.metadata.json +1 -1
- package/icon/public-api.d.ts +1 -0
- package/link/link.component.d.ts +136 -0
- package/link/link.module.d.ts +5 -0
- package/link/link.pipes.d.ts +4 -0
- package/link/package.json +14 -0
- package/link/pepperi-addons-ngx-lib-link.d.ts +5 -0
- package/link/pepperi-addons-ngx-lib-link.metadata.json +1 -0
- package/link/public-api.d.ts +2 -0
- package/package.json +1 -1
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
- package/profile-data-views-list/package.json +15 -0
- package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.d.ts +4 -0
- package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.metadata.json +1 -0
- package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +14 -0
- package/profile-data-views-list/profile-data-view/profile-data-view.component.theme.scss +7 -0
- package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +21 -0
- package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.theme.scss +5 -0
- package/profile-data-views-list/profile-data-views-list.component.d.ts +32 -0
- package/profile-data-views-list/profile-data-views-list.model.d.ts +18 -0
- package/profile-data-views-list/profile-data-views-list.module.d.ts +5 -0
- package/profile-data-views-list/public-api.d.ts +5 -0
- package/search/pepperi-addons-ngx-lib-search.metadata.json +1 -1
- package/search/search.component.d.ts +5 -2
- package/search/search.model.d.ts +1 -0
- package/smart-filters/pepperi-addons-ngx-lib-smart-filters.metadata.json +1 -1
- package/src/assets/i18n/en.ngx-lib.json +8 -0
- package/src/core/style/abstracts/variables.scss +4 -0
- package/src/core/style/components/checkbox.scss +4 -4
- package/src/core/style/vendors/normalize.scss +6 -0
- package/top-bar/pepperi-addons-ngx-lib-top-bar.metadata.json +1 -1
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/icon'), require('@pepperi-addons/ngx-lib'), require('@pepperi-addons/ngx-lib/icon'), require('@pepperi-addons/ngx-lib/textbox-icon'), require('@pepperi-addons/ngx-lib/field-title'), require('@ngx-translate/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib/link', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/material/core', '@angular/material/button', '@angular/material/form-field', '@angular/material/input', '@angular/material/icon', '@pepperi-addons/ngx-lib', '@pepperi-addons/ngx-lib/icon', '@pepperi-addons/ngx-lib/textbox-icon', '@pepperi-addons/ngx-lib/field-title', '@ngx-translate/core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = global['pepperi-addons']['ngx-lib'] || {}, global['pepperi-addons']['ngx-lib'].link = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.material.core, global.ng.material.button, global.ng.material.formField, global.ng.material.input, global.ng.material.icon, global['pepperi-addons']['ngx-lib'], global['pepperi-addons']['ngx-lib'].icon, global['pepperi-addons']['ngx-lib']['textbox-icon'], global['pepperi-addons']['ngx-lib']['field-title'], global.translate));
|
|
5
|
+
}(this, (function (exports, core, common, forms, core$2, button, formField, input, icon$1, ngxLib, icon, textboxIcon, fieldTitle, core$1) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var IsUrlPipe = /** @class */ (function () {
|
|
8
|
+
function IsUrlPipe() {
|
|
9
|
+
}
|
|
10
|
+
IsUrlPipe.prototype.transform = function (value) {
|
|
11
|
+
// const regex = /^((ht|f)tp(s?):\/\/)?([w]{3}[\.])?/;
|
|
12
|
+
var regex = /^((http(s?)|ftp)\:\/\/)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)(.*)/;
|
|
13
|
+
//console.log(`pipe - value - ${value} is valid url - ${regex.test(value)}`);
|
|
14
|
+
return regex.test(value);
|
|
15
|
+
};
|
|
16
|
+
return IsUrlPipe;
|
|
17
|
+
}());
|
|
18
|
+
IsUrlPipe.decorators = [
|
|
19
|
+
{ type: core.Pipe, args: [{
|
|
20
|
+
name: 'isUrl'
|
|
21
|
+
},] }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This is a text box input component that can be use to
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @class PepTextboxComponent
|
|
29
|
+
* @implements {OnChanges}
|
|
30
|
+
* @implements {OnInit}
|
|
31
|
+
* @implements {OnDestroy}
|
|
32
|
+
*/
|
|
33
|
+
var PepLinkComponent = /** @class */ (function () {
|
|
34
|
+
function PepLinkComponent(fb, customizationService, renderer, element, translate, utilitiesService, isUrlPipe) {
|
|
35
|
+
this.fb = fb;
|
|
36
|
+
this.customizationService = customizationService;
|
|
37
|
+
this.renderer = renderer;
|
|
38
|
+
this.element = element;
|
|
39
|
+
this.translate = translate;
|
|
40
|
+
this.utilitiesService = utilitiesService;
|
|
41
|
+
this.isUrlPipe = isUrlPipe;
|
|
42
|
+
this.dataQa = '';
|
|
43
|
+
this._key = '';
|
|
44
|
+
this._value = '';
|
|
45
|
+
this._formattedValue = null;
|
|
46
|
+
/**
|
|
47
|
+
* The title of the textbox.
|
|
48
|
+
*
|
|
49
|
+
* @memberof PepTextboxComponent
|
|
50
|
+
*/
|
|
51
|
+
this.label = '';
|
|
52
|
+
/**
|
|
53
|
+
* The placeholder (relevant only for children - if parent isn't null).
|
|
54
|
+
*
|
|
55
|
+
* @memberof PepTextboxComponent
|
|
56
|
+
*/
|
|
57
|
+
this.placeholder = '';
|
|
58
|
+
/**
|
|
59
|
+
* The type of the textbox.
|
|
60
|
+
*
|
|
61
|
+
* @type {PepTextboxFieldType}
|
|
62
|
+
* @memberof PepTextboxComponent
|
|
63
|
+
*/
|
|
64
|
+
this.type = 'text';
|
|
65
|
+
/**
|
|
66
|
+
* If the textbox is mandatory
|
|
67
|
+
*
|
|
68
|
+
* @memberof PepTextboxComponent
|
|
69
|
+
*/
|
|
70
|
+
this.mandatory = false;
|
|
71
|
+
// TODO: Check if should remove disabled and keep only readonly.
|
|
72
|
+
/**
|
|
73
|
+
* If the textbox is disabled.
|
|
74
|
+
*
|
|
75
|
+
* @memberof PepTextboxComponent
|
|
76
|
+
*/
|
|
77
|
+
this.disabled = false;
|
|
78
|
+
/**
|
|
79
|
+
* If the textbox is readonly
|
|
80
|
+
*
|
|
81
|
+
* @memberof PepTextboxComponent
|
|
82
|
+
*/
|
|
83
|
+
this.readonly = false;
|
|
84
|
+
this.textColor = '';
|
|
85
|
+
this.xAlignment = ngxLib.DEFAULT_HORIZONTAL_ALIGNMENT;
|
|
86
|
+
this.rowSpan = 1;
|
|
87
|
+
// @Input() lastFocusField: any;
|
|
88
|
+
this.minValue = NaN;
|
|
89
|
+
this.maxValue = NaN;
|
|
90
|
+
this._visible = true;
|
|
91
|
+
this.form = null;
|
|
92
|
+
this.isActive = false;
|
|
93
|
+
this.showTitle = true;
|
|
94
|
+
this.renderTitle = true;
|
|
95
|
+
this.renderError = true;
|
|
96
|
+
this.renderSymbol = true;
|
|
97
|
+
this.layoutType = 'form';
|
|
98
|
+
this.parentFieldKey = null;
|
|
99
|
+
/**
|
|
100
|
+
* The value change event.
|
|
101
|
+
*
|
|
102
|
+
* @type {EventEmitter<string>}
|
|
103
|
+
* @memberof PepTextboxComponent
|
|
104
|
+
*/
|
|
105
|
+
this.valueChange = new core.EventEmitter();
|
|
106
|
+
this.formValidationChange = new core.EventEmitter();
|
|
107
|
+
this.elementClick = new core.EventEmitter();
|
|
108
|
+
this._calculateFormattedValue = true;
|
|
109
|
+
this.controlType = 'link';
|
|
110
|
+
this.standAlone = false;
|
|
111
|
+
this.isInEditMode = false;
|
|
112
|
+
this.isUrl = false;
|
|
113
|
+
this.isInFocus = false;
|
|
114
|
+
}
|
|
115
|
+
Object.defineProperty(PepLinkComponent.prototype, "key", {
|
|
116
|
+
get: function () {
|
|
117
|
+
return this._key;
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* The text box key
|
|
121
|
+
*
|
|
122
|
+
* @memberof PepTextboxComponent
|
|
123
|
+
*/
|
|
124
|
+
set: function (value) {
|
|
125
|
+
this._key = value;
|
|
126
|
+
this.dataQa = value;
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(PepLinkComponent.prototype, "value", {
|
|
132
|
+
get: function () {
|
|
133
|
+
return this._value;
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* The value of the text box.
|
|
137
|
+
*
|
|
138
|
+
* @memberof PepTextboxComponent
|
|
139
|
+
*/
|
|
140
|
+
set: function (value) {
|
|
141
|
+
if (!value) {
|
|
142
|
+
value = '';
|
|
143
|
+
}
|
|
144
|
+
this._value = value;
|
|
145
|
+
if (this._calculateFormattedValue) {
|
|
146
|
+
this.setFormattedValue(value);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
enumerable: false,
|
|
150
|
+
configurable: true
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(PepLinkComponent.prototype, "formattedValue", {
|
|
153
|
+
get: function () {
|
|
154
|
+
return this._formattedValue;
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* The formatted value.
|
|
158
|
+
*
|
|
159
|
+
* @memberof PepTextboxComponent
|
|
160
|
+
*/
|
|
161
|
+
set: function (value) {
|
|
162
|
+
if (!value) {
|
|
163
|
+
value = '';
|
|
164
|
+
}
|
|
165
|
+
if (this._calculateFormattedValue) {
|
|
166
|
+
this._calculateFormattedValue = false;
|
|
167
|
+
}
|
|
168
|
+
this.setFormattedValue(value);
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(PepLinkComponent.prototype, "visible", {
|
|
174
|
+
get: function () {
|
|
175
|
+
return this._visible;
|
|
176
|
+
},
|
|
177
|
+
set: function (visible) {
|
|
178
|
+
this._visible = visible;
|
|
179
|
+
if (visible) {
|
|
180
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
enumerable: false,
|
|
187
|
+
configurable: true
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(PepLinkComponent.prototype, "calculateFormattedValue", {
|
|
190
|
+
get: function () {
|
|
191
|
+
return this._calculateFormattedValue;
|
|
192
|
+
},
|
|
193
|
+
enumerable: false,
|
|
194
|
+
configurable: true
|
|
195
|
+
});
|
|
196
|
+
PepLinkComponent.prototype.setFormattedValue = function (value) {
|
|
197
|
+
if (this._calculateFormattedValue) {
|
|
198
|
+
this._formattedValue = this.isNumberType()
|
|
199
|
+
? this.utilitiesService.formatNumber(value)
|
|
200
|
+
: value;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this._formattedValue = value;
|
|
204
|
+
}
|
|
205
|
+
this.updateFormFieldValue();
|
|
206
|
+
};
|
|
207
|
+
PepLinkComponent.prototype.updateFormFieldValue = function () {
|
|
208
|
+
this.customizationService.updateFormFieldValue(this.form, this.key, this.formattedValue, this.parentFieldKey);
|
|
209
|
+
};
|
|
210
|
+
Object.defineProperty(PepLinkComponent.prototype, "displayValue", {
|
|
211
|
+
get: function () {
|
|
212
|
+
var res = '';
|
|
213
|
+
if (this.type == 'link') {
|
|
214
|
+
res = this.formattedValue;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
res = this.isInFocus ? this.value : this.formattedValue;
|
|
218
|
+
}
|
|
219
|
+
return res;
|
|
220
|
+
},
|
|
221
|
+
enumerable: false,
|
|
222
|
+
configurable: true
|
|
223
|
+
});
|
|
224
|
+
PepLinkComponent.prototype.setDefaultForm = function () {
|
|
225
|
+
var pepField = new ngxLib.PepTextboxField({
|
|
226
|
+
key: this.key,
|
|
227
|
+
value: this.value,
|
|
228
|
+
mandatory: this.mandatory,
|
|
229
|
+
readonly: this.readonly,
|
|
230
|
+
disabled: this.disabled,
|
|
231
|
+
maxFieldCharacters: this.maxFieldCharacters,
|
|
232
|
+
type: this.type,
|
|
233
|
+
minValue: this.minValue,
|
|
234
|
+
maxValue: this.maxValue,
|
|
235
|
+
});
|
|
236
|
+
this.form = this.customizationService.getDefaultFromGroup(pepField, this.renderError);
|
|
237
|
+
};
|
|
238
|
+
PepLinkComponent.prototype.ngOnInit = function () {
|
|
239
|
+
if (this.form === null) {
|
|
240
|
+
this.standAlone = true;
|
|
241
|
+
this.minValue =
|
|
242
|
+
isNaN(this.minValue) && !isNaN(this.maxValue)
|
|
243
|
+
? 0
|
|
244
|
+
: this.minValue;
|
|
245
|
+
this.maxValue =
|
|
246
|
+
isNaN(this.maxValue) && !isNaN(this.minValue)
|
|
247
|
+
? 99999
|
|
248
|
+
: this.maxValue;
|
|
249
|
+
this.setDefaultForm();
|
|
250
|
+
this.renderer.addClass(this.element.nativeElement, ngxLib.PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME);
|
|
251
|
+
if (!this.renderTitle) {
|
|
252
|
+
this.renderer.addClass(this.element.nativeElement, ngxLib.PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
|
|
256
|
+
this.updateFormFieldValue();
|
|
257
|
+
};
|
|
258
|
+
PepLinkComponent.prototype.ngOnChanges = function (changes) {
|
|
259
|
+
if (this.standAlone) {
|
|
260
|
+
this.setDefaultForm();
|
|
261
|
+
}
|
|
262
|
+
this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
|
|
263
|
+
};
|
|
264
|
+
PepLinkComponent.prototype.ngOnDestroy = function () {
|
|
265
|
+
//
|
|
266
|
+
};
|
|
267
|
+
PepLinkComponent.prototype.onFocus = function (event) {
|
|
268
|
+
this.isInFocus = true;
|
|
269
|
+
// select the value in focus (DI-18246 improvement)
|
|
270
|
+
setTimeout(function () {
|
|
271
|
+
var eventTarget = event.target || event.srcElement;
|
|
272
|
+
if (eventTarget) {
|
|
273
|
+
eventTarget.select();
|
|
274
|
+
}
|
|
275
|
+
}, 0);
|
|
276
|
+
};
|
|
277
|
+
PepLinkComponent.prototype.isNumberType = function () {
|
|
278
|
+
return (this.type === 'percentage' ||
|
|
279
|
+
this.type === 'currency' ||
|
|
280
|
+
this.type === 'int' ||
|
|
281
|
+
this.type === 'real');
|
|
282
|
+
};
|
|
283
|
+
PepLinkComponent.prototype.isValueValid = function (value) {
|
|
284
|
+
var res = false;
|
|
285
|
+
if (this.isNumberType()) {
|
|
286
|
+
if (value === '') {
|
|
287
|
+
res = this.mandatory ? false : true;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
var numberValue = this.utilitiesService.coerceNumberProperty(value);
|
|
291
|
+
res =
|
|
292
|
+
numberValue >= this.minValue &&
|
|
293
|
+
numberValue <= this.maxValue;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
// TODO: Maybe need to check other types.
|
|
298
|
+
res = true;
|
|
299
|
+
}
|
|
300
|
+
return res;
|
|
301
|
+
};
|
|
302
|
+
PepLinkComponent.prototype.isDifferentValue = function (value) {
|
|
303
|
+
var res = false;
|
|
304
|
+
if (this.isNumberType()) {
|
|
305
|
+
if (this.value === '' || value === '') {
|
|
306
|
+
res = true;
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
var currentValue = this.utilitiesService.coerceNumberProperty(this.value);
|
|
310
|
+
var newValue = this.utilitiesService.coerceNumberProperty(value);
|
|
311
|
+
res = currentValue !== newValue;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
res = true;
|
|
316
|
+
}
|
|
317
|
+
return res;
|
|
318
|
+
};
|
|
319
|
+
PepLinkComponent.prototype.onChange = function (e) {
|
|
320
|
+
var value = e.target ? e.target.value : e;
|
|
321
|
+
this.valueChange.emit(value);
|
|
322
|
+
};
|
|
323
|
+
PepLinkComponent.prototype.onBlur = function (e) {
|
|
324
|
+
this.isInFocus = false;
|
|
325
|
+
var value = e.target ? e.target.value : e;
|
|
326
|
+
if (value !== this.value && this.isDifferentValue(value)) {
|
|
327
|
+
// If renderError is false and the new value is not valid.
|
|
328
|
+
if (!this.renderError && !this.isValueValid(value)) {
|
|
329
|
+
this.renderer.setProperty(this.input.nativeElement, 'value', this.value);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
this.value = value;
|
|
333
|
+
// If the user is setting the formatted value then set the value till the user format it and return it back.
|
|
334
|
+
if (!this._calculateFormattedValue) {
|
|
335
|
+
this._formattedValue = value;
|
|
336
|
+
}
|
|
337
|
+
this.valueChange.emit(value);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (this.isInEditMode) {
|
|
341
|
+
this.isInEditMode = false;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
PepLinkComponent.prototype.onClick = function () {
|
|
345
|
+
var output = {
|
|
346
|
+
key: this.key,
|
|
347
|
+
value: this.value,
|
|
348
|
+
controlType: this.controlType
|
|
349
|
+
};
|
|
350
|
+
this.elementClick.emit(output);
|
|
351
|
+
};
|
|
352
|
+
PepLinkComponent.prototype.anchorClicked = function () {
|
|
353
|
+
var currentValue = this.value;
|
|
354
|
+
if (currentValue.trim().length > 0) {
|
|
355
|
+
switch (this.type) {
|
|
356
|
+
case 'email':
|
|
357
|
+
window.open('mailto:' + currentValue, 'email');
|
|
358
|
+
break;
|
|
359
|
+
case 'phone':
|
|
360
|
+
window.open('tel:' + currentValue, 'tel');
|
|
361
|
+
break;
|
|
362
|
+
case 'link':
|
|
363
|
+
var output = {
|
|
364
|
+
key: this.key,
|
|
365
|
+
value: this.value,
|
|
366
|
+
controlType: this.controlType
|
|
367
|
+
};
|
|
368
|
+
this.elementClick.emit(output);
|
|
369
|
+
if (this.isUrlPipe.transform(currentValue)) {
|
|
370
|
+
window.open(currentValue);
|
|
371
|
+
}
|
|
372
|
+
break;
|
|
373
|
+
default:
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
PepLinkComponent.prototype.cardTemplateClicked = function (event) {
|
|
379
|
+
var _this = this;
|
|
380
|
+
this.isInEditMode = true;
|
|
381
|
+
setTimeout(function () {
|
|
382
|
+
_this.input.nativeElement.focus();
|
|
383
|
+
}, 0);
|
|
384
|
+
};
|
|
385
|
+
return PepLinkComponent;
|
|
386
|
+
}());
|
|
387
|
+
PepLinkComponent.decorators = [
|
|
388
|
+
{ type: core.Component, args: [{
|
|
389
|
+
selector: 'pep-link',
|
|
390
|
+
template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"value.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <input #input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [formControlName]=\"key\" [type]=\"type\" [value]=\"displayValue\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\" [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0}\" />\n\n <span *ngIf=\"disabled && formattedValue?.length > 0\" class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \">\n {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\">\n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherError\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </mat-error>\n\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template>\n\n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" (blur)=\"onBlur($event)\" (change)=\"onChange($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }} </span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a *ngIf=\"formattedValue != null && (value ? value : formattedValue) | isUrl\" [id]=\"key\"\n class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" title=\"{{ formattedValue }}\"\n target=\"_blank\" href=\"{{ value ? value : formattedValue }}\" (click)=\"onClick()\">{{\n formattedValue }}</a>\n <a *ngIf=\"formattedValue != null && !((value ? value : formattedValue) | isUrl)\" [id]=\"key\"\n class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" title=\"{{ formattedValue }}\"\n href=\"javascript:void(0)\" (click)=\"onClick()\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\"> </span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>",
|
|
391
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
392
|
+
styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}"]
|
|
393
|
+
},] }
|
|
394
|
+
];
|
|
395
|
+
PepLinkComponent.ctorParameters = function () { return [
|
|
396
|
+
{ type: forms.FormBuilder },
|
|
397
|
+
{ type: ngxLib.PepCustomizationService },
|
|
398
|
+
{ type: core.Renderer2 },
|
|
399
|
+
{ type: core.ElementRef },
|
|
400
|
+
{ type: core$1.TranslateService },
|
|
401
|
+
{ type: ngxLib.PepUtilitiesService },
|
|
402
|
+
{ type: IsUrlPipe }
|
|
403
|
+
]; };
|
|
404
|
+
PepLinkComponent.propDecorators = {
|
|
405
|
+
dataQa: [{ type: core.HostBinding, args: ['attr.data-qa',] }],
|
|
406
|
+
key: [{ type: core.Input }],
|
|
407
|
+
value: [{ type: core.Input }],
|
|
408
|
+
formattedValue: [{ type: core.Input }],
|
|
409
|
+
label: [{ type: core.Input }],
|
|
410
|
+
placeholder: [{ type: core.Input }],
|
|
411
|
+
type: [{ type: core.Input }],
|
|
412
|
+
mandatory: [{ type: core.Input }],
|
|
413
|
+
disabled: [{ type: core.Input }],
|
|
414
|
+
readonly: [{ type: core.Input }],
|
|
415
|
+
maxFieldCharacters: [{ type: core.Input }],
|
|
416
|
+
textColor: [{ type: core.Input }],
|
|
417
|
+
xAlignment: [{ type: core.Input }],
|
|
418
|
+
rowSpan: [{ type: core.Input }],
|
|
419
|
+
minValue: [{ type: core.Input }],
|
|
420
|
+
maxValue: [{ type: core.Input }],
|
|
421
|
+
visible: [{ type: core.Input }],
|
|
422
|
+
form: [{ type: core.Input }],
|
|
423
|
+
isActive: [{ type: core.Input }],
|
|
424
|
+
showTitle: [{ type: core.Input }],
|
|
425
|
+
renderTitle: [{ type: core.Input }],
|
|
426
|
+
renderError: [{ type: core.Input }],
|
|
427
|
+
renderSymbol: [{ type: core.Input }],
|
|
428
|
+
layoutType: [{ type: core.Input }],
|
|
429
|
+
parentFieldKey: [{ type: core.Input }],
|
|
430
|
+
valueChange: [{ type: core.Output }],
|
|
431
|
+
formValidationChange: [{ type: core.Output }],
|
|
432
|
+
elementClick: [{ type: core.Output }],
|
|
433
|
+
input: [{ type: core.ViewChild, args: ['input',] }]
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
var PepLinkModule = /** @class */ (function () {
|
|
437
|
+
function PepLinkModule(pepIconRegistry) {
|
|
438
|
+
this.pepIconRegistry = pepIconRegistry;
|
|
439
|
+
this.pepIconRegistry.registerIcons([icon.pepIconSystemEdit]);
|
|
440
|
+
}
|
|
441
|
+
return PepLinkModule;
|
|
442
|
+
}());
|
|
443
|
+
PepLinkModule.decorators = [
|
|
444
|
+
{ type: core.NgModule, args: [{
|
|
445
|
+
imports: [
|
|
446
|
+
common.CommonModule,
|
|
447
|
+
forms.ReactiveFormsModule,
|
|
448
|
+
// Material modules,
|
|
449
|
+
core$2.MatCommonModule,
|
|
450
|
+
button.MatButtonModule,
|
|
451
|
+
formField.MatFormFieldModule,
|
|
452
|
+
input.MatInputModule,
|
|
453
|
+
icon$1.MatIconModule,
|
|
454
|
+
// ngx-lib modules
|
|
455
|
+
ngxLib.PepNgxLibModule,
|
|
456
|
+
icon.PepIconModule,
|
|
457
|
+
fieldTitle.PepFieldTitleModule,
|
|
458
|
+
textboxIcon.PepTextboxIconModule,
|
|
459
|
+
],
|
|
460
|
+
exports: [PepLinkComponent],
|
|
461
|
+
declarations: [
|
|
462
|
+
PepLinkComponent,
|
|
463
|
+
// PepTextboxValidationDirective,
|
|
464
|
+
IsUrlPipe
|
|
465
|
+
],
|
|
466
|
+
providers: [IsUrlPipe]
|
|
467
|
+
},] }
|
|
468
|
+
];
|
|
469
|
+
PepLinkModule.ctorParameters = function () { return [
|
|
470
|
+
{ type: icon.PepIconRegistry }
|
|
471
|
+
]; };
|
|
472
|
+
|
|
473
|
+
/*
|
|
474
|
+
* Public API Surface of ngx-lib/link
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Generated bundle index. Do not edit.
|
|
479
|
+
*/
|
|
480
|
+
|
|
481
|
+
exports.PepLinkComponent = PepLinkComponent;
|
|
482
|
+
exports.PepLinkModule = PepLinkModule;
|
|
483
|
+
exports.ɵa = IsUrlPipe;
|
|
484
|
+
|
|
485
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
486
|
+
|
|
487
|
+
})));
|
|
488
|
+
//# sourceMappingURL=pepperi-addons-ngx-lib-link.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-link.umd.js","sources":["../../../projects/ngx-lib/link/link.pipes.ts","../../../projects/ngx-lib/link/link.component.ts","../../../projects/ngx-lib/link/link.module.ts","../../../projects/ngx-lib/link/public-api.ts","../../../projects/ngx-lib/link/pepperi-addons-ngx-lib-link.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'isUrl'\n})\nexport class IsUrlPipe implements PipeTransform {\n transform(value: string): boolean {\n // const regex = /^((ht|f)tp(s?):\\/\\/)?([w]{3}[\\.])?/;\n const regex = /^((http(s?)|ftp)\\:\\/\\/)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)(.*)/;\n //console.log(`pipe - value - ${value} is valid url - ${regex.test(value)}`);\n return regex.test(value);\n }\n}","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ElementRef,\n ViewChild,\n Renderer2,\n OnDestroy,\n ChangeDetectorRef,\n HostBinding,\n} from '@angular/core';\nimport { FormGroup, FormBuilder } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepTextboxFieldType,\n PepTextboxField,\n PepFieldBase,\n PepUtilitiesService,\n IPepFieldClickEvent,\n} from '@pepperi-addons/ngx-lib';\nimport { IsUrlPipe } from './link.pipes';\n\n/**\n * This is a text box input component that can be use to\n *\n * @export\n * @class PepTextboxComponent\n * @implements {OnChanges}\n * @implements {OnInit}\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepLinkComponent implements OnChanges, OnInit, OnDestroy {\n\n @HostBinding('attr.data-qa') dataQa = '';\n\n private _key = '';\n /**\n * The text box key\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set key(value) {\n this._key = value;\n this.dataQa = value;\n }\n get key(): string {\n return this._key;\n }\n\n private _value = '';\n /**\n * The value of the text box.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n\n if (this._calculateFormattedValue) {\n this.setFormattedValue(value);\n }\n }\n get value(): string {\n return this._value;\n }\n\n private _formattedValue = null;\n /**\n * The formatted value.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set formattedValue(value: string) {\n if (!value) {\n value = '';\n }\n\n if (this._calculateFormattedValue) {\n this._calculateFormattedValue = false;\n }\n\n this.setFormattedValue(value);\n }\n get formattedValue(): string {\n return this._formattedValue;\n }\n\n /**\n * The title of the textbox.\n *\n * @memberof PepTextboxComponent\n */\n @Input() label = '';\n\n /**\n * The placeholder (relevant only for children - if parent isn't null).\n *\n * @memberof PepTextboxComponent\n */\n @Input() placeholder = '';\n\n /**\n * The type of the textbox.\n *\n * @type {PepTextboxFieldType}\n * @memberof PepTextboxComponent\n */\n @Input() type: PepTextboxFieldType = 'text';\n\n /**\n * If the textbox is mandatory\n *\n * @memberof PepTextboxComponent\n */\n @Input() mandatory = false;\n\n // TODO: Check if should remove disabled and keep only readonly.\n /**\n * If the textbox is disabled.\n *\n * @memberof PepTextboxComponent\n */\n @Input() disabled = false;\n\n /**\n * If the textbox is readonly\n *\n * @memberof PepTextboxComponent\n */\n @Input() readonly = false;\n @Input() maxFieldCharacters: number;\n @Input() textColor = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n // @Input() lastFocusField: any;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _visible = true;\n @Input()\n set visible(visible: boolean) {\n this._visible = visible;\n if (visible) {\n this.renderer.removeClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n } else {\n this.renderer.addClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n\n @Input() form: FormGroup = null;\n @Input() isActive = false;\n @Input() showTitle = true;\n @Input() renderTitle = true;\n @Input() renderError = true;\n @Input() renderSymbol = true;\n @Input() layoutType: PepLayoutType = 'form';\n @Input() parentFieldKey: string = null;\n\n /**\n * The value change event.\n *\n * @type {EventEmitter<string>}\n * @memberof PepTextboxComponent\n */\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n @Output()\n formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n @ViewChild('input') input: ElementRef;\n\n private _calculateFormattedValue = true;\n get calculateFormattedValue(): boolean {\n return this._calculateFormattedValue;\n }\n\n controlType = 'link';\n\n standAlone = false;\n isInEditMode = false;\n isInFocus: boolean;\n isUrl = false;\n\n constructor(\n public fb: FormBuilder,\n private customizationService: PepCustomizationService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService,\n private utilitiesService: PepUtilitiesService,\n private isUrlPipe: IsUrlPipe\n ) {\n this.isInFocus = false;\n }\n\n private setFormattedValue(value: string) {\n if (this._calculateFormattedValue) {\n this._formattedValue = this.isNumberType()\n ? this.utilitiesService.formatNumber(value)\n : value;\n } else {\n this._formattedValue = value;\n }\n\n this.updateFormFieldValue();\n }\n\n private updateFormFieldValue() {\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.formattedValue,\n this.parentFieldKey\n );\n }\n\n get displayValue(): string {\n let res = '';\n\n if (this.type == 'link') {\n res = this.formattedValue;\n } else {\n res = this.isInFocus ? this.value : this.formattedValue;\n }\n\n return res;\n }\n\n private setDefaultForm(): void {\n const pepField = new PepTextboxField({\n key: this.key,\n value: this.value,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n maxFieldCharacters: this.maxFieldCharacters,\n type: this.type,\n minValue: this.minValue,\n maxValue: this.maxValue,\n });\n this.form = this.customizationService.getDefaultFromGroup(\n pepField,\n this.renderError\n );\n }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n\n this.minValue =\n isNaN(this.minValue) && !isNaN(this.maxValue)\n ? 0\n : this.minValue;\n this.maxValue =\n isNaN(this.maxValue) && !isNaN(this.minValue)\n ? 99999\n : this.maxValue;\n\n this.setDefaultForm();\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n\n if (!this.renderTitle) {\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME\n );\n }\n }\n\n this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n\n this.updateFormFieldValue();\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n }\n\n ngOnDestroy(): void {\n //\n }\n\n onFocus(event: any): void {\n this.isInFocus = true;\n\n // select the value in focus (DI-18246 improvement)\n setTimeout(() => {\n const eventTarget = event.target || event.srcElement;\n if (eventTarget) {\n eventTarget.select();\n }\n }, 0);\n }\n\n isNumberType(): boolean {\n return (\n this.type === 'percentage' ||\n this.type === 'currency' ||\n this.type === 'int' ||\n this.type === 'real'\n );\n }\n\n isValueValid(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (value === '') {\n res = this.mandatory ? false : true;\n } else {\n const numberValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n res =\n numberValue >= this.minValue &&\n numberValue <= this.maxValue;\n }\n } else {\n // TODO: Maybe need to check other types.\n res = true;\n }\n\n return res;\n }\n\n isDifferentValue(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (this.value === '' || value === '') {\n res = true;\n } else {\n const currentValue = this.utilitiesService.coerceNumberProperty(\n this.value\n );\n const newValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n\n res = currentValue !== newValue;\n }\n } else {\n res = true;\n }\n\n return res;\n }\n\n onChange(e: any): void {\n const value = e.target ? e.target.value : e;\n\n this.valueChange.emit(value);\n }\n\n onBlur(e: any): void {\n this.isInFocus = false;\n const value = e.target ? e.target.value : e;\n if (value !== this.value && this.isDifferentValue(value)) {\n // If renderError is false and the new value is not valid.\n if (!this.renderError && !this.isValueValid(value)) {\n this.renderer.setProperty(\n this.input.nativeElement,\n 'value',\n this.value\n );\n } else {\n this.value = value;\n\n // If the user is setting the formatted value then set the value till the user format it and return it back.\n if (!this._calculateFormattedValue) {\n this._formattedValue = value;\n }\n\n this.valueChange.emit(value);\n }\n }\n\n if (this.isInEditMode) {\n this.isInEditMode = false;\n }\n }\n\n onClick() {\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n }\n\n anchorClicked(): void {\n const currentValue = this.value;\n if (currentValue.trim().length > 0) {\n switch (this.type) {\n case 'email':\n window.open('mailto:' + currentValue, 'email');\n break;\n case 'phone':\n window.open('tel:' + currentValue, 'tel');\n break;\n case 'link':\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n if (this.isUrlPipe.transform(currentValue)) {\n window.open(currentValue);\n }\n break;\n default:\n break;\n }\n }\n }\n\n cardTemplateClicked(event: any): void {\n this.isInEditMode = true;\n\n setTimeout(() => {\n this.input.nativeElement.focus();\n }, 0);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemEdit,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepTextboxIconModule } from '@pepperi-addons/ngx-lib/textbox-icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepLinkComponent } from './link.component';\n//import { PepTextboxValidationDirective } from './textbox-validation.directive';\n\nimport { IsUrlPipe } from './link.pipes';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepTextboxIconModule,\n ],\n exports: [PepLinkComponent],\n declarations: [\n PepLinkComponent,\n // PepTextboxValidationDirective,\n IsUrlPipe\n ],\n providers: [IsUrlPipe]\n})\nexport class PepLinkModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemEdit]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/link\n */\nexport * from './link.module';\nexport * from './link.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {IsUrlPipe as ɵa} from './link.pipes';"],"names":["Pipe","DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepTextboxField","PepCustomizationService","Component","ChangeDetectionStrategy","FormBuilder","Renderer2","ElementRef","TranslateService","PepUtilitiesService","HostBinding","Input","Output","ViewChild","pepIconSystemEdit","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatButtonModule","MatFormFieldModule","MatInputModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepTextboxIconModule","PepIconRegistry"],"mappings":";;;;;;;QAKA;;QACI,6BAAS,GAAT,UAAU,KAAa;;YAEnB,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;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAACC,sBAAiB,CAAC,CAAC,CAAC;SAC3D;;;;gBA3BJC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,sBAAe;wBACfC,4BAAkB;wBAClBC,oBAAc;wBACdC,oBAAa;;wBAEbC,sBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;wBACnBC,gCAAoB;qBACvB;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE;wBACV,gBAAgB;;wBAEhB,SAAS;qBACZ;oBACD,SAAS,EAAE,CAAC,SAAS,CAAC;iBACzB;;;gBAlCGC,oBAAe;;;ICbnB;;;;ICAA;;;;;;;;;;;;;;"}
|
|
@@ -2310,16 +2310,17 @@
|
|
|
2310
2310
|
var _this = this;
|
|
2311
2311
|
if (isForEdit === void 0) { isForEdit = false; }
|
|
2312
2312
|
var res = new PepSelectionData();
|
|
2313
|
+
var selectionType = 1;
|
|
2314
|
+
var items = [];
|
|
2315
|
+
var itemTypes = [];
|
|
2313
2316
|
if (this.selectionTypeForActions === 'single') {
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2317
|
+
if (this.selectedItemId.length > 0) {
|
|
2318
|
+
var tmp = this.selectedItemId.split(this.SEPARATOR);
|
|
2319
|
+
items.push(tmp[0]);
|
|
2320
|
+
itemTypes.push(tmp[1]);
|
|
2321
|
+
}
|
|
2318
2322
|
}
|
|
2319
2323
|
else if (this.selectionTypeForActions === 'multi') {
|
|
2320
|
-
var items_2 = [];
|
|
2321
|
-
var itemTypes_1 = [];
|
|
2322
|
-
var selectionType = 1;
|
|
2323
2324
|
var currentList_1 = [];
|
|
2324
2325
|
// For edit - only the selected items.
|
|
2325
2326
|
if (isForEdit) {
|
|
@@ -2346,14 +2347,14 @@
|
|
|
2346
2347
|
currentList_1.forEach(function (item) {
|
|
2347
2348
|
var tmp = item.split(_this.SEPARATOR);
|
|
2348
2349
|
if (tmp.length === 2) {
|
|
2349
|
-
|
|
2350
|
-
|
|
2350
|
+
items.push(tmp[0]);
|
|
2351
|
+
itemTypes.push(tmp[1]);
|
|
2351
2352
|
}
|
|
2352
2353
|
});
|
|
2353
|
-
res.selectionType = selectionType;
|
|
2354
|
-
res.rows = items_2;
|
|
2355
|
-
res.rowTypes = itemTypes_1;
|
|
2356
2354
|
}
|
|
2355
|
+
res.selectionType = selectionType;
|
|
2356
|
+
res.rows = items;
|
|
2357
|
+
res.rowTypes = itemTypes;
|
|
2357
2358
|
return res;
|
|
2358
2359
|
};
|
|
2359
2360
|
PepListComponent.prototype.getIsItemEditable = function (uid) {
|