@taiga-ui/addon-charts 3.70.0-canary.e02fd1e → 3.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,661 +1,515 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@taiga-ui/cdk'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/addon-charts/components/arc-chart', ['exports', '@angular/core', '@angular/platform-browser', '@taiga-ui/cdk', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-charts"] = global["taiga-ui"]["addon-charts"] || {}, global["taiga-ui"]["addon-charts"].components = global["taiga-ui"]["addon-charts"].components || {}, global["taiga-ui"]["addon-charts"].components["arc-chart"] = {}), global.ng.core, global.ng.platformBrowser, global.i1, global.rxjs, global.rxjs.operators));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@taiga-ui/cdk'), require('rxjs'), require('rxjs/operators')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/addon-charts/components/arc-chart', ['exports', '@angular/core', '@angular/platform-browser', '@taiga-ui/cdk', 'rxjs', 'rxjs/operators'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-charts"] = global["taiga-ui"]["addon-charts"] || {}, global["taiga-ui"]["addon-charts"].components = global["taiga-ui"]["addon-charts"].components || {}, global["taiga-ui"]["addon-charts"].components["arc-chart"] = {}), global.ng.core, global.ng.platformBrowser, global.i1, global.rxjs, global.rxjs.operators));
5
5
  })(this, (function (exports, i0, i2, i1, i3, operators) { 'use strict';
6
6
 
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
18
20
  }
19
- });
21
+ n["default"] = e;
22
+ return Object.freeze(n);
20
23
  }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
24
 
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
27
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
29
29
 
