ng-configcat-publicapi-ui 2.3.1 → 2.5.0

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 (88) hide show
  1. package/README.md +15 -15
  2. package/{esm2015/lib/_models/index.js → esm2020/lib/_models/index.mjs} +3 -3
  3. package/esm2020/lib/_models/settingValuesModel.mjs +2 -0
  4. package/{esm2015/lib/_models/updateSettingValuesModel.js → esm2020/lib/_models/updateSettingValuesModel.mjs} +2 -2
  5. package/esm2020/lib/_services/form-helper.mjs +21 -0
  6. package/{esm2015/lib/_services/index.js → esm2020/lib/_services/index.mjs} +2 -2
  7. package/esm2020/lib/_services/public-api.service.mjs +68 -0
  8. package/esm2020/lib/_services/setting-list-form-helper.mjs +152 -0
  9. package/esm2020/lib/authorization/authorization.component.mjs +50 -0
  10. package/esm2020/lib/base/base.component.mjs +45 -0
  11. package/esm2020/lib/configuration.mjs +13 -0
  12. package/esm2020/lib/dialogs/concurrent-dialog/concurrent-dialog.component.mjs +25 -0
  13. package/esm2020/lib/dialogs/expand-dialog/expand-dialog.component.mjs +77 -0
  14. package/esm2020/lib/dialogs/reason-dialog/reason-dialog.component.mjs +36 -0
  15. package/esm2020/lib/dialogs/save-snackbar/save-snackbar.component.mjs +14 -0
  16. package/esm2020/lib/ng-configcat-publicapi-ui.module.mjs +160 -0
  17. package/esm2020/lib/selects/config-select/config-select.component.mjs +56 -0
  18. package/esm2020/lib/selects/environment-select/environment-select.component.mjs +43 -0
  19. package/esm2020/lib/selects/product-select/product-select.component.mjs +36 -0
  20. package/esm2020/lib/selects/setting-select/setting-select.component.mjs +43 -0
  21. package/esm2020/lib/setting-item/setting-item.component.mjs +129 -0
  22. package/esm2020/lib/setting-list/setting/rollout-percentage-items/rollout-percentage-items.component.mjs +81 -0
  23. package/esm2020/lib/setting-list/setting/rollout-rules/rollout-rules.component.mjs +295 -0
  24. package/esm2020/lib/setting-list/setting/setting.component.mjs +137 -0
  25. package/esm2020/lib/setting-list/setting/value/value.component.mjs +32 -0
  26. package/esm2020/lib/setting-list/setting-list.component.mjs +200 -0
  27. package/esm2020/ng-configcat-publicapi-ui.mjs +5 -0
  28. package/{esm2015/public-api.js → esm2020/public-api.mjs} +12 -12
  29. package/fesm2015/ng-configcat-publicapi-ui.mjs +1588 -0
  30. package/fesm2015/ng-configcat-publicapi-ui.mjs.map +1 -0
  31. package/fesm2020/ng-configcat-publicapi-ui.mjs +1569 -0
  32. package/fesm2020/ng-configcat-publicapi-ui.mjs.map +1 -0
  33. package/lib/_models/index.d.ts +2 -2
  34. package/lib/_models/settingValuesModel.d.ts +11 -11
  35. package/lib/_models/updateSettingValuesModel.d.ts +7 -7
  36. package/lib/_services/form-helper.d.ts +4 -4
  37. package/lib/_services/index.d.ts +1 -1
  38. package/lib/_services/public-api.service.d.ts +19 -15
  39. package/lib/_services/setting-list-form-helper.d.ts +17 -14
  40. package/lib/authorization/authorization.component.d.ts +18 -15
  41. package/lib/base/base.component.d.ts +17 -13
  42. package/lib/configuration.d.ts +8 -5
  43. package/lib/dialogs/concurrent-dialog/concurrent-dialog.component.d.ts +12 -9
  44. package/lib/dialogs/expand-dialog/expand-dialog.component.d.ts +24 -20
  45. package/lib/dialogs/reason-dialog/reason-dialog.component.d.ts +15 -12
  46. package/lib/dialogs/save-snackbar/save-snackbar.component.d.ts +8 -5
  47. package/lib/ng-configcat-publicapi-ui.module.d.ts +44 -6
  48. package/lib/selects/config-select/config-select.component.d.ts +17 -14
  49. package/lib/selects/environment-select/environment-select.component.d.ts +17 -14
  50. package/lib/selects/product-select/product-select.component.d.ts +14 -11
  51. package/lib/selects/setting-select/setting-select.component.d.ts +17 -14
  52. package/lib/setting-item/setting-item.component.d.ts +37 -31
  53. package/lib/setting-list/setting/rollout-percentage-items/rollout-percentage-items.component.d.ts +27 -22
  54. package/lib/setting-list/setting/rollout-rules/rollout-rules.component.d.ts +60 -46
  55. package/lib/setting-list/setting/setting.component.d.ts +43 -37
  56. package/lib/setting-list/setting/value/value.component.d.ts +19 -16
  57. package/lib/setting-list/setting-list.component.d.ts +50 -42
  58. package/ng-configcat-publicapi-ui.d.ts +5 -18
  59. package/package.json +26 -21
  60. package/public-api.d.ts +8 -8
  61. package/bundles/ng-configcat-publicapi-ui.umd.js +0 -1826
  62. package/bundles/ng-configcat-publicapi-ui.umd.js.map +0 -1
  63. package/esm2015/lib/_models/settingValuesModel.js +0 -2
  64. package/esm2015/lib/_services/form-helper.js +0 -21
  65. package/esm2015/lib/_services/public-api.service.js +0 -71
  66. package/esm2015/lib/_services/setting-list-form-helper.js +0 -128
  67. package/esm2015/lib/authorization/authorization.component.js +0 -49
  68. package/esm2015/lib/base/base.component.js +0 -40
  69. package/esm2015/lib/configuration.js +0 -10
  70. package/esm2015/lib/dialogs/concurrent-dialog/concurrent-dialog.component.js +0 -26
  71. package/esm2015/lib/dialogs/expand-dialog/expand-dialog.component.js +0 -70
  72. package/esm2015/lib/dialogs/reason-dialog/reason-dialog.component.js +0 -35
  73. package/esm2015/lib/dialogs/save-snackbar/save-snackbar.component.js +0 -15
  74. package/esm2015/lib/ng-configcat-publicapi-ui.module.js +0 -100
  75. package/esm2015/lib/selects/config-select/config-select.component.js +0 -48
  76. package/esm2015/lib/selects/environment-select/environment-select.component.js +0 -40
  77. package/esm2015/lib/selects/product-select/product-select.component.js +0 -34
  78. package/esm2015/lib/selects/setting-select/setting-select.component.js +0 -40
  79. package/esm2015/lib/setting-item/setting-item.component.js +0 -106
  80. package/esm2015/lib/setting-list/setting/rollout-percentage-items/rollout-percentage-items.component.js +0 -69
  81. package/esm2015/lib/setting-list/setting/rollout-rules/rollout-rules.component.js +0 -260
  82. package/esm2015/lib/setting-list/setting/setting.component.js +0 -112
  83. package/esm2015/lib/setting-list/setting/value/value.component.js +0 -31
  84. package/esm2015/lib/setting-list/setting-list.component.js +0 -179
  85. package/esm2015/ng-configcat-publicapi-ui.js +0 -19
  86. package/fesm2015/ng-configcat-publicapi-ui.js +0 -1415
  87. package/fesm2015/ng-configcat-publicapi-ui.js.map +0 -1
  88. package/ng-configcat-publicapi-ui.metadata.json +0 -1
