@caribeng/ui 22.2.0 → 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 +93 -11
- package/fesm2022/caribeng-ui-accordion.mjs +2 -2
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-breadcrumb.mjs +13 -6
- package/fesm2022/caribeng-ui-chart.mjs +8 -5
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/caribeng-ui-code-block.mjs +332 -0
- package/fesm2022/caribeng-ui-colorpicker.mjs +99 -5
- package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
- package/fesm2022/caribeng-ui-confirmdialog.mjs +78 -13
- package/fesm2022/caribeng-ui-confirmpopup.mjs +91 -16
- package/fesm2022/caribeng-ui-contextmenu.mjs +8 -4
- package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
- package/fesm2022/caribeng-ui-dataview.mjs +4 -1
- package/fesm2022/caribeng-ui-dock.mjs +52 -12
- package/fesm2022/caribeng-ui-drawer.mjs +9 -4
- package/fesm2022/caribeng-ui-editor.mjs +21 -0
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +134 -17
- package/fesm2022/caribeng-ui-folder-card.mjs +122 -12
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-inputmask.mjs +8 -2
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-megamenu.mjs +13 -9
- package/fesm2022/caribeng-ui-mentions.mjs +495 -0
- package/fesm2022/caribeng-ui-menu.mjs +8 -4
- package/fesm2022/caribeng-ui-menubar.mjs +9 -5
- package/fesm2022/caribeng-ui-message.mjs +6 -3
- package/fesm2022/caribeng-ui-organizationchart.mjs +6 -10
- package/fesm2022/caribeng-ui-panel.mjs +6 -6
- package/fesm2022/caribeng-ui-panelmenu.mjs +9 -6
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-pricing.mjs +263 -69
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scrolltop.mjs +3 -1
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-stepper.mjs +10 -3
- package/fesm2022/caribeng-ui-table.mjs +10 -4
- package/fesm2022/caribeng-ui-tabmenu.mjs +8 -4
- package/fesm2022/caribeng-ui-tieredmenu.mjs +109 -19
- package/fesm2022/caribeng-ui.mjs +388 -1
- package/package.json +42 -2
- package/schematics/collection.json +5 -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 +16 -1
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-breadcrumb.d.ts +8 -0
- package/types/caribeng-ui-chart.d.ts +3 -1
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/caribeng-ui-code-block.d.ts +65 -0
- package/types/caribeng-ui-colorpicker.d.ts +5 -1
- package/types/caribeng-ui-command-palette.d.ts +133 -0
- package/types/caribeng-ui-confirmdialog.d.ts +34 -2
- package/types/caribeng-ui-confirmpopup.d.ts +39 -2
- package/types/caribeng-ui-contextmenu.d.ts +7 -0
- package/types/caribeng-ui-copy-button.d.ts +90 -0
- package/types/caribeng-ui-dataview.d.ts +2 -0
- package/types/caribeng-ui-dock.d.ts +13 -1
- package/types/caribeng-ui-drawer.d.ts +3 -1
- package/types/caribeng-ui-file-card.d.ts +27 -2
- package/types/caribeng-ui-folder-card.d.ts +27 -5
- package/types/caribeng-ui-inputmask.d.ts +3 -1
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-megamenu.d.ts +11 -0
- package/types/caribeng-ui-mentions.d.ts +127 -0
- package/types/caribeng-ui-menu.d.ts +7 -0
- package/types/caribeng-ui-menubar.d.ts +7 -0
- package/types/caribeng-ui-message.d.ts +2 -0
- package/types/caribeng-ui-panelmenu.d.ts +7 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-pricing.d.ts +41 -4
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-stepper.d.ts +2 -0
- package/types/caribeng-ui-table.d.ts +1 -1
- package/types/caribeng-ui-tabmenu.d.ts +7 -0
- package/types/caribeng-ui-tieredmenu.d.ts +17 -1
- package/types/caribeng-ui.d.ts +276 -2
- package/styles/caribeng.css +0 -380
- package/styles/scss/_mixins.scss +0 -46
- package/styles/scss/_overlay.scss +0 -15
- package/styles/scss/_tokens.scss +0 -267
- package/styles/scss/_utilities.scss +0 -73
- package/styles/scss/_variables.scss +0 -33
- package/styles/scss/index.scss +0 -16
|
@@ -38,6 +38,9 @@ class CbDrawer {
|
|
|
38
38
|
this.closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: toBoolean });
|
|
39
39
|
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
40
40
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Ancho (izquierda/derecha) o alto (arriba/abajo) del panel, p. ej. `'32rem'`. */
|
|
42
|
+
this.size = input('', /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
41
44
|
this.onShow = output();
|
|
42
45
|
this.onHide = output();
|
|
43
46
|
this.titleId = `cb-drawer-${nextUid()}-title`;
|
|
@@ -99,11 +102,12 @@ class CbDrawer {
|
|
|
99
102
|
this.onHide.emit();
|
|
100
103
|
}
|
|
101
104
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
102
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDrawer, isStandalone: true, selector: "cb-drawer", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", onShow: "onShow", onHide: "onHide" }, viewQueries: [{ propertyName: "tpl", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDrawer, isStandalone: true, selector: "cb-drawer", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissableMask: { classPropertyName: "dismissableMask", publicName: "dismissableMask", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", onShow: "onShow", onHide: "onHide" }, viewQueries: [{ propertyName: "tpl", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
103
106
|
<ng-template #tpl>
|
|
104
107
|
<div
|
|
105
108
|
class="cb-drawer"
|
|
106
109
|
[class]="'cb-drawer--' + position()"
|
|
110
|
+
[style.--cb-drawer-size]="size() || null"
|
|
107
111
|
role="dialog"
|
|
108
112
|
aria-modal="true"
|
|
109
113
|
[attr.aria-labelledby]="header() ? titleId : null"
|
|
@@ -127,7 +131,7 @@ class CbDrawer {
|
|
|
127
131
|
<footer class="cb-drawer__footer"><ng-content select="[cb-drawer-footer]" /></footer>
|
|
128
132
|
</div>
|
|
129
133
|
</ng-template>
|
|
130
|
-
`, isInline: true, styles: [".cb-drawer{display:flex;flex-direction:column;box-sizing:border-box;background-color:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);box-shadow:var(--cb-shadow-lg);overflow:hidden}.cb-drawer--left,.cb-drawer--right{width:min(22rem,100vw);height:100vh}.cb-drawer--top,.cb-drawer--bottom{width:100vw;height:min(18rem,100vh)}.cb-drawer--right{animation:cb-drawer-right var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--left{animation:cb-drawer-left var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--top{animation:cb-drawer-top var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--bottom{animation:cb-drawer-bottom var(--cb-duration-normal, .22s) var(--cb-ease, ease)}@keyframes cb-drawer-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes cb-drawer-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes cb-drawer-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cb-drawer-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.cb-drawer{animation:none!important}}.cb-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5);border-bottom:1px solid var(--cb-color-border)}.cb-drawer__title{margin:0;font-size:var(--cb-text-lg);font-weight:var(--cb-font-weight-semibold)}.cb-drawer__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;border:none;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-drawer__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-drawer__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-drawer__body{flex:1 1 auto;padding:var(--cb-space-5);overflow-y:auto}.cb-drawer__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5)}.cb-drawer__footer:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
134
|
+
`, isInline: true, styles: [".cb-drawer{display:flex;flex-direction:column;box-sizing:border-box;background-color:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);box-shadow:var(--cb-shadow-lg);overflow:hidden}.cb-drawer--left,.cb-drawer--right{width:min(var(--cb-drawer-size, 22rem),100vw);height:100vh}.cb-drawer--top,.cb-drawer--bottom{width:100vw;height:min(var(--cb-drawer-size, 18rem),100vh)}.cb-drawer--right{animation:cb-drawer-right var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--left{animation:cb-drawer-left var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--top{animation:cb-drawer-top var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--bottom{animation:cb-drawer-bottom var(--cb-duration-normal, .22s) var(--cb-ease, ease)}@keyframes cb-drawer-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes cb-drawer-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes cb-drawer-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cb-drawer-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.cb-drawer{animation:none!important}}.cb-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5);border-bottom:1px solid var(--cb-color-border)}.cb-drawer__title{margin:0;font-size:var(--cb-text-lg);font-weight:var(--cb-font-weight-semibold)}.cb-drawer__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;border:none;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-drawer__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-drawer__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-drawer__body{flex:1 1 auto;padding:var(--cb-space-5);overflow-y:auto}.cb-drawer__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5)}.cb-drawer__footer:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
131
135
|
}
|
|
132
136
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDrawer, decorators: [{
|
|
133
137
|
type: Component,
|
|
@@ -136,6 +140,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
136
140
|
<div
|
|
137
141
|
class="cb-drawer"
|
|
138
142
|
[class]="'cb-drawer--' + position()"
|
|
143
|
+
[style.--cb-drawer-size]="size() || null"
|
|
139
144
|
role="dialog"
|
|
140
145
|
aria-modal="true"
|
|
141
146
|
[attr.aria-labelledby]="header() ? titleId : null"
|
|
@@ -159,8 +164,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
159
164
|
<footer class="cb-drawer__footer"><ng-content select="[cb-drawer-footer]" /></footer>
|
|
160
165
|
</div>
|
|
161
166
|
</ng-template>
|
|
162
|
-
`, styles: [".cb-drawer{display:flex;flex-direction:column;box-sizing:border-box;background-color:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);box-shadow:var(--cb-shadow-lg);overflow:hidden}.cb-drawer--left,.cb-drawer--right{width:min(22rem,100vw);height:100vh}.cb-drawer--top,.cb-drawer--bottom{width:100vw;height:min(18rem,100vh)}.cb-drawer--right{animation:cb-drawer-right var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--left{animation:cb-drawer-left var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--top{animation:cb-drawer-top var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--bottom{animation:cb-drawer-bottom var(--cb-duration-normal, .22s) var(--cb-ease, ease)}@keyframes cb-drawer-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes cb-drawer-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes cb-drawer-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cb-drawer-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.cb-drawer{animation:none!important}}.cb-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5);border-bottom:1px solid var(--cb-color-border)}.cb-drawer__title{margin:0;font-size:var(--cb-text-lg);font-weight:var(--cb-font-weight-semibold)}.cb-drawer__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;border:none;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-drawer__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-drawer__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-drawer__body{flex:1 1 auto;padding:var(--cb-space-5);overflow-y:auto}.cb-drawer__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5)}.cb-drawer__footer:empty{display:none}\n"] }]
|
|
163
|
-
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissableMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissableMask", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], onShow: [{ type: i0.Output, args: ["onShow"] }], onHide: [{ type: i0.Output, args: ["onHide"] }], tpl: [{ type: i0.ViewChild, args: ['tpl', { isSignal: true }] }] } });
|
|
167
|
+
`, styles: [".cb-drawer{display:flex;flex-direction:column;box-sizing:border-box;background-color:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);box-shadow:var(--cb-shadow-lg);overflow:hidden}.cb-drawer--left,.cb-drawer--right{width:min(var(--cb-drawer-size, 22rem),100vw);height:100vh}.cb-drawer--top,.cb-drawer--bottom{width:100vw;height:min(var(--cb-drawer-size, 18rem),100vh)}.cb-drawer--right{animation:cb-drawer-right var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--left{animation:cb-drawer-left var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--top{animation:cb-drawer-top var(--cb-duration-normal, .22s) var(--cb-ease, ease)}.cb-drawer--bottom{animation:cb-drawer-bottom var(--cb-duration-normal, .22s) var(--cb-ease, ease)}@keyframes cb-drawer-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes cb-drawer-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes cb-drawer-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes cb-drawer-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.cb-drawer{animation:none!important}}.cb-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5);border-bottom:1px solid var(--cb-color-border)}.cb-drawer__title{margin:0;font-size:var(--cb-text-lg);font-weight:var(--cb-font-weight-semibold)}.cb-drawer__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;border:none;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;transition:background var(--cb-duration-fast) var(--cb-ease)}.cb-drawer__close:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-drawer__close:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-drawer__body{flex:1 1 auto;padding:var(--cb-space-5);overflow-y:auto}.cb-drawer__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--cb-space-3);padding:var(--cb-space-4) var(--cb-space-5)}.cb-drawer__footer:empty{display:none}\n"] }]
|
|
168
|
+
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissableMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissableMask", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onShow: [{ type: i0.Output, args: ["onShow"] }], onHide: [{ type: i0.Output, args: ["onHide"] }], tpl: [{ type: i0.ViewChild, args: ['tpl', { isSignal: true }] }] } });
|
|
164
169
|
let uid = 0;
|
|
165
170
|
function nextUid() {
|
|
166
171
|
return ++uid;
|
|
@@ -2025,6 +2025,11 @@ class CbEditor {
|
|
|
2025
2025
|
this.exec('insertHTML', `<a href="${escapeAttr(url)}"${target}>${escapeHtml(url)}</a>`);
|
|
2026
2026
|
}
|
|
2027
2027
|
else {
|
|
2028
|
+
// El doble clic en Windows selecciona también el espacio siguiente: se deja fuera del enlace
|
|
2029
|
+
// (insertHTML lo descartaría y las palabras quedarían pegadas).
|
|
2030
|
+
trimRangeWhitespace(range);
|
|
2031
|
+
sel.removeAllRanges();
|
|
2032
|
+
sel.addRange(range);
|
|
2028
2033
|
this.exec('insertHTML', `<a href="${escapeAttr(url)}"${target}>${escapeHtml(range.toString())}</a>`);
|
|
2029
2034
|
}
|
|
2030
2035
|
}
|
|
@@ -4469,6 +4474,22 @@ function setLinkAttrs(anchor, url, newTab) {
|
|
|
4469
4474
|
anchor.removeAttribute('rel');
|
|
4470
4475
|
}
|
|
4471
4476
|
}
|
|
4477
|
+
/** Saca de la selección los espacios de los extremos (si caen en un nodo de texto). */
|
|
4478
|
+
function trimRangeWhitespace(range) {
|
|
4479
|
+
const { startContainer: start, endContainer: end } = range;
|
|
4480
|
+
if (end.nodeType === Node.TEXT_NODE) {
|
|
4481
|
+
const before = (end.textContent ?? '').slice(0, range.endOffset);
|
|
4482
|
+
const trailing = before.length - before.trimEnd().length;
|
|
4483
|
+
if (trailing && range.toString().trim())
|
|
4484
|
+
range.setEnd(end, range.endOffset - trailing);
|
|
4485
|
+
}
|
|
4486
|
+
if (start.nodeType === Node.TEXT_NODE) {
|
|
4487
|
+
const after = (start.textContent ?? '').slice(range.startOffset);
|
|
4488
|
+
const leading = after.length - after.trimStart().length;
|
|
4489
|
+
if (leading && range.toString().trim())
|
|
4490
|
+
range.setStart(start, range.startOffset + leading);
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4472
4493
|
function readAsDataUrl(file) {
|
|
4473
4494
|
return new Promise((resolve, reject) => {
|
|
4474
4495
|
const reader = new FileReader();
|
|
@@ -42,7 +42,7 @@ class CbFieldset {
|
|
|
42
42
|
type="button"
|
|
43
43
|
class="cb-fieldset__toggler"
|
|
44
44
|
[attr.aria-expanded]="!collapsed()"
|
|
45
|
-
[attr.aria-controls]="contentId"
|
|
45
|
+
[attr.aria-controls]="collapsed() ? null : contentId"
|
|
46
46
|
(click)="toggle()"
|
|
47
47
|
>
|
|
48
48
|
<cb-icon
|
|
@@ -84,7 +84,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
84
84
|
type="button"
|
|
85
85
|
class="cb-fieldset__toggler"
|
|
86
86
|
[attr.aria-expanded]="!collapsed()"
|
|
87
|
-
[attr.aria-controls]="contentId"
|
|
87
|
+
[attr.aria-controls]="collapsed() ? null : contentId"
|
|
88
88
|
(click)="toggle()"
|
|
89
89
|
>
|
|
90
90
|
<cb-icon
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { viewChild, input, booleanAttribute, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { CbMenu } from '@caribeng/ui/menu';
|
|
5
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Tarjeta de categoría/almacenamiento de CaribeNG: icono con tinte, título y
|
|
7
9
|
* subtítulo a la izquierda; dos valores alineados a la derecha. Útil para
|
|
8
10
|
* resúmenes de media, almacenamiento o métricas de categoría.
|
|
9
11
|
*
|
|
12
|
+
* Como `cb-folder-card`: con `actions` muestra un botón ⋮ con un menú
|
|
13
|
+
* (`actionSelect`) y con `clickable` toda la tarjeta emite `open`.
|
|
14
|
+
*
|
|
10
15
|
* @example
|
|
11
16
|
* ```html
|
|
12
17
|
* <cb-file-card icon="image" color="#10b981" title="Imágenes"
|
|
13
|
-
* subtitle="17% usado" value="245 archivos" valueSub="26.4 GB"
|
|
18
|
+
* subtitle="17% usado" value="245 archivos" valueSub="26.4 GB"
|
|
19
|
+
* clickable (open)="verImagenes()" />
|
|
14
20
|
* ```
|
|
15
21
|
*/
|
|
16
22
|
class CbFileCard {
|
|
17
23
|
constructor() {
|
|
24
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
25
|
+
this.t = injectCbTranslation();
|
|
26
|
+
this.menu = viewChild('menu', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.trigger = viewChild('trigger', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
18
30
|
/** Nombre del icono (del set de CaribeNG). */
|
|
19
31
|
this.icon = input('file', /* @ts-ignore */
|
|
20
32
|
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
@@ -33,55 +45,160 @@ class CbFileCard {
|
|
|
33
45
|
/** Valor secundario a la derecha (p. ej. "26.4 GB"). */
|
|
34
46
|
this.valueSub = input('', /* @ts-ignore */
|
|
35
47
|
...(ngDevMode ? [{ debugName: "valueSub" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/** Acciones del menú ⋮. Sin acciones no se muestra el botón. */
|
|
49
|
+
this.actions = input([], /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
51
|
+
/** Nombre del botón ⋮ y del menú. Por defecto, "Más acciones: {título}" del idioma activo. */
|
|
52
|
+
this.actionsAriaLabel = input(undefined, /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "actionsAriaLabel" }] : /* istanbul ignore next */ []));
|
|
54
|
+
/** Toda la tarjeta es pulsable y emite `open` (clic, Enter o Espacio). */
|
|
55
|
+
this.clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
56
|
+
/** Acción elegida en el menú ⋮. */
|
|
57
|
+
this.actionSelect = output();
|
|
58
|
+
/** Se pulsó la tarjeta (solo con `clickable`). */
|
|
59
|
+
this.open = output();
|
|
60
|
+
this.menuOpen = signal(false, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
|
|
62
|
+
this.menuLabel = computed(() => {
|
|
63
|
+
const custom = this.actionsAriaLabel();
|
|
64
|
+
if (custom)
|
|
65
|
+
return custom;
|
|
66
|
+
const title = this.title();
|
|
67
|
+
return title ? `${this.t().moreActions}: ${title}` : this.t().moreActions;
|
|
68
|
+
}, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "menuLabel" }] : /* istanbul ignore next */ []));
|
|
36
70
|
}
|
|
37
71
|
/** Fondo tintado derivado del color (cualquier color CSS: hex, rgb(), var(--…)). */
|
|
38
72
|
tintBg() {
|
|
39
73
|
const c = this.color();
|
|
40
74
|
return c ? `color-mix(in srgb, ${c} 12%, transparent)` : null;
|
|
41
75
|
}
|
|
76
|
+
/** Abre o cierra el menú de acciones anclado al botón ⋮. */
|
|
77
|
+
toggleMenu() {
|
|
78
|
+
const menu = this.menu();
|
|
79
|
+
const trigger = this.trigger()?.nativeElement;
|
|
80
|
+
if (!menu || !trigger)
|
|
81
|
+
return;
|
|
82
|
+
if (menu.isOpen) {
|
|
83
|
+
menu.hide();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
menu.show(trigger);
|
|
87
|
+
this.menuOpen.set(true);
|
|
88
|
+
}
|
|
89
|
+
openFromKeyboard(event) {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
if (!this.menu()?.isOpen)
|
|
92
|
+
this.toggleMenu();
|
|
93
|
+
}
|
|
42
94
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileCard, isStandalone: true, selector: "cb-file-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueSub: { classPropertyName: "valueSub", publicName: "valueSub", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-file-card" }, ngImport: i0, template: `
|
|
95
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFileCard, isStandalone: true, selector: "cb-file-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueSub: { classPropertyName: "valueSub", publicName: "valueSub", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, actionsAriaLabel: { classPropertyName: "actionsAriaLabel", publicName: "actionsAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionSelect: "actionSelect", open: "open" }, host: { properties: { "class.cb-file-card--clickable": "clickable()" }, classAttribute: "cb-file-card" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
44
96
|
<div class="cb-file-card__left">
|
|
45
97
|
<span class="cb-file-card__icon" [style.background]="tintBg()" [style.color]="color() || null">
|
|
46
98
|
<cb-icon [name]="icon()" [size]="20" aria-hidden="true" />
|
|
47
99
|
</span>
|
|
48
100
|
<div class="cb-file-card__text">
|
|
49
|
-
|
|
101
|
+
@if (clickable()) {
|
|
102
|
+
<button type="button" class="cb-file-card__title cb-file-card__open" (click)="open.emit($event)">{{ title() }}</button>
|
|
103
|
+
} @else {
|
|
104
|
+
<span class="cb-file-card__title">{{ title() }}</span>
|
|
105
|
+
}
|
|
50
106
|
@if (subtitle()) {
|
|
51
107
|
<span class="cb-file-card__subtitle">{{ subtitle() }}</span>
|
|
52
108
|
}
|
|
53
109
|
</div>
|
|
54
110
|
</div>
|
|
55
|
-
<div class="cb-file-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
111
|
+
<div class="cb-file-card__end">
|
|
112
|
+
<div class="cb-file-card__values">
|
|
113
|
+
<span class="cb-file-card__value">{{ value() }}</span>
|
|
114
|
+
@if (valueSub()) {
|
|
115
|
+
<span class="cb-file-card__value-sub">{{ valueSub() }}</span>
|
|
116
|
+
}
|
|
117
|
+
</div>
|
|
118
|
+
@if (actions().length) {
|
|
119
|
+
<button
|
|
120
|
+
#trigger
|
|
121
|
+
type="button"
|
|
122
|
+
class="cb-file-card__menu-button"
|
|
123
|
+
[attr.aria-label]="menuLabel()"
|
|
124
|
+
aria-haspopup="menu"
|
|
125
|
+
[attr.aria-expanded]="menuOpen()"
|
|
126
|
+
(click)="toggleMenu()"
|
|
127
|
+
(keydown.arrowdown)="openFromKeyboard($event)"
|
|
128
|
+
>
|
|
129
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
|
|
130
|
+
<circle cx="12" cy="5" r="2" />
|
|
131
|
+
<circle cx="12" cy="12" r="2" />
|
|
132
|
+
<circle cx="12" cy="19" r="2" />
|
|
133
|
+
</svg>
|
|
134
|
+
</button>
|
|
135
|
+
<cb-menu
|
|
136
|
+
#menu
|
|
137
|
+
[items]="actions()"
|
|
138
|
+
[ariaLabel]="menuLabel()"
|
|
139
|
+
(itemSelect)="actionSelect.emit($event)"
|
|
140
|
+
(hidden)="menuOpen.set(false)"
|
|
141
|
+
/>
|
|
59
142
|
}
|
|
60
143
|
</div>
|
|
61
|
-
`, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
144
|
+
`, isInline: true, styles: [":host{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-file-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-file-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-file-card--clickable:has(.cb-file-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__open{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.9rem;text-align:start;cursor:pointer}.cb-file-card__open:focus-visible{outline:none}.cb-file-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__end{display:flex;align-items:center;gap:.25rem;flex:none}.cb-file-card__menu-button{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin-right:-.5rem;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-file-card__menu-button:hover,.cb-file-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-file-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }, { kind: "component", type: CbMenu, selector: "cb-menu", inputs: ["items", "ariaLabel"], outputs: ["itemSelect", "hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
62
145
|
}
|
|
63
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFileCard, decorators: [{
|
|
64
147
|
type: Component,
|
|
65
|
-
args: [{ selector: 'cb-file-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: {
|
|
148
|
+
args: [{ selector: 'cb-file-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon, CbMenu], host: {
|
|
149
|
+
class: 'cb-file-card',
|
|
150
|
+
'[class.cb-file-card--clickable]': 'clickable()',
|
|
151
|
+
}, template: `
|
|
66
152
|
<div class="cb-file-card__left">
|
|
67
153
|
<span class="cb-file-card__icon" [style.background]="tintBg()" [style.color]="color() || null">
|
|
68
154
|
<cb-icon [name]="icon()" [size]="20" aria-hidden="true" />
|
|
69
155
|
</span>
|
|
70
156
|
<div class="cb-file-card__text">
|
|
71
|
-
|
|
157
|
+
@if (clickable()) {
|
|
158
|
+
<button type="button" class="cb-file-card__title cb-file-card__open" (click)="open.emit($event)">{{ title() }}</button>
|
|
159
|
+
} @else {
|
|
160
|
+
<span class="cb-file-card__title">{{ title() }}</span>
|
|
161
|
+
}
|
|
72
162
|
@if (subtitle()) {
|
|
73
163
|
<span class="cb-file-card__subtitle">{{ subtitle() }}</span>
|
|
74
164
|
}
|
|
75
165
|
</div>
|
|
76
166
|
</div>
|
|
77
|
-
<div class="cb-file-
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
167
|
+
<div class="cb-file-card__end">
|
|
168
|
+
<div class="cb-file-card__values">
|
|
169
|
+
<span class="cb-file-card__value">{{ value() }}</span>
|
|
170
|
+
@if (valueSub()) {
|
|
171
|
+
<span class="cb-file-card__value-sub">{{ valueSub() }}</span>
|
|
172
|
+
}
|
|
173
|
+
</div>
|
|
174
|
+
@if (actions().length) {
|
|
175
|
+
<button
|
|
176
|
+
#trigger
|
|
177
|
+
type="button"
|
|
178
|
+
class="cb-file-card__menu-button"
|
|
179
|
+
[attr.aria-label]="menuLabel()"
|
|
180
|
+
aria-haspopup="menu"
|
|
181
|
+
[attr.aria-expanded]="menuOpen()"
|
|
182
|
+
(click)="toggleMenu()"
|
|
183
|
+
(keydown.arrowdown)="openFromKeyboard($event)"
|
|
184
|
+
>
|
|
185
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
|
|
186
|
+
<circle cx="12" cy="5" r="2" />
|
|
187
|
+
<circle cx="12" cy="12" r="2" />
|
|
188
|
+
<circle cx="12" cy="19" r="2" />
|
|
189
|
+
</svg>
|
|
190
|
+
</button>
|
|
191
|
+
<cb-menu
|
|
192
|
+
#menu
|
|
193
|
+
[items]="actions()"
|
|
194
|
+
[ariaLabel]="menuLabel()"
|
|
195
|
+
(itemSelect)="actionSelect.emit($event)"
|
|
196
|
+
(hidden)="menuOpen.set(false)"
|
|
197
|
+
/>
|
|
81
198
|
}
|
|
82
199
|
</div>
|
|
83
|
-
`, styles: [":host{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"] }]
|
|
84
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueSub: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSub", required: false }] }] } });
|
|
200
|
+
`, styles: [":host{position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);padding:.9rem 1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-file-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-file-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-file-card--clickable:has(.cb-file-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__left{display:flex;align-items:center;gap:.75rem;min-width:0}.cb-file-card__icon{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:var(--cb-radius-md, 10px);flex:none;color:var(--cb-color-primary-600, #059669)}.cb-file-card__text{display:flex;flex-direction:column;min-width:0}.cb-file-card__title{font-weight:600;font-size:.9rem}.cb-file-card__open{padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.9rem;text-align:start;cursor:pointer}.cb-file-card__open:focus-visible{outline:none}.cb-file-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-file-card__subtitle{font-size:.8rem;color:var(--cb-color-text-muted)}.cb-file-card__end{display:flex;align-items:center;gap:.25rem;flex:none}.cb-file-card__menu-button{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin-right:-.5rem;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-file-card__menu-button:hover,.cb-file-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-file-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-file-card__values{display:flex;flex-direction:column;align-items:flex-end;text-align:right;flex:none}.cb-file-card__value,.cb-file-card__value-sub{font-size:.85rem;color:var(--cb-color-text-muted)}\n"] }]
|
|
201
|
+
}], propDecorators: { menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueSub: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSub", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], actionsAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAriaLabel", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], actionSelect: [{ type: i0.Output, args: ["actionSelect"] }], open: [{ type: i0.Output, args: ["open"] }] } });
|
|
85
202
|
|
|
86
203
|
/*
|
|
87
204
|
* Public API Surface de @caribeng/ui/file-card
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { viewChild, input, booleanAttribute, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { CbIcon } from '@caribeng/ui/icon';
|
|
4
|
+
import { CbMenu } from '@caribeng/ui/menu';
|
|
4
5
|
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Tarjeta de carpeta de CaribeNG: icono de carpeta, nombre y una fila con
|
|
8
|
-
* número de archivos y tamaño.
|
|
9
|
+
* número de archivos y tamaño.
|
|
10
|
+
*
|
|
11
|
+
* Con `actions` muestra un botón ⋮ que abre un menú (`cb-menu`) con esas
|
|
12
|
+
* acciones y emite `actionSelect`. Con `clickable`, toda la tarjeta abre la
|
|
13
|
+
* carpeta (`open`) sin interferir con el botón del menú. Sigue aceptando un
|
|
14
|
+
* trigger propio proyectado por `[cb-folder-actions]`.
|
|
9
15
|
*
|
|
10
16
|
* @example
|
|
11
17
|
* ```html
|
|
12
|
-
* <cb-folder-card name="Imágenes" files="345" size="26.4 GB"
|
|
13
|
-
*
|
|
14
|
-
* </cb-folder-card>
|
|
18
|
+
* <cb-folder-card name="Imágenes" files="345" size="26.4 GB" clickable
|
|
19
|
+
* [actions]="acciones" (actionSelect)="onAccion($event)" (open)="abrir()" />
|
|
15
20
|
* ```
|
|
16
21
|
*/
|
|
17
22
|
class CbFolderCard {
|
|
18
23
|
constructor() {
|
|
19
24
|
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
20
25
|
this.t = injectCbTranslation();
|
|
26
|
+
this.menu = viewChild('menu', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.trigger = viewChild('trigger', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
|
|
21
30
|
/** Nombre de la carpeta. */
|
|
22
31
|
this.name = input('', /* @ts-ignore */
|
|
23
32
|
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
@@ -33,16 +42,85 @@ class CbFolderCard {
|
|
|
33
42
|
/** Color del icono de carpeta. */
|
|
34
43
|
this.color = input('#f5b301', /* @ts-ignore */
|
|
35
44
|
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Acciones del menú ⋮ (abrir, renombrar, eliminar…). Sin acciones no se muestra el botón. */
|
|
46
|
+
this.actions = input([], /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/** Nombre del botón ⋮ y del menú. Por defecto, "Más acciones: {nombre}" del idioma activo. */
|
|
49
|
+
this.actionsAriaLabel = input(undefined, /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "actionsAriaLabel" }] : /* istanbul ignore next */ []));
|
|
51
|
+
/** Toda la tarjeta es pulsable y emite `open` (clic, Enter o Espacio). */
|
|
52
|
+
this.clickable = input(false, { ...(ngDevMode ? { debugName: "clickable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
53
|
+
/** Acción elegida en el menú ⋮. */
|
|
54
|
+
this.actionSelect = output();
|
|
55
|
+
/** Se pidió abrir la carpeta (solo con `clickable`). */
|
|
56
|
+
this.open = output();
|
|
57
|
+
this.menuOpen = signal(false, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "menuOpen" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.menuLabel = computed(() => {
|
|
60
|
+
const custom = this.actionsAriaLabel();
|
|
61
|
+
if (custom)
|
|
62
|
+
return custom;
|
|
63
|
+
const name = this.name();
|
|
64
|
+
return name ? `${this.t().moreActions}: ${name}` : this.t().moreActions;
|
|
65
|
+
}, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "menuLabel" }] : /* istanbul ignore next */ []));
|
|
67
|
+
}
|
|
68
|
+
/** Abre o cierra el menú de acciones anclado al botón ⋮. */
|
|
69
|
+
toggleMenu() {
|
|
70
|
+
const menu = this.menu();
|
|
71
|
+
const trigger = this.trigger()?.nativeElement;
|
|
72
|
+
if (!menu || !trigger)
|
|
73
|
+
return;
|
|
74
|
+
if (menu.isOpen) {
|
|
75
|
+
menu.hide();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
menu.show(trigger);
|
|
79
|
+
this.menuOpen.set(true);
|
|
80
|
+
}
|
|
81
|
+
openFromKeyboard(event) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
if (!this.menu()?.isOpen)
|
|
84
|
+
this.toggleMenu();
|
|
36
85
|
}
|
|
37
86
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFolderCard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
38
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFolderCard, isStandalone: true, selector: "cb-folder-card", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, filesLabel: { classPropertyName: "filesLabel", publicName: "filesLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-folder-card" }, ngImport: i0, template: `
|
|
87
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbFolderCard, isStandalone: true, selector: "cb-folder-card", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, filesLabel: { classPropertyName: "filesLabel", publicName: "filesLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, actionsAriaLabel: { classPropertyName: "actionsAriaLabel", publicName: "actionsAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionSelect: "actionSelect", open: "open" }, host: { properties: { "class.cb-folder-card--clickable": "clickable()" }, classAttribute: "cb-folder-card" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
39
88
|
<div class="cb-folder-card__top">
|
|
40
89
|
<cb-icon name="folder" [size]="30" class="cb-folder-card__icon" [style.color]="color() || null" aria-hidden="true" />
|
|
41
90
|
<span class="cb-folder-card__actions">
|
|
42
91
|
<ng-content select="[cb-folder-actions]" />
|
|
92
|
+
@if (actions().length) {
|
|
93
|
+
<button
|
|
94
|
+
#trigger
|
|
95
|
+
type="button"
|
|
96
|
+
class="cb-folder-card__menu-button"
|
|
97
|
+
[attr.aria-label]="menuLabel()"
|
|
98
|
+
aria-haspopup="menu"
|
|
99
|
+
[attr.aria-expanded]="menuOpen()"
|
|
100
|
+
(click)="toggleMenu()"
|
|
101
|
+
(keydown.arrowdown)="openFromKeyboard($event)"
|
|
102
|
+
>
|
|
103
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
|
|
104
|
+
<circle cx="12" cy="5" r="2" />
|
|
105
|
+
<circle cx="12" cy="12" r="2" />
|
|
106
|
+
<circle cx="12" cy="19" r="2" />
|
|
107
|
+
</svg>
|
|
108
|
+
</button>
|
|
109
|
+
<cb-menu
|
|
110
|
+
#menu
|
|
111
|
+
[items]="actions()"
|
|
112
|
+
[ariaLabel]="menuLabel()"
|
|
113
|
+
(itemSelect)="actionSelect.emit($event)"
|
|
114
|
+
(hidden)="menuOpen.set(false)"
|
|
115
|
+
/>
|
|
116
|
+
}
|
|
43
117
|
</span>
|
|
44
118
|
</div>
|
|
45
|
-
|
|
119
|
+
@if (clickable()) {
|
|
120
|
+
<button type="button" class="cb-folder-card__name cb-folder-card__open" (click)="open.emit($event)">{{ name() }}</button>
|
|
121
|
+
} @else {
|
|
122
|
+
<div class="cb-folder-card__name">{{ name() }}</div>
|
|
123
|
+
}
|
|
46
124
|
<div class="cb-folder-card__meta">
|
|
47
125
|
@if (files() !== '') {
|
|
48
126
|
<span>{{ files() }} {{ (filesLabel() ?? t().files) }}</span>
|
|
@@ -51,18 +129,50 @@ class CbFolderCard {
|
|
|
51
129
|
<span>{{ size() }}</span>
|
|
52
130
|
}
|
|
53
131
|
</div>
|
|
54
|
-
`, isInline: true, styles: [":host{display:block;padding:1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__name{margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
132
|
+
`, isInline: true, styles: [":host{position:relative;display:block;padding:1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-folder-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-folder-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-folder-card--clickable:has(.cb-folder-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{position:relative;z-index:1;display:inline-flex;align-items:center;gap:.25rem;color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__menu-button{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:-.375rem -.5rem 0 0;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:inherit;cursor:pointer}.cb-folder-card__menu-button:hover,.cb-folder-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-folder-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__name{display:block;margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__open{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.95rem;text-align:start;cursor:pointer}.cb-folder-card__open:focus-visible{outline:none}.cb-folder-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }, { kind: "component", type: CbMenu, selector: "cb-menu", inputs: ["items", "ariaLabel"], outputs: ["itemSelect", "hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
133
|
}
|
|
56
134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbFolderCard, decorators: [{
|
|
57
135
|
type: Component,
|
|
58
|
-
args: [{ selector: 'cb-folder-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: {
|
|
136
|
+
args: [{ selector: 'cb-folder-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon, CbMenu], host: {
|
|
137
|
+
class: 'cb-folder-card',
|
|
138
|
+
'[class.cb-folder-card--clickable]': 'clickable()',
|
|
139
|
+
}, template: `
|
|
59
140
|
<div class="cb-folder-card__top">
|
|
60
141
|
<cb-icon name="folder" [size]="30" class="cb-folder-card__icon" [style.color]="color() || null" aria-hidden="true" />
|
|
61
142
|
<span class="cb-folder-card__actions">
|
|
62
143
|
<ng-content select="[cb-folder-actions]" />
|
|
144
|
+
@if (actions().length) {
|
|
145
|
+
<button
|
|
146
|
+
#trigger
|
|
147
|
+
type="button"
|
|
148
|
+
class="cb-folder-card__menu-button"
|
|
149
|
+
[attr.aria-label]="menuLabel()"
|
|
150
|
+
aria-haspopup="menu"
|
|
151
|
+
[attr.aria-expanded]="menuOpen()"
|
|
152
|
+
(click)="toggleMenu()"
|
|
153
|
+
(keydown.arrowdown)="openFromKeyboard($event)"
|
|
154
|
+
>
|
|
155
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true">
|
|
156
|
+
<circle cx="12" cy="5" r="2" />
|
|
157
|
+
<circle cx="12" cy="12" r="2" />
|
|
158
|
+
<circle cx="12" cy="19" r="2" />
|
|
159
|
+
</svg>
|
|
160
|
+
</button>
|
|
161
|
+
<cb-menu
|
|
162
|
+
#menu
|
|
163
|
+
[items]="actions()"
|
|
164
|
+
[ariaLabel]="menuLabel()"
|
|
165
|
+
(itemSelect)="actionSelect.emit($event)"
|
|
166
|
+
(hidden)="menuOpen.set(false)"
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
63
169
|
</span>
|
|
64
170
|
</div>
|
|
65
|
-
|
|
171
|
+
@if (clickable()) {
|
|
172
|
+
<button type="button" class="cb-folder-card__name cb-folder-card__open" (click)="open.emit($event)">{{ name() }}</button>
|
|
173
|
+
} @else {
|
|
174
|
+
<div class="cb-folder-card__name">{{ name() }}</div>
|
|
175
|
+
}
|
|
66
176
|
<div class="cb-folder-card__meta">
|
|
67
177
|
@if (files() !== '') {
|
|
68
178
|
<span>{{ files() }} {{ (filesLabel() ?? t().files) }}</span>
|
|
@@ -71,8 +181,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
71
181
|
<span>{{ size() }}</span>
|
|
72
182
|
}
|
|
73
183
|
</div>
|
|
74
|
-
`, styles: [":host{display:block;padding:1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__name{margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"] }]
|
|
75
|
-
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], filesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
|
|
184
|
+
`, styles: [":host{position:relative;display:block;padding:1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 14px);background:var(--cb-color-surface);font-family:var(--cb-font-sans);color:var(--cb-color-text)}:host(.cb-folder-card--clickable){cursor:pointer;transition:background-color .15s ease}:host(.cb-folder-card--clickable:hover){background:var(--cb-color-surface-hover)}:host(.cb-folder-card--clickable:has(.cb-folder-card__open:focus-visible)){outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__top{display:flex;align-items:flex-start;justify-content:space-between}.cb-folder-card__icon{color:#f5b301}.cb-folder-card__actions{position:relative;z-index:1;display:inline-flex;align-items:center;gap:.25rem;color:var(--cb-color-text-muted);line-height:1}.cb-folder-card__menu-button{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:-.375rem -.5rem 0 0;padding:0;border:0;border-radius:var(--cb-radius-md, 8px);background:transparent;color:inherit;cursor:pointer}.cb-folder-card__menu-button:hover,.cb-folder-card__menu-button[aria-expanded=true]{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-folder-card__menu-button:focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:2px}.cb-folder-card__name{display:block;margin:.75rem 0 .25rem;font-weight:600;font-size:.95rem}.cb-folder-card__open{width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:600;font-size:.95rem;text-align:start;cursor:pointer}.cb-folder-card__open:focus-visible{outline:none}.cb-folder-card__open:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.cb-folder-card__meta{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;color:var(--cb-color-text-muted)}\n"] }]
|
|
185
|
+
}], propDecorators: { menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], filesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], actionsAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAriaLabel", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], actionSelect: [{ type: i0.Output, args: ["actionSelect"] }], open: [{ type: i0.Output, args: ["open"] }] } });
|
|
76
186
|
|
|
77
187
|
/*
|
|
78
188
|
* Public API Surface de @caribeng/ui/folder-card
|
|
@@ -26,7 +26,7 @@ class CbInlineMessage {
|
|
|
26
26
|
...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
|
|
27
27
|
}
|
|
28
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInlineMessage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbInlineMessage, isStandalone: true, selector: "cb-inline-message", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, host: {
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbInlineMessage, isStandalone: true, selector: "cb-inline-message", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "severity() === \"danger\" || severity() === \"warn\" ? \"alert\" : \"status\"", "class.cb-inline-message--info": "severity() === \"info\"", "class.cb-inline-message--success": "severity() === \"success\"", "class.cb-inline-message--warn": "severity() === \"warn\"", "class.cb-inline-message--danger": "severity() === \"danger\"" }, classAttribute: "cb-inline-message" }, ngImport: i0, template: `
|
|
30
30
|
<cb-icon [name]="iconName()" [size]="15" aria-hidden="true" />
|
|
31
31
|
<span class="cb-inline-message__text">{{ text() }}<ng-content /></span>
|
|
32
32
|
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem .625rem;border-radius:var(--cb-radius-md);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm);font-weight:var(--cb-font-medium)}:host(.cb-inline-message--info){background:color-mix(in srgb,var(--cb-color-info-500) 14%,transparent);color:var(--cb-color-info-500)}:host(.cb-inline-message--success){background:color-mix(in srgb,var(--cb-color-success-500) 14%,transparent);color:var(--cb-color-success-500)}:host(.cb-inline-message--warn){background:color-mix(in srgb,var(--cb-color-warning-500) 14%,transparent);color:var(--cb-color-warning-500)}:host(.cb-inline-message--danger){background:color-mix(in srgb,var(--cb-color-danger-500) 14%,transparent);color:var(--cb-color-danger-500)}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -35,7 +35,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
35
35
|
type: Component,
|
|
36
36
|
args: [{ selector: 'cb-inline-message', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: {
|
|
37
37
|
class: 'cb-inline-message',
|
|
38
|
-
role: 'alert',
|
|
38
|
+
'[attr.role]': 'severity() === "danger" || severity() === "warn" ? "alert" : "status"',
|
|
39
39
|
'[class.cb-inline-message--info]': 'severity() === "info"',
|
|
40
40
|
'[class.cb-inline-message--success]': 'severity() === "success"',
|
|
41
41
|
'[class.cb-inline-message--warn]': 'severity() === "warn"',
|