@caribeng/ui 22.4.0 → 22.6.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.
- package/README.md +313 -313
- package/fesm2022/caribeng-ui-account-picker.mjs +533 -0
- package/fesm2022/caribeng-ui-aging.mjs +488 -0
- package/fesm2022/{caribeng-ui-caribe-alert.mjs → caribeng-ui-alert.mjs} +45 -45
- package/fesm2022/caribeng-ui-amount.mjs +249 -0
- package/fesm2022/caribeng-ui-anchor.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs} +41 -41
- package/fesm2022/caribeng-ui-audit-log.mjs +323 -0
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-breadcrumb.mjs +13 -3
- package/fesm2022/{caribeng-ui-caribe-button-group.mjs → caribeng-ui-button-group.mjs} +15 -15
- package/fesm2022/caribeng-ui-button.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-card-content.mjs → caribeng-ui-card-content.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-card-move.mjs → caribeng-ui-card-move.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-card-primary.mjs → caribeng-ui-card-primary.mjs} +31 -31
- package/fesm2022/{caribeng-ui-caribe-card-select.mjs → caribeng-ui-card-select.mjs} +67 -67
- package/fesm2022/caribeng-ui-carousel.mjs +2 -2
- package/fesm2022/caribeng-ui-cascadeselect.mjs +45 -9
- package/fesm2022/caribeng-ui-chat.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-coachmark.mjs → caribeng-ui-coachmark.mjs} +85 -85
- package/fesm2022/caribeng-ui-command-palette.mjs +2 -2
- package/fesm2022/caribeng-ui-comments.mjs +864 -0
- package/fesm2022/caribeng-ui-datagrid.mjs +1635 -0
- package/fesm2022/caribeng-ui-dataview.mjs +2 -2
- package/fesm2022/caribeng-ui-datepicker.mjs +2 -2
- package/fesm2022/caribeng-ui-document.mjs +495 -0
- package/fesm2022/{caribeng-ui-caribe-dots-indicator.mjs → caribeng-ui-dots-indicator.mjs} +41 -41
- package/fesm2022/caribeng-ui-dynamic-form.mjs +1581 -0
- package/fesm2022/caribeng-ui-editor.mjs +2303 -1311
- package/fesm2022/{caribeng-ui-caribe-expansion-panel.mjs → caribeng-ui-expansion-panel.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-fab-menu.mjs → caribeng-ui-fab-menu.mjs} +75 -75
- package/fesm2022/caribeng-ui-file-card.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-file-download.mjs → caribeng-ui-file-download.mjs} +63 -63
- package/fesm2022/caribeng-ui-financial-report.mjs +380 -0
- package/fesm2022/{caribeng-ui-caribe-float-menu.mjs → caribeng-ui-float-menu.mjs} +31 -31
- package/fesm2022/caribeng-ui-floatlabel.mjs +2 -2
- package/fesm2022/caribeng-ui-flow.mjs +1508 -0
- package/fesm2022/{caribeng-ui-caribe-footer.mjs → caribeng-ui-footer.mjs} +19 -19
- package/fesm2022/caribeng-ui-gantt.mjs +1094 -0
- package/fesm2022/{caribeng-ui-caribe-header.mjs → caribeng-ui-header.mjs} +49 -49
- package/fesm2022/{caribeng-ui-caribe-icon-button.mjs → caribeng-ui-icon-button.mjs} +23 -23
- package/fesm2022/caribeng-ui-image-cropper.mjs +671 -0
- package/fesm2022/caribeng-ui-import-wizard.mjs +746 -0
- package/fesm2022/caribeng-ui-infinite-scroll.mjs +226 -0
- package/fesm2022/caribeng-ui-input-number.mjs +22 -6
- package/fesm2022/{caribeng-ui-caribe-input-search.mjs → caribeng-ui-input-search.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-input-token.mjs → caribeng-ui-input-token.mjs} +59 -59
- package/fesm2022/caribeng-ui-inputotp.mjs +2 -2
- package/fesm2022/caribeng-ui-journal-entry.mjs +340 -0
- package/fesm2022/caribeng-ui-kanban.mjs +6 -6
- package/fesm2022/caribeng-ui-kpi.mjs +189 -0
- package/fesm2022/{caribeng-ui-caribe-link.mjs → caribeng-ui-link.mjs} +37 -37
- package/fesm2022/caribeng-ui-masonry.mjs +93 -0
- package/fesm2022/caribeng-ui-media-player.mjs +821 -0
- package/fesm2022/caribeng-ui-mentions.mjs +2 -2
- package/fesm2022/caribeng-ui-notification-center.mjs +636 -0
- package/fesm2022/{caribeng-ui-caribe-off-canvas.mjs → caribeng-ui-off-canvas.mjs} +55 -55
- package/fesm2022/{caribeng-ui-caribe-onboarding.mjs → caribeng-ui-onboarding.mjs} +105 -105
- package/fesm2022/caribeng-ui-orderlist.mjs +2 -2
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1755 -25
- package/fesm2022/caribeng-ui-period-picker.mjs +637 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +2 -2
- package/fesm2022/caribeng-ui-picklist.mjs +2 -2
- package/fesm2022/caribeng-ui-pivot.mjs +419 -0
- package/fesm2022/caribeng-ui-pricing.mjs +2 -2
- package/fesm2022/caribeng-ui-rating.mjs +14 -17
- package/fesm2022/caribeng-ui-reconciliation.mjs +386 -0
- package/fesm2022/caribeng-ui-scheduler.mjs +1027 -0
- package/fesm2022/caribeng-ui-select.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-shortcut.mjs → caribeng-ui-shortcut.mjs} +29 -29
- package/fesm2022/caribeng-ui-sidebar.mjs +2 -2
- package/fesm2022/caribeng-ui-signature-pad.mjs +654 -0
- package/fesm2022/{caribeng-ui-caribe-status.mjs → caribeng-ui-status.mjs} +11 -11
- package/fesm2022/{caribeng-ui-caribe-step-indicator.mjs → caribeng-ui-step-indicator.mjs} +53 -53
- package/fesm2022/caribeng-ui-stepper.mjs +2 -2
- package/fesm2022/caribeng-ui-steps.mjs +2 -2
- package/fesm2022/caribeng-ui-table.mjs +323 -15
- package/fesm2022/caribeng-ui-tabmenu.mjs +2 -2
- package/fesm2022/caribeng-ui-tabs.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-tag-button.mjs → caribeng-ui-tag-button.mjs} +25 -25
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-tieredmenu.mjs +6 -6
- package/fesm2022/{caribeng-ui-caribe-tracker.mjs → caribeng-ui-tracker.mjs} +29 -29
- package/fesm2022/{caribeng-ui-caribe-transaction-status.mjs → caribeng-ui-transaction-status.mjs} +11 -11
- package/fesm2022/caribeng-ui-treeselect.mjs +44 -9
- package/fesm2022/caribeng-ui-treetable.mjs +236 -17
- package/fesm2022/{caribeng-ui-caribe-voucher.mjs → caribeng-ui-voucher.mjs} +45 -45
- package/fesm2022/caribeng-ui-xlsx.mjs +486 -0
- package/fesm2022/caribeng-ui.mjs +1185 -5
- package/package.json +217 -177
- package/types/caribeng-ui-account-picker.d.ts +142 -0
- package/types/caribeng-ui-aging.d.ts +123 -0
- package/types/{caribeng-ui-caribe-alert.d.ts → caribeng-ui-alert.d.ts} +2 -2
- package/types/caribeng-ui-amount.d.ts +82 -0
- package/types/{caribeng-ui-caribe-animation-lottie.d.ts → caribeng-ui-animation-lottie.d.ts} +2 -2
- package/types/caribeng-ui-audit-log.d.ts +86 -0
- package/types/caribeng-ui-breadcrumb.d.ts +2 -2
- package/types/{caribeng-ui-caribe-button-group.d.ts → caribeng-ui-button-group.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-content.d.ts → caribeng-ui-card-content.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-move.d.ts → caribeng-ui-card-move.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-card-primary.d.ts → caribeng-ui-card-primary.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-select.d.ts → caribeng-ui-card-select.d.ts} +2 -2
- package/types/caribeng-ui-cascadeselect.d.ts +6 -0
- package/types/{caribeng-ui-caribe-coachmark.d.ts → caribeng-ui-coachmark.d.ts} +2 -2
- package/types/caribeng-ui-comments.d.ts +214 -0
- package/types/caribeng-ui-datagrid.d.ts +269 -0
- package/types/caribeng-ui-document.d.ts +138 -0
- package/types/{caribeng-ui-caribe-dots-indicator.d.ts → caribeng-ui-dots-indicator.d.ts} +2 -2
- package/types/caribeng-ui-dynamic-form.d.ts +409 -0
- package/types/caribeng-ui-editor.d.ts +110 -12
- package/types/{caribeng-ui-caribe-expansion-panel.d.ts → caribeng-ui-expansion-panel.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-fab-menu.d.ts → caribeng-ui-fab-menu.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-file-download.d.ts → caribeng-ui-file-download.d.ts} +1 -1
- package/types/caribeng-ui-financial-report.d.ts +102 -0
- package/types/{caribeng-ui-caribe-float-menu.d.ts → caribeng-ui-float-menu.d.ts} +2 -2
- package/types/caribeng-ui-flow.d.ts +228 -0
- package/types/{caribeng-ui-caribe-footer.d.ts → caribeng-ui-footer.d.ts} +2 -2
- package/types/caribeng-ui-gantt.d.ts +244 -0
- package/types/{caribeng-ui-caribe-header.d.ts → caribeng-ui-header.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-icon-button.d.ts → caribeng-ui-icon-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-illustration.d.ts → caribeng-ui-illustration.d.ts} +1 -1
- package/types/caribeng-ui-image-cropper.d.ts +169 -0
- package/types/caribeng-ui-import-wizard.d.ts +149 -0
- package/types/caribeng-ui-infinite-scroll.d.ts +75 -0
- package/types/caribeng-ui-input-number.d.ts +1 -1
- package/types/{caribeng-ui-caribe-input-search.d.ts → caribeng-ui-input-search.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-input-token.d.ts → caribeng-ui-input-token.d.ts} +2 -2
- package/types/caribeng-ui-journal-entry.d.ts +110 -0
- package/types/caribeng-ui-kpi.d.ts +64 -0
- package/types/{caribeng-ui-caribe-link.d.ts → caribeng-ui-link.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-logo.d.ts → caribeng-ui-logo.d.ts} +1 -1
- package/types/caribeng-ui-masonry.d.ts +32 -0
- package/types/caribeng-ui-media-player.d.ts +140 -0
- package/types/caribeng-ui-notification-center.d.ts +153 -0
- package/types/{caribeng-ui-caribe-off-canvas.d.ts → caribeng-ui-off-canvas.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-onboarding.d.ts → caribeng-ui-onboarding.d.ts} +2 -2
- package/types/caribeng-ui-pdfviewer.d.ts +245 -5
- package/types/caribeng-ui-period-picker.d.ts +148 -0
- package/types/caribeng-ui-pivot.d.ts +116 -0
- package/types/caribeng-ui-reconciliation.d.ts +109 -0
- package/types/caribeng-ui-scheduler.d.ts +188 -0
- package/types/{caribeng-ui-caribe-shortcut.d.ts → caribeng-ui-shortcut.d.ts} +2 -2
- package/types/caribeng-ui-signature-pad.d.ts +151 -0
- package/types/{caribeng-ui-caribe-status.d.ts → caribeng-ui-status.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-step-indicator.d.ts → caribeng-ui-step-indicator.d.ts} +2 -2
- package/types/caribeng-ui-table.d.ts +66 -2
- package/types/{caribeng-ui-caribe-tag-button.d.ts → caribeng-ui-tag-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-tracker.d.ts → caribeng-ui-tracker.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-transaction-status.d.ts → caribeng-ui-transaction-status.d.ts} +2 -2
- package/types/caribeng-ui-treeselect.d.ts +6 -0
- package/types/caribeng-ui-treetable.d.ts +67 -2
- package/types/{caribeng-ui-caribe-voucher.d.ts → caribeng-ui-voucher.d.ts} +2 -2
- package/types/caribeng-ui-xlsx.d.ts +79 -0
- package/types/caribeng-ui.d.ts +713 -4
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +0 -92
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +0 -130
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +0 -94
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +0 -88
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +0 -100
- package/fesm2022/caribeng-ui-caribe-input-date.mjs +0 -138
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +0 -154
- package/fesm2022/caribeng-ui-caribe-loader.mjs +0 -48
- package/fesm2022/caribeng-ui-caribe-modal.mjs +0 -119
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +0 -52
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +0 -104
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +0 -57
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +0 -84
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +0 -69
- package/fesm2022/caribeng-ui-caribe-switch.mjs +0 -182
- package/types/caribeng-ui-caribe-calendar.d.ts +0 -27
- package/types/caribeng-ui-caribe-circle-loading.d.ts +0 -28
- package/types/caribeng-ui-caribe-data-table.d.ts +0 -26
- package/types/caribeng-ui-caribe-file-select.d.ts +0 -31
- package/types/caribeng-ui-caribe-inline-alert.d.ts +0 -28
- package/types/caribeng-ui-caribe-input-date.d.ts +0 -40
- package/types/caribeng-ui-caribe-input-select.d.ts +0 -47
- package/types/caribeng-ui-caribe-loader.d.ts +0 -22
- package/types/caribeng-ui-caribe-modal.d.ts +0 -21
- package/types/caribeng-ui-caribe-pictogram.d.ts +0 -15
- package/types/caribeng-ui-caribe-pop-over.d.ts +0 -17
- package/types/caribeng-ui-caribe-preloader.d.ts +0 -24
- package/types/caribeng-ui-caribe-progress-bar.d.ts +0 -28
- package/types/caribeng-ui-caribe-stroke.d.ts +0 -17
- package/types/caribeng-ui-caribe-switch.d.ts +0 -55
- /package/fesm2022/{caribeng-ui-caribe-illustration.mjs → caribeng-ui-illustration.mjs} +0 -0
- /package/fesm2022/{caribeng-ui-caribe-logo.mjs → caribeng-ui-logo.mjs} +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { CB_CONFIG, injectCbTranslation, cbFormatAmount } from '@caribeng/ui';
|
|
4
|
+
|
|
5
|
+
const ES_CURRENCIES = {
|
|
6
|
+
COP: { one: 'peso', many: 'pesos', cent: 'centavo', cents: 'centavos', suffix: 'M/CTE' },
|
|
7
|
+
MXN: { one: 'peso', many: 'pesos', cent: 'centavo', cents: 'centavos', suffix: 'M.N.' },
|
|
8
|
+
CLP: { one: 'peso', many: 'pesos', cent: 'centavo', cents: 'centavos' },
|
|
9
|
+
ARS: { one: 'peso', many: 'pesos', cent: 'centavo', cents: 'centavos' },
|
|
10
|
+
DOP: { one: 'peso', many: 'pesos', cent: 'centavo', cents: 'centavos' },
|
|
11
|
+
USD: { one: 'dólar', many: 'dólares', cent: 'centavo', cents: 'centavos' },
|
|
12
|
+
EUR: { one: 'euro', many: 'euros', cent: 'céntimo', cents: 'céntimos' },
|
|
13
|
+
PEN: { one: 'sol', many: 'soles', cent: 'céntimo', cents: 'céntimos' },
|
|
14
|
+
GBP: { one: 'libra', many: 'libras', cent: 'penique', cents: 'peniques', feminine: true },
|
|
15
|
+
};
|
|
16
|
+
const EN_CURRENCIES = {
|
|
17
|
+
COP: { one: 'peso', many: 'pesos', cent: 'cent', cents: 'cents' },
|
|
18
|
+
MXN: { one: 'peso', many: 'pesos', cent: 'cent', cents: 'cents' },
|
|
19
|
+
USD: { one: 'dollar', many: 'dollars', cent: 'cent', cents: 'cents' },
|
|
20
|
+
EUR: { one: 'euro', many: 'euros', cent: 'cent', cents: 'cents' },
|
|
21
|
+
GBP: { one: 'pound', many: 'pounds', cent: 'penny', cents: 'pence' },
|
|
22
|
+
};
|
|
23
|
+
const UNITS = ['', 'uno', 'dos', 'tres', 'cuatro', 'cinco', 'seis', 'siete', 'ocho', 'nueve', 'diez', 'once', 'doce', 'trece', 'catorce', 'quince', 'dieciséis', 'diecisiete', 'dieciocho', 'diecinueve', 'veinte', 'veintiuno', 'veintidós', 'veintitrés', 'veinticuatro', 'veinticinco', 'veintiséis', 'veintisiete', 'veintiocho', 'veintinueve'];
|
|
24
|
+
const TENS = ['', '', '', 'treinta', 'cuarenta', 'cincuenta', 'sesenta', 'setenta', 'ochenta', 'noventa'];
|
|
25
|
+
const HUNDREDS = ['', 'ciento', 'doscientos', 'trescientos', 'cuatrocientos', 'quinientos', 'seiscientos', 'setecientos', 'ochocientos', 'novecientos'];
|
|
26
|
+
/** 0–999 en español; `apocope` acorta «uno» a «un» (antes de un sustantivo o de «mil»). */
|
|
27
|
+
function esHundreds(n, apocope, feminine = false) {
|
|
28
|
+
if (n === 0)
|
|
29
|
+
return '';
|
|
30
|
+
if (n === 100)
|
|
31
|
+
return 'cien';
|
|
32
|
+
const h = Math.floor(n / 100);
|
|
33
|
+
const rest = n % 100;
|
|
34
|
+
let hundreds = HUNDREDS[h];
|
|
35
|
+
if (feminine && h > 1)
|
|
36
|
+
hundreds = hundreds.replace(/ientos$/, 'ientas').replace(/^quinientos$/, 'quinientas');
|
|
37
|
+
let tail = '';
|
|
38
|
+
if (rest < 30)
|
|
39
|
+
tail = UNITS[rest];
|
|
40
|
+
else {
|
|
41
|
+
const t = Math.floor(rest / 10);
|
|
42
|
+
const u = rest % 10;
|
|
43
|
+
tail = TENS[t] + (u ? ` y ${UNITS[u]}` : '');
|
|
44
|
+
}
|
|
45
|
+
if (tail.endsWith('uno') && apocope)
|
|
46
|
+
tail = feminine ? tail.replace(/uno$/, 'una') : tail.replace(/veintiuno$/, 'veintiún').replace(/uno$/, 'un');
|
|
47
|
+
return [hundreds, tail].filter(Boolean).join(' ');
|
|
48
|
+
}
|
|
49
|
+
/** Entero en letras en español (hasta billones). */
|
|
50
|
+
function esInteger(n, apocope = false, feminine = false) {
|
|
51
|
+
if (n === 0)
|
|
52
|
+
return 'cero';
|
|
53
|
+
const parts = [];
|
|
54
|
+
const billions = Math.floor(n / 1e12);
|
|
55
|
+
const millions = Math.floor((n % 1e12) / 1e6);
|
|
56
|
+
const thousands = Math.floor((n % 1e6) / 1e3);
|
|
57
|
+
const units = n % 1e3;
|
|
58
|
+
if (billions)
|
|
59
|
+
parts.push(billions === 1 ? 'un billón' : `${esInteger(billions, true)} billones`);
|
|
60
|
+
if (millions)
|
|
61
|
+
parts.push(millions === 1 ? 'un millón' : `${esInteger(millions, true)} millones`);
|
|
62
|
+
if (thousands)
|
|
63
|
+
parts.push(thousands === 1 ? 'mil' : `${esHundreds(thousands, true, feminine)} mil`);
|
|
64
|
+
if (units)
|
|
65
|
+
parts.push(esHundreds(units, apocope, feminine));
|
|
66
|
+
return parts.join(' ');
|
|
67
|
+
}
|
|
68
|
+
const EN_SMALL = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
|
|
69
|
+
const EN_TENS = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
|
|
70
|
+
function enHundreds(n) {
|
|
71
|
+
const h = Math.floor(n / 100);
|
|
72
|
+
const rest = n % 100;
|
|
73
|
+
const tail = rest < 20 ? EN_SMALL[rest] : EN_TENS[Math.floor(rest / 10)] + (rest % 10 ? `-${EN_SMALL[rest % 10]}` : '');
|
|
74
|
+
return [h ? `${EN_SMALL[h]} hundred` : '', tail].filter(Boolean).join(' ');
|
|
75
|
+
}
|
|
76
|
+
/** Entero en letras en inglés (hasta trillones). */
|
|
77
|
+
function enInteger(n) {
|
|
78
|
+
if (n === 0)
|
|
79
|
+
return 'zero';
|
|
80
|
+
const scales = [
|
|
81
|
+
[1e12, 'trillion'],
|
|
82
|
+
[1e9, 'billion'],
|
|
83
|
+
[1e6, 'million'],
|
|
84
|
+
[1e3, 'thousand'],
|
|
85
|
+
];
|
|
86
|
+
const parts = [];
|
|
87
|
+
let rest = n;
|
|
88
|
+
for (const [size, name] of scales) {
|
|
89
|
+
const q = Math.floor(rest / size);
|
|
90
|
+
if (q)
|
|
91
|
+
parts.push(`${enHundreds(q)} ${name}`);
|
|
92
|
+
rest %= size;
|
|
93
|
+
}
|
|
94
|
+
if (rest)
|
|
95
|
+
parts.push(enHundreds(rest));
|
|
96
|
+
return parts.join(' ');
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Importe en letras para cheques, recibos y facturas.
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* cbAmountInWords(1250000.5); // "UN MILLÓN DOSCIENTOS CINCUENTA MIL PESOS CON 50/100 M/CTE"
|
|
103
|
+
* cbAmountInWords(21, { style: 'text' }); // "veintiún pesos"
|
|
104
|
+
* cbAmountInWords(1234.56, { language: 'en', currency: 'USD', style: 'text' }); // "one thousand two hundred thirty-four dollars and fifty-six cents"
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
function cbAmountInWords(value, options = {}) {
|
|
108
|
+
const language = options.language ?? 'es';
|
|
109
|
+
const code = (options.currency ?? 'COP').toUpperCase();
|
|
110
|
+
const style = options.style ?? 'check';
|
|
111
|
+
const negative = value < 0;
|
|
112
|
+
const totalCents = Math.round(Math.abs(value) * 100);
|
|
113
|
+
const integer = Math.floor(totalCents / 100);
|
|
114
|
+
const cents = totalCents % 100;
|
|
115
|
+
let out;
|
|
116
|
+
if (language === 'en') {
|
|
117
|
+
const cur = EN_CURRENCIES[code] ?? { one: code, many: code, cent: 'cent', cents: 'cents' };
|
|
118
|
+
out = `${enInteger(integer)} ${integer === 1 ? cur.one : cur.many}`;
|
|
119
|
+
if (cents)
|
|
120
|
+
out += style === 'check' ? ` and ${String(cents).padStart(2, '0')}/100` : ` and ${enInteger(cents)} ${cents === 1 ? cur.cent : cur.cents}`;
|
|
121
|
+
if (negative)
|
|
122
|
+
out = `minus ${out}`;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
const cur = ES_CURRENCIES[code] ?? { one: code, many: code, cent: 'centavo', cents: 'centavos' };
|
|
126
|
+
const words = esInteger(integer, true, cur.feminine);
|
|
127
|
+
// «un millón de pesos», «dos millones de pesos»: con millones exactos se añade «de».
|
|
128
|
+
const de = integer > 0 && integer % 1e6 === 0 ? ' de' : '';
|
|
129
|
+
out = `${words}${de} ${integer === 1 ? cur.one : cur.many}`;
|
|
130
|
+
if (cents)
|
|
131
|
+
out += style === 'check' ? ` con ${String(cents).padStart(2, '0')}/100` : ` con ${esInteger(cents, true)} ${cents === 1 ? cur.cent : cur.cents}`;
|
|
132
|
+
if (style === 'check' && cur.suffix)
|
|
133
|
+
out += ` ${cur.suffix}`;
|
|
134
|
+
if (negative)
|
|
135
|
+
out = `menos ${out}`;
|
|
136
|
+
}
|
|
137
|
+
return style === 'check' ? out.toLocaleUpperCase(language) : out;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Importe de CaribeNG: muestra un valor con su moneda, los negativos en rojo (con
|
|
142
|
+
* signo o entre paréntesis), su equivalente en otra moneda y, si se pide, en letras.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```html
|
|
146
|
+
* <cb-amount [value]="1250000" currency="COP" words />
|
|
147
|
+
* <cb-amount [value]="1250000" currency="COP" [convert]="{ currency: 'USD', rate: 3950, divide: true, label: 'TRM' }" />
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
class CbAmount {
|
|
151
|
+
constructor() {
|
|
152
|
+
this.config = inject(CB_CONFIG);
|
|
153
|
+
this.t = injectCbTranslation();
|
|
154
|
+
this.value = input(null, /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
156
|
+
/** Código de moneda (si no, el de `provideCaribeNG({ currency })`; `''` sin símbolo). */
|
|
157
|
+
this.currency = input(undefined, /* @ts-ignore */
|
|
158
|
+
...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
159
|
+
this.decimals = input(undefined, /* @ts-ignore */
|
|
160
|
+
...(ngDevMode ? [{ debugName: "decimals" }] : /* istanbul ignore next */ []));
|
|
161
|
+
this.negative = input(undefined, /* @ts-ignore */
|
|
162
|
+
...(ngDevMode ? [{ debugName: "negative" }] : /* istanbul ignore next */ []));
|
|
163
|
+
/** Muestra el código de la moneda tras el importe (`COP`). */
|
|
164
|
+
this.showCode = input(false, { ...(ngDevMode ? { debugName: "showCode" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
165
|
+
/** Muestra el importe en letras debajo. */
|
|
166
|
+
this.words = input(false, { ...(ngDevMode ? { debugName: "words" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
167
|
+
/** Estilo de las letras: `check` (mayúsculas, 50/100, M/CTE) o `text`. */
|
|
168
|
+
this.wordsStyle = input('check', /* @ts-ignore */
|
|
169
|
+
...(ngDevMode ? [{ debugName: "wordsStyle" }] : /* istanbul ignore next */ []));
|
|
170
|
+
/** Equivalente en otra moneda. */
|
|
171
|
+
this.convert = input(null, /* @ts-ignore */
|
|
172
|
+
...(ngDevMode ? [{ debugName: "convert" }] : /* istanbul ignore next */ []));
|
|
173
|
+
this.size = input('md', /* @ts-ignore */
|
|
174
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
175
|
+
this.code = computed(() => {
|
|
176
|
+
const c = this.currency();
|
|
177
|
+
return c === undefined ? (this.config.currency ?? '') : c;
|
|
178
|
+
}, /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []));
|
|
180
|
+
this.locale = computed(() => this.config.numberLocale ?? this.t().intlLocale, /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
182
|
+
this.isNegative = computed(() => (this.value() ?? 0) < 0, /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "isNegative" }] : /* istanbul ignore next */ []));
|
|
184
|
+
this.text = computed(() => cbFormatAmount(this.value(), this.locale(), { currency: this.code() || null, decimals: this.decimals(), negative: this.negative() ?? this.config.negativeStyle ?? 'minus' }), /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
186
|
+
this.converted = computed(() => {
|
|
187
|
+
const c = this.convert();
|
|
188
|
+
const v = this.value();
|
|
189
|
+
if (!c || v === null || !c.rate)
|
|
190
|
+
return null;
|
|
191
|
+
const amount = c.divide ? v / c.rate : v * c.rate;
|
|
192
|
+
const target = cbFormatAmount(amount, this.locale(), { currency: c.currency, currencyDisplay: 'symbol' });
|
|
193
|
+
const rate = cbFormatAmount(c.rate, this.locale(), { decimals: 2 });
|
|
194
|
+
return c.label ? `${target} (${c.label} ${rate})` : target;
|
|
195
|
+
}, /* @ts-ignore */
|
|
196
|
+
...(ngDevMode ? [{ debugName: "converted" }] : /* istanbul ignore next */ []));
|
|
197
|
+
this.inWords = computed(() => {
|
|
198
|
+
const v = this.value();
|
|
199
|
+
if (v === null)
|
|
200
|
+
return '';
|
|
201
|
+
const language = this.t().intlLocale.startsWith('en') ? 'en' : 'es';
|
|
202
|
+
return cbAmountInWords(v, { language, currency: this.code() || 'COP', style: this.wordsStyle() });
|
|
203
|
+
}, /* @ts-ignore */
|
|
204
|
+
...(ngDevMode ? [{ debugName: "inWords" }] : /* istanbul ignore next */ []));
|
|
205
|
+
}
|
|
206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAmount, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbAmount, isStandalone: true, selector: "cb-amount", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, negative: { classPropertyName: "negative", publicName: "negative", isSignal: true, isRequired: false, transformFunction: null }, showCode: { classPropertyName: "showCode", publicName: "showCode", isSignal: true, isRequired: false, transformFunction: null }, words: { classPropertyName: "words", publicName: "words", isSignal: true, isRequired: false, transformFunction: null }, wordsStyle: { classPropertyName: "wordsStyle", publicName: "wordsStyle", isSignal: true, isRequired: false, transformFunction: null }, convert: { classPropertyName: "convert", publicName: "convert", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-amount--negative": "isNegative()", "class.cb-amount--block": "words() || !!convert()", "class": "'cb-amount--' + size()" }, classAttribute: "cb-amount" }, ngImport: i0, template: `
|
|
208
|
+
<span class="cb-amount__value">{{ text() }}</span>
|
|
209
|
+
@if (showCode() && code()) {
|
|
210
|
+
<span class="cb-amount__code">{{ code() }}</span>
|
|
211
|
+
}
|
|
212
|
+
@if (converted(); as c) {
|
|
213
|
+
<span class="cb-amount__converted">≈ {{ c }}</span>
|
|
214
|
+
}
|
|
215
|
+
@if (words()) {
|
|
216
|
+
<span class="cb-amount__words">{{ inWords() }}</span>
|
|
217
|
+
}
|
|
218
|
+
`, isInline: true, styles: [":host{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:0 .35rem;font-variant-numeric:tabular-nums}:host(.cb-amount--block){display:inline-grid;grid-template-columns:auto auto;justify-content:start}:host(.cb-amount--negative) .cb-amount__value{color:var(--cb-color-danger-text, #dc2626)}:host(.cb-amount--sm){font-size:var(--cb-text-sm, .875rem)}:host(.cb-amount--lg) .cb-amount__value{font-size:var(--cb-text-xl, 1.25rem);font-weight:var(--cb-font-weight-semibold, 600)}:host(.cb-amount--xl) .cb-amount__value{font-size:var(--cb-text-3xl, 1.875rem);font-weight:var(--cb-font-weight-bold, 700);letter-spacing:-.01em}.cb-amount__code{color:var(--cb-color-text-muted);font-size:.8em}.cb-amount__converted,.cb-amount__words{grid-column:1 / -1;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-amount__words{font-variant-numeric:normal;letter-spacing:.01em}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
219
|
+
}
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAmount, decorators: [{
|
|
221
|
+
type: Component,
|
|
222
|
+
args: [{ selector: 'cb-amount', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
223
|
+
class: 'cb-amount',
|
|
224
|
+
'[class.cb-amount--negative]': 'isNegative()',
|
|
225
|
+
'[class.cb-amount--block]': 'words() || !!convert()',
|
|
226
|
+
'[class]': "'cb-amount--' + size()",
|
|
227
|
+
}, template: `
|
|
228
|
+
<span class="cb-amount__value">{{ text() }}</span>
|
|
229
|
+
@if (showCode() && code()) {
|
|
230
|
+
<span class="cb-amount__code">{{ code() }}</span>
|
|
231
|
+
}
|
|
232
|
+
@if (converted(); as c) {
|
|
233
|
+
<span class="cb-amount__converted">≈ {{ c }}</span>
|
|
234
|
+
}
|
|
235
|
+
@if (words()) {
|
|
236
|
+
<span class="cb-amount__words">{{ inWords() }}</span>
|
|
237
|
+
}
|
|
238
|
+
`, styles: [":host{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:0 .35rem;font-variant-numeric:tabular-nums}:host(.cb-amount--block){display:inline-grid;grid-template-columns:auto auto;justify-content:start}:host(.cb-amount--negative) .cb-amount__value{color:var(--cb-color-danger-text, #dc2626)}:host(.cb-amount--sm){font-size:var(--cb-text-sm, .875rem)}:host(.cb-amount--lg) .cb-amount__value{font-size:var(--cb-text-xl, 1.25rem);font-weight:var(--cb-font-weight-semibold, 600)}:host(.cb-amount--xl) .cb-amount__value{font-size:var(--cb-text-3xl, 1.875rem);font-weight:var(--cb-font-weight-bold, 700);letter-spacing:-.01em}.cb-amount__code{color:var(--cb-color-text-muted);font-size:.8em}.cb-amount__converted,.cb-amount__words{grid-column:1 / -1;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-amount__words{font-variant-numeric:normal;letter-spacing:.01em}\n"] }]
|
|
239
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], negative: [{ type: i0.Input, args: [{ isSignal: true, alias: "negative", required: false }] }], showCode: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCode", required: false }] }], words: [{ type: i0.Input, args: [{ isSignal: true, alias: "words", required: false }] }], wordsStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "wordsStyle", required: false }] }], convert: [{ type: i0.Input, args: [{ isSignal: true, alias: "convert", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
240
|
+
|
|
241
|
+
/*
|
|
242
|
+
* Public API Surface de @caribeng/ui/amount
|
|
243
|
+
*/
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Generated bundle index. Do not edit.
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
export { CbAmount, cbAmountInWords, enInteger, esInteger };
|
|
@@ -127,7 +127,7 @@ class CbAnchor {
|
|
|
127
127
|
</ng-template>
|
|
128
128
|
<ng-container *ngTemplateOutlet="list; context: { $implicit: links(), level: 0 }" />
|
|
129
129
|
</nav>
|
|
130
|
-
`, isInline: true, styles: [":host{display:block;font-family:var(--cb-font-sans, inherit)}.cb-anchor__list{margin:0;padding:0;list-style:none;border-left:2px solid var(--cb-color-border)}.cb-anchor__list--nested{border-left:0}.cb-anchor__link{display:block;margin-left:-2px;padding:.3rem .75rem;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted);text-decoration:none;border-left:2px solid transparent;transition:color var(--cb-duration-fast, .12s) ease,border-color var(--cb-duration-fast, .12s) ease}.cb-anchor__list--nested .cb-anchor__link{padding-left:1.5rem}.cb-anchor__link:hover{color:var(--cb-color-text)}.cb-anchor__link.cb-is-active{font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-primary-
|
|
130
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--cb-font-sans, inherit)}.cb-anchor__list{margin:0;padding:0;list-style:none;border-left:2px solid var(--cb-color-border)}.cb-anchor__list--nested{border-left:0}.cb-anchor__link{display:block;margin-left:-2px;padding:.3rem .75rem;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted);text-decoration:none;border-left:2px solid transparent;transition:color var(--cb-duration-fast, .12s) ease,border-color var(--cb-duration-fast, .12s) ease}.cb-anchor__list--nested .cb-anchor__link{padding-left:1.5rem}.cb-anchor__link:hover{color:var(--cb-color-text)}.cb-anchor__link.cb-is-active{font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-primary-text);border-left-color:var(--cb-color-primary-500)}.cb-anchor__link:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:-2px;border-radius:var(--cb-radius-sm, .25rem)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
131
131
|
}
|
|
132
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAnchor, decorators: [{
|
|
133
133
|
type: Component,
|
|
@@ -155,7 +155,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
155
155
|
</ng-template>
|
|
156
156
|
<ng-container *ngTemplateOutlet="list; context: { $implicit: links(), level: 0 }" />
|
|
157
157
|
</nav>
|
|
158
|
-
`, styles: [":host{display:block;font-family:var(--cb-font-sans, inherit)}.cb-anchor__list{margin:0;padding:0;list-style:none;border-left:2px solid var(--cb-color-border)}.cb-anchor__list--nested{border-left:0}.cb-anchor__link{display:block;margin-left:-2px;padding:.3rem .75rem;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted);text-decoration:none;border-left:2px solid transparent;transition:color var(--cb-duration-fast, .12s) ease,border-color var(--cb-duration-fast, .12s) ease}.cb-anchor__list--nested .cb-anchor__link{padding-left:1.5rem}.cb-anchor__link:hover{color:var(--cb-color-text)}.cb-anchor__link.cb-is-active{font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-primary-
|
|
158
|
+
`, styles: [":host{display:block;font-family:var(--cb-font-sans, inherit)}.cb-anchor__list{margin:0;padding:0;list-style:none;border-left:2px solid var(--cb-color-border)}.cb-anchor__list--nested{border-left:0}.cb-anchor__link{display:block;margin-left:-2px;padding:.3rem .75rem;font-size:var(--cb-text-sm, .875rem);color:var(--cb-color-text-muted);text-decoration:none;border-left:2px solid transparent;transition:color var(--cb-duration-fast, .12s) ease,border-color var(--cb-duration-fast, .12s) ease}.cb-anchor__list--nested .cb-anchor__link{padding-left:1.5rem}.cb-anchor__link:hover{color:var(--cb-color-text)}.cb-anchor__link.cb-is-active{font-weight:var(--cb-font-weight-medium, 500);color:var(--cb-color-primary-text);border-left-color:var(--cb-color-primary-500)}.cb-anchor__link:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:-2px;border-radius:var(--cb-radius-sm, .25rem)}\n"] }]
|
|
159
159
|
}], ctorParameters: () => [], propDecorators: { links: [{ type: i0.Input, args: [{ isSignal: true, alias: "links", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], activeChange: [{ type: i0.Output, args: ["activeChange"] }] } });
|
|
160
160
|
|
|
161
161
|
/*
|
package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs}
RENAMED
|
@@ -3,7 +3,7 @@ import { input, signal, ViewEncapsulation, ChangeDetectionStrategy, Component }
|
|
|
3
3
|
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Animation-lottie
|
|
6
|
+
* Animation-lottie: contenedor de animación (placeholder
|
|
7
7
|
* animado mientras se integra Lottie real).
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
@@ -35,26 +35,26 @@ class CbAnimationLottie {
|
|
|
35
35
|
this.playing.set(false);
|
|
36
36
|
}
|
|
37
37
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAnimationLottie, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
38
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbAnimationLottie, isStandalone: true, selector: "cb-animation-lottie", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "size()", "style.height": "size()" }, classAttribute: "cb-animation-lottie-host" }, ngImport: i0, template: `
|
|
39
|
-
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
40
|
-
<svg
|
|
41
|
-
class="cb-animation-lottie__svg"
|
|
42
|
-
[class.cb-is-playing]="playing()"
|
|
43
|
-
viewBox="0 0 48 48"
|
|
44
|
-
aria-hidden="true"
|
|
45
|
-
>
|
|
46
|
-
<circle
|
|
47
|
-
cx="24"
|
|
48
|
-
cy="24"
|
|
49
|
-
r="18"
|
|
50
|
-
fill="none"
|
|
51
|
-
stroke="var(--cb-color-primary-500, #10b981)"
|
|
52
|
-
stroke-width="4"
|
|
53
|
-
stroke-linecap="round"
|
|
54
|
-
stroke-dasharray="80 32"
|
|
55
|
-
/>
|
|
56
|
-
</svg>
|
|
57
|
-
</div>
|
|
38
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbAnimationLottie, isStandalone: true, selector: "cb-animation-lottie", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "size()", "style.height": "size()" }, classAttribute: "cb-animation-lottie-host" }, ngImport: i0, template: `
|
|
39
|
+
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
40
|
+
<svg
|
|
41
|
+
class="cb-animation-lottie__svg"
|
|
42
|
+
[class.cb-is-playing]="playing()"
|
|
43
|
+
viewBox="0 0 48 48"
|
|
44
|
+
aria-hidden="true"
|
|
45
|
+
>
|
|
46
|
+
<circle
|
|
47
|
+
cx="24"
|
|
48
|
+
cy="24"
|
|
49
|
+
r="18"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="var(--cb-color-primary-500, #10b981)"
|
|
52
|
+
stroke-width="4"
|
|
53
|
+
stroke-linecap="round"
|
|
54
|
+
stroke-dasharray="80 32"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
</div>
|
|
58
58
|
`, isInline: true, styles: [":host{display:inline-flex}.cb-animation-lottie{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%}.cb-animation-lottie__svg{width:70%;height:70%;transform-origin:center}.cb-animation-lottie__svg.cb-is-playing{animation:cb-lottie-spin 1.2s linear infinite}@keyframes cb-lottie-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cb-animation-lottie__svg.cb-is-playing{animation-duration:3s}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
59
59
|
}
|
|
60
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbAnimationLottie, decorators: [{
|
|
@@ -63,26 +63,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
63
63
|
class: 'cb-animation-lottie-host',
|
|
64
64
|
'[style.width]': 'size()',
|
|
65
65
|
'[style.height]': 'size()',
|
|
66
|
-
}, template: `
|
|
67
|
-
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
68
|
-
<svg
|
|
69
|
-
class="cb-animation-lottie__svg"
|
|
70
|
-
[class.cb-is-playing]="playing()"
|
|
71
|
-
viewBox="0 0 48 48"
|
|
72
|
-
aria-hidden="true"
|
|
73
|
-
>
|
|
74
|
-
<circle
|
|
75
|
-
cx="24"
|
|
76
|
-
cy="24"
|
|
77
|
-
r="18"
|
|
78
|
-
fill="none"
|
|
79
|
-
stroke="var(--cb-color-primary-500, #10b981)"
|
|
80
|
-
stroke-width="4"
|
|
81
|
-
stroke-linecap="round"
|
|
82
|
-
stroke-dasharray="80 32"
|
|
83
|
-
/>
|
|
84
|
-
</svg>
|
|
85
|
-
</div>
|
|
66
|
+
}, template: `
|
|
67
|
+
<div class="cb-animation-lottie" role="img" [attr.aria-label]="(ariaLabel() ?? t().animation)">
|
|
68
|
+
<svg
|
|
69
|
+
class="cb-animation-lottie__svg"
|
|
70
|
+
[class.cb-is-playing]="playing()"
|
|
71
|
+
viewBox="0 0 48 48"
|
|
72
|
+
aria-hidden="true"
|
|
73
|
+
>
|
|
74
|
+
<circle
|
|
75
|
+
cx="24"
|
|
76
|
+
cy="24"
|
|
77
|
+
r="18"
|
|
78
|
+
fill="none"
|
|
79
|
+
stroke="var(--cb-color-primary-500, #10b981)"
|
|
80
|
+
stroke-width="4"
|
|
81
|
+
stroke-linecap="round"
|
|
82
|
+
stroke-dasharray="80 32"
|
|
83
|
+
/>
|
|
84
|
+
</svg>
|
|
85
|
+
</div>
|
|
86
86
|
`, styles: [":host{display:inline-flex}.cb-animation-lottie{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%}.cb-animation-lottie__svg{width:70%;height:70%;transform-origin:center}.cb-animation-lottie__svg.cb-is-playing{animation:cb-lottie-spin 1.2s linear infinite}@keyframes cb-lottie-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cb-animation-lottie__svg.cb-is-playing{animation-duration:3s}}\n"] }]
|
|
87
87
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
88
88
|
|