ng-configcat-publicapi-ui 2.3.2 → 2.5.1

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