@caribeng/ui 22.2.0 → 22.5.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 +311 -231
- package/fesm2022/caribeng-ui-accordion.mjs +2 -2
- package/fesm2022/caribeng-ui-account-picker.mjs +533 -0
- package/fesm2022/caribeng-ui-aging.mjs +488 -0
- package/fesm2022/{caribeng-ui-caribe-alert.mjs → caribeng-ui-alert.mjs} +45 -45
- package/fesm2022/caribeng-ui-amount.mjs +249 -0
- package/fesm2022/caribeng-ui-anchor.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs} +41 -41
- package/fesm2022/caribeng-ui-audit-log.mjs +323 -0
- package/fesm2022/caribeng-ui-avatar.mjs +4 -4
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-breadcrumb.mjs +26 -9
- package/fesm2022/{caribeng-ui-caribe-button-group.mjs → caribeng-ui-button-group.mjs} +15 -15
- package/fesm2022/caribeng-ui-button.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-card-content.mjs → caribeng-ui-card-content.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-card-move.mjs → caribeng-ui-card-move.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-card-primary.mjs → caribeng-ui-card-primary.mjs} +31 -31
- package/fesm2022/{caribeng-ui-caribe-card-select.mjs → caribeng-ui-card-select.mjs} +67 -67
- package/fesm2022/caribeng-ui-carousel.mjs +2 -2
- package/fesm2022/caribeng-ui-cascadeselect.mjs +45 -9
- package/fesm2022/caribeng-ui-chart.mjs +8 -5
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/{caribeng-ui-caribe-coachmark.mjs → caribeng-ui-coachmark.mjs} +85 -85
- 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-comments.mjs +864 -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-datagrid.mjs +1635 -0
- package/fesm2022/caribeng-ui-dataview.mjs +6 -3
- package/fesm2022/caribeng-ui-datepicker.mjs +2 -2
- package/fesm2022/caribeng-ui-dock.mjs +52 -12
- package/fesm2022/caribeng-ui-document.mjs +495 -0
- package/fesm2022/{caribeng-ui-caribe-dots-indicator.mjs → caribeng-ui-dots-indicator.mjs} +41 -41
- package/fesm2022/caribeng-ui-drawer.mjs +9 -4
- package/fesm2022/caribeng-ui-dynamic-form.mjs +1581 -0
- package/fesm2022/caribeng-ui-editor.mjs +2324 -1311
- package/fesm2022/{caribeng-ui-caribe-expansion-panel.mjs → caribeng-ui-expansion-panel.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-fab-menu.mjs → caribeng-ui-fab-menu.mjs} +75 -75
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +134 -17
- package/fesm2022/{caribeng-ui-caribe-file-download.mjs → caribeng-ui-file-download.mjs} +63 -63
- package/fesm2022/caribeng-ui-financial-report.mjs +380 -0
- package/fesm2022/{caribeng-ui-caribe-float-menu.mjs → caribeng-ui-float-menu.mjs} +31 -31
- package/fesm2022/caribeng-ui-floatlabel.mjs +2 -2
- package/fesm2022/caribeng-ui-flow.mjs +1508 -0
- package/fesm2022/caribeng-ui-folder-card.mjs +122 -12
- package/fesm2022/{caribeng-ui-caribe-footer.mjs → caribeng-ui-footer.mjs} +19 -19
- package/fesm2022/caribeng-ui-gantt.mjs +1094 -0
- package/fesm2022/{caribeng-ui-caribe-header.mjs → caribeng-ui-header.mjs} +49 -49
- package/fesm2022/{caribeng-ui-caribe-icon-button.mjs → caribeng-ui-icon-button.mjs} +23 -23
- package/fesm2022/caribeng-ui-image-cropper.mjs +671 -0
- package/fesm2022/caribeng-ui-import-wizard.mjs +746 -0
- package/fesm2022/caribeng-ui-infinite-scroll.mjs +226 -0
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-input-number.mjs +22 -6
- package/fesm2022/{caribeng-ui-caribe-input-search.mjs → caribeng-ui-input-search.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-input-token.mjs → caribeng-ui-input-token.mjs} +59 -59
- package/fesm2022/caribeng-ui-inputmask.mjs +8 -2
- package/fesm2022/caribeng-ui-inputotp.mjs +2 -2
- package/fesm2022/caribeng-ui-journal-entry.mjs +340 -0
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-kpi.mjs +189 -0
- package/fesm2022/{caribeng-ui-caribe-link.mjs → caribeng-ui-link.mjs} +37 -37
- package/fesm2022/caribeng-ui-masonry.mjs +93 -0
- package/fesm2022/caribeng-ui-media-player.mjs +821 -0
- package/fesm2022/caribeng-ui-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-notification-center.mjs +636 -0
- package/fesm2022/{caribeng-ui-caribe-off-canvas.mjs → caribeng-ui-off-canvas.mjs} +55 -55
- package/fesm2022/{caribeng-ui-caribe-onboarding.mjs → caribeng-ui-onboarding.mjs} +105 -105
- package/fesm2022/caribeng-ui-orderlist.mjs +2 -2
- package/fesm2022/caribeng-ui-organizationchart.mjs +6 -10
- package/fesm2022/caribeng-ui-panel.mjs +6 -6
- package/fesm2022/caribeng-ui-panelmenu.mjs +9 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1755 -25
- package/fesm2022/caribeng-ui-period-picker.mjs +637 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-picklist.mjs +2 -2
- package/fesm2022/caribeng-ui-pivot.mjs +419 -0
- package/fesm2022/caribeng-ui-pricing.mjs +263 -69
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-rating.mjs +14 -17
- package/fesm2022/caribeng-ui-reconciliation.mjs +386 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scheduler.mjs +1027 -0
- package/fesm2022/caribeng-ui-scrolltop.mjs +3 -1
- package/fesm2022/caribeng-ui-select.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-shortcut.mjs → caribeng-ui-shortcut.mjs} +29 -29
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-signature-pad.mjs +654 -0
- package/fesm2022/{caribeng-ui-caribe-status.mjs → caribeng-ui-status.mjs} +11 -11
- package/fesm2022/{caribeng-ui-caribe-step-indicator.mjs → caribeng-ui-step-indicator.mjs} +53 -53
- package/fesm2022/caribeng-ui-stepper.mjs +12 -5
- package/fesm2022/caribeng-ui-steps.mjs +2 -2
- package/fesm2022/caribeng-ui-table.mjs +333 -19
- package/fesm2022/caribeng-ui-tabmenu.mjs +10 -6
- package/fesm2022/caribeng-ui-tabs.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-tag-button.mjs → caribeng-ui-tag-button.mjs} +25 -25
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-tieredmenu.mjs +111 -21
- package/fesm2022/{caribeng-ui-caribe-tracker.mjs → caribeng-ui-tracker.mjs} +29 -29
- package/fesm2022/{caribeng-ui-caribe-transaction-status.mjs → caribeng-ui-transaction-status.mjs} +11 -11
- package/fesm2022/caribeng-ui-treeselect.mjs +44 -9
- package/fesm2022/caribeng-ui-treetable.mjs +236 -17
- package/fesm2022/{caribeng-ui-caribe-voucher.mjs → caribeng-ui-voucher.mjs} +45 -45
- package/fesm2022/caribeng-ui-xlsx.mjs +486 -0
- package/fesm2022/caribeng-ui.mjs +1568 -1
- package/package.json +258 -178
- 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-account-picker.d.ts +142 -0
- package/types/caribeng-ui-aging.d.ts +123 -0
- package/types/{caribeng-ui-caribe-alert.d.ts → caribeng-ui-alert.d.ts} +2 -2
- package/types/caribeng-ui-amount.d.ts +82 -0
- package/types/{caribeng-ui-caribe-animation-lottie.d.ts → caribeng-ui-animation-lottie.d.ts} +2 -2
- package/types/caribeng-ui-audit-log.d.ts +86 -0
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-breadcrumb.d.ts +9 -1
- package/types/{caribeng-ui-caribe-button-group.d.ts → caribeng-ui-button-group.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-content.d.ts → caribeng-ui-card-content.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-move.d.ts → caribeng-ui-card-move.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-card-primary.d.ts → caribeng-ui-card-primary.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-select.d.ts → caribeng-ui-card-select.d.ts} +2 -2
- package/types/caribeng-ui-cascadeselect.d.ts +6 -0
- package/types/caribeng-ui-chart.d.ts +3 -1
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/{caribeng-ui-caribe-coachmark.d.ts → caribeng-ui-coachmark.d.ts} +2 -2
- 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-comments.d.ts +214 -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-datagrid.d.ts +269 -0
- package/types/caribeng-ui-dataview.d.ts +2 -0
- package/types/caribeng-ui-dock.d.ts +13 -1
- package/types/caribeng-ui-document.d.ts +138 -0
- package/types/{caribeng-ui-caribe-dots-indicator.d.ts → caribeng-ui-dots-indicator.d.ts} +2 -2
- package/types/caribeng-ui-drawer.d.ts +3 -1
- package/types/caribeng-ui-dynamic-form.d.ts +409 -0
- package/types/caribeng-ui-editor.d.ts +110 -12
- package/types/{caribeng-ui-caribe-expansion-panel.d.ts → caribeng-ui-expansion-panel.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-fab-menu.d.ts → caribeng-ui-fab-menu.d.ts} +2 -2
- package/types/caribeng-ui-file-card.d.ts +27 -2
- package/types/{caribeng-ui-caribe-file-download.d.ts → caribeng-ui-file-download.d.ts} +1 -1
- package/types/caribeng-ui-financial-report.d.ts +102 -0
- package/types/{caribeng-ui-caribe-float-menu.d.ts → caribeng-ui-float-menu.d.ts} +2 -2
- package/types/caribeng-ui-flow.d.ts +228 -0
- package/types/caribeng-ui-folder-card.d.ts +27 -5
- package/types/{caribeng-ui-caribe-footer.d.ts → caribeng-ui-footer.d.ts} +2 -2
- package/types/caribeng-ui-gantt.d.ts +244 -0
- package/types/{caribeng-ui-caribe-header.d.ts → caribeng-ui-header.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-icon-button.d.ts → caribeng-ui-icon-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-illustration.d.ts → caribeng-ui-illustration.d.ts} +1 -1
- package/types/caribeng-ui-image-cropper.d.ts +169 -0
- package/types/caribeng-ui-import-wizard.d.ts +149 -0
- package/types/caribeng-ui-infinite-scroll.d.ts +75 -0
- package/types/caribeng-ui-input-number.d.ts +1 -1
- package/types/{caribeng-ui-caribe-input-search.d.ts → caribeng-ui-input-search.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-input-token.d.ts → caribeng-ui-input-token.d.ts} +2 -2
- package/types/caribeng-ui-inputmask.d.ts +3 -1
- package/types/caribeng-ui-journal-entry.d.ts +110 -0
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-kpi.d.ts +64 -0
- package/types/{caribeng-ui-caribe-link.d.ts → caribeng-ui-link.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-logo.d.ts → caribeng-ui-logo.d.ts} +1 -1
- package/types/caribeng-ui-masonry.d.ts +32 -0
- package/types/caribeng-ui-media-player.d.ts +140 -0
- package/types/caribeng-ui-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-notification-center.d.ts +153 -0
- package/types/{caribeng-ui-caribe-off-canvas.d.ts → caribeng-ui-off-canvas.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-onboarding.d.ts → caribeng-ui-onboarding.d.ts} +2 -2
- package/types/caribeng-ui-panelmenu.d.ts +7 -0
- package/types/caribeng-ui-pdfviewer.d.ts +245 -5
- package/types/caribeng-ui-period-picker.d.ts +148 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-pivot.d.ts +116 -0
- package/types/caribeng-ui-pricing.d.ts +41 -4
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-reconciliation.d.ts +109 -0
- package/types/caribeng-ui-scheduler.d.ts +188 -0
- package/types/{caribeng-ui-caribe-shortcut.d.ts → caribeng-ui-shortcut.d.ts} +2 -2
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-signature-pad.d.ts +151 -0
- package/types/{caribeng-ui-caribe-status.d.ts → caribeng-ui-status.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-step-indicator.d.ts → caribeng-ui-step-indicator.d.ts} +2 -2
- package/types/caribeng-ui-stepper.d.ts +2 -0
- package/types/caribeng-ui-table.d.ts +67 -3
- package/types/caribeng-ui-tabmenu.d.ts +7 -0
- package/types/{caribeng-ui-caribe-tag-button.d.ts → caribeng-ui-tag-button.d.ts} +2 -2
- package/types/caribeng-ui-tieredmenu.d.ts +17 -1
- package/types/{caribeng-ui-caribe-tracker.d.ts → caribeng-ui-tracker.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-transaction-status.d.ts → caribeng-ui-transaction-status.d.ts} +2 -2
- package/types/caribeng-ui-treeselect.d.ts +6 -0
- package/types/caribeng-ui-treetable.d.ts +67 -2
- package/types/{caribeng-ui-caribe-voucher.d.ts → caribeng-ui-voucher.d.ts} +2 -2
- package/types/caribeng-ui-xlsx.d.ts +79 -0
- package/types/caribeng-ui.d.ts +985 -2
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +0 -92
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +0 -130
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +0 -94
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +0 -88
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +0 -100
- package/fesm2022/caribeng-ui-caribe-input-date.mjs +0 -138
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +0 -154
- package/fesm2022/caribeng-ui-caribe-loader.mjs +0 -48
- package/fesm2022/caribeng-ui-caribe-modal.mjs +0 -119
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +0 -52
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +0 -104
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +0 -57
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +0 -84
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +0 -69
- package/fesm2022/caribeng-ui-caribe-switch.mjs +0 -182
- package/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
- package/types/caribeng-ui-caribe-calendar.d.ts +0 -27
- package/types/caribeng-ui-caribe-circle-loading.d.ts +0 -28
- package/types/caribeng-ui-caribe-data-table.d.ts +0 -26
- package/types/caribeng-ui-caribe-file-select.d.ts +0 -31
- package/types/caribeng-ui-caribe-inline-alert.d.ts +0 -28
- package/types/caribeng-ui-caribe-input-date.d.ts +0 -40
- package/types/caribeng-ui-caribe-input-select.d.ts +0 -47
- package/types/caribeng-ui-caribe-loader.d.ts +0 -22
- package/types/caribeng-ui-caribe-modal.d.ts +0 -21
- package/types/caribeng-ui-caribe-pictogram.d.ts +0 -15
- package/types/caribeng-ui-caribe-pop-over.d.ts +0 -17
- package/types/caribeng-ui-caribe-preloader.d.ts +0 -24
- package/types/caribeng-ui-caribe-progress-bar.d.ts +0 -28
- package/types/caribeng-ui-caribe-stroke.d.ts +0 -17
- package/types/caribeng-ui-caribe-switch.d.ts +0 -55
- /package/fesm2022/{caribeng-ui-caribe-illustration.mjs → caribeng-ui-illustration.mjs} +0 -0
- /package/fesm2022/{caribeng-ui-caribe-logo.mjs → caribeng-ui-logo.mjs} +0 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injector, ElementRef, model, input, numberAttribute, booleanAttribute, output, signal, viewChild, computed, effect, untracked, afterNextRender, NgZone, DestroyRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, cbFormat } from '@caribeng/ui';
|
|
4
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Modelo del calendario de eventos: fechas, rejilla del mes, eventos de cada
|
|
8
|
+
* día y colocación de los que se solapan. Funciones puras (sin DOM).
|
|
9
|
+
*/
|
|
10
|
+
// --- Fechas ------------------------------------------------------------------------------
|
|
11
|
+
function toDate(value) {
|
|
12
|
+
if (value instanceof Date)
|
|
13
|
+
return isNaN(value.getTime()) ? null : new Date(value);
|
|
14
|
+
if (typeof value !== 'string' || !value)
|
|
15
|
+
return null;
|
|
16
|
+
// 'AAAA-MM-DD' sin hora: día local (new Date() lo leería en UTC).
|
|
17
|
+
const day = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
|
|
18
|
+
const date = day ? new Date(Number(day[1]), Number(day[2]) - 1, Number(day[3])) : new Date(value);
|
|
19
|
+
return isNaN(date.getTime()) ? null : date;
|
|
20
|
+
}
|
|
21
|
+
function startOfDay(date) {
|
|
22
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
23
|
+
}
|
|
24
|
+
function addDays(date, days) {
|
|
25
|
+
const d = new Date(date);
|
|
26
|
+
d.setDate(d.getDate() + days);
|
|
27
|
+
return d;
|
|
28
|
+
}
|
|
29
|
+
function addMinutes(date, minutes) {
|
|
30
|
+
return new Date(date.getTime() + minutes * 60_000);
|
|
31
|
+
}
|
|
32
|
+
function sameDay(a, b) {
|
|
33
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
34
|
+
}
|
|
35
|
+
function dayDiff(a, b) {
|
|
36
|
+
return Math.round((Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()) - Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())) / 86_400_000);
|
|
37
|
+
}
|
|
38
|
+
/** Primer día de la semana de `date` (`first`: 0 = domingo, 1 = lunes). */
|
|
39
|
+
function startOfWeek(date, first) {
|
|
40
|
+
return addDays(startOfDay(date), -((date.getDay() - first + 7) % 7));
|
|
41
|
+
}
|
|
42
|
+
/** Minutos desde la medianoche. */
|
|
43
|
+
function minutesOf(date) {
|
|
44
|
+
return date.getHours() * 60 + date.getMinutes();
|
|
45
|
+
}
|
|
46
|
+
/** `AAAA-MM-DD` del día. */
|
|
47
|
+
function isoDay(date) {
|
|
48
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
49
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
50
|
+
}
|
|
51
|
+
/** Fecha y hora local sin zona (`AAAA-MM-DDTHH:mm`), como la escribe un `<input type="datetime-local">`. */
|
|
52
|
+
function isoLocal(date) {
|
|
53
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
54
|
+
return `${isoDay(date)}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
55
|
+
}
|
|
56
|
+
function resolveEvent(event) {
|
|
57
|
+
const start = toDate(event.start);
|
|
58
|
+
if (!start)
|
|
59
|
+
return null;
|
|
60
|
+
if (event.allDay) {
|
|
61
|
+
const s = startOfDay(start);
|
|
62
|
+
let e = startOfDay(toDate(event.end) ?? s);
|
|
63
|
+
if (e < s)
|
|
64
|
+
e = s;
|
|
65
|
+
return { event, start: s, end: e, allDay: true };
|
|
66
|
+
}
|
|
67
|
+
let end = toDate(event.end) ?? addMinutes(start, 60);
|
|
68
|
+
if (end <= start)
|
|
69
|
+
end = addMinutes(start, 30);
|
|
70
|
+
return { event, start, end, allDay: false };
|
|
71
|
+
}
|
|
72
|
+
/** ¿El evento ocupa (parte de) este día? */
|
|
73
|
+
function onDay(e, day) {
|
|
74
|
+
const d0 = startOfDay(day);
|
|
75
|
+
if (e.allDay)
|
|
76
|
+
return e.start <= d0 && d0 <= e.end;
|
|
77
|
+
const d1 = addDays(d0, 1);
|
|
78
|
+
return e.start < d1 && e.end > d0;
|
|
79
|
+
}
|
|
80
|
+
/** Eventos de un día: primero los de día completo (y los que duran varios días), luego por hora. */
|
|
81
|
+
function eventsOfDay(events, day) {
|
|
82
|
+
return events
|
|
83
|
+
.filter((e) => onDay(e, day))
|
|
84
|
+
.sort((a, b) => Number(b.allDay || isMultiDay(b)) - Number(a.allDay || isMultiDay(a)) || a.start.getTime() - b.start.getTime() || a.event.title.localeCompare(b.event.title));
|
|
85
|
+
}
|
|
86
|
+
/** Un evento con hora que cruza la medianoche. */
|
|
87
|
+
function isMultiDay(e) {
|
|
88
|
+
return !e.allDay && !sameDay(e.start, addMinutes(e.end, -1));
|
|
89
|
+
}
|
|
90
|
+
/** Rejilla del mes: semanas completas (de 4 a 6) desde el primer día de la semana. */
|
|
91
|
+
function monthGrid(date, firstDay) {
|
|
92
|
+
const first = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
93
|
+
const last = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
94
|
+
const weeks = [];
|
|
95
|
+
for (let d = startOfWeek(first, firstDay); d <= last || weeks.length < 4; d = addDays(d, 7)) {
|
|
96
|
+
weeks.push(Array.from({ length: 7 }, (_, i) => addDays(d, i)));
|
|
97
|
+
if (weeks.length === 6)
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
return weeks;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Coloca los eventos con hora de un día: los que se solapan se reparten en
|
|
104
|
+
* columnas (cada grupo de solapados usa tantas como necesita).
|
|
105
|
+
*/
|
|
106
|
+
function layoutDay(events, day) {
|
|
107
|
+
const d0 = startOfDay(day);
|
|
108
|
+
const d1 = addDays(d0, 1);
|
|
109
|
+
const timed = events
|
|
110
|
+
.filter((e) => !e.allDay && e.start < d1 && e.end > d0)
|
|
111
|
+
.map((e) => ({
|
|
112
|
+
e,
|
|
113
|
+
from: e.start < d0 ? 0 : minutesOf(e.start),
|
|
114
|
+
to: e.end > d1 ? 24 * 60 : Math.max(minutesOf(e.end) || 24 * 60, (e.start < d0 ? 0 : minutesOf(e.start)) + 15),
|
|
115
|
+
}))
|
|
116
|
+
.sort((a, b) => a.from - b.from || b.to - a.to);
|
|
117
|
+
const placed = [];
|
|
118
|
+
let group = [];
|
|
119
|
+
let groupEnd = -1;
|
|
120
|
+
const flush = () => {
|
|
121
|
+
const columns = Math.max(1, ...group.map((g) => g.column + 1));
|
|
122
|
+
for (const g of group)
|
|
123
|
+
placed.push({ e: g.item.e, from: g.item.from, to: g.item.to, column: g.column, columns });
|
|
124
|
+
group = [];
|
|
125
|
+
};
|
|
126
|
+
for (const item of timed) {
|
|
127
|
+
if (item.from >= groupEnd && group.length)
|
|
128
|
+
flush();
|
|
129
|
+
// Primera columna libre (cuyo último evento ya terminó).
|
|
130
|
+
const used = new Set(group.filter((g) => g.item.to > item.from).map((g) => g.column));
|
|
131
|
+
let column = 0;
|
|
132
|
+
while (used.has(column))
|
|
133
|
+
column++;
|
|
134
|
+
group.push({ item, column });
|
|
135
|
+
groupEnd = Math.max(groupEnd, item.to);
|
|
136
|
+
}
|
|
137
|
+
if (group.length)
|
|
138
|
+
flush();
|
|
139
|
+
return placed;
|
|
140
|
+
}
|
|
141
|
+
/** Mueve un evento: `days` días y `minutes` minutos (conserva la duración). */
|
|
142
|
+
function shiftEvent(event, days, minutes) {
|
|
143
|
+
const r = resolveEvent(event);
|
|
144
|
+
if (!r)
|
|
145
|
+
return event;
|
|
146
|
+
if (r.allDay)
|
|
147
|
+
return { ...event, start: isoDay(addDays(r.start, days)), end: isoDay(addDays(r.end, days)) };
|
|
148
|
+
return { ...event, start: isoLocal(addMinutes(addDays(r.start, days), minutes)), end: isoLocal(addMinutes(addDays(r.end, days), minutes)) };
|
|
149
|
+
}
|
|
150
|
+
/** Cambia la duración de un evento con hora (`minutes` en el fin; nunca menos de `min`). */
|
|
151
|
+
function resizeEvent(event, minutes, min = 15) {
|
|
152
|
+
const r = resolveEvent(event);
|
|
153
|
+
if (!r || r.allDay)
|
|
154
|
+
return event;
|
|
155
|
+
const end = addMinutes(r.end, minutes);
|
|
156
|
+
return { ...event, end: isoLocal(end < addMinutes(r.start, min) ? addMinutes(r.start, min) : end) };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Alto de una hora en las vistas de semana y día (px), igual que en el CSS. */
|
|
160
|
+
const HOUR = 48;
|
|
161
|
+
/** Eventos que caben en una celda del mes antes de "+N más". */
|
|
162
|
+
const MONTH_LIMIT = 3;
|
|
163
|
+
let nextUid = 0;
|
|
164
|
+
/**
|
|
165
|
+
* Calendario de eventos de CaribeNG: vistas de mes, semana, día y agenda.
|
|
166
|
+
*
|
|
167
|
+
* - En semana y día, los eventos con hora se colocan en su franja (los que se
|
|
168
|
+
* solapan, uno al lado del otro) y los de día completo en la franja superior;
|
|
169
|
+
* una línea marca la hora actual.
|
|
170
|
+
* - Arrastra un evento para moverlo y su borde inferior para cambiar la duración;
|
|
171
|
+
* arrastra sobre una franja vacía (o haz clic) para elegir un hueco
|
|
172
|
+
* (`slotSelect`). En el mes, los eventos se arrastran de un día a otro.
|
|
173
|
+
* - Con el teclado cada evento es un botón: flechas lo mueven (un día, o la
|
|
174
|
+
* duración de una franja), Mayús + flechas arriba / abajo cambian la duración y
|
|
175
|
+
* Enter lo abre; cada día tiene un botón para crear un evento.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```html
|
|
179
|
+
* <cb-scheduler [(events)]="eventos" [(view)]="vista" (slotSelect)="crear($event)" (eventOpen)="abrir($event)" />
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
class CbScheduler {
|
|
183
|
+
constructor() {
|
|
184
|
+
/** Textos de interfaz en el idioma activo (`provideCaribeNG({ locale })`). */
|
|
185
|
+
this.t = injectCbTranslation();
|
|
186
|
+
this.fmt = cbFormat;
|
|
187
|
+
this.Math = Math;
|
|
188
|
+
this.injector = inject(Injector);
|
|
189
|
+
this.host = inject(ElementRef);
|
|
190
|
+
this.uid = `cb-scheduler-${++nextUid}`;
|
|
191
|
+
this.hour = HOUR;
|
|
192
|
+
this.ppm = HOUR / 60;
|
|
193
|
+
this.hours = Array.from({ length: 24 }, (_, i) => i);
|
|
194
|
+
/** Eventos (bidireccional: se actualiza al moverlos o cambiar su duración). */
|
|
195
|
+
this.events = model([], /* @ts-ignore */
|
|
196
|
+
...(ngDevMode ? [{ debugName: "events" }] : /* istanbul ignore next */ []));
|
|
197
|
+
this.view = model('week', /* @ts-ignore */
|
|
198
|
+
...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
199
|
+
/** Día de referencia de la vista (el mes, la semana o el día que se muestra). */
|
|
200
|
+
this.date = model(startOfDay(new Date()), /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
|
|
202
|
+
/** Vistas disponibles y su orden. */
|
|
203
|
+
this.views = input(['month', 'week', 'day', 'agenda'], /* @ts-ignore */
|
|
204
|
+
...(ngDevMode ? [{ debugName: "views" }] : /* istanbul ignore next */ []));
|
|
205
|
+
/** Primer día de la semana (0 = domingo, 1 = lunes). */
|
|
206
|
+
this.firstDayOfWeek = input(1, { ...(ngDevMode ? { debugName: "firstDayOfWeek" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
207
|
+
/** Minutos de cada franja: paso al arrastrar y con el teclado. */
|
|
208
|
+
this.slotMinutes = input(30, { ...(ngDevMode ? { debugName: "slotMinutes" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
209
|
+
/** Hora a la que se desplaza la vista de semana o día al abrirse. */
|
|
210
|
+
this.scrollHour = input(8, { ...(ngDevMode ? { debugName: "scrollHour" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
211
|
+
/** Días que muestra la agenda desde el día de referencia. */
|
|
212
|
+
this.agendaDays = input(14, { ...(ngDevMode ? { debugName: "agendaDays" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
213
|
+
/** Permite mover, cambiar la duración y elegir huecos. */
|
|
214
|
+
this.editable = input(true, { ...(ngDevMode ? { debugName: "editable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
215
|
+
/** Alto del área del calendario. */
|
|
216
|
+
this.height = input('36rem', /* @ts-ignore */
|
|
217
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
218
|
+
/** Un evento cambió de fecha u hora. */
|
|
219
|
+
this.eventChange = output();
|
|
220
|
+
/** Clic o Enter sobre un evento. */
|
|
221
|
+
this.eventOpen = output();
|
|
222
|
+
/** Se eligió un hueco (arrastrando o con clic en una franja, doble clic o el botón + de un día). */
|
|
223
|
+
this.slotSelect = output();
|
|
224
|
+
this.preview = signal(null, /* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "preview" }] : /* istanbul ignore next */ []));
|
|
226
|
+
this.announcement = signal('', /* @ts-ignore */
|
|
227
|
+
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
228
|
+
this.now = signal(new Date(), /* @ts-ignore */
|
|
229
|
+
...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
230
|
+
this.drag = null;
|
|
231
|
+
/** Tras arrastrar un evento no se emite el clic que lo sigue. */
|
|
232
|
+
this.suppressClick = false;
|
|
233
|
+
this.scrollRef = viewChild('scroll', /* @ts-ignore */
|
|
234
|
+
...(ngDevMode ? [{ debugName: "scrollRef" }] : /* istanbul ignore next */ []));
|
|
235
|
+
this.resolved = computed(() => this.events()
|
|
236
|
+
.map(resolveEvent)
|
|
237
|
+
.filter((e) => !!e), /* @ts-ignore */
|
|
238
|
+
...(ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []));
|
|
239
|
+
/** Eventos con la vista previa del arrastre aplicada. */
|
|
240
|
+
this.shown = computed(() => {
|
|
241
|
+
const p = this.preview();
|
|
242
|
+
if (!p?.id)
|
|
243
|
+
return this.resolved();
|
|
244
|
+
return this.events()
|
|
245
|
+
.map((e) => {
|
|
246
|
+
if (e.id !== p.id)
|
|
247
|
+
return e;
|
|
248
|
+
const drag = this.drag;
|
|
249
|
+
return drag?.mode === 'resize' ? resizeEvent(e, p.minutes, this.slotMinutes()) : shiftEvent(e, p.days, p.minutes);
|
|
250
|
+
})
|
|
251
|
+
.map(resolveEvent)
|
|
252
|
+
.filter((e) => !!e);
|
|
253
|
+
}, /* @ts-ignore */
|
|
254
|
+
...(ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []));
|
|
255
|
+
/** Días de la vista de semana o día. */
|
|
256
|
+
this.days = computed(() => {
|
|
257
|
+
const d = startOfDay(this.date());
|
|
258
|
+
if (this.view() === 'day')
|
|
259
|
+
return [d];
|
|
260
|
+
const first = startOfWeek(d, this.firstDayOfWeek());
|
|
261
|
+
return Array.from({ length: 7 }, (_, i) => addDays(first, i));
|
|
262
|
+
}, /* @ts-ignore */
|
|
263
|
+
...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
264
|
+
this.weeks = computed(() => monthGrid(this.date(), this.firstDayOfWeek()), /* @ts-ignore */
|
|
265
|
+
...(ngDevMode ? [{ debugName: "weeks" }] : /* istanbul ignore next */ []));
|
|
266
|
+
this.weekdayNames = computed(() => {
|
|
267
|
+
const format = new Intl.DateTimeFormat(this.t().intlLocale, { weekday: 'short' });
|
|
268
|
+
const first = startOfWeek(new Date(2030, 0, 7), this.firstDayOfWeek());
|
|
269
|
+
return Array.from({ length: 7 }, (_, i) => format.format(addDays(first, i)));
|
|
270
|
+
}, /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "weekdayNames" }] : /* istanbul ignore next */ []));
|
|
272
|
+
this.agenda = computed(() => {
|
|
273
|
+
const start = startOfDay(this.date());
|
|
274
|
+
const out = [];
|
|
275
|
+
for (let i = 0; i < this.agendaDays(); i++) {
|
|
276
|
+
const day = addDays(start, i);
|
|
277
|
+
const events = eventsOfDay(this.resolved(), day);
|
|
278
|
+
if (events.length)
|
|
279
|
+
out.push({ day, events });
|
|
280
|
+
}
|
|
281
|
+
return out;
|
|
282
|
+
}, /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "agenda" }] : /* istanbul ignore next */ []));
|
|
284
|
+
this.title = computed(() => {
|
|
285
|
+
const locale = this.t().intlLocale;
|
|
286
|
+
const d = this.date();
|
|
287
|
+
const cap = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
288
|
+
switch (this.view()) {
|
|
289
|
+
case 'month':
|
|
290
|
+
return cap(new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(d));
|
|
291
|
+
case 'day':
|
|
292
|
+
return cap(new Intl.DateTimeFormat(locale, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }).format(d));
|
|
293
|
+
case 'agenda': {
|
|
294
|
+
const end = addDays(startOfDay(d), this.agendaDays() - 1);
|
|
295
|
+
return this.rangeText(startOfDay(d), end);
|
|
296
|
+
}
|
|
297
|
+
default: {
|
|
298
|
+
const days = this.days();
|
|
299
|
+
return this.rangeText(days[0], days[days.length - 1]);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}, /* @ts-ignore */
|
|
303
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
304
|
+
this.nowTop = computed(() => minutesOf(this.now()) * this.ppm, /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "nowTop" }] : /* istanbul ignore next */ []));
|
|
306
|
+
/** Hueco seleccionado al arrastrar sobre una franja. */
|
|
307
|
+
this.selection = computed(() => this.preview()?.select ?? null, /* @ts-ignore */
|
|
308
|
+
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
309
|
+
/** Día bajo el puntero al arrastrar en el mes o en la franja de día completo. */
|
|
310
|
+
this.dropDay = computed(() => {
|
|
311
|
+
const p = this.preview();
|
|
312
|
+
const drag = this.drag;
|
|
313
|
+
if (!p?.id || !drag?.dayOnly)
|
|
314
|
+
return null;
|
|
315
|
+
return addDays(drag.day, p.days);
|
|
316
|
+
}, /* @ts-ignore */
|
|
317
|
+
...(ngDevMode ? [{ debugName: "dropDay" }] : /* istanbul ignore next */ []));
|
|
318
|
+
// Semana y día se abren en la hora de trabajo (no a medianoche).
|
|
319
|
+
effect(() => {
|
|
320
|
+
const view = this.view();
|
|
321
|
+
if (view !== 'week' && view !== 'day')
|
|
322
|
+
return;
|
|
323
|
+
untracked(() => afterNextRender(() => {
|
|
324
|
+
const el = this.scrollRef()?.nativeElement;
|
|
325
|
+
if (!el)
|
|
326
|
+
return;
|
|
327
|
+
el.scrollTop = Math.max(0, this.scrollHour() * HOUR - 8);
|
|
328
|
+
// Si la semana se desplaza de lado (contenedor estrecho), se abre en el día de hoy.
|
|
329
|
+
const today = el.querySelector('.cb-sched__col--today');
|
|
330
|
+
const gutter = el.querySelector('.cb-sched__gutter')?.offsetWidth ?? 0;
|
|
331
|
+
if (today && el.scrollWidth > el.clientWidth)
|
|
332
|
+
el.scrollLeft = Math.max(0, today.offsetLeft - gutter);
|
|
333
|
+
}, { injector: this.injector }));
|
|
334
|
+
});
|
|
335
|
+
// La línea de la hora actual avanza cada minuto (fuera de la zona: no deja la app "inestable").
|
|
336
|
+
const timer = inject(NgZone).runOutsideAngular(() => setInterval(() => this.now.set(new Date()), 60_000));
|
|
337
|
+
inject(DestroyRef).onDestroy(() => clearInterval(timer));
|
|
338
|
+
}
|
|
339
|
+
rangeText(from, to) {
|
|
340
|
+
const locale = this.t().intlLocale;
|
|
341
|
+
const f = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', year: 'numeric' });
|
|
342
|
+
return f.formatRange?.(from, to) ?? `${f.format(from)} – ${f.format(to)}`;
|
|
343
|
+
}
|
|
344
|
+
// --- Textos ---------------------------------------------------------------------------
|
|
345
|
+
viewLabel(v) {
|
|
346
|
+
const t = this.t();
|
|
347
|
+
return { month: t.schedulerMonth, week: t.schedulerWeek, day: t.schedulerDay, agenda: t.schedulerAgenda }[v];
|
|
348
|
+
}
|
|
349
|
+
time(d) {
|
|
350
|
+
return new Intl.DateTimeFormat(this.t().intlLocale, { hour: '2-digit', minute: '2-digit' }).format(d);
|
|
351
|
+
}
|
|
352
|
+
hourLabel(h) {
|
|
353
|
+
return this.time(new Date(2030, 0, 1, h));
|
|
354
|
+
}
|
|
355
|
+
weekday(d) {
|
|
356
|
+
return new Intl.DateTimeFormat(this.t().intlLocale, { weekday: 'short' }).format(d);
|
|
357
|
+
}
|
|
358
|
+
/** Cabecera de un día de la agenda (el número va aparte): "Viernes, octubre". */
|
|
359
|
+
agendaDay(d) {
|
|
360
|
+
const locale = this.t().intlLocale;
|
|
361
|
+
const weekday = new Intl.DateTimeFormat(locale, { weekday: 'long' }).format(d);
|
|
362
|
+
const month = new Intl.DateTimeFormat(locale, { month: 'long' }).format(d);
|
|
363
|
+
return `${weekday.charAt(0).toUpperCase()}${weekday.slice(1)}, ${month}`;
|
|
364
|
+
}
|
|
365
|
+
longDay(d) {
|
|
366
|
+
return new Intl.DateTimeFormat(this.t().intlLocale, { weekday: 'long', day: 'numeric', month: 'long' }).format(d);
|
|
367
|
+
}
|
|
368
|
+
eventLabel(e) {
|
|
369
|
+
const t = this.t();
|
|
370
|
+
const when = e.allDay
|
|
371
|
+
? sameDay(e.start, e.end)
|
|
372
|
+
? `${this.longDay(e.start)}, ${t.schedulerAllDay.toLowerCase()}`
|
|
373
|
+
: `${this.longDay(e.start)} – ${this.longDay(e.end)}`
|
|
374
|
+
: isMultiDay(e)
|
|
375
|
+
? `${this.longDay(e.start)} ${this.time(e.start)} – ${this.longDay(e.end)} ${this.time(e.end)}`
|
|
376
|
+
: `${this.longDay(e.start)}, ${this.time(e.start)} – ${this.time(e.end)}`;
|
|
377
|
+
return [e.event.title, when, e.event.location].filter(Boolean).join(', ');
|
|
378
|
+
}
|
|
379
|
+
isToday(d) {
|
|
380
|
+
return sameDay(d, this.now());
|
|
381
|
+
}
|
|
382
|
+
isMulti(e) {
|
|
383
|
+
return isMultiDay(e);
|
|
384
|
+
}
|
|
385
|
+
minuteDate(day, minute) {
|
|
386
|
+
return addMinutes(startOfDay(day), minute);
|
|
387
|
+
}
|
|
388
|
+
// --- Eventos por día ---------------------------------------------------------------------
|
|
389
|
+
dayEvents(d) {
|
|
390
|
+
return eventsOfDay(this.shown(), d);
|
|
391
|
+
}
|
|
392
|
+
/** En el mes, si sobra uno se muestra (no "+1 más"). */
|
|
393
|
+
limitFor(d) {
|
|
394
|
+
return this.dayEvents(d).length === MONTH_LIMIT + 1 ? MONTH_LIMIT + 1 : MONTH_LIMIT;
|
|
395
|
+
}
|
|
396
|
+
allDayEvents(d) {
|
|
397
|
+
return eventsOfDay(this.shown(), d).filter((e) => e.allDay);
|
|
398
|
+
}
|
|
399
|
+
placed(d) {
|
|
400
|
+
return layoutDay(this.shown(), d);
|
|
401
|
+
}
|
|
402
|
+
// --- Navegación ------------------------------------------------------------------------
|
|
403
|
+
/** Periodo anterior (−1) o siguiente (1). */
|
|
404
|
+
step(direction) {
|
|
405
|
+
const d = this.date();
|
|
406
|
+
switch (this.view()) {
|
|
407
|
+
case 'month':
|
|
408
|
+
this.date.set(new Date(d.getFullYear(), d.getMonth() + direction, 1));
|
|
409
|
+
break;
|
|
410
|
+
case 'day':
|
|
411
|
+
this.date.set(addDays(d, direction));
|
|
412
|
+
break;
|
|
413
|
+
case 'agenda':
|
|
414
|
+
this.date.set(addDays(d, direction * this.agendaDays()));
|
|
415
|
+
break;
|
|
416
|
+
default:
|
|
417
|
+
this.date.set(addDays(d, direction * 7));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
goToday() {
|
|
421
|
+
this.date.set(startOfDay(new Date()));
|
|
422
|
+
}
|
|
423
|
+
/** Abre la vista de día de una fecha. */
|
|
424
|
+
openDay(d) {
|
|
425
|
+
this.date.set(startOfDay(d));
|
|
426
|
+
if (this.views().includes('day'))
|
|
427
|
+
this.view.set('day');
|
|
428
|
+
}
|
|
429
|
+
// --- Huecos -----------------------------------------------------------------------------
|
|
430
|
+
selectDay(d) {
|
|
431
|
+
if (!this.editable())
|
|
432
|
+
return;
|
|
433
|
+
const start = startOfDay(d);
|
|
434
|
+
this.slotSelect.emit({ start, end: start, allDay: true });
|
|
435
|
+
}
|
|
436
|
+
selectTime(d, minute) {
|
|
437
|
+
if (!this.editable())
|
|
438
|
+
return;
|
|
439
|
+
const start = this.minuteDate(d, minute);
|
|
440
|
+
this.slotSelect.emit({ start, end: addMinutes(start, Math.max(this.slotMinutes(), 30)), allDay: false });
|
|
441
|
+
}
|
|
442
|
+
// --- Arrastre ----------------------------------------------------------------------------
|
|
443
|
+
/** Día (y minuto, en las columnas de hora) bajo el puntero. */
|
|
444
|
+
pointAt(x, y) {
|
|
445
|
+
const doc = this.host.nativeElement.ownerDocument;
|
|
446
|
+
const stack = doc.elementsFromPoint?.(x, y) ?? [];
|
|
447
|
+
for (const el of stack) {
|
|
448
|
+
const target = el.closest?.('[data-date]');
|
|
449
|
+
if (!target || !this.host.nativeElement.contains(target))
|
|
450
|
+
continue;
|
|
451
|
+
const day = new Date(Number(target.dataset['date']));
|
|
452
|
+
if (target.dataset['dayOnly'])
|
|
453
|
+
return { day, minute: null, dayOnly: true };
|
|
454
|
+
const rect = target.getBoundingClientRect();
|
|
455
|
+
const minute = Math.max(0, Math.min(24 * 60, (y - rect.top) / this.ppm));
|
|
456
|
+
return { day, minute, dayOnly: false };
|
|
457
|
+
}
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
snap(minute) {
|
|
461
|
+
const slot = this.slotMinutes();
|
|
462
|
+
return Math.round(minute / slot) * slot;
|
|
463
|
+
}
|
|
464
|
+
onEventPointerDown(event, e, mode, day, dayOnly) {
|
|
465
|
+
if (!this.editable() || event.button !== 0)
|
|
466
|
+
return;
|
|
467
|
+
event.stopPropagation();
|
|
468
|
+
const point = this.pointAt(event.clientX, event.clientY);
|
|
469
|
+
this.drag = { mode, id: e.event.id, x: event.clientX, y: event.clientY, day, minute: point?.minute ?? minutesOf(e.start), dayOnly, moved: false };
|
|
470
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
471
|
+
}
|
|
472
|
+
onColumnPointerDown(event, d) {
|
|
473
|
+
if (!this.editable() || event.button !== 0 || event.target.closest('.cb-sched__event'))
|
|
474
|
+
return;
|
|
475
|
+
const point = this.pointAt(event.clientX, event.clientY);
|
|
476
|
+
const minute = this.snap(Math.floor((point?.minute ?? 0) / this.slotMinutes()) * this.slotMinutes());
|
|
477
|
+
this.drag = { mode: 'select', id: null, x: event.clientX, y: event.clientY, day: d, minute, dayOnly: false, moved: false };
|
|
478
|
+
this.preview.set({ id: null, days: 0, minutes: 0, select: { day: d, from: minute, to: minute + this.slotMinutes() } });
|
|
479
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
480
|
+
event.preventDefault();
|
|
481
|
+
}
|
|
482
|
+
onPointerMove(event) {
|
|
483
|
+
const drag = this.drag;
|
|
484
|
+
if (!drag)
|
|
485
|
+
return;
|
|
486
|
+
if (!drag.moved && Math.abs(event.clientX - drag.x) < 4 && Math.abs(event.clientY - drag.y) < 4)
|
|
487
|
+
return;
|
|
488
|
+
drag.moved = true;
|
|
489
|
+
const point = this.pointAt(event.clientX, event.clientY);
|
|
490
|
+
if (drag.mode === 'select') {
|
|
491
|
+
if (!point || point.minute === null)
|
|
492
|
+
return;
|
|
493
|
+
const a = drag.minute;
|
|
494
|
+
const b = this.snap(point.minute);
|
|
495
|
+
const from = Math.min(a, b);
|
|
496
|
+
const to = Math.max(a + this.slotMinutes(), b);
|
|
497
|
+
this.preview.set({ id: null, days: 0, minutes: 0, select: { day: drag.day, from, to } });
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
if (!point)
|
|
501
|
+
return;
|
|
502
|
+
const days = drag.mode === 'resize' ? 0 : dayDiff(drag.day, point.day);
|
|
503
|
+
const minutes = drag.dayOnly || point.minute === null ? 0 : this.snap(point.minute - drag.minute);
|
|
504
|
+
this.preview.set({ id: drag.id, days, minutes, select: null });
|
|
505
|
+
}
|
|
506
|
+
onPointerUp() {
|
|
507
|
+
const drag = this.drag;
|
|
508
|
+
const preview = this.preview();
|
|
509
|
+
this.drag = null;
|
|
510
|
+
this.preview.set(null);
|
|
511
|
+
if (!drag)
|
|
512
|
+
return;
|
|
513
|
+
if (drag.mode === 'select') {
|
|
514
|
+
const s = preview?.select;
|
|
515
|
+
if (s)
|
|
516
|
+
this.selectRange(s.day, s.from, s.to);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
if (!drag.moved || !preview?.id)
|
|
520
|
+
return;
|
|
521
|
+
this.suppressClick = true;
|
|
522
|
+
setTimeout(() => (this.suppressClick = false));
|
|
523
|
+
if (drag.mode === 'resize')
|
|
524
|
+
this.apply(drag.id, (e) => resizeEvent(e, preview.minutes, this.slotMinutes()));
|
|
525
|
+
else
|
|
526
|
+
this.apply(drag.id, (e) => shiftEvent(e, preview.days, preview.minutes));
|
|
527
|
+
}
|
|
528
|
+
selectRange(day, from, to) {
|
|
529
|
+
const start = this.minuteDate(day, from);
|
|
530
|
+
this.slotSelect.emit({ start, end: this.minuteDate(day, to), allDay: false });
|
|
531
|
+
}
|
|
532
|
+
cancelDrag() {
|
|
533
|
+
this.drag = null;
|
|
534
|
+
this.preview.set(null);
|
|
535
|
+
}
|
|
536
|
+
onEventClick(e) {
|
|
537
|
+
if (this.suppressClick)
|
|
538
|
+
return;
|
|
539
|
+
this.eventOpen.emit(e.event);
|
|
540
|
+
}
|
|
541
|
+
// --- Cambios -------------------------------------------------------------------------------
|
|
542
|
+
apply(id, change) {
|
|
543
|
+
const events = this.events();
|
|
544
|
+
const previous = events.find((e) => e.id === id);
|
|
545
|
+
if (!previous)
|
|
546
|
+
return;
|
|
547
|
+
const next = change(previous);
|
|
548
|
+
if (next.start === previous.start && next.end === previous.end)
|
|
549
|
+
return;
|
|
550
|
+
this.events.set(events.map((e) => (e.id === id ? next : e)));
|
|
551
|
+
this.eventChange.emit({ event: next, previous });
|
|
552
|
+
const r = resolveEvent(next);
|
|
553
|
+
if (r)
|
|
554
|
+
this.announcement.set(cbFormat(this.t().schedulerMoved, this.eventLabel(r)));
|
|
555
|
+
}
|
|
556
|
+
onEventKeydown(event, e, dayOnly) {
|
|
557
|
+
if (!this.editable() || event.altKey || event.ctrlKey || event.metaKey)
|
|
558
|
+
return;
|
|
559
|
+
const id = e.event.id;
|
|
560
|
+
const slot = this.slotMinutes();
|
|
561
|
+
let handled = true;
|
|
562
|
+
if (event.shiftKey && !dayOnly && !e.allDay && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
|
|
563
|
+
this.apply(id, (ev) => resizeEvent(ev, event.key === 'ArrowDown' ? slot : -slot, slot));
|
|
564
|
+
}
|
|
565
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
566
|
+
this.apply(id, (ev) => shiftEvent(ev, event.key === 'ArrowRight' ? 1 : -1, 0));
|
|
567
|
+
}
|
|
568
|
+
else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
569
|
+
const down = event.key === 'ArrowDown';
|
|
570
|
+
if (dayOnly || e.allDay)
|
|
571
|
+
this.apply(id, (ev) => shiftEvent(ev, down ? 7 : -7, 0));
|
|
572
|
+
else
|
|
573
|
+
this.apply(id, (ev) => shiftEvent(ev, 0, down ? slot : -slot));
|
|
574
|
+
}
|
|
575
|
+
else
|
|
576
|
+
handled = false;
|
|
577
|
+
if (!handled)
|
|
578
|
+
return;
|
|
579
|
+
event.preventDefault();
|
|
580
|
+
// La vista se repinta: el foco vuelve al evento (que puede haber cambiado de día).
|
|
581
|
+
afterNextRender(() => {
|
|
582
|
+
const el = Array.from(this.host.nativeElement.querySelectorAll('[data-event-id]')).find((b) => b.dataset['eventId'] === id);
|
|
583
|
+
el?.focus();
|
|
584
|
+
if (!el) {
|
|
585
|
+
const moved = this.resolved().find((r) => r.event.id === id);
|
|
586
|
+
if (moved && this.view() !== 'month')
|
|
587
|
+
this.date.set(startOfDay(moved.start));
|
|
588
|
+
}
|
|
589
|
+
}, { injector: this.injector });
|
|
590
|
+
}
|
|
591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbScheduler, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
592
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbScheduler, isStandalone: true, selector: "cb-scheduler", inputs: { events: { classPropertyName: "events", publicName: "events", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, slotMinutes: { classPropertyName: "slotMinutes", publicName: "slotMinutes", isSignal: true, isRequired: false, transformFunction: null }, scrollHour: { classPropertyName: "scrollHour", publicName: "scrollHour", isSignal: true, isRequired: false, transformFunction: null }, agendaDays: { classPropertyName: "agendaDays", publicName: "agendaDays", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { events: "eventsChange", view: "viewChange", date: "dateChange", eventChange: "eventChange", eventOpen: "eventOpen", slotSelect: "slotSelect" }, host: { properties: { "class.cb-scheduler--readonly": "!editable()" }, classAttribute: "cb-scheduler" }, viewQueries: [{ propertyName: "scrollRef", first: true, predicate: ["scroll"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
593
|
+
<div class="cb-sched__toolbar">
|
|
594
|
+
<div class="cb-sched__nav">
|
|
595
|
+
<button type="button" class="cb-sched__icon-btn" [attr.aria-label]="t().schedulerPrevious" (click)="step(-1)">
|
|
596
|
+
<cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
|
|
597
|
+
</button>
|
|
598
|
+
<button type="button" class="cb-sched__btn" (click)="goToday()">{{ t().today }}</button>
|
|
599
|
+
<button type="button" class="cb-sched__icon-btn" [attr.aria-label]="t().schedulerNext" (click)="step(1)">
|
|
600
|
+
<cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
|
|
601
|
+
</button>
|
|
602
|
+
<h2 class="cb-sched__title" aria-live="polite">{{ title() }}</h2>
|
|
603
|
+
</div>
|
|
604
|
+
<div class="cb-sched__views" role="group" [attr.aria-label]="t().schedulerViews">
|
|
605
|
+
@for (v of views(); track v) {
|
|
606
|
+
<button type="button" class="cb-sched__view" [attr.aria-pressed]="view() === v" (click)="view.set(v)">{{ viewLabel(v) }}</button>
|
|
607
|
+
}
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
|
|
611
|
+
<div class="cb-sched__body" [style.height]="height()" (pointermove)="onPointerMove($event)" (pointerup)="onPointerUp()" (pointercancel)="cancelDrag()">
|
|
612
|
+
@switch (view()) {
|
|
613
|
+
@case ('month') {
|
|
614
|
+
<div class="cb-sched__month" role="grid" [attr.aria-label]="title()">
|
|
615
|
+
<div class="cb-sched__month-head" role="row">
|
|
616
|
+
@for (name of weekdayNames(); track $index) {
|
|
617
|
+
<span class="cb-sched__weekday" role="columnheader">{{ name }}</span>
|
|
618
|
+
}
|
|
619
|
+
</div>
|
|
620
|
+
@for (week of weeks(); track $index) {
|
|
621
|
+
<div class="cb-sched__week" role="row">
|
|
622
|
+
@for (d of week; track d.getTime()) {
|
|
623
|
+
<div
|
|
624
|
+
class="cb-sched__cell"
|
|
625
|
+
role="gridcell"
|
|
626
|
+
[attr.data-date]="d.getTime()"
|
|
627
|
+
data-day-only="true"
|
|
628
|
+
[class.cb-sched__cell--outside]="d.getMonth() !== date().getMonth()"
|
|
629
|
+
[class.cb-sched__cell--today]="isToday(d)"
|
|
630
|
+
[class.cb-sched__cell--drop]="dropDay()?.getTime() === d.getTime()"
|
|
631
|
+
(dblclick)="selectDay(d)"
|
|
632
|
+
>
|
|
633
|
+
<div class="cb-sched__cell-head">
|
|
634
|
+
<button type="button" class="cb-sched__day-num" [attr.aria-label]="fmt(t().schedulerOpenDay, longDay(d))" (click)="openDay(d)">{{ d.getDate() }}</button>
|
|
635
|
+
@if (editable()) {
|
|
636
|
+
<button type="button" class="cb-sched__add" [attr.aria-label]="fmt(t().schedulerNewEvent, longDay(d))" (click)="selectDay(d)">
|
|
637
|
+
<cb-icon name="plus" [size]="13" aria-hidden="true" />
|
|
638
|
+
</button>
|
|
639
|
+
}
|
|
640
|
+
</div>
|
|
641
|
+
@for (e of dayEvents(d).slice(0, limitFor(d)); track e.event.id) {
|
|
642
|
+
<button
|
|
643
|
+
type="button"
|
|
644
|
+
class="cb-sched__chip"
|
|
645
|
+
[class.cb-sched__chip--block]="e.allDay || isMulti(e)"
|
|
646
|
+
[class.cb-is-dragging]="preview()?.id === e.event.id"
|
|
647
|
+
[style.--cb-sched-color]="e.event.color || null"
|
|
648
|
+
[attr.data-event-id]="e.event.id"
|
|
649
|
+
[attr.aria-label]="eventLabel(e)"
|
|
650
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
651
|
+
(pointerdown)="onEventPointerDown($event, e, 'move', d, true)"
|
|
652
|
+
(click)="onEventClick(e)"
|
|
653
|
+
(keydown)="onEventKeydown($event, e, true)"
|
|
654
|
+
>
|
|
655
|
+
@if (!e.allDay && !isMulti(e)) {
|
|
656
|
+
<span class="cb-sched__dot" aria-hidden="true"></span>
|
|
657
|
+
<span class="cb-sched__chip-time" aria-hidden="true">{{ time(e.start) }}</span>
|
|
658
|
+
}
|
|
659
|
+
<span class="cb-sched__chip-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
660
|
+
</button>
|
|
661
|
+
}
|
|
662
|
+
@if (dayEvents(d).length > limitFor(d)) {
|
|
663
|
+
<button type="button" class="cb-sched__more" [attr.aria-label]="fmt(t().schedulerMoreLabel, dayEvents(d).length - limitFor(d), longDay(d))" (click)="openDay(d)">
|
|
664
|
+
{{ fmt(t().schedulerMore, dayEvents(d).length - limitFor(d)) }}
|
|
665
|
+
</button>
|
|
666
|
+
}
|
|
667
|
+
</div>
|
|
668
|
+
}
|
|
669
|
+
</div>
|
|
670
|
+
}
|
|
671
|
+
</div>
|
|
672
|
+
}
|
|
673
|
+
@case ('agenda') {
|
|
674
|
+
<div class="cb-sched__agenda">
|
|
675
|
+
@for (group of agenda(); track group.day.getTime()) {
|
|
676
|
+
<section class="cb-sched__agenda-day" [attr.aria-label]="longDay(group.day)">
|
|
677
|
+
<h3 class="cb-sched__agenda-date" [class.cb-sched__agenda-date--today]="isToday(group.day)">
|
|
678
|
+
<span class="cb-sched__agenda-num">{{ group.day.getDate() }}</span>
|
|
679
|
+
<span>{{ agendaDay(group.day) }}</span>
|
|
680
|
+
</h3>
|
|
681
|
+
<ul class="cb-sched__agenda-list">
|
|
682
|
+
@for (e of group.events; track e.event.id) {
|
|
683
|
+
<li>
|
|
684
|
+
<button type="button" class="cb-sched__agenda-item" [style.--cb-sched-color]="e.event.color || null" [attr.aria-label]="eventLabel(e)" (click)="eventOpen.emit(e.event)">
|
|
685
|
+
<span class="cb-sched__dot" aria-hidden="true"></span>
|
|
686
|
+
<span class="cb-sched__agenda-time" aria-hidden="true">{{ e.allDay ? t().schedulerAllDay : time(e.start) + ' – ' + time(e.end) }}</span>
|
|
687
|
+
<span class="cb-sched__agenda-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
688
|
+
@if (e.event.location) {
|
|
689
|
+
<span class="cb-sched__agenda-loc" aria-hidden="true">{{ e.event.location }}</span>
|
|
690
|
+
}
|
|
691
|
+
</button>
|
|
692
|
+
</li>
|
|
693
|
+
}
|
|
694
|
+
</ul>
|
|
695
|
+
</section>
|
|
696
|
+
} @empty {
|
|
697
|
+
<p class="cb-sched__empty">{{ t().schedulerNoEvents }}</p>
|
|
698
|
+
}
|
|
699
|
+
</div>
|
|
700
|
+
}
|
|
701
|
+
@default {
|
|
702
|
+
<div #scroll class="cb-sched__time" [style.--cb-sched-days]="days().length">
|
|
703
|
+
<div class="cb-sched__sticky">
|
|
704
|
+
<div class="cb-sched__time-head">
|
|
705
|
+
<span class="cb-sched__gutter" aria-hidden="true"></span>
|
|
706
|
+
@for (d of days(); track d.getTime()) {
|
|
707
|
+
<div class="cb-sched__col-head" [class.cb-sched__col-head--today]="isToday(d)">
|
|
708
|
+
<button type="button" class="cb-sched__col-day" [attr.aria-label]="fmt(t().schedulerOpenDay, longDay(d))" (click)="openDay(d)">
|
|
709
|
+
<span class="cb-sched__col-weekday">{{ weekday(d) }}</span>
|
|
710
|
+
<span class="cb-sched__col-num">{{ d.getDate() }}</span>
|
|
711
|
+
</button>
|
|
712
|
+
@if (editable()) {
|
|
713
|
+
<button type="button" class="cb-sched__add" [attr.aria-label]="fmt(t().schedulerNewEvent, longDay(d))" (click)="selectTime(d, scrollHour() * 60)">
|
|
714
|
+
<cb-icon name="plus" [size]="13" aria-hidden="true" />
|
|
715
|
+
</button>
|
|
716
|
+
}
|
|
717
|
+
</div>
|
|
718
|
+
}
|
|
719
|
+
</div>
|
|
720
|
+
<div class="cb-sched__allday">
|
|
721
|
+
<span class="cb-sched__gutter cb-sched__gutter--label">{{ t().schedulerAllDay }}</span>
|
|
722
|
+
@for (d of days(); track d.getTime()) {
|
|
723
|
+
<div class="cb-sched__allday-cell" [attr.data-date]="d.getTime()" data-day-only="true" [class.cb-sched__cell--drop]="dropDay()?.getTime() === d.getTime()" (dblclick)="selectDay(d)">
|
|
724
|
+
@for (e of allDayEvents(d); track e.event.id) {
|
|
725
|
+
<button
|
|
726
|
+
type="button"
|
|
727
|
+
class="cb-sched__chip cb-sched__chip--block"
|
|
728
|
+
[class.cb-is-dragging]="preview()?.id === e.event.id"
|
|
729
|
+
[style.--cb-sched-color]="e.event.color || null"
|
|
730
|
+
[attr.data-event-id]="e.event.id"
|
|
731
|
+
[attr.aria-label]="eventLabel(e)"
|
|
732
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
733
|
+
(pointerdown)="onEventPointerDown($event, e, 'move', d, true)"
|
|
734
|
+
(click)="onEventClick(e)"
|
|
735
|
+
(keydown)="onEventKeydown($event, e, true)"
|
|
736
|
+
>
|
|
737
|
+
<span class="cb-sched__chip-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
738
|
+
</button>
|
|
739
|
+
}
|
|
740
|
+
</div>
|
|
741
|
+
}
|
|
742
|
+
</div>
|
|
743
|
+
</div>
|
|
744
|
+
<div class="cb-sched__hours" [style.height.px]="24 * hour">
|
|
745
|
+
<div class="cb-sched__gutter cb-sched__gutter--hours" aria-hidden="true">
|
|
746
|
+
@for (h of hours; track h) {
|
|
747
|
+
<span class="cb-sched__hour-label" [style.top.px]="h * hour">{{ h ? hourLabel(h) : '' }}</span>
|
|
748
|
+
}
|
|
749
|
+
</div>
|
|
750
|
+
@for (d of days(); track d.getTime()) {
|
|
751
|
+
<div class="cb-sched__col" [attr.data-date]="d.getTime()" [class.cb-sched__col--today]="isToday(d)" (pointerdown)="onColumnPointerDown($event, d)">
|
|
752
|
+
@for (h of hours; track h) {
|
|
753
|
+
<span class="cb-sched__line" [style.top.px]="h * hour" aria-hidden="true"></span>
|
|
754
|
+
}
|
|
755
|
+
@if (isToday(d)) {
|
|
756
|
+
<span class="cb-sched__now" [style.top.px]="nowTop()" aria-hidden="true"></span>
|
|
757
|
+
}
|
|
758
|
+
@if (selection(); as s) {
|
|
759
|
+
@if (s.day.getTime() === d.getTime()) {
|
|
760
|
+
<span class="cb-sched__selection" [style.top.px]="s.from * ppm" [style.height.px]="(s.to - s.from) * ppm" aria-hidden="true">
|
|
761
|
+
{{ time(minuteDate(d, s.from)) }} – {{ time(minuteDate(d, s.to)) }}
|
|
762
|
+
</span>
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
@for (p of placed(d); track p.e.event.id) {
|
|
766
|
+
<button
|
|
767
|
+
type="button"
|
|
768
|
+
class="cb-sched__event"
|
|
769
|
+
[class.cb-is-dragging]="preview()?.id === p.e.event.id"
|
|
770
|
+
[class.cb-sched__event--short]="p.to - p.from < 45"
|
|
771
|
+
[style.--cb-sched-color]="p.e.event.color || null"
|
|
772
|
+
[style.top.px]="p.from * ppm"
|
|
773
|
+
[style.height.px]="Math.max(18, (p.to - p.from) * ppm - 2)"
|
|
774
|
+
[style.left]="'calc(' + (p.column / p.columns) * 100 + '% + 2px)'"
|
|
775
|
+
[style.width]="'calc(' + 100 / p.columns + '% - 4px)'"
|
|
776
|
+
[attr.data-event-id]="p.e.event.id"
|
|
777
|
+
[attr.aria-label]="eventLabel(p.e)"
|
|
778
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
779
|
+
(pointerdown)="onEventPointerDown($event, p.e, 'move', d, false)"
|
|
780
|
+
(click)="onEventClick(p.e)"
|
|
781
|
+
(keydown)="onEventKeydown($event, p.e, false)"
|
|
782
|
+
>
|
|
783
|
+
<span class="cb-sched__event-title" aria-hidden="true">{{ p.e.event.title }}</span>
|
|
784
|
+
<span class="cb-sched__event-time" aria-hidden="true">{{ time(p.e.start) }} – {{ time(p.e.end) }}</span>
|
|
785
|
+
@if (p.e.event.location && p.to - p.from >= 60) {
|
|
786
|
+
<span class="cb-sched__event-loc" aria-hidden="true">{{ p.e.event.location }}</span>
|
|
787
|
+
}
|
|
788
|
+
@if (editable() && !isMulti(p.e)) {
|
|
789
|
+
<span class="cb-sched__resize" data-resize="true" aria-hidden="true" (pointerdown)="onEventPointerDown($event, p.e, 'resize', d, false)"></span>
|
|
790
|
+
}
|
|
791
|
+
</button>
|
|
792
|
+
}
|
|
793
|
+
</div>
|
|
794
|
+
}
|
|
795
|
+
</div>
|
|
796
|
+
</div>
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
</div>
|
|
800
|
+
<p class="cb-sched__sr" [id]="uid + '-help'">{{ t().schedulerInstructions }}</p>
|
|
801
|
+
<div class="cb-sched__sr" role="status">{{ announcement() }}</div>
|
|
802
|
+
`, isInline: true, styles: [":host{--cb-sched-hour: 48px;--cb-sched-gutter: 3.5rem;--cb-sched-accent: var(--cb-color-primary-500);display:flex;flex-direction:column;gap:var(--cb-space-3, .75rem);width:100%;min-width:0;container-type:inline-size;color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm, .875rem)}.cb-sched__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem}.cb-sched__nav{display:flex;align-items:center;gap:.35rem;min-width:0}.cb-sched__title{margin:0 0 0 .5rem;overflow:hidden;font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}.cb-sched__btn,.cb-sched__icon-btn{display:inline-flex;align-items:center;justify-content:center;height:2rem;padding:0 .75rem;border:1px solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-sm, .875rem);cursor:pointer}.cb-sched__icon-btn{width:2rem;padding:0;border-color:transparent}:is(.cb-sched__btn,.cb-sched__icon-btn):hover{background:var(--cb-color-surface-hover)}.cb-sched__views{display:inline-flex;padding:2px;border-radius:var(--cb-radius-md);background:var(--cb-color-surface-hover)}.cb-sched__view{padding:.3rem .75rem;border:0;border-radius:calc(var(--cb-radius-md) - 2px);background:transparent;color:var(--cb-color-text-muted);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-medium, 500);cursor:pointer}.cb-sched__view[aria-pressed=true]{background:var(--cb-color-surface-raised);color:var(--cb-color-text-strong, var(--cb-color-text));box-shadow:0 1px 2px #0f172a1f}:is(.cb-sched__btn,.cb-sched__icon-btn,.cb-sched__view,.cb-sched__day-num,.cb-sched__add,.cb-sched__chip,.cb-sched__more,.cb-sched__event,.cb-sched__col-day,.cb-sched__agenda-item):focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-sched__body{display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 12px);background:var(--cb-color-surface)}.cb-sched__month{display:flex;flex:1;flex-direction:column;min-height:0}.cb-sched__month-head,.cb-sched__week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.cb-sched__month-head{border-bottom:1px solid var(--cb-color-border)}.cb-sched__weekday{padding:.45rem;color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);text-align:center;text-transform:capitalize}.cb-sched__week{flex:1;min-height:5.5rem;border-bottom:1px solid var(--cb-color-border)}.cb-sched__week:last-child{border-bottom:0}.cb-sched__cell{display:flex;flex-direction:column;gap:2px;min-width:0;padding:.25rem;overflow:hidden;border-right:1px solid var(--cb-color-border)}.cb-sched__cell:last-child{border-right:0}.cb-sched__cell--outside{background:var(--cb-color-surface-subtle, var(--cb-color-surface-hover))}.cb-sched__cell--outside .cb-sched__day-num{color:var(--cb-color-text-muted)}.cb-sched__cell--drop{background:color-mix(in srgb,var(--cb-sched-accent) 10%,transparent);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--cb-sched-accent) 40%,transparent)}.cb-sched__cell-head{display:flex;align-items:center;justify-content:space-between}.cb-sched__day-num{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;height:1.6rem;padding:0 .3rem;border:0;border-radius:999px;background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);cursor:pointer}.cb-sched__day-num:hover{background:var(--cb-color-surface-hover)}.cb-sched__cell--today .cb-sched__day-num{background:var(--cb-sched-accent);color:var(--cb-color-primary-contrast, #fff)}.cb-sched__add{display:inline-flex;align-items:center;justify-content:center;width:1.4rem;height:1.4rem;padding:0;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;opacity:0}:is(.cb-sched__cell,.cb-sched__col-head):hover .cb-sched__add,.cb-sched__add:focus-visible{opacity:1}@media(hover:none){.cb-sched__add{opacity:1}}.cb-sched__chip{--_c: var(--cb-sched-color, var(--cb-sched-accent));display:flex;align-items:center;gap:.3rem;width:100%;min-width:0;padding:.1rem .35rem;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);text-align:start;cursor:pointer;touch-action:none}.cb-sched__chip:hover{background:var(--cb-color-surface-hover)}.cb-sched__chip--block{background:color-mix(in srgb,var(--_c) 18%,var(--cb-color-surface));box-shadow:inset 3px 0 0 var(--_c);font-weight:var(--cb-font-weight-medium, 500)}.cb-sched__chip--block:hover{background:color-mix(in srgb,var(--_c) 26%,var(--cb-color-surface))}.cb-sched__dot{flex:none;width:.5rem;height:.5rem;border-radius:50%;background:var(--cb-sched-color, var(--cb-sched-accent))}.cb-sched__chip-time{flex:none;color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums}.cb-sched__chip-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cb-sched__more{align-self:flex-start;padding:.05rem .35rem;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);cursor:pointer}.cb-sched__more:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-sched__time{position:relative;flex:1;min-height:0;overflow-y:auto}@container (max-width: 40rem){.cb-sched__time{--_min: calc(var(--cb-sched-gutter) + var(--cb-sched-days) * 4.5rem);overflow-x:auto}.cb-sched__sticky,.cb-sched__time-head,.cb-sched__allday,.cb-sched__hours{min-width:var(--_min)}.cb-sched__time .cb-sched__gutter{position:sticky;left:0;z-index:3;background:var(--cb-color-surface)}}.cb-sched__sticky{position:sticky;top:0;z-index:5;background:var(--cb-color-surface)}.cb-sched__time-head,.cb-sched__allday,.cb-sched__hours{display:grid;grid-template-columns:var(--cb-sched-gutter) repeat(var(--cb-sched-days),minmax(0,1fr))}.cb-sched__time-head{border-bottom:1px solid var(--cb-color-border)}.cb-sched__col-head{display:flex;align-items:center;justify-content:center;gap:.15rem;padding:.35rem .25rem;border-left:1px solid var(--cb-color-border)}.cb-sched__col-day{display:inline-flex;flex-direction:column;align-items:center;padding:.15rem .4rem;border:0;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);font:inherit;cursor:pointer}.cb-sched__col-day:hover{background:var(--cb-color-surface-hover)}.cb-sched__col-weekday{font-size:var(--cb-text-xs, .75rem);text-transform:capitalize}.cb-sched__col-num{color:var(--cb-color-text);font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:1.2}.cb-sched__col-head--today .cb-sched__col-weekday,.cb-sched__col-head--today .cb-sched__col-num{color:var(--cb-color-primary-600, var(--cb-sched-accent))}.cb-sched__allday{border-bottom:1px solid var(--cb-color-border)}.cb-sched__gutter--label{display:flex;align-items:center;justify-content:flex-end;padding-right:.4rem;color:var(--cb-color-text-muted);font-size:.6875rem;text-align:right}.cb-sched__allday-cell{display:flex;flex-direction:column;gap:2px;min-width:0;min-height:1.9rem;padding:.2rem;border-left:1px solid var(--cb-color-border)}.cb-sched__hours,.cb-sched__gutter--hours{position:relative}.cb-sched__hour-label{position:absolute;right:.4rem;margin-top:-.5em;color:var(--cb-color-text-muted);font-size:.6875rem;font-variant-numeric:tabular-nums}.cb-sched__col{position:relative;border-left:1px solid var(--cb-color-border);cursor:cell}:host(.cb-scheduler--readonly) .cb-sched__col{cursor:default}.cb-sched__col--today{background:color-mix(in srgb,var(--cb-sched-accent) 4%,transparent)}.cb-sched__line{position:absolute;right:0;left:0;border-top:1px solid color-mix(in srgb,var(--cb-color-border) 70%,transparent);pointer-events:none}.cb-sched__now{position:absolute;right:0;left:0;z-index:3;border-top:2px solid var(--cb-color-danger-500, #ef4444);pointer-events:none}.cb-sched__now:before{content:\"\";position:absolute;top:-6px;left:-5px;width:10px;height:10px;border-radius:50%;background:var(--cb-color-danger-500, #ef4444)}.cb-sched__selection{position:absolute;right:2px;left:2px;z-index:2;padding:.15rem .35rem;border:2px dashed var(--cb-sched-accent);border-radius:var(--cb-radius-sm);background:color-mix(in srgb,var(--cb-sched-accent) 14%,transparent);color:var(--cb-color-primary-700, var(--cb-color-text));font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);pointer-events:none}.cb-sched__event{--_c: var(--cb-sched-color, var(--cb-sched-accent));position:absolute;z-index:1;display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;min-width:0;padding:.2rem .4rem;overflow:hidden;border:0;border-left:3px solid var(--_c);border-radius:var(--cb-radius-sm);background:color-mix(in srgb,var(--_c) 20%,var(--cb-color-surface));color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);text-align:start;cursor:grab;touch-action:none}.cb-sched__event:hover{z-index:2;background:color-mix(in srgb,var(--_c) 28%,var(--cb-color-surface))}:host(.cb-scheduler--readonly) .cb-sched__event,:host(.cb-scheduler--readonly) .cb-sched__chip{cursor:pointer}.cb-is-dragging{z-index:4!important;opacity:.85;box-shadow:0 6px 18px #0f172a38;cursor:grabbing}.cb-sched__event-title{max-width:100%;overflow:hidden;font-weight:var(--cb-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}.cb-sched__event-time,.cb-sched__event-loc{max-width:100%;overflow:hidden;color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.cb-sched__event--short{flex-direction:row;gap:.35rem;align-items:center;padding-top:0;padding-bottom:0}.cb-sched__resize{position:absolute;right:0;bottom:0;left:0;height:6px;cursor:ns-resize}.cb-sched__agenda{flex:1;min-height:0;padding:.25rem 0;overflow-y:auto}.cb-sched__agenda-day{display:grid;grid-template-columns:11rem minmax(0,1fr);gap:.5rem;padding:.6rem 1rem;border-bottom:1px solid var(--cb-color-border)}.cb-sched__agenda-day:last-child{border-bottom:0}.cb-sched__agenda-date{display:flex;align-items:baseline;gap:.5rem;margin:0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-sched__agenda-num{color:var(--cb-color-text);font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600)}.cb-sched__agenda-date--today .cb-sched__agenda-num{color:var(--cb-color-primary-600, var(--cb-sched-accent))}.cb-sched__agenda-list{display:grid;gap:2px;margin:0;padding:0;list-style:none}.cb-sched__agenda-item{display:grid;grid-template-columns:auto 8rem minmax(0,1fr) auto;align-items:center;gap:.6rem;width:100%;padding:.4rem .5rem;border:0;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text);font:inherit;text-align:start;cursor:pointer}.cb-sched__agenda-item:hover{background:var(--cb-color-surface-hover)}.cb-sched__agenda-time{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums}.cb-sched__agenda-title{overflow:hidden;font-weight:var(--cb-font-weight-medium, 500);text-overflow:ellipsis;white-space:nowrap}.cb-sched__agenda-loc{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}@media(max-width:40rem){.cb-sched__agenda-day{grid-template-columns:minmax(0,1fr)}.cb-sched__agenda-item{grid-template-columns:auto minmax(0,1fr)}.cb-sched__agenda-time,.cb-sched__agenda-loc{grid-column:2}}.cb-sched__empty{margin:0;padding:2rem;color:var(--cb-color-text-muted);text-align:center}.cb-sched__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}@media(forced-colors:active){.cb-sched__event,.cb-sched__chip--block{border:1px solid CanvasText}}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
803
|
+
}
|
|
804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbScheduler, decorators: [{
|
|
805
|
+
type: Component,
|
|
806
|
+
args: [{ selector: 'cb-scheduler', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-scheduler', '[class.cb-scheduler--readonly]': '!editable()' }, template: `
|
|
807
|
+
<div class="cb-sched__toolbar">
|
|
808
|
+
<div class="cb-sched__nav">
|
|
809
|
+
<button type="button" class="cb-sched__icon-btn" [attr.aria-label]="t().schedulerPrevious" (click)="step(-1)">
|
|
810
|
+
<cb-icon name="chevron-left" [size]="18" aria-hidden="true" />
|
|
811
|
+
</button>
|
|
812
|
+
<button type="button" class="cb-sched__btn" (click)="goToday()">{{ t().today }}</button>
|
|
813
|
+
<button type="button" class="cb-sched__icon-btn" [attr.aria-label]="t().schedulerNext" (click)="step(1)">
|
|
814
|
+
<cb-icon name="chevron-right" [size]="18" aria-hidden="true" />
|
|
815
|
+
</button>
|
|
816
|
+
<h2 class="cb-sched__title" aria-live="polite">{{ title() }}</h2>
|
|
817
|
+
</div>
|
|
818
|
+
<div class="cb-sched__views" role="group" [attr.aria-label]="t().schedulerViews">
|
|
819
|
+
@for (v of views(); track v) {
|
|
820
|
+
<button type="button" class="cb-sched__view" [attr.aria-pressed]="view() === v" (click)="view.set(v)">{{ viewLabel(v) }}</button>
|
|
821
|
+
}
|
|
822
|
+
</div>
|
|
823
|
+
</div>
|
|
824
|
+
|
|
825
|
+
<div class="cb-sched__body" [style.height]="height()" (pointermove)="onPointerMove($event)" (pointerup)="onPointerUp()" (pointercancel)="cancelDrag()">
|
|
826
|
+
@switch (view()) {
|
|
827
|
+
@case ('month') {
|
|
828
|
+
<div class="cb-sched__month" role="grid" [attr.aria-label]="title()">
|
|
829
|
+
<div class="cb-sched__month-head" role="row">
|
|
830
|
+
@for (name of weekdayNames(); track $index) {
|
|
831
|
+
<span class="cb-sched__weekday" role="columnheader">{{ name }}</span>
|
|
832
|
+
}
|
|
833
|
+
</div>
|
|
834
|
+
@for (week of weeks(); track $index) {
|
|
835
|
+
<div class="cb-sched__week" role="row">
|
|
836
|
+
@for (d of week; track d.getTime()) {
|
|
837
|
+
<div
|
|
838
|
+
class="cb-sched__cell"
|
|
839
|
+
role="gridcell"
|
|
840
|
+
[attr.data-date]="d.getTime()"
|
|
841
|
+
data-day-only="true"
|
|
842
|
+
[class.cb-sched__cell--outside]="d.getMonth() !== date().getMonth()"
|
|
843
|
+
[class.cb-sched__cell--today]="isToday(d)"
|
|
844
|
+
[class.cb-sched__cell--drop]="dropDay()?.getTime() === d.getTime()"
|
|
845
|
+
(dblclick)="selectDay(d)"
|
|
846
|
+
>
|
|
847
|
+
<div class="cb-sched__cell-head">
|
|
848
|
+
<button type="button" class="cb-sched__day-num" [attr.aria-label]="fmt(t().schedulerOpenDay, longDay(d))" (click)="openDay(d)">{{ d.getDate() }}</button>
|
|
849
|
+
@if (editable()) {
|
|
850
|
+
<button type="button" class="cb-sched__add" [attr.aria-label]="fmt(t().schedulerNewEvent, longDay(d))" (click)="selectDay(d)">
|
|
851
|
+
<cb-icon name="plus" [size]="13" aria-hidden="true" />
|
|
852
|
+
</button>
|
|
853
|
+
}
|
|
854
|
+
</div>
|
|
855
|
+
@for (e of dayEvents(d).slice(0, limitFor(d)); track e.event.id) {
|
|
856
|
+
<button
|
|
857
|
+
type="button"
|
|
858
|
+
class="cb-sched__chip"
|
|
859
|
+
[class.cb-sched__chip--block]="e.allDay || isMulti(e)"
|
|
860
|
+
[class.cb-is-dragging]="preview()?.id === e.event.id"
|
|
861
|
+
[style.--cb-sched-color]="e.event.color || null"
|
|
862
|
+
[attr.data-event-id]="e.event.id"
|
|
863
|
+
[attr.aria-label]="eventLabel(e)"
|
|
864
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
865
|
+
(pointerdown)="onEventPointerDown($event, e, 'move', d, true)"
|
|
866
|
+
(click)="onEventClick(e)"
|
|
867
|
+
(keydown)="onEventKeydown($event, e, true)"
|
|
868
|
+
>
|
|
869
|
+
@if (!e.allDay && !isMulti(e)) {
|
|
870
|
+
<span class="cb-sched__dot" aria-hidden="true"></span>
|
|
871
|
+
<span class="cb-sched__chip-time" aria-hidden="true">{{ time(e.start) }}</span>
|
|
872
|
+
}
|
|
873
|
+
<span class="cb-sched__chip-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
874
|
+
</button>
|
|
875
|
+
}
|
|
876
|
+
@if (dayEvents(d).length > limitFor(d)) {
|
|
877
|
+
<button type="button" class="cb-sched__more" [attr.aria-label]="fmt(t().schedulerMoreLabel, dayEvents(d).length - limitFor(d), longDay(d))" (click)="openDay(d)">
|
|
878
|
+
{{ fmt(t().schedulerMore, dayEvents(d).length - limitFor(d)) }}
|
|
879
|
+
</button>
|
|
880
|
+
}
|
|
881
|
+
</div>
|
|
882
|
+
}
|
|
883
|
+
</div>
|
|
884
|
+
}
|
|
885
|
+
</div>
|
|
886
|
+
}
|
|
887
|
+
@case ('agenda') {
|
|
888
|
+
<div class="cb-sched__agenda">
|
|
889
|
+
@for (group of agenda(); track group.day.getTime()) {
|
|
890
|
+
<section class="cb-sched__agenda-day" [attr.aria-label]="longDay(group.day)">
|
|
891
|
+
<h3 class="cb-sched__agenda-date" [class.cb-sched__agenda-date--today]="isToday(group.day)">
|
|
892
|
+
<span class="cb-sched__agenda-num">{{ group.day.getDate() }}</span>
|
|
893
|
+
<span>{{ agendaDay(group.day) }}</span>
|
|
894
|
+
</h3>
|
|
895
|
+
<ul class="cb-sched__agenda-list">
|
|
896
|
+
@for (e of group.events; track e.event.id) {
|
|
897
|
+
<li>
|
|
898
|
+
<button type="button" class="cb-sched__agenda-item" [style.--cb-sched-color]="e.event.color || null" [attr.aria-label]="eventLabel(e)" (click)="eventOpen.emit(e.event)">
|
|
899
|
+
<span class="cb-sched__dot" aria-hidden="true"></span>
|
|
900
|
+
<span class="cb-sched__agenda-time" aria-hidden="true">{{ e.allDay ? t().schedulerAllDay : time(e.start) + ' – ' + time(e.end) }}</span>
|
|
901
|
+
<span class="cb-sched__agenda-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
902
|
+
@if (e.event.location) {
|
|
903
|
+
<span class="cb-sched__agenda-loc" aria-hidden="true">{{ e.event.location }}</span>
|
|
904
|
+
}
|
|
905
|
+
</button>
|
|
906
|
+
</li>
|
|
907
|
+
}
|
|
908
|
+
</ul>
|
|
909
|
+
</section>
|
|
910
|
+
} @empty {
|
|
911
|
+
<p class="cb-sched__empty">{{ t().schedulerNoEvents }}</p>
|
|
912
|
+
}
|
|
913
|
+
</div>
|
|
914
|
+
}
|
|
915
|
+
@default {
|
|
916
|
+
<div #scroll class="cb-sched__time" [style.--cb-sched-days]="days().length">
|
|
917
|
+
<div class="cb-sched__sticky">
|
|
918
|
+
<div class="cb-sched__time-head">
|
|
919
|
+
<span class="cb-sched__gutter" aria-hidden="true"></span>
|
|
920
|
+
@for (d of days(); track d.getTime()) {
|
|
921
|
+
<div class="cb-sched__col-head" [class.cb-sched__col-head--today]="isToday(d)">
|
|
922
|
+
<button type="button" class="cb-sched__col-day" [attr.aria-label]="fmt(t().schedulerOpenDay, longDay(d))" (click)="openDay(d)">
|
|
923
|
+
<span class="cb-sched__col-weekday">{{ weekday(d) }}</span>
|
|
924
|
+
<span class="cb-sched__col-num">{{ d.getDate() }}</span>
|
|
925
|
+
</button>
|
|
926
|
+
@if (editable()) {
|
|
927
|
+
<button type="button" class="cb-sched__add" [attr.aria-label]="fmt(t().schedulerNewEvent, longDay(d))" (click)="selectTime(d, scrollHour() * 60)">
|
|
928
|
+
<cb-icon name="plus" [size]="13" aria-hidden="true" />
|
|
929
|
+
</button>
|
|
930
|
+
}
|
|
931
|
+
</div>
|
|
932
|
+
}
|
|
933
|
+
</div>
|
|
934
|
+
<div class="cb-sched__allday">
|
|
935
|
+
<span class="cb-sched__gutter cb-sched__gutter--label">{{ t().schedulerAllDay }}</span>
|
|
936
|
+
@for (d of days(); track d.getTime()) {
|
|
937
|
+
<div class="cb-sched__allday-cell" [attr.data-date]="d.getTime()" data-day-only="true" [class.cb-sched__cell--drop]="dropDay()?.getTime() === d.getTime()" (dblclick)="selectDay(d)">
|
|
938
|
+
@for (e of allDayEvents(d); track e.event.id) {
|
|
939
|
+
<button
|
|
940
|
+
type="button"
|
|
941
|
+
class="cb-sched__chip cb-sched__chip--block"
|
|
942
|
+
[class.cb-is-dragging]="preview()?.id === e.event.id"
|
|
943
|
+
[style.--cb-sched-color]="e.event.color || null"
|
|
944
|
+
[attr.data-event-id]="e.event.id"
|
|
945
|
+
[attr.aria-label]="eventLabel(e)"
|
|
946
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
947
|
+
(pointerdown)="onEventPointerDown($event, e, 'move', d, true)"
|
|
948
|
+
(click)="onEventClick(e)"
|
|
949
|
+
(keydown)="onEventKeydown($event, e, true)"
|
|
950
|
+
>
|
|
951
|
+
<span class="cb-sched__chip-title" aria-hidden="true">{{ e.event.title }}</span>
|
|
952
|
+
</button>
|
|
953
|
+
}
|
|
954
|
+
</div>
|
|
955
|
+
}
|
|
956
|
+
</div>
|
|
957
|
+
</div>
|
|
958
|
+
<div class="cb-sched__hours" [style.height.px]="24 * hour">
|
|
959
|
+
<div class="cb-sched__gutter cb-sched__gutter--hours" aria-hidden="true">
|
|
960
|
+
@for (h of hours; track h) {
|
|
961
|
+
<span class="cb-sched__hour-label" [style.top.px]="h * hour">{{ h ? hourLabel(h) : '' }}</span>
|
|
962
|
+
}
|
|
963
|
+
</div>
|
|
964
|
+
@for (d of days(); track d.getTime()) {
|
|
965
|
+
<div class="cb-sched__col" [attr.data-date]="d.getTime()" [class.cb-sched__col--today]="isToday(d)" (pointerdown)="onColumnPointerDown($event, d)">
|
|
966
|
+
@for (h of hours; track h) {
|
|
967
|
+
<span class="cb-sched__line" [style.top.px]="h * hour" aria-hidden="true"></span>
|
|
968
|
+
}
|
|
969
|
+
@if (isToday(d)) {
|
|
970
|
+
<span class="cb-sched__now" [style.top.px]="nowTop()" aria-hidden="true"></span>
|
|
971
|
+
}
|
|
972
|
+
@if (selection(); as s) {
|
|
973
|
+
@if (s.day.getTime() === d.getTime()) {
|
|
974
|
+
<span class="cb-sched__selection" [style.top.px]="s.from * ppm" [style.height.px]="(s.to - s.from) * ppm" aria-hidden="true">
|
|
975
|
+
{{ time(minuteDate(d, s.from)) }} – {{ time(minuteDate(d, s.to)) }}
|
|
976
|
+
</span>
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
@for (p of placed(d); track p.e.event.id) {
|
|
980
|
+
<button
|
|
981
|
+
type="button"
|
|
982
|
+
class="cb-sched__event"
|
|
983
|
+
[class.cb-is-dragging]="preview()?.id === p.e.event.id"
|
|
984
|
+
[class.cb-sched__event--short]="p.to - p.from < 45"
|
|
985
|
+
[style.--cb-sched-color]="p.e.event.color || null"
|
|
986
|
+
[style.top.px]="p.from * ppm"
|
|
987
|
+
[style.height.px]="Math.max(18, (p.to - p.from) * ppm - 2)"
|
|
988
|
+
[style.left]="'calc(' + (p.column / p.columns) * 100 + '% + 2px)'"
|
|
989
|
+
[style.width]="'calc(' + 100 / p.columns + '% - 4px)'"
|
|
990
|
+
[attr.data-event-id]="p.e.event.id"
|
|
991
|
+
[attr.aria-label]="eventLabel(p.e)"
|
|
992
|
+
[attr.aria-describedby]="editable() ? uid + '-help' : null"
|
|
993
|
+
(pointerdown)="onEventPointerDown($event, p.e, 'move', d, false)"
|
|
994
|
+
(click)="onEventClick(p.e)"
|
|
995
|
+
(keydown)="onEventKeydown($event, p.e, false)"
|
|
996
|
+
>
|
|
997
|
+
<span class="cb-sched__event-title" aria-hidden="true">{{ p.e.event.title }}</span>
|
|
998
|
+
<span class="cb-sched__event-time" aria-hidden="true">{{ time(p.e.start) }} – {{ time(p.e.end) }}</span>
|
|
999
|
+
@if (p.e.event.location && p.to - p.from >= 60) {
|
|
1000
|
+
<span class="cb-sched__event-loc" aria-hidden="true">{{ p.e.event.location }}</span>
|
|
1001
|
+
}
|
|
1002
|
+
@if (editable() && !isMulti(p.e)) {
|
|
1003
|
+
<span class="cb-sched__resize" data-resize="true" aria-hidden="true" (pointerdown)="onEventPointerDown($event, p.e, 'resize', d, false)"></span>
|
|
1004
|
+
}
|
|
1005
|
+
</button>
|
|
1006
|
+
}
|
|
1007
|
+
</div>
|
|
1008
|
+
}
|
|
1009
|
+
</div>
|
|
1010
|
+
</div>
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
</div>
|
|
1014
|
+
<p class="cb-sched__sr" [id]="uid + '-help'">{{ t().schedulerInstructions }}</p>
|
|
1015
|
+
<div class="cb-sched__sr" role="status">{{ announcement() }}</div>
|
|
1016
|
+
`, styles: [":host{--cb-sched-hour: 48px;--cb-sched-gutter: 3.5rem;--cb-sched-accent: var(--cb-color-primary-500);display:flex;flex-direction:column;gap:var(--cb-space-3, .75rem);width:100%;min-width:0;container-type:inline-size;color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:var(--cb-text-sm, .875rem)}.cb-sched__toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem}.cb-sched__nav{display:flex;align-items:center;gap:.35rem;min-width:0}.cb-sched__title{margin:0 0 0 .5rem;overflow:hidden;font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}.cb-sched__btn,.cb-sched__icon-btn{display:inline-flex;align-items:center;justify-content:center;height:2rem;padding:0 .75rem;border:1px solid var(--cb-color-border-strong);border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-sm, .875rem);cursor:pointer}.cb-sched__icon-btn{width:2rem;padding:0;border-color:transparent}:is(.cb-sched__btn,.cb-sched__icon-btn):hover{background:var(--cb-color-surface-hover)}.cb-sched__views{display:inline-flex;padding:2px;border-radius:var(--cb-radius-md);background:var(--cb-color-surface-hover)}.cb-sched__view{padding:.3rem .75rem;border:0;border-radius:calc(var(--cb-radius-md) - 2px);background:transparent;color:var(--cb-color-text-muted);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-medium, 500);cursor:pointer}.cb-sched__view[aria-pressed=true]{background:var(--cb-color-surface-raised);color:var(--cb-color-text-strong, var(--cb-color-text));box-shadow:0 1px 2px #0f172a1f}:is(.cb-sched__btn,.cb-sched__icon-btn,.cb-sched__view,.cb-sched__day-num,.cb-sched__add,.cb-sched__chip,.cb-sched__more,.cb-sched__event,.cb-sched__col-day,.cb-sched__agenda-item):focus-visible{outline:2px solid var(--cb-color-focus-ring);outline-offset:1px}.cb-sched__body{display:flex;flex-direction:column;min-height:0;overflow:hidden;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, 12px);background:var(--cb-color-surface)}.cb-sched__month{display:flex;flex:1;flex-direction:column;min-height:0}.cb-sched__month-head,.cb-sched__week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.cb-sched__month-head{border-bottom:1px solid var(--cb-color-border)}.cb-sched__weekday{padding:.45rem;color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);text-align:center;text-transform:capitalize}.cb-sched__week{flex:1;min-height:5.5rem;border-bottom:1px solid var(--cb-color-border)}.cb-sched__week:last-child{border-bottom:0}.cb-sched__cell{display:flex;flex-direction:column;gap:2px;min-width:0;padding:.25rem;overflow:hidden;border-right:1px solid var(--cb-color-border)}.cb-sched__cell:last-child{border-right:0}.cb-sched__cell--outside{background:var(--cb-color-surface-subtle, var(--cb-color-surface-hover))}.cb-sched__cell--outside .cb-sched__day-num{color:var(--cb-color-text-muted)}.cb-sched__cell--drop{background:color-mix(in srgb,var(--cb-sched-accent) 10%,transparent);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--cb-sched-accent) 40%,transparent)}.cb-sched__cell-head{display:flex;align-items:center;justify-content:space-between}.cb-sched__day-num{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;height:1.6rem;padding:0 .3rem;border:0;border-radius:999px;background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);cursor:pointer}.cb-sched__day-num:hover{background:var(--cb-color-surface-hover)}.cb-sched__cell--today .cb-sched__day-num{background:var(--cb-sched-accent);color:var(--cb-color-primary-contrast, #fff)}.cb-sched__add{display:inline-flex;align-items:center;justify-content:center;width:1.4rem;height:1.4rem;padding:0;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);cursor:pointer;opacity:0}:is(.cb-sched__cell,.cb-sched__col-head):hover .cb-sched__add,.cb-sched__add:focus-visible{opacity:1}@media(hover:none){.cb-sched__add{opacity:1}}.cb-sched__chip{--_c: var(--cb-sched-color, var(--cb-sched-accent));display:flex;align-items:center;gap:.3rem;width:100%;min-width:0;padding:.1rem .35rem;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);text-align:start;cursor:pointer;touch-action:none}.cb-sched__chip:hover{background:var(--cb-color-surface-hover)}.cb-sched__chip--block{background:color-mix(in srgb,var(--_c) 18%,var(--cb-color-surface));box-shadow:inset 3px 0 0 var(--_c);font-weight:var(--cb-font-weight-medium, 500)}.cb-sched__chip--block:hover{background:color-mix(in srgb,var(--_c) 26%,var(--cb-color-surface))}.cb-sched__dot{flex:none;width:.5rem;height:.5rem;border-radius:50%;background:var(--cb-sched-color, var(--cb-sched-accent))}.cb-sched__chip-time{flex:none;color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums}.cb-sched__chip-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cb-sched__more{align-self:flex-start;padding:.05rem .35rem;border:0;border-radius:var(--cb-radius-sm);background:transparent;color:var(--cb-color-text-muted);font:inherit;font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);cursor:pointer}.cb-sched__more:hover{background:var(--cb-color-surface-hover);color:var(--cb-color-text)}.cb-sched__time{position:relative;flex:1;min-height:0;overflow-y:auto}@container (max-width: 40rem){.cb-sched__time{--_min: calc(var(--cb-sched-gutter) + var(--cb-sched-days) * 4.5rem);overflow-x:auto}.cb-sched__sticky,.cb-sched__time-head,.cb-sched__allday,.cb-sched__hours{min-width:var(--_min)}.cb-sched__time .cb-sched__gutter{position:sticky;left:0;z-index:3;background:var(--cb-color-surface)}}.cb-sched__sticky{position:sticky;top:0;z-index:5;background:var(--cb-color-surface)}.cb-sched__time-head,.cb-sched__allday,.cb-sched__hours{display:grid;grid-template-columns:var(--cb-sched-gutter) repeat(var(--cb-sched-days),minmax(0,1fr))}.cb-sched__time-head{border-bottom:1px solid var(--cb-color-border)}.cb-sched__col-head{display:flex;align-items:center;justify-content:center;gap:.15rem;padding:.35rem .25rem;border-left:1px solid var(--cb-color-border)}.cb-sched__col-day{display:inline-flex;flex-direction:column;align-items:center;padding:.15rem .4rem;border:0;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text-muted);font:inherit;cursor:pointer}.cb-sched__col-day:hover{background:var(--cb-color-surface-hover)}.cb-sched__col-weekday{font-size:var(--cb-text-xs, .75rem);text-transform:capitalize}.cb-sched__col-num{color:var(--cb-color-text);font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);line-height:1.2}.cb-sched__col-head--today .cb-sched__col-weekday,.cb-sched__col-head--today .cb-sched__col-num{color:var(--cb-color-primary-600, var(--cb-sched-accent))}.cb-sched__allday{border-bottom:1px solid var(--cb-color-border)}.cb-sched__gutter--label{display:flex;align-items:center;justify-content:flex-end;padding-right:.4rem;color:var(--cb-color-text-muted);font-size:.6875rem;text-align:right}.cb-sched__allday-cell{display:flex;flex-direction:column;gap:2px;min-width:0;min-height:1.9rem;padding:.2rem;border-left:1px solid var(--cb-color-border)}.cb-sched__hours,.cb-sched__gutter--hours{position:relative}.cb-sched__hour-label{position:absolute;right:.4rem;margin-top:-.5em;color:var(--cb-color-text-muted);font-size:.6875rem;font-variant-numeric:tabular-nums}.cb-sched__col{position:relative;border-left:1px solid var(--cb-color-border);cursor:cell}:host(.cb-scheduler--readonly) .cb-sched__col{cursor:default}.cb-sched__col--today{background:color-mix(in srgb,var(--cb-sched-accent) 4%,transparent)}.cb-sched__line{position:absolute;right:0;left:0;border-top:1px solid color-mix(in srgb,var(--cb-color-border) 70%,transparent);pointer-events:none}.cb-sched__now{position:absolute;right:0;left:0;z-index:3;border-top:2px solid var(--cb-color-danger-500, #ef4444);pointer-events:none}.cb-sched__now:before{content:\"\";position:absolute;top:-6px;left:-5px;width:10px;height:10px;border-radius:50%;background:var(--cb-color-danger-500, #ef4444)}.cb-sched__selection{position:absolute;right:2px;left:2px;z-index:2;padding:.15rem .35rem;border:2px dashed var(--cb-sched-accent);border-radius:var(--cb-radius-sm);background:color-mix(in srgb,var(--cb-sched-accent) 14%,transparent);color:var(--cb-color-primary-700, var(--cb-color-text));font-size:var(--cb-text-xs, .75rem);font-weight:var(--cb-font-weight-semibold, 600);pointer-events:none}.cb-sched__event{--_c: var(--cb-sched-color, var(--cb-sched-accent));position:absolute;z-index:1;display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;min-width:0;padding:.2rem .4rem;overflow:hidden;border:0;border-left:3px solid var(--_c);border-radius:var(--cb-radius-sm);background:color-mix(in srgb,var(--_c) 20%,var(--cb-color-surface));color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-xs, .75rem);text-align:start;cursor:grab;touch-action:none}.cb-sched__event:hover{z-index:2;background:color-mix(in srgb,var(--_c) 28%,var(--cb-color-surface))}:host(.cb-scheduler--readonly) .cb-sched__event,:host(.cb-scheduler--readonly) .cb-sched__chip{cursor:pointer}.cb-is-dragging{z-index:4!important;opacity:.85;box-shadow:0 6px 18px #0f172a38;cursor:grabbing}.cb-sched__event-title{max-width:100%;overflow:hidden;font-weight:var(--cb-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}.cb-sched__event-time,.cb-sched__event-loc{max-width:100%;overflow:hidden;color:var(--cb-color-text-muted);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.cb-sched__event--short{flex-direction:row;gap:.35rem;align-items:center;padding-top:0;padding-bottom:0}.cb-sched__resize{position:absolute;right:0;bottom:0;left:0;height:6px;cursor:ns-resize}.cb-sched__agenda{flex:1;min-height:0;padding:.25rem 0;overflow-y:auto}.cb-sched__agenda-day{display:grid;grid-template-columns:11rem minmax(0,1fr);gap:.5rem;padding:.6rem 1rem;border-bottom:1px solid var(--cb-color-border)}.cb-sched__agenda-day:last-child{border-bottom:0}.cb-sched__agenda-date{display:flex;align-items:baseline;gap:.5rem;margin:0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-sched__agenda-num{color:var(--cb-color-text);font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600)}.cb-sched__agenda-date--today .cb-sched__agenda-num{color:var(--cb-color-primary-600, var(--cb-sched-accent))}.cb-sched__agenda-list{display:grid;gap:2px;margin:0;padding:0;list-style:none}.cb-sched__agenda-item{display:grid;grid-template-columns:auto 8rem minmax(0,1fr) auto;align-items:center;gap:.6rem;width:100%;padding:.4rem .5rem;border:0;border-radius:var(--cb-radius-md);background:transparent;color:var(--cb-color-text);font:inherit;text-align:start;cursor:pointer}.cb-sched__agenda-item:hover{background:var(--cb-color-surface-hover)}.cb-sched__agenda-time{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums}.cb-sched__agenda-title{overflow:hidden;font-weight:var(--cb-font-weight-medium, 500);text-overflow:ellipsis;white-space:nowrap}.cb-sched__agenda-loc{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}@media(max-width:40rem){.cb-sched__agenda-day{grid-template-columns:minmax(0,1fr)}.cb-sched__agenda-item{grid-template-columns:auto minmax(0,1fr)}.cb-sched__agenda-time,.cb-sched__agenda-loc{grid-column:2}}.cb-sched__empty{margin:0;padding:2rem;color:var(--cb-color-text-muted);text-align:center}.cb-sched__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}@media(forced-colors:active){.cb-sched__event,.cb-sched__chip--block{border:1px solid CanvasText}}\n"] }]
|
|
1017
|
+
}], ctorParameters: () => [], propDecorators: { events: [{ type: i0.Input, args: [{ isSignal: true, alias: "events", required: false }] }, { type: i0.Output, args: ["eventsChange"] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }, { type: i0.Output, args: ["viewChange"] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }, { type: i0.Output, args: ["dateChange"] }], views: [{ type: i0.Input, args: [{ isSignal: true, alias: "views", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], slotMinutes: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotMinutes", required: false }] }], scrollHour: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHour", required: false }] }], agendaDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "agendaDays", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], eventChange: [{ type: i0.Output, args: ["eventChange"] }], eventOpen: [{ type: i0.Output, args: ["eventOpen"] }], slotSelect: [{ type: i0.Output, args: ["slotSelect"] }], scrollRef: [{ type: i0.ViewChild, args: ['scroll', { isSignal: true }] }] } });
|
|
1018
|
+
|
|
1019
|
+
/*
|
|
1020
|
+
* Public API Surface de @caribeng/ui/scheduler
|
|
1021
|
+
*/
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Generated bundle index. Do not edit.
|
|
1025
|
+
*/
|
|
1026
|
+
|
|
1027
|
+
export { CbScheduler };
|