@caribeng/ui 22.1.1 → 22.4.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 +134 -12
- package/fesm2022/caribeng-ui-accordion.mjs +4 -4
- package/fesm2022/caribeng-ui-anchor.mjs +169 -0
- package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-blockui.mjs +12 -4
- package/fesm2022/caribeng-ui-breadcrumb.mjs +17 -7
- package/fesm2022/caribeng-ui-button.mjs +22 -2
- package/fesm2022/caribeng-ui-caribe-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-animation-lottie.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-button-group.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +11 -6
- package/fesm2022/caribeng-ui-caribe-card-content.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-card-move.mjs +29 -7
- package/fesm2022/caribeng-ui-caribe-card-select.mjs +56 -14
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +10 -7
- package/fesm2022/caribeng-ui-caribe-coachmark.mjs +42 -19
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +15 -9
- package/fesm2022/caribeng-ui-caribe-dots-indicator.mjs +38 -5
- package/fesm2022/caribeng-ui-caribe-expansion-panel.mjs +16 -5
- package/fesm2022/caribeng-ui-caribe-fab-menu.mjs +56 -7
- package/fesm2022/caribeng-ui-caribe-file-download.mjs +68 -27
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +22 -17
- package/fesm2022/caribeng-ui-caribe-float-menu.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-footer.mjs +8 -4
- package/fesm2022/caribeng-ui-caribe-header.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-icon-button.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-illustration.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-input-search.mjs +14 -10
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +12 -10
- package/fesm2022/caribeng-ui-caribe-input-token.mjs +61 -11
- package/fesm2022/caribeng-ui-caribe-link.mjs +7 -2
- package/fesm2022/caribeng-ui-caribe-loader.mjs +8 -5
- package/fesm2022/caribeng-ui-caribe-modal.mjs +32 -16
- package/fesm2022/caribeng-ui-caribe-off-canvas.mjs +26 -12
- package/fesm2022/caribeng-ui-caribe-onboarding.mjs +44 -19
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +34 -10
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +9 -6
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-shortcut.mjs +8 -3
- package/fesm2022/caribeng-ui-caribe-step-indicator.mjs +12 -5
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-switch.mjs +5 -3
- package/fesm2022/caribeng-ui-caribe-tag-button.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-tracker.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-transaction-status.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-voucher.mjs +11 -8
- package/fesm2022/caribeng-ui-carousel.mjs +49 -14
- package/fesm2022/caribeng-ui-cascadeselect.mjs +22 -8
- package/fesm2022/caribeng-ui-chart.mjs +2601 -303
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/caribeng-ui-chip.mjs +9 -4
- package/fesm2022/caribeng-ui-chips.mjs +9 -5
- package/fesm2022/caribeng-ui-code-block.mjs +332 -0
- package/fesm2022/caribeng-ui-colorpicker.mjs +107 -11
- package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
- package/fesm2022/caribeng-ui-confirmdialog.mjs +140 -10
- package/fesm2022/caribeng-ui-confirmpopup.mjs +209 -9
- package/fesm2022/caribeng-ui-contextmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
- package/fesm2022/caribeng-ui-dataview.mjs +214 -6
- package/fesm2022/caribeng-ui-datepicker.mjs +1630 -393
- package/fesm2022/caribeng-ui-descriptions.mjs +124 -0
- package/fesm2022/caribeng-ui-dialog.mjs +10 -7
- package/fesm2022/caribeng-ui-dock.mjs +58 -15
- package/fesm2022/caribeng-ui-drawer.mjs +17 -9
- package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
- package/fesm2022/caribeng-ui-editor.mjs +4413 -243
- package/fesm2022/caribeng-ui-empty.mjs +80 -0
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +136 -19
- package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
- package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
- package/fesm2022/caribeng-ui-folder-card.mjs +132 -15
- package/fesm2022/caribeng-ui-galleria.mjs +76 -45
- package/fesm2022/caribeng-ui-image.mjs +52 -29
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-inplace.mjs +22 -6
- package/fesm2022/caribeng-ui-input-number.mjs +9 -7
- package/fesm2022/caribeng-ui-inputgroup.mjs +2 -2
- package/fesm2022/caribeng-ui-inputmask.mjs +22 -13
- package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
- package/fesm2022/caribeng-ui-listbox.mjs +13 -11
- package/fesm2022/caribeng-ui-megamenu.mjs +228 -32
- package/fesm2022/caribeng-ui-mentions.mjs +495 -0
- package/fesm2022/caribeng-ui-menu.mjs +18 -8
- package/fesm2022/caribeng-ui-menubar.mjs +17 -8
- package/fesm2022/caribeng-ui-message.mjs +13 -7
- package/fesm2022/caribeng-ui-metergroup.mjs +29 -11
- package/fesm2022/caribeng-ui-multiselect.mjs +399 -97
- package/fesm2022/caribeng-ui-orderlist.mjs +230 -11
- package/fesm2022/caribeng-ui-organizationchart.mjs +16 -15
- package/fesm2022/caribeng-ui-paginator.mjs +18 -15
- package/fesm2022/caribeng-ui-panel.mjs +11 -8
- package/fesm2022/caribeng-ui-panelmenu.mjs +14 -8
- package/fesm2022/caribeng-ui-password.mjs +8 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-picklist.mjs +251 -14
- package/fesm2022/caribeng-ui-pricing.mjs +272 -75
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-rating.mjs +7 -3
- package/fesm2022/caribeng-ui-repeater.mjs +223 -0
- package/fesm2022/caribeng-ui-result.mjs +91 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scrollpanel.mjs +6 -3
- package/fesm2022/caribeng-ui-scrolltop.mjs +9 -4
- package/fesm2022/caribeng-ui-select.mjs +379 -87
- package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-slider.mjs +171 -75
- package/fesm2022/caribeng-ui-speeddial.mjs +7 -4
- package/fesm2022/caribeng-ui-spinner.mjs +5 -2
- package/fesm2022/caribeng-ui-splitbutton.mjs +163 -0
- package/fesm2022/caribeng-ui-splitter.mjs +5 -2
- package/fesm2022/caribeng-ui-statistic.mjs +183 -0
- package/fesm2022/caribeng-ui-stepper.mjs +17 -7
- package/fesm2022/caribeng-ui-steps.mjs +6 -3
- package/fesm2022/caribeng-ui-table.mjs +716 -84
- package/fesm2022/caribeng-ui-tabmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-terminal.mjs +45 -9
- package/fesm2022/caribeng-ui-themetoggle.mjs +82 -0
- package/fesm2022/caribeng-ui-tieredmenu.mjs +113 -20
- package/fesm2022/caribeng-ui-timeline.mjs +175 -6
- package/fesm2022/caribeng-ui-toast.mjs +7 -4
- package/fesm2022/caribeng-ui-togglebutton.mjs +8 -6
- package/fesm2022/caribeng-ui-toolbar.mjs +6 -3
- package/fesm2022/caribeng-ui-tree.mjs +302 -6
- package/fesm2022/caribeng-ui-treeselect.mjs +26 -10
- package/fesm2022/caribeng-ui-treetable.mjs +269 -6
- package/fesm2022/caribeng-ui-virtualscroller.mjs +123 -10
- package/fesm2022/caribeng-ui.mjs +1216 -6
- package/package.json +93 -3
- package/schematics/collection.json +15 -0
- package/schematics/migrate-from-primeng/core-icons.json +1 -0
- package/schematics/migrate-from-primeng/icons.js +269 -0
- package/schematics/migrate-from-primeng/index.js +290 -0
- package/schematics/migrate-from-primeng/mappings/button.js +93 -0
- package/schematics/migrate-from-primeng/mappings/card.js +33 -0
- package/schematics/migrate-from-primeng/mappings/checkbox.js +44 -0
- package/schematics/migrate-from-primeng/mappings/confirm.js +221 -0
- package/schematics/migrate-from-primeng/mappings/datepicker.js +121 -0
- package/schematics/migrate-from-primeng/mappings/dialog.js +84 -0
- package/schematics/migrate-from-primeng/mappings/index.js +88 -0
- package/schematics/migrate-from-primeng/mappings/inputnumber.js +62 -0
- package/schematics/migrate-from-primeng/mappings/inputtext.js +60 -0
- package/schematics/migrate-from-primeng/mappings/menu.js +468 -0
- package/schematics/migrate-from-primeng/mappings/multiselect.js +49 -0
- package/schematics/migrate-from-primeng/mappings/radiobutton.js +22 -0
- package/schematics/migrate-from-primeng/mappings/rules.js +206 -0
- package/schematics/migrate-from-primeng/mappings/select.js +97 -0
- package/schematics/migrate-from-primeng/mappings/service-calls.js +100 -0
- package/schematics/migrate-from-primeng/mappings/table.js +613 -0
- package/schematics/migrate-from-primeng/mappings/tabs.js +225 -0
- package/schematics/migrate-from-primeng/mappings/tag.js +29 -0
- package/schematics/migrate-from-primeng/mappings/textarea.js +44 -0
- package/schematics/migrate-from-primeng/mappings/toast.js +173 -0
- package/schematics/migrate-from-primeng/mappings/toggleswitch.js +37 -0
- package/schematics/migrate-from-primeng/mappings/tooltip.js +44 -0
- package/schematics/migrate-from-primeng/mappings/types.js +10 -0
- package/schematics/migrate-from-primeng/report.js +79 -0
- package/schematics/migrate-from-primeng/schema.js +2 -0
- package/schematics/migrate-from-primeng/schema.json +34 -0
- package/schematics/migrate-from-primeng/template.js +387 -0
- package/schematics/migrate-from-primeng/todo.js +5 -0
- package/schematics/migrate-from-primeng/typescript.js +442 -0
- package/schematics/migrate-from-primeng/workspace.js +117 -0
- package/schematics/ng-add/index.js +140 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +66 -0
- package/types/caribeng-ui-anchor.d.ts +50 -0
- package/types/caribeng-ui-autocomplete.d.ts +4 -2
- package/types/caribeng-ui-avatargroup.d.ts +3 -1
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-blockui.d.ts +9 -4
- package/types/caribeng-ui-breadcrumb.d.ts +11 -0
- package/types/caribeng-ui-button.d.ts +9 -1
- package/types/caribeng-ui-caribe-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-animation-lottie.d.ts +4 -1
- package/types/caribeng-ui-caribe-button-group.d.ts +4 -1
- package/types/caribeng-ui-caribe-calendar.d.ts +5 -1
- package/types/caribeng-ui-caribe-card-content.d.ts +4 -1
- package/types/caribeng-ui-caribe-card-move.d.ts +13 -13
- package/types/caribeng-ui-caribe-card-select.d.ts +10 -1
- package/types/caribeng-ui-caribe-circle-loading.d.ts +4 -1
- package/types/caribeng-ui-caribe-coachmark.d.ts +6 -0
- package/types/caribeng-ui-caribe-data-table.d.ts +7 -2
- package/types/caribeng-ui-caribe-dots-indicator.d.ts +9 -0
- package/types/caribeng-ui-caribe-expansion-panel.d.ts +7 -10
- package/types/caribeng-ui-caribe-fab-menu.d.ts +10 -1
- package/types/caribeng-ui-caribe-file-download.d.ts +8 -10
- package/types/caribeng-ui-caribe-file-select.d.ts +7 -1
- package/types/caribeng-ui-caribe-float-menu.d.ts +4 -1
- package/types/caribeng-ui-caribe-header.d.ts +3 -0
- package/types/caribeng-ui-caribe-icon-button.d.ts +4 -1
- package/types/caribeng-ui-caribe-illustration.d.ts +4 -1
- package/types/caribeng-ui-caribe-inline-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-input-search.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-select.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-token.d.ts +16 -1
- package/types/caribeng-ui-caribe-link.d.ts +3 -0
- package/types/caribeng-ui-caribe-loader.d.ts +4 -1
- package/types/caribeng-ui-caribe-modal.d.ts +7 -10
- package/types/caribeng-ui-caribe-off-canvas.d.ts +6 -1
- package/types/caribeng-ui-caribe-onboarding.d.ts +6 -0
- package/types/caribeng-ui-caribe-pictogram.d.ts +4 -1
- package/types/caribeng-ui-caribe-pop-over.d.ts +7 -10
- package/types/caribeng-ui-caribe-preloader.d.ts +4 -1
- package/types/caribeng-ui-caribe-progress-bar.d.ts +3 -0
- package/types/caribeng-ui-caribe-shortcut.d.ts +3 -1
- package/types/caribeng-ui-caribe-step-indicator.d.ts +6 -0
- package/types/caribeng-ui-caribe-stroke.d.ts +4 -1
- package/types/caribeng-ui-caribe-switch.d.ts +3 -1
- package/types/caribeng-ui-caribe-tracker.d.ts +3 -0
- package/types/caribeng-ui-caribe-voucher.d.ts +5 -2
- package/types/caribeng-ui-carousel.d.ts +10 -1
- package/types/caribeng-ui-cascadeselect.d.ts +7 -2
- package/types/caribeng-ui-chart.d.ts +471 -44
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/caribeng-ui-chip.d.ts +6 -0
- package/types/caribeng-ui-chips.d.ts +6 -2
- package/types/caribeng-ui-code-block.d.ts +65 -0
- package/types/caribeng-ui-colorpicker.d.ts +8 -2
- package/types/caribeng-ui-command-palette.d.ts +133 -0
- package/types/caribeng-ui-confirmdialog.d.ts +57 -6
- package/types/caribeng-ui-confirmpopup.d.ts +74 -5
- package/types/caribeng-ui-contextmenu.d.ts +11 -1
- package/types/caribeng-ui-copy-button.d.ts +90 -0
- package/types/caribeng-ui-dataview.d.ts +65 -5
- package/types/caribeng-ui-datepicker.d.ts +186 -21
- package/types/caribeng-ui-descriptions.d.ts +63 -0
- package/types/caribeng-ui-dialog.d.ts +4 -1
- package/types/caribeng-ui-dock.d.ts +17 -2
- package/types/caribeng-ui-drawer.d.ts +7 -2
- package/types/caribeng-ui-dynamicdialog.d.ts +93 -3
- package/types/caribeng-ui-editor.d.ts +486 -13
- package/types/caribeng-ui-empty.d.ts +34 -0
- package/types/caribeng-ui-file-card.d.ts +28 -3
- package/types/caribeng-ui-fileupload.d.ts +27 -4
- package/types/caribeng-ui-folder-card.d.ts +31 -6
- package/types/caribeng-ui-galleria.d.ts +9 -0
- package/types/caribeng-ui-image.d.ts +10 -0
- package/types/caribeng-ui-inplace.d.ts +8 -0
- package/types/caribeng-ui-input-number.d.ts +3 -1
- package/types/caribeng-ui-inputmask.d.ts +8 -1
- package/types/caribeng-ui-inputotp.d.ts +7 -2
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-keyfilter.d.ts +30 -0
- package/types/caribeng-ui-listbox.d.ts +5 -3
- package/types/caribeng-ui-megamenu.d.ts +37 -2
- package/types/caribeng-ui-mentions.d.ts +127 -0
- package/types/caribeng-ui-menu.d.ts +14 -2
- package/types/caribeng-ui-menubar.d.ts +12 -1
- package/types/caribeng-ui-message.d.ts +5 -0
- package/types/caribeng-ui-metergroup.d.ts +9 -1
- package/types/caribeng-ui-multiselect.d.ts +71 -10
- package/types/caribeng-ui-orderlist.d.ts +58 -6
- package/types/caribeng-ui-organizationchart.d.ts +7 -1
- package/types/caribeng-ui-paginator.d.ts +3 -0
- package/types/caribeng-ui-panel.d.ts +3 -0
- package/types/caribeng-ui-panelmenu.d.ts +11 -1
- package/types/caribeng-ui-password.d.ts +4 -2
- package/types/caribeng-ui-pdfviewer.d.ts +258 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-picklist.d.ts +67 -7
- package/types/caribeng-ui-pricing.d.ts +49 -9
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-rating.d.ts +6 -2
- package/types/caribeng-ui-repeater.d.ts +79 -0
- package/types/caribeng-ui-result.d.ts +35 -0
- package/types/caribeng-ui-scrollpanel.d.ts +4 -1
- package/types/caribeng-ui-scrolltop.d.ts +4 -1
- package/types/caribeng-ui-select.d.ts +73 -9
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-slider.d.ts +63 -10
- package/types/caribeng-ui-speeddial.d.ts +5 -2
- package/types/caribeng-ui-spinner.d.ts +3 -0
- package/types/caribeng-ui-splitbutton.d.ts +49 -0
- package/types/caribeng-ui-splitter.d.ts +3 -0
- package/types/caribeng-ui-statistic.d.ts +65 -0
- package/types/caribeng-ui-stepper.d.ts +5 -0
- package/types/caribeng-ui-steps.d.ts +4 -1
- package/types/caribeng-ui-table.d.ts +185 -17
- package/types/caribeng-ui-tabmenu.d.ts +11 -1
- package/types/caribeng-ui-terminal.d.ts +10 -0
- package/types/caribeng-ui-themetoggle.d.ts +32 -0
- package/types/caribeng-ui-tieredmenu.d.ts +22 -3
- package/types/caribeng-ui-timeline.d.ts +63 -4
- package/types/caribeng-ui-toast.d.ts +3 -0
- package/types/caribeng-ui-togglebutton.d.ts +5 -3
- package/types/caribeng-ui-toolbar.d.ts +7 -4
- package/types/caribeng-ui-tree.d.ts +76 -4
- package/types/caribeng-ui-treeselect.d.ts +10 -2
- package/types/caribeng-ui-treetable.d.ts +68 -4
- package/types/caribeng-ui-virtualscroller.d.ts +45 -5
- package/types/caribeng-ui.d.ts +775 -12
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accordion = exports.tabs = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
/** Hijos que cuentan (sin el espacio en blanco entre etiquetas). */
|
|
6
|
+
function significant(node) {
|
|
7
|
+
return node.children.filter((child) => child.kind !== 'text' || child.inner.trim() !== '');
|
|
8
|
+
}
|
|
9
|
+
/** `value="0"` / `[value]="0"` → `0`. */
|
|
10
|
+
function valueOf(node) {
|
|
11
|
+
return node.bindings.find((b) => b.name === 'value' && (b.kind === 'static' || b.kind === 'property'))?.value.trim();
|
|
12
|
+
}
|
|
13
|
+
/** Texto de una cabecera, o `null` si tiene marcado (iconos, badges, bloques). */
|
|
14
|
+
function headerText(node) {
|
|
15
|
+
const text = node.inner.trim().replace(/\s+/g, ' ');
|
|
16
|
+
return /[<@]/.test(text) ? null : text;
|
|
17
|
+
}
|
|
18
|
+
/** El primer elemento hijo con uno de estos tags. */
|
|
19
|
+
function childNamed(node, names) {
|
|
20
|
+
return node.children.find((child) => child.kind === 'element' && names.includes(child.name));
|
|
21
|
+
}
|
|
22
|
+
const NO_ACTIVE = 'cb-tabs no expone la pestaña activa (empieza en la primera).';
|
|
23
|
+
/** Atributos de `p-tabs` / `p-tabView`. */
|
|
24
|
+
function tabsRules(firstValue) {
|
|
25
|
+
return {
|
|
26
|
+
value: (binding, el) => {
|
|
27
|
+
if (!(binding.kind === 'static' && binding.value.trim() === firstValue))
|
|
28
|
+
el.todos.push(`${binding.source} — ${NO_ACTIVE}`);
|
|
29
|
+
},
|
|
30
|
+
activeIndex: (binding, el) => {
|
|
31
|
+
if (!(binding.kind !== 'event' && binding.value.trim() === '0'))
|
|
32
|
+
el.todos.push(`${binding.source} — ${NO_ACTIVE}`);
|
|
33
|
+
},
|
|
34
|
+
'(valueChange)': (0, rules_1.unsupported)(NO_ACTIVE),
|
|
35
|
+
'(activeIndexChange)': (0, rules_1.unsupported)(NO_ACTIVE),
|
|
36
|
+
'(onChange)': (0, rules_1.unsupported)(NO_ACTIVE),
|
|
37
|
+
'(onClose)': (0, rules_1.unsupported)('las pestañas de cb-tabs no se cierran.'),
|
|
38
|
+
styleClass: (0, rules_1.styleClass)(),
|
|
39
|
+
style: (0, rules_1.unsupported)('personaliza las pestañas con los tokens CSS de CaribeNG.'),
|
|
40
|
+
scrollable: (0, rules_1.drop)(),
|
|
41
|
+
lazy: (0, rules_1.drop)(),
|
|
42
|
+
selectOnFocus: (0, rules_1.drop)(),
|
|
43
|
+
showNavigators: (0, rules_1.drop)(),
|
|
44
|
+
tabindex: (0, rules_1.drop)(),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** `[disabled]` de la pestaña (p-tab) pasa al cb-tab. */
|
|
48
|
+
function tabPanel(label, disabled) {
|
|
49
|
+
return {
|
|
50
|
+
to: 'cb-tab',
|
|
51
|
+
rules: { value: (0, rules_1.drop)() },
|
|
52
|
+
finalize: (el) => {
|
|
53
|
+
el.attrs.unshift((0, rules_1.renderAttr)('static', 'label', label));
|
|
54
|
+
if (disabled)
|
|
55
|
+
el.attrs.push(disabled.source);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ```html
|
|
61
|
+
* <p-tabs value="0">
|
|
62
|
+
* <p-tablist><p-tab value="0">Resumen</p-tab><p-tab value="1">Detalle</p-tab></p-tablist>
|
|
63
|
+
* <p-tabpanels><p-tabpanel value="0">A</p-tabpanel><p-tabpanel value="1">B</p-tabpanel></p-tabpanels>
|
|
64
|
+
* </p-tabs>
|
|
65
|
+
* ```
|
|
66
|
+
* → `<cb-tabs><cb-tab label="Resumen">A</cb-tab><cb-tab label="Detalle">B</cb-tab></cb-tabs>`
|
|
67
|
+
*/
|
|
68
|
+
function restructureTabs(node, r) {
|
|
69
|
+
const parts = significant(node);
|
|
70
|
+
const list = parts.find((p) => p.name === 'p-tablist');
|
|
71
|
+
const panelsWrapper = parts.find((p) => p.name === 'p-tabpanels');
|
|
72
|
+
if (!list || !panelsWrapper || parts.length !== 2)
|
|
73
|
+
return 'p-tabs sin la estructura p-tablist + p-tabpanels; migra a <cb-tabs> con un <cb-tab label="…"> por panel.';
|
|
74
|
+
const tabs = significant(list);
|
|
75
|
+
const panels = significant(panelsWrapper);
|
|
76
|
+
if ([...tabs, ...panels].some((n) => n.kind !== 'element' || !['p-tab', 'p-tabpanel'].includes(n.name))) {
|
|
77
|
+
return 'las pestañas se generan con @for/@if o tienen elementos extra; migra a <cb-tabs> con un <cb-tab label="…"> por panel.';
|
|
78
|
+
}
|
|
79
|
+
const headers = new Map(tabs.map((tab) => [valueOf(tab), tab]));
|
|
80
|
+
if (headers.has(undefined) || headers.size !== tabs.length || panels.length !== tabs.length) {
|
|
81
|
+
return 'las pestañas y los paneles no se pueden emparejar por value; migra a <cb-tabs> con un <cb-tab label="…"> por panel.';
|
|
82
|
+
}
|
|
83
|
+
const pairs = [];
|
|
84
|
+
for (const panel of panels) {
|
|
85
|
+
const tab = headers.get(valueOf(panel));
|
|
86
|
+
if (!tab)
|
|
87
|
+
return `el p-tabpanel con value ${valueOf(panel)} no tiene p-tab; migra a <cb-tabs> a mano.`;
|
|
88
|
+
const label = headerText(tab);
|
|
89
|
+
if (label === null)
|
|
90
|
+
return 'una cabecera tiene marcado (icono, badge…) y cb-tab solo admite texto en label; migra a <cb-tabs> a mano.';
|
|
91
|
+
pairs.push([panel, label, tab.bindings.find((b) => b.name === 'disabled')]);
|
|
92
|
+
}
|
|
93
|
+
r.convert(node, { to: 'cb-tabs', rules: tabsRules(valueOf(tabs[0])) });
|
|
94
|
+
r.remove(list);
|
|
95
|
+
r.unwrap(panelsWrapper);
|
|
96
|
+
for (const [panel, label, disabled] of pairs)
|
|
97
|
+
r.convert(panel, tabPanel(label, disabled));
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const TAB_PANEL_V17 = {
|
|
101
|
+
header: (0, rules_1.rename)('label'),
|
|
102
|
+
closable: (0, rules_1.unsupported)('las pestañas de cb-tabs no se cierran.'),
|
|
103
|
+
leftIcon: (0, rules_1.unsupported)('cb-tab solo admite texto en label.'),
|
|
104
|
+
rightIcon: (0, rules_1.unsupported)('cb-tab solo admite texto en label.'),
|
|
105
|
+
tooltip: (0, rules_1.unsupported)('usa la directiva cbTooltip de @caribeng/ui/tooltip.'),
|
|
106
|
+
tooltipPosition: (0, rules_1.unsupported)('usa la directiva cbTooltip de @caribeng/ui/tooltip.'),
|
|
107
|
+
tooltipStyleClass: (0, rules_1.unsupported)('usa la directiva cbTooltip de @caribeng/ui/tooltip.'),
|
|
108
|
+
headerStyle: (0, rules_1.unsupported)('personaliza las pestañas con los tokens CSS de CaribeNG.'),
|
|
109
|
+
headerStyleClass: (0, rules_1.unsupported)('personaliza las pestañas con los tokens CSS de CaribeNG.'),
|
|
110
|
+
cache: (0, rules_1.drop)(),
|
|
111
|
+
selected: (0, rules_1.unsupported)(NO_ACTIVE),
|
|
112
|
+
};
|
|
113
|
+
exports.tabs = {
|
|
114
|
+
name: 'tabs',
|
|
115
|
+
entry: '@caribeng/ui/tabs',
|
|
116
|
+
symbol: 'CbTabs',
|
|
117
|
+
tags: { 'cb-tab': 'CbTab' },
|
|
118
|
+
modules: {
|
|
119
|
+
'primeng/tabs': { TabsModule: 'CbTabs', Tabs: 'CbTabs', TabList: 'CbTabs', TabPanels: 'CbTabs', Tab: 'CbTab', TabPanel: 'CbTab' },
|
|
120
|
+
// PrimeNG < 18.
|
|
121
|
+
'primeng/tabview': { TabViewModule: 'CbTabs', TabView: 'CbTabs', TabPanel: 'CbTab' },
|
|
122
|
+
},
|
|
123
|
+
elements: [
|
|
124
|
+
{ tag: 'p-tabs', to: 'cb-tabs', rules: {}, restructure: restructureTabs },
|
|
125
|
+
...['p-tabView', 'p-tabview'].map((tag) => ({ tag, to: 'cb-tabs', rules: tabsRules() })),
|
|
126
|
+
{
|
|
127
|
+
tag: 'p-tabPanel',
|
|
128
|
+
to: 'cb-tab',
|
|
129
|
+
symbol: 'CbTab',
|
|
130
|
+
rules: TAB_PANEL_V17,
|
|
131
|
+
child: (child) => (child.name === 'ng-template' ? { todo: 'cb-tab solo admite texto en label; la cabecera personalizada no se mostrará.' } : null),
|
|
132
|
+
same: ['disabled'],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
const NO_OPEN = 'cb-accordion empieza con los paneles cerrados y no expone cuál está abierto.';
|
|
137
|
+
/**
|
|
138
|
+
* ```html
|
|
139
|
+
* <p-accordion-panel value="0">
|
|
140
|
+
* <p-accordion-header>Envío</p-accordion-header>
|
|
141
|
+
* <p-accordion-content>…</p-accordion-content>
|
|
142
|
+
* </p-accordion-panel>
|
|
143
|
+
* ```
|
|
144
|
+
* → `<cb-accordion-panel header="Envío">…</cb-accordion-panel>`
|
|
145
|
+
*/
|
|
146
|
+
function restructurePanel(node, r) {
|
|
147
|
+
const header = childNamed(node, ['p-accordion-header', 'p-accordionheader']);
|
|
148
|
+
const content = childNamed(node, ['p-accordion-content', 'p-accordioncontent']);
|
|
149
|
+
if (!header || !content)
|
|
150
|
+
return 'panel sin p-accordion-header y p-accordion-content; migra a <cb-accordion-panel header="…"> a mano.';
|
|
151
|
+
const text = headerText(header);
|
|
152
|
+
if (text === null)
|
|
153
|
+
return 'la cabecera tiene marcado (icono, badge…) y cb-accordion-panel solo admite texto en header; migra a mano.';
|
|
154
|
+
r.convert(node, {
|
|
155
|
+
to: 'cb-accordion-panel',
|
|
156
|
+
rules: { value: (0, rules_1.drop)() },
|
|
157
|
+
finalize: (el) => el.attrs.unshift((0, rules_1.renderAttr)('static', 'header', text)),
|
|
158
|
+
});
|
|
159
|
+
r.remove(header);
|
|
160
|
+
r.unwrap(content);
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
exports.accordion = {
|
|
164
|
+
name: 'accordion',
|
|
165
|
+
entry: '@caribeng/ui/accordion',
|
|
166
|
+
symbol: 'CbAccordion',
|
|
167
|
+
modules: {
|
|
168
|
+
'primeng/accordion': {
|
|
169
|
+
AccordionModule: 'CbAccordion',
|
|
170
|
+
Accordion: 'CbAccordion',
|
|
171
|
+
AccordionPanel: 'CbAccordionPanel',
|
|
172
|
+
AccordionHeader: 'CbAccordionPanel',
|
|
173
|
+
AccordionContent: 'CbAccordionPanel',
|
|
174
|
+
// PrimeNG < 18.
|
|
175
|
+
AccordionTab: 'CbAccordionPanel',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
elements: [
|
|
179
|
+
{
|
|
180
|
+
tag: 'p-accordion',
|
|
181
|
+
to: 'cb-accordion',
|
|
182
|
+
rules: {
|
|
183
|
+
value: (0, rules_1.unsupported)(NO_OPEN),
|
|
184
|
+
activeIndex: (0, rules_1.unsupported)(NO_OPEN),
|
|
185
|
+
'(valueChange)': (0, rules_1.unsupported)(NO_OPEN),
|
|
186
|
+
'(activeIndexChange)': (0, rules_1.unsupported)(NO_OPEN),
|
|
187
|
+
'(onOpen)': (0, rules_1.unsupported)(NO_OPEN),
|
|
188
|
+
'(onClose)': (0, rules_1.unsupported)(NO_OPEN),
|
|
189
|
+
expandIcon: (0, rules_1.unsupported)('cb-accordion usa su propio icono.'),
|
|
190
|
+
collapseIcon: (0, rules_1.unsupported)('cb-accordion usa su propio icono.'),
|
|
191
|
+
styleClass: (0, rules_1.styleClass)(),
|
|
192
|
+
style: (0, rules_1.unsupported)('personaliza el acordeón con los tokens CSS de CaribeNG.'),
|
|
193
|
+
selectOnFocus: (0, rules_1.drop)(),
|
|
194
|
+
transitionOptions: (0, rules_1.drop)(),
|
|
195
|
+
motionOptions: (0, rules_1.drop)(),
|
|
196
|
+
},
|
|
197
|
+
same: ['multiple'],
|
|
198
|
+
},
|
|
199
|
+
...['p-accordion-panel', 'p-accordionpanel'].map((tag) => ({
|
|
200
|
+
tag,
|
|
201
|
+
to: 'cb-accordion-panel',
|
|
202
|
+
symbol: 'CbAccordionPanel',
|
|
203
|
+
rules: {},
|
|
204
|
+
restructure: restructurePanel,
|
|
205
|
+
})),
|
|
206
|
+
{
|
|
207
|
+
tag: 'p-accordionTab',
|
|
208
|
+
to: 'cb-accordion-panel',
|
|
209
|
+
symbol: 'CbAccordionPanel',
|
|
210
|
+
rules: {
|
|
211
|
+
selected: (0, rules_1.unsupported)(NO_OPEN),
|
|
212
|
+
'(selectedChange)': (0, rules_1.unsupported)(NO_OPEN),
|
|
213
|
+
headerStyle: (0, rules_1.unsupported)('personaliza el acordeón con los tokens CSS de CaribeNG.'),
|
|
214
|
+
headerStyleClass: (0, rules_1.unsupported)('personaliza el acordeón con los tokens CSS de CaribeNG.'),
|
|
215
|
+
contentStyle: (0, rules_1.unsupported)('personaliza el acordeón con los tokens CSS de CaribeNG.'),
|
|
216
|
+
contentStyleClass: (0, rules_1.unsupported)('personaliza el acordeón con los tokens CSS de CaribeNG.'),
|
|
217
|
+
cache: (0, rules_1.drop)(),
|
|
218
|
+
transitionOptions: (0, rules_1.drop)(),
|
|
219
|
+
iconPos: (0, rules_1.unsupported)('cb-accordion-panel coloca su icono a la derecha.'),
|
|
220
|
+
},
|
|
221
|
+
child: (child) => (child.name === 'ng-template' ? { todo: 'cb-accordion-panel solo admite texto en header; la cabecera personalizada no se mostrará.' } : null),
|
|
222
|
+
same: ['header', 'disabled'],
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tag = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
/**
|
|
6
|
+
* `<p-tag value="Nuevo" severity="warn" icon="pi pi-star" [rounded]="true" />`
|
|
7
|
+
* → `<cb-tag value="Nuevo" severity="warning" icon="star" [rounded]="true" />`
|
|
8
|
+
*/
|
|
9
|
+
exports.tag = {
|
|
10
|
+
name: 'tag',
|
|
11
|
+
entry: '@caribeng/ui/tag',
|
|
12
|
+
symbol: 'CbTag',
|
|
13
|
+
modules: {
|
|
14
|
+
'primeng/tag': { TagModule: 'CbTag', Tag: 'CbTag' },
|
|
15
|
+
},
|
|
16
|
+
elements: [
|
|
17
|
+
{
|
|
18
|
+
tag: 'p-tag',
|
|
19
|
+
to: 'cb-tag',
|
|
20
|
+
rules: {
|
|
21
|
+
severity: (0, rules_1.values)('severity', rules_1.SEVERITY_VALUES),
|
|
22
|
+
icon: (0, rules_1.iconName)(),
|
|
23
|
+
styleClass: (0, rules_1.styleClass)(),
|
|
24
|
+
},
|
|
25
|
+
child: (child) => (child.name === 'ng-template' ? { todo: 'cb-tag no admite plantilla de icono; usa el input icon.' } : null),
|
|
26
|
+
same: ['value', 'rounded'],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textarea = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
const NOT_FORWARDED = 'el atributo nativo no se reenvía al <textarea> interno de cb-textarea.';
|
|
6
|
+
/**
|
|
7
|
+
* `<textarea pTextarea id="nota" rows="5" [autoResize]="true" [(ngModel)]="nota"></textarea>`
|
|
8
|
+
* → `<cb-textarea inputId="nota" [rows]="5" [autoResize]="true" [(ngModel)]="nota" />`
|
|
9
|
+
*/
|
|
10
|
+
exports.textarea = {
|
|
11
|
+
name: 'textarea',
|
|
12
|
+
entry: '@caribeng/ui/textarea',
|
|
13
|
+
symbol: 'CbTextarea',
|
|
14
|
+
modules: {
|
|
15
|
+
'primeng/textarea': { TextareaModule: 'CbTextarea', Textarea: 'CbTextarea' },
|
|
16
|
+
// Nombre anterior a PrimeNG 18.
|
|
17
|
+
'primeng/inputtextarea': { InputTextareaModule: 'CbTextarea', InputTextarea: 'CbTextarea' },
|
|
18
|
+
},
|
|
19
|
+
elements: ['pTextarea', 'pInputTextarea'].map((attr) => ({
|
|
20
|
+
attr,
|
|
21
|
+
on: ['textarea'],
|
|
22
|
+
to: 'cb-textarea',
|
|
23
|
+
selfClosing: true,
|
|
24
|
+
rules: {
|
|
25
|
+
// El id debe llegar al <textarea> interno para que <label for> siga funcionando.
|
|
26
|
+
id: (0, rules_1.rename)('inputId'),
|
|
27
|
+
pSize: (0, rules_1.values)('size', rules_1.SIZE_VALUES),
|
|
28
|
+
rows: (0, rules_1.numeric)(),
|
|
29
|
+
maxlength: (0, rules_1.numeric)(),
|
|
30
|
+
variant: (0, rules_1.unsupported)('cb-textarea no tiene variante "filled".'),
|
|
31
|
+
fluid: (0, rules_1.unsupported)('cb-textarea ya ocupa todo el ancho de su contenedor.'),
|
|
32
|
+
cols: (0, rules_1.unsupported)('cb-textarea ocupa el ancho de su contenedor; ajusta el ancho con CSS.'),
|
|
33
|
+
minlength: (0, rules_1.unsupported)(NOT_FORWARDED),
|
|
34
|
+
autocomplete: (0, rules_1.unsupported)(NOT_FORWARDED),
|
|
35
|
+
spellcheck: (0, rules_1.unsupported)(NOT_FORWARDED),
|
|
36
|
+
autofocus: (0, rules_1.unsupported)('usa la directiva cbAutoFocus de @caribeng/ui/autofocus.'),
|
|
37
|
+
'aria-label': (0, rules_1.unsupported)('usa el input label de cb-textarea; el aria-label del host no llega al <textarea> interno.'),
|
|
38
|
+
'(onResize)': (0, rules_1.unsupported)('cb-textarea no emite el cambio de tamaño.'),
|
|
39
|
+
'(focus)': (0, rules_1.event)('focusin'),
|
|
40
|
+
'(blur)': (0, rules_1.event)('focusout'),
|
|
41
|
+
},
|
|
42
|
+
same: ['autoResize', 'placeholder', 'readonly', 'required', 'disabled', 'invalid', 'value'],
|
|
43
|
+
})),
|
|
44
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.toast = void 0;
|
|
37
|
+
const ts = __importStar(require("typescript"));
|
|
38
|
+
const rules_1 = require("./rules");
|
|
39
|
+
const service_calls_1 = require("./service-calls");
|
|
40
|
+
const POSITIONS = ['top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center'];
|
|
41
|
+
/** Severidades de los mensajes de PrimeNG → CbSeverity. */
|
|
42
|
+
const MESSAGE_SEVERITY = { warn: 'warning', error: 'danger' };
|
|
43
|
+
/** Propiedades de un mensaje de PrimeNG sin equivalente en CbToastOptions. */
|
|
44
|
+
const DROPPED_FIELDS = new Set(['key', 'icon', 'data', 'id', 'styleClass', 'contentStyleClass', 'closeIcon', 'text']);
|
|
45
|
+
/**
|
|
46
|
+
* `{ severity: 'error', summary, sticky: true, key: 'x' }`
|
|
47
|
+
* → `{ severity: 'danger', summary, life: 0 }`. Devuelve el texto nuevo (o
|
|
48
|
+
* `null` si no cambia) y los avisos.
|
|
49
|
+
*/
|
|
50
|
+
function rewriteMessage(sf, message, todos) {
|
|
51
|
+
let changed = false;
|
|
52
|
+
const hasLife = message.properties.some((p) => (0, service_calls_1.propertyName)(p) === 'life');
|
|
53
|
+
const dropped = [];
|
|
54
|
+
const properties = [];
|
|
55
|
+
for (const property of message.properties) {
|
|
56
|
+
const name = (0, service_calls_1.propertyName)(property);
|
|
57
|
+
const text = property.getText(sf);
|
|
58
|
+
if (name && DROPPED_FIELDS.has(name)) {
|
|
59
|
+
dropped.push(text);
|
|
60
|
+
changed = true;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (name === 'severity' && ts.isPropertyAssignment(property)) {
|
|
64
|
+
const value = property.initializer;
|
|
65
|
+
if (ts.isStringLiteralLike(value)) {
|
|
66
|
+
const mapped = MESSAGE_SEVERITY[value.text];
|
|
67
|
+
if (mapped) {
|
|
68
|
+
const quote = sf.text[value.getStart(sf)];
|
|
69
|
+
properties.push(`${property.name.getText(sf)}: ${quote}${mapped}${quote}`);
|
|
70
|
+
changed = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
todos.push(`severity con expresión: CaribeNG usa 'warning' y 'danger' en vez de 'warn' y 'error'.`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (name === 'sticky' && ts.isPropertyAssignment(property)) {
|
|
79
|
+
changed = true;
|
|
80
|
+
const value = property.initializer;
|
|
81
|
+
if (value.kind === ts.SyntaxKind.FalseKeyword)
|
|
82
|
+
continue;
|
|
83
|
+
if (hasLife) {
|
|
84
|
+
todos.push(`${text} — en CaribeNG un mensaje fijo es life: 0; revisa el life de este mensaje.`);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
properties.push(value.kind === ts.SyntaxKind.TrueKeyword ? 'life: 0' : `life: (${value.getText(sf)}) ? 0 : 3000`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
properties.push(text);
|
|
91
|
+
}
|
|
92
|
+
if (dropped.length)
|
|
93
|
+
todos.push(`${dropped.join(', ')} — CbToastService no tiene estos campos.`);
|
|
94
|
+
if (!changed)
|
|
95
|
+
return null;
|
|
96
|
+
return (0, service_calls_1.rebuildObject)(sf, message, properties);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Llamadas a `MessageService` → `CbToastService`: traduce las severidades
|
|
100
|
+
* (`warn` → `warning`, `error` → `danger`), `sticky` → `life: 0`, y marca
|
|
101
|
+
* `key`, `addAll()` y los observables, que no tienen equivalente.
|
|
102
|
+
*/
|
|
103
|
+
const rewriteMessageService = (sf, { locals }, edits) => {
|
|
104
|
+
const local = locals.get('MessageService');
|
|
105
|
+
if (!local)
|
|
106
|
+
return;
|
|
107
|
+
(0, service_calls_1.forEachServiceCall)(sf, local, (method, access, call) => {
|
|
108
|
+
const todos = [];
|
|
109
|
+
if (method === 'add' && call) {
|
|
110
|
+
const [message] = call.arguments;
|
|
111
|
+
if (message && ts.isObjectLiteralExpression(message)) {
|
|
112
|
+
const rewritten = rewriteMessage(sf, message, todos);
|
|
113
|
+
if (rewritten !== null)
|
|
114
|
+
edits.push({ start: message.getStart(sf), end: message.getEnd(), text: rewritten });
|
|
115
|
+
}
|
|
116
|
+
else if (message) {
|
|
117
|
+
todos.push(`mensaje no literal: CaribeNG usa severity 'warning'/'danger' (no 'warn'/'error') y life: 0 en vez de sticky.`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else if (method === 'addAll') {
|
|
121
|
+
todos.push('CbToastService no tiene addAll(); llama a add() por cada mensaje.');
|
|
122
|
+
}
|
|
123
|
+
else if (method === 'clear' && call?.arguments.length) {
|
|
124
|
+
const args = call.arguments;
|
|
125
|
+
edits.push({ start: args[0].getStart(sf), end: args[args.length - 1].getEnd(), text: '' });
|
|
126
|
+
todos.push('cb-toast no tiene key: clear() cierra todos los mensajes.');
|
|
127
|
+
}
|
|
128
|
+
else if (method === 'messageObserver' || method === 'clearObserver') {
|
|
129
|
+
todos.push(`CbToastService no expone ${method}; usa su señal toasts().`);
|
|
130
|
+
}
|
|
131
|
+
if (todos.length)
|
|
132
|
+
edits.push((0, service_calls_1.todoBefore)(sf, call ?? access, todos));
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* `<p-toast position="bottom-center" />` → `<cb-toast position="bottom-center" />`
|
|
137
|
+
* y `MessageService` (primeng/api) → `CbToastService`.
|
|
138
|
+
*/
|
|
139
|
+
exports.toast = {
|
|
140
|
+
name: 'toast',
|
|
141
|
+
entry: '@caribeng/ui/toast',
|
|
142
|
+
symbol: 'CbToast',
|
|
143
|
+
modules: {
|
|
144
|
+
'primeng/toast': { ToastModule: 'CbToast', Toast: 'CbToast' },
|
|
145
|
+
'primeng/api': { MessageService: 'CbToastService' },
|
|
146
|
+
},
|
|
147
|
+
rootServices: ['CbToastService'],
|
|
148
|
+
rewriteSource: rewriteMessageService,
|
|
149
|
+
elements: [
|
|
150
|
+
{
|
|
151
|
+
tag: 'p-toast',
|
|
152
|
+
to: 'cb-toast',
|
|
153
|
+
rules: {
|
|
154
|
+
position: (0, rules_1.values)('position', Object.fromEntries(POSITIONS.map((p) => [p, p]))),
|
|
155
|
+
key: (0, rules_1.unsupported)('cb-toast muestra todos los mensajes de CbToastService; si tenías varios p-toast con key, deja uno.'),
|
|
156
|
+
life: (0, rules_1.unsupported)('indica life en cada mensaje (CbToastService.add).'),
|
|
157
|
+
preventOpenDuplicates: (0, rules_1.unsupported)('cb-toast no filtra mensajes duplicados.'),
|
|
158
|
+
preventDuplicates: (0, rules_1.unsupported)('cb-toast no filtra mensajes duplicados.'),
|
|
159
|
+
styleClass: (0, rules_1.styleClass)(),
|
|
160
|
+
autoZIndex: (0, rules_1.drop)(),
|
|
161
|
+
baseZIndex: (0, rules_1.drop)(),
|
|
162
|
+
showTransformOptions: (0, rules_1.drop)(),
|
|
163
|
+
hideTransformOptions: (0, rules_1.drop)(),
|
|
164
|
+
showTransitionOptions: (0, rules_1.drop)(),
|
|
165
|
+
hideTransitionOptions: (0, rules_1.drop)(),
|
|
166
|
+
motionOptions: (0, rules_1.drop)(),
|
|
167
|
+
breakpoints: (0, rules_1.drop)(),
|
|
168
|
+
'(onClose)': (0, rules_1.unsupported)('cb-toast no emite el cierre de los mensajes.'),
|
|
169
|
+
},
|
|
170
|
+
child: (child) => (child.name === 'ng-template' ? { todo: 'cb-toast no admite plantillas de mensaje; el contenido no se mostrará.' } : null),
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toggleswitch = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
/**
|
|
6
|
+
* `<p-toggleswitch [(ngModel)]="activo" inputId="activo" (onChange)="guardar($event.checked)" />`
|
|
7
|
+
* → `<cb-toggle [(ngModel)]="activo" inputId="activo" (changed)="guardar($event)" />`
|
|
8
|
+
*/
|
|
9
|
+
const rules = {
|
|
10
|
+
size: (0, rules_1.values)('size', rules_1.SIZE_VALUES),
|
|
11
|
+
styleClass: (0, rules_1.styleClass)(),
|
|
12
|
+
readonly: (0, rules_1.unsupported)('usa disabled o deshabilita el control de formulario.'),
|
|
13
|
+
trueValue: (0, rules_1.unsupported)('cb-toggle usa true/false; convierte el valor en el modelo.'),
|
|
14
|
+
falseValue: (0, rules_1.unsupported)('cb-toggle usa true/false; convierte el valor en el modelo.'),
|
|
15
|
+
tabindex: (0, rules_1.unsupported)('el tabindex no se reenvía al control interno.'),
|
|
16
|
+
autofocus: (0, rules_1.unsupported)('usa la directiva cbAutoFocus de @caribeng/ui/autofocus.'),
|
|
17
|
+
ariaLabelledBy: (0, rules_1.unsupported)('usa ariaLabel o el input label de cb-toggle.'),
|
|
18
|
+
'(onChange)': (0, rules_1.event)('changed', (0, rules_1.adaptEvent)('checked')),
|
|
19
|
+
...rules_1.FOCUS_EVENTS,
|
|
20
|
+
};
|
|
21
|
+
exports.toggleswitch = {
|
|
22
|
+
name: 'toggleswitch',
|
|
23
|
+
entry: '@caribeng/ui/toggle',
|
|
24
|
+
symbol: 'CbToggle',
|
|
25
|
+
modules: {
|
|
26
|
+
'primeng/toggleswitch': { ToggleSwitchModule: 'CbToggle', ToggleSwitch: 'CbToggle' },
|
|
27
|
+
// Nombre anterior a PrimeNG 18.
|
|
28
|
+
'primeng/inputswitch': { InputSwitchModule: 'CbToggle', InputSwitch: 'CbToggle' },
|
|
29
|
+
},
|
|
30
|
+
elements: ['p-toggleswitch', 'p-toggleSwitch', 'p-toggle-switch', 'p-inputSwitch', 'p-inputswitch'].map((tag) => ({
|
|
31
|
+
tag,
|
|
32
|
+
to: 'cb-toggle',
|
|
33
|
+
rules,
|
|
34
|
+
child: (child) => (child.name === 'ng-template' ? { todo: 'cb-toggle no admite plantilla para el tirador.' } : null),
|
|
35
|
+
same: ['inputId', 'ariaLabel', 'disabled', 'invalid', 'label'],
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tooltip = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
const NO_TIMING = 'cbTooltip usa sus propios tiempos de aparición.';
|
|
6
|
+
/**
|
|
7
|
+
* `<span pTooltip="Ayuda" tooltipPosition="bottom">` → `<span cbTooltip="Ayuda" cbTooltipPosition="bottom">`.
|
|
8
|
+
* Funciona en cualquier elemento, también sobre componentes que se migran a la vez (`<p-button pTooltip>`).
|
|
9
|
+
*/
|
|
10
|
+
exports.tooltip = {
|
|
11
|
+
name: 'tooltip',
|
|
12
|
+
entry: '@caribeng/ui/tooltip',
|
|
13
|
+
symbol: 'CbTooltipDirective',
|
|
14
|
+
modules: {
|
|
15
|
+
'primeng/tooltip': { TooltipModule: 'CbTooltipDirective', Tooltip: 'CbTooltipDirective' },
|
|
16
|
+
},
|
|
17
|
+
elements: [],
|
|
18
|
+
directives: [
|
|
19
|
+
{
|
|
20
|
+
attr: 'pTooltip',
|
|
21
|
+
to: 'cbTooltip',
|
|
22
|
+
rules: {
|
|
23
|
+
tooltipPosition: (0, rules_1.values)('cbTooltipPosition', { top: 'top', bottom: 'bottom', left: 'left', right: 'right' }),
|
|
24
|
+
tooltipDisabled: (0, rules_1.rename)('cbTooltipDisabled'),
|
|
25
|
+
appendTo: (0, rules_1.drop)(),
|
|
26
|
+
tooltipZIndex: (0, rules_1.drop)(),
|
|
27
|
+
tooltipEvent: (0, rules_1.unsupported)('cbTooltip se muestra con hover y con foco.'),
|
|
28
|
+
positionStyle: (0, rules_1.unsupported)('cbTooltip se posiciona con el overlay del CDK.'),
|
|
29
|
+
positionTop: (0, rules_1.unsupported)('cbTooltip se posiciona con el overlay del CDK.'),
|
|
30
|
+
positionLeft: (0, rules_1.unsupported)('cbTooltip se posiciona con el overlay del CDK.'),
|
|
31
|
+
tooltipStyleClass: (0, rules_1.unsupported)('personaliza el tooltip con los tokens CSS de CaribeNG.'),
|
|
32
|
+
escape: (0, rules_1.unsupported)('cbTooltip muestra solo texto (siempre escapado).'),
|
|
33
|
+
showDelay: (0, rules_1.unsupported)(NO_TIMING),
|
|
34
|
+
hideDelay: (0, rules_1.unsupported)(NO_TIMING),
|
|
35
|
+
life: (0, rules_1.unsupported)(NO_TIMING),
|
|
36
|
+
autoHide: (0, rules_1.unsupported)(NO_TIMING),
|
|
37
|
+
fitContent: (0, rules_1.unsupported)('cbTooltip ajusta su ancho al texto.'),
|
|
38
|
+
hideOnEscape: (0, rules_1.drop)(),
|
|
39
|
+
showOnEllipsis: (0, rules_1.unsupported)('cbTooltip se muestra siempre que tenga texto.'),
|
|
40
|
+
tooltipOptions: (0, rules_1.unsupported)('pasa cada opción como input de cbTooltip.'),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tipos de los mapeos PrimeNG → CaribeNG.
|
|
4
|
+
*
|
|
5
|
+
* Cada componente se describe con datos (qué módulos/símbolos importa PrimeNG,
|
|
6
|
+
* qué selector usa y cómo se traduce cada input/output). El motor de
|
|
7
|
+
* plantillas (`../template.ts`) y el de TypeScript (`../typescript.ts`) solo
|
|
8
|
+
* aplican estos datos: añadir un componente no exige tocar los motores.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REPORT_PATH = void 0;
|
|
4
|
+
exports.scanWorkspace = scanWorkspace;
|
|
5
|
+
exports.renderReport = renderReport;
|
|
6
|
+
const template_1 = require("./template");
|
|
7
|
+
const workspace_1 = require("./workspace");
|
|
8
|
+
/** Archivo del informe en la raíz del workspace. */
|
|
9
|
+
exports.REPORT_PATH = '/caribeng-migration-report.md';
|
|
10
|
+
const SCANNED = /\.(ts|mts|js|mjs|html|css|scss|sass|less|json)$/;
|
|
11
|
+
const SKIPPED = new Set(['package.json', 'package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lock']);
|
|
12
|
+
/** Referencias a paquetes del ecosistema PrimeNG. */
|
|
13
|
+
const PRIME_PACKAGE = /primeng|primeicons|@primeuix|tailwindcss-primeui|primelocale/;
|
|
14
|
+
/** Selectores PrimeNG en plantillas: `<p-table`, `pTooltip`, `pi pi-…`. */
|
|
15
|
+
const PRIME_TEMPLATE = /<p-[a-z]|\sp[A-Z][A-Za-z]+(?=[\s=>/])|\bpi pi-/;
|
|
16
|
+
/** Busca avisos y restos de PrimeNG en todo el workspace. */
|
|
17
|
+
function scanWorkspace(tree) {
|
|
18
|
+
const todos = [];
|
|
19
|
+
const leftovers = [];
|
|
20
|
+
for (const path of (0, workspace_1.workspaceFiles)(tree)) {
|
|
21
|
+
const name = path.slice(path.lastIndexOf('/') + 1);
|
|
22
|
+
if (!SCANNED.test(path) || SKIPPED.has(name) || path === exports.REPORT_PATH)
|
|
23
|
+
continue;
|
|
24
|
+
const template = /\.(html|ts)$/.test(path);
|
|
25
|
+
tree
|
|
26
|
+
.readText(path)
|
|
27
|
+
.split(/\r?\n/)
|
|
28
|
+
.forEach((line, i) => {
|
|
29
|
+
const at = line.indexOf(template_1.TODO_MARK);
|
|
30
|
+
if (at >= 0) {
|
|
31
|
+
// Hasta el cierre del comentario: en TypeScript puede seguir código en la misma línea.
|
|
32
|
+
const message = line.slice(at + template_1.TODO_MARK.length + 1).replace(/\s*(-->|\*\/)[\s\S]*$/, '').trim();
|
|
33
|
+
todos.push({ path, line: i + 1, text: message });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (PRIME_PACKAGE.test(line) || (template && PRIME_TEMPLATE.test(line)))
|
|
37
|
+
leftovers.push({ path, line: i + 1, text: line.trim() });
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return { todos, leftovers };
|
|
41
|
+
}
|
|
42
|
+
/** Informe en Markdown con lo migrado y lo que queda por revisar. */
|
|
43
|
+
function renderReport({ scan, changedFiles, manual, removedPackages }) {
|
|
44
|
+
const lines = ['# Migración de PrimeNG a CaribeNG', ''];
|
|
45
|
+
lines.push(`- Archivos modificados: **${changedFiles.length}**`);
|
|
46
|
+
lines.push(`- Avisos para revisar (\`${template_1.TODO_MARK}\`): **${scan.todos.length}**`);
|
|
47
|
+
lines.push(`- Referencias a PrimeNG sin migrar: **${scan.leftovers.length}**`);
|
|
48
|
+
lines.push(removedPackages.length
|
|
49
|
+
? `- Paquetes eliminados de package.json: ${removedPackages.map((p) => `\`${p}\``).join(', ')}`
|
|
50
|
+
: '- PrimeNG sigue en package.json mientras queden referencias (las dos librerías pueden convivir).');
|
|
51
|
+
lines.push('');
|
|
52
|
+
const section = (title, intro, findings) => {
|
|
53
|
+
if (!findings.length)
|
|
54
|
+
return;
|
|
55
|
+
lines.push(`## ${title}`, '', intro);
|
|
56
|
+
let current = '';
|
|
57
|
+
for (const finding of findings) {
|
|
58
|
+
if (finding.path !== current) {
|
|
59
|
+
current = finding.path;
|
|
60
|
+
lines.push('', `### \`${finding.path.slice(1)}\``, '');
|
|
61
|
+
}
|
|
62
|
+
lines.push(`- Línea ${finding.line}: ${finding.text.replace(/\|/g, '\\|')}`);
|
|
63
|
+
}
|
|
64
|
+
lines.push('');
|
|
65
|
+
};
|
|
66
|
+
section('Avisos', `El migrador dejó un comentario \`${template_1.TODO_MARK}\` en cada punto que necesita una decisión. Bórralo cuando lo resuelvas.`, scan.todos);
|
|
67
|
+
section('Referencias a PrimeNG pendientes', 'Componentes, directivas o imports que esta versión del migrador aún no traduce. Migra estos usos a mano (consulta el catálogo de CaribeNG).', scan.leftovers);
|
|
68
|
+
if (manual.length) {
|
|
69
|
+
lines.push('## Imports que añadir a mano', '', ...manual.map((item) => `- ${item}`), '');
|
|
70
|
+
}
|
|
71
|
+
lines.push('## Siguientes pasos', '');
|
|
72
|
+
lines.push('1. Revisa los cambios con `git diff`.');
|
|
73
|
+
lines.push('2. Resuelve los avisos y las referencias pendientes de este informe.');
|
|
74
|
+
lines.push('3. Compila (`ng build`) y ejecuta los tests.');
|
|
75
|
+
if (!removedPackages.length)
|
|
76
|
+
lines.push('4. Cuando no queden referencias, vuelve a ejecutar el migrador o quita `primeng` y `primeicons` de package.json.');
|
|
77
|
+
lines.push('');
|
|
78
|
+
return lines.join('\n');
|
|
79
|
+
}
|