30
- /******************************************************************************
31
- Copyright (c) Microsoft Corporation.
30
+ /*! *****************************************************************************
31
+ Copyright (c) Microsoft Corporation.
32
32
 
33
- Permission to use, copy, modify, and/or distribute this software for any
34
- purpose with or without fee is hereby granted.
33
+ Permission to use, copy, modify, and/or distribute this software for any
34
+ purpose with or without fee is hereby granted.
35
35
 
36
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
- PERFORMANCE OF THIS SOFTWARE.
43
- ***************************************************************************** */
44
- /* global Reflect, Promise, SuppressedError, Symbol */
45
- var extendStatics = function (d, b) {
46
- extendStatics = Object.setPrototypeOf ||
47
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
48
- function (d, b) { for (var p in b)
49
- if (Object.prototype.hasOwnProperty.call(b, p))
50
- d[p] = b[p]; };
51
- return extendStatics(d, b);
52
- };
53
- function __extends(d, b) {
54
- if (typeof b !== "function" && b !== null)
55
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
56
- extendStatics(d, b);
57
- function __() { this.constructor = d; }
58
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
59
- }
60
- var __assign = function () {
61
- __assign = Object.assign || function __assign(t) {
62
- for (var s, i = 1, n = arguments.length; i < n; i++) {
63
- s = arguments[i];
64
- for (var p in s)
65
- if (Object.prototype.hasOwnProperty.call(s, p))
66
- t[p] = s[p];
67
- }
68
- return t;
69
- };
70
- return __assign.apply(this, arguments);
71
- };
72
- function __rest(s, e) {
73
- var t = {};
74
- for (var p in s)
75
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
76
- t[p] = s[p];
77
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
78
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
79
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
80
- t[p[i]] = s[p[i]];
81
- }
82
- return t;
83
- }
84
- function __decorate(decorators, target, key, desc) {
85
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
86
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
87
- r = Reflect.decorate(decorators, target, key, desc);
88
- else
89
- for (var i = decorators.length - 1; i >= 0; i--)
90
- if (d = decorators[i])
91
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
92
- return c > 3 && r && Object.defineProperty(target, key, r), r;
93
- }
94
- function __param(paramIndex, decorator) {
95
- return function (target, key) { decorator(target, key, paramIndex); };
96
- }
97
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
98
- function accept(f) { if (f !== void 0 && typeof f !== "function")
99
- throw new TypeError("Function expected"); return f; }
100
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
101
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
102
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
103
- var _, done = false;
104
- for (var i = decorators.length - 1; i >= 0; i--) {
105
- var context = {};
106
- for (var p in contextIn)
107
- context[p] = p === "access" ? {} : contextIn[p];
108
- for (var p in contextIn.access)
109
- context.access[p] = contextIn.access[p];
110
- context.addInitializer = function (f) { if (done)
111
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
112
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
113
- if (kind === "accessor") {
114
- if (result === void 0)
115
- continue;
116
- if (result === null || typeof result !== "object")
117
- throw new TypeError("Object expected");
118
- if (_ = accept(result.get))
119
- descriptor.get = _;
120
- if (_ = accept(result.set))
121
- descriptor.set = _;
122
- if (_ = accept(result.init))
123
- initializers.unshift(_);
124
- }
125
- else if (_ = accept(result)) {
126
- if (kind === "field")
127
- initializers.unshift(_);
128
- else
129
- descriptor[key] = _;
130
- }
131
- }
132
- if (target)
133
- Object.defineProperty(target, contextIn.name, descriptor);
134
- done = true;
135
- }
136
- ;
137
- function __runInitializers(thisArg, initializers, value) {
138
- var useValue = arguments.length > 2;
139
- for (var i = 0; i < initializers.length; i++) {
140
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
141
- }
142
- return useValue ? value : void 0;
143
- }
144
- ;
145
- function __propKey(x) {
146
- return typeof x === "symbol" ? x : "".concat(x);
147
- }
148
- ;
149
- function __setFunctionName(f, name, prefix) {
150
- if (typeof name === "symbol")
151
- name = name.description ? "[".concat(name.description, "]") : "";
152
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
153
- }
154
- ;
155
- function __metadata(metadataKey, metadataValue) {
156
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
157
- return Reflect.metadata(metadataKey, metadataValue);
158
- }
159
- function __awaiter(thisArg, _arguments, P, generator) {
160
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
161
- return new (P || (P = Promise))(function (resolve, reject) {
162
- function fulfilled(value) { try {
163
- step(generator.next(value));
164
- }
165
- catch (e) {
166
- reject(e);
167
- } }
168
- function rejected(value) { try {
169
- step(generator["throw"](value));
170
- }
171
- catch (e) {
172
- reject(e);
173
- } }
174
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
175
- step((generator = generator.apply(thisArg, _arguments || [])).next());
176
- });
177
- }
178
- function __generator(thisArg, body) {
179
- var _ = { label: 0, sent: function () { if (t[0] & 1)
180
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
181
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
182
- function verb(n) { return function (v) { return step([n, v]); }; }
183
- function step(op) {
184
- if (f)
185
- throw new TypeError("Generator is already executing.");
186
- while (g && (g = 0, op[0] && (_ = 0)), _)
187
- try {
188
- 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)
189
- return t;
190
- if (y = 0, t)
191
- op = [op[0] & 2, t.value];
192
- switch (op[0]) {
193
- case 0:
194
- case 1:
195
- t = op;
196
- break;
197
- case 4:
198
- _.label++;
199
- return { value: op[1], done: false };
200
- case 5:
201
- _.label++;
202
- y = op[1];
203
- op = [0];
204
- continue;
205
- case 7:
206
- op = _.ops.pop();
207
- _.trys.pop();
208
- continue;
209
- default:
210
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
211
- _ = 0;
212
- continue;
213
- }
214
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
215
- _.label = op[1];
216
- break;
217
- }
218
- if (op[0] === 6 && _.label < t[1]) {
219
- _.label = t[1];
220
- t = op;
221
- break;
222
- }
223
- if (t && _.label < t[2]) {
224
- _.label = t[2];
225
- _.ops.push(op);
226
- break;
227
- }
228
- if (t[2])
229
- _.ops.pop();
230
- _.trys.pop();
231
- continue;
232
- }
233
- op = body.call(thisArg, _);
234
- }
235
- catch (e) {
236
- op = [6, e];
237
- y = 0;
238
- }
239
- finally {
240
- f = t = 0;
241
- }
242
- if (op[0] & 5)
243
- throw op[1];
244
- return { value: op[0] ? op[1] : void 0, done: true };
245
- }
246
- }
247
- var __createBinding = Object.create ? (function (o, m, k, k2) {
248
- if (k2 === undefined)
249
- k2 = k;
250
- var desc = Object.getOwnPropertyDescriptor(m, k);
251
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
252
- desc = { enumerable: true, get: function () { return m[k]; } };
253
- }
254
- Object.defineProperty(o, k2, desc);
255
- }) : (function (o, m, k, k2) {
256
- if (k2 === undefined)
257
- k2 = k;
258
- o[k2] = m[k];
259
- });
260
- function __exportStar(m, o) {
261
- for (var p in m)
262
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
263
- __createBinding(o, m, p);
264
- }
265
- function __values(o) {
266
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
267
- if (m)
268
- return m.call(o);
269
- if (o && typeof o.length === "number")
270
- return {
271
- next: function () {
272
- if (o && i >= o.length)
273
- o = void 0;
274
- return { value: o && o[i++], done: !o };
275
- }
276
- };
277
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
278
- }
279
- function __read(o, n) {
280
- var m = typeof Symbol === "function" && o[Symbol.iterator];
281
- if (!m)
282
- return o;
283
- var i = m.call(o), r, ar = [], e;
284
- try {
285
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
286
- ar.push(r.value);
287
- }
288
- catch (error) {
289
- e = { error: error };
290
- }
291
- finally {
292
- try {
293
- if (r && !r.done && (m = i["return"]))
294
- m.call(i);
295
- }
296
- finally {
297
- if (e)
298
- throw e.error;
299
- }
300
- }
301
- return ar;
302
- }
303
- /** @deprecated */
304
- function __spread() {
305
- for (var ar = [], i = 0; i < arguments.length; i++)
306
- ar = ar.concat(__read(arguments[i]));
307
- return ar;
308
- }
309
- /** @deprecated */
310
- function __spreadArrays() {
311
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
312
- s += arguments[i].length;
313
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
314
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
315
- r[k] = a[j];
316
- return r;
317
- }
318
- function __spreadArray(to, from, pack) {
319
- if (pack || arguments.length === 2)
320
- for (var i = 0, l = from.length, ar; i < l; i++) {
321
- if (ar || !(i in from)) {
322
- if (!ar)
323
- ar = Array.prototype.slice.call(from, 0, i);
324
- ar[i] = from[i];
325
- }
326
- }
327
- return to.concat(ar || Array.prototype.slice.call(from));
328
- }
329
- function __await(v) {
330
- return this instanceof __await ? (this.v = v, this) : new __await(v);
331
- }
332
- function __asyncGenerator(thisArg, _arguments, generator) {
333
- if (!Symbol.asyncIterator)
334
- throw new TypeError("Symbol.asyncIterator is not defined.");
335
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
336
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
337
- function verb(n) { if (g[n])
338
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
339
- function resume(n, v) { try {
340
- step(g[n](v));
341
- }
342
- catch (e) {
343
- settle(q[0][3], e);
344
- } }
345
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
346
- function fulfill(value) { resume("next", value); }
347
- function reject(value) { resume("throw", value); }
348
- function settle(f, v) { if (f(v), q.shift(), q.length)
349
- resume(q[0][0], q[0][1]); }
350
- }
351
- function __asyncDelegator(o) {
352
- var i, p;
353
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
354
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
355
- }
356
- function __asyncValues(o) {
357
- if (!Symbol.asyncIterator)
358
- throw new TypeError("Symbol.asyncIterator is not defined.");
359
- var m = o[Symbol.asyncIterator], i;
360
- 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);
361
- 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); }); }; }
362
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
363
- }
364
- function __makeTemplateObject(cooked, raw) {
365
- if (Object.defineProperty) {
366
- Object.defineProperty(cooked, "raw", { value: raw });
367
- }
368
- else {
369
- cooked.raw = raw;
370
- }
371
- return cooked;
372
- }
373
- ;
374
- var __setModuleDefault = Object.create ? (function (o, v) {
375
- Object.defineProperty(o, "default", { enumerable: true, value: v });
376
- }) : function (o, v) {
377
- o["default"] = v;
378
- };
379
- function __importStar(mod) {
380
- if (mod && mod.__esModule)
381
- return mod;
382
- var result = {};
383
- if (mod != null)
384
- for (var k in mod)
385
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
386
- __createBinding(result, mod, k);
387
- __setModuleDefault(result, mod);
388
- return result;
389
- }
390
- function __importDefault(mod) {
391
- return (mod && mod.__esModule) ? mod : { default: mod };
392
- }
393
- function __classPrivateFieldGet(receiver, state, kind, f) {
394
- if (kind === "a" && !f)
395
- throw new TypeError("Private accessor was defined without a getter");
396
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
397
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
398
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
399
- }
400
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
401
- if (kind === "m")
402
- throw new TypeError("Private method is not writable");
403
- if (kind === "a" && !f)
404
- throw new TypeError("Private accessor was defined without a setter");
405
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
406
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
407
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
408
- }
409
- function __classPrivateFieldIn(state, receiver) {
410
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
411
- throw new TypeError("Cannot use 'in' operator on non-object");
412
- return typeof state === "function" ? receiver === state : state.has(receiver);
413
- }
414
- function __addDisposableResource(env, value, async) {
415
- if (value !== null && value !== void 0) {
416
- if (typeof value !== "object" && typeof value !== "function")
417
- throw new TypeError("Object expected.");
418
- var dispose;
419
- if (async) {
420
- if (!Symbol.asyncDispose)
421
- throw new TypeError("Symbol.asyncDispose is not defined.");
422
- dispose = value[Symbol.asyncDispose];
423
- }
424
- if (dispose === void 0) {
425
- if (!Symbol.dispose)
426
- throw new TypeError("Symbol.dispose is not defined.");
427
- dispose = value[Symbol.dispose];
428
- }
429
- if (typeof dispose !== "function")
430
- throw new TypeError("Object not disposable.");
431
- env.stack.push({ value: value, dispose: dispose, async: async });
432
- }
433
- else if (async) {
434
- env.stack.push({ async: true });
435
- }
436
- return value;
437
- }
438
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
439
- var e = new Error(message);
440
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
441
- };
442
- function __disposeResources(env) {
443
- function fail(e) {
444
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
445
- env.hasError = true;
446
- }
447
- function next() {
448
- while (env.stack.length) {
449
- var rec = env.stack.pop();
450
- try {
451
- var result = rec.dispose && rec.dispose.call(rec.value);
452
- if (rec.async)
453
- return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
454
- }
455
- catch (e) {
456
- fail(e);
457
- }
458
- }
459
- if (env.hasError)
460
- throw env.error;
461
- }
462
- return next();
463
- }
464
- var tslib_es6 = {
465
- __extends: __extends,
466
- __assign: __assign,
467
- __rest: __rest,
468
- __decorate: __decorate,
469
- __param: __param,
470
- __metadata: __metadata,
471
- __awaiter: __awaiter,
472
- __generator: __generator,
473
- __createBinding: __createBinding,
474
- __exportStar: __exportStar,
475
- __values: __values,
476
- __read: __read,
477
- __spread: __spread,
478
- __spreadArrays: __spreadArrays,
479
- __spreadArray: __spreadArray,
480
- __await: __await,
481
- __asyncGenerator: __asyncGenerator,
482
- __asyncDelegator: __asyncDelegator,
483
- __asyncValues: __asyncValues,
484
- __makeTemplateObject: __makeTemplateObject,
485
- __importStar: __importStar,
486
- __importDefault: __importDefault,
487
- __classPrivateFieldGet: __classPrivateFieldGet,
488
- __classPrivateFieldSet: __classPrivateFieldSet,
489
- __classPrivateFieldIn: __classPrivateFieldIn,
490
- __addDisposableResource: __addDisposableResource,
491
- __disposeResources: __disposeResources,
492
- };
36
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
+ PERFORMANCE OF THIS SOFTWARE.
43
+ ***************************************************************************** */
44
+ /* global Reflect, Promise */
45
+ var extendStatics = function (d, b) {
46
+ extendStatics = Object.setPrototypeOf ||
47
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
48
+ function (d, b) { for (var p in b)
49
+ if (Object.prototype.hasOwnProperty.call(b, p))
50
+ d[p] = b[p]; };
51
+ return extendStatics(d, b);
52
+ };
53
+ function __extends(d, b) {
54
+ if (typeof b !== "function" && b !== null)
55
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
56
+ extendStatics(d, b);
57
+ function __() { this.constructor = d; }
58
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
59
+ }
60
+ var __assign = function () {
61
+ __assign = Object.assign || function __assign(t) {
62
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
63
+ s = arguments[i];
64
+ for (var p in s)
65
+ if (Object.prototype.hasOwnProperty.call(s, p))
66
+ t[p] = s[p];
67
+ }
68
+ return t;
69
+ };
70
+ return __assign.apply(this, arguments);
71
+ };
72
+ function __rest(s, e) {
73
+ var t = {};
74
+ for (var p in s)
75
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
76
+ t[p] = s[p];
77
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
78
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
79
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
80
+ t[p[i]] = s[p[i]];
81
+ }
82
+ return t;
83
+ }
84
+ function __decorate(decorators, target, key, desc) {
85
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
86
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
87
+ r = Reflect.decorate(decorators, target, key, desc);
88
+ else
89
+ for (var i = decorators.length - 1; i >= 0; i--)
90
+ if (d = decorators[i])
91
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
92
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
93
+ }
94
+ function __param(paramIndex, decorator) {
95
+ return function (target, key) { decorator(target, key, paramIndex); };
96
+ }
97
+ function __metadata(metadataKey, metadataValue) {
98
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
99
+ return Reflect.metadata(metadataKey, metadataValue);
100
+ }
101
+ function __awaiter(thisArg, _arguments, P, generator) {
102
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103
+ return new (P || (P = Promise))(function (resolve, reject) {
104
+ function fulfilled(value) { try {
105
+ step(generator.next(value));
106
+ }
107
+ catch (e) {
108
+ reject(e);
109
+ } }
110
+ function rejected(value) { try {
111
+ step(generator["throw"](value));
112
+ }
113
+ catch (e) {
114
+ reject(e);
115
+ } }
116
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
117
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
118
+ });
119
+ }
120
+ function __generator(thisArg, body) {
121
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
122
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
123
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
124
+ function verb(n) { return function (v) { return step([n, v]); }; }
125
+ function step(op) {
126
+ if (f)
127
+ throw new TypeError("Generator is already executing.");
128
+ while (_)
129
+ try {
130
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
131
+ return t;
132
+ if (y = 0, t)
133
+ op = [op[0] & 2, t.value];
134
+ switch (op[0]) {
135
+ case 0:
136
+ case 1:
137
+ t = op;
138
+ break;
139
+ case 4:
140
+ _.label++;
141
+ return { value: op[1], done: false };
142
+ case 5:
143
+ _.label++;
144
+ y = op[1];
145
+ op = [0];
146
+ continue;
147
+ case 7:
148
+ op = _.ops.pop();
149
+ _.trys.pop();
150
+ continue;
151
+ default:
152
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
153
+ _ = 0;
154
+ continue;
155
+ }
156
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
157
+ _.label = op[1];
158
+ break;
159
+ }
160
+ if (op[0] === 6 && _.label < t[1]) {
161
+ _.label = t[1];
162
+ t = op;
163
+ break;
164
+ }
165
+ if (t && _.label < t[2]) {
166
+ _.label = t[2];
167
+ _.ops.push(op);
168
+ break;
169
+ }
170
+ if (t[2])
171
+ _.ops.pop();
172
+ _.trys.pop();
173
+ continue;
174
+ }
175
+ op = body.call(thisArg, _);
176
+ }
177
+ catch (e) {
178
+ op = [6, e];
179
+ y = 0;
180
+ }
181
+ finally {
182
+ f = t = 0;
183
+ }
184
+ if (op[0] & 5)
185
+ throw op[1];
186
+ return { value: op[0] ? op[1] : void 0, done: true };
187
+ }
188
+ }
189
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
190
+ if (k2 === undefined)
191
+ k2 = k;
192
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
193
+ }) : (function (o, m, k, k2) {
194
+ if (k2 === undefined)
195
+ k2 = k;
196
+ o[k2] = m[k];
197
+ });
198
+ function __exportStar(m, o) {
199
+ for (var p in m)
200
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
201
+ __createBinding(o, m, p);
202
+ }
203
+ function __values(o) {
204
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
205
+ if (m)
206
+ return m.call(o);
207
+ if (o && typeof o.length === "number")
208
+ return {
209
+ next: function () {
210
+ if (o && i >= o.length)
211
+ o = void 0;
212
+ return { value: o && o[i++], done: !o };
213
+ }
214
+ };
215
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
216
+ }
217
+ function __read(o, n) {
218
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
219
+ if (!m)
220
+ return o;
221
+ var i = m.call(o), r, ar = [], e;
222
+ try {
223
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
224
+ ar.push(r.value);
225
+ }
226
+ catch (error) {
227
+ e = { error: error };
228
+ }
229
+ finally {
230
+ try {
231
+ if (r && !r.done && (m = i["return"]))
232
+ m.call(i);
233
+ }
234
+ finally {
235
+ if (e)
236
+ throw e.error;
237
+ }
238
+ }
239
+ return ar;
240
+ }
241
+ /** @deprecated */
242
+ function __spread() {
243
+ for (var ar = [], i = 0; i < arguments.length; i++)
244
+ ar = ar.concat(__read(arguments[i]));
245
+ return ar;
246
+ }
247
+ /** @deprecated */
248
+ function __spreadArrays() {
249
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
250
+ s += arguments[i].length;
251
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
252
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
253
+ r[k] = a[j];
254
+ return r;
255
+ }
256
+ function __spreadArray(to, from, pack) {
257
+ if (pack || arguments.length === 2)
258
+ for (var i = 0, l = from.length, ar; i < l; i++) {
259
+ if (ar || !(i in from)) {
260
+ if (!ar)
261
+ ar = Array.prototype.slice.call(from, 0, i);
262
+ ar[i] = from[i];
263
+ }
264
+ }
265
+ return to.concat(ar || from);
266
+ }
267
+ function __await(v) {
268
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
269
+ }
270
+ function __asyncGenerator(thisArg, _arguments, generator) {
271
+ if (!Symbol.asyncIterator)
272
+ throw new TypeError("Symbol.asyncIterator is not defined.");
273
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
274
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
275
+ function verb(n) { if (g[n])
276
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
277
+ function resume(n, v) { try {
278
+ step(g[n](v));
279
+ }
280
+ catch (e) {
281
+ settle(q[0][3], e);
282
+ } }
283
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
284
+ function fulfill(value) { resume("next", value); }
285
+ function reject(value) { resume("throw", value); }
286
+ function settle(f, v) { if (f(v), q.shift(), q.length)
287
+ resume(q[0][0], q[0][1]); }
288
+ }
289
+ function __asyncDelegator(o) {
290
+ var i, p;
291
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
292
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
293
+ }
294
+ function __asyncValues(o) {
295
+ if (!Symbol.asyncIterator)
296
+ throw new TypeError("Symbol.asyncIterator is not defined.");
297
+ var m = o[Symbol.asyncIterator], i;
298
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
299
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
300
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
301
+ }
302
+ function __makeTemplateObject(cooked, raw) {
303
+ if (Object.defineProperty) {
304
+ Object.defineProperty(cooked, "raw", { value: raw });
305
+ }
306
+ else {
307
+ cooked.raw = raw;
308
+ }
309
+ return cooked;
310
+ }
311
+ ;
312
+ var __setModuleDefault = Object.create ? (function (o, v) {
313
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
314
+ }) : function (o, v) {
315
+ o["default"] = v;
316
+ };
317
+ function __importStar(mod) {
318
+ if (mod && mod.__esModule)
319
+ return mod;
320
+ var result = {};
321
+ if (mod != null)
322
+ for (var k in mod)
323
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
324
+ __createBinding(result, mod, k);
325
+ __setModuleDefault(result, mod);
326
+ return result;
327
+ }
328
+ function __importDefault(mod) {
329
+ return (mod && mod.__esModule) ? mod : { default: mod };
330
+ }
331
+ function __classPrivateFieldGet(receiver, state, kind, f) {
332
+ if (kind === "a" && !f)
333
+ throw new TypeError("Private accessor was defined without a getter");
334
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
335
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
336
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
337
+ }
338
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
339
+ if (kind === "m")
340
+ throw new TypeError("Private method is not writable");
341
+ if (kind === "a" && !f)
342
+ throw new TypeError("Private accessor was defined without a setter");
343
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
344
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
345
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
346
+ }
493
347
 