@@ -1,1826 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('ng-configcat-publicapi'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/common'), require('@angular/material/form-field'), require('@angular/material/core'), require('@angular/material/select'), require('@angular/material/button'), require('@angular/material/input'), require('@angular/material/dialog'), require('@angular/cdk/drag-drop'), require('semver'), require('@angular/material/snack-bar'), require('@angular/platform-browser/animations'), require('@angular/material/icon'), require('@angular/material/tooltip'), require('@angular/material/chips'), require('@angular/material/autocomplete'), require('@angular/router'), require('@angular/material/menu')) :
3
- typeof define === 'function' && define.amd ? define('ng-configcat-publicapi-ui', ['exports', '@angular/core', '@angular/common/http', 'ng-configcat-publicapi', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/common', '@angular/material/form-field', '@angular/material/core', '@angular/material/select', '@angular/material/button', '@angular/material/input', '@angular/material/dialog', '@angular/cdk/drag-drop', 'semver', '@angular/material/snack-bar', '@angular/platform-browser/animations', '@angular/material/icon', '@angular/material/tooltip', '@angular/material/chips', '@angular/material/autocomplete', '@angular/router', '@angular/material/menu'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-configcat-publicapi-ui"] = {}, global.ng.core, global.ng.common.http, global.ngConfigcatPublicapi, global.rxjs, global.rxjs.operators, global.ng.forms, global.ng.common, global.ng.material.formField, global.ng.material.core, global.ng.material.select, global.ng.material.button, global.ng.material.input, global.ng.material.dialog, global.ng.cdk.dragDrop, global.semver, global.ng.material.snackBar, global.ng.platformBrowser.animations, global.ng.material.icon, global.ng.material.tooltip, global.ng.material.chips, global.ng.material.autocomplete, global.ng.router, global.ng.material.menu));
5
- })(this, (function (exports, i0, i1, ngConfigcatPublicapi, rxjs, operators, i1$1, common, formField, core, select, button, input, dialog, dragDrop, semver, snackBar, animations, icon, tooltip, chips, autocomplete, router, menu) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
28
- var semver__namespace = /*#__PURE__*/_interopNamespace(semver);
29
-
30
- /*! *****************************************************************************
31
- Copyright (c) Microsoft Corporation.
32
-
33
- Permission to use, copy, modify, and/or distribute this software for any
34
- purpose with or without fee is hereby granted.
35
-
36
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
- PERFORMANCE OF THIS SOFTWARE.
43
- ***************************************************************************** */
44
- /* global Reflect, Promise */
45
- var extendStatics = function (d, b) {
46
- extendStatics = Object.setPrototypeOf ||
47
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
48
- function (d, b) { for (var p in b)
49
- if (Object.prototype.hasOwnProperty.call(b, p))
50
- d[p] = b[p]; };
51
- return extendStatics(d, b);
52
- };
53
- function __extends(d, b) {
54
- if (typeof b !== "function" && b !== null)
55
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
56
- extendStatics(d, b);
57
- function __() { this.constructor = d; }
58
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
59
- }
60
- var __assign = function () {
61
- __assign = Object.assign || function __assign(t) {
62
- for (var s, i = 1, n = arguments.length; i < n; i++) {
63
- s = arguments[i];
64
- for (var p in s)
65
- if (Object.prototype.hasOwnProperty.call(s, p))
66
- t[p] = s[p];
67
- }
68
- return t;
69
- };
70
- return __assign.apply(this, arguments);
71
- };
72
- function __rest(s, e) {
73
- var t = {};
74
- for (var p in s)
75
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
76
- t[p] = s[p];
77
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
78
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
79
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
80
- t[p[i]] = s[p[i]];
81
- }
82
- return t;
83
- }
84
- function __decorate(decorators, target, key, desc) {
85
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
86
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
87
- r = Reflect.decorate(decorators, target, key, desc);
88
- else
89
- for (var i = decorators.length - 1; i >= 0; i--)
90
- if (d = decorators[i])
91
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
92
- return c > 3 && r && Object.defineProperty(target, key, r), r;
93
- }
94
- function __param(paramIndex, decorator) {
95
- return function (target, key) { decorator(target, key, paramIndex); };
96
- }
97
- function __metadata(metadataKey, metadataValue) {
98
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
99
- return Reflect.metadata(metadataKey, metadataValue);
100
- }
101
- function __awaiter(thisArg, _arguments, P, generator) {
102
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103
- return new (P || (P = Promise))(function (resolve, reject) {
104
- function fulfilled(value) { try {
105
- step(generator.next(value));
106
- }
107
- catch (e) {
108
- reject(e);
109
- } }
110
- function rejected(value) { try {
111
- step(generator["throw"](value));
112
- }
113
- catch (e) {
114
- reject(e);
115
- } }
116
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
117
- step((generator = generator.apply(thisArg, _arguments || [])).next());
118
- });
119
- }
120
- function __generator(thisArg, body) {
121
- var _ = { label: 0, sent: function () { if (t[0] & 1)
122
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
123
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
124
- function verb(n) { return function (v) { return step([n, v]); }; }
125
- function step(op) {
126
- if (f)
127
- throw new TypeError("Generator is already executing.");
128
- while (_)
129
- try {
130
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
131
- return t;
132
- if (y = 0, t)
133
- op = [op[0] & 2, t.value];
134
- switch (op[0]) {
135
- case 0:
136
- case 1:
137
- t = op;
138
- break;
139
- case 4:
140
- _.label++;
141
- return { value: op[1], done: false };
142
- case 5:
143
- _.label++;
144
- y = op[1];
145
- op = [0];
146
- continue;
147
- case 7:
148
- op = _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- default:
152
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
153
- _ = 0;
154
- continue;
155
- }
156
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
157
- _.label = op[1];
158
- break;
159
- }
160
- if (op[0] === 6 && _.label < t[1]) {
161
- _.label = t[1];
162
- t = op;
163
- break;
164
- }
165
- if (t && _.label < t[2]) {
166
- _.label = t[2];
167
- _.ops.push(op);
168
- break;
169
- }
170
- if (t[2])
171
- _.ops.pop();
172
- _.trys.pop();
173
- continue;
174
- }
175
- op = body.call(thisArg, _);
176
- }
177
- catch (e) {
178
- op = [6, e];
179
- y = 0;
180
- }
181
- finally {
182
- f = t = 0;
183
- }
184
- if (op[0] & 5)
185
- throw op[1];
186
- return { value: op[0] ? op[1] : void 0, done: true };
187
- }
188
- }
189
- var __createBinding = Object.create ? (function (o, m, k, k2) {
190
- if (k2 === undefined)
191
- k2 = k;
192
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
193
- }) : (function (o, m, k, k2) {
194
- if (k2 === undefined)
195
- k2 = k;
196
- o[k2] = m[k];
197
- });
198
- function __exportStar(m, o) {
199
- for (var p in m)
200
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
201
- __createBinding(o, m, p);
202
- }
203
- function __values(o) {
204
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
205
- if (m)
206
- return m.call(o);
207
- if (o && typeof o.length === "number")
208
- return {
209
- next: function () {
210
- if (o && i >= o.length)
211
- o = void 0;
212
- return { value: o && o[i++], done: !o };
213
- }
214
- };
215
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
216
- }
217
- function __read(o, n) {
218
- var m = typeof Symbol === "function" && o[Symbol.iterator];
219
- if (!m)
220
- return o;
221
- var i = m.call(o), r, ar = [], e;
222
- try {
223
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
224
- ar.push(r.value);
225
- }
226
- catch (error) {
227
- e = { error: error };
228
- }
229
- finally {
230
- try {
231
- if (r && !r.done && (m = i["return"]))
232
- m.call(i);
233
- }
234
- finally {
235
- if (e)
236
- throw e.error;
237
- }
238
- }
239
- return ar;
240
- }
241
- /** @deprecated */
242
- function __spread() {
243
- for (var ar = [], i = 0; i < arguments.length; i++)
244
- ar = ar.concat(__read(arguments[i]));
245
- return ar;
246
- }
247
- /** @deprecated */
248
- function __spreadArrays() {
249
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
250
- s += arguments[i].length;
251
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
252
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
253
- r[k] = a[j];
254
- return r;
255
- }
256
- function __spreadArray(to, from, pack) {
257
- if (pack || arguments.length === 2)
258
- for (var i = 0, l = from.length, ar; i < l; i++) {
259
- if (ar || !(i in from)) {
260
- if (!ar)
261
- ar = Array.prototype.slice.call(from, 0, i);
262
- ar[i] = from[i];
263
- }
264
- }
265
- return to.concat(ar || Array.prototype.slice.call(from));
266
- }
267
- function __await(v) {
268
- return this instanceof __await ? (this.v = v, this) : new __await(v);
269
- }
270
- function __asyncGenerator(thisArg, _arguments, generator) {
271
- if (!Symbol.asyncIterator)
272
- throw new TypeError("Symbol.asyncIterator is not defined.");
273
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
274
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
275
- function verb(n) { if (g[n])
276
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
277
- function resume(n, v) { try {
278
- step(g[n](v));
279
- }
280
- catch (e) {
281
- settle(q[0][3], e);
282
- } }
283
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
284
- function fulfill(value) { resume("next", value); }
285
- function reject(value) { resume("throw", value); }
286
- function settle(f, v) { if (f(v), q.shift(), q.length)
287
- resume(q[0][0], q[0][1]); }
288
- }
289
- function __asyncDelegator(o) {
290
- var i, p;
291
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
292
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
293
- }
294
- function __asyncValues(o) {
295
- if (!Symbol.asyncIterator)
296
- throw new TypeError("Symbol.asyncIterator is not defined.");
297
- var m = o[Symbol.asyncIterator], i;
298
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
299
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
300
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
301
- }
302
- function __makeTemplateObject(cooked, raw) {
303
- if (Object.defineProperty) {
304
- Object.defineProperty(cooked, "raw", { value: raw });
305
- }
306
- else {
307
- cooked.raw = raw;
308
- }
309
- return cooked;
310
- }
311
- ;
312
- var __setModuleDefault = Object.create ? (function (o, v) {
313
- Object.defineProperty(o, "default", { enumerable: true, value: v });
314
- }) : function (o, v) {
315
- o["default"] = v;
316
- };
317
- function __importStar(mod) {
318
- if (mod && mod.__esModule)
319
- return mod;
320
- var result = {};
321
- if (mod != null)
322
- for (var k in mod)
323
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
324
- __createBinding(result, mod, k);
325
- __setModuleDefault(result, mod);
326
- return result;
327
- }
328
- function __importDefault(mod) {
329
- return (mod && mod.__esModule) ? mod : { default: mod };
330
- }
331
- function __classPrivateFieldGet(receiver, state, kind, f) {
332
- if (kind === "a" && !f)
333
- throw new TypeError("Private accessor was defined without a getter");
334
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
335
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
336
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
337
- }
338
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
339
- if (kind === "m")
340
- throw new TypeError("Private method is not writable");
341
- if (kind === "a" && !f)
342
- throw new TypeError("Private accessor was defined without a setter");
343
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
344
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
345
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
346
- }
347
-
348
- var Configuration = /** @class */ (function () {
349
- function Configuration() {
350
- this.basePath = 'https://api.configcat.com';
351
- }
352
- return Configuration;
353
- }());
354
- Configuration.decorators = [
355
- { type: i0.Injectable }
356
- ];
357
-
358
- var PublicApiService = /** @class */ (function () {
359
- function PublicApiService(httpClient, configuration) {
360
- this.httpClient = httpClient;
361
- this.configuration = configuration;
362
- }
363
- PublicApiService.prototype.createMeService = function (basicAuthUsername, basicAuthPassword, basePath) {
364
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
365
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
366
- if (basePath === void 0) { basePath = null; }
367
- var _a, _b, _c;
368
- return new ngConfigcatPublicapi.MeService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
369
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
370
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
371
- }));
372
- };
373
- PublicApiService.prototype.createProductsService = function (basicAuthUsername, basicAuthPassword, basePath) {
374
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
375
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
376
- if (basePath === void 0) { basePath = null; }
377
- var _a, _b, _c;
378
- return new ngConfigcatPublicapi.ProductsService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
379
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
380
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
381
- }));
382
- };
383
- PublicApiService.prototype.createConfigsService = function (basicAuthUsername, basicAuthPassword, basePath) {
384
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
385
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
386
- if (basePath === void 0) { basePath = null; }
387
- var _a, _b, _c;
388
- return new ngConfigcatPublicapi.ConfigsService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
389
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
390
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
391
- }));
392
- };
393
- PublicApiService.prototype.createEnvironmentsService = function (basicAuthUsername, basicAuthPassword, basePath) {
394
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
395
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
396
- if (basePath === void 0) { basePath = null; }
397
- var _a, _b, _c;
398
- return new ngConfigcatPublicapi.EnvironmentsService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
399
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
400
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
401
- }));
402
- };
403
- PublicApiService.prototype.createSettingsService = function (basicAuthUsername, basicAuthPassword, basePath) {
404
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
405
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
406
- if (basePath === void 0) { basePath = null; }
407
- var _a, _b, _c;
408
- return new ngConfigcatPublicapi.FeatureFlagsSettingsService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
409
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
410
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
411
- }));
412
- };
413
- PublicApiService.prototype.createSettingValuesService = function (basicAuthUsername, basicAuthPassword, basePath) {
414
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
415
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
416
- if (basePath === void 0) { basePath = null; }
417
- var _a, _b, _c;
418
- return new ngConfigcatPublicapi.FeatureFlagSettingValuesService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
419
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
420
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
421
- }));
422
- };
423
- PublicApiService.prototype.createIntegrationLinksService = function (basicAuthUsername, basicAuthPassword, basePath) {
424
- if (basicAuthUsername === void 0) { basicAuthUsername = null; }
425
- if (basicAuthPassword === void 0) { basicAuthPassword = null; }
426
- if (basePath === void 0) { basePath = null; }
427
- var _a, _b, _c;
428
- return new ngConfigcatPublicapi.IntegrationLinksService(this.httpClient, basePath !== null && basePath !== void 0 ? basePath : (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.basePath, new ngConfigcatPublicapi.Configuration({
429
- username: basicAuthUsername !== null && basicAuthUsername !== void 0 ? basicAuthUsername : (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.basicAuthUsername,
430
- password: basicAuthPassword !== null && basicAuthPassword !== void 0 ? basicAuthPassword : (_c = this.configuration) === null || _c === void 0 ? void 0 : _c.basicAuthPassword
431
- }));
432
- };
433
- return PublicApiService;
434
- }());
435
- PublicApiService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PublicApiService_Factory() { return new PublicApiService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(Configuration, 8)); }, token: PublicApiService, providedIn: "root" });
436
- PublicApiService.decorators = [
437
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
438
- ];
439
- PublicApiService.ctorParameters = function () { return [
440
- { type: i1.HttpClient },
441
- { type: Configuration, decorators: [{ type: i0.Optional }] }
442
- ]; };
443
-
444
- var BaseComponent = /** @class */ (function () {
445
- function BaseComponent(publicApiService) {
446
- this.publicApiService = publicApiService;
447
- this.basePath = null;
448
- this.basicAuthUsername = null;
449
- this.basicAuthPassword = null;
450
- }
451
- BaseComponent.prototype.createProductsService = function () {
452
- return this.publicApiService.createProductsService(this.basicAuthUsername, this.basicAuthPassword, this.basePath);
453
- };
454
- BaseComponent.prototype.createConfigsService = function () {
455
- return this.publicApiService.createConfigsService(this.basicAuthUsername, this.basicAuthPassword, this.basePath);
456
- };
457
- BaseComponent.prototype.createEnvironmentsService = function () {
458
- return this.publicApiService.createEnvironmentsService(this.basicAuthUsername, this.basicAuthPassword, this.basePath);
459
- };
460
- BaseComponent.prototype.createSettingsService = function () {
461
- return this.publicApiService.createSettingsService(this.basicAuthUsername, this.basicAuthPassword, this.basePath);
462
- };
463
- BaseComponent.prototype.createSettingValuesService = function () {
464
- return this.publicApiService.createSettingValuesService(this.basicAuthUsername, this.basicAuthPassword, this.basePath);
465
- };
466
- return BaseComponent;
467
- }());
468
- BaseComponent.decorators = [
469
- { type: i0.Component, args: [{
470
- selector: 'base',
471
- template: '<div></div>'
472
- },] }
473
- ];
474
- BaseComponent.ctorParameters = function () { return [
475
- { type: PublicApiService }
476
- ]; };
477
- BaseComponent.propDecorators = {
478
- basePath: [{ type: i0.Input }],
479
- basicAuthUsername: [{ type: i0.Input }],
480
- basicAuthPassword: [{ type: i0.Input }]
481
- };
482
-
483
- var SettingItemComponent = /** @class */ (function (_super) {
484
- __extends(SettingItemComponent, _super);
485
- function SettingItemComponent(publicApiService) {
486
- var _this = _super.call(this, publicApiService) || this;
487
- _this.canEditSetting = true;
488
- _this.canDeleteSetting = true;
489
- _this.deleteSettingText = 'Delete setting';
490
- _this.showEnvironmentName = true;
491
- _this.editSettingRequested = new i0.EventEmitter();
492
- _this.deleteSettingRequested = new i0.EventEmitter();
493
- _this.loadSucceeded = new i0.EventEmitter();
494
- _this.loadFailed = new i0.EventEmitter();
495
- _this.saveSucceeded = new i0.EventEmitter();
496
- _this.saveFailed = new i0.EventEmitter();
497
- _this.formValuesChanged = new i0.EventEmitter();
498
- _this.loadSettingValues = function () {
499
- return _this.createSettingValuesService().getSettingValue(_this.environmentId, _this.settingId)
500
- .pipe(operators.map(function (settingValue) {
501
- _this.settingValue = settingValue;
502
- var settingValues = {
503
- settingValues: [settingValue],
504
- readOnly: settingValue.readOnly,
505
- config: settingValue.config,
506
- environment: settingValue.environment
507
- };
508
- _this.loadSucceeded.emit(settingValues);
509
- return settingValues;
510
- }), operators.catchError(function (error) {
511
- _this.loadFailed.emit(error);
512
- return rxjs.throwError(error);
513
- }));
514
- };
515
- _this.handleSave = function (model) {
516
- if (model.settingValues.length === 0) {
517
- return;
518
- }
519
- var updateModel = model.settingValues[0];
520
- return _this.createSettingValuesService().replaceSettingValue(_this.environmentId, _this.settingId, updateModel, model.reason)
521
- .pipe(operators.map(function (settingValue) {
522
- _this.settingValue = settingValue;
523
- var settingValues = {
524
- settingValues: [settingValue],
525
- readOnly: settingValue.readOnly,
526
- config: settingValue.config,
527
- environment: settingValue.environment
528
- };
529
- _this.saveSucceeded.emit(settingValues);
530
- return settingValues;
531
- }), operators.catchError(function (error) {
532
- _this.saveFailed.emit(error);
533
- return rxjs.throwError(error);
534
- }));
535
- };
536
- return _this;
537
- }
538
- SettingItemComponent.prototype.ngOnInit = function () {
539
- };
540
- SettingItemComponent.prototype.onEditSettingRequested = function (setting) {
541
- this.editSettingRequested.emit({
542
- setting: setting.setting,
543
- environment: this.settingValue.environment,
544
- config: this.settingValue.config
545
- });
546
- };
547
- SettingItemComponent.prototype.onDeleteSettingRequested = function (setting) {
548
- this.deleteSettingRequested.emit({
549
- setting: setting.setting,
550
- environment: this.settingValue.environment,
551
- config: this.settingValue.config
552
- });
553
- };
554
- SettingItemComponent.prototype.onFormValuesChanged = function () {
555
- this.formValuesChanged.emit();
556
- };
557
- return SettingItemComponent;
558
- }(BaseComponent));
559
- SettingItemComponent.decorators = [
560
- { type: i0.Component, args: [{
561
- selector: 'configcat-setting-item',
562
- template: "<configcat-setting-list [canEditSetting]=\"canEditSetting\" [canDeleteSetting]=\"canDeleteSetting\"\r\n [onSave]=\"handleSave\" [loadSettingValues]=\"loadSettingValues\"\r\n (editSettingRequested)=\"onEditSettingRequested($event)\" (deleteSettingRequested)=\"onDeleteSettingRequested($event)\"\r\n [deleteSettingText]=\"deleteSettingText\"\r\n [showEnvironmentName]=\"showEnvironmentName\" (formValuesChanged)=\"onFormValuesChanged()\">\r\n</configcat-setting-list>",
563
- styles: [".container{font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;background-color:#f3f3f3;border:1px solid rgba(0,0,0,.12);border-radius:4px;margin:1em 0}.container .setting-full{position:relative;display:flex;flex-wrap:nowrap}.container .setting-full .setting-details{display:flex;flex-direction:column;width:400px;padding:1em 0 1em 1em}.container .setting-full .setting-details>*{margin:.5em}.container .setting-full .setting-details .setting-name{flex-direction:row}.container .setting-full .setting-details .setting-name .name{font-weight:bold;word-wrap:break-word;max-width:100%}.container .setting-full .setting-details .setting-key{word-wrap:break-word}.container .setting-full .setting-details .description{font-size:.8em}.container .setting-full .setting-details code{background-color:#d3d3d3;padding:3px 6px}.container .setting-full .rules-list{width:100%;padding:1em}.container .setting-full .targeting-button{margin-left:1rem;margin-bottom:1em}.all-other{min-height:40px;justify-content:flex-start;border:1px solid #d5d5d5;border-radius:4px;background-color:#fff;margin:.5em 1em;padding:4px 0 4px .5em}.all-other .chip{background-color:#67b1fc3d}.all-other .served-value{margin-left:auto;min-width:100px}.end{margin-left:auto}.flex{display:flex;flex-wrap:wrap;align-items:center}.show-hide-toggle{margin-left:1em;cursor:pointer}@media (max-width: 1200px){.setting-full .setting-details{width:300px}}@media (max-width: 700px){.setting-full{flex-wrap:wrap}.setting-full .setting-details{padding:.2em 0 .2em .2em}.setting-full .all-other{margin:.5em .3em}}\n"]
564
- },] }
565
- ];
566
- SettingItemComponent.ctorParameters = function () { return [
567
- { type: PublicApiService }
568
- ]; };
569
- SettingItemComponent.propDecorators = {
570
- productId: [{ type: i0.Input }],
571
- environmentId: [{ type: i0.Input }],
572
- configId: [{ type: i0.Input }],
573
- settingId: [{ type: i0.Input }],
574
- canEditSetting: [{ type: i0.Input }],
575
- canDeleteSetting: [{ type: i0.Input }],
576
- deleteSettingText: [{ type: i0.Input }],
577
- showEnvironmentName: [{ type: i0.Input }],
578
- editSettingRequested: [{ type: i0.Output }],
579
- deleteSettingRequested: [{ type: i0.Output }],
580
- loadSucceeded: [{ type: i0.Output }],
581
- loadFailed: [{ type: i0.Output }],
582
- saveSucceeded: [{ type: i0.Output }],
583
- saveFailed: [{ type: i0.Output }],
584
- formValuesChanged: [{ type: i0.Output }]
585
- };
586
-
587
- var SettingSelectComponent = /** @class */ (function (_super) {
588
- __extends(SettingSelectComponent, _super);
589
- function SettingSelectComponent(publicApiService) {
590
- return _super.call(this, publicApiService) || this;
591
- }
592
- SettingSelectComponent.prototype.ngOnInit = function () {
593
- this.settings = [];
594
- this.reloadSettings();
595
- };
596
- SettingSelectComponent.prototype.ngOnChanges = function () {
597
- this.reloadSettings();
598
- };
599
- SettingSelectComponent.prototype.reloadSettings = function () {
600
- var _this = this;
601
- if (this.configId) {
602
- this.createSettingsService().getSettings(this.configId).subscribe(function (settings) {
603
- _this.settings = settings;
604
- if (_this.settings.length > 0) {
605
- _this.valueFormControl.setValue(_this.settings[0].settingId);
606
- }
607
- });
608
- }
609
- };
610
- return SettingSelectComponent;
611
- }(BaseComponent));
612
- SettingSelectComponent.decorators = [
613
- { type: i0.Component, args: [{
614
- selector: 'configcat-setting-select',
615
- template: "<mat-form-field class=\"form-field\">\r\n <mat-select placeholder=\"Feature flag or setting\" [formControl]=\"valueFormControl\" *ngIf=\"settings\" name=\"value\">\r\n <mat-option *ngFor=\"let setting of settings\" [value]=\"setting.settingId\">{{setting.name}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>",
616
- styles: [".form-field{width:100%}\n"]
617
- },] }
618
- ];
619
- SettingSelectComponent.ctorParameters = function () { return [
620
- { type: PublicApiService }
621
- ]; };
622
- SettingSelectComponent.propDecorators = {
623
- valueFormControl: [{ type: i0.Input }],
624
- configId: [{ type: i0.Input }]
625
- };
626
-
627
- var ProductSelectComponent = /** @class */ (function (_super) {
628
- __extends(ProductSelectComponent, _super);
629
- function ProductSelectComponent(publicApiService) {
630
- return _super.call(this, publicApiService) || this;
631
- }
632
- ProductSelectComponent.prototype.ngOnInit = function () {
633
- var _this = this;
634
- this.products = [];
635
- this.createProductsService().getProducts().subscribe(function (products) {
636
- _this.products = products;
637
- if (_this.products.length > 0) {
638
- _this.valueFormControl.setValue(_this.products[0].productId, {
639
- emitEvent: true,
640
- emitModelToViewChange: true, emitViewToModelChange: true
641
- });
642
- }
643
- });
644
- };
645
- return ProductSelectComponent;
646
- }(BaseComponent));
647
- ProductSelectComponent.decorators = [
648
- { type: i0.Component, args: [{
649
- selector: 'configcat-product-select',
650
- template: "<mat-form-field class=\"form-field\">\r\n <mat-select placeholder=\"Product\" [formControl]=\"valueFormControl\" name=\"productValue\">\r\n <mat-option *ngFor=\"let product of products\" [value]=\"product.productId\">{{product.name}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>",
651
- styles: [".form-field{width:100%}\n"]
652
- },] }
653
- ];
654
- ProductSelectComponent.ctorParameters = function () { return [
655
- { type: PublicApiService }
656
- ]; };
657
- ProductSelectComponent.propDecorators = {
658
- valueFormControl: [{ type: i0.Input }]
659
- };
660
-
661
- var ConfigSelectComponent = /** @class */ (function (_super) {
662
- __extends(ConfigSelectComponent, _super);
663
- function ConfigSelectComponent(publicApiService) {
664
- return _super.call(this, publicApiService) || this;
665
- }
666
- ConfigSelectComponent.prototype.ngOnInit = function () {
667
- this.configs = [];
668
- this.reloadConfigs();
669
- };
670
- ConfigSelectComponent.prototype.ngOnChanges = function () {
671
- this.reloadConfigs();
672
- };
673
- ConfigSelectComponent.prototype.reloadConfigs = function () {
674
- var _this = this;
675
- if (this.productId) {
676
- this.createConfigsService().getConfigs(this.productId).subscribe(function (configs) {
677
- _this.configs = configs;
678
- if (_this.configs.length > 0) {
679
- _this.valueFormControl.setValue(_this.configs[0].configId);
680
- }
681
- });
682
- }
683
- };
684
- return ConfigSelectComponent;
685
- }(BaseComponent));
686
- ConfigSelectComponent.decorators = [
687
- { type: i0.Component, args: [{
688
- selector: 'configcat-config-select',
689
- template: "<mat-form-field class=\"form-field\">\r\n <mat-select placeholder=\"Config\" [formControl]=\"valueFormControl\" *ngIf=\"configs\" name=\"value\">\r\n <mat-option *ngFor=\"let config of configs\" [value]=\"config.configId\">{{config.name}}</mat-option>\r\n </mat-select>\r\n</mat-form-field>",
690
- providers: [
691
- {
692
- provide: i1$1.NG_VALUE_ACCESSOR,
693
- useExisting: i0.forwardRef(function () { return ConfigSelectComponent; }),
694
- multi: true
695
- }
696
- ],
697
- styles: [".form-field{width:100%}\n"]
698
- },] }
699
- ];
700
- ConfigSelectComponent.ctorParameters = function () { return [
701
- { type: PublicApiService }
702
- ]; };
703
- ConfigSelectComponent.propDecorators = {
704
- valueFormControl: [{ type: i0.Input }],
705
- productId: [{ type: i0.Input }]
706
- };
707
-
708
- var EnvironmentSelectComponent = /** @class */ (function (_super) {
709
- __extends(EnvironmentSelectComponent, _super);
710
- function EnvironmentSelectComponent(publicApiService) {
711
- return _super.call(this, publicApiService) || this;
712
- }
713
- EnvironmentSelectComponent.prototype.ngOnInit = function () {
714
- this.environments = [];
715
- this.reloadEnvironments();
716
- };
717
- EnvironmentSelectComponent.prototype.ngOnChanges = function () {
718
- this.reloadEnvironments();
719
- };
720
- EnvironmentSelectComponent.prototype.reloadEnvironments = function () {
721
- var _this = this;
722
- if (this.productId) {
723
- this.createEnvironmentsService().getEnvironments(this.productId).subscribe(function (environments) {
724
- _this.environments = environments;
725
- if (_this.environments.length > 0) {
726
- _this.valueFormControl.setValue(_this.environments[0].environmentId);
727
- }
728
- });
729
- }
730
- };
731
- return EnvironmentSelectComponent;
732
- }(BaseComponent));
733
- EnvironmentSelectComponent.decorators = [
734
- { type: i0.Component, args: [{
735
- selector: 'configcat-environment-select',
736
- template: "<mat-form-field class=\"form-field\">\r\n <mat-select placeholder=\"Environment\" [formControl]=\"valueFormControl\" *ngIf=\"environments\" name=\"value\">\r\n <mat-option *ngFor=\"let environment of environments\" [value]=\"environment.environmentId\">{{environment.name}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>",
737
- styles: [".form-field{width:100%}\n"]
738
- },] }
739
- ];
740
- EnvironmentSelectComponent.ctorParameters = function () { return [
741
- { type: PublicApiService }
742
- ]; };
743
- EnvironmentSelectComponent.propDecorators = {
744
- valueFormControl: [{ type: i0.Input }],
745
- productId: [{ type: i0.Input }]
746
- };
747
-
748
- var FormHelper = /** @class */ (function () {
749
- function FormHelper() {
750
- }
751
- FormHelper.getErrorMessage = function (control, hint) {
752
- if (hint === void 0) { hint = ''; }
753
- if (!control || control.valid) {
754
- return;
755
- }
756
- if (control.hasError('required')) {
757
- return hint + " The field is required.";
758
- }
759
- if (control.hasError('pattern')) {
760
- return 'Not a valid e-mail address.';
761
- }
762
- if (control.hasError('minlength')) {
763
- return 'The field must be at least ' + control.errors.minlength.requiredLength + ' characters long';
764
- }
765
- if (control.hasError('maxlength')) {
766
- return 'The field must be at max ' + control.errors.maxlength.requiredLength + ' characters long';
767
- }
768
- return;
769
- };
770
- return FormHelper;
771
- }());
772
-
773
- var AuthorizationComponent = /** @class */ (function () {
774
- function AuthorizationComponent(formBuilder, publicApiService) {
775
- this.formBuilder = formBuilder;
776
- this.publicApiService = publicApiService;
777
- this.basePath = null;
778
- this.authorized = new i0.EventEmitter();
779
- this.FormHelper = FormHelper;
780
- }
781
- AuthorizationComponent.prototype.ngOnInit = function () {
782
- this.formGroup = this.formBuilder.group({
783
- basicAuthUsername: ['', i1$1.Validators.required],
784
- basicAuthPassword: ['', i1$1.Validators.required],
785
- });
786
- };
787
- AuthorizationComponent.prototype.onSubmit = function () {
788
- var _this = this;
789
- if (!this.formGroup.valid) {
790
- return;
791
- }
792
- var meService = this.publicApiService.createMeService(this.formGroup.controls.basicAuthUsername.value, this.formGroup.controls.basicAuthPassword.value, this.basePath);
793
- meService.getMe().subscribe(function (me) {
794
- _this.authorized.emit({
795
- basicAuthUsername: _this.formGroup.controls.basicAuthUsername.value,
796
- basicAuthPassword: _this.formGroup.controls.basicAuthPassword.value
797
- });
798
- }, function (error) {
799
- _this.formGroup.setErrors({ invalidAuthorization: 'Invalid Basic auth user name or password' });
800
- });
801
- };
802
- return AuthorizationComponent;
803
- }());
804
- AuthorizationComponent.decorators = [
805
- { type: i0.Component, args: [{
806
- selector: 'configcat-authorization',
807
- template: "<form [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"container\">\r\n <div class=\"form\">\r\n <p>\r\n <a href=\"https://app.configcat.com/my-account/public-api-credentials\" target=\"_blank\">\r\n Get your Basic Auth user name and password</a> to access ConfigCat Public API.\r\n <br /><br />\r\n <b>Note!</b> Your ConfigCat account's email address and password will not work here.\r\n </p>\r\n\r\n <mat-form-field class=\"form-field\">\r\n <mat-label>Basic auth user name</mat-label>\r\n <input matInput placeholder=\"Basic auth user name\" formControlName=\"basicAuthUsername\">\r\n <mat-error *ngIf=\"formGroup.controls.basicAuthUsername.invalid\">\r\n {{FormHelper.getErrorMessage(formGroup.controls.basicAuthUsername)}}\r\n </mat-error>\r\n </mat-form-field>\r\n <mat-form-field class=\"form-field\">\r\n <mat-label>Basic auth password</mat-label>\r\n <input matInput placeholder=\"Basic auth password\" formControlName=\"basicAuthPassword\" type=\"password\"\r\n autocomplete=\"current-password\">\r\n <mat-error *ngIf=\"formGroup.controls.basicAuthPassword.invalid\">\r\n {{FormHelper.getErrorMessage(formGroup.controls.basicAuthPassword)}}\r\n </mat-error>\r\n </mat-form-field>\r\n <div>\r\n <button mat-raised-button color=\"primary\" type=\"submit\" class=\"submit\">Authorize</button>\r\n <mat-error *ngIf=\"formGroup.invalid && formGroup.errors && formGroup.errors.invalidAuthorization\">\r\n {{formGroup.errors.invalidAuthorization}}</mat-error>\r\n </div>\r\n </div>\r\n </div>\r\n</form>",
808
- styles: [".container{display:flex;margin:8px}.form{width:100%}.form-field{width:100%;margin-bottom:8px}.submit{margin-top:8px;margin-bottom:8px}\n"]
809
- },] }
810
- ];
811
- AuthorizationComponent.ctorParameters = function () { return [
812
- { type: i1$1.FormBuilder },
813
- { type: PublicApiService }
814
- ]; };
815
- AuthorizationComponent.propDecorators = {
816
- basePath: [{ type: i0.Input }],
817
- authorized: [{ type: i0.Output }]
818
- };
819
-
820
- var ConcurrentDialogComponent = /** @class */ (function () {
821
- function ConcurrentDialogComponent(dialogRef) {
822
- this.dialogRef = dialogRef;
823
- }
824
- ConcurrentDialogComponent.prototype.ngOnInit = function () {
825
- };
826
- ConcurrentDialogComponent.prototype.save = function () {
827
- this.dialogRef.close({ button: 'save' });
828
- };
829
- ConcurrentDialogComponent.prototype.discard = function () {
830
- this.dialogRef.close({ button: 'discard' });
831
- };
832
- return ConcurrentDialogComponent;
833
- }());
834
- ConcurrentDialogComponent.decorators = [
835
- { type: i0.Component, args: [{
836
- selector: 'configcat-concurrent-dialog',
837
- template: "<h3 mat-dialog-title>Concurrent update detected</h3>\r\n<p>\r\n Somebody updated the feature flags & settings while you were editing them.\r\n</p>\r\n<ul>\r\n <li>\r\n To discard your local changes and reload the updated values, click <strong>Discard my changes & reload</strong>\r\n </li>\r\n <li>\r\n To save you local values and overwrite the remote changes, click <strong>Save anyway</strong>\r\n </li>\r\n</ul>\r\n<p>For more info about the changes check the <a [routerLink]=\"['/auditlog']\" target=\"_blank\" rel=\"noopener noreferrer\" >audit logs</a> in a new tab.</p>\r\n<div mat-dialog-actions>\r\n <button type=\"button\" style=\"margin-right: 10px;\" mat-raised-button color=\"primary\" (click)=\"discard()\">Discard\r\n local changes & reload</button>\r\n <button type=\"button\" mat-raised-button (click)=\"save()\">Save anyway</button>\r\n</div>",
838
- styles: [""]
839
- },] }
840
- ];
841
- ConcurrentDialogComponent.ctorParameters = function () { return [
842
- { type: dialog.MatDialogRef }
843
- ]; };
844
-
845
- var ExpandDialogComponent = /** @class */ (function () {
846
- function ExpandDialogComponent(dialogRef, formBuilder, data) {
847
- this.dialogRef = dialogRef;
848
- this.formBuilder = formBuilder;
849
- this.data = data;
850
- }
851
- ExpandDialogComponent.prototype.ngOnInit = function () {
852
- var _this = this;
853
- if (this.data.multiline) {
854
- this.buildFormGroup();
855
- }
856
- else {
857
- this.formControlSubscription = this.data.control.valueChanges.subscribe(function (value) {
858
- _this.data.control.setValue(value, { onlySelf: true, emitEvent: false, emitModelToViewChange: true });
859
- _this.data.control.markAsDirty();
860
- }, function (error) { }, function () { });
861
- }
862
- };
863
- ExpandDialogComponent.prototype.values = function () {
864
- return this.formGroup.get('values');
865
- };
866
- ExpandDialogComponent.prototype.buildFormGroup = function () {
867
- var _this = this;
868
- var value = this.data.control.value ? this.data.control.value : '';
869
- var list = value.split(',').map(function (v) { return v.trim(); }).filter(function (v) { return !!v; });
870
- this.formGroup = this.formBuilder.group({
871
- values: this.formBuilder.array(list.map(function (v) { return _this.formBuilder.control(v); }))
872
- });
873
- this.formGroupSubscription = this.formGroup.valueChanges.subscribe(function (formGroupValue) {
874
- _this.data.control.setValue(formGroupValue.values
875
- .filter(function (v) { return !!v; })
876
- .join(','), { onlySelf: true, emitEvent: false, emitModelToViewChange: true });
877
- _this.data.control.updateValueAndValidity();
878
- _this.data.control.markAsDirty();
879
- });
880
- };
881
- ExpandDialogComponent.prototype.add = function () {
882
- this.formGroup.controls.values.push(this.formBuilder.control(''));
883
- };
884
- ExpandDialogComponent.prototype.remove = function (index) {
885
- this.formGroup.controls.values.removeAt(index);
886
- };
887
- ExpandDialogComponent.prototype.ngOnDestroy = function () {
888
- if (this.formControlSubscription) {
889
- this.formControlSubscription.unsubscribe();
890
- this.formControlSubscription = null;
891
- }
892
- if (this.formGroupSubscription) {
893
- this.formGroupSubscription.unsubscribe();
894
- this.formGroupSubscription = null;
895
- }
896
- };
897
- ExpandDialogComponent.prototype.close = function () {
898
- this.dialogRef.close();
899
- };
900
- return ExpandDialogComponent;
901
- }());
902
- ExpandDialogComponent.decorators = [
903
- { type: i0.Component, args: [{
904
- selector: 'configcat-expand-dialog',
905
- template: "<div mat-dialog-content class=\"container\">\r\n\r\n <mat-form-field appearance=\"outline\" *ngIf=\"!data.multiline\">\r\n <mat-label></mat-label>\r\n <textarea matInput [formControl]=\"data.control\" rows=\"15\"></textarea>\r\n </mat-form-field>\r\n <div [formGroup]=\"formGroup\" *ngIf=\"data.multiline\">\r\n <div *ngFor=\"let valueControl of values().controls; let i = index;\" class=\"value-field\">\r\n <mat-form-field appearance=\"outline\">\r\n <input matInput [formControl]=\"valueControl\" rows=\"15\" />\r\n </mat-form-field>\r\n <button (click)=\"remove(i)\" mat-icon-button type=\"button\">\r\n <mat-icon>delete_outline</mat-icon>\r\n </button>\r\n </div>\r\n <button (click)=\"add()\" mat-icon-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions>\r\n <button type=\"button\" mat-raised-button color=\"primary\" (click)=\"close()\">Done</button>\r\n</div>",
906
- styles: [".container>*{width:100%}.container>* .value-field{display:flex;font-size:12px;flex-wrap:nowrap}.container>* .value-field mat-form-field{flex-grow:1}\n"]
907
- },] }
908
- ];
909
- ExpandDialogComponent.ctorParameters = function () { return [
910
- { type: dialog.MatDialogRef },
911
- { type: i1$1.FormBuilder },
912
- { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
913
- ]; };
914
-
915
- var ReasonDialogComponent = /** @class */ (function () {
916
- function ReasonDialogComponent(dialogRef, formBuilder) {
917
- this.dialogRef = dialogRef;
918
- this.formBuilder = formBuilder;
919
- }
920
- ReasonDialogComponent.prototype.ngOnInit = function () {
921
- this.formGroup = this.formBuilder.group({
922
- reason: ['', [i1$1.Validators.required, i1$1.Validators.maxLength(1000)]]
923
- });
924
- };
925
- ReasonDialogComponent.prototype.handleSaveButton = function () {
926
- if (!this.formGroup.valid) {
927
- return;
928
- }
929
- this.dialogRef.close({ button: 'save', reason: this.formGroup.controls.reason.value });
930
- };
931
- ReasonDialogComponent.prototype.cancel = function () {
932
- this.dialogRef.close({ button: 'cancel' });
933
- };
934
- return ReasonDialogComponent;
935
- }());
936
- ReasonDialogComponent.decorators = [
937
- { type: i0.Component, args: [{
938
- selector: 'configcat-reason-dialog',
939
- template: "<h3 mat-dialog-title>Add notes</h3>\r\n<p>This will appear in the Why column of the Audit Log.</p>\r\n<form [formGroup]=\"formGroup\" (ngSubmit)=\"handleSaveButton()\">\r\n <div mat-dialog-content class=\"container\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label></mat-label>\r\n <textarea matInput formControlName=\"reason\" name=\"reason\" placeholder=\"I'm changing settings because...\"\r\n rows=\"3\"></textarea>\r\n <mat-error *ngIf=\"formGroup.controls.reason.invalid\">The field is required.</mat-error>\r\n </mat-form-field>\r\n </div>\r\n <br>\r\n <div mat-dialog-actions>\r\n <button type=\"submit\" style=\"margin-right: 10px;\" mat-raised-button color=\"primary\">Add notes & Save</button>\r\n <button type=\"button\" mat-raised-button (click)=\"cancel()\">Cancel</button>\r\n </div>\r\n</form>",
940
- styles: [".container>*{width:100%}\n"]
941
- },] }
942
- ];
943
- ReasonDialogComponent.ctorParameters = function () { return [
944
- { type: dialog.MatDialogRef },
945
- { type: i1$1.FormBuilder }
946
- ]; };
947
-
948
- var SaveSnackbarComponent = /** @class */ (function () {
949
- function SaveSnackbarComponent() {
950
- }
951
- SaveSnackbarComponent.prototype.ngOnInit = function () {
952
- };
953
- return SaveSnackbarComponent;
954
- }());
955
- SaveSnackbarComponent.decorators = [
956
- { type: i0.Component, args: [{
957
- selector: 'configcat-save-snackbar',
958
- template: "<p class=\"header\">Settings saved successfully.</p>",
959
- styles: ["p{text-align:center;font-weight:bold}.header{font-size:1.2em}\n"]
960
- },] }
961
- ];
962
- SaveSnackbarComponent.ctorParameters = function () { return []; };
963
-
964
- var RolloutPercentageItemsComponent = /** @class */ (function () {
965
- function RolloutPercentageItemsComponent() {
966
- this.SettingType = ngConfigcatPublicapi.SettingType;
967
- }
968
- RolloutPercentageItemsComponent.prototype.setting = function () {
969
- return this.formGroup.get('setting').value;
970
- };
971
- RolloutPercentageItemsComponent.prototype.rolloutRules = function () {
972
- return this.formGroup.get('rolloutRules');
973
- };
974
- RolloutPercentageItemsComponent.prototype.rolloutPercentageItems = function () {
975
- return this.formGroup.get('rolloutPercentageItems');
976
- };
977
- RolloutPercentageItemsComponent.prototype.rolloutPercentageItemsSum = function () {
978
- return this.formGroup.get('rolloutPercentageItemsSum');
979
- };
980
- RolloutPercentageItemsComponent.prototype.value = function (rolloutPercentageItem) {
981
- return this.setting().settingType === ngConfigcatPublicapi.SettingType.Boolean ?
982
- rolloutPercentageItem.get('valueDisabled') :
983
- rolloutPercentageItem.get('value');
984
- };
985
- RolloutPercentageItemsComponent.prototype.percentageChanged = function (index) {
986
- if (this.rolloutPercentageItems().controls[index].value.percentage < 0) {
987
- this.rolloutPercentageItems().controls[index].controls.percentage.setValue(0);
988
- }
989
- if (this.rolloutPercentageItems().controls[index].value.percentage > 100) {
990
- this.rolloutPercentageItems().controls[index].controls.percentage.setValue(100);
991
- }
992
- if (this.rolloutPercentageItems().controls.length === 2) {
993
- this.rolloutPercentageItems().controls[1 - index].controls.percentage
994
- .setValue(100 - this.rolloutPercentageItems().controls[index].value.percentage);
995
- }
996
- this.updateSum();
997
- };
998
- RolloutPercentageItemsComponent.prototype.updateSum = function () {
999
- if (this.rolloutPercentageItems().controls.length === 0) {
1000
- this.rolloutPercentageItemsSum().setValue(100);
1001
- }
1002
- else {
1003
- this.rolloutPercentageItemsSum().setValue(this.rolloutPercentageItems().controls.map(function (v) { return v.value.percentage; })
1004
- .reduce(function (a, b) { return a + b; }));
1005
- }
1006
- };
1007
- RolloutPercentageItemsComponent.prototype.removeRolloutPercentageItem = function (index) {
1008
- this.rolloutPercentageItems().removeAt(index);
1009
- this.rolloutPercentageItems().markAsDirty();
1010
- this.updateSum();
1011
- };
1012
- RolloutPercentageItemsComponent.prototype.removeAll = function () {
1013
- this.rolloutPercentageItems().clear();
1014
- this.rolloutPercentageItems().markAsDirty();
1015
- this.updateSum();
1016
- };
1017
- return RolloutPercentageItemsComponent;
1018
- }());
1019
- RolloutPercentageItemsComponent.decorators = [
1020
- { type: i0.Component, args: [{
1021
- selector: 'configcat-rollout-percentage-items',
1022
- template: "<div class=\"percentage-wrapper\" [formGroup]=\"formGroup\">\r\n\r\n <div class=\"if\" *ngIf=\"rolloutRules().controls.length > 0\">\r\n <mat-chip-list>\r\n <mat-chip class=\"chip\">ELSE IF</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n <div class=\"grow\">\r\n <div class=\"percentage-row flex\"\r\n *ngFor=\"let rolloutPercentageItem of rolloutPercentageItems().controls; let i = index\">\r\n <div class=\"flex\">\r\n <input type=\"number\" [formControl]=\"rolloutPercentageItem.controls.percentage\"\r\n (input)=\"percentageChanged(i)\">%\r\n <span class=\"users\">of <a href=\"https://configcat.com/docs/advanced/user-object\"\r\n target=\"_blank\" rel=\"noopener noreferrer\">users</a>\r\n </span>\r\n </div>\r\n\r\n <div class=\"delete-option\" matTooltip=\"Remove this % option\"\r\n *ngIf=\"!readOnly && rolloutPercentageItems().controls.length > 2\"\r\n (click)=\"removeRolloutPercentageItem(i)\">\r\n <mat-icon>cancel</mat-icon>\r\n </div>\r\n\r\n <span data-tooltip=\"The sum of percentages must be equal to 100.\"\r\n *ngIf=\"(i === rolloutPercentageItems().controls.length -1) && (rolloutPercentageItemsSum().invalid)\">\r\n <mat-icon color=\"warn\">\r\n error_outline\r\n </mat-icon>\r\n </span>\r\n\r\n <div class=\"value flex\">\r\n <span class=\"value-name\" *ngIf=\"setting().settingType !== SettingType.Boolean\">Served value:</span>\r\n <configcat-value class=\"served-value\" [valueFormControl]=\"value(rolloutPercentageItem)\" [setting]=\"setting()\">\r\n </configcat-value>\r\n </div>\r\n <div class=\"delete\" matTooltip=\"Remove % options\" (click)=\"removeAll()\" *ngIf=\"!readOnly\">\r\n <mat-icon>cancel</mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n</div>",
1023
- styles: [".percentage-wrapper{border:1px solid #d5d5d5;background-color:#fff;border-radius:4px;margin:.5em 1em;position:relative;padding:.5em 0;display:flex}.percentage-wrapper .delete{position:absolute;color:#d6a9a9;cursor:pointer;top:-8px;right:-12px}.percentage-wrapper .delete:hover{color:#ed5251}.percentage-wrapper .delete mat-icon{font-size:20px}.percentage-wrapper .delete-option{color:#d6a9a9;cursor:pointer;margin-left:1rem;margin-top:4px}.percentage-wrapper .delete-option:hover{color:#ed5251}.percentage-wrapper .delete-option mat-icon{font-size:20px}.if{display:flex;align-items:center}.if>*{margin:0 .5em}.if .spacing{margin-right:44px}.if .chip{background-color:#67b1fc3d}.grow{flex-grow:1}.percentage-row{min-height:40px;margin-left:.5em}.flex{display:flex;flex-wrap:wrap;align-items:center}.value{margin-left:auto;min-width:100px}.value .value-name{display:none}input{background-color:#fff;border:1px solid #e5e5e5;min-height:28px;width:40px;margin-right:5px;font-size:15px;padding:0 5px;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;font-weight:300}.users{margin-left:20px}@media (max-width: 700px){.percentage-wrapper{margin:.5em .3em}}\n"]
1024
- },] }
1025
- ];
1026
- RolloutPercentageItemsComponent.ctorParameters = function () { return []; };
1027
- RolloutPercentageItemsComponent.propDecorators = {
1028
- formGroup: [{ type: i0.Input }],
1029
- readOnly: [{ type: i0.Input }]
1030
- };
1031
-
1032
- var RolloutRulesComponent = /** @class */ (function () {
1033
- function RolloutRulesComponent(dialog) {
1034
- this.dialog = dialog;
1035
- this.SettingType = ngConfigcatPublicapi.SettingType;
1036
- this.defaultComparisonAttributes = ['Identifier', 'Email', 'Country'];
1037
- this.rolloutRuleComparators = [
1038
- { value: ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf, label: 'IS ONE OF' },
1039
- { value: ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf, label: 'IS NOT ONE OF' },
1040
- { value: ngConfigcatPublicapi.RolloutRuleComparator.Contains, label: 'CONTAINS' },
1041
- { value: ngConfigcatPublicapi.RolloutRuleComparator.DoesNotContain, label: 'DOES NOT CONTAIN' },
1042
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsOneOf, label: 'IS ONE OF (SemVer)' },
1043
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsNotOneOf, label: 'IS NOT ONE OF (SemVer)' },
1044
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerLess, label: '< (SemVer)' },
1045
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerLessOrEquals, label: '<= (SemVer)' },
1046
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreater, label: '> (SemVer)' },
1047
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreaterOrEquals, label: '>= (SemVer)' },
1048
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberEquals, label: '= (Number)' },
1049
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberDoesNotEqual, label: '!= (Number)' },
1050
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberLess, label: '< (Number)' },
1051
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberLessOrEquals, label: '<= (Number)' },
1052
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberGreater, label: '> (Number)' },
1053
- { value: ngConfigcatPublicapi.RolloutRuleComparator.NumberGreaterOrEquals, label: '>= (Number)' },
1054
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsOneOf, label: 'IS ONE OF (Sensitive)' },
1055
- { value: ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsNotOneOf, label: 'IS NOT ONE OF (Sensitive)' },
1056
- ];
1057
- }
1058
- RolloutRulesComponent.prototype.onlyFirstTooltip = function () {
1059
- return this.formGroup.root.get('allRolloutRulesCount').value > 20 || this.rolloutRules().controls.length > 10;
1060
- };
1061
- RolloutRulesComponent.prototype.setting = function () {
1062
- return this.formGroup.get('setting').value;
1063
- };
1064
- RolloutRulesComponent.prototype.rolloutRules = function () {
1065
- return this.formGroup.get('rolloutRules');
1066
- };
1067
- RolloutRulesComponent.prototype.comparisonAttributes = function () {
1068
- return this.formGroup.root.get('comparisonAttributes').value;
1069
- };
1070
- RolloutRulesComponent.prototype.removeRule = function (index) {
1071
- this.rolloutRules().removeAt(index);
1072
- this.rolloutRules().markAsDirty();
1073
- };
1074
- RolloutRulesComponent.prototype.onDrop = function (event) {
1075
- var rolloutRules = this.rolloutRules().controls;
1076
- dragDrop.moveItemInArray(rolloutRules, event.previousIndex, event.currentIndex);
1077
- this.formGroup.markAsDirty();
1078
- };
1079
- RolloutRulesComponent.prototype.attributeChanged = function (event, comparisonAttribute) {
1080
- if (this.defaultComparisonAttributes.indexOf(event) !== -1) {
1081
- if (comparisonAttribute.value !== event) {
1082
- comparisonAttribute.setValue(event);
1083
- this.formGroup.markAsDirty();
1084
- }
1085
- }
1086
- else {
1087
- if (comparisonAttribute.value !== '') {
1088
- comparisonAttribute.setValue('');
1089
- this.formGroup.markAsDirty();
1090
- }
1091
- }
1092
- };
1093
- RolloutRulesComponent.prototype.getPlaceHolder = function (rolloutRule) {
1094
- if (!rolloutRule.controls.comparisonAttribute.value) {
1095
- return '';
1096
- }
1097
- switch (rolloutRule.controls.comparator.value) {
1098
- case ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf:
1099
- case ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf:
1100
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsOneOf:
1101
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsNotOneOf:
1102
- switch (rolloutRule.controls.comparisonAttribute.value.toLowerCase()) {
1103
- case 'identifier':
1104
- return 'e.g: user_id1, user_id2, user_id3';
1105
- case 'email':
1106
- return 'e.g: jane@example.com, john@example.com';
1107
- case 'country':
1108
- return 'e.g: France, Brazil';
1109
- default:
1110
- return 'e.g: value1, value2, value3';
1111
- }
1112
- case ngConfigcatPublicapi.RolloutRuleComparator.Contains:
1113
- case ngConfigcatPublicapi.RolloutRuleComparator.DoesNotContain:
1114
- switch (rolloutRule.controls.comparisonAttribute.value.toLowerCase()) {
1115
- case 'identifier':
1116
- return 'part-of-id';
1117
- case 'email':
1118
- return 'e.g: @example.com';
1119
- case 'country':
1120
- return 'e.g: United';
1121
- default:
1122
- return 'e.g: any-part-of-your-value-string';
1123
- }
1124
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsOneOf:
1125
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsNotOneOf:
1126
- return 'e.g: 1.0.0, 2.0.1';
1127
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerLessOrEquals:
1128
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerLess:
1129
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreater:
1130
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreaterOrEquals:
1131
- return 'e.g: 1.0.0';
1132
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberEquals:
1133
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberDoesNotEqual:
1134
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLess:
1135
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLessOrEquals:
1136
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreater:
1137
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreaterOrEquals:
1138
- return 'e.g: 42';
1139
- }
1140
- return '';
1141
- };
1142
- RolloutRulesComponent.prototype.getComparisonValueType = function (rolloutRule) {
1143
- switch (rolloutRule.controls.comparator.value) {
1144
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberEquals:
1145
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberDoesNotEqual:
1146
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLess:
1147
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLessOrEquals:
1148
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreater:
1149
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreaterOrEquals:
1150
- return 'number';
1151
- default:
1152
- return 'text';
1153
- }
1154
- };
1155
- RolloutRulesComponent.prototype.getInfoClass = function (rolloutRule) {
1156
- if (!rolloutRule.controls.comparisonAttribute.value) {
1157
- return 'info';
1158
- }
1159
- switch (rolloutRule.controls.comparator.value) {
1160
- case ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf:
1161
- case ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf:
1162
- case ngConfigcatPublicapi.RolloutRuleComparator.Contains:
1163
- case ngConfigcatPublicapi.RolloutRuleComparator.DoesNotContain:
1164
- return 'warn';
1165
- default:
1166
- return 'info';
1167
- }
1168
- };
1169
- RolloutRulesComponent.prototype.getInfoTooltip = function (rolloutRule) {
1170
- if (!rolloutRule.controls.comparisonAttribute.value) {
1171
- return 'Learn more about comparators';
1172
- }
1173
- switch (rolloutRule.controls.comparator.value) {
1174
- case ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf:
1175
- case ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf:
1176
- case ngConfigcatPublicapi.RolloutRuleComparator.Contains:
1177
- case ngConfigcatPublicapi.RolloutRuleComparator.DoesNotContain:
1178
- return 'Consider using sensitive text comparators. Click to learn more.';
1179
- default:
1180
- return 'Click to learn more about comparators';
1181
- }
1182
- };
1183
- RolloutRulesComponent.prototype.comparatorChanged = function (rolloutRule) {
1184
- var validators = [];
1185
- switch (rolloutRule.controls.comparator.value) {
1186
- case ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf:
1187
- case ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf:
1188
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsOneOf:
1189
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsNotOneOf:
1190
- case ngConfigcatPublicapi.RolloutRuleComparator.Contains:
1191
- case ngConfigcatPublicapi.RolloutRuleComparator.DoesNotContain:
1192
- validators = [i1$1.Validators.required, i1$1.Validators.maxLength(65535)];
1193
- break;
1194
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsOneOf:
1195
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsNotOneOf:
1196
- validators = [i1$1.Validators.required, this.validateSemVerList];
1197
- break;
1198
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerLessOrEquals:
1199
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerLess:
1200
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreater:
1201
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerGreaterOrEquals:
1202
- validators = [i1$1.Validators.required, this.validateSemVer];
1203
- break;
1204
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberEquals:
1205
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberDoesNotEqual:
1206
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLess:
1207
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberLessOrEquals:
1208
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreater:
1209
- case ngConfigcatPublicapi.RolloutRuleComparator.NumberGreaterOrEquals:
1210
- validators = [i1$1.Validators.required, i1$1.Validators.min(-1.79769313486232E+308), i1$1.Validators.max(1.79769313486232E+308)];
1211
- break;
1212
- }
1213
- rolloutRule.controls.comparisonValue.setValidators(validators);
1214
- rolloutRule.controls.comparisonValue.updateValueAndValidity();
1215
- };
1216
- RolloutRulesComponent.prototype.isListType = function (rolloutRule) {
1217
- switch (rolloutRule.controls.comparator.value) {
1218
- case ngConfigcatPublicapi.RolloutRuleComparator.IsOneOf:
1219
- case ngConfigcatPublicapi.RolloutRuleComparator.IsNotOneOf:
1220
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsOneOf:
1221
- case ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsNotOneOf:
1222
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsOneOf:
1223
- case ngConfigcatPublicapi.RolloutRuleComparator.SemVerIsNotOneOf:
1224
- return true;
1225
- default:
1226
- return false;
1227
- }
1228
- };
1229
- RolloutRulesComponent.prototype.validateSemVer = function (c) {
1230
- if (semver__namespace.valid(c.value) === null) {
1231
- return {
1232
- validateSemVer: {
1233
- valid: false
1234
- }
1235
- };
1236
- }
1237
- return null;
1238
- };
1239
- RolloutRulesComponent.prototype.validateSemVerList = function (c) {
1240
- if (!c.value) {
1241
- return {
1242
- validateSemVerList: {
1243
- valid: false
1244
- }
1245
- };
1246
- }
1247
- var semvers = c.value.split(',').map(function (s) { return s.trim(); });
1248
- if (semvers.find(function (s) { return s && s !== '' && semver__namespace.valid(s) === null; })) {
1249
- return {
1250
- validateSemVerList: {
1251
- valid: false
1252
- }
1253
- };
1254
- }
1255
- return null;
1256
- };
1257
- RolloutRulesComponent.prototype.popOut = function (rolloutRule) {
1258
- this.dialog.open(ExpandDialogComponent, {
1259
- width: '640px',
1260
- data: {
1261
- control: rolloutRule.controls.comparisonValue,
1262
- multiline: this.isListType(rolloutRule)
1263
- }
1264
- });
1265
- };
1266
- RolloutRulesComponent.prototype.trackByIndex = function (index) {
1267
- return index;
1268
- };
1269
- return RolloutRulesComponent;
1270
- }());
1271
- RolloutRulesComponent.decorators = [
1272
- { type: i0.Component, args: [{
1273
- selector: 'configcat-rollout-rules',
1274
- template: "<div [formGroup]=\"formGroup\">\r\n <div cdkDropList (cdkDropListDropped)=\"onDrop($event)\" [cdkDropListDisabled]=\"readOnly\"\r\n [cdkDropListData]=\"rolloutRules().controls\">\r\n <div *ngFor=\"let rolloutRule of rolloutRules().controls; trackBy: trackByIndex; let i = index\" cdkDrag>\r\n <div class=\"targeting-row\">\r\n <div class=\"fields flex\">\r\n <div class=\"drag-handle\" cdkDragHandle data-tooltip=\"Drag here to reorder\" *ngIf=\"!readOnly\">\r\n <mat-icon>drag_indicator</mat-icon>\r\n </div>\r\n <div class=\"if\">\r\n <mat-chip-list [class.spacing]=\"i === 0\">\r\n <mat-chip class=\"chip\">{{ i === 0 ? 'IF' : 'ELSE IF' }}</mat-chip>\r\n </mat-chip-list>\r\n <a href=\"https://configcat.com/docs/advanced/user-object\" target=\"_blank\" rel=\"noopener noreferrer\">user's</a>\r\n </div>\r\n\r\n <select class=\"custom-select attribute-select\" matTooltip=\"Comparison attribute\"\r\n matTooltipPosition=\"above\" [matTooltipDisabled]=\"onlyFirstTooltip() && i !== 0\"\r\n (change)=\"attributeChanged($event.target.value, rolloutRule.controls.comparisonAttribute)\">\r\n <option *ngFor=\"let comparisonAttribute of defaultComparisonAttributes\"\r\n [selected]=\"comparisonAttribute === rolloutRule.controls.comparisonAttribute.value\">\r\n {{comparisonAttribute}}</option>\r\n <option\r\n [selected]=\"defaultComparisonAttributes.indexOf(rolloutRule.controls.comparisonAttribute.value) === -1\">\r\n Custom\r\n </option>\r\n </select>\r\n\r\n\r\n <span class=\"attribute-span\" data-tooltip=\"Custom user attribute\"\r\n [hidden]=\"defaultComparisonAttributes.indexOf(rolloutRule.controls.comparisonAttribute.value) !== -1\">\r\n <span class=\"attribute-error\" *ngIf=\"rolloutRule.controls.comparisonAttribute.invalid\">*</span>\r\n <input [ngClass]=\"{'invalid': rolloutRule.controls.comparisonAttribute.invalid}\" type=\"text\"\r\n matInput [matAutocomplete]=\"auto\" [formControl]=\"rolloutRule.controls.comparisonAttribute\"\r\n class=\"attribute\" placeholder=\"e.g. Eye color\">\r\n </span>\r\n\r\n <mat-autocomplete #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of comparisonAttributes()\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n\r\n <div class=\"select-wrapper\">\r\n <select class=\"custom-select\" [formControl]=\"rolloutRule.controls.comparator\"\r\n matTooltip=\"Comparator\" matTooltipPosition=\"above\"\r\n [matTooltipDisabled]=\"onlyFirstTooltip() && i !== 0\"\r\n (change)=\"comparatorChanged(rolloutRule)\">\r\n <optgroup label=\"SENSITIVE TEXT\">\r\n <option *ngFor=\"let comparator of rolloutRuleComparators.slice(16, 18)\"\r\n [ngValue]=\"comparator.value\">\r\n {{comparator.label}}\r\n </option>\r\n </optgroup>\r\n <optgroup label=\"TEXT\">\r\n <option *ngFor=\"let comparator of rolloutRuleComparators.slice(0, 4)\"\r\n [ngValue]=\"comparator.value\">\r\n {{comparator.label}}\r\n </option>\r\n </optgroup>\r\n <optgroup label=\"SEMANTIC VERSION\">\r\n <option *ngFor=\"let comparator of rolloutRuleComparators.slice(4, 10)\"\r\n [ngValue]=\"comparator.value\">\r\n {{comparator.label}}\r\n </option>\r\n </optgroup>\r\n <optgroup label=\"NUMBER\">\r\n <option *ngFor=\"let comparator of rolloutRuleComparators.slice(10, 16)\"\r\n [ngValue]=\"comparator.value\">\r\n {{comparator.label}}\r\n </option>\r\n </optgroup>\r\n </select>\r\n <div [class]=\"getInfoClass(rolloutRule)\" [matTooltip]=\"getInfoTooltip(rolloutRule)\"\r\n [matTooltipDisabled]=\"onlyFirstTooltip() && i !== 0\">\r\n <a href=\"https://configcat.com/docs/advanced/targeting/#comparator\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n <mat-icon>info</mat-icon>\r\n </a>\r\n </div>\r\n </div>\r\n\r\n <div class=\"comparison-value\" data-tooltip=\"Comparison value\">\r\n <span class=\"error\" *ngIf=\"rolloutRule.controls.comparisonValue.invalid\">*</span>\r\n\r\n <input [ngClass]=\"{'invalid': rolloutRule.controls.comparisonValue.invalid}\"\r\n [formControl]=\"rolloutRule.controls.comparisonValue\"\r\n [type]=\"getComparisonValueType(rolloutRule)\" [placeholder]=\"getPlaceHolder(rolloutRule)\">\r\n <div class=\"expand\" matTooltip=\"Pop-out Editor\" (click)=\"popOut(rolloutRule)\" *ngIf=\"getComparisonValueType(rolloutRule)==='text'\">\r\n <mat-icon>height</mat-icon>\r\n </div>\r\n </div>\r\n\r\n <div class=\"delete\" matTooltip=\"Remove targeting rule\"\r\n [matTooltipDisabled]=\"onlyFirstTooltip() && i !== 0\" *ngIf=\"!readOnly\" (click)=\"removeRule(i)\">\r\n <mat-icon>cancel</mat-icon>\r\n </div>\r\n </div>\r\n <div class=\"value flex\">\r\n <div class=\"serve\" *ngIf=\"setting().settingType !== SettingType.Boolean\">\r\n <mat-chip-list>\r\n <mat-chip class=\"chip\">Serve:</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n\r\n <configcat-value class=\"served-value\" [valueFormControl]=\"rolloutRule.controls.value\"\r\n [setting]=\"setting()\">\r\n </configcat-value>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>",
1275
- styles: [".cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}.targeting-row{border:1px solid #d5d5d5;border-radius:4px;background-color:#fff;margin:.5em 1em;display:flex;position:relative;padding:.5em 0}.targeting-row .select-wrapper{position:relative}.targeting-row .info{position:absolute;cursor:pointer;top:-8px;left:166px}.targeting-row .info a{color:#7fb3fd}.targeting-row .info a:hover{color:#0068f0}.targeting-row .info mat-icon{font-size:18px}.targeting-row .warn{position:absolute;cursor:pointer;top:-8px;left:128px}.targeting-row .warn a{color:#fdc67f}.targeting-row .warn a:hover{color:#ff9200}.targeting-row .warn mat-icon{font-size:18px}.chip{background-color:#67b1fc3d}.fields{justify-content:left;max-width:1060px;flex-grow:100}.fields .if{display:flex;align-items:center}.fields .if>*{margin:0 .5em}.fields .if .spacing{margin-right:46px}.fields .attribute-span{margin-left:.5em}.fields .attribute{width:170px;background-color:#fff;border:1px solid #e5e5e5;min-height:28px;min-width:170px;font-size:15px;padding:0 10px;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;font-weight:300}.fields .invalid{border:1px solid #ff5252}.fields .attribute-error{color:#ff5252;margin-right:5px}.fields .delete{position:absolute;color:#d6a9a9;cursor:pointer;top:-8px;right:-12px;z-index:999}.fields .delete:hover{color:#ed5251}.fields .delete mat-icon{font-size:20px}.fields .drag-handle{position:absolute;cursor:-webkit-grab;cursor:-moz-grab;left:-20px;top:14px}.fields .drag-handle mat-icon{font-size:20px}.fields .custom-select{margin-left:.5em;width:170px;background-color:#fff;border:1px solid #e5e5e5;min-height:30px;min-width:170px;font-size:.8em;padding:0 5px;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;font-weight:300}.fields .attribute-select{min-width:100px;width:100px;margin-left:0}.fields .comparison-value{flex-grow:100;min-width:200px;display:flex;align-items:center;margin-left:.5em}.fields .comparison-value .error{color:#ff5252;margin:0 5px}.fields .comparison-value input{background-color:#fff;border:1px solid #e5e5e5;min-height:28px;min-width:170px;flex-grow:100;font-size:15px;padding:0 30px 0 10px;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;font-weight:300}.fields .comparison-value .invalid{border:1px solid #ff5252}.value{margin-left:auto;flex-wrap:nowrap}.value .serve{margin:0 5px}.warn{padding-left:3em;font-size:.8em}.flex{display:flex;flex-wrap:wrap;align-items:center}.expand{position:absolute;right:2px;font-size:8px;cursor:pointer;margin-left:-28px;z-index:1;color:#b3b3b3;background-color:#fff}.expand mat-icon{transform:rotate(45deg)}@media (max-width: 1200px){.targeting-row{flex-wrap:wrap}.targeting-row .fields{max-width:500px}}@media (max-width: 700px){.targeting-row{flex-direction:column;margin:.5em .3em}.targeting-row .help{left:161px}.targeting-row .fields{flex-direction:column;align-items:stretch}.targeting-row .fields .custom-select{margin:0}.targeting-row .fields .comparison-value{margin:0}}\n"]
1276
- },] }
1277
- ];
1278
- RolloutRulesComponent.ctorParameters = function () { return [
1279
- { type: dialog.MatDialog }
1280
- ]; };
1281
- RolloutRulesComponent.propDecorators = {
1282
- formGroup: [{ type: i0.Input }],
1283
- readOnly: [{ type: i0.Input }]
1284
- };
1285
-
1286
- var ValueComponent = /** @class */ (function () {
1287
- function ValueComponent(dialog) {
1288
- this.dialog = dialog;
1289
- this.SettingType = ngConfigcatPublicapi.SettingType;
1290
- }
1291
- ValueComponent.prototype.popOut = function () {
1292
- this.dialog.open(ExpandDialogComponent, {
1293
- width: '640px',
1294
- data: { control: this.valueFormControl }
1295
- });
1296
- };
1297
- return ValueComponent;
1298
- }());
1299
- ValueComponent.decorators = [
1300
- { type: i0.Component, args: [{
1301
- selector: 'configcat-value',
1302
- template: "<div class=\"flex\">\r\n <div class=\"container\" [ngSwitch]=\"setting.settingType\">\r\n <div *ngSwitchCase=\"SettingType.String\" class=\"with-validation\">\r\n <span *ngIf=\"valueFormControl.invalid\" class=\"error\">*</span>\r\n <input [ngClass]=\"{'invalid': valueFormControl.invalid}\" type=\"text\"\r\n [formControl]=\"valueFormControl\" placeholder=\"my value\" name=\"value\">\r\n <div class=\"expand\" (click)=\"popOut()\" matTooltip=\"Pop-out Editor\">\r\n <mat-icon>height</mat-icon>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"SettingType.Int\" class=\"with-validation\">\r\n <span *ngIf=\"valueFormControl.invalid\" class=\"error\">*</span>\r\n <input [ngClass]=\"{'invalid': valueFormControl.invalid}\" type=\"number\" [formControl]=\"valueFormControl\"\r\n placeholder=\"42\" name=\"value\" />\r\n </div>\r\n <div *ngSwitchCase=\"SettingType.Double\" class=\"with-validation\">\r\n <span *ngIf=\"valueFormControl.invalid\" class=\"error\">*</span>\r\n <input [ngClass]=\"{'invalid': valueFormControl.invalid}\" type=\"number\" [formControl]=\"valueFormControl\"\r\n placeholder=\"3.14\" name=\"value\">\r\n </div>\r\n <div *ngSwitchCase=\"SettingType.Boolean\" class=\"toggle\">\r\n <label class=\"switch\">\r\n <input type=\"checkbox\" [formControl]=\"valueFormControl\" name=\"value\" />\r\n <span class=\"slider round\"></span>\r\n </label>\r\n </div>\r\n </div>\r\n <div *ngIf=\"setting.settingType === SettingType.Boolean\" class=\"spacer\"></div>\r\n\r\n</div>\r\n",
1303
- styles: [".switch{position:relative;width:66px;height:30px;margin-left:4px;margin-top:0;margin-bottom:0}.switch input{display:none}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ff5252;transition:.4s;width:66px;height:30px}.slider:before{position:absolute;content:\"\";height:22px;width:22px;left:4px;bottom:4px;background-color:#fff;transition:.4s}input:checked+.slider{background-color:#9acd32}input:focus+.slider{box-shadow:0 0 1px #9acd32}input:checked+.slider:before{transform:translate(36px)}.slider.round{border-radius:34px}.slider.round:before{border-radius:50%}.slider:after{content:\"Off\";color:#fff;display:block;position:absolute;transform:translate(-14%,-50%);top:50%;left:50%;font-size:10px;font-family:Verdana,sans-serif}input:checked+.slider:after{content:\"On\";transform:translate(-91%,-50%)}\n", ".flex{display:flex;margin-right:20px;align-items:center}.flex .spacer{width:15px}.flex .container .with-validation{display:flex;flex-wrap:nowrap}.flex .container .toggle{width:66px;height:30px}.flex .container input{background-color:#fff;border:1px solid #e5e5e5;min-height:28px;font-size:15px;padding:0 30px 0 10px;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif;font-weight:300;min-width:170px}.flex .container .invalid{border:1px solid #ff5252}.flex .container .error{color:#ff5252;margin-right:5px}@media (max-width: 1200px){.flex .container input{min-width:auto}}.flex .variationId{margin-left:5px;cursor:pointer;color:#888;display:flex;align-items:center}.flex .expand{position:relative;top:2px;height:24px;cursor:pointer;margin-left:-28px;z-index:1;color:#b3b3b3;background-color:#fff}.flex .expand mat-icon{transform:rotate(45deg)}\n"]
1304
- },] }
1305
- ];
1306
- ValueComponent.ctorParameters = function () { return [
1307
- { type: dialog.MatDialog }
1308
- ]; };
1309
- ValueComponent.propDecorators = {
1310
- valueFormControl: [{ type: i0.Input }],
1311
- setting: [{ type: i0.Input }]
1312
- };
1313
-
1314
- var SettingListFormHelper = /** @class */ (function () {
1315
- function SettingListFormHelper(formBuilder) {
1316
- this.formBuilder = formBuilder;
1317
- }
1318
- SettingListFormHelper.prototype.createSettingValuesFormGroup = function (settingValuesModel) {
1319
- var _this = this;
1320
- var formGroup = this.formBuilder.group({
1321
- settingValues: this.formBuilder.array(settingValuesModel.settingValues.map(function (sv) {
1322
- return _this.createSettingValueFormGroup(sv, settingValuesModel.readOnly);
1323
- })),
1324
- // Decorator
1325
- environment: this.formBuilder.group({
1326
- environmentId: [{ value: settingValuesModel.environment.environmentId, disabled: true }],
1327
- name: [{ value: settingValuesModel.environment.name, disabled: true }],
1328
- }),
1329
- comparisonAttributes: [[]],
1330
- allRolloutRulesCount: [0]
1331
- });
1332
- var rolloutRules = this.getAllRolloutRules(formGroup);
1333
- var comparisonAttributes = this.getComparisonAttributes(rolloutRules);
1334
- formGroup.patchValue({ allRolloutRulesCount: rolloutRules.length });
1335
- formGroup.patchValue({ comparisonAttributes: comparisonAttributes });
1336
- return formGroup;
1337
- };
1338
- SettingListFormHelper.prototype.createSettingValueFormGroup = function (settingValueModel, readOnly) {
1339
- var _this = this;
1340
- return this.formBuilder.group({
1341
- settingId: [settingValueModel.setting.settingId],
1342
- value: [
1343
- { value: settingValueModel.value, disabled: readOnly },
1344
- this.getValidatorsForSettingType(settingValueModel.setting.settingType)
1345
- ],
1346
- rolloutPercentageItems: this.formBuilder.array(settingValueModel.rolloutPercentageItems.map(function (p) {
1347
- return _this.createRolloutPercentageItemFormGroup(p, readOnly, settingValueModel.setting.settingType);
1348
- })),
1349
- rolloutRules: this.formBuilder.array(settingValueModel.rolloutRules.map(function (r) {
1350
- return _this.createRolloutRuleFormGroup(r, readOnly, settingValueModel.setting.settingType);
1351
- })),
1352
- updatedAt: [{ value: settingValueModel.updatedAt, disabled: true }],
1353
- lastUpdaterUserEmail: [{ value: settingValueModel.lastUpdaterUserEmail, disabled: true }],
1354
- lastUpdaterUserFullName: [{ value: settingValueModel.lastUpdaterUserFullName, disabled: true }],
1355
- rolloutPercentageItemsSum: [{ value: 100, disabled: false }, [i1$1.Validators.min(100), i1$1.Validators.max(100)]],
1356
- // Decoration
1357
- setting: this.formBuilder.group({
1358
- settingId: [{ value: settingValueModel.setting.settingId, disabled: true }],
1359
- key: [{ value: settingValueModel.setting.key, disabled: true }],
1360
- name: [{ value: settingValueModel.setting.name, disabled: true }],
1361
- hint: [{ value: settingValueModel.setting.hint, disabled: true }],
1362
- settingType: [{ value: settingValueModel.setting.settingType, disabled: true }],
1363
- creatorEmail: [{ value: settingValueModel.setting.creatorEmail, disabled: true }],
1364
- creatorFullName: [{ value: settingValueModel.setting.creatorFullName, disabled: true }],
1365
- createdAt: [{ value: settingValueModel.setting.createdAt, disabled: true }]
1366
- }),
1367
- integrationLinks: this.formBuilder.array(settingValueModel.integrationLinks.map(function (il) {
1368
- return _this.formBuilder.group({
1369
- key: [{ value: il.key, disabled: true }],
1370
- description: [{ value: il.description, disabled: true }],
1371
- integrationLinkType: [{ value: il.integrationLinkType, disabled: true }],
1372
- url: [{ value: il.url, disabled: true }],
1373
- });
1374
- }))
1375
- });
1376
- };
1377
- SettingListFormHelper.prototype.createRolloutPercentageItemFormGroup = function (p, readOnly, settingType) {
1378
- return this.formBuilder.group({
1379
- percentage: [{ value: p.percentage, disabled: readOnly }, [i1$1.Validators.required, i1$1.Validators.min(0), i1$1.Validators.max(100)]],
1380
- value: [
1381
- { value: p.value, disabled: readOnly },
1382
- [].concat.apply([], [i1$1.Validators.required, this.getValidatorsForSettingType(settingType)])
1383
- ],
1384
- valueDisabled: [
1385
- { value: p.value, disabled: true }, // For percentage item value
1386
- ]
1387
- });
1388
- };
1389
- SettingListFormHelper.prototype.createRolloutRuleFormGroup = function (r, readOnly, settingType) {
1390
- return this.formBuilder.group({
1391
- comparisonAttribute: [{ value: r.comparisonAttribute, disabled: readOnly }, [i1$1.Validators.required]],
1392
- comparator: [{ value: r.comparator, disabled: readOnly }, [i1$1.Validators.required]],
1393
- comparisonValue: [{ value: r.comparisonValue, disabled: readOnly }, [i1$1.Validators.required]],
1394
- value: [
1395
- { value: r.value, disabled: readOnly },
1396
- this.getValidatorsForSettingType(settingType)
1397
- ],
1398
- });
1399
- };
1400
- SettingListFormHelper.prototype.getValidatorsForSettingType = function (settingType) {
1401
- switch (settingType) {
1402
- case ngConfigcatPublicapi.SettingType.Int:
1403
- return [i1$1.Validators.required,
1404
- i1$1.Validators.min(-2147483648), i1$1.Validators.max(2147483647), i1$1.Validators.pattern('^[-+]?[0-9]\\d*$')];
1405
- case ngConfigcatPublicapi.SettingType.Double:
1406
- return [i1$1.Validators.required, i1$1.Validators.min(-1.79769313486232E+308), i1$1.Validators.max(1.79769313486232E+308)];
1407
- case ngConfigcatPublicapi.SettingType.String:
1408
- case ngConfigcatPublicapi.SettingType.Boolean:
1409
- return [i1$1.Validators.required];
1410
- default:
1411
- return [];
1412
- }
1413
- };
1414
- SettingListFormHelper.prototype.getAllRolloutRules = function (formGroup) {
1415
- var settingValues = formGroup.get('settingValues');
1416
- var rolloutRules = settingValues.controls.map(function (cv) { return cv.get('rolloutRules').value; });
1417
- return rolloutRules.length === 0 ? rolloutRules : rolloutRules.reduce(function (a, b) { return a.concat(b); });
1418
- };
1419
- SettingListFormHelper.prototype.getComparisonAttributes = function (rolloutRules) {
1420
- if (rolloutRules.length > 0) {
1421
- var currentComparisonAttributes = rolloutRules.map(function (r) { return r.comparisonAttribute; });
1422
- var defaultComparisonAttributes_1 = ['Identifier', 'Email', 'Country'];
1423
- var comparisonAttributes = currentComparisonAttributes.filter(function (c) { return defaultComparisonAttributes_1.indexOf(c) === -1; });
1424
- return Array.from(new Set(comparisonAttributes));
1425
- }
1426
- else {
1427
- return [];
1428
- }
1429
- };
1430
- return SettingListFormHelper;
1431
- }());
1432
- SettingListFormHelper.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function SettingListFormHelper_Factory() { return new SettingListFormHelper(i0__namespace.ɵɵinject(i1__namespace$1.FormBuilder)); }, token: SettingListFormHelper, providedIn: "root" });
1433
- SettingListFormHelper.decorators = [
1434
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1435
- ];
1436
- SettingListFormHelper.ctorParameters = function () { return [
1437
- { type: i1$1.FormBuilder }
1438
- ]; };
1439
-
1440
- var SettingListComponent = /** @class */ (function () {
1441
- function SettingListComponent(formHelper, snackBar, dialog) {
1442
- this.formHelper = formHelper;
1443
- this.snackBar = snackBar;
1444
- this.dialog = dialog;
1445
- this.deleteSettingText = 'Delete setting';
1446
- this.showEnvironmentName = false;
1447
- this.editSettingRequested = new i0.EventEmitter();
1448
- this.deleteSettingRequested = new i0.EventEmitter();
1449
- this.formValuesChanged = new i0.EventEmitter();
1450
- this.loading = true;
1451
- this.submitting = false;
1452
- this.showRevertQuestion = false;
1453
- this.showFeedBackMessage = false;
1454
- this.readOnly = false;
1455
- }
1456
- SettingListComponent.prototype.ngOnInit = function () {
1457
- this.reloadSettingValues();
1458
- };
1459
- SettingListComponent.prototype.ngOnChanges = function () {
1460
- this.reloadSettingValues();
1461
- };
1462
- SettingListComponent.prototype.ngOnDestroy = function () {
1463
- if (this.formValuesChangedSubscription) {
1464
- this.formValuesChangedSubscription.unsubscribe();
1465
- this.formValuesChangedSubscription = null;
1466
- }
1467
- };
1468
- SettingListComponent.prototype.reloadSettingValues = function () {
1469
- var _this = this;
1470
- this.showFeedBackMessage = false;
1471
- this.loading = true;
1472
- this.loadSettingValues()
1473
- .subscribe(function (settingValues) {
1474
- _this.readOnly = settingValues.readOnly;
1475
- _this.settingValues = settingValues;
1476
- _this.createFormGroup();
1477
- _this.loading = false;
1478
- }, function (error) {
1479
- _this.snackBar.open('Ooops. We could not load your Feature Flags and Settings. Please try again or contact us.', 'Dismiss', { duration: 60000, panelClass: 'red-snackbar' });
1480
- });
1481
- };
1482
- SettingListComponent.prototype.createFormGroup = function () {
1483
- var _this = this;
1484
- this.formGroup = this.formHelper.createSettingValuesFormGroup(this.settingValues);
1485
- this.formValuesChangedSubscription = this.formGroup.valueChanges.subscribe(function () {
1486
- _this.formValuesChanged.emit();
1487
- });
1488
- };
1489
- SettingListComponent.prototype.settingValuesFormArray = function () {
1490
- return this.formGroup.get('settingValues');
1491
- };
1492
- SettingListComponent.prototype.submit = function () {
1493
- var _this = this;
1494
- if (!this.formGroup || !this.formGroup.valid) {
1495
- this.showFeedBackMessage = true;
1496
- this.formGroup.markAsTouched();
1497
- return;
1498
- }
1499
- this.showFeedBackMessage = false;
1500
- this.submitting = true;
1501
- var updateSettingValuesModel = {
1502
- settingValues: this.formGroup.controls.settingValues.value,
1503
- knownLastUpdatedAt: this.settingValues.lastUpdatedAt,
1504
- forced: false
1505
- };
1506
- if (this.settingValues.reasonRequired) {
1507
- var dialogRef = this.dialog.open(ReasonDialogComponent, {
1508
- width: '450px'
1509
- });
1510
- dialogRef.afterClosed()
1511
- .subscribe(function (result) {
1512
- if (result && result.button === 'save' && result.reason) {
1513
- updateSettingValuesModel.reason = result.reason;
1514
- _this.updateSettingValues(updateSettingValuesModel);
1515
- }
1516
- else {
1517
- _this.submitting = false;
1518
- }
1519
- });
1520
- return;
1521
- }
1522
- this.updateSettingValues(updateSettingValuesModel);
1523
- };
1524
- SettingListComponent.prototype.updateSettingValues = function (updateSettingValuesModel) {
1525
- var _this = this;
1526
- this.onSave(updateSettingValuesModel).subscribe(function (settingValues) {
1527
- _this.settingValues = settingValues;
1528
- _this.createFormGroup();
1529
- _this.submitting = false;
1530
- _this.snackBar.openFromComponent(SaveSnackbarComponent, { duration: 5000, panelClass: 'green-snackbar' });
1531
- }, function (error) {
1532
- if (error.status === 400 && error.error
1533
- && error.error.KnownLastUpdatedAt && error.error.KnownLastUpdatedAt[0] === 'Concurrent update') {
1534
- var dialogRef = _this.dialog.open(ConcurrentDialogComponent, {
1535
- width: '560px'
1536
- });
1537
- dialogRef.afterClosed()
1538
- .subscribe(function (result) {
1539
- if (result && result.button === 'save') {
1540
- updateSettingValuesModel.forced = true;
1541
- _this.updateSettingValues(updateSettingValuesModel);
1542
- }
1543
- else {
1544
- _this.reloadSettingValues();
1545
- _this.submitting = false;
1546
- }
1547
- });
1548
- return;
1549
- }
1550
- if (error.status === 400 && error.error && error.error.Reason && error.error.Reason[0] === 'Reason required') {
1551
- var dialogRef = _this.dialog.open(ReasonDialogComponent, {
1552
- width: '450px'
1553
- });
1554
- dialogRef.afterClosed()
1555
- .subscribe(function (result) {
1556
- if (result && result.button === 'save' && result.reason) {
1557
- updateSettingValuesModel.reason = result.reason;
1558
- _this.updateSettingValues(updateSettingValuesModel);
1559
- }
1560
- else {
1561
- _this.submitting = false;
1562
- }
1563
- });
1564
- return;
1565
- }
1566
- _this.formGroup.setErrors({ internalServerError: 'Internal server error' });
1567
- _this.showFeedBackMessage = true;
1568
- });
1569
- };
1570
- SettingListComponent.prototype.handleRevertYes = function () {
1571
- this.showRevertQuestion = false;
1572
- this.reloadSettingValues();
1573
- };
1574
- SettingListComponent.prototype.handleRevertCancel = function () {
1575
- this.showRevertQuestion = false;
1576
- };
1577
- SettingListComponent.prototype.onEditSettingRequested = function (setting) {
1578
- this.editSettingRequested.emit({
1579
- setting: setting.setting,
1580
- environment: this.settingValues.environment,
1581
- config: this.settingValues.config
1582
- });
1583
- };
1584
- SettingListComponent.prototype.onDeleteSettingRequested = function (setting) {
1585
- this.deleteSettingRequested.emit({
1586
- setting: setting.setting,
1587
- environment: this.settingValues.environment,
1588
- config: this.settingValues.config
1589
- });
1590
- };
1591
- return SettingListComponent;
1592
- }());
1593
- SettingListComponent.decorators = [
1594
- { type: i0.Component, args: [{
1595
- selector: 'configcat-setting-list',
1596
- template: "<form [formGroup]=\"formGroup\" (ngSubmit)=\"submit()\" *ngIf=\"!loading\">\r\n <div class=\"wrapper\" *ngFor=\"let settingValueFromGroup of settingValuesFormArray().controls; let i = index\">\r\n <setting [formGroup]=\"settingValueFromGroup\" [readOnly]=\"readOnly\"\r\n [canEditSetting]=\"canEditSetting\" [canDeleteSetting]=\"canDeleteSetting\"\r\n (editSettingRequested)=\"onEditSettingRequested($event)\"\r\n (deleteSettingRequested)=\"onDeleteSettingRequested($event)\" [deleteSettingText]=\"deleteSettingText\"\r\n [showEnvironmentName]=\"showEnvironmentName\">\r\n </setting>\r\n </div>\r\n\r\n <div class=\"save\" *ngIf=\"!readOnly && !submitting && formGroup.dirty\">\r\n <div class=\"feedback\" *ngIf=\"formGroup.touched && formGroup.invalid && showFeedBackMessage\">\r\n <div class=\"error\" *ngIf=\"formGroup.errors && formGroup.errors.internalServerError\">\r\n <span>Something went wrong and we could not save your settings. You can try again or <a\r\n href=\"https://configcat.com/support\" target=\"_blank\" rel=\"noopener noreferrer\">contact us.</a></span>\r\n </div>\r\n <div class=\"error\" *ngIf=\"!formGroup.errors || !formGroup.errors.internalServerError\">\r\n <span>Oh no! A feature flag has invalid or missing data.</span>\r\n </div>\r\n </div>\r\n <button type=\"button\" mat-stroked-button *ngIf=\"!showRevertQuestion\" (click)=\"showRevertQuestion = true\">\r\n <mat-icon>history</mat-icon><span>Revert changes</span>\r\n </button>\r\n <div *ngIf=\"showRevertQuestion\">\r\n <span class=\"revert\">Revert to last saved state?</span>\r\n <button type=\"button\" class=\"yes\" mat-stroked-button (click)=\"handleRevertYes()\">Yes</button>\r\n <button type=\"button\" mat-stroked-button (click)=\"handleRevertCancel()\">No</button>\r\n </div>\r\n <button class=\"save-button\" mat-flat-button color=\"warn\" type=\"submit\" [disabled]=\"submitting\">\r\n <mat-icon>backup</mat-icon> <span> Save & publish changes</span>\r\n </button>\r\n </div>\r\n</form>\r\n",
1597
- styles: [".wrapper{background-color:#f3f3f3;border:1px solid rgba(0,0,0,.12);border-radius:4px;margin:1em 0}.show-hide a{cursor:pointer;font-size:.8rem}.save{position:-webkit-sticky;position:sticky;bottom:0;min-height:38px;padding:.5rem .5rem .5rem 0;background-color:#fff;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-end;z-index:1000}.save .save-button{-webkit-animation:shadow-pulse 1s 3;animation:shadow-pulse 1s 3;margin-left:1rem}.save>*{margin:.3em}.save .revert{margin:0 16px;font-size:14px}.save .yes{margin:0 5px}.error{background-color:#a32b2d;color:#fff;padding:5px;font-size:.9em}.error a{color:#fff;text-decoration:underline}@media (max-width: 700px){.save{padding:.5rem 0}}\n"]
1598
- },] }
1599
- ];
1600
- SettingListComponent.ctorParameters = function () { return [
1601
- { type: SettingListFormHelper },
1602
- { type: snackBar.MatSnackBar },
1603
- { type: dialog.MatDialog }
1604
- ]; };
1605
- SettingListComponent.propDecorators = {
1606
- canEditSetting: [{ type: i0.Input }],
1607
- canDeleteSetting: [{ type: i0.Input }],
1608
- onSave: [{ type: i0.Input }],
1609
- loadSettingValues: [{ type: i0.Input }],
1610
- deleteSettingText: [{ type: i0.Input }],
1611
- showEnvironmentName: [{ type: i0.Input }],
1612
- editSettingRequested: [{ type: i0.Output }],
1613
- deleteSettingRequested: [{ type: i0.Output }],
1614
- formValuesChanged: [{ type: i0.Output }]
1615
- };
1616
-
1617
- var SettingComponent = /** @class */ (function () {
1618
- function SettingComponent(formHelper, cdRef) {
1619
- this.formHelper = formHelper;
1620
- this.cdRef = cdRef;
1621
- this.deleteSettingText = 'Delete setting';
1622
- this.showEnvironmentName = false;
1623
- this.editSettingRequested = new i0.EventEmitter();
1624
- this.deleteSettingRequested = new i0.EventEmitter();
1625
- this.rulesBeingRendered = false;
1626
- this.SettingType = ngConfigcatPublicapi.SettingType;
1627
- }
1628
- SettingComponent.prototype.ngOnInit = function () { };
1629
- SettingComponent.prototype.environment = function () {
1630
- return this.formGroup.root.get('environment').value;
1631
- };
1632
- SettingComponent.prototype.setting = function () {
1633
- return this.formGroup.get('setting').value;
1634
- };
1635
- SettingComponent.prototype.integrationLinks = function () {
1636
- return this.formGroup.get('integrationLinks');
1637
- };
1638
- SettingComponent.prototype.rolloutRules = function () {
1639
- return this.formGroup.get('rolloutRules');
1640
- };
1641
- SettingComponent.prototype.rolloutPercentageItems = function () {
1642
- return this.formGroup.get('rolloutPercentageItems');
1643
- };
1644
- SettingComponent.prototype.value = function () {
1645
- return this.formGroup.get('value');
1646
- };
1647
- SettingComponent.prototype.addRolloutRule = function () {
1648
- this.rolloutRules().push(this.formHelper.createRolloutRuleFormGroup({
1649
- comparisonAttribute: 'Identifier',
1650
- comparator: ngConfigcatPublicapi.RolloutRuleComparator.SensitiveIsOneOf,
1651
- comparisonValue: '',
1652
- value: this.setting().settingType === ngConfigcatPublicapi.SettingType.Boolean ? false : null
1653
- }, this.readOnly, this.setting().settingType));
1654
- this.rolloutRules().markAsDirty();
1655
- };
1656
- SettingComponent.prototype.removeRolloutRules = function () {
1657
- this.rolloutRules().clear();
1658
- this.rolloutRules().markAsDirty();
1659
- };
1660
- SettingComponent.prototype.addRolloutPercentageItem = function () {
1661
- if (this.rolloutPercentageItems().length === 0) {
1662
- switch (this.setting().settingType) {
1663
- case ngConfigcatPublicapi.SettingType.Boolean:
1664
- this.rolloutPercentageItems().push(this.formHelper.createRolloutPercentageItemFormGroup({
1665
- percentage: 0,
1666
- value: true
1667
- }, this.readOnly, this.setting().settingType));
1668
- this.rolloutPercentageItems().push(this.formHelper.createRolloutPercentageItemFormGroup({
1669
- percentage: 100,
1670
- value: false
1671
- }, this.readOnly, this.setting().settingType));
1672
- break;
1673
- case ngConfigcatPublicapi.SettingType.String:
1674
- case ngConfigcatPublicapi.SettingType.Int:
1675
- case ngConfigcatPublicapi.SettingType.Double:
1676
- for (var i = 0; i < 4; i++) {
1677
- this.rolloutPercentageItems().push(this.formHelper.createRolloutPercentageItemFormGroup({
1678
- percentage: 25,
1679
- value: null
1680
- }, this.readOnly, this.setting().settingType));
1681
- }
1682
- break;
1683
- }
1684
- }
1685
- else if (this.setting().settingType !== ngConfigcatPublicapi.SettingType.Boolean) {
1686
- this.rolloutPercentageItems().push(this.formHelper.createRolloutPercentageItemFormGroup({
1687
- percentage: 0,
1688
- value: null
1689
- }, this.readOnly, this.setting().settingType));
1690
- }
1691
- this.rolloutPercentageItems().markAsDirty();
1692
- };
1693
- SettingComponent.prototype.removeRolloutPercentageItems = function () {
1694
- this.rolloutPercentageItems().clear();
1695
- this.rolloutPercentageItems().markAsDirty();
1696
- };
1697
- SettingComponent.prototype.editSetting = function () {
1698
- this.editSettingRequested.emit({ setting: this.setting() });
1699
- };
1700
- SettingComponent.prototype.deleteSetting = function () {
1701
- this.deleteSettingRequested.emit({ setting: this.setting() });
1702
- };
1703
- return SettingComponent;
1704
- }());
1705
- SettingComponent.decorators = [
1706
- { type: i0.Component, args: [{
1707
- selector: 'setting',
1708
- template: "<div class=\"setting-full\"\r\n [formGroup]=\"formGroup\">\r\n <div class=\"delete\" (click)=\"deleteSetting()\" *ngIf=\"canDeleteSetting\" [matTooltip]=\"deleteSettingText\"\r\n data-robot=\"deleteSetting\">\r\n <mat-icon>cancel</mat-icon>\r\n </div>\r\n <div class=\"setting-header flex\">\r\n <div class=\"setting-name flex\">\r\n <div class=\"name\" data-robot=\"settingName\">\r\n {{setting().name}}\r\n <span *ngIf=\"showEnvironmentName\"> ({{environment().name}})</span>\r\n </div>\r\n <div class=\"edit\" matTooltip=\"Edit name and description\" (click)=\"editSetting()\" *ngIf=\"canEditSetting\"\r\n data-robot=\"renameSetting\">\r\n <mat-icon>edit</mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"setting-content\">\r\n <div class=\"setting-details\">\r\n <div class=\"setting-key\"><code data-robot=\"settingKey\">{{setting().key}}</code></div>\r\n <span *ngIf=\"setting().hint\" class=\"description\">{{setting().hint}}</span>\r\n </div>\r\n\r\n <div class=\"rules-list\">\r\n <div>\r\n <configcat-rollout-rules *ngIf=\"rolloutRules().controls.length !== 0\" [formGroup]=\"formGroup\">\r\n </configcat-rollout-rules>\r\n </div>\r\n\r\n <configcat-rollout-percentage-items *ngIf=\"rolloutPercentageItems().controls.length !== 0\"\r\n [formGroup]=\"formGroup\">\r\n </configcat-rollout-percentage-items>\r\n\r\n <div class=\"all-other flex\">\r\n <div *ngIf=\"rolloutPercentageItems().length === 0 && rolloutRules().length !== 0\"\r\n data-tooltip=\"This value will be served to all users who the above rules don't apply.\">\r\n <mat-chip-list>\r\n <mat-chip class=\"chip\">To all other users, serve:</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n <div *ngIf=\"rolloutPercentageItems().length !== 0\"\r\n data-tooltip=\"This fallback value will be served in case the user can't be identified.\">\r\n <mat-chip-list>\r\n <mat-chip class=\"chip\">To unidentified users, serve:</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n <div *ngIf=\"rolloutPercentageItems().length === 0 && rolloutRules().length === 0\">\r\n <mat-chip-list>\r\n <mat-chip class=\"chip\">To all users, serve:</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n <configcat-value class=\"served-value\" [valueFormControl]=\"value()\" [setting]=\"setting()\">\r\n </configcat-value>\r\n </div>\r\n <div class=\"buttons\">\r\n <button type=\"button\" class=\"sige-button targeting-button\" (click)=\"addRolloutRule()\" *ngIf=\"!readOnly\">\r\n {{rolloutRules().length === 0 ? 'Target specific users' : 'Add new targeting rule'}}\r\n </button>\r\n <button type=\"button\" class=\"sige-button targeting-button\" (click)=\"addRolloutPercentageItem()\"\r\n *ngIf=\"!readOnly\"\r\n [disabled]=\"setting().settingType === SettingType.Boolean && rolloutPercentageItems().length !== 0\">\r\n {{rolloutPercentageItems().length === 0 ? 'Target % of users' : 'Add new % option'}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
1709
- styles: [".setting-full{position:relative;display:flex;flex-wrap:nowrap;flex-direction:column;border-radius:3px}.setting-full .delete{position:absolute;right:-15px;top:-10px;color:#d6a9a9;cursor:pointer}.setting-full .delete:hover{color:#ed5251}.setting-full .delete mat-icon{font-size:20px}.setting-full .setting-header{padding:1.5em 1.5em 0}.setting-full .setting-header .setting-name{flex-direction:row}.setting-full .setting-header .setting-name:hover>.edit{visibility:visible}.setting-full .setting-header .setting-name .name{font-weight:bold;word-wrap:break-word;max-width:100%}.setting-full .setting-header .setting-name .edit{margin:5px 0 0 5px;cursor:pointer;visibility:hidden;color:gray}.setting-full .setting-header .setting-name .edit:hover{visibility:visible}.setting-full .setting-header .setting-name .edit mat-icon{font-size:18px}.setting-full .setting-header .setting-meta{margin-left:auto;margin-right:14px;font-size:.7em;color:gray}.setting-full .setting-content{display:flex}.setting-full .setting-content .setting-details{display:flex;flex-direction:column;width:400px;padding:0 0 1em 1em}.setting-full .setting-content .setting-details>*{margin:.5em}.setting-full .setting-content .setting-details .integrations{font-size:.8rem}.setting-full .setting-content .setting-details .integrations>div{margin:3px}.setting-full .setting-content .setting-details .integrations>div>a:hover{text-decoration:underline}.setting-full .setting-content .setting-details .setting-key{word-wrap:break-word}.setting-full .setting-content .setting-details .description{font-size:.8em;white-space:pre-wrap;word-wrap:break-word;max-width:300px}.setting-full .setting-content .setting-details code{background-color:#d3d3d3;padding:3px 6px}.setting-full .setting-content .rules-list{width:100%;padding:0 1em 1em}.setting-full .setting-content .targeting-button{margin-left:.5rem;margin-right:.5rem;margin-bottom:1em}.all-other{min-height:40px;justify-content:flex-start;border:1px solid #d5d5d5;border-radius:4px;background-color:#fff;margin:.5em 1em;padding:4px 0 4px .5em}.all-other .chip{background-color:#67b1fc3d}.all-other .served-value{margin-left:auto;min-width:100px}.end{margin-left:auto}.buttons{display:flex;margin-left:.5rem;margin-right:.5rem}.buttons .updated-date{font-size:.7em;margin-left:auto;margin-right:22px;color:gray}.flex{display:flex;flex-wrap:wrap;align-items:center}.show-hide-toggle{margin-left:1em;cursor:pointer}.show-hide-toggle a{font-size:.8rem}.sige-button{background-color:#d9eadc;color:#363636;cursor:pointer;justify-content:center;padding:.375em .75em;text-align:center;white-space:nowrap;border-radius:2px;font-size:.75rem;border:1px solid #dbdbdb;box-shadow:none;display:inline-flex;font-family:Montserrat,Roboto,\"Helvetica Neue\",sans-serif}.sige-button:hover{background-color:#bad0be}.sige-button:disabled{background-color:#fff;color:#b3b3b3}@media (max-width: 1200px){.setting-details{width:300px}}@media (max-width: 700px){.setting-full .setting-content{flex-wrap:wrap}.setting-full .setting-content .rules-list{padding:0}.buttons{flex-direction:column}.updated-date{display:none}.setting-details{padding:.2em 0 .2em .2em}.all-other{margin:.5em .3em}}\n"]
1710
- },] }
1711
- ];
1712
- SettingComponent.ctorParameters = function () { return [
1713
- { type: SettingListFormHelper },
1714
- { type: i0.ChangeDetectorRef }
1715
- ]; };
1716
- SettingComponent.propDecorators = {
1717
- formGroup: [{ type: i0.Input }],
1718
- readOnly: [{ type: i0.Input }],
1719
- canEditSetting: [{ type: i0.Input }],
1720
- canDeleteSetting: [{ type: i0.Input }],
1721
- deleteSettingText: [{ type: i0.Input }],
1722
- showEnvironmentName: [{ type: i0.Input }],
1723
- editSettingRequested: [{ type: i0.Output }],
1724
- deleteSettingRequested: [{ type: i0.Output }]
1725
- };
1726
-
1727
- var NgConfigCatPublicApiUIModule = /** @class */ (function () {
1728
- function NgConfigCatPublicApiUIModule() {
1729
- }
1730
- NgConfigCatPublicApiUIModule.forRoot = function (configurationFactory) {
1731
- return {
1732
- ngModule: NgConfigCatPublicApiUIModule,
1733
- providers: [{ provide: Configuration, useFactory: configurationFactory }]
1734
- };
1735
- };
1736
- return NgConfigCatPublicApiUIModule;
1737
- }());
1738
- NgConfigCatPublicApiUIModule.decorators = [
1739
- { type: i0.NgModule, args: [{
1740
- declarations: [
1741
- BaseComponent,
1742
- ProductSelectComponent,
1743
- ConfigSelectComponent,
1744
- EnvironmentSelectComponent,
1745
- SettingSelectComponent,
1746
- SettingItemComponent,
1747
- AuthorizationComponent,
1748
- SettingListComponent,
1749
- SettingComponent,
1750
- RolloutPercentageItemsComponent,
1751
- RolloutRulesComponent,
1752
- ValueComponent,
1753
- ReasonDialogComponent,
1754
- ConcurrentDialogComponent,
1755
- SaveSnackbarComponent,
1756
- ExpandDialogComponent
1757
- ],
1758
- imports: [
1759
- common.CommonModule,
1760
- i1$1.FormsModule,
1761
- i1$1.ReactiveFormsModule,
1762
- animations.BrowserAnimationsModule,
1763
- i1.HttpClientModule,
1764
- ngConfigcatPublicapi.ApiModule,
1765
- formField.MatFormFieldModule,
1766
- core.MatOptionModule,
1767
- select.MatSelectModule,
1768
- button.MatButtonModule,
1769
- input.MatInputModule,
1770
- icon.MatIconModule,
1771
- tooltip.MatTooltipModule,
1772
- chips.MatChipsModule,
1773
- autocomplete.MatAutocompleteModule,
1774
- dragDrop.DragDropModule,
1775
- router.RouterModule,
1776
- snackBar.MatSnackBarModule,
1777
- dialog.MatDialogModule,
1778
- menu.MatMenuModule
1779
- ],
1780
- exports: [
1781
- AuthorizationComponent,
1782
- ProductSelectComponent,
1783
- ConfigSelectComponent,
1784
- EnvironmentSelectComponent,
1785
- SettingSelectComponent,
1786
- SettingItemComponent
1787
- ]
1788
- },] }
1789
- ];
1790
- NgConfigCatPublicApiUIModule.ctorParameters = function () { return []; };
1791
-
1792
- /*
1793
- * Public API Surface of ng-configcat-publicapi-ui
1794
- */
1795
-
1796
- /**
1797
- * Generated bundle index. Do not edit.
1798
- */
1799
-
1800
- exports.AuthorizationComponent = AuthorizationComponent;
1801
- exports.ConfigSelectComponent = ConfigSelectComponent;
1802
- exports.EnvironmentSelectComponent = EnvironmentSelectComponent;
1803
- exports.NgConfigCatPublicApiUIModule = NgConfigCatPublicApiUIModule;
1804
- exports.ProductSelectComponent = ProductSelectComponent;
1805
- exports.PublicApiService = PublicApiService;
1806
- exports.SettingItemComponent = SettingItemComponent;
1807
- exports.SettingSelectComponent = SettingSelectComponent;
1808
- exports["ɵa"] = BaseComponent;
1809
- exports["ɵb"] = PublicApiService;
1810
- exports["ɵc"] = Configuration;
1811
- exports["ɵd"] = PublicApiService;
1812
- exports["ɵe"] = SettingListComponent;
1813
- exports["ɵf"] = SettingListFormHelper;
1814
- exports["ɵg"] = SettingComponent;
1815
- exports["ɵh"] = RolloutPercentageItemsComponent;
1816
- exports["ɵi"] = RolloutRulesComponent;
1817
- exports["ɵj"] = ValueComponent;
1818
- exports["ɵk"] = ReasonDialogComponent;
1819
- exports["ɵl"] = ConcurrentDialogComponent;
1820
- exports["ɵm"] = SaveSnackbarComponent;
1821
- exports["ɵn"] = ExpandDialogComponent;
1822
-
1823
- Object.defineProperty(exports, '__esModule', { value: true });
1824
-
1825
- }));
1826
- //# sourceMappingURL=ng-configcat-publicapi-ui.umd.js.map