494
- // 3/4 with 1% safety offset
495
- var ARC = 0.76;
496
- var SIZE = {
497
- m: 9,
498
- l: 11,
499
- xl: 16,
500
- };
501
- var WIDTH = {
502
- m: 0.25,
503
- l: 0.375,
504
- xl: 0.5625,
505
- };
506
- var GAP = {
507
- m: 0.125,
508
- l: 0.1875,
509
- xl: 0.25,
510
- };
511
- function arcsToIndex(arcs) {
512
- return arcs.map(function (_a, index) {
513
- var nativeElement = _a.nativeElement;
514
- return i3.merge(i1.tuiTypedFromEvent(nativeElement, 'mouseenter').pipe(operators.map(function () { return index; })), i1.tuiTypedFromEvent(nativeElement, 'mouseleave').pipe(operators.map(function () { return NaN; })));
515
- });
516
- }
517
- var TuiArcChartComponent = /** @class */ (function () {
518
- function TuiArcChartComponent(sanitizer, cdr, destroy$) {
519
- var _this = this;
520
- this.sanitizer = sanitizer;
521
- this.arcs$ = new i3.ReplaySubject(1);
522
- this.value = [];
523
- this.size = 'm';
524
- this.max = 100;
525
- this.minLabel = '0%';
526
- this.maxLabel = '100%';
527
- this.activeItemIndex = NaN;
528
- this.activeItemIndexChange = this.arcs$.pipe(operators.switchMap(function (arcs) { return arcs.changes.pipe(operators.startWith(null), operators.switchMap(function () { return i3.merge.apply(void 0, __spreadArray([], __read(arcsToIndex(arcs)))); })); }), operators.tap(function (index) {
529
- _this.activeItemIndex = index;
530
- }));
531
- this.initialized = false;
532
- i3.timer(0)
533
- .pipe(i1.tuiWatch(cdr), operators.takeUntil(destroy$))
534
- .subscribe(function () {
535
- _this.initialized = true;
536
- });
537
- }
538
- Object.defineProperty(TuiArcChartComponent.prototype, "arcs", {
539
- set: function (arcs) {
540
- this.arcs$.next(arcs);
541
- },
542
- enumerable: false,
543
- configurable: true
544
- });
545
- Object.defineProperty(TuiArcChartComponent.prototype, "width", {
546
- get: function () {
547
- return SIZE[this.size];
548
- },
549
- enumerable: false,
550
- configurable: true
551
- });
552
- Object.defineProperty(TuiArcChartComponent.prototype, "strokeWidth", {
553
- get: function () {
554
- return WIDTH[this.size];
555
- },
556
- enumerable: false,
557
- configurable: true
558
- });
559
- TuiArcChartComponent.prototype.isInactive = function (index) {
560
- return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;
561
- };
562
- TuiArcChartComponent.prototype.getInset = function (index) {
563
- return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);
564
- };
565
- TuiArcChartComponent.prototype.getDiameter = function (index) {
566
- return SIZE[this.size] - 2 * this.getInset(index);
567
- };
568
- TuiArcChartComponent.prototype.getLength = function (index) {
569
- return Math.PI * this.getDiameter(index) * ARC;
570
- };
571
- TuiArcChartComponent.prototype.getOffset = function (index) {
572
- return this.getLength(index) * (1 - Math.min(this.value[index] / this.max, 1));
573
- };
574
- TuiArcChartComponent.prototype.getColor = function (index) {
575
- return this.sanitizer.bypassSecurityTrustStyle("var(--tui-chart-" + index + ", var(--tui-support-0" + (index + 1) + "))");
576
- };
577
- return TuiArcChartComponent;
578
- }());
579
- TuiArcChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartComponent, deps: [{ token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }, { token: i1.TuiDestroyService, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
580
- TuiArcChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiArcChartComponent, selector: "tui-arc-chart", inputs: { value: "value", size: "size", max: "max", minLabel: "minLabel", maxLabel: "maxLabel", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "this.size", "style.width.rem": "this.width", "style.height.rem": "this.width", "style.strokeWidth.rem": "this.strokeWidth" } }, providers: [i1.TuiDestroyService], viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true }], ngImport: i0__namespace, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(index)\"\n>\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive(index)\"\n [style.stroke]=\"getColor(index)\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content></ng-content>\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-secondary);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-02);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-01)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:bold}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:bold}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;width:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-02)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"], directives: [{ type: i1__namespace.TuiRepeatTimesDirective, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
581
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartComponent, decorators: [{
582
- type: i0.Component,
583
- args: [{
584
- selector: 'tui-arc-chart',
585
- templateUrl: './arc-chart.template.html',
586
- styleUrls: ['./arc-chart.style.less'],
587
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
588
- providers: [i1.TuiDestroyService],
589
- }]
590
- }], ctorParameters: function () {
591
- return [{ type: i2__namespace.DomSanitizer, decorators: [{
592
- type: i0.Inject,
593
- args: [i2.DomSanitizer]
594
- }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
595
- type: i0.Inject,
596
- args: [i0.ChangeDetectorRef]
597
- }] }, { type: i3__namespace.Observable, decorators: [{
598
- type: i0.Self
599
- }, {
600
- type: i0.Inject,
601
- args: [i1.TuiDestroyService]
602
- }] }];
603
- }, propDecorators: { arcs: [{
604
- type: i0.ViewChildren,
605
- args: ['arc']
606
- }], value: [{
607
- type: i0.Input
608
- }], size: [{
609
- type: i0.Input
610
- }, {
611
- type: i0.HostBinding,
612
- args: ['attr.data-size']
613
- }], max: [{
614
- type: i0.Input
615
- }], minLabel: [{
616
- type: i0.Input
617
- }], maxLabel: [{
618
- type: i0.Input
619
- }], activeItemIndex: [{
620
- type: i0.Input
621
- }], activeItemIndexChange: [{
622
- type: i0.Output
623
- }], width: [{
624
- type: i0.HostBinding,
625
- args: ['style.width.rem']
626
- }, {
627
- type: i0.HostBinding,
628
- args: ['style.height.rem']
629
- }], strokeWidth: [{
630
- type: i0.HostBinding,
631
- args: ['style.strokeWidth.rem']
632
- }] } });
348
+ // 3/4 with 1% safety offset
349
+ var ARC = 0.76;
350
+ var SIZE = {
351
+ m: 9,
352
+ l: 11,
353
+ xl: 16,
354
+ };
355
+ var WIDTH = {
356
+ m: 0.25,
357
+ l: 0.375,
358
+ xl: 0.5625,
359
+ };
360
+ var GAP = {
361
+ m: 0.125,
362
+ l: 0.1875,
363
+ xl: 0.25,
364
+ };
365
+ function arcsToIndex(arcs) {
366
+ return arcs.map(function (_a, index) {
367
+ var nativeElement = _a.nativeElement;
368
+ return i3.merge(i1.tuiTypedFromEvent(nativeElement, 'mouseenter').pipe(operators.map(function () { return index; })), i1.tuiTypedFromEvent(nativeElement, 'mouseleave').pipe(operators.map(function () { return NaN; })));
369
+ });
370
+ }
371
+ var TuiArcChartComponent = /** @class */ (function () {
372
+ function TuiArcChartComponent(sanitizer, cdr, destroy$) {
373
+ var _this = this;
374
+ this.sanitizer = sanitizer;
375
+ this.arcs$ = new i3.ReplaySubject(1);
376
+ this.value = [];
377
+ this.size = 'm';
378
+ this.max = 100;
379
+ this.minLabel = '0%';
380
+ this.maxLabel = '100%';
381
+ this.activeItemIndex = NaN;
382
+ this.activeItemIndexChange = this.arcs$.pipe(operators.switchMap(function (arcs) { return arcs.changes.pipe(operators.startWith(null), operators.switchMap(function () { return i3.merge.apply(void 0, __spreadArray([], __read(arcsToIndex(arcs)))); })); }), operators.tap(function (index) {
383
+ _this.activeItemIndex = index;
384
+ }));
385
+ this.initialized = false;
386
+ i3.timer(0)
387
+ .pipe(i1.tuiWatch(cdr), operators.takeUntil(destroy$))
388
+ .subscribe(function () {
389
+ _this.initialized = true;
390
+ });
391
+ }
392
+ Object.defineProperty(TuiArcChartComponent.prototype, "arcs", {
393
+ set: function (arcs) {
394
+ this.arcs$.next(arcs);
395
+ },
396
+ enumerable: false,
397
+ configurable: true
398
+ });
399
+ Object.defineProperty(TuiArcChartComponent.prototype, "width", {
400
+ get: function () {
401
+ return SIZE[this.size];
402
+ },
403
+ enumerable: false,
404
+ configurable: true
405
+ });
406
+ Object.defineProperty(TuiArcChartComponent.prototype, "strokeWidth", {
407
+ get: function () {
408
+ return WIDTH[this.size];
409
+ },
410
+ enumerable: false,
411
+ configurable: true
412
+ });
413
+ TuiArcChartComponent.prototype.isInactive = function (index) {
414
+ return !Number.isNaN(this.activeItemIndex) && index !== this.activeItemIndex;
415
+ };
416
+ TuiArcChartComponent.prototype.getInset = function (index) {
417
+ return this.strokeWidth / 2 + index * (this.strokeWidth + GAP[this.size]);
418
+ };
419
+ TuiArcChartComponent.prototype.getDiameter = function (index) {
420
+ return SIZE[this.size] - 2 * this.getInset(index);
421
+ };
422
+ TuiArcChartComponent.prototype.getLength = function (index) {
423
+ return Math.PI * this.getDiameter(index) * ARC;
424
+ };
425
+ TuiArcChartComponent.prototype.getOffset = function (index) {
426
+ return this.getLength(index) * (1 - Math.min(this.value[index] / this.max, 1));
427
+ };
428
+ TuiArcChartComponent.prototype.getColor = function (index) {
429
+ return this.sanitizer.bypassSecurityTrustStyle("var(--tui-chart-" + index + ", var(--tui-support-0" + (index + 1) + "))");
430
+ };
431
+ return TuiArcChartComponent;
432
+ }());
433
+ TuiArcChartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartComponent, deps: [{ token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }, { token: i1.TuiDestroyService, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
434
+ TuiArcChartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiArcChartComponent, selector: "tui-arc-chart", inputs: { value: "value", size: "size", max: "max", minLabel: "minLabel", maxLabel: "maxLabel", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "this.size", "style.width.rem": "this.width", "style.height.rem": "this.width", "style.strokeWidth.rem": "this.strokeWidth" } }, providers: [i1.TuiDestroyService], viewQueries: [{ propertyName: "arcs", predicate: ["arc"], descendants: true }], ngImport: i0__namespace, template: "<svg\n *tuiRepeatTimes=\"let index of value.length\"\n focusable=\"false\"\n viewBox=\"-100 -100 200 200\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"t-svg\"\n [style.height.em]=\"getDiameter(index)\"\n [style.left.em]=\"getInset(index)\"\n [style.top.em]=\"getInset(index)\"\n [style.width.em]=\"getDiameter(index)\"\n>\n <path\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n #arc\n d=\"M -70 70 A 100 100 0 1 1 70 70\"\n vector-effect=\"non-scaling-stroke\"\n class=\"t-value\"\n [class.t-value_inactive]=\"isInactive(index)\"\n [style.stroke]=\"getColor(index)\"\n [style.strokeDasharray.em]=\"getLength(index)\"\n [style.strokeDashoffset.em]=\"initialized ? getOffset(index) : getLength(index)\"\n />\n</svg>\n<div class=\"t-content\">\n <div class=\"t-wrapper\">\n <ng-content></ng-content>\n </div>\n</div>\n<div class=\"t-percent\">\n <span>{{ minLabel }}</span>\n <span>{{ maxLabel }}</span>\n</div>\n", styles: [":host{position:relative;display:block;flex-shrink:0}.t-svg{position:absolute;top:0;left:0;bottom:0;right:0;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;color:var(--tui-secondary);font-size:1rem;pointer-events:none}.t-value{pointer-events:auto;transition:stroke-dashoffset var(--tui-duration) ease-in-out,opacity var(--tui-duration) ease-in-out .1s}.t-value_inactive{transition-property:stroke-dashoffset,opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:.16}.t-content{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;text-align:center;color:var(--tui-text-02);font:var(--tui-font-text-xs);pointer-events:none}:host[data-size=xl] .t-content{font:var(--tui-font-text-m)}.t-wrapper{pointer-events:auto}.t-wrapper:first-line{color:var(--tui-text-01)}:host[data-size=m] .t-wrapper:first-line{font:var(--tui-font-text-s);font-weight:bold}:host[data-size=l] .t-wrapper:first-line{font:var(--tui-font-text-m);font-weight:bold}:host[data-size=xl] .t-wrapper:first-line{font:var(--tui-font-heading-5)}.t-percent{position:absolute;left:25%;bottom:11%;display:flex;width:50%;justify-content:space-between;font:var(--tui-font-text-xs);color:var(--tui-text-02)}:host[data-size=xl] .t-percent{font:var(--tui-font-text-m)}\n"], directives: [{ type: i1__namespace.TuiRepeatTimesDirective, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
435
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartComponent, decorators: [{
436
+ type: i0.Component,
437
+ args: [{
438
+ selector: 'tui-arc-chart',
439
+ templateUrl: './arc-chart.template.html',
440
+ styleUrls: ['./arc-chart.style.less'],
441
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
442
+ providers: [i1.TuiDestroyService],
443
+ }]
444
+ }], ctorParameters: function () {
445
+ return [{ type: i2__namespace.DomSanitizer, decorators: [{
446
+ type: i0.Inject,
447
+ args: [i2.DomSanitizer]
448
+ }] }, { type: i0__namespace.ChangeDetectorRef, decorators: [{
449
+ type: i0.Inject,
450
+ args: [i0.ChangeDetectorRef]
451
+ }] }, { type: i3__namespace.Observable, decorators: [{
452
+ type: i0.Self
453
+ }, {
454
+ type: i0.Inject,
455
+ args: [i1.TuiDestroyService]
456
+ }] }];
457
+ }, propDecorators: { arcs: [{
458
+ type: i0.ViewChildren,
459
+ args: ['arc']
460
+ }], value: [{
461
+ type: i0.Input
462
+ }], size: [{
463
+ type: i0.Input
464
+ }, {
465
+ type: i0.HostBinding,
466
+ args: ['attr.data-size']
467
+ }], max: [{
468
+ type: i0.Input
469
+ }], minLabel: [{
470
+ type: i0.Input
471
+ }], maxLabel: [{
472
+ type: i0.Input
473
+ }], activeItemIndex: [{
474
+ type: i0.Input
475
+ }], activeItemIndexChange: [{
476
+ type: i0.Output
477
+ }], width: [{
478
+ type: i0.HostBinding,
479
+ args: ['style.width.rem']
480
+ }, {
481
+ type: i0.HostBinding,
482
+ args: ['style.height.rem']
483
+ }], strokeWidth: [{
484
+ type: i0.HostBinding,
485
+ args: ['style.strokeWidth.rem']
486
+ }] } });
633
487
 
634
- var TuiArcChartModule = /** @class */ (function () {
635
- function TuiArcChartModule() {
636
- }
637
- return TuiArcChartModule;
638
- }());
639
- TuiArcChartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
640
- TuiArcChartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, declarations: [TuiArcChartComponent], imports: [i1.TuiRepeatTimesModule], exports: [TuiArcChartComponent] });
641
- TuiArcChartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, imports: [[i1.TuiRepeatTimesModule]] });
642
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, decorators: [{
643
- type: i0.NgModule,
644
- args: [{
645
- imports: [i1.TuiRepeatTimesModule],
646
- declarations: [TuiArcChartComponent],
647
- exports: [TuiArcChartComponent],
648
- }]
649
- }] });
488
+ var TuiArcChartModule = /** @class */ (function () {
489
+ function TuiArcChartModule() {
490
+ }
491
+ return TuiArcChartModule;
492
+ }());
493
+ TuiArcChartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
494
+ TuiArcChartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, declarations: [TuiArcChartComponent], imports: [i1.TuiRepeatTimesModule], exports: [TuiArcChartComponent] });
495
+ TuiArcChartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, imports: [[i1.TuiRepeatTimesModule]] });
496
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiArcChartModule, decorators: [{
497
+ type: i0.NgModule,
498
+ args: [{
499
+ imports: [i1.TuiRepeatTimesModule],
500
+ declarations: [TuiArcChartComponent],
501
+ exports: [TuiArcChartComponent],
502
+ }]
503
+ }] });
650
504
 
651
- /**
652
- * Generated bundle index. Do not edit.
653
- */
505
+ /**
506
+ * Generated bundle index. Do not edit.
507
+ */
654
508
 
655
- exports.TuiArcChartComponent = TuiArcChartComponent;
656
- exports.TuiArcChartModule = TuiArcChartModule;
509
+ exports.TuiArcChartComponent = TuiArcChartComponent;
510
+ exports.TuiArcChartModule = TuiArcChartModule;
657
511
 
658
- Object.defineProperty(exports, '__esModule', { value: true });
512
+ Object.defineProperty(exports, '__esModule', { value: true });
659
513
 
660
514
  }));
661
515
  //# sourceMappingURL=taiga-ui-addon-charts-components-arc-chart.umd.js